JS Lab2017, 25 марта, Одесса
Андрей Кучеренко (Lead Software Engineer at EPAM Systems)
Разработка мультипакетных приложения: причины, способы, риски
Доклад раскроет тему разработки многопакетных приложений на javascript. Доклад сделан на основе реального опыта внедрения подобной разработки на проекте.
Все материалы: http://jslab.in.ua/
Организаторы: http://geekslab.org.ua/
5. Test Suites: 55 passed, 55 total
Tests: 303 passed, 303 total
Snapshots: 0 total
Time: 5.131s
Test Suites: 458 passed, 458 total
Tests: 3007 passed, 3007 total
Snapshots: 0 total
Time: 90.131s
|----------|
| % Lines |
|----------|
| 100|
Было СталоUnit Tests
Coverage
|----------|
| % Lines |
|----------|
| 89.7 |
$ tslint 'packages/*/{src/**/,test/**/}*.ts{,x}' --force
Done in 0.47s.
Found 0 exact clones with 0 duplicated lines in 0 files
0.0% (0 lines) duplicated lines out of 2302 total lines of code.
Done in 0.18s.
Took 2 min 56 sec on Jenkins
Linters
Duplications
CI
$ tslint 'packages/*/{src/**/,test/**/}*
Done in 19.47s.
Found 69 exact clones with 1467 duplicat
4.97% (1467 lines) duplicated lines out
Done in 2.75s.
Took 10 min 47 sec on Jenkins
18. Возможности @knitjs
Все зависимости в одном package.json
Нет node_modules в каждом репозитории
Показывает неиспользуемые и неустановленые
зависимости
19. ✗ create-knit-app lets-start-knitting
info creating a new knit app in lets-start-knitting
success finished creating your project!
info start exploring by running:
cd lets-start-knitting
yarn start
info read more about what you can do with knit:
info https://github.com/knitjs/knit
21. ➜ lets-start-knitting git:(master) ✗ yarn knit build
yarn knit v0.21.3
$ knit build
✔ discovering modules
✔ validating package.json
✔ discovering modules
✔ validating package.json
✔ check for missing dependencies
✔ check for unused dependencies
✔ reading package.json of modules
✔ getting last tag
✔ determining updated modules since last release
✔ rebuilding project
✔ rebuilding updated modules
✔ @myscope/body-component
✔ @myscope/header-component
✔ page-component
Done in 14.92s.
22. ➜ lets-start-knitting git:(master) ✗ yarn knit help
yarn knit v0.21.3
$ knit help
Commands:
list [modules...] list modules and their dependencies
validate validate modules for release
server start a dev server
schema update graphql schema
version <version> version updated modules
build build updated modules
stitch update the package.json of all modules with knitted
dependencies and project meta data
publish publish updated modules
release <version> run full release pipeline on updated modules.
version > build > knit > publish > push
23. ➜ lets-start-knitting git:(master) ✗ yarn knit list
yarn knit v0.21.3
$ knit list
✔ discovering modules
✔ reading package.json of modules
info showing dependencies for 3 modules
- @myscope/body-component (0.0.0) [2 dependencies]
- @myscope/header-component (0.0.0) [2 dependencies]
- page-component (0.0.0) [4 dependencies]
Done in 0.79s.
➜ lets-start-knitting git:(master) ✗ yarn knit validate
yarn knit v0.21.3
$ knit validate
✔ looking for `node_modules` in .*ignore files
✔ discovering modules
✔ validating package.json
✔ check for missing dependencies
✔ check for unused dependencies
Done in 0.87s.
24. Проблемы @knitjs
Работает только с babel, не поддерживает
typescript, coffeescript, etc.
Тяжело менять под свои нужды
Работа с версиями только в одном стиле
Не очень большое комьюнити