$30 off During Our Annual Pro Sale. View Details »

Too many metafiles and chest.js

Too many metafiles and chest.js

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

Daijiro Wachi

June 24, 2014
Tweet

More Decks by Daijiro Wachi

Other Decks in Programming

Transcript

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

    tvm, jsss • Bootstrap / Ratchet / Flight / Node <3
  2. 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:
  3. Tripling Each Year 0 1 2 3 5 6 7

    8 9 2012 2013 2014 Number of metafiles I use frequently
  4. 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…)
  5. 4 Problems • Ugly root directory • Init process growing

    increasingly complex • Need a "Package Manager" manager • Too many different types of commands
  6. • 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
  7. 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/
  8. 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;(
  9. Symbolic Link + .gitignore $ ls ./.meta - package.json -

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

    ./", "postinstall": "bower install" }, https://www.npmjs.org/doc/scripts.html
  11. 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/
  12. 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/
  13. 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/
  14. • 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
  15. 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
  16. 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
  17. chest.json { name: ‘node-gakuen’, description: ‘A school for node lovers’,

    version: ‘4.13.6’, scripts: { build: { usage: ‘build all file’, run: ‘grunt build’ } } }
  18. 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’ } } }
  19. 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’ } } }