From 0461c64b9ab957faaedeef3d2fada57285951c19 Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Sat, 20 Apr 2019 19:23:22 +0200 Subject: [PATCH] :construction: Handling of package.json exceptions --- config/dependencies.yaml | 4 + config/exceptions.yaml | 10 +- config/scripts.yaml | 19 +- config/templates/package.dflt.json | 3 +- config/templates/rollup.config.dflt.js | 2 +- package.json | 3 + packages/aaron/package.json | 14 +- packages/aaron/rollup.config.js | 2 +- packages/bent/package.json | 14 +- packages/bent/rollup.config.js | 2 +- packages/brian/package.json | 14 +- packages/brian/rollup.config.js | 2 +- packages/bruce/package.json | 14 +- packages/bruce/rollup.config.js | 2 +- packages/carlita/package.json | 14 +- packages/carlita/rollup.config.js | 2 +- packages/carlton/package.json | 14 +- packages/carlton/rollup.config.js | 2 +- packages/cathrin/package.json | 14 +- packages/cathrin/rollup.config.js | 2 +- packages/components/.babelrc | 6 + packages/components/package.json | 21 +- packages/components/rollup.config.js | 2 +- packages/components/scripts/build.sh | 22 ++ packages/core/package.json | 20 +- packages/core/rollup.config.js | 2 +- .../create-freesewing-pattern/package.json | 22 +- packages/create-freesewing-pattern/readme.md | 149 -------------- packages/css-theme/package.json | 16 +- packages/examples/package.json | 14 +- packages/examples/rollup.config.js | 2 +- packages/florent/package.json | 14 +- packages/florent/rollup.config.js | 2 +- packages/huey/package.json | 14 +- packages/huey/rollup.config.js | 2 +- packages/hugo/package.json | 14 +- packages/hugo/rollup.config.js | 2 +- packages/i18n/package.json | 14 +- packages/i18n/rollup.config.js | 2 +- packages/jaeger/package.json | 14 +- packages/jaeger/rollup.config.js | 2 +- packages/models/package.json | 14 +- packages/models/rollup.config.js | 2 +- packages/mui-theme/package.json | 14 +- packages/mui-theme/rollup.config.js | 27 +++ packages/patterns/package.json | 14 +- packages/patterns/rollup.config.js | 2 +- packages/plugin-banner/package.json | 14 +- packages/plugin-banner/rollup.config.js | 2 +- packages/plugin-bundle/package.json | 14 +- packages/plugin-bundle/rollup.config.js | 2 +- packages/plugin-bust/package.json | 14 +- packages/plugin-bust/rollup.config.js | 2 +- packages/plugin-buttons/package.json | 14 +- packages/plugin-buttons/rollup.config.js | 2 +- packages/plugin-cutonfold/package.json | 14 +- packages/plugin-cutonfold/rollup.config.js | 2 +- packages/plugin-debug/package.json | 14 +- packages/plugin-debug/rollup.config.js | 2 +- packages/plugin-designer/package.json | 14 +- packages/plugin-designer/rollup.config.js | 2 +- packages/plugin-dimension/package.json | 14 +- packages/plugin-dimension/rollup.config.js | 2 +- packages/plugin-flip/package.json | 14 +- packages/plugin-flip/rollup.config.js | 2 +- packages/plugin-grainline/package.json | 14 +- packages/plugin-grainline/rollup.config.js | 2 +- packages/plugin-i18n/package.json | 14 +- packages/plugin-i18n/rollup.config.js | 2 +- packages/plugin-logo/package.json | 14 +- packages/plugin-logo/rollup.config.js | 2 +- packages/plugin-round/package.json | 14 +- packages/plugin-round/rollup.config.js | 2 +- packages/plugin-scalebox/package.json | 14 +- packages/plugin-scalebox/rollup.config.js | 2 +- packages/plugin-sprinkle/package.json | 14 +- packages/plugin-sprinkle/rollup.config.js | 2 +- packages/plugin-svgattr/package.json | 14 +- packages/plugin-svgattr/rollup.config.js | 2 +- packages/plugin-theme/.babelrc | 10 - packages/plugin-theme/package.json | 14 +- packages/plugin-theme/rollup.config.js | 6 +- packages/plugin-title/package.json | 14 +- packages/plugin-title/rollup.config.js | 2 +- packages/plugin-validate/package.json | 14 +- packages/plugin-validate/rollup.config.js | 2 +- packages/shin/package.json | 14 +- packages/shin/rollup.config.js | 2 +- packages/simon/package.json | 14 +- packages/simon/rollup.config.js | 2 +- packages/sven/package.json | 14 +- packages/sven/rollup.config.js | 2 +- packages/tamiko/package.json | 14 +- packages/tamiko/rollup.config.js | 2 +- packages/trayvon/package.json | 14 +- packages/trayvon/rollup.config.js | 2 +- packages/wahid/package.json | 14 +- packages/wahid/rollup.config.js | 2 +- packages/workbench/.babelrc | 10 +- packages/workbench/package.json | 14 +- packages/workbench/rollup.config.js | 32 +++ .../workbench/src/components/ButtonPicker.js | 57 ++++-- packages/workbench/src/components/NavBar.js | 61 +++--- .../ButtonPicker.scss} | 0 .../{css/Config.css => scss/Config.scss} | 0 .../{css/Help.css => scss/Help.scss} | 0 .../{css/NavBar.css => scss/NavBar.scss} | 0 .../{css/Settings.css => scss/Settings.scss} | 0 .../src/components/settings/Config.js | 114 +++++++---- .../src/components/settings/Measurements.js | 22 +- .../src/components/settings/Options.js | 188 +++++++++++------- .../src/components/settings/ResolvedConfig.js | 102 ++++++---- .../src/components/settings/index.js | 8 +- packages/workbench/src/index.js | 137 +++++++------ .../src/{style.css => scss/style.scss} | 0 scripts/reconfigure.js | 25 ++- yarn.lock | 24 ++- 117 files changed, 1018 insertions(+), 772 deletions(-) create mode 100644 packages/components/.babelrc create mode 100755 packages/components/scripts/build.sh delete mode 100644 packages/create-freesewing-pattern/readme.md create mode 100644 packages/mui-theme/rollup.config.js delete mode 100644 packages/plugin-theme/.babelrc create mode 100644 packages/workbench/rollup.config.js rename packages/workbench/src/components/{css/ButtonPicker.css => scss/ButtonPicker.scss} (100%) rename packages/workbench/src/components/{css/Config.css => scss/Config.scss} (100%) rename packages/workbench/src/components/{css/Help.css => scss/Help.scss} (100%) rename packages/workbench/src/components/{css/NavBar.css => scss/NavBar.scss} (100%) rename packages/workbench/src/components/{css/Settings.css => scss/Settings.scss} (100%) rename packages/workbench/src/{style.css => scss/style.scss} (100%) diff --git a/config/dependencies.yaml b/config/dependencies.yaml index c207bb28ae0..28017b330b3 100644 --- a/config/dependencies.yaml +++ b/config/dependencies.yaml @@ -22,6 +22,10 @@ carlton: peer: "@freesewing/bent": "^{{version}}" "@freesewing/plugin-buttons": "^{{version}}" +components: + peer: + "react": "^16.4.1" + "prop-types": "15.7.2" core: _: "bezier-js": "^2.2.13" diff --git a/config/exceptions.yaml b/config/exceptions.yaml index 71ec67d5931..9698d044ce6 100644 --- a/config/exceptions.yaml +++ b/config/exceptions.yaml @@ -1,15 +1,13 @@ noNamespace: - create-freesewing-pattern -noRollup: +customRollup: - css-theme - create-freesewing-pattern - - mui-theme - plugin-theme - workbench -extraPackageJson: + - components +packageJson: create-freesewing-pattern: - "reveal": true, + "reveal": true "bin": "create-freesewing-pattern": "index.js" - "engines": - "npm": ">=5" diff --git a/config/scripts.yaml b/config/scripts.yaml index 69fd74cf5a2..86fff84e6b0 100644 --- a/config/scripts.yaml +++ b/config/scripts.yaml @@ -1,22 +1,27 @@ _: clean: "rimraf ../../dist/{{name}}" - nodebuild: "rollup -c -o ../../dist/{{name}}/index.js -f cjs" - modulebuild: "rollup -c -o ../../dist/{{name}}/index.mjs -f es" + nodebuild: "BABEL_ENV=production rollup -c -o ../../dist/{{name}}/index.js -f cjs" + modulebuild: "BABEL_ENV=production rollup -c -o ../../dist/{{name}}/index.mjs -f es" build: "npm run clean && npm run nodebuild && npm run modulebuild" test: "echo \"{{name}}: No tests configured. Perhaps you'd like to do this?\" && exit 0" pubtest: "npm publish --registry http://localhost:6662" _types: patterns: plugins: +create-freesewing-pattern: + mkdist: "mkdir -p ../../dist/create-freesewing-pattern" + copyfiles: "cp -R index.js package.json README.md lib template ../../dist/create-freesewing-pattern/" + build: "npm run clean && npm run mkdist && npm run copyfiles" + test: "ava -v && standard *.js lib/*.js" +css-theme: + build: "npx node-sass --output-style compressed src/theme.scss ../../dist/css-theme/theme.css" components: test: "echo \"{{name}}: No tests configured. Perhaps you'd like to do this?\" && exit 0" build: "echo \"{{name}}: No build command available.\" && exit 0" core: - test: "nyc mocha tests/*.test.js" - report: "nyc report --reporter=html mocha --compilers js:babel-core/register tests/*.test.js" - coverage: "nyc npm test && nyc report --reporter=text-lcov > coverage.lcov && ./node_modules/.bin/codecov" -create-freesewing-pattern: - test: "ava -v && standard *.js lib/*.js" + test: "BABEL_ENV=production nyc mocha tests/*.test.js" + report: "BABEL_ENV=production nyc report --reporter=html mocha --compilers js:babel-core/register tests/*.test.js" + coverage: "BABEL_ENV=production nyc npm test && nyc report --reporter=text-lcov > coverage.lcov && ./node_modules/.bin/codecov" workbench: test: "cross-env CI=1 react-scripts test --env=jsdom" test:watch: "react-scripts test --env=jsdom" diff --git a/config/templates/package.dflt.json b/config/templates/package.dflt.json index 958b65ac928..87e15e2b943 100644 --- a/config/templates/package.dflt.json +++ b/config/templates/package.dflt.json @@ -23,6 +23,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" + "node": ">=8.0.0", + "npm": ">=5" } } diff --git a/config/templates/rollup.config.dflt.js b/config/templates/rollup.config.dflt.js index 278315399d9..05d5097b581 100644 --- a/config/templates/rollup.config.dflt.js +++ b/config/templates/rollup.config.dflt.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/package.json b/package.json index f4678ffd47d..72e42a1b6a7 100644 --- a/package.json +++ b/package.json @@ -46,8 +46,10 @@ "@babel/core": "7.2.2", "@babel/node": "7.2.2", "@babel/plugin-external-helpers": "7.2.0", + "@babel/plugin-proposal-class-properties": "7.4.0", "@babel/plugin-proposal-object-rest-spread": "7.4.3", "@babel/preset-env": "^7.1.0", + "@babel/preset-react": "7.0.0", "@babel/register": "^7.0.0", "@svgr/rollup": "^2.4.1", "ava": "^1.2.1", @@ -78,6 +80,7 @@ "node-sass": "4.11.0", "nyc": "12.0.2", "prettier": "1.14.0", + "prop-types": "15.7.2", "react": "^16.4.1", "react-dom": "^16.4.1", "react-scripts": "^1.1.4", diff --git a/packages/aaron/package.json b/packages/aaron/package.json index 18e99ad25ea..c19d1bb14d7 100644 --- a/packages/aaron/package.json +++ b/packages/aaron/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/aaron", + "version": "0.33.0", + "description": "A FreeSewing pattern for a A-shirt or tank top", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/aaron", - "nodebuild": "rollup -c -o ../../dist/aaron/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/aaron/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/aaron/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/aaron/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"aaron: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/aaron" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/aaron/rollup.config.js b/packages/aaron/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/aaron/rollup.config.js +++ b/packages/aaron/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/bent/package.json b/packages/bent/package.json index 4d4371249e2..92cf773b24a 100644 --- a/packages/bent/package.json +++ b/packages/bent/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/bent", + "version": "0.33.0", + "description": "A FreeSewing pattern for a menswear body block with a two-part sleeve", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/bent", - "nodebuild": "rollup -c -o ../../dist/bent/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/bent/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/bent/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/bent/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"bent: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/bent" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/bent/rollup.config.js b/packages/bent/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/bent/rollup.config.js +++ b/packages/bent/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/brian/package.json b/packages/brian/package.json index a198d651818..26458ddca96 100644 --- a/packages/brian/package.json +++ b/packages/brian/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/brian", + "version": "0.33.0", + "description": "A FreeSewing pattern for a basic body block for menswear", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/brian", - "nodebuild": "rollup -c -o ../../dist/brian/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/brian/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/brian/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/brian/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"brian: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -42,8 +45,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/brian" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/brian/rollup.config.js b/packages/brian/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/brian/rollup.config.js +++ b/packages/brian/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/bruce/package.json b/packages/bruce/package.json index b2233af6151..fc3c0fd37db 100644 --- a/packages/bruce/package.json +++ b/packages/bruce/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/bruce", + "version": "0.33.0", + "description": "A FreeSewing pattern for boxer briefs", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/bruce", - "nodebuild": "rollup -c -o ../../dist/bruce/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/bruce/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/bruce/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/bruce/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"bruce: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -42,8 +45,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/bruce" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/bruce/rollup.config.js b/packages/bruce/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/bruce/rollup.config.js +++ b/packages/bruce/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/carlita/package.json b/packages/carlita/package.json index 927880281a0..af4512100b9 100644 --- a/packages/carlita/package.json +++ b/packages/carlita/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/carlita", + "version": "0.33.0", + "description": "A FreeSewing pattern for Sherlock Holmes cosplay; Or just a nice long coat", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/carlita", - "nodebuild": "rollup -c -o ../../dist/carlita/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/carlita/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/carlita/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/carlita/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"carlita: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -44,8 +47,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/carlita" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/carlita/rollup.config.js b/packages/carlita/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/carlita/rollup.config.js +++ b/packages/carlita/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/carlton/package.json b/packages/carlton/package.json index b364d6b48a1..cc30a249275 100644 --- a/packages/carlton/package.json +++ b/packages/carlton/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/carlton", + "version": "0.33.0", + "description": "A FreeSewing pattern for Sherlock Holmes cosplay; Or just a nice long coat", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/carlton", - "nodebuild": "rollup -c -o ../../dist/carlton/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/carlton/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/carlton/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/carlton/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"carlton: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -42,8 +45,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/carlton" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/carlton/rollup.config.js b/packages/carlton/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/carlton/rollup.config.js +++ b/packages/carlton/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/cathrin/package.json b/packages/cathrin/package.json index 425ae5d0d44..e37f62f301f 100644 --- a/packages/cathrin/package.json +++ b/packages/cathrin/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/cathrin", + "version": "0.33.0", + "description": "A FreeSewing pattern for a underbust corset / waist trainer", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/cathrin", - "nodebuild": "rollup -c -o ../../dist/cathrin/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/cathrin/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/cathrin/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/cathrin/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"cathrin: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -42,8 +45,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/cathrin" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/cathrin/rollup.config.js b/packages/cathrin/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/cathrin/rollup.config.js +++ b/packages/cathrin/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/components/.babelrc b/packages/components/.babelrc new file mode 100644 index 00000000000..9eb56f36f76 --- /dev/null +++ b/packages/components/.babelrc @@ -0,0 +1,6 @@ +{ + "presets": [ + ["@babel/preset-env", { "modules": false }], + "@babel/preset-react", + ], +} diff --git a/packages/components/package.json b/packages/components/package.json index fc557d6d7ec..42263a29044 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/components", + "version": "0.33.0", + "description": "A collection of React components for FreeSewing web UIs", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -14,15 +17,16 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/components", - "nodebuild": "rollup -c -o ../../dist/components/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/components/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/components/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/components/index.mjs -f es", "build": "echo \"components: No build command available.\" && exit 0", "test": "echo \"components: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" }, - "peerDependencies": {}, - "dependencies": {}, - "devDependencies": {}, + "peerDependencies": { + "react": "^16.4.1", + "prop-types": "15.7.2" + }, "files": [ "../../dist/packages/components/*", "README.md", @@ -32,8 +36,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/components" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/components/rollup.config.js b/packages/components/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/components/rollup.config.js +++ b/packages/components/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/components/scripts/build.sh b/packages/components/scripts/build.sh new file mode 100755 index 00000000000..2b1ed9b16fc --- /dev/null +++ b/packages/components/scripts/build.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# We'll have to come up with a cross-platform way to handle this +# (as in, make sure it works on windows), but until that time +# this shell script will do. + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +CUR=`pwd` + +cd $DIR/../src/ +rm -rf ../../../dist/components +for d in * ; do { + cd .. + # do something here + mkdir -p ../../dist/components/$d + rollup -c ./rollup.config.js ./src/$d/index.js -m -o ../../dist/components/$d/index.js -f cjs + rollup -c ./rollup.config.js ./src/$d/index.js -m -o ../../dist/components/$d/index.mjs -f es + cd src +} +done +cd $CUR + + diff --git a/packages/core/package.json b/packages/core/package.json index 9dbd83f8bac..522e081222b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/core", + "version": "0.33.0", + "description": "A library for creating made-to-measure sewing patterns", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -22,13 +25,13 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/core", - "nodebuild": "rollup -c -o ../../dist/core/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/core/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/core/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/core/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", - "test": "nyc mocha tests/*.test.js", + "test": "BABEL_ENV=production nyc mocha tests/*.test.js", "pubtest": "npm publish --registry http://localhost:6662", - "report": "nyc report --reporter=html mocha --compilers js:babel-core/register tests/*.test.js", - "coverage": "nyc npm test && nyc report --reporter=text-lcov > coverage.lcov && ./node_modules/.bin/codecov" + "report": "BABEL_ENV=production nyc report --reporter=html mocha --compilers js:babel-core/register tests/*.test.js", + "coverage": "BABEL_ENV=production nyc npm test && nyc report --reporter=text-lcov > coverage.lcov && ./node_modules/.bin/codecov" }, "dependencies": { "bezier-js": "^2.2.13", @@ -44,8 +47,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/core" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/core/rollup.config.js b/packages/core/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/core/rollup.config.js +++ b/packages/core/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/create-freesewing-pattern/package.json b/packages/create-freesewing-pattern/package.json index 8eb2ff93352..330b448984a 100644 --- a/packages/create-freesewing-pattern/package.json +++ b/packages/create-freesewing-pattern/package.json @@ -1,4 +1,7 @@ { + "name": "create-freesewing-pattern", + "version": "0.33.0", + "description": "Initializer package for FreeSewing patterns: npm init FreeSewing-pattern", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -16,11 +19,13 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/create-freesewing-pattern", - "nodebuild": "rollup -c -o ../../dist/create-freesewing-pattern/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/create-freesewing-pattern/index.mjs -f es", - "build": "npm run clean && npm run nodebuild && npm run modulebuild", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/create-freesewing-pattern/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/create-freesewing-pattern/index.mjs -f es", + "build": "npm run clean && npm run mkdist && npm run copyfiles", "test": "ava -v && standard *.js lib/*.js", - "pubtest": "npm publish --registry http://localhost:6662" + "pubtest": "npm publish --registry http://localhost:6662", + "mkdist": "mkdir -p ../../dist/create-freesewing-pattern", + "copyfiles": "cp -R index.js package.json README.md lib template ../../dist/create-freesewing-pattern/" }, "dependencies": { "chalk": "^2.4.2", @@ -49,8 +54,11 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" + "node": ">=8.0.0", + "npm": ">=5" }, - "version": "0.33.0", - "name": "create-freesewing-pattern" + "reveal": true, + "bin": { + "create-freesewing-pattern": "index.js" + } } diff --git a/packages/create-freesewing-pattern/readme.md b/packages/create-freesewing-pattern/readme.md deleted file mode 100644 index 96eb1920456..00000000000 --- a/packages/create-freesewing-pattern/readme.md +++ /dev/null @@ -1,149 +0,0 @@ -# create-react-library - -> CLI for creating reusable, modern React libraries using Rollup and create-react-app. - -[![NPM](https://img.shields.io/npm/v/create-react-library.svg)](https://www.npmjs.com/package/create-react-library) [![Build Status](https://travis-ci.com/transitive-bullshit/create-react-library.svg?branch=master)](https://travis-ci.com/transitive-bullshit/create-react-library) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) - - -## Intro - -

- -

- - -## Features - -- Easy-to-use CLI -- Handles all modern JS features -- Bundles `cjs` and `es` module formats -- [create-react-app](https://github.com/facebookincubator/create-react-app) for example usage and local dev -- [Rollup](https://rollupjs.org/) for bundling -- [Babel](https://babeljs.io/) for transpiling -- [Jest](https://facebook.github.io/jest/) for testing -- Supports complicated peer-dependencies -- Supports CSS modules -- Optional support for TypeScript -- Sourcemap creation -- Hundreds of public modules created -- Thorough documentation :heart_eyes: -- [Chinese docs](./readme.zh-CN.md) by [@monsterooo](https://github.com/monsterooo) - - -## Install globally - -This package requires `node >= 4`, but we recommend `node >= 8`. - -```bash -npm install -g create-react-library -``` - -## Usage with npx - -```bash -npx create-react-library -``` - -_([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f))_ - -## Creating a New Module - -```bash -create-react-library -``` - -Answer some basic prompts about your module, and then the CLI will perform the following steps: -- copy over the template -- install dependencies via yarn or npm -- link packages together for local development -- initialize local git repo - -At this point, your new module should resemble this screenshot and is all setup for local development. - -

- -

- - -## Development - -Local development is broken into two parts (ideally using two tabs). - -First, run rollup to watch your `src/` module and automatically recompile it into `dist/` whenever you make changes. - -```bash -npm start # runs rollup with watch flag -``` - -The second part will be running the `example/` create-react-app that's linked to the local version of your module. - -```bash -# (in another tab) -cd example -npm start # runs create-react-app dev server -``` - -Now, anytime you make a change to your library in `src/` or to the example app's `example/src`, `create-react-app` will live-reload your local dev server so you can iterate on your component in real-time. - -![](https://media.giphy.com/media/12NUbkX6p4xOO4/giphy.gif) - - -#### Publishing to npm - -```bash -npm publish -``` - -This builds `cjs` and `es` versions of your module to `dist/` and then publishes your module to `npm`. - -Make sure that any npm modules you want as peer dependencies are properly marked as `peerDependencies` in `package.json`. The rollup config will automatically recognize them as peers and not try to bundle them in your module. - - -#### Deploying to Github Pages - -```bash -npm run deploy -``` - -This creates a production build of the example `create-react-app` that showcases your library and then runs `gh-pages` to deploy the resulting bundle. - - -## Examples - -### Multiple Named Exports - -Here is a [branch](https://github.com/transitive-bullshit/react-modern-library-boilerplate/tree/feature/multiple-exports) which demonstrates how to use multiple named exports. The module in this branch exports two components, `Foo` and `Bar`, and shows how to use them from the example app. - -### Material-UI - -Here is a [branch](https://github.com/transitive-bullshit/react-modern-library-boilerplate/tree/feature/material-ui) which demonstrates how to make use of a relatively complicated peer dependency, [material-ui](https://github.com/mui-org/material-ui). It shows the power of [rollup-plugin-peer-deps-external](https://www.npmjs.com/package/rollup-plugin-peer-deps-external) which makes it a breeze to create reusable modules that include complicated material-ui subcomponents without having them bundled as a part of your module. - -### Boilerplate - -The CLI is based on this [boilerplate](https://github.com/transitive-bullshit/react-modern-library-boilerplate), which you can optionally read about [here](https://hackernoon.com/publishing-baller-react-modules-2b039d84bce7). - -### Libraries - -Here are some example libraries that have been bootstrapped with `create-react-library`. - -- [tabler-react](https://github.com/tabler/tabler-react) - React components and demo for the Tabler UI theme. -- [react-background-slideshow](https://github.com/transitive-bullshit/react-background-slideshow) - Sexy tiled background slideshow for React 🔥 -- [react-starfield-animation](https://github.com/transitive-bullshit/react-starfield-animation) -Canvas-based starfield animation for React ✨ -- [react-particle-effect-button](https://github.com/transitive-bullshit/react-particle-effect-button) - Bursting particle effect buttons for React 🎉 -- [react-particle-animation](https://github.com/transitive-bullshit/react-particle-animation) - Canvas-based particle animation for React 🌐 -- [react-block-image](https://github.com/transitive-bullshit/react-block-image) - React replacement for img with more control + fallback support 🌃 -- [react-mp3-recorder](https://github.com/transitive-bullshit/react-mp3-recorder) - Microphone recorder for React that captures mp3 audio 🎵 -- [react-before-after-slider](https://github.com/transitive-bullshit/react-before-after-slider) - A sexy image comparison slider for React. -- [worldwind-react-globe](https://github.com/emxsys/worldwind-react-globe) - NASA WorldWind globe component for React. -- [react-shimmer](https://github.com/gokcan/react-shimmer) - Shimmer effect for loading images. -- [react-login-modal-sm](https://github.com/Silind/react-login-modal-sm) - Customizable React social media login modal. -- [react-gradient-scroll-indicator](https://github.com/jbccollins/react-gradient-scroll-indicator) - Wrapper for scrollable content with gradients. -- [react-editext](https://github.com/alioguzhan/react-editext) - Editable Text Component. -- ... and hundreds more! - -Want to add yours to the list? Submit an [issue](https://github.com/transitive-bullshit/create-react-library/issues/new). - - -## License - -MIT © [Travis Fischer](https://github.com/transitive-bullshit) diff --git a/packages/css-theme/package.json b/packages/css-theme/package.json index cedc1816262..8badf447997 100644 --- a/packages/css-theme/package.json +++ b/packages/css-theme/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/css-theme", + "version": "0.33.0", + "description": "A CSS theme for FreeSewing web UIs", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -17,9 +20,9 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/css-theme", - "nodebuild": "rollup -c -o ../../dist/css-theme/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/css-theme/index.mjs -f es", - "build": "npm run clean && npm run nodebuild && npm run modulebuild", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/css-theme/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/css-theme/index.mjs -f es", + "build": "npx node-sass --output-style compressed src/theme.scss ../../dist/css-theme/theme.css", "test": "echo \"css-theme: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" }, @@ -35,8 +38,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/css-theme" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/examples/package.json b/packages/examples/package.json index db3c0c13626..b69eea816eb 100644 --- a/packages/examples/package.json +++ b/packages/examples/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/examples", + "version": "0.33.0", + "description": "A FreeSewing pattern holding examples for our documentation", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -16,8 +19,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/examples", - "nodebuild": "rollup -c -o ../../dist/examples/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/examples/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/examples/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/examples/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"examples: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -37,8 +40,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/examples" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/examples/rollup.config.js b/packages/examples/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/examples/rollup.config.js +++ b/packages/examples/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/florent/package.json b/packages/florent/package.json index f8bba14353c..c86978803df 100644 --- a/packages/florent/package.json +++ b/packages/florent/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/florent", + "version": "0.33.0", + "description": "A FreeSewing pattern for a flat cap", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/florent", - "nodebuild": "rollup -c -o ../../dist/florent/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/florent/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/florent/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/florent/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"florent: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -42,8 +45,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/florent" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/florent/rollup.config.js b/packages/florent/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/florent/rollup.config.js +++ b/packages/florent/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/huey/package.json b/packages/huey/package.json index 701db9b1922..a4c3899b9e6 100644 --- a/packages/huey/package.json +++ b/packages/huey/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/huey", + "version": "0.33.0", + "description": "A FreeSewing pattern for a zip-up hoodie", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/huey", - "nodebuild": "rollup -c -o ../../dist/huey/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/huey/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/huey/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/huey/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"huey: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -42,8 +45,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/huey" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/huey/rollup.config.js b/packages/huey/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/huey/rollup.config.js +++ b/packages/huey/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/hugo/package.json b/packages/hugo/package.json index 4b8da12ddae..4c6efde811f 100644 --- a/packages/hugo/package.json +++ b/packages/hugo/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/hugo", + "version": "0.33.0", + "description": "A FreeSewing pattern for a hooded jumper with raglan sleeves", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/hugo", - "nodebuild": "rollup -c -o ../../dist/hugo/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/hugo/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/hugo/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/hugo/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"hugo: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -42,8 +45,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/hugo" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/hugo/rollup.config.js b/packages/hugo/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/hugo/rollup.config.js +++ b/packages/hugo/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/i18n/package.json b/packages/i18n/package.json index cc8705bac67..4deb95d8fc1 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/i18n", + "version": "0.33.0", + "description": "Translations for the FreeSewing project", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -18,8 +21,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/i18n", - "nodebuild": "rollup -c -o ../../dist/i18n/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/i18n/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/i18n/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/i18n/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"i18n: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -36,8 +39,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/i18n" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/i18n/rollup.config.js b/packages/i18n/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/i18n/rollup.config.js +++ b/packages/i18n/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/jaeger/package.json b/packages/jaeger/package.json index 7e72ccc9abe..dafe97d2482 100644 --- a/packages/jaeger/package.json +++ b/packages/jaeger/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/jaeger", + "version": "0.33.0", + "description": "A FreeSewing pattern for a sport coat style jacket", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/jaeger", - "nodebuild": "rollup -c -o ../../dist/jaeger/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/jaeger/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/jaeger/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/jaeger/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"jaeger: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -42,8 +45,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/jaeger" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/jaeger/rollup.config.js b/packages/jaeger/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/jaeger/rollup.config.js +++ b/packages/jaeger/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/models/package.json b/packages/models/package.json index 582017fcba4..2ca4485ab6c 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/models", + "version": "0.33.0", + "description": "Body measurements data for a range of default sizes", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -18,8 +21,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/models", - "nodebuild": "rollup -c -o ../../dist/models/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/models/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/models/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/models/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"models: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -36,8 +39,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/models" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/models/rollup.config.js b/packages/models/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/models/rollup.config.js +++ b/packages/models/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/mui-theme/package.json b/packages/mui-theme/package.json index 4185a5072bf..61ca17aee56 100644 --- a/packages/mui-theme/package.json +++ b/packages/mui-theme/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/mui-theme", + "version": "0.33.0", + "description": "A Material-UI theme for FreeSewing web UIs", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -16,8 +19,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/mui-theme", - "nodebuild": "rollup -c -o ../../dist/mui-theme/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/mui-theme/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/mui-theme/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/mui-theme/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"mui-theme: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -36,8 +39,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/mui-theme" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/mui-theme/rollup.config.js b/packages/mui-theme/rollup.config.js new file mode 100644 index 00000000000..05d5097b581 --- /dev/null +++ b/packages/mui-theme/rollup.config.js @@ -0,0 +1,27 @@ +import babel from "rollup-plugin-babel"; +import resolve from "rollup-plugin-node-resolve"; +import json from "rollup-plugin-json"; +import minify from "rollup-plugin-babel-minify"; +import peerDepsExternal from "rollup-plugin-peer-deps-external"; +import { name, version, description, author, license } from "./package.json"; + +export default { + input: "src/index.js", + output: { + sourcemap: true + }, + plugins: [ + peerDepsExternal(), + resolve({ modulesOnly: true }), + json(), + babel({ + exclude: "node_modules/**", + plugins: ["@babel/plugin-proposal-object-rest-spread"] + }), + minify({ + comments: false, + sourceMap: true, + banner: `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */` + }) + ] +}; diff --git a/packages/patterns/package.json b/packages/patterns/package.json index b5aea252ba1..863d3dfd958 100644 --- a/packages/patterns/package.json +++ b/packages/patterns/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/patterns", + "version": "0.33.0", + "description": "An umbrella package for all FreeSewing patterns", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/patterns", - "nodebuild": "rollup -c -o ../../dist/patterns/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/patterns/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/patterns/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/patterns/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"patterns: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -55,8 +58,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/patterns" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/patterns/rollup.config.js b/packages/patterns/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/patterns/rollup.config.js +++ b/packages/patterns/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/plugin-banner/package.json b/packages/plugin-banner/package.json index e86f7c57385..29a3fb3d3d5 100644 --- a/packages/plugin-banner/package.json +++ b/packages/plugin-banner/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/plugin-banner", + "version": "0.33.0", + "description": "A FreeSewing plugin to repeat text on a path", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/plugin-banner", - "nodebuild": "rollup -c -o ../../dist/plugin-banner/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/plugin-banner/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-banner/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-banner/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"plugin-banner: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/plugin-banner" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/plugin-banner/rollup.config.js b/packages/plugin-banner/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/plugin-banner/rollup.config.js +++ b/packages/plugin-banner/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/plugin-bundle/package.json b/packages/plugin-bundle/package.json index 25f13cb3c54..038315a4790 100644 --- a/packages/plugin-bundle/package.json +++ b/packages/plugin-bundle/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/plugin-bundle", + "version": "0.33.0", + "description": "An umbrella package of 8 essential FreeSewing build-time plugins", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -22,8 +25,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/plugin-bundle", - "nodebuild": "rollup -c -o ../../dist/plugin-bundle/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/plugin-bundle/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-bundle/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-bundle/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"plugin-bundle: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -42,8 +45,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/plugin-bundle" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/plugin-bundle/rollup.config.js b/packages/plugin-bundle/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/plugin-bundle/rollup.config.js +++ b/packages/plugin-bundle/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/plugin-bust/package.json b/packages/plugin-bust/package.json index da5e9941dbb..699cf3033f6 100644 --- a/packages/plugin-bust/package.json +++ b/packages/plugin-bust/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/plugin-bust", + "version": "0.33.0", + "description": "A FreeSewing plugin that helps with bust-adjusting menswear patterns", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/plugin-bust", - "nodebuild": "rollup -c -o ../../dist/plugin-bust/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/plugin-bust/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-bust/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-bust/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"plugin-bust: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/plugin-bust" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/plugin-bust/rollup.config.js b/packages/plugin-bust/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/plugin-bust/rollup.config.js +++ b/packages/plugin-bust/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/plugin-buttons/package.json b/packages/plugin-buttons/package.json index 1e9165e6b99..e95401a557a 100644 --- a/packages/plugin-buttons/package.json +++ b/packages/plugin-buttons/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/plugin-buttons", + "version": "0.33.0", + "description": "A FreeSewing plugin that provides button and buttonhole snippets", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/plugin-buttons", - "nodebuild": "rollup -c -o ../../dist/plugin-buttons/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/plugin-buttons/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-buttons/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-buttons/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"plugin-buttons: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/plugin-buttons" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/plugin-buttons/rollup.config.js b/packages/plugin-buttons/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/plugin-buttons/rollup.config.js +++ b/packages/plugin-buttons/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/plugin-cutonfold/package.json b/packages/plugin-cutonfold/package.json index 8838affd450..2ab80cee11d 100644 --- a/packages/plugin-cutonfold/package.json +++ b/packages/plugin-cutonfold/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/plugin-cutonfold", + "version": "0.33.0", + "description": "A FreeSewing plugin to add cut-on-fold indicators on your patterns", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/plugin-cutonfold", - "nodebuild": "rollup -c -o ../../dist/plugin-cutonfold/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/plugin-cutonfold/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-cutonfold/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-cutonfold/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"plugin-cutonfold: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/plugin-cutonfold" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/plugin-cutonfold/rollup.config.js b/packages/plugin-cutonfold/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/plugin-cutonfold/rollup.config.js +++ b/packages/plugin-cutonfold/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/plugin-debug/package.json b/packages/plugin-debug/package.json index 9c4844feade..edf3bdc0270 100644 --- a/packages/plugin-debug/package.json +++ b/packages/plugin-debug/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/plugin-debug", + "version": "0.33.0", + "description": "A FreeSewing plugin to log debug info to your browser console", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/plugin-debug", - "nodebuild": "rollup -c -o ../../dist/plugin-debug/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/plugin-debug/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-debug/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-debug/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"plugin-debug: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/plugin-debug" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/plugin-debug/rollup.config.js b/packages/plugin-debug/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/plugin-debug/rollup.config.js +++ b/packages/plugin-debug/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/plugin-designer/package.json b/packages/plugin-designer/package.json index 5c011bd48ec..3473378fffc 100644 --- a/packages/plugin-designer/package.json +++ b/packages/plugin-designer/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/plugin-designer", + "version": "0.33.0", + "description": "A FreeSewing plugin to facilitate pattern design", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/plugin-designer", - "nodebuild": "rollup -c -o ../../dist/plugin-designer/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/plugin-designer/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-designer/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-designer/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"plugin-designer: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/plugin-designer" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/plugin-designer/rollup.config.js b/packages/plugin-designer/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/plugin-designer/rollup.config.js +++ b/packages/plugin-designer/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/plugin-dimension/package.json b/packages/plugin-dimension/package.json index 4b742b1da2a..eba69d718ba 100644 --- a/packages/plugin-dimension/package.json +++ b/packages/plugin-dimension/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/plugin-dimension", + "version": "0.33.0", + "description": "A FreeSewing plugin to add dimensions to your (paperless) pattern", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/plugin-dimension", - "nodebuild": "rollup -c -o ../../dist/plugin-dimension/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/plugin-dimension/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-dimension/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-dimension/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"plugin-dimension: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/plugin-dimension" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/plugin-dimension/rollup.config.js b/packages/plugin-dimension/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/plugin-dimension/rollup.config.js +++ b/packages/plugin-dimension/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/plugin-flip/package.json b/packages/plugin-flip/package.json index ca910e92516..90920543641 100644 --- a/packages/plugin-flip/package.json +++ b/packages/plugin-flip/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/plugin-flip", + "version": "0.33.0", + "description": "A FreeSewing plugin to flip parts horizontally", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/plugin-flip", - "nodebuild": "rollup -c -o ../../dist/plugin-flip/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/plugin-flip/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-flip/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-flip/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"plugin-flip: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/plugin-flip" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/plugin-flip/rollup.config.js b/packages/plugin-flip/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/plugin-flip/rollup.config.js +++ b/packages/plugin-flip/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/plugin-grainline/package.json b/packages/plugin-grainline/package.json index d794471d6fb..987446d8276 100644 --- a/packages/plugin-grainline/package.json +++ b/packages/plugin-grainline/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/plugin-grainline", + "version": "0.33.0", + "description": "A FreeSewing plugin to add grainline indicators on your patterns", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/plugin-grainline", - "nodebuild": "rollup -c -o ../../dist/plugin-grainline/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/plugin-grainline/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-grainline/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-grainline/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"plugin-grainline: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/plugin-grainline" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/plugin-grainline/rollup.config.js b/packages/plugin-grainline/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/plugin-grainline/rollup.config.js +++ b/packages/plugin-grainline/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/plugin-i18n/package.json b/packages/plugin-i18n/package.json index d1d183b1310..92c2c3ec775 100644 --- a/packages/plugin-i18n/package.json +++ b/packages/plugin-i18n/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/plugin-i18n", + "version": "0.33.0", + "description": "A FreeSewing plugin for pattern translation", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/plugin-i18n", - "nodebuild": "rollup -c -o ../../dist/plugin-i18n/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/plugin-i18n/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-i18n/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-i18n/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"plugin-i18n: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/plugin-i18n" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/plugin-i18n/rollup.config.js b/packages/plugin-i18n/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/plugin-i18n/rollup.config.js +++ b/packages/plugin-i18n/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/plugin-logo/package.json b/packages/plugin-logo/package.json index f915874d641..2b9ffb08096 100644 --- a/packages/plugin-logo/package.json +++ b/packages/plugin-logo/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/plugin-logo", + "version": "0.33.0", + "description": "A FreeSewing plugin to add our logo to your patterns", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/plugin-logo", - "nodebuild": "rollup -c -o ../../dist/plugin-logo/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/plugin-logo/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-logo/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-logo/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"plugin-logo: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/plugin-logo" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/plugin-logo/rollup.config.js b/packages/plugin-logo/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/plugin-logo/rollup.config.js +++ b/packages/plugin-logo/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/plugin-round/package.json b/packages/plugin-round/package.json index 38d03c4712e..425a4bd3cf4 100644 --- a/packages/plugin-round/package.json +++ b/packages/plugin-round/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/plugin-round", + "version": "0.33.0", + "description": "A FreeSewing plugin to round corners", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/plugin-round", - "nodebuild": "rollup -c -o ../../dist/plugin-round/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/plugin-round/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-round/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-round/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"plugin-round: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/plugin-round" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/plugin-round/rollup.config.js b/packages/plugin-round/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/plugin-round/rollup.config.js +++ b/packages/plugin-round/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/plugin-scalebox/package.json b/packages/plugin-scalebox/package.json index f00e1c1a827..ae5de18ed4c 100644 --- a/packages/plugin-scalebox/package.json +++ b/packages/plugin-scalebox/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/plugin-scalebox", + "version": "0.33.0", + "description": "A FreeSewing plugin to add a scalebox to your pattern", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/plugin-scalebox", - "nodebuild": "rollup -c -o ../../dist/plugin-scalebox/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/plugin-scalebox/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-scalebox/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-scalebox/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"plugin-scalebox: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/plugin-scalebox" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/plugin-scalebox/rollup.config.js b/packages/plugin-scalebox/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/plugin-scalebox/rollup.config.js +++ b/packages/plugin-scalebox/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/plugin-sprinkle/package.json b/packages/plugin-sprinkle/package.json index f9365770e57..3de9be66b95 100644 --- a/packages/plugin-sprinkle/package.json +++ b/packages/plugin-sprinkle/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/plugin-sprinkle", + "version": "0.33.0", + "description": "A FreeSewing plugin to bulk-add snippets to your pattern", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/plugin-sprinkle", - "nodebuild": "rollup -c -o ../../dist/plugin-sprinkle/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/plugin-sprinkle/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-sprinkle/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-sprinkle/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"plugin-sprinkle: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/plugin-sprinkle" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/plugin-sprinkle/rollup.config.js b/packages/plugin-sprinkle/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/plugin-sprinkle/rollup.config.js +++ b/packages/plugin-sprinkle/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/plugin-svgattr/package.json b/packages/plugin-svgattr/package.json index 93cc1ad8cc6..70e2ee6c41f 100644 --- a/packages/plugin-svgattr/package.json +++ b/packages/plugin-svgattr/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/plugin-svgattr", + "version": "0.33.0", + "description": "A FreeSewing plugin to set SVG attributes", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/plugin-svgattr", - "nodebuild": "rollup -c -o ../../dist/plugin-svgattr/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/plugin-svgattr/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-svgattr/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-svgattr/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"plugin-svgattr: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/plugin-svgattr" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/plugin-svgattr/rollup.config.js b/packages/plugin-svgattr/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/plugin-svgattr/rollup.config.js +++ b/packages/plugin-svgattr/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/plugin-theme/.babelrc b/packages/plugin-theme/.babelrc deleted file mode 100644 index 957cae3e64d..00000000000 --- a/packages/plugin-theme/.babelrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "presets": [ - [ - "@babel/preset-env", - { - "useBuiltIns": "entry" - } - ] - ] -} diff --git a/packages/plugin-theme/package.json b/packages/plugin-theme/package.json index 569b0747ad9..9371b091562 100644 --- a/packages/plugin-theme/package.json +++ b/packages/plugin-theme/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/plugin-theme", + "version": "0.33.0", + "description": "A FreeSewing plugin that provides a default theme", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/plugin-theme", - "nodebuild": "rollup -c -o ../../dist/plugin-theme/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/plugin-theme/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-theme/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-theme/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"plugin-theme: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/plugin-theme" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/plugin-theme/rollup.config.js b/packages/plugin-theme/rollup.config.js index c9a1e4db027..824efb1ccaf 100644 --- a/packages/plugin-theme/rollup.config.js +++ b/packages/plugin-theme/rollup.config.js @@ -3,15 +3,15 @@ import babel from "rollup-plugin-babel"; import resolve from "rollup-plugin-node-resolve"; import json from "rollup-plugin-json"; import sass from "rollup-plugin-sass"; +import peerDepsExternal from "rollup-plugin-peer-deps-external"; import { version, name, description, author, license } from "./package.json"; import fs from "fs"; export default { input: "src/index.js", plugins: [ - resolve({ - browser: true - }), + peerDepsExternal(), + resolve(), json(), babel({ exclude: "node_modules/**" diff --git a/packages/plugin-title/package.json b/packages/plugin-title/package.json index 338668980a8..0249f64de85 100644 --- a/packages/plugin-title/package.json +++ b/packages/plugin-title/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/plugin-title", + "version": "0.33.0", + "description": "A FreeSewing plugin to add a title to your pattern parts", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/plugin-title", - "nodebuild": "rollup -c -o ../../dist/plugin-title/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/plugin-title/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-title/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-title/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"plugin-title: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/plugin-title" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/plugin-title/rollup.config.js b/packages/plugin-title/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/plugin-title/rollup.config.js +++ b/packages/plugin-title/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/plugin-validate/package.json b/packages/plugin-validate/package.json index 59c447e2e49..d8e1ab6bf65 100644 --- a/packages/plugin-validate/package.json +++ b/packages/plugin-validate/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/plugin-validate", + "version": "0.33.0", + "description": "A FreeSewing plugin that validates aspects of your code", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/plugin-validate", - "nodebuild": "rollup -c -o ../../dist/plugin-validate/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/plugin-validate/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-validate/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/plugin-validate/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"plugin-validate: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -41,8 +44,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/plugin-validate" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/plugin-validate/rollup.config.js b/packages/plugin-validate/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/plugin-validate/rollup.config.js +++ b/packages/plugin-validate/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/shin/package.json b/packages/shin/package.json index 526ee0bcfc2..79774e5bb59 100644 --- a/packages/shin/package.json +++ b/packages/shin/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/shin", + "version": "0.33.0", + "description": "A FreeSewing pattern for swim trunks", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/shin", - "nodebuild": "rollup -c -o ../../dist/shin/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/shin/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/shin/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/shin/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"shin: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -42,8 +45,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/shin" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/shin/rollup.config.js b/packages/shin/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/shin/rollup.config.js +++ b/packages/shin/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/simon/package.json b/packages/simon/package.json index 7c3765b70d9..e6db92492c5 100644 --- a/packages/simon/package.json +++ b/packages/simon/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/simon", + "version": "0.33.0", + "description": "A FreeSewing pattern for a button down shirt", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/simon", - "nodebuild": "rollup -c -o ../../dist/simon/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/simon/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/simon/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/simon/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"simon: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -42,8 +45,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/simon" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/simon/rollup.config.js b/packages/simon/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/simon/rollup.config.js +++ b/packages/simon/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/sven/package.json b/packages/sven/package.json index 5c1081838a1..173cb3e4aba 100644 --- a/packages/sven/package.json +++ b/packages/sven/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/sven", + "version": "0.33.0", + "description": "A FreeSewing pattern for a straightforward sweater", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/sven", - "nodebuild": "rollup -c -o ../../dist/sven/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/sven/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/sven/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/sven/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"sven: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -42,8 +45,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/sven" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/sven/rollup.config.js b/packages/sven/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/sven/rollup.config.js +++ b/packages/sven/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/tamiko/package.json b/packages/tamiko/package.json index 0b008843213..c648c2ab9f1 100644 --- a/packages/tamiko/package.json +++ b/packages/tamiko/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/tamiko", + "version": "0.33.0", + "description": "A FreeSewing pattern for a zero-waste top", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/tamiko", - "nodebuild": "rollup -c -o ../../dist/tamiko/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/tamiko/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/tamiko/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/tamiko/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"tamiko: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -42,8 +45,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/tamiko" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/tamiko/rollup.config.js b/packages/tamiko/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/tamiko/rollup.config.js +++ b/packages/tamiko/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/trayvon/package.json b/packages/trayvon/package.json index 712e3b5710a..acfe30ecfb0 100644 --- a/packages/trayvon/package.json +++ b/packages/trayvon/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/trayvon", + "version": "0.33.0", + "description": "A FreeSewing pattern for a tie", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/trayvon", - "nodebuild": "rollup -c -o ../../dist/trayvon/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/trayvon/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/trayvon/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/trayvon/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"trayvon: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -42,8 +45,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/trayvon" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/trayvon/rollup.config.js b/packages/trayvon/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/trayvon/rollup.config.js +++ b/packages/trayvon/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/wahid/package.json b/packages/wahid/package.json index c2e61b375c8..705411c0386 100644 --- a/packages/wahid/package.json +++ b/packages/wahid/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/wahid", + "version": "0.33.0", + "description": "A FreeSewing pattern for a classic fitted waistcoat", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -21,8 +24,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/wahid", - "nodebuild": "rollup -c -o ../../dist/wahid/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/wahid/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/wahid/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/wahid/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "echo \"wahid: No tests configured. Perhaps you'd like to do this?\" && exit 0", "pubtest": "npm publish --registry http://localhost:6662" @@ -42,8 +45,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/wahid" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/wahid/rollup.config.js b/packages/wahid/rollup.config.js index 278315399d9..05d5097b581 100644 --- a/packages/wahid/rollup.config.js +++ b/packages/wahid/rollup.config.js @@ -12,7 +12,7 @@ export default { }, plugins: [ peerDepsExternal(), - resolve({ browser: true }), + resolve({ modulesOnly: true }), json(), babel({ exclude: "node_modules/**", diff --git a/packages/workbench/.babelrc b/packages/workbench/.babelrc index 86653dc5e00..9420cb414c5 100644 --- a/packages/workbench/.babelrc +++ b/packages/workbench/.babelrc @@ -1,12 +1,6 @@ { "presets": [ - ["env", { - "modules": false - }], - "stage-0", - "react" + ["@babel/preset-env", { "modules": false }], + "@babel/preset-react" ], - "plugins": [ - ["transform-object-rest-spread", { "useBuiltIns": true }] - ] } diff --git a/packages/workbench/package.json b/packages/workbench/package.json index 5f8edd05eaf..f2ff17d4bc9 100644 --- a/packages/workbench/package.json +++ b/packages/workbench/package.json @@ -1,4 +1,7 @@ { + "name": "@freesewing/workbench", + "version": "0.33.0", + "description": "A React component to facilitate FreeSewing pattern design", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", @@ -15,8 +18,8 @@ "module": "dist/index.mjs", "scripts": { "clean": "rimraf ../../dist/workbench", - "nodebuild": "rollup -c -o ../../dist/workbench/index.js -f cjs", - "modulebuild": "rollup -c -o ../../dist/workbench/index.mjs -f es", + "nodebuild": "BABEL_ENV=production rollup -c -o ../../dist/workbench/index.js -f cjs", + "modulebuild": "BABEL_ENV=production rollup -c -o ../../dist/workbench/index.mjs -f es", "build": "npm run clean && npm run nodebuild && npm run modulebuild", "test": "cross-env CI=1 react-scripts test --env=jsdom", "pubtest": "npm publish --registry http://localhost:6662", @@ -37,8 +40,7 @@ "access": "public" }, "engines": { - "node": ">=8.0.0" - }, - "version": "0.33.0", - "name": "@freesewing/workbench" + "node": ">=8.0.0", + "npm": ">=5" + } } diff --git a/packages/workbench/rollup.config.js b/packages/workbench/rollup.config.js new file mode 100644 index 00000000000..e653f94e296 --- /dev/null +++ b/packages/workbench/rollup.config.js @@ -0,0 +1,32 @@ +import babel from "rollup-plugin-babel"; +import resolve from "rollup-plugin-node-resolve"; +import json from "rollup-plugin-json"; +import minify from "rollup-plugin-babel-minify"; +import peerDepsExternal from "rollup-plugin-peer-deps-external"; +import sass from "rollup-plugin-sass"; +import { name, version, description, author, license } from "./package.json"; + +export default { + input: "src/index.js", + output: { + sourcemap: true + }, + plugins: [ + peerDepsExternal(), + resolve({ modulesOnly: true }), + json(), + babel({ + exclude: "node_modules/**", + plugins: [ + "@babel/plugin-proposal-object-rest-spread", + "@babel/plugin-proposal-class-properties" + ] + }), + sass(), + minify({ + comments: false, + sourceMap: true, + banner: `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */` + }) + ] +}; diff --git a/packages/workbench/src/components/ButtonPicker.js b/packages/workbench/src/components/ButtonPicker.js index 65f009308b5..88cd9225df4 100644 --- a/packages/workbench/src/components/ButtonPicker.js +++ b/packages/workbench/src/components/ButtonPicker.js @@ -4,34 +4,65 @@ import Emblem from "./Emblem"; import { i18n } from "@freesewing/i18n"; import { version } from "../../package.json"; import { FormattedMessage } from "react-intl"; -import css from "./css/ButtonPicker.css"; +import css from "./scss/ButtonPicker.scss"; const ButtonPicker = props => (
- - { props.msgKey - ?

- :
- } + + {props.msgKey ? ( +

+ +

+ ) : ( +
+ +
+ )}
- {props.keys.map((key) => ( - - ) - )} + ))}
diff --git a/packages/workbench/src/components/NavBar.js b/packages/workbench/src/components/NavBar.js index e3b4f138fa2..e4633868d19 100644 --- a/packages/workbench/src/components/NavBar.js +++ b/packages/workbench/src/components/NavBar.js @@ -1,34 +1,49 @@ import React from "react"; import Logo from "./Logo"; import Emblem from "./Emblem"; -import css from "./css/NavBar.css"; +import css from "./scss/NavBar.scss"; import { FormattedMessage } from "react-intl"; const NavBar = props => { const goToHelp = () => - window.location.href = "https://freesewing.dev/"+props.locale+"/workbench"; + (window.location.href = + "https://freesewing.dev/" + props.locale + "/workbench"); return ( -
- { props.empty - ? "" - : -
+
+ {props.empty ? ( + "" + ) : ( + +
+ +
- +
- { props.pattern ? ( - - - - - ) : "" - } + {props.pattern ? ( + + + + + ) : ( + "" + )} @@ -37,8 +52,8 @@ const NavBar = props => {
- } -
-); -} + )} +
+ ); +}; export default NavBar; diff --git a/packages/workbench/src/components/css/ButtonPicker.css b/packages/workbench/src/components/scss/ButtonPicker.scss similarity index 100% rename from packages/workbench/src/components/css/ButtonPicker.css rename to packages/workbench/src/components/scss/ButtonPicker.scss diff --git a/packages/workbench/src/components/css/Config.css b/packages/workbench/src/components/scss/Config.scss similarity index 100% rename from packages/workbench/src/components/css/Config.css rename to packages/workbench/src/components/scss/Config.scss diff --git a/packages/workbench/src/components/css/Help.css b/packages/workbench/src/components/scss/Help.scss similarity index 100% rename from packages/workbench/src/components/css/Help.css rename to packages/workbench/src/components/scss/Help.scss diff --git a/packages/workbench/src/components/css/NavBar.css b/packages/workbench/src/components/scss/NavBar.scss similarity index 100% rename from packages/workbench/src/components/css/NavBar.css rename to packages/workbench/src/components/scss/NavBar.scss diff --git a/packages/workbench/src/components/css/Settings.css b/packages/workbench/src/components/scss/Settings.scss similarity index 100% rename from packages/workbench/src/components/css/Settings.css rename to packages/workbench/src/components/scss/Settings.scss diff --git a/packages/workbench/src/components/settings/Config.js b/packages/workbench/src/components/settings/Config.js index e8295bdb103..0f5396937fe 100644 --- a/packages/workbench/src/components/settings/Config.js +++ b/packages/workbench/src/components/settings/Config.js @@ -1,30 +1,51 @@ import React from "react"; import Emblem from "../Emblem"; import { FormattedMessage } from "react-intl"; -import css from "../css/Config.css"; +import css from "../scss/Config.scss"; const Config = props => { console.log(props.pattern); - const emblem = (t1, t2) => - + const emblem = (t1, t2) => ( + + ); const renderConfig = () => { let c = props.pattern.config; let rows = []; for (let key of ["name", "version"]) - rows.push( - {key}: - {c[key]} - ); + rows.push( + + + {key}: + {c[key]} + + + ); for (let key of ["measurements", "parts", "hide"]) { let list = []; if (typeof c[key] !== "undefined") { - for (let item of c[key]) list.push(
  • {item}
  • ); - rows.push( - {key}: -
      {list}
    - ); - } else rows.push({key}:); + for (let item of c[key]) + list.push( +
  • + {item} +
  • + ); + rows.push( + + + {key}: +
      {list}
    + + + ); + } else + rows.push( + + + {key}: + + + ); } for (let key of ["dependencies", "inject"]) { if (typeof c[key] !== "undefined") { @@ -32,42 +53,55 @@ const Config = props => { for (let item of Object.keys(c[key])) { let values = null; if (typeof c[key][item] === "string") { - list.push(
  • - {item} - { key === "inject" ? " «" : ":"} - - {c[key][item]} -
  • ); + list.push( +
  • + + {item} + {key === "inject" ? " «" : ":"} + + {c[key][item]} +
  • + ); } else if (c[key][item].length > 0) { - list.push(
  • - {item}: - {c[key][item].map(v => v+" ")} -
  • ); - + list.push( +
  • + {item}: + + {c[key][item].map(v => v + " ")} + +
  • + ); } } - rows.push( - {key}: -
      {list}
    - ); - } else rows.push({key}:); + rows.push( + + + {key}: +
      {list}
    + + + ); + } else + rows.push( + + + {key}: + + + ); } return ( - + + + - - {rows} - + {rows}
    {emblem("config",".js")}
    {emblem("config", ".js")}
    ); - } + }; - return ( -
    - {renderConfig()} -
    - ); -} + return
    {renderConfig()}
    ; +}; export default Config; diff --git a/packages/workbench/src/components/settings/Measurements.js b/packages/workbench/src/components/settings/Measurements.js index e6c39f65665..c6de1eee46c 100644 --- a/packages/workbench/src/components/settings/Measurements.js +++ b/packages/workbench/src/components/settings/Measurements.js @@ -1,25 +1,27 @@ import React from "react"; import Emblem from "../Emblem"; import { FormattedMessage } from "react-intl"; -import css from "../css/Config.css"; +import css from "../scss/Config.scss"; const Measurements = props => { - const emblem = (t1, t2) => - + const emblem = (t1, t2) => ( + + ); return (
    - + + + - - +
    + +
    -
    -        {JSON.stringify(props, null, 2)}
    -      
    +
    {JSON.stringify(props, null, 2)}
    ); -} +}; export default Measurements; diff --git a/packages/workbench/src/components/settings/Options.js b/packages/workbench/src/components/settings/Options.js index 03d438041cb..304998dfb6d 100644 --- a/packages/workbench/src/components/settings/Options.js +++ b/packages/workbench/src/components/settings/Options.js @@ -1,11 +1,12 @@ import React from "react"; import Emblem from "../Emblem"; import { FormattedMessage } from "react-intl"; -import css from "../css/Config.css"; +import css from "../scss/Config.scss"; const Options = props => { - const emblem = (t1, t2) => - + const emblem = (t1, t2) => ( + + ); const renderOptions = () => { let c = props.pattern.config; @@ -15,72 +16,127 @@ const Options = props => { for (let item of Object.keys(c.options).sort()) { let values = null; if (typeof c.options[item] === "boolean") { - rows.push( - {item}: - {c.options[item] ? "TRUE" : "FALSE"} - ); + rows.push( + + + {item}: + + {c.options[item] ? "TRUE" : "FALSE"} + + + + ); } else if (typeof c.options[item] !== "object") { - rows.push( - {item}: - {c.options[item]} - ); + rows.push( + + + {item}: + {c.options[item]} + + + ); } else { if (typeof c.options[item].pct !== "undefined") { - rows.push( - {item}: - - {c.options[item].min}% - {" / "} - {c.options[item].pct}% - {" / "} - {c.options[item].max}% - - ); + rows.push( + + + {item}: + + {c.options[item].min}%{" / "} + {c.options[item].pct}% + {" / "} + {c.options[item].max}% + + + + ); } else if (typeof c.options[item].deg !== "undefined") { - rows.push( - {item}: - - {c.options[item].min}° - {" / "} - {c.options[item].deg}° - {" / "} - {c.options[item].max}° - - ); + rows.push( + + + {item}: + + {c.options[item].min} + ° + {" / "} + + {c.options[item].deg} + ° + + {" / "} + {c.options[item].max} + ° + + + + ); } else if (typeof c.options[item].mm !== "undefined") { - rows.push( - {item}: - - {c.options[item].min}mm; - {" / "} - {c.options[item].mm}mm - {" / "} - {c.options[item].max}mm - - ); + rows.push( + + + {item}: + + {c.options[item].min} + mm; + {" / "} + + {c.options[item].mm} + mm + + {" / "} + {c.options[item].max} + mm + + + + ); } else if (typeof c.options[item].bool !== "undefined") { - rows.push( - {item}: - {c.options[item].bool - ? TRUE / FALSE - : TRUE / FALSE - } - ); + rows.push( + + + {item}: + {c.options[item].bool ? ( + + TRUE + / FALSE + + ) : ( + + TRUE / + FALSE + + )} + + + ); } else if (typeof c.options[item].list !== "undefined") { let list = []; for (let opt of c.options[item].list) { - if (opt === c.options[item].dflt) list.push(
  • {opt} «
  • ); + if (opt === c.options[item].dflt) + list.push( +
  • + {opt} « +
  • + ); else list.push(
  • {opt}
  • ); } - rows.push( - {item}: -
      {list}
    - ); + rows.push( + + + {item}: +
      {list}
    + + + ); } else { - rows.push( - {item}: - FIXME - ); + rows.push( + + + {item}: + FIXME + + + ); } } } @@ -88,19 +144,15 @@ const Options = props => { return ( - + + + - - {rows} - + {rows}
    {emblem(c.name+".config",".options")}
    {emblem(c.name + ".config", ".options")}
    ); - } + }; - return ( -
    - {renderOptions()} -
    - ); -} + return
    {renderOptions()}
    ; +}; export default Options; diff --git a/packages/workbench/src/components/settings/ResolvedConfig.js b/packages/workbench/src/components/settings/ResolvedConfig.js index 62c1bf0d096..a59df33dce2 100644 --- a/packages/workbench/src/components/settings/ResolvedConfig.js +++ b/packages/workbench/src/components/settings/ResolvedConfig.js @@ -1,65 +1,95 @@ import React from "react"; import Emblem from "../Emblem"; import { FormattedMessage } from "react-intl"; -import css from "../css/Config.css"; +import css from "../scss/Config.scss"; const ResolvedConfig = props => { - const emblem = (t1, t2) => - + const emblem = (t1, t2) => ( + + ); const renderResolvedConfig = () => { let c = props.pattern.config; let rows = []; let list = []; if (typeof c.draftOrder !== "undefined") { - for (let item of c.draftOrder) list.push(
  • {item}
  • ); - rows.push( - draftOrder: -
      {list}
    - ); - } else rows.push(draftOrder:); + for (let item of c.draftOrder) + list.push( +
  • + {item} +
  • + ); + rows.push( + + + draftOrder: +
      {list}
    + + + ); + } else + rows.push( + + + draftOrder: + + + ); for (let key of ["resolvedDependencies"]) { if (typeof c[key] !== "undefined") { let list = []; for (let item of Object.keys(c[key])) { let values = null; if (typeof c[key][item] === "string") { - list.push(
  • - {item} - { key === "inject" ? " «" : ":"} - - {c[key][item]} -
  • ); + list.push( +
  • + + {item} + {key === "inject" ? " «" : ":"} + + {c[key][item]} +
  • + ); } else if (c[key][item].length > 0) { - list.push(
  • - {item}: - {c[key][item].map(v => v+" ")} -
  • ); - + list.push( +
  • + {item}: + + {c[key][item].map(v => v + " ")} + +
  • + ); } } - rows.push( - {key}: -
      {list}
    - ); - } else rows.push({key}:); + rows.push( + + + {key}: +
      {list}
    + + + ); + } else + rows.push( + + + {key}: + + + ); } return ( - + + + - - {rows} - + {rows}
    {emblem(c.name,".config")}
    {emblem(c.name, ".config")}
    ); - } + }; - return ( -
    - {renderResolvedConfig()} -
    - ); -} + return
    {renderResolvedConfig()}
    ; +}; export default ResolvedConfig; diff --git a/packages/workbench/src/components/settings/index.js b/packages/workbench/src/components/settings/index.js index b32e210f476..aa15422efda 100644 --- a/packages/workbench/src/components/settings/index.js +++ b/packages/workbench/src/components/settings/index.js @@ -1,7 +1,7 @@ import React from "react"; import Emblem from "../Emblem"; import { FormattedMessage } from "react-intl"; -import css from "../css/Settings.css"; +import css from "../scss/Settings.scss"; import Config from "./Config"; import ResolvedConfig from "./ResolvedConfig"; import Options from "./Options"; @@ -27,9 +27,9 @@ const Settings = props => { ); -} +}; - // - // +// +// export default Settings; diff --git a/packages/workbench/src/index.js b/packages/workbench/src/index.js index 55b02f573f2..32beb7419df 100644 --- a/packages/workbench/src/index.js +++ b/packages/workbench/src/index.js @@ -1,29 +1,30 @@ -import React, { Component } from 'react' -import PropTypes from 'prop-types' -import storage from "./utils/storage" +import React, { Component } from "react"; +import PropTypes from "prop-types"; +import storage from "./utils/storage"; import { i18n, strings } from "@freesewing/i18n"; -import "./style.css"; +import "./scss/style.scss"; import NavBar from "./components/NavBar"; import ButtonPicker from "./components/ButtonPicker"; import Settings from "./components/settings/"; -import { IntlProvider, addLocaleData } from "react-intl"; -import en from "react-intl/locale-data/en"; -import de from "react-intl/locale-data/de"; -import es from "react-intl/locale-data/es"; -import fr from "react-intl/locale-data/fr"; -import nl from "react-intl/locale-data/nl"; +import { IntlProvider } from "react-intl"; +//import { IntlProvider, addLocaleData } from "react-intl"; +//import en from "react-intl/locale-data/en"; +//import de from "react-intl/locale-data/de"; +//import es from "react-intl/locale-data/es"; +//import fr from "react-intl/locale-data/fr"; +//import nl from "react-intl/locale-data/nl"; import createTheme from "@freesewing/mui-theme"; -import MuiThemeProvider from '@material-ui/core/styles/MuiThemeProvider'; +import MuiThemeProvider from "@material-ui/core/styles/MuiThemeProvider"; import Button from "@material-ui/core/Button"; require("typeface-roboto-condensed"); require("@freesewing/css-theme"); -addLocaleData([...en, ...de, ...es, ...fr, ...nl]); +//addLocaleData([...en, ...de, ...es, ...fr, ...nl]); export default class Workbench extends Component { static propTypes = { freesewing: PropTypes.object - } + }; constructor(props) { super(props); @@ -41,115 +42,139 @@ export default class Workbench extends Component { saveToStorage = key => { if (key === "language") this.Storage.set("language", this.state.language); else if (key === "pattern") this.Storage.set("pattern", this.state.pattern); - else if (key === "gist") this.Storage.set(this.state.pattern, JSON.stringify(this.state.gist)); + else if (key === "gist") + this.Storage.set(this.state.pattern, JSON.stringify(this.state.gist)); else { this.Storage.set("language", this.state.language); this.Storage.set("pattern", this.state.pattern); this.Storage.set(this.state.pattern, JSON.stringify(this.state.gist)); } - } + }; getLanguage = () => { let lang = this.Storage.get("language"); if (Object.keys(i18n).indexOf(lang) !== -1) return lang; return false; - } - setLanguage = language => this.setState({ language }, () => this.saveToStorage('language')); + }; + setLanguage = language => + this.setState({ language }, () => this.saveToStorage("language")); getPattern = () => { let pattern = this.Storage.get("pattern"); - if (Object.keys(this.props.freesewing.patterns).indexOf(pattern) !== -1) return pattern; + if (Object.keys(this.props.freesewing.patterns).indexOf(pattern) !== -1) + return pattern; return false; - } - setPattern = pattern => this.setState({ pattern }, () => this.saveToStorage('pattern')); + }; + setPattern = pattern => + this.setState({ pattern }, () => this.saveToStorage("pattern")); getGist = () => { let gist = this.Storage.get(JSON.parse(this.state.pattern)); if (typeof gist === "object") return gist; return false; - } - setGist = gist => this.setState({ gist }, () => this.saveToStorage('gist')); + }; + setGist = gist => this.setState({ gist }, () => this.saveToStorage("gist")); toggleSettings = () => { let settings = !this.state.settings; this.setState({ settings }); - } + }; updateGist = (key, value) => { - if (key.substring(0, 7) === "options.") return updateOption(key.substring(7), value); + if (key.substring(0, 7) === "options.") + return updateOption(key.substring(7), value); let gist = this.state.gist; gist[key] = value; - this.setState({ gist }, () => this.saveToStorage('gist')); - } + this.setState({ gist }, () => this.saveToStorage("gist")); + }; toggleDarkmode = () => { let theme = "light"; if (this.state.theme === "light") theme = "dark"; this.setState({ theme }); - } + }; render() { let main = null; let navbar = null; if (!this.state.language) { - navbar = + navbar = ; let keys = Object.keys(i18n); let values = {}; for (let lang of keys) values[lang] = i18n[lang][lang]; - main = + ); } else { if (!this.state.pattern) { - navbar = this.setLanguage(false)} - language={i18n[this.state.language][this.state.language]} - locale={this.state.language} - pattern={false} - /> + navbar = ( + this.setLanguage(false)} + language={i18n[this.state.language][this.state.language]} + locale={this.state.language} + pattern={false} + /> + ); let keys = Object.keys(this.props.freesewing.patterns); let values = {}; for (let pattern of keys) values[pattern] = pattern; - main = + ); } else { - navbar = this.setLanguage(false)} - language={i18n[this.state.language][this.state.language]} - locale={this.state.language} - clearPattern={() => this.setPattern(false)} - pattern={this.state.pattern} - toggleSettings={this.toggleSettings} - /> - if (this.state.settings) main = this.setLanguage(false)} + language={i18n[this.state.language][this.state.language]} + locale={this.state.language} + clearPattern={() => this.setPattern(false)} + pattern={this.state.pattern} + toggleSettings={this.toggleSettings} /> - else main =
    Language is set
    {JSON.stringify(this.state, null, 2)}
    + ); + if (this.state.settings) + main = ( + + ); + else + main = ( +
    + Language is set +
    {JSON.stringify(this.state, null, 2)}
    +
    + ); } } - return {navbar} - + {main} + ); } } - - diff --git a/packages/workbench/src/style.css b/packages/workbench/src/scss/style.scss similarity index 100% rename from packages/workbench/src/style.css rename to packages/workbench/src/scss/style.scss diff --git a/scripts/reconfigure.js b/scripts/reconfigure.js index b29bf0df8af..0325217f472 100644 --- a/scripts/reconfigure.js +++ b/scripts/reconfigure.js @@ -173,21 +173,26 @@ function peerDependencies(pkg, config, type) { */ function packageConfig(pkg, config) { let type = packageType(pkg, config); - let pkgConf = JSON.parse( - Mustache.render(config.templates.pkg, { - name: pkg, - description: config.descriptions[pkg], - author: config.defaults.author, - keywords: keywords(pkg, config, type) - }) - ); - pkgConf.version = version; + let pkgConf = {}; + // Let's keep these at the top pkgConf.name = fullName(pkg, config); + pkgConf.version = version; + (pkgConf.description = config.descriptions[pkg]), + (pkgConf = { + ...pkgConf, + ...JSON.parse(Mustache.render(config.templates.pkg, { name: pkg })) + }); pkgConf.keywords = pkgConf.keywords.concat(keywords(pkg, config, type)); (pkgConf.scripts = scripts(pkg, config, type)), (pkgConf.dependencies = dependencies(pkg, config, type)); pkgConf.devDependencies = devDependencies(pkg, config, type); pkgConf.peerDependencies = peerDependencies(pkg, config, type); + if (typeof config.exceptions.packageJson[pkg] !== "undefined") { + pkgConf = { + ...pkgConf, + ...config.exceptions.packageJson[pkg] + }; + } return pkgConf; } @@ -271,7 +276,7 @@ function reconfigure(pkgs, config) { path.join(config.repoPath, "packages", pkg, "package.json"), JSON.stringify(packageConfig(pkg, config), null, 2) + "\n" ); - if (config.exceptions.noRollup.indexOf(pkg) === -1) { + if (config.exceptions.customRollup.indexOf(pkg) === -1) { fse.writeFileSync( path.join(config.repoPath, "packages", pkg, "rollup.config.js"), config.templates.rollup diff --git a/yarn.lock b/yarn.lock index f3223425627..5e0747bdde4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -145,6 +145,18 @@ "@babel/traverse" "^7.4.0" "@babel/types" "^7.4.0" +"@babel/helper-create-class-features-plugin@^7.4.0": + version "7.4.3" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.4.3.tgz#5bbd279c6c3ac6a60266b89bbfe7f8021080a1ef" + integrity sha512-UMl3TSpX11PuODYdWGrUeW6zFkdYhDn7wRLrOuNVM6f9L+S9CzmDXYyrp3MTHcwWjnzur1f/Op8A7iYZWya2Yg== + dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-member-expression-to-functions" "^7.0.0" + "@babel/helper-optimise-call-expression" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-replace-supers" "^7.4.0" + "@babel/helper-split-export-declaration" "^7.4.0" + "@babel/helper-define-map@^7.4.0": version "7.4.0" resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.4.0.tgz#cbfd8c1b2f12708e262c26f600cd16ed6a3bc6c9" @@ -363,6 +375,14 @@ "@babel/helper-remap-async-to-generator" "^7.1.0" "@babel/plugin-syntax-async-generators" "^7.2.0" +"@babel/plugin-proposal-class-properties@7.4.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.4.0.tgz#d70db61a2f1fd79de927eea91f6411c964e084b8" + integrity sha512-t2ECPNOXsIeK1JxJNKmgbzQtoG27KIlVE61vTqX0DKR9E9sZlVVxWUtEW9D5FlZ8b8j7SBNCHY47GgPKCKlpPg== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.4.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-proposal-json-strings@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz#568ecc446c6148ae6b267f02551130891e29f317" @@ -783,7 +803,7 @@ js-levenshtein "^1.1.3" semver "^5.5.0" -"@babel/preset-react@^7.0.0": +"@babel/preset-react@7.0.0", "@babel/preset-react@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.0.0.tgz#e86b4b3d99433c7b3e9e91747e2653958bc6b3c0" integrity sha512-oayxyPS4Zj+hF6Et11BwuBkmpgT/zMxyuZgFrMeZID6Hdh3dGlk4sHCAhdBCpuCKW2ppBfl2uCCetlrUIJRY3w== @@ -12718,7 +12738,7 @@ promzard@^0.3.0: dependencies: read "1" -prop-types@^15.5.10, prop-types@^15.6.2: +prop-types@15.7.2, prop-types@^15.5.10, prop-types@^15.6.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==