From 51be4f67b6b0ef0f150aecc975690d5216e48bc8 Mon Sep 17 00:00:00 2001 From: Sebastien Dubois Date: Wed, 14 Mar 2018 18:57:57 +0100 Subject: [PATCH] fix(build): fixed issue with prettier config name with webpack plugin and added new scripts at root --- CONTRIBUTING.md | 6 ++++++ package.json | 4 +++- packages/stark-build/config/webpack.common.js | 4 +--- packages/stark-build/config/webpack.dev.js | 7 ++----- packages/stark-build/config/webpack.github-deploy.js | 6 ++---- packages/stark-build/config/webpack.prod.js | 6 +++--- packages/stark-build/config/webpack.test.js | 4 +--- 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0bed4ea893..abcec7b6cb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -122,6 +122,12 @@ If you want to modify Stark packages (e.g., stark-build, stark-core, ...): Start hacking :) +If you want to test/validate your changes against the starter, then you can use the following scripts from the root: +* rebuild: `npm run build` +* update the starter: `npm run update-starter` +* run the starter: `npm run starter` + + ## Releasing a version * commit all changes to include in the release * edit the version in package.json diff --git a/package.json b/package.json index 8017b081e4..960c15a675 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,9 @@ "postinstall:build": "cd packages/stark-build && npm install && cd ../..", "postinstall:core": "cd packages/stark-core && npm install && cd ../..", "postinstall:starter": "cd starter && npm install && cd ..", - "build": "sh ./build.sh" + "build": "sh ./build.sh", + "update-starter": "cd starter && npm install && cd ..", + "starter": "cd starter && npm start && cd .." }, "lint-staged": { "*.{css,js,json,pcss,scss,ts}": [ diff --git a/packages/stark-build/config/webpack.common.js b/packages/stark-build/config/webpack.common.js index e68e5ea87d..2f16f50fa8 100644 --- a/packages/stark-build/config/webpack.common.js +++ b/packages/stark-build/config/webpack.common.js @@ -1,6 +1,4 @@ -/** - * @author: @AngularClass - */ +"use strict"; const helpers = require("./helpers"); const commonData = require("./webpack.common-data.js"); // common configuration between environments diff --git a/packages/stark-build/config/webpack.dev.js b/packages/stark-build/config/webpack.dev.js index 95f5e09229..8afd952426 100644 --- a/packages/stark-build/config/webpack.dev.js +++ b/packages/stark-build/config/webpack.dev.js @@ -1,6 +1,4 @@ -/** - * @author: @AngularClass - */ +"use strict"; const helpers = require("./helpers"); const buildUtils = require("./build-utils"); @@ -11,7 +9,6 @@ const commonData = require("./webpack.common-data.js"); // the settings that are /** * Webpack Plugins */ -const LoaderOptionsPlugin = require("webpack/lib/LoaderOptionsPlugin"); const NamedModulesPlugin = require("webpack/lib/NamedModulesPlugin"); const SourceMapDevToolPlugin = require("webpack/lib/SourceMapDevToolPlugin"); @@ -212,7 +209,7 @@ module.exports = function() { * See: https://github.com/JaKXz/stylelint-webpack-plugin */ new StylelintPlugin({ - configFile: "stylelint.config.js", + configFile: ".stylelintrc", emitErrors: false, files: ["src/**/*.?(pc|sc|c|sa)ss"] // pcss|scss|css|sass }), diff --git a/packages/stark-build/config/webpack.github-deploy.js b/packages/stark-build/config/webpack.github-deploy.js index fae588e554..6a111cceb6 100644 --- a/packages/stark-build/config/webpack.github-deploy.js +++ b/packages/stark-build/config/webpack.github-deploy.js @@ -1,9 +1,7 @@ -/** - * @author: @AngularClass - */ +"use strict"; + const fs = require("fs"); const path = require("path"); -const helpers = require("./helpers"); const ghDeploy = require("./github-deploy"); const webpackMerge = require("webpack-merge"); // used to merge webpack configs diff --git a/packages/stark-build/config/webpack.prod.js b/packages/stark-build/config/webpack.prod.js index aec9c97a2b..3bc5c89daf 100644 --- a/packages/stark-build/config/webpack.prod.js +++ b/packages/stark-build/config/webpack.prod.js @@ -1,6 +1,5 @@ -/** - * @author: @AngularClass - */ +"use strict"; + const helpers = require("./helpers"); const buildUtils = require("./build-utils"); @@ -192,6 +191,7 @@ module.exports = function() { */ new ExtractTextPlugin("[name].[contenthash].css"), + // TODO remove since it's probably useless here (defined in webpack.common.js) new PurifyPlugin() /* buildOptimizer */, /** diff --git a/packages/stark-build/config/webpack.test.js b/packages/stark-build/config/webpack.test.js index 11227ac7da..f1a00b2efb 100644 --- a/packages/stark-build/config/webpack.test.js +++ b/packages/stark-build/config/webpack.test.js @@ -1,6 +1,4 @@ -/** - * @author: @AngularClass - */ +"use strict"; const helpers = require("./helpers");