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
packageJson:
create-freesewing-pattern:
"reveal": true
"bin":
"create-freesewing-pattern": "index.js"
bin:
create-freesewing-pattern: index.js
main: index.js
module: '!'
css-theme:
main: "dist/theme.css"
main: dist/theme.css
module: '!'

View file

@ -11,10 +11,10 @@ _types:
patterns:
plugins:
create-freesewing-pattern:
mkdist: "mkdir -p dist"
copyfiles: "cp -R index.js package.json README.md lib template dist/"
build: "npm run clean && npm run mkdist && npm run copyfiles"
test: "ava -v && standard *.js lib/*.js"
clean: "!"
nodebuild: "!"
modulebuild: "!"
build: "!"
css-theme:
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"

View file

@ -125,9 +125,11 @@ function scripts(pkg, config, type) {
}
if (typeof config.scripts[pkg] !== "undefined") {
for (let key of Object.keys(config.scripts[pkg])) {
runScripts[key] = Mustache.render(config.scripts[pkg][key], {
name: pkg
});
if (config.scripts[pkg][key] === "!") delete runScripts[key];
else
runScripts[key] = Mustache.render(config.scripts[pkg][key], {
name: pkg
});
}
}
@ -192,6 +194,9 @@ function packageConfig(pkg, config) {
...pkgConf,
...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;