Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: the CLI package needed an update regarding handlebars #1457

Merged
merged 8 commits into from
Dec 28, 2022
5 changes: 0 additions & 5 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,12 @@
"ora": "5.4.0"
},
"devDependencies": {
"@pattern-lab/starterkit-mustache-base": "3.0.3",
"dos2unix-cli": "^1.0.1",
"eslint": "4.18.2",
"eslint-config-prettier": "2.9.0",
"eslint-plugin-prettier": "2.6.0",
"prettier": "2.8.1",
"proxyquire": "2.1.3",
"starterkit-mustache-acidtest": "0.0.3",
"starterkit-mustache-bootstrap": "0.1.1",
"starterkit-mustache-foundation": "0.1.1",
"starterkit-mustache-materialdesign": "0.1.2",
"tap": "14.11.0"
},
"files": [
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ Passing no options starts the init in interactive mode
Options:
-h, --help output usage information
-p, --project-dir <path> Specify a project directory. Default: ./
-e, --edition <name> Specify an edition to install. Default: edition-node
-k, --starterkit <name> Specify a starterkit to install. Default: starterkit-mustache-base
-e, --edition <name> Specify an edition to install. Default: @pattern-lab/edition-node
-k, --starterkit <name> Specify a starterkit to install. Default: @pattern-lab/starterkit-handlebars-demo
```

### Serve Pattern Lab
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/cli-build.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tap.test('Init and build ->', (t) =>
'--edition',
'@pattern-lab/edition-node',
'--starterkit',
'@pattern-lab/starterkit-mustache-demo',
'@pattern-lab/starterkit-handlebars-demo',
]);
yield spawnCmd([
'build',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/cli-disable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tap.test('Disable ->', (t) =>
'--edition',
'@pattern-lab/edition-node',
'--starterkit',
'@pattern-lab/starterkit-mustache-base',
'@pattern-lab/starterkit-handlebars-vanilla',
]);
yield spawnCmd([
'install',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/cli-enable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tap.test('Enable ->', (t) =>
'--edition',
'@pattern-lab/edition-node',
'--starterkit',
'@pattern-lab/starterkit-mustache-base',
'@pattern-lab/starterkit-handlebars-vanilla',
]);
yield spawnCmd([
'install',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/cli-export.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tap.test('Init and export ->', (t) =>
'--edition',
'@pattern-lab/edition-node',
'--starterkit',
'@pattern-lab/starterkit-mustache-base',
'@pattern-lab/starterkit-handlebars-vanilla',
]);
yield spawnCmd([
'export',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/cli-init.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tap.test('Init ->', (t) =>
'--edition',
'@pattern-lab/edition-node',
'--starterkit',
'@pattern-lab/starterkit-mustache-base',
'@pattern-lab/starterkit-handlebars-vanilla',
]);
t.ok(
fs.existsSync(path.resolve(projectRoot)),
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/fixtures/patternlab-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"css": "./test/fixtures/public/css"
}
},
"patternExtension": "mustache",
"patternExtension": "hbs",
"patternStateCascade": ["inprogress", "inreview", "complete"],
"patternExportDirectory": "./pattern_exports/",
"patternExportPatternPartials": [],
Expand Down
48 changes: 9 additions & 39 deletions packages/cli/test/install-starterkit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,64 +14,34 @@ const minimalConfig = {
},
};

tap.test('Install starterkit-mustache-demo ->', (t) =>
tap.test('Install @pattern-lab/starterkit-handlebars-vanilla ->', (t) =>
wrapAsync(function* () {
yield installStarterkit(
'@pattern-lab/starterkit-mustache-demo',
'@pattern-lab/starterkit-handlebars-vanilla',
minimalConfig
);
const pkg = yield moduleExist('@pattern-lab/starterkit-mustache-demo');
const pkg = yield moduleExist('@pattern-lab/starterkit-handlebars-vanilla');
t.ok(pkg, 'module should exist after install');
t.end();
})
);

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

tap.test('Install starterkit-mustache-bootstrap ->', (t) =>
tap.test('Install @pattern-lab/starterkit-twig-demo ->', (t) =>
wrapAsync(function* () {
yield installStarterkit('starterkit-mustache-bootstrap', minimalConfig);
const pkg = yield moduleExist('starterkit-mustache-bootstrap');
t.ok(pkg, 'module should exist after install');
t.end();
})
);

tap.test('Install starterkit-mustache-foundation ->', (t) =>
wrapAsync(function* () {
yield installStarterkit('starterkit-mustache-foundation', minimalConfig);
const pkg = yield moduleExist('starterkit-mustache-foundation');
t.ok(pkg, 'module should exist after install');
t.end();
})
);

tap.test('Install starterkit-mustache-acidtest ->', (t) =>
wrapAsync(function* () {
yield installStarterkit('starterkit-mustache-acidtest', minimalConfig);
const pkg = yield moduleExist('starterkit-mustache-acidtest');
t.ok(pkg, 'module should exist after install');
t.end();
})
);

tap.test('Install starterkit-mustache-materialdesign ->', (t) =>
wrapAsync(function* () {
yield installStarterkit(
'starterkit-mustache-materialdesign',
minimalConfig
);
const pkg = yield moduleExist('starterkit-mustache-materialdesign');
yield installStarterkit('@pattern-lab/starterkit-twig-demo', minimalConfig);
const pkg = yield moduleExist('@pattern-lab/starterkit-twig-demo');
t.ok(pkg, 'module should exist after install');
t.end();
})
Expand Down
2 changes: 1 addition & 1 deletion packages/starterkit-handlebars-demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The Demo StarterKit for Handlebars is meant to be used as a demonstration of a H

The Base StarterKit for Handlebars requires the following PatternEngine:

- `@pattern-lab/patternengine-node-handlebars`: [npm](https://www.npmjs.com/package/@pattern-lab/patternengine-node-handlebars), [Github](https://github.com/pattern-lab/patternengine-node-handlebars)
- `@pattern-lab/engine-handlebars`: [npm](https://www.npmjs.com/package/@pattern-lab/engine-handlebars), [Github](https://github.com/pattern-lab/patternlab-node/tree/dev/packages/engine-handlebars)

## Install

Expand Down
25 changes: 0 additions & 25 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2041,11 +2041,6 @@
dependencies:
"@octokit/openapi-types" "^11.2.0"

"@pattern-lab/[email protected]":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@pattern-lab/starterkit-mustache-base/-/starterkit-mustache-base-3.0.3.tgz#8ce9bc8e0d2254ee970a09c4bdc76d4f6131c91d"
integrity sha512-AALdLim5L4ODDjUevRGBY/omhzTU38tSJMRRLaCnwoZ9dxn2QOZNampxj5T7Fhn4oTQnyjhawslVbqVekoViig==

"@reach/visually-hidden@^0.1.2":
version "0.1.4"
resolved "https://registry.yarnpkg.com/@reach/visually-hidden/-/visually-hidden-0.1.4.tgz#0dc4ecedf523004337214187db70a46183bd945b"
Expand Down Expand Up @@ -15034,26 +15029,6 @@ [email protected]:
stringify-package "^1.0.1"
yargs "^16.0.0"

[email protected]:
version "0.0.3"
resolved "https://registry.yarnpkg.com/starterkit-mustache-acidtest/-/starterkit-mustache-acidtest-0.0.3.tgz#8ad2b69f955b487ce60415b4d2b0e2177aa0af29"
integrity sha1-itK2n5VbSHzmBBW00rDiF3qgryk=

[email protected]:
version "0.1.1"
resolved "https://registry.yarnpkg.com/starterkit-mustache-bootstrap/-/starterkit-mustache-bootstrap-0.1.1.tgz#1cc0b988a8e6fc084dbb9604bf166af17b4216e6"
integrity sha1-HMC5iKjm/AhNu5YEvxZq8XtCFuY=

[email protected]:
version "0.1.1"
resolved "https://registry.yarnpkg.com/starterkit-mustache-foundation/-/starterkit-mustache-foundation-0.1.1.tgz#083bf6c1cf6a605ce8729555d502726fa419fd01"
integrity sha1-CDv2wc9qYFzocpVV1QJyb6QZ/QE=

[email protected]:
version "0.1.2"
resolved "https://registry.yarnpkg.com/starterkit-mustache-materialdesign/-/starterkit-mustache-materialdesign-0.1.2.tgz#1806fa26c87a79ed343cffc139d215a634b7994a"
integrity sha1-GAb6Jsh6ee00PP/BOdIVpjS3mUo=

static-extend@^0.1.1:
version "0.1.2"
resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6"
Expand Down