Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit ad6e291

Browse files
authored
Merge pull request #53 from pattern-lab/develop
- Switch to scoped live-server package - Fix scoped starterkit regression - Update dependencies - Global install note
2 parents afd5408 + bbc74cf commit ad6e291

File tree

11 files changed

+880
-256
lines changed

11 files changed

+880
-256
lines changed

bin/inquiries/starterkit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const starterkitSetup = [{
88
choices: [
99
{
1010
name: 'starterkit-mustache-demo',
11-
value: 'starterkit-mustache-demo'
11+
value: '@pattern-lab/starterkit-mustache-demo'
1212
},
1313
{
1414
name: 'starterkit-mustache-bootstrap',
@@ -44,7 +44,7 @@ const starterkitSetup = [{
4444
},
4545
{
4646
name: 'starterkit-mustache-base',
47-
value: 'starterkit-mustache-base'
47+
value: '@pattern-lab/starterkit-mustache-base'
4848
},
4949
new inquirer.Separator(),
5050
{

bin/install-starterkit.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ const checkAndInstallPackage = require('./utils').checkAndInstallPackage;
44
const copyAsync = require('./utils').copyAsync;
55
const wrapAsync = require('./utils').wrapAsync;
66

7-
const installStarterkit = (starterkit, config) => wrapAsync(function*() {
7+
const installStarterkit = (starterkit, config) => wrapAsync(function * () {
88
const sourceDir = config.paths.source.root;
9-
const name = starterkit.name || starterkit;
10-
const url = `pattern-lab/${name}`;
9+
const name = starterkit.value || starterkit;
10+
const url = name.startsWith('@pattern-lab/')
11+
? name
12+
: `pattern-lab/${name}`;
1113
yield checkAndInstallPackage(name, url);
1214
yield copyAsync(path.resolve('./node_modules', name, 'dist'), path.resolve(sourceDir));
1315
return name;

bin/serve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22
const chokidar = require('chokidar');
3-
const liveServer = require('live-server');
3+
const liveServer = require('@pattern-lab/live-server');
44
const patternlab = require('patternlab-node');
55
const path = require('path');
66
const _ = require('lodash');

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "patternlab-node-cli",
33
"description": "Command-line interface (CLI) for the patternlab-node core.",
4-
"version": "0.0.1-alpha.10",
4+
"version": "0.0.1-alpha.11",
55
"bin": {
66
"patternlab": "bin/patternlab.js"
77
},
@@ -10,26 +10,26 @@
1010
},
1111
"private": true,
1212
"dependencies": {
13-
"archiver": "2.0.3",
14-
"chalk": "2.1.0",
15-
"chokidar": "1.7.0",
16-
"commander": "2.11.0",
17-
"execa": "0.8.0",
13+
"@pattern-lab/live-server": "1.3.2",
14+
"archiver": "2.1.1",
15+
"chalk": "2.3.1",
16+
"chokidar": "2.0.2",
17+
"commander": "2.14.1",
18+
"execa": "0.9.0",
1819
"fs-promise": "2.0.3",
1920
"glob": "7.1.2",
2021
"has-yarn": "1.0.0",
21-
"inquirer": "3.3.0",
22-
"live-server": "pattern-lab/live-server",
23-
"lodash": "4.17.4",
24-
"ora": "1.3.0",
22+
"inquirer": "5.1.0",
23+
"lodash": "4.17.5",
24+
"ora": "1.4.0",
2525
"path-exists": "3.0.0",
2626
"patternlab-node": "2.12.0",
2727
"sanitize-filename": "1.6.1"
2828
},
2929
"devDependencies": {
30-
"eslint": "4.8.0",
30+
"eslint": "4.17.0",
3131
"proxyquire": "1.8.0",
32-
"tap": "10.7.2"
32+
"tap": "11.1.0"
3333
},
3434
"files": [
3535
"bin"

readme.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66

77

88
## Installation
9-
`npm install pattern-lab/patternlab-node-cli` or `yarn add pattern-lab/patternlab-node-cli`
9+
*Note: Global installs are currently not supported and will be fixed when the Pattern Lab core hits v3.0.0*
10+
11+
#### Via NPM
12+
`npm install pattern-lab/patternlab-node-cli --save-dev`
13+
14+
#### Via Yarn
15+
`yarn add pattern-lab/patternlab-node-cli --dev`
1016

1117
## Getting Started
1218
1. In order to use PatternLab you need to initialize a PatternLab project with `patternlab init`. The CLI will ask you some setup question and scaffold your project based on it.

test/cli-build.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const wrapAsync = require('../bin/utils').wrapAsync;
88
const projectRoot = getUniqueProjectPath();
99

1010
tap.test('Init and build ->', t => wrapAsync(function*() {
11-
yield spawnCmd(['init', '--verbose', '--project-dir', projectRoot, '--edition', 'edition-node', '--starterkit', 'starterkit-mustache-base']);
11+
yield spawnCmd(['init', '--verbose', '--project-dir', projectRoot, '--edition', 'edition-node', '--starterkit', '@pattern-lab/starterkit-mustache-base']);
1212
yield spawnCmd(['build', '--config', `${projectRoot}/patternlab-config.json`]);
1313
t.ok(exists.sync(path.resolve(projectRoot, 'public')), 'should build all files into public dir');
1414
t.ok(exists.sync(path.resolve(projectRoot, 'public', 'annotations')), 'with a annotations dir');

test/cli-export.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const wrapAsync = require('../bin/utils').wrapAsync;
88
const projectRoot = getUniqueProjectPath();
99

1010
tap.test('Init and export ->', t => wrapAsync(function*() {
11-
yield spawnCmd(['init', '--verbose', '--project-dir', projectRoot, '--edition', 'edition-node', '--starterkit', 'starterkit-mustache-base']);
11+
yield spawnCmd(['init', '--verbose', '--project-dir', projectRoot, '--edition', 'edition-node', '--starterkit', '@pattern-lab/starterkit-mustache-base']);
1212
yield spawnCmd(['export', '--config', `${projectRoot}/patternlab-config.json`]);
1313
t.ok(exists.sync(path.resolve(projectRoot, 'pattern_exports', 'patterns.zip')), ' should create patterns.zip');
1414
t.end();

test/cli-init.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const wrapAsync = require('../bin/utils').wrapAsync;
88
const projectRoot = getUniqueProjectPath();
99

1010
tap.test('Init ->', t => wrapAsync(function*() {
11-
yield spawnCmd(['init', '--verbose', '--project-dir', projectRoot, '--edition', 'edition-node', '--starterkit', 'starterkit-mustache-base']);
11+
yield spawnCmd(['init', '--verbose', '--project-dir', projectRoot, '--edition', 'edition-node', '--starterkit', '@pattern-lab/starterkit-mustache-base']);
1212
t.ok(exists.sync(path.resolve(projectRoot)), 'should initialize a PatternLab project');
1313
t.ok(exists.sync(path.resolve(projectRoot, 'source')), 'with a source dir');
1414
t.ok(exists.sync(path.resolve(projectRoot, 'public')), 'with a public dir');

test/install-starterkit.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ const minimalConfig = {
1515
};
1616

1717
tap.test('Install starterkit-mustache-demo ->', t => wrapAsync(function*() {
18-
yield installStarterkit('starterkit-mustache-demo', minimalConfig);
19-
const pkg = yield moduleExist('starterkit-mustache-demo');
18+
yield installStarterkit('@pattern-lab/starterkit-mustache-demo', minimalConfig);
19+
const pkg = yield moduleExist('@pattern-lab/starterkit-mustache-demo');
2020
t.ok(pkg, 'module should exist after install');
2121
t.end();
2222
}));
2323

2424
tap.test('Install starterkit-mustache-base ->', t => wrapAsync(function*() {
25-
yield installStarterkit('starterkit-mustache-base', minimalConfig);
26-
const pkg = yield moduleExist('starterkit-mustache-base');
25+
yield installStarterkit('@pattern-lab/starterkit-mustache-base', minimalConfig);
26+
const pkg = yield moduleExist('@pattern-lab/starterkit-mustache-base');
2727
t.ok(pkg, 'module should exist after install');
2828
t.end();
2929
}));

test/serve.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const liveServerMock = require('./mocks/liverserver.mock.js');
66
const wrapAsync = require('../bin/utils').wrapAsync;
77

88
// Require preview but mock patternlab so that we only test the module behavior
9-
const preview = proxyquire('../bin/serve', {'live-server': liveServerMock});
9+
const preview = proxyquire('../bin/serve', {'@pattern-lab/live-server': liveServerMock});
1010

1111
tap.test('Serve ->', t => wrapAsync(function*() {
1212
const config = yield resolveConfig('./test/fixtures/patternlab-config.json');

0 commit comments

Comments
 (0)