bespokejs / bespoke

DIY Presentation Micro-Framework
http://markdalgleish.com/projects/bespoke.js/
MIT License
4.69k stars 442 forks source link

Migrating plugins #44

Closed mcollina closed 10 years ago

mcollina commented 10 years ago

Hi @markdalgleish!

I would like to migrate bespoke-run. Do you have a guide, or a list of steps for migrating plugins to the new format easily?

Thanks!

mcollina commented 10 years ago

I ported my bespoke-run. Here are my steps (for future references)

  1. Updated the gulpfile (https://github.com/markdalgleish/bespoke-keys/blob/master/gulpfile.js)
  2. Change your plugin structure with the new module.exports syntax (https://github.com/markdalgleish/bespoke-keys/blob/master/lib/bespoke-keys.js#L1-L2)
  3. move your file to lib/bespoke-yourplugin.js
  4. Update all the references in gulpfile
  5. Update your demo so it references all the 'dist' builds (https://github.com/mcollina/bespoke-run/blob/master/demo/index.html#L41-L46)
  6. your demo should work!

If you have unit tests

  1. copy https://github.com/markdalgleish/bespoke-keys/blob/master/karma.conf.js
  2. Fix all the paths, move file around so that it matches what defined in gulpfile and karma.conf.
  3. Change how you require bespoke in the tests (https://github.com/mcollina/bespoke-run/commit/7a8d41b68a13d85c3765827a409ac8ddbcf4d165#diff-91a69ddc7c621c1bf13ed208a31cb35dR15)
  4. your tests should run fine!