File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11'use strict' ;
22const path = require ( 'path' ) ;
3- const checkAndInstallPackage = require ( './utils' ) . checkAndInstallPackage ;
4- const copyAsync = require ( './utils' ) . copyAsync ;
5- const wrapAsync = require ( './utils' ) . wrapAsync ;
3+ const pkg = require ( '../package.json' ) ;
4+ const {
5+ checkAndInstallPackage,
6+ copyAsync,
7+ wrapAsync,
8+ writeJsonAsync,
9+ } = require ( './utils' ) ;
610
711const installEdition = ( edition , config ) =>
812 wrapAsync ( function * ( ) {
@@ -26,6 +30,17 @@ const installEdition = (edition, config) =>
2630 path . resolve ( sourceDir , '../' , 'gulpfile.js' )
2731 ) ;
2832 }
33+ case '@pattern-lab/edition-node' : {
34+ const scriptsJSON = {
35+ 'pl:build' : 'patternlab build --config ./patternlab-config.json' ,
36+ 'pl:help' : 'patternlab --help' ,
37+ 'pl:install' : 'patternlab install --config ./patternlab-config.json' ,
38+ 'pl:serve' : 'patternlab serve --config ./patternlab-config.json' ,
39+ 'pl:version' : 'patternlab --version' ,
40+ } ;
41+ pkg . scripts = Object . assign ( { } , pkg . scripts || { } , scriptsJSON ) ;
42+ yield writeJsonAsync ( './package.json' , pkg , { spaces : 2 } ) ;
43+ }
2944 }
3045 return config ;
3146 } ) ;
You can’t perform that action at this time.
0 commit comments