1
0
Fork 0

🔧 Updated (re)configure script

This commit is contained in:
Joost De Cock 2019-05-02 21:17:18 +02:00
parent 116b94b0f2
commit 8e30902d69
3 changed files with 19 additions and 11 deletions

View file

@ -7,8 +7,11 @@ customRollup:
- core - core
packageJson: packageJson:
create-freesewing-pattern: create-freesewing-pattern:
"reveal": true bin:
"bin": create-freesewing-pattern: index.js
"create-freesewing-pattern": "index.js" main: index.js
module: '!'
css-theme: css-theme:
main: "dist/theme.css" main: dist/theme.css
module: '!'

View file

@ -11,10 +11,10 @@ _types:
patterns: patterns:
plugins: plugins:
create-freesewing-pattern: create-freesewing-pattern:
mkdist: "mkdir -p dist" clean: "!"
copyfiles: "cp -R index.js package.json README.md lib template dist/" nodebuild: "!"
build: "npm run clean && npm run mkdist && npm run copyfiles" modulebuild: "!"
test: "ava -v && standard *.js lib/*.js" build: "!"
css-theme: css-theme:
build: "npx node-sass --output-style compressed src/theme.scss dist/theme.css" build: "npx node-sass --output-style compressed src/theme.scss dist/theme.css"
watch: "npx node-sass --watch --output-style compressed src/theme.scss dist/theme.css" watch: "npx node-sass --watch --output-style compressed src/theme.scss dist/theme.css"

View file

@ -125,6 +125,8 @@ function scripts(pkg, config, type) {
} }
if (typeof config.scripts[pkg] !== "undefined") { if (typeof config.scripts[pkg] !== "undefined") {
for (let key of Object.keys(config.scripts[pkg])) { for (let key of Object.keys(config.scripts[pkg])) {
if (config.scripts[pkg][key] === "!") delete runScripts[key];
else
runScripts[key] = Mustache.render(config.scripts[pkg][key], { runScripts[key] = Mustache.render(config.scripts[pkg][key], {
name: pkg name: pkg
}); });
@ -192,6 +194,9 @@ function packageConfig(pkg, config) {
...pkgConf, ...pkgConf,
...config.exceptions.packageJson[pkg] ...config.exceptions.packageJson[pkg]
}; };
for (let key of Object.keys(config.exceptions.packageJson[pkg])) {
if (config.exceptions.packageJson[pkg][key] === "!") delete pkgConf[key];
}
} }
return pkgConf; return pkgConf;