From b5f18ca80efb5d0b9e1a053b08d3a013a9bae046 Mon Sep 17 00:00:00 2001 From: Joel Chen Date: Mon, 17 Feb 2020 12:19:01 -0800 Subject: [PATCH] rename dir partial to partials (#1534) --- .../config/webpack/{partial => partials}/babel.js | 0 .../config/webpack/{partial => partials}/base-options.js | 0 .../config/webpack/{partial => partials}/coverage.js | 0 .../config/webpack/{partial => partials}/dev-mode.js | 0 .../config/webpack/{partial => partials}/dev.js | 0 .../config/webpack/{partial => partials}/dll-entry.js | 0 .../config/webpack/{partial => partials}/dll-load.js | 0 .../config/webpack/{partial => partials}/dll-output.js | 0 .../config/webpack/{partial => partials}/dll-reference.js | 0 .../config/webpack/{partial => partials}/dll.js | 0 .../config/webpack/{partial => partials}/entry.js | 0 .../config/webpack/{partial => partials}/extract-style.js | 0 .../config/webpack/{partial => partials}/fail.js | 0 .../config/webpack/{partial => partials}/fonts.js | 0 .../config/webpack/{partial => partials}/images.js | 0 .../config/webpack/{partial => partials}/index.js | 0 .../config/webpack/{partial => partials}/isomorphic.js | 0 .../config/webpack/{partial => partials}/loadable.js | 0 .../config/webpack/{partial => partials}/locales.js | 0 .../config/webpack/{partial => partials}/node.js | 0 .../config/webpack/{partial => partials}/output.js | 0 .../config/webpack/{partial => partials}/prod-mode.js | 0 .../config/webpack/{partial => partials}/pwa.js | 0 .../config/webpack/{partial => partials}/resolve-loader.js | 0 .../config/webpack/{partial => partials}/resolve.js | 0 .../webpack/{partial => partials}/simple-progress.js | 0 .../webpack/{partial => partials}/sourcemaps-inline.js | 0 .../webpack/{partial => partials}/sourcemaps-remote.js | 0 .../config/webpack/{partial => partials}/stats.js | 0 .../config/webpack/{partial => partials}/subapp-chunks.js | 0 .../config/webpack/{partial => partials}/test-base.js | 0 .../config/webpack/{partial => partials}/test-entry.js | 0 .../config/webpack/{partial => partials}/test-output.js | 0 .../config/webpack/{partial => partials}/test-resolve.js | 0 .../config/webpack/{partial => partials}/uglify.js | 0 .../xarc-app-dev/config/webpack/util/generate-config.js | 7 +++++-- packages/xarc-app-dev/test/spec/extract.style.spec.js | 2 +- 37 files changed, 6 insertions(+), 3 deletions(-) rename packages/xarc-app-dev/config/webpack/{partial => partials}/babel.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/base-options.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/coverage.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/dev-mode.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/dev.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/dll-entry.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/dll-load.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/dll-output.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/dll-reference.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/dll.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/entry.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/extract-style.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/fail.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/fonts.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/images.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/index.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/isomorphic.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/loadable.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/locales.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/node.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/output.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/prod-mode.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/pwa.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/resolve-loader.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/resolve.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/simple-progress.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/sourcemaps-inline.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/sourcemaps-remote.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/stats.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/subapp-chunks.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/test-base.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/test-entry.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/test-output.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/test-resolve.js (100%) rename packages/xarc-app-dev/config/webpack/{partial => partials}/uglify.js (100%) diff --git a/packages/xarc-app-dev/config/webpack/partial/babel.js b/packages/xarc-app-dev/config/webpack/partials/babel.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/babel.js rename to packages/xarc-app-dev/config/webpack/partials/babel.js diff --git a/packages/xarc-app-dev/config/webpack/partial/base-options.js b/packages/xarc-app-dev/config/webpack/partials/base-options.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/base-options.js rename to packages/xarc-app-dev/config/webpack/partials/base-options.js diff --git a/packages/xarc-app-dev/config/webpack/partial/coverage.js b/packages/xarc-app-dev/config/webpack/partials/coverage.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/coverage.js rename to packages/xarc-app-dev/config/webpack/partials/coverage.js diff --git a/packages/xarc-app-dev/config/webpack/partial/dev-mode.js b/packages/xarc-app-dev/config/webpack/partials/dev-mode.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/dev-mode.js rename to packages/xarc-app-dev/config/webpack/partials/dev-mode.js diff --git a/packages/xarc-app-dev/config/webpack/partial/dev.js b/packages/xarc-app-dev/config/webpack/partials/dev.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/dev.js rename to packages/xarc-app-dev/config/webpack/partials/dev.js diff --git a/packages/xarc-app-dev/config/webpack/partial/dll-entry.js b/packages/xarc-app-dev/config/webpack/partials/dll-entry.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/dll-entry.js rename to packages/xarc-app-dev/config/webpack/partials/dll-entry.js diff --git a/packages/xarc-app-dev/config/webpack/partial/dll-load.js b/packages/xarc-app-dev/config/webpack/partials/dll-load.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/dll-load.js rename to packages/xarc-app-dev/config/webpack/partials/dll-load.js diff --git a/packages/xarc-app-dev/config/webpack/partial/dll-output.js b/packages/xarc-app-dev/config/webpack/partials/dll-output.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/dll-output.js rename to packages/xarc-app-dev/config/webpack/partials/dll-output.js diff --git a/packages/xarc-app-dev/config/webpack/partial/dll-reference.js b/packages/xarc-app-dev/config/webpack/partials/dll-reference.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/dll-reference.js rename to packages/xarc-app-dev/config/webpack/partials/dll-reference.js diff --git a/packages/xarc-app-dev/config/webpack/partial/dll.js b/packages/xarc-app-dev/config/webpack/partials/dll.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/dll.js rename to packages/xarc-app-dev/config/webpack/partials/dll.js diff --git a/packages/xarc-app-dev/config/webpack/partial/entry.js b/packages/xarc-app-dev/config/webpack/partials/entry.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/entry.js rename to packages/xarc-app-dev/config/webpack/partials/entry.js diff --git a/packages/xarc-app-dev/config/webpack/partial/extract-style.js b/packages/xarc-app-dev/config/webpack/partials/extract-style.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/extract-style.js rename to packages/xarc-app-dev/config/webpack/partials/extract-style.js diff --git a/packages/xarc-app-dev/config/webpack/partial/fail.js b/packages/xarc-app-dev/config/webpack/partials/fail.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/fail.js rename to packages/xarc-app-dev/config/webpack/partials/fail.js diff --git a/packages/xarc-app-dev/config/webpack/partial/fonts.js b/packages/xarc-app-dev/config/webpack/partials/fonts.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/fonts.js rename to packages/xarc-app-dev/config/webpack/partials/fonts.js diff --git a/packages/xarc-app-dev/config/webpack/partial/images.js b/packages/xarc-app-dev/config/webpack/partials/images.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/images.js rename to packages/xarc-app-dev/config/webpack/partials/images.js diff --git a/packages/xarc-app-dev/config/webpack/partial/index.js b/packages/xarc-app-dev/config/webpack/partials/index.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/index.js rename to packages/xarc-app-dev/config/webpack/partials/index.js diff --git a/packages/xarc-app-dev/config/webpack/partial/isomorphic.js b/packages/xarc-app-dev/config/webpack/partials/isomorphic.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/isomorphic.js rename to packages/xarc-app-dev/config/webpack/partials/isomorphic.js diff --git a/packages/xarc-app-dev/config/webpack/partial/loadable.js b/packages/xarc-app-dev/config/webpack/partials/loadable.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/loadable.js rename to packages/xarc-app-dev/config/webpack/partials/loadable.js diff --git a/packages/xarc-app-dev/config/webpack/partial/locales.js b/packages/xarc-app-dev/config/webpack/partials/locales.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/locales.js rename to packages/xarc-app-dev/config/webpack/partials/locales.js diff --git a/packages/xarc-app-dev/config/webpack/partial/node.js b/packages/xarc-app-dev/config/webpack/partials/node.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/node.js rename to packages/xarc-app-dev/config/webpack/partials/node.js diff --git a/packages/xarc-app-dev/config/webpack/partial/output.js b/packages/xarc-app-dev/config/webpack/partials/output.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/output.js rename to packages/xarc-app-dev/config/webpack/partials/output.js diff --git a/packages/xarc-app-dev/config/webpack/partial/prod-mode.js b/packages/xarc-app-dev/config/webpack/partials/prod-mode.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/prod-mode.js rename to packages/xarc-app-dev/config/webpack/partials/prod-mode.js diff --git a/packages/xarc-app-dev/config/webpack/partial/pwa.js b/packages/xarc-app-dev/config/webpack/partials/pwa.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/pwa.js rename to packages/xarc-app-dev/config/webpack/partials/pwa.js diff --git a/packages/xarc-app-dev/config/webpack/partial/resolve-loader.js b/packages/xarc-app-dev/config/webpack/partials/resolve-loader.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/resolve-loader.js rename to packages/xarc-app-dev/config/webpack/partials/resolve-loader.js diff --git a/packages/xarc-app-dev/config/webpack/partial/resolve.js b/packages/xarc-app-dev/config/webpack/partials/resolve.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/resolve.js rename to packages/xarc-app-dev/config/webpack/partials/resolve.js diff --git a/packages/xarc-app-dev/config/webpack/partial/simple-progress.js b/packages/xarc-app-dev/config/webpack/partials/simple-progress.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/simple-progress.js rename to packages/xarc-app-dev/config/webpack/partials/simple-progress.js diff --git a/packages/xarc-app-dev/config/webpack/partial/sourcemaps-inline.js b/packages/xarc-app-dev/config/webpack/partials/sourcemaps-inline.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/sourcemaps-inline.js rename to packages/xarc-app-dev/config/webpack/partials/sourcemaps-inline.js diff --git a/packages/xarc-app-dev/config/webpack/partial/sourcemaps-remote.js b/packages/xarc-app-dev/config/webpack/partials/sourcemaps-remote.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/sourcemaps-remote.js rename to packages/xarc-app-dev/config/webpack/partials/sourcemaps-remote.js diff --git a/packages/xarc-app-dev/config/webpack/partial/stats.js b/packages/xarc-app-dev/config/webpack/partials/stats.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/stats.js rename to packages/xarc-app-dev/config/webpack/partials/stats.js diff --git a/packages/xarc-app-dev/config/webpack/partial/subapp-chunks.js b/packages/xarc-app-dev/config/webpack/partials/subapp-chunks.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/subapp-chunks.js rename to packages/xarc-app-dev/config/webpack/partials/subapp-chunks.js diff --git a/packages/xarc-app-dev/config/webpack/partial/test-base.js b/packages/xarc-app-dev/config/webpack/partials/test-base.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/test-base.js rename to packages/xarc-app-dev/config/webpack/partials/test-base.js diff --git a/packages/xarc-app-dev/config/webpack/partial/test-entry.js b/packages/xarc-app-dev/config/webpack/partials/test-entry.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/test-entry.js rename to packages/xarc-app-dev/config/webpack/partials/test-entry.js diff --git a/packages/xarc-app-dev/config/webpack/partial/test-output.js b/packages/xarc-app-dev/config/webpack/partials/test-output.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/test-output.js rename to packages/xarc-app-dev/config/webpack/partials/test-output.js diff --git a/packages/xarc-app-dev/config/webpack/partial/test-resolve.js b/packages/xarc-app-dev/config/webpack/partials/test-resolve.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/test-resolve.js rename to packages/xarc-app-dev/config/webpack/partials/test-resolve.js diff --git a/packages/xarc-app-dev/config/webpack/partial/uglify.js b/packages/xarc-app-dev/config/webpack/partials/uglify.js similarity index 100% rename from packages/xarc-app-dev/config/webpack/partial/uglify.js rename to packages/xarc-app-dev/config/webpack/partials/uglify.js diff --git a/packages/xarc-app-dev/config/webpack/util/generate-config.js b/packages/xarc-app-dev/config/webpack/util/generate-config.js index f985ce72d..733cff110 100644 --- a/packages/xarc-app-dev/config/webpack/util/generate-config.js +++ b/packages/xarc-app-dev/config/webpack/util/generate-config.js @@ -1,7 +1,9 @@ "use strict"; +/* eslint-disable no-unused-expressions */ + const xsh = require("xsh"); -const partialConfigs = require("../partial"); +const partialConfigs = require("../partials"); const WebpackConfigComposer = require("webpack-config-composer"); const optionalRequire = require("optional-require")(require); const Path = require("path"); @@ -65,9 +67,10 @@ function initWebpackConfigComposer(options) { if (!options.composer) { const composer = (options.composer = new WebpackConfigComposer()); - composer.addProfiles(options.profiles); + options.profiles && composer.addProfiles(options.profiles); composer.addProfile("user", {}); composer.addPartials(partialConfigs.partials); + options.partials && composer.addPartials(options.partials); } return options; diff --git a/packages/xarc-app-dev/test/spec/extract.style.spec.js b/packages/xarc-app-dev/test/spec/extract.style.spec.js index fe9be4549..c7cdec8ee 100644 --- a/packages/xarc-app-dev/test/spec/extract.style.spec.js +++ b/packages/xarc-app-dev/test/spec/extract.style.spec.js @@ -1,6 +1,6 @@ const expect = require("chai").expect; const archetype = require("@xarc/app/config/archetype"); -const moduleName = "../../config/webpack/partial/extract-style"; +const moduleName = "../../config/webpack/partials/extract-style"; describe("@xarc/app-dev extract-styles", function() { this.timeout(10000);