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

Commit 7acb118

Browse files
committed
feat(package): Add scripts
1 parent 998256c commit 7acb118

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
"bugs": "https://github.com/pattern-lab/edition-node/issues",
2222
"author": "Brian Muenzenmeyer",
2323
"scripts": {
24+
"build": "node ./scripts/build.js",
25+
"help": "node ./scripts/help.js",
26+
"serve": "node ./scripts/serve.js"
2427
},
2528
"license": "MIT",
2629
"engines": {

scripts/build.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
This is another simple example, which we wrapped with an `npm` script inside package.json
3+
*/
4+
const config = require('./../patternlab-config.json');
5+
const patternlab = require('@pattern-lab/patternlab-node')(config);
6+
7+
patternlab.build(() => {
8+
// use the callback
9+
}, {
10+
cleanPublic: true
11+
}).then(() => {
12+
// or do something else when this promise resolves
13+
});

scripts/help.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
This is another simple example, which we wrapped with an `npm` script inside package.json
3+
*/
4+
const config = require('./../patternlab-config.json');
5+
const patternlab = require('@pattern-lab/patternlab-node')(config);
6+
7+
patternlab.help();

scripts/serve.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
This is another simple example, which we wrapped with an `npm` script inside package.json
3+
*/
4+
const config = require('./../patternlab-config.json');
5+
const patternlab = require('@pattern-lab/patternlab-node')(config);
6+
7+
patternlab.serve(() => {
8+
// use the callback
9+
}, {
10+
cleanPublic: true,
11+
}).then(() => {
12+
// or do something else when this promise resolves
13+
});

0 commit comments

Comments
 (0)