Skip to content
Merged

BETA #939

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
2aa0f8f
feat(package): revamp plugin-tab
bmuenzenmeyer Jul 3, 2018
4ae13ce
fix(cli): support scoped plugins
bmuenzenmeyer Jul 3, 2018
0f227a3
fix(docs): update event info with tab example
bmuenzenmeyer Jul 3, 2018
0850fd6
feat(API): remove reliance on patternlab object during plugin install
bmuenzenmeyer Jul 3, 2018
197fc35
chore(core): WIP initialize plugins
bmuenzenmeyer Jul 3, 2018
44f0f8e
fix(plugins): support scoped packages
bmuenzenmeyer Jul 3, 2018
066e6c9
chore(core): WIP initialize plugins
bmuenzenmeyer Jul 3, 2018
0071a85
Merge branch 'dev' into plugin-work
bmuenzenmeyer Jul 3, 2018
5293975
chore(package): code cleanup
bmuenzenmeyer Jul 3, 2018
45583f8
fix(package): fix pathing and naming issues
bmuenzenmeyer Jul 3, 2018
bc2a0d3
chore(package): cleanup
bmuenzenmeyer Jul 3, 2018
29f0bb4
Make default config directory agnostic. Fix kepabCasing beaking installs
raphaelokon Jul 9, 2018
b92e62b
fix(package): Allow .json extension on annotations file (issue #836)
engelfrost Jul 10, 2018
4048bf9
Merge pull request #886 from engelfrost/rename-annotations-js
bmuenzenmeyer Jul 13, 2018
27bd4cd
fix(package): update mustache dependency
bmuenzenmeyer Jul 13, 2018
2b70ff4
fix(package): update tap dependency
bmuenzenmeyer Jul 13, 2018
5a58824
feat(core): remove plugin install / disable / enable logic
bmuenzenmeyer Jul 17, 2018
0abfb7b
chore(cli): remove kebabbing of plugin name
bmuenzenmeyer Jul 17, 2018
3a6582c
refactor(cli): always use same options when writing JSON
bmuenzenmeyer Jul 17, 2018
88cce3f
fix(cli): set initialized to false during plugin installation
bmuenzenmeyer Jul 17, 2018
be68cff
Merge branch 'dev' into plugin-work
bmuenzenmeyer Jul 17, 2018
992ebce
chore(utils): fix merge booboo
bmuenzenmeyer Jul 17, 2018
6c8af4f
chore(package): pin dependencies
bmuenzenmeyer Jul 17, 2018
a1a9779
fix(postinstall): fix typo in name
bmuenzenmeyer Jul 17, 2018
64c971d
fix: workaround fix for the PL UIKit viewport resizer width occasiona…
bolt-bot Jul 22, 2018
20ddc6b
chore: revert whitespace changes
bolt-bot Jul 22, 2018
9aee403
chore: revert whitespace changes
bolt-bot Jul 22, 2018
a67275a
Merge branch 'fix/fix-uikit-viewport-width' of https://github.com/sgh…
bolt-bot Jul 22, 2018
2c57401
refactor: replace compiling Sass via Ruby w/ much faster (and more ea…
bolt-bot Jul 22, 2018
60599d5
refactor: minify CSS compiled in Pattern Lab's default uikit
bolt-bot Jul 22, 2018
395ab87
refactor: upgrade existing NPM dependencies used in build tools to la…
bolt-bot Jul 22, 2018
f7978d2
Merge branch 'dev' into feature/update-uikit-build-tools
bolt-bot Jul 22, 2018
9c16675
fix: check to make sure the code panel-related <script> tag contains …
bolt-bot Jul 22, 2018
3caffbf
fix: adjust how PL's viewport is sized / positioned when the sidebar …
bolt-bot Jul 23, 2018
38e5b6c
chore: manually port over CSS width fix from #903
bolt-bot Jul 23, 2018
100ea8f
fix: fix broken / missing closing HTML tag
bolt-bot Jul 23, 2018
4cb08d5
feat: wire up new PL-specific iframe loader toast to display before t…
bolt-bot Jul 23, 2018
7a982d6
feat: 1st pass wiring up automatic critical CSS generation to UIkit
bolt-bot Jul 23, 2018
90e61ef
refactor: consolidate collection of standalone Gulp clean tasks into …
bolt-bot Jul 23, 2018
b3a889a
refactor: adjust how Pattern Lab's main UI gets loaded up / pieced to…
bolt-bot Jul 23, 2018
e736dd6
chore: pull in updates added in #904 to make sure deps + build tasks …
bolt-bot Jul 23, 2018
c6051e3
feat: lay down prep work for adding full on service worker support to…
bolt-bot Jul 23, 2018
d464a14
chore: adding fresh dist/ build from the latest PR changes
bolt-bot Jul 23, 2018
1f14270
Merge pull request #903 from sghoweri/fix/fix-uikit-viewport-width
bmuenzenmeyer Jul 24, 2018
07f38ef
Merge pull request #898 from pattern-lab/plugin-work
bmuenzenmeyer Jul 27, 2018
c79a7e8
Merge remote-tracking branch 'pattern-lab/dev' into feature/update-ui…
bmuenzenmeyer Jul 27, 2018
15d9a54
Merge pull request #904 from sghoweri/feature/update-uikit-build-tools
bmuenzenmeyer Jul 27, 2018
35c5726
fix: change const back to var since PL's Uikit JS isn't run through B…
bolt-bot Jul 28, 2018
ea856a1
chore: upgrade Lerna to latest version; add `clean` npm script to mon…
sghoweri Jul 28, 2018
7a3ee56
fix: move hoist config over to the right JSON file
sghoweri Jul 28, 2018
7634079
fix: move hoist and packages config settings over to the correct JSON…
sghoweri Jul 28, 2018
1abfba5
Merge branch 'feature/lerna-hoist' of https://github.com/sghoweri/pat…
sghoweri Jul 28, 2018
ac8a0f0
chore: revert updating Lerna packages config
sghoweri Jul 28, 2018
9266edf
refactor: port over urlHandler
sghoweri Jul 29, 2018
b0b8f66
refactor: port over postmessage.js, fix issues with patternData scope.
sghoweri Jul 29, 2018
9859bc7
refactor: port over data-saver.js; add required dependencies.
sghoweri Jul 29, 2018
9d8fe9b
refactor: port over styleguide.js; add required deps + swap out no lo…
sghoweri Jul 29, 2018
a64c283
refactor: migrate layout.js; add mustache template deps
sghoweri Jul 29, 2018
e490a03
refactor: port over modal-styleguide; add deps + fix JS errors with v…
sghoweri Jul 29, 2018
9daa9a5
refactor: port over modal-viewer.js; add necessary deps + fix JS erro…
sghoweri Jul 29, 2018
ceff63e
refactor: temporarily disable WIP code refactor for updating logic in…
sghoweri Jul 29, 2018
f7b4080
refactor: add required deps to panels-util; fix JS errors from undefi…
sghoweri Jul 29, 2018
e51e3be
refactor: add necessary deps to panels-viewer; fix broken JS; refacto…
sghoweri Jul 29, 2018
2656efc
refactor: port panels JS over; add necessary deps
sghoweri Jul 29, 2018
05d3589
refactor: port over plugin loader; export module so other components …
sghoweri Jul 29, 2018
f0b77ac
refactor: port over pattern-finder; add deps, fix JS errors + add bas…
sghoweri Jul 29, 2018
dfd6d07
refactor: port over prism-languages JS plugin; export module so other…
sghoweri Jul 29, 2018
23a216e
chore: remove clipboard.min.js -- dependency now pulled in via NPM
sghoweri Jul 29, 2018
464ee47
refactor: add new entrypoint files for patternlab-pattern and pattern…
sghoweri Jul 29, 2018
fd3b5a2
refactor: add new typeahead component -- replaces original typeahead …
sghoweri Jul 29, 2018
d094e30
refactor: add new eventemitter util library -- replaces event emitter…
sghoweri Jul 29, 2018
98a47ba
chore: add index.js to utils to simplify pulling in utility libraries…
sghoweri Jul 29, 2018
2ed013f
refactor: remove bower-specific config files and gulp tasks; add corr…
sghoweri Jul 29, 2018
87dd04e
chore: remove old JS build scripts from Gulp; add missing deps to pac…
sghoweri Jul 29, 2018
02e3fc5
refactor: add minified loadJS script loader to PL footer; fix JS path…
sghoweri Jul 29, 2018
1d7dec8
fix: fix JS paths imported
sghoweri Jul 29, 2018
b8a7283
refactor: remove bower components shipped in the dist folder
sghoweri Jul 29, 2018
fec1147
refactor: consolidate built JS bundles
sghoweri Jul 29, 2018
0219880
refactor: add barebones basic Webpack build config
sghoweri Jul 29, 2018
71c7a30
chore: revert adding UIkit-specific deps to root package.json file
sghoweri Jul 29, 2018
94888d4
chore: temporarily disable in-progress UI updates relating to the vie…
sghoweri Jul 29, 2018
564da7a
fix: update PrismJS import
sghoweri Jul 29, 2018
6921ab5
Merge pull request #906 from sghoweri/fix/partial-code-panel-toggle-fix
bmuenzenmeyer Aug 3, 2018
0990274
Merge pull request #914 from sghoweri/feature/lerna-hoist
bmuenzenmeyer Aug 3, 2018
19ca0d2
Merge branch 'dev' into feature/async-loading-and-ui-polish
bmuenzenmeyer Aug 3, 2018
fb92e63
Merge pull request #908 from sghoweri/feature/async-loading-and-ui-po…
bmuenzenmeyer Aug 3, 2018
812efe9
fix: add webpack-cli as a uikit-workshop dependency; update npm scrip…
sghoweri Aug 3, 2018
64a2c10
Merge branch 'dev' into feature/remove-bower-refactor-js
sghoweri Aug 3, 2018
b714fea
Some clean up
dnwhte Aug 3, 2018
bbfc6a3
Update dependencies for engine-nunjucks
dnwhte Aug 3, 2018
0dee50a
Create a Nunjucks loader to resolve Pattern Lab include paths
dnwhte Aug 3, 2018
a9f5925
Update version
dnwhte Aug 3, 2018
07d2b6e
chore: updated uikit-workshop/.github/CONTRIBUTING.md
joshbatley Aug 8, 2018
0dfb218
chore: removed copyPublic function and calls from uikit-workshop's gu…
joshbatley Aug 8, 2018
d8c41e4
chore: remove old dist folder assets no longer needed with upgraded b…
sghoweri Aug 13, 2018
d0ba66f
refactor: update HTML partials to be inlined / included via Webpack; …
sghoweri Aug 13, 2018
318801a
refactor: update uikit build process to move the rest of the way over…
sghoweri Aug 13, 2018
48e4375
refactor: remove Gulpfile config no longer needed
sghoweri Aug 13, 2018
eda41b1
refactor: remove package.json deps no longer needed; remove penthouse…
sghoweri Aug 13, 2018
cbe1a5a
chore: add freshly built assets with the new and improved Webpack build
sghoweri Aug 13, 2018
4adce73
Merge pull request #915 from sghoweri/feature/remove-bower-refactor-js
bmuenzenmeyer Aug 14, 2018
2f83255
Merge branch 'dev' into feature/migrate-gulp-build-to-webpack
sghoweri Aug 14, 2018
f098b14
Fix issue with loading custom nunjucks filters
Aug 15, 2018
7c5a197
Log pattern resolve errors
Aug 15, 2018
643808b
fix: add missing node-sass dependency
sghoweri Aug 16, 2018
72426ad
Merge pull request #920 from sghoweri/feature/migrate-gulp-build-to-w…
bmuenzenmeyer Aug 17, 2018
1344755
chore: updated uikit-workshop/.github/CONTRIBUTING.md
bmuenzenmeyer Aug 17, 2018
12f3e07
Merge branch 'jbatley-dev' into dev
bmuenzenmeyer Aug 17, 2018
573d1a5
Update the readme on modifying the nunjucks environment.
dnwhte Aug 18, 2018
32ec1c8
Revert "Update version"
dnwhte Aug 18, 2018
6e6b398
Merge pull request #918 from danwhite85/nunjucks-loader
bmuenzenmeyer Aug 22, 2018
06f8b6a
fix: .eslintrc without extension
ManoelLobo Aug 23, 2018
e263fb0
fix(uikit): remove indent from code panels
bmuenzenmeyer Aug 24, 2018
b4286ca
fix(ui): fix keyboard shortcut for M link
bmuenzenmeyer Aug 24, 2018
365c626
fix(uikit): correct ishViewportRange logic
bmuenzenmeyer Aug 24, 2018
3477536
Merge pull request #931 from pattern-lab/fix/929-code-highlighting
bmuenzenmeyer Aug 24, 2018
d1e5f9d
Merge pull request #932 from pattern-lab/fix/930-medium-ui
bmuenzenmeyer Aug 24, 2018
3118cac
feat(package): add test command which bails on error
bmuenzenmeyer Aug 24, 2018
cfd346c
fix(tests): scope the addition of each engine to only core
bmuenzenmeyer Aug 24, 2018
f2824af
Merge pull request #933 from pattern-lab/feat/927-lerna-tests
bmuenzenmeyer Aug 24, 2018
0ea44f8
refactor: add number prefixes to PL's Sass imports so files are organ…
sghoweri Aug 24, 2018
4f09e35
refactor: reorder Sass imports for utilities, themes, and vendor to g…
sghoweri Aug 24, 2018
40f2c09
chore: fresh build of PL assets
sghoweri Aug 24, 2018
da13765
fix: update typeahead selector so styles work as expected
sghoweri Aug 24, 2018
f75de74
fix: update ish-controls to be vertically centered in the global PL h…
sghoweri Aug 24, 2018
16f8fe4
refactor: make PL header sticky if supported
sghoweri Aug 24, 2018
a5be07b
fix: update PL code viewer to open and resize as expected + animate m…
sghoweri Aug 24, 2018
6c714ad
chore: update compiled PL assets
sghoweri Aug 24, 2018
e0b2fd9
Merge commit 'f2824af7fd9c11b2c93b44da731ab345bf562d5d' into feature/…
sghoweri Aug 24, 2018
d107277
refactor: break out copy-to-clipboard into it's own standalone JS
sghoweri Aug 25, 2018
52f5c80
refactor: update UIKit JS logic to use method shorthands across the b…
sghoweri Aug 25, 2018
e83d858
refactor: update banner comments across the board; reorganize JS impo…
sghoweri Aug 25, 2018
98ee886
chore: remove WIP comments added during previous refactor work
sghoweri Aug 25, 2018
a796787
refactor: pull in copy-to-clipboard component directly into the 2 dif…
sghoweri Aug 25, 2018
8e6d824
refactor: cleanup and refactor 1st half of styleguide.js
sghoweri Aug 25, 2018
367893a
refactor: finish high-level refactoring of the 2nd half of styleguide…
sghoweri Aug 25, 2018
9a7bda0
refactor: cleanup + minor fixes
sghoweri Aug 25, 2018
74781fb
refactor: wrapping up refactoring / fixing eslint and prettier issues…
sghoweri Aug 25, 2018
5e38f56
refactor: completely rewrite data-saver to use modern libraries + sav…
sghoweri Aug 25, 2018
8245e27
refactor: finishing up refactoring remaining JS utils to address esli…
sghoweri Aug 25, 2018
b28739d
chore: fresh build with latest changes
sghoweri Aug 25, 2018
e1d25d4
Merge pull request #934 from sghoweri/feature/uikit-refactor--reorgan…
bmuenzenmeyer Aug 29, 2018
8f321e4
Merge branch 'dev' into feature/uikit-refactor--p4
sghoweri Aug 29, 2018
f864da2
fix: update Lerna to latest version; update bootstrap command to use …
sghoweri Aug 29, 2018
125b111
fix: update globally installed version of Lerna on Travis to match lo…
sghoweri Aug 29, 2018
9f78923
Merge branch 'feature/uikit-refactor--p4' of https://github.com/sghow…
sghoweri Aug 29, 2018
0aea66c
Merge pull request #935 from sghoweri/feature/uikit-refactor--p4
bmuenzenmeyer Sep 5, 2018
02ba847
Merge pull request #928 from ManoelLobo/pr/eslintrc-extension
bmuenzenmeyer Sep 5, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ This ensures that any changes you've made will still result in a clean and funct

## Coding style

Formatting is automated via [Prettier](https://prettier.io/), setup to run on precommit. We suggest [editor integration](https://prettier.io/docs/en/editors.html) for this and for eslint. Prettier is further configured within `.prettierrc`. Eslint validates syntax and usage that Prettier doesn't handle. Configuration for both is found within the `.eslintrc` file.
Formatting is automated via [Prettier](https://prettier.io/), setup to run on precommit. We suggest [editor integration](https://prettier.io/docs/en/editors.html) for this and for eslint. Prettier is further configured within `.prettierrc`. Eslint validates syntax and usage that Prettier doesn't handle. Configuration for both is found within the `.eslintrc.json` file.

The `.editorconfig` controls spaces / tabs within supported editors. Check out their [site](http://editorconfig.org/).

Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
packages/core/scripts/api.handlebars
packages/core/scripts/events.handlebars
packages/core/test/files/annotations.js
**/uikit-workshop/src/js/**/*
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ before_install:
- phantomjs --version

before_script:
- npm install -g lerna@3.0.0-beta.21
- npm install -g lerna@3.2.1
- npm run bootstrap
- lerna add @pattern-lab/engine-mustache
- lerna add @pattern-lab/engine-handlebars
- lerna add @pattern-lab/engine-underscore
- lerna add @pattern-lab/engine-liquid
- lerna add @pattern-lab/engine-twig
- lerna add @pattern-lab/engine-react
- lerna add @pattern-lab/engine-mustache --scope=@pattern-lab/core
- lerna add @pattern-lab/engine-handlebars --scope=@pattern-lab/core
- lerna add @pattern-lab/engine-underscore --scope=@pattern-lab/core
- lerna add @pattern-lab/engine-liquid --scope=@pattern-lab/core
- lerna add @pattern-lab/engine-twig --scope=@pattern-lab/core
- lerna add @pattern-lab/engine-react --scope=@pattern-lab/core

branches:
only:
Expand Down
14 changes: 13 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
{
"lerna": "3.0.0-beta.21",
"lerna": "3.2.1",
"packages": [
"packages/*"
],
"version": "independent",
"command": {
"init": {
"exact": true
},
"bootstrap": {
"hoist": [
"tap",
"eslin*",
"husky",
"prettier",
"pretty-quick"
]
},
"publish": {
"allowBranch": "master"
}
},
"npmClientArgs": [
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"devDependencies": {
"lerna": "3.0.0-beta.21"
"lerna": "3.2.1"
},
"private": true,
"scripts": {
"bootstrap": "lerna bootstrap --hoist tap --hoist eslin* --hoist husky --hoist prettier --hoist pretty-quick",
"bootstrap": "lerna bootstrap",
"precommit": "pretty-quick --staged",
"prettier": "prettier --config .prettierrc --write ./**/*.js",
"test": "lerna run test"
"test": "lerna run test",
"clean": "git clean -dfx"
},
"nyc": {
"exclude": [
Expand Down
45 changes: 8 additions & 37 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,114 +4,85 @@ All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

<a name="0.0.1-alpha.23"></a>
## [0.0.1-alpha.23](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/@pattern-lab/cli@0.0.1-alpha.22...@pattern-lab/cli@0.0.1-alpha.23) (2018-07-09)

## [0.0.1-alpha.23](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/@pattern-lab/cli@0.0.1-alpha.22...@pattern-lab/cli@0.0.1-alpha.23) (2018-07-09)

### Bug Fixes

* **install:** copy dependencies ([1acef87](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/1acef87))





<a name="0.0.1-alpha.22"></a>

## [0.0.1-alpha.22](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/@pattern-lab/cli@0.0.1-alpha.21...@pattern-lab/cli@0.0.1-alpha.22) (2018-07-06)

**Note:** Version bump only for package @pattern-lab/cli





<a name="0.0.1-alpha.21"></a>
## [0.0.1-alpha.21](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/@pattern-lab/cli@0.0.1-alpha.20...@pattern-lab/cli@0.0.1-alpha.21) (2018-07-06)

## [0.0.1-alpha.21](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/@pattern-lab/cli@0.0.1-alpha.20...@pattern-lab/cli@0.0.1-alpha.21) (2018-07-06)

### Bug Fixes

* **install:** add break statements to install edition command ([3b1813c](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/3b1813c))
* **install:** use process to find package.json ([200c7cb](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/200c7cb))


### Features

* **package:** add npmrc file ([55f5bc2](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/55f5bc2))
* **package:** pin all dependencies ([415698e](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/415698e))
* **package:** remove package-lock.json files ([5ab3995](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/5ab3995))





<a name="0.0.1-alpha.20"></a>
## [0.0.1-alpha.20](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/@pattern-lab/cli@0.0.1-alpha.19...@pattern-lab/cli@0.0.1-alpha.20) (2018-07-05)

## [0.0.1-alpha.20](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/@pattern-lab/cli@0.0.1-alpha.19...@pattern-lab/cli@0.0.1-alpha.20) (2018-07-05)

### Bug Fixes

* **cli:** change whitespace to spaces per standard ([4556fc7](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/4556fc7))
* **tests:** change test command name similar to live-server until this passes CI ([5c39be1](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/5c39be1))


### Features

* **serve:** change calling method ([3b86a0d](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/3b86a0d))
* **tests:** use lerna run test at the monorepo level ([38a01b1](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/38a01b1))




<a name="0.0.1-alpha.19"></a>
## [0.0.1-alpha.19](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/@pattern-lab/cli@0.0.1-alpha.18...@pattern-lab/cli@0.0.1-alpha.19) (2018-05-19)

## [0.0.1-alpha.19](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/@pattern-lab/cli@0.0.1-alpha.18...@pattern-lab/cli@0.0.1-alpha.19) (2018-05-19)

### Bug Fixes

* **cli:** change line-endings of cli entrypoint ([3fc86c2](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/3fc86c2))
* **wording:** reconcile Pattern Lab vs PatternLab ([f3d1e0d](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/f3d1e0d))




<a name="0.0.1-alpha.18"></a>
## [0.0.1-alpha.18](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/@pattern-lab/cli@0.0.1-alpha.17...@pattern-lab/cli@0.0.1-alpha.18) (2018-05-04)

## [0.0.1-alpha.18](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/@pattern-lab/cli@0.0.1-alpha.17...@pattern-lab/cli@0.0.1-alpha.18) (2018-05-04)

### Bug Fixes

* **version:** use static core method getVersion ([f9dcd4d](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/f9dcd4d))




<a name="0.0.1-alpha.17"></a>
## [0.0.1-alpha.17](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/@pattern-lab/cli@0.0.1-alpha.16...@pattern-lab/cli@0.0.1-alpha.17) (2018-05-04)

## [0.0.1-alpha.17](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/@pattern-lab/cli@0.0.1-alpha.16...@pattern-lab/cli@0.0.1-alpha.17) (2018-05-04)

### Bug Fixes

* **package:** update publish config and installation target ([27d2c8f](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/27d2c8f))




<a name="0.0.1-alpha.16"></a>
## [0.0.1-alpha.16](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/@pattern-lab/cli@0.0.1-alpha.15...@pattern-lab/cli@0.0.1-alpha.16) (2018-05-04)

## [0.0.1-alpha.16](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/@pattern-lab/cli@0.0.1-alpha.15...@pattern-lab/cli@0.0.1-alpha.16) (2018-05-04)

### Features

* **API:** standardize v() and version() into a single call ([6309e69](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/6309e69))


### BREAKING CHANGES

* **API:** change `version()` to return a string representation of the version, removing `v()`




<a name="0.0.1-alpha.15"></a>

## [0.0.1-alpha.15](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/@pattern-lab/cli@0.0.1-alpha.14...@pattern-lab/cli@0.0.1-alpha.15) (2018-03-21)
Expand Down
20 changes: 19 additions & 1 deletion packages/cli/bin/install-plugin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
'use strict';

const path = require('path');

const _ = require('lodash');

const checkAndInstallPackage = require('./utils').checkAndInstallPackage;
const wrapAsync = require('./utils').wrapAsync;

Expand All @@ -8,7 +12,21 @@ const installPlugin = (plugin, config) =>
const name = plugin.name || plugin;
yield checkAndInstallPackage(name);
// Put the installed plugin in the patternlab-config.json
_.set(config, `plugins[${name}]['enabled']`, false);
_.set(config, `plugins[${name}]['enabled']`, true);
_.set(config, `plugins[${name}]['initialized']`, false);

// Get the options from the plugin, if any
const pluginPathConfig = path.resolve(
path.join(process.cwd(), 'node_modules', name, 'config.json')
);
try {
const pluginConfigJSON = require(pluginPathConfig);
if (!_.has(config.plugins[name].options)) {
_.set(config, `plugins[${name}]['options]`, pluginConfigJSON);
}
} catch (ex) {
//a config.json file is not required at this time
}
return name;
});

Expand Down
3 changes: 2 additions & 1 deletion packages/cli/bin/patternlab.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node
'use strict';
const cli = require('commander');
const path = require('path');
const build = require('./cli-actions/build');
const disable = require('./cli-actions/disable');
const enable = require('./cli-actions/enable');
Expand Down Expand Up @@ -42,7 +43,7 @@ cli
'-c, --config <path>',
'Specify config file. Default looks up the project dir',
val => val.trim(),
'./patternlab-config.json'
path.resolve(process.cwd(), 'patternlab-config.json')
)
.option('-v, --verbose', 'Show verbose console logs', verboseLogs)
.option('--silent', 'Turn off console logs', silenceLogs);
Expand Down
24 changes: 21 additions & 3 deletions packages/cli/bin/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,21 +175,39 @@ const checkAndInstallPackage = (packageName, url) =>
*/
const noop = () => {};

/**
* @func writeJsonAsync
* Wrapper for fs.writeJsonAsync with consistent spacing
* @param {string} filePath
* @param {object} data
*/
const writeJsonAsync = (filePath, data) =>
wrapAsync(function*() {
yield fs.outputJSON(filePath, data, { spaces: 2 });
});

/**
* @func getJSONKey
* Installs package, then returns the value for the given JSON file's key within
* @param {string} packageName - the node_module to install / load
* @param {object} key - the key to find
* @param {object} fileName - the filePath of the JSON
*/
const getJSONKey = (packageName, key, fileName = 'package.json') =>
wrapAsync(function*() {
yield checkAndInstallPackage(packageName);
const packageJSON = yield fs.readJson(
const jsonData = yield fs.readJson(
path.resolve('node_modules', packageName, fileName)
);
return packageJSON[key];
return jsonData[key];
});

module.exports = {
copyWithPattern,
copyAsync: fs.copy,
mkdirsAsync: fs.mkdirs,
moveAsync: fs.move,
writeJsonAsync: fs.outputJson,
writeJsonAsync: writeJsonAsync,
readJsonAsync: fs.readJson,
error,
info,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"eslint-plugin-prettier": "2.6.0",
"prettier": "1.11.1",
"proxyquire": "2.0.1",
"tap": "11.1.1"
"tap": "11.1.5"
},
"files": [
"bin"
Expand Down
54 changes: 27 additions & 27 deletions packages/cli/test/cli-init.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,31 @@ const wrapAsync = require('../bin/utils').wrapAsync;
const projectRoot = getUniqueProjectPath();

tap.test('Init ->', t =>
wrapAsync(function*() {
yield spawnCmd([
'init',
'--verbose',
'--project-dir',
projectRoot,
'--edition',
'@pattern-lab/edition-node',
'--starterkit',
'@pattern-lab/starterkit-mustache-base',
]);
t.ok(
exists.sync(path.resolve(projectRoot)),
'should initialize a Pattern Lab project'
);
t.ok(exists.sync(path.resolve(projectRoot, 'source')), 'with a source dir');
t.ok(exists.sync(path.resolve(projectRoot, 'public')), 'with a public dir');
t.ok(
exists.sync(path.resolve(projectRoot, 'pattern_exports')),
'with a pattern_exports dir'
);
t.ok(
exists.sync(path.resolve(projectRoot, 'patternlab-config.json')),
'with a pattern_exports dir'
);
t.end();
})
wrapAsync(function*() {
yield spawnCmd([
'init',
'--verbose',
'--project-dir',
projectRoot,
'--edition',
'@pattern-lab/edition-node',
'--starterkit',
'@pattern-lab/starterkit-mustache-base',
]);
t.ok(
exists.sync(path.resolve(projectRoot)),
'should initialize a Pattern Lab project'
);
t.ok(exists.sync(path.resolve(projectRoot, 'source')), 'with a source dir');
t.ok(exists.sync(path.resolve(projectRoot, 'public')), 'with a public dir');
t.ok(
exists.sync(path.resolve(projectRoot, 'pattern_exports')),
'with a pattern_exports dir'
);
t.ok(
exists.sync(path.resolve(projectRoot, 'patternlab-config.json')),
'with a pattern_exports dir'
);
t.end();
})
);
Loading