From 8e30902d69fc9234f979c3f97f16e5344265b9c4 Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Thu, 2 May 2019 21:17:18 +0200 Subject: [PATCH] :wrench: Updated (re)configure script --- config/exceptions.yaml | 11 +++++++---- config/scripts.yaml | 8 ++++---- scripts/reconfigure.js | 11 ++++++++--- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/config/exceptions.yaml b/config/exceptions.yaml index 5b29fdf4b1b..7223507e878 100644 --- a/config/exceptions.yaml +++ b/config/exceptions.yaml @@ -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: '!' + diff --git a/config/scripts.yaml b/config/scripts.yaml index ed88b2b981f..b78b46bd7b6 100644 --- a/config/scripts.yaml +++ b/config/scripts.yaml @@ -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" diff --git a/scripts/reconfigure.js b/scripts/reconfigure.js index 1011603cf07..9dfc20849d6 100644 --- a/scripts/reconfigure.js +++ b/scripts/reconfigure.js @@ -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;