module web - Offirmo-team/wiki GitHub Wiki

Voir aussi npm, bower, git...

Introduction

...

echo 7 > .nvmrc
nvm install
onn
git_offirmo.sh
yarn init
echo "TODO" > CONTRIBUTING.md
printf "\n## Contributing\nSee CONTRIBUTING.md\n" >> README.md
yarn add lodash
yarn add -D typescript @types/lodash npm-run-all
yarn add -D @types/node
yarn add typescript-string-enums
yarn add -D nodemon pre-commit

Conception

Architecture

Technique

npm

node + browser

exports

AMD

Contenu

Création et .json

mkdir lib
npm init
bower init

puis ajouter :

touch package.json.txt bower.json.txt

Rappels sur package.json et bower.json

Ajouter des modules de base

npm install --save lodash amdefine
npm install --save jsen
npm install --save-dev pre-commit eslint nsp mocha chai sinon sinon-chai
npm install --save-dev bower jspm
npm install --save-dev karma karma-requirejs karma-mocha karma-phantomjs-launcher karma-chrome-launcher karma-firefox-launcher

npm install --save superagent superagent-no-cache superagent-mock superagent-cache

bower install --save lodash
bower install --save-dev mocha chai sinon-chai
bower install --save requirejs require-css requirejs-text require-dust requirejs-plugins domReady
bower install --save bootstrap underscore.string 
bower install --save superagent superagent-mock superagent-no-cache

Finir les inits

karma init

Ajouter des infos et des hooks : (exposition: voir https://github.com/defunctzombie/node-browser-resolve)

"main": "dist/es6.umd/index.js",
"jsnext:main": "dist/es7/index.js",
"typings": "dist/es6.umd/index.d.ts",
"browser": {
  "./main.js": "browser.js"
},
"chromeapp": {
  "./main.js": "custom-chromeapp.js"
}
"scripts": {
  "bower": "bower update --config.interactive=false",
  "lint": "eslint .",
  "nsp": "nsp audit-package",
  "test": "mocha blah blah"
},
"pre-commit": [
  "lint"
]

Fichiers de base

https://github.com/rafalchmiel/friction/wiki

touch CONTRIBUTING.md

Licence licence https://github.com/Offirmo/html_tests/blob/master/LICENSE

touch LICENSE
touch .gitignore
touch .editorconfig
touch .eslintignore
touch .eslintrc
touch .travis.yml

enregistrement

À faire une seule fois.

http://devhike.blogspot.fr/2013/06/how-to-register-your-library-or.html

bower register [app name] [git endpoint]
// example:
bower register raphael.backbone git://github.com/tomasAlabes/backbone.raphael.git
Registering a package will make it visible and installable via the registry.
Proceed (y/n)? y
registered backbone.raphael to git://github.com/tomasAlabes/backbone.raphael.git

Vérifs

bower list
npm outdated
npm run lint
npm run nsp
npm test
# https://docs.travis-ci.com/user/travis-lint
# gem install travis --no-rdoc --no-ri
travis lint

Versionnage

https://github.com/mikaelbr/mversion

git checkout master
git fetch && git pull
  1. status must be clear !
XXX minification (grunt ?)
mversion build -m
mversion patch -m
mversion minor -m
mversion major -m

envoi

git push
git push --tags
npm publish --access public

divers

Other interesting commands :

node --debug restlink_server.js
node tcpproxy.js 5858 localhost 8585
node --debug-brk=8585 --debug restlink_server.js
./node_modules/.bin/semver 0.9.2 -i minor
git add -u

mversion tague le repo. Mais si besoin de le faire manuellement :

git tag -a v0.9.1 -m 'version 0.9.1'
git tag -a v1.0.0 -m 'version 1.0.0'
git tag -a v2.0.0 -m 'version 2.0.0'
git tag -a v -m 'v'

http://packagequality.com/#?package=restlink

https://medium.com/@jdxcode/for-the-love-of-god-dont-use-npmignore-f93c08909d8d

https://ourcodeworld.com/articles/read/162/tips-and-tricks-that-you-probably-don-t-know-with-the-github-markdown-in-readme-md-files

https://github.com/stereobooster/package.json

⚠️ **GitHub.com Fallback** ⚠️