Too many metafiles and chest.js

Too many metafiles and chest.js

東京Node学園 13時限目
「増え続けるmetafileが生む問題とchest.js」
http://nodejs.connpass.com/event/6763/

1d5ca7d8f17f15de4272e1ec7ef7abac?s=128

Daijirō Wachi

June 24, 2014
Tweet

Transcript

  1. Too Many Metafiles and chest.js @watilde

  2. @author • @watilde • npm publish / month • beeplay,

    tvm, jsss • Bootstrap / Ratchet / Flight / Node <3
  3. • PHP @work

  4. Main Subject "Too many metafiles"

  5. Front End
 Development Tools

  6. tool name file name npm • package.json • .npmrc •

    node_modules jshint • .jshintrc • .jshintignore Grunt • Gruntfile.js gulp • gulpfile.js editorconfig • .editorconfig bower • bower.json • .bowerrc component.io • component.json etc… have some metafiles:
  7. Tripling Each Year 0 1 2 3 5 6 7

    8 9 2012 2013 2014 Number of metafiles I use frequently
  8. Next Year: 27 Files!? 0 5 10 15 20 25

    30 2012 2013 2014 2015 Number of metafiles I use frequently Just kidding XD (maybe…)
  9. 4 Problems • Ugly root directory • Init process growing

    increasingly complex • Need a "Package Manager" manager • Too many different types of commands
  10. • Ugly root directory • Init process growing increasingly complex

    • Need a "Package Manager" manager • Too many different types of commands 4 Problems These are resolved by the current version of chest.js
  11. Ugly root directory •Routine example: $ cd ~/project/ $ ls

    .editorconfig .git/ .gitignore .travis.yml .jshintrc bower.json
 CONTRIBUTING.md Gruntfile.js 
 README.md bin/ lib/ package.json 
 power_assert.js spec/ src/
  12. Init process growing increasingly complex • Most users of these

    front end development tools are web designers • Many of them don’t like terminal • Have to run many commands;(
  13. Symbolic Link + .gitignore $ ls ./.meta - package.json -

    bower.json ! $ ln -s .meta/* ./ ! $ cat .gitignore ./package.json ./bower.json
  14. npm run-scripts // package.json "scripts": { "install": "ln -s .meta/*

    ./", "postinstall": "bower install" }, https://www.npmjs.org/doc/scripts.html
  15. Easier

  16. http://chestjs.com/ Enter chest.js

  17. Getting started

  18. e.g)
 General example project: $ cd ~/project/ $ ls .editorconfig

    .git/ .gitignore .travis.yml .jshintrc bower.json
 CONTRIBUTING.md Gruntfile.js 
 README.md bin/ lib/ package.json 
 power_assert.js spec/ src/
  19. Install chest command $ npm install -g chest $ chest

    ! @see ‘chest usage’
  20. Put metafiles in the chest $ chest put .editorconfig
 .travis.yml

    Gruntfile.js package.json power_assert.js ! $ ls .chest .git/ .gitignore
 CONTRIBUTING.md README.md
 bin/ lib/ spec/ src/
  21. Show list $ chest list .editorconfig
 .travis.yml bower.json Gruntfile.js package.json

    power_assert.js
  22. Create symbolic link $ chest open $ ls .editorconfig .git/

    .gitignore .travis.yml .jshintrc bower.json
 CONTRIBUTING.md Gruntfile.js 
 README.md bin/ lib/ package.json 
 power_assert.js spec/ src/
  23. Support install $ chest install ! run npm install run

    bower install
  24. Open & Install in postinstall $ cat package.json ɾɾɾ "scripts":

    { "postinstall": "chest boost" }, ɾɾɾ
  25. What’s next?

  26. • Ugly root directory • Init process growing increasingly complex

    • Need a "Package Manager" manager • Too many different types of commands 4 Problems Will resolve these in future versions of chest.js
  27. Need a
 "Package Manager" manager •Version, Name, Description, etc •Currently

    when updating one metafile, you have to changes all the others manually •Ideally, chest.js will manage this info with one base file
  28. Too many
 different types of commands •case(grunt || gulp) write

    usage •Others: npm-run-script, make, bash, etc •difficult to write usage •Challenging to ensure backward
 compatibility for commands
  29. chest.json { name: ‘node-gakuen’, description: ‘A school for node lovers’,

    version: ‘4.13.6’, scripts: { build: { usage: ‘build all file’, run: ‘grunt build’ } } }
  30. chest.json • chest syncɿsync both metainfo { name: ‘node-gakuen’, description:

    ‘A school for node lovers’, version: ‘0.0.1’, scripts: { build: { usage: ‘build all files’, run: ‘grunt build’ } } }
  31. chest.json •chest-run-scriptsɿcommand rapper required usage { name: ‘node-gakuen’, description: ‘A

    school for node lovers’, version: ‘0.0.1’, scripts: { build: { usage: ‘build all file’, run: ‘grunt build’ } } }
  32. http://chestjs.com/ < Thanks! Any questions?