Skip to content

Commit 0076b64

Browse files
committed
Merge commit '97948b2e0b80764fdcec2fb2132f76bcef3c3466' into feature/uikit-refactor-p5--web-components
# Conflicts: # packages/uikit-workshop/package.json
2 parents 73d39ce + 97948b2 commit 0076b64

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+619
-129
lines changed

README.md

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ Refer to the [core usage guidelines](https://github.com/pattern-lab/patternlab-n
2424

2525
As of Pattern Lab Node 3.0.0, installation of [Editions](http://patternlab.io/docs/advanced-ecosystem-overview.html) is accomplished via the command line interface.
2626

27-
_0 to 60mph_
28-
29-
The below assume a new directory and project is required.
27+
The below assumes a new directory and project is required. This is likely what you want to do if starting from scratch. You could also run this within an existing project. The CLI will ask you for the installation location.
3028

3129
1. Open a terminal window and following along below:
3230
```bash
@@ -36,31 +34,10 @@ The below assume a new directory and project is required.
3634
```
3735
> If you get an error stating that `npx` is not installed, ensure you are on `npm 5.2.0` or later by running `npm -v` or install it globally with `npm install -g npx`. [Learn more about npx.](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b)
3836
1. Follow the on-screen prompts to choose your Edition and a Starterkit should you want one.
39-
1. Run `npm install` one last time to ensure any transient packages from the CLI are installed.
40-
1. Open `package.json` and add the following to your `scripts` object
41-
```diff
42-
"scripts": {
43-
+ "patternlab": "patternlab"
44-
},
45-
```
46-
This tells `npm` to look in the local `node_modules/.bin` directory for the `patternlab` CLI.
47-
1. In your terminal, run `npm run patternlab <command>`, where `<command>` is a documented method on the CLI, such as `build`, `serve`, or `help`.
48-
49-
50-
_Established npm projects_
37+
- If you chose `edition-node`, new commands in the "scripts" will be added in your `package.json`.
38+
- If you chose `edition-node-gulp`, a `gulpfile.js` will be added to your project.
5139

52-
1. Run the following command from a terminal:
53-
```bash
54-
npm install @pattern-lab/cli --save-dev
55-
```
56-
1. Open `package.json` and add the following to your `scripts` object
57-
```diff
58-
"scripts": {
59-
+ "patternlab": "patternlab"
60-
},
61-
```
62-
This tells `npm` to look in the local `node_modules/.bin` directory for the `patternlab` CLI.
63-
1. In your terminal, run `npm run patternlab init`. Follow the on-screen prompts to choose your Edition and a Starterkit should you want one.
40+
> Notice that `@pattern-lab/cli` was installed as a depdendency. Learn how to further [use the cli in your own project](https://github.com/pattern-lab/patternlab-node/blob/dev/packages/cli/readme.md#configuring-your-project-to-use-the-cli).
6441

6542

6643
## Ecosystem
@@ -85,7 +62,6 @@ Pattern Lab / Node wouldn't be what it is today without the support of the commu
8562
* **[Brad Frost](http://bradfrost.com/)**
8663
* [Marcos Peebles](https://twitter.com/marcospeebles)
8764
* [Susan Simkins](https://twitter.com/susanmsimkins)
88-
* [Wilfred Nas](https://twitter.com/wnas)
8965
9066
## Contributing
9167

packages/cli/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
<a name="0.0.1-beta.0"></a>
7+
## [0.0.1-beta.0](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/@pattern-lab/[email protected]...@pattern-lab/[email protected]) (2018-09-07)
8+
9+
10+
### Bug Fixes
11+
12+
* **cli:** set initialized to false during plugin installation ([88cce3f](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/88cce3f))
13+
* **cli:** support scoped plugins ([4ae13ce](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/4ae13ce))
14+
* **package:** update tap dependency ([2b70ff4](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/2b70ff4))
15+
16+
17+
18+
19+
620
<a name="0.0.1-alpha.23"></a>
721

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

packages/cli/bin/cli-actions/build.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
'use strict';
22
const buildPatterns = require('../build');
3-
const copyFiles = require('../copy-source-files');
43
const resolveConfig = require('../resolve-config');
54
const { error, info, wrapAsync } = require('../utils');
65

76
const build = options =>
87
wrapAsync(function*() {
98
try {
109
const config = yield resolveConfig(options.parent.config);
11-
yield copyFiles(config.paths);
1210
yield buildPatterns(config, options);
1311
info(`build: Yay, your Pattern Lab project was successfully built ☺`);
1412
} catch (err) {

packages/cli/bin/cli-actions/serve.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
'use strict';
22
const resolveConfig = require('../resolve-config');
3-
const build = require('./build');
43
const servePatterns = require('../serve');
54
const wrapAsync = require('../utils').wrapAsync;
65

76
const serve = options =>
87
wrapAsync(function*() {
98
const config = yield resolveConfig(options.parent.config);
10-
yield build(options);
11-
servePatterns(config, options.watch);
9+
servePatterns(config, options);
1210
});
1311

1412
module.exports = serve;

packages/cli/bin/copy-source-files.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

packages/cli/bin/patternlab.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ cli
5757
.alias('compile')
5858
.description('Build Pattern Lab. Optionally (re-)build only the patterns')
5959
.option('-p, --patterns-only', 'Whether to only build patterns')
60+
.option('--no-watch', 'Start watching for changes')
6061
.action(build);
6162

6263
/**
@@ -130,7 +131,7 @@ cli
130131
.command('serve')
131132
.alias('browse')
132133
.description('Starts a server to inspect files in browser')
133-
.option('-w, --watch', 'Start watching for changes')
134+
.option('--no-watch', 'Start watching for changes')
134135
.action(serve);
135136

136137
// Show additional help

packages/cli/bin/serve.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ const { error, info } = require('./utils');
99
* @func serve
1010
* @desc Start a browser-sync server in the Pattern Lab public dir
1111
* @param {object} config - The passed Pattern Lab config
12+
* @param {object} options - The passed options at invocation time
1213
*/
13-
function serve(config) {
14+
function serve(config, options) {
1415
if (!isValidConfig) {
1516
throw new TypeError(
1617
'serve: Expects config not to be empty and of type object.'
@@ -37,7 +38,7 @@ function serve(config) {
3738
try {
3839
info(`serve: Serving your files …`);
3940
const pl = patternlab(config);
40-
pl.server.serve({});
41+
pl.server.serve(options);
4142
} catch (err) {
4243
error(err);
4344
}

packages/cli/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"name": "@pattern-lab/cli",
33
"description": "Command-line interface (CLI) for the @pattern-lab/core.",
4-
"version": "0.0.1-alpha.23",
4+
"version": "0.0.1-beta.0",
55
"bin": {
66
"patternlab": "bin/patternlab.js"
77
},
88
"author": {
99
"name": "Raphael Okon"
1010
},
1111
"dependencies": {
12-
"@pattern-lab/core": "^3.0.0-alpha.16",
13-
"@pattern-lab/live-server": "^1.3.3-alpha.6",
12+
"@pattern-lab/core": "^3.0.0-beta.0",
13+
"@pattern-lab/live-server": "^1.3.3-beta.0",
1414
"archiver": "2.1.1",
1515
"chalk": "2.4.1",
1616
"commander": "2.15.1",

packages/cli/readme.md

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,44 @@
1414
#### Via Yarn
1515
`yarn add @pattern-lab/cli --dev`
1616

17-
## Getting Started
18-
1. In order to use Pattern Lab you need to initialize a Pattern Lab project with `patternlab init`. The CLI will ask you some setup question and scaffold your project based on it.
19-
2. Build your patterns use `patternlab build`. The Pattern Lab CLI will assume that the `patternlab-config.json` is in the project root. Othewise specify a custom path to config with `patternlab build --config path/to/config`
20-
3. To view your patterns in the browser preview `patternlab serve` or again specify a custom config location `patternlab serve --config path/to/config`
21-
4. To export your patterns in the browser preview `patternlab export` or again specify a custom config location `patternlab export --config path/to/config`
17+
## Configuring Your Project to Use the CLI
18+
19+
If the CLI is installed globally, you may call commands directly, such as `patternlab --version`.
20+
21+
If the CLI is not installed globally, you need to tell `npm` where to find the executable when invoking commands.
22+
23+
Open `package.json` and add the following to your `scripts` object:
24+
25+
```diff
26+
"scripts": {
27+
+ "patternlab": "patternlab"
28+
},
29+
```
30+
This tells `npm` to look in the local `node_modules/.bin` directory for the `patternlab` CLI.
31+
32+
Subcommands and options can then be forwarded to the CLI like this:
33+
34+
```bash
35+
npm run patternlab -- serve
36+
```
37+
38+
Installing [`edition-node`](https://github.com/pattern-lab/patternlab-node/tree/master/packages/edition-node) will add the following CLI commands for convenience:
39+
40+
```diff
41+
"scripts": {
42+
+ "pl:build": "patternlab build --config ./patternlab-config.json",
43+
+ "pl:help": "patternlab --help",
44+
+ "pl:install": "patternlab install --config ./patternlab-config.json",
45+
+ "pl:serve": "patternlab serve --config ./patternlab-config.json",
46+
+ "pl:version": "patternlab --version"
47+
},
48+
```
49+
50+
Then you can invoke any of these like this:
51+
52+
```
53+
npm run pl:serve
54+
```
2255

2356
## API & Usage
2457
### General usage

packages/core/CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,27 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
<a name="3.0.0-beta.0"></a>
7+
# [3.0.0-beta.0](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/compare/@pattern-lab/[email protected]...@pattern-lab/[email protected]) (2018-09-07)
8+
9+
10+
### Bug Fixes
11+
12+
* **docs:** update event info with tab example ([0f227a3](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/commit/0f227a3))
13+
* **package:** Allow .json extension on annotations file (issue [#836](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/issues/836)) ([b92e62b](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/commit/b92e62b))
14+
* **package:** update tap dependency ([2b70ff4](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/commit/2b70ff4))
15+
* **plugins:** support scoped packages ([44f0f8e](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/commit/44f0f8e))
16+
17+
18+
### Features
19+
20+
* **API:** remove reliance on patternlab object during plugin install ([0850fd6](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/commit/0850fd6))
21+
* **core:** remove plugin install / disable / enable logic ([5a58824](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/commit/5a58824)), closes [#872](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/issues/872)
22+
23+
24+
25+
26+
627
<a name="3.0.0-alpha.16"></a>
728

829
# [3.0.0-alpha.16](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/compare/@pattern-lab/[email protected]...@pattern-lab/[email protected]) (2018-07-06)

0 commit comments

Comments
 (0)