@servicetitan/startup 32.1.0 → 32.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/build.d.ts +36 -7
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +35 -10
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/bundle-package.d.ts +9 -10
- package/dist/cli/commands/bundle-package.d.ts.map +1 -1
- package/dist/cli/commands/bundle-package.js +6 -22
- package/dist/cli/commands/bundle-package.js.map +1 -1
- package/dist/cli/commands/clean.d.ts +2 -2
- package/dist/cli/commands/clean.d.ts.map +1 -1
- package/dist/cli/commands/clean.js +16 -4
- package/dist/cli/commands/clean.js.map +1 -1
- package/dist/cli/commands/convert-eslint-config.d.ts +2 -2
- package/dist/cli/commands/convert-eslint-config.d.ts.map +1 -1
- package/dist/cli/commands/convert-eslint-config.js +3 -4
- package/dist/cli/commands/convert-eslint-config.js.map +1 -1
- package/dist/cli/commands/eslint.d.ts +3 -5
- package/dist/cli/commands/eslint.d.ts.map +1 -1
- package/dist/cli/commands/eslint.js +2 -18
- package/dist/cli/commands/eslint.js.map +1 -1
- package/dist/cli/commands/get-command.d.ts.map +1 -1
- package/dist/cli/commands/get-command.js +2 -0
- package/dist/cli/commands/get-command.js.map +1 -1
- package/dist/cli/commands/index.d.ts +0 -1
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +0 -1
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +10 -6
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +9 -8
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/install.d.ts +21 -7
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +33 -11
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/kendo-ui-license.d.ts +3 -3
- package/dist/cli/commands/kendo-ui-license.d.ts.map +1 -1
- package/dist/cli/commands/kendo-ui-license.js +17 -5
- package/dist/cli/commands/kendo-ui-license.js.map +1 -1
- package/dist/cli/commands/lint.d.ts +31 -12
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/lint.js +34 -13
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/commands/mfe-list.d.ts +46 -0
- package/dist/cli/commands/mfe-list.d.ts.map +1 -0
- package/dist/cli/commands/mfe-list.js +200 -0
- package/dist/cli/commands/mfe-list.js.map +1 -0
- package/dist/cli/commands/mfe-package-clean.d.ts +29 -5
- package/dist/cli/commands/mfe-package-clean.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-clean.js +28 -5
- package/dist/cli/commands/mfe-package-clean.js.map +1 -1
- package/dist/cli/commands/mfe-package-publish.d.ts +37 -5
- package/dist/cli/commands/mfe-package-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-publish.js +36 -5
- package/dist/cli/commands/mfe-package-publish.js.map +1 -1
- package/dist/cli/commands/mfe-publish.d.ts +17 -4
- package/dist/cli/commands/mfe-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-publish.js +37 -7
- package/dist/cli/commands/mfe-publish.js.map +1 -1
- package/dist/cli/commands/prepare-package.d.ts +3 -5
- package/dist/cli/commands/prepare-package.d.ts.map +1 -1
- package/dist/cli/commands/prepare-package.js +2 -18
- package/dist/cli/commands/prepare-package.js.map +1 -1
- package/dist/cli/commands/review/review.d.ts +14 -6
- package/dist/cli/commands/review/review.d.ts.map +1 -1
- package/dist/cli/commands/review/review.js +27 -23
- package/dist/cli/commands/review/review.js.map +1 -1
- package/dist/cli/commands/run-task.d.ts +10 -6
- package/dist/cli/commands/run-task.d.ts.map +1 -1
- package/dist/cli/commands/run-task.js +16 -13
- package/dist/cli/commands/run-task.js.map +1 -1
- package/dist/cli/commands/start.d.ts +28 -7
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +27 -10
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/styles-check.d.ts +2 -2
- package/dist/cli/commands/styles-check.d.ts.map +1 -1
- package/dist/cli/commands/styles-check.js +2 -1
- package/dist/cli/commands/styles-check.js.map +1 -1
- package/dist/cli/commands/test/runners/vitest.js +2 -1
- package/dist/cli/commands/test/runners/vitest.js.map +1 -1
- package/dist/cli/commands/test/tests.d.ts +14 -5
- package/dist/cli/commands/test/tests.d.ts.map +1 -1
- package/dist/cli/commands/test/tests.js +26 -13
- package/dist/cli/commands/test/tests.js.map +1 -1
- package/dist/cli/commands/types.d.ts +13 -4
- package/dist/cli/commands/types.d.ts.map +1 -1
- package/dist/cli/commands/types.js +28 -0
- package/dist/cli/commands/types.js.map +1 -1
- package/dist/cli/commands/upload-sourcemaps.d.ts +3 -5
- package/dist/cli/commands/upload-sourcemaps.d.ts.map +1 -1
- package/dist/cli/commands/upload-sourcemaps.js +5 -20
- package/dist/cli/commands/upload-sourcemaps.js.map +1 -1
- package/dist/cli/index.js +48 -39
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/tasks/swc-compile-package.d.ts +2 -2
- package/dist/cli/tasks/swc-compile-package.d.ts.map +1 -1
- package/dist/cli/tasks/swc-compile-package.js.map +1 -1
- package/dist/cli/tasks/tsc-compile-package.d.ts +2 -2
- package/dist/cli/tasks/tsc-compile-package.d.ts.map +1 -1
- package/dist/cli/tasks/tsc-compile-package.js +1 -1
- package/dist/cli/tasks/tsc-compile-package.js.map +1 -1
- package/dist/cli/tasks/tsc-compile.d.ts +2 -2
- package/dist/cli/tasks/tsc-compile.d.ts.map +1 -1
- package/dist/cli/tasks/tsc-compile.js.map +1 -1
- package/dist/cli/utils/bundle.js +2 -2
- package/dist/cli/utils/bundle.js.map +1 -1
- package/dist/cli/utils/cli-npm.d.ts +14 -0
- package/dist/cli/utils/cli-npm.d.ts.map +1 -1
- package/dist/cli/utils/cli-npm.js +44 -0
- package/dist/cli/utils/cli-npm.js.map +1 -1
- package/dist/cli/utils/cli-os.d.ts +2 -2
- package/dist/cli/utils/cli-os.d.ts.map +1 -1
- package/dist/cli/utils/cli-os.js +13 -9
- package/dist/cli/utils/cli-os.js.map +1 -1
- package/dist/cli/utils/eslint.d.ts +2 -1
- package/dist/cli/utils/eslint.d.ts.map +1 -1
- package/dist/cli/utils/eslint.js.map +1 -1
- package/dist/cli/utils/index.d.ts +1 -0
- package/dist/cli/utils/index.d.ts.map +1 -1
- package/dist/cli/utils/index.js +1 -0
- package/dist/cli/utils/index.js.map +1 -1
- package/dist/cli/utils/is-tty.d.ts +2 -0
- package/dist/cli/utils/is-tty.d.ts.map +1 -0
- package/dist/cli/utils/is-tty.js +15 -0
- package/dist/cli/utils/is-tty.js.map +1 -0
- package/dist/cli/utils/maybe-create-git-folder.d.ts +1 -1
- package/dist/cli/utils/maybe-create-git-folder.d.ts.map +1 -1
- package/dist/cli/utils/maybe-create-git-folder.js +12 -6
- package/dist/cli/utils/maybe-create-git-folder.js.map +1 -1
- package/dist/cli/utils/process-tree.d.ts.map +1 -1
- package/dist/cli/utils/process-tree.js +2 -2
- package/dist/cli/utils/process-tree.js.map +1 -1
- package/dist/cli/utils/set-node-options.d.ts.map +1 -1
- package/dist/cli/utils/set-node-options.js +2 -1
- package/dist/cli/utils/set-node-options.js.map +1 -1
- package/dist/utils/find-packages.d.ts +1 -0
- package/dist/utils/find-packages.d.ts.map +1 -1
- package/dist/utils/find-packages.js.map +1 -1
- package/dist/utils/format-relative-date.d.ts +2 -0
- package/dist/utils/format-relative-date.d.ts.map +1 -0
- package/dist/utils/format-relative-date.js +60 -0
- package/dist/utils/format-relative-date.js.map +1 -0
- package/dist/utils/get-configuration.d.ts +10 -3
- package/dist/utils/get-configuration.d.ts.map +1 -1
- package/dist/utils/get-configuration.js +1 -0
- package/dist/utils/get-configuration.js.map +1 -1
- package/dist/utils/get-jest-config.d.ts.map +1 -1
- package/dist/utils/get-jest-config.js +20 -9
- package/dist/utils/get-jest-config.js.map +1 -1
- package/dist/utils/get-packages.d.ts +3 -5
- package/dist/utils/get-packages.d.ts.map +1 -1
- package/dist/utils/get-packages.js +1 -4
- package/dist/utils/get-packages.js.map +1 -1
- package/dist/utils/get-startup-version.d.ts.map +1 -1
- package/dist/utils/get-startup-version.js +1 -1
- package/dist/utils/get-startup-version.js.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/omit.d.ts +2 -0
- package/dist/utils/omit.d.ts.map +1 -0
- package/dist/utils/omit.js +28 -0
- package/dist/utils/omit.js.map +1 -0
- package/dist/webpack/configs/loaders/style-loader.d.ts +1 -1
- package/dist/webpack/configs/loaders/style-loader.d.ts.map +1 -1
- package/dist/webpack/configs/loaders/style-loader.js +2 -2
- package/dist/webpack/configs/loaders/style-loader.js.map +1 -1
- package/dist/webpack/configs/optimization-config.js +5 -5
- package/dist/webpack/configs/optimization-config.js.map +1 -1
- package/dist/webpack/configs/output-config.d.ts.map +1 -1
- package/dist/webpack/configs/output-config.js +14 -7
- package/dist/webpack/configs/output-config.js.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js +10 -3
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js.map +1 -1
- package/package.json +26 -20
- package/src/cli/commands/__tests__/build.test.ts +1 -1
- package/src/cli/commands/__tests__/bundle-package.test.ts +22 -2
- package/src/cli/commands/__tests__/install.test.ts +42 -4
- package/src/cli/commands/__tests__/lint.test.ts +1 -1
- package/src/cli/commands/__tests__/mfe-list.test.ts +394 -0
- package/src/cli/commands/__tests__/mfe-publish.test.ts +25 -0
- package/src/cli/commands/__tests__/start.test.ts +1 -1
- package/src/cli/commands/build.ts +14 -10
- package/src/cli/commands/bundle-package.ts +19 -13
- package/src/cli/commands/clean.ts +2 -4
- package/src/cli/commands/convert-eslint-config.ts +3 -5
- package/src/cli/commands/eslint.ts +3 -5
- package/src/cli/commands/get-command.ts +2 -0
- package/src/cli/commands/index.ts +0 -1
- package/src/cli/commands/init.ts +7 -8
- package/src/cli/commands/install.ts +24 -11
- package/src/cli/commands/kendo-ui-license.ts +4 -6
- package/src/cli/commands/lint.ts +19 -19
- package/src/cli/commands/mfe-list.ts +173 -0
- package/src/cli/commands/mfe-package-clean.ts +25 -4
- package/src/cli/commands/mfe-package-publish.ts +33 -4
- package/src/cli/commands/mfe-publish.ts +37 -6
- package/src/cli/commands/prepare-package.ts +3 -5
- package/src/cli/commands/review/review.ts +9 -9
- package/src/cli/commands/run-task.ts +15 -11
- package/src/cli/commands/start.ts +12 -10
- package/src/cli/commands/styles-check.ts +2 -2
- package/src/cli/commands/test/__tests__/tests.test.ts +1 -1
- package/src/cli/commands/test/runners/__tests__/vitest.test.ts +82 -13
- package/src/cli/commands/test/runners/vitest.ts +4 -2
- package/src/cli/commands/test/tests.ts +20 -10
- package/src/cli/commands/types.ts +14 -4
- package/src/cli/commands/upload-sourcemaps.ts +3 -5
- package/src/cli/index.ts +59 -36
- package/src/cli/tasks/swc-compile-package.ts +2 -2
- package/src/cli/tasks/tsc-compile-package.ts +4 -3
- package/src/cli/tasks/tsc-compile.ts +2 -2
- package/src/cli/utils/__tests__/bundle.test.ts +13 -0
- package/src/cli/utils/__tests__/cli-npm.test.ts +89 -0
- package/src/cli/utils/__tests__/is-tty.test.ts +17 -0
- package/src/cli/utils/__tests__/maybe-create-git-folder.test.ts +10 -17
- package/src/cli/utils/__tests__/set-node-options.test.ts +10 -10
- package/src/cli/utils/bundle.ts +2 -2
- package/src/cli/utils/cli-npm.ts +34 -0
- package/src/cli/utils/cli-os.ts +12 -25
- package/src/cli/utils/eslint.ts +2 -1
- package/src/cli/utils/index.ts +1 -0
- package/src/cli/utils/is-tty.ts +3 -0
- package/src/cli/utils/maybe-create-git-folder.ts +10 -8
- package/src/cli/utils/process-tree.ts +4 -2
- package/src/cli/utils/set-node-options.ts +2 -1
- package/src/utils/__tests__/format-relative-date.test.ts +61 -0
- package/src/utils/__tests__/get-jest-config.test.ts +44 -0
- package/src/utils/__tests__/get-packages.test.ts +3 -0
- package/src/utils/find-packages.ts +1 -0
- package/src/utils/format-relative-date.ts +33 -0
- package/src/utils/get-configuration.ts +7 -2
- package/src/utils/get-jest-config.ts +36 -18
- package/src/utils/get-packages.ts +3 -9
- package/src/utils/get-startup-version.ts +1 -3
- package/src/utils/index.ts +2 -0
- package/src/utils/omit.ts +12 -0
- package/src/webpack/__mocks__/style-rules.ts +3 -3
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +6 -14
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +52 -29
- package/src/webpack/configs/loaders/style-loader.ts +5 -2
- package/src/webpack/configs/optimization-config.ts +5 -5
- package/src/webpack/configs/output-config.ts +10 -5
- package/src/webpack/configs/plugins/assets-manifest-plugin.ts +11 -4
- package/dist/cli/commands/get-user-commands.d.ts +0 -7
- package/dist/cli/commands/get-user-commands.d.ts.map +0 -1
- package/dist/cli/commands/get-user-commands.js +0 -27
- package/dist/cli/commands/get-user-commands.js.map +0 -1
- package/src/cli/commands/__tests__/get-user-commands.test.ts +0 -27
- package/src/cli/commands/get-user-commands.ts +0 -19
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "omit", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return omit;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
function omit(obj, keys) {
|
|
12
|
+
return keys.reduce((result, key)=>omitInternal({
|
|
13
|
+
...result
|
|
14
|
+
}, key.split('.')), obj);
|
|
15
|
+
}
|
|
16
|
+
function omitInternal(obj, [key, ...rest]) {
|
|
17
|
+
if (!rest.length) {
|
|
18
|
+
delete obj[key];
|
|
19
|
+
} else if (typeof obj[key] === 'object') {
|
|
20
|
+
return {
|
|
21
|
+
...obj,
|
|
22
|
+
[key]: omitInternal(obj[key], rest)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
return obj;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=omit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/omit.ts"],"sourcesContent":["export function omit<T extends Record<string, any>>(obj: T, keys: string[]): T {\n return keys.reduce((result, key) => omitInternal({ ...result }, key.split('.')), obj);\n}\n\nfunction omitInternal<T extends Record<string, any>>(obj: T, [key, ...rest]: string[]): T {\n if (!rest.length) {\n delete obj[key];\n } else if (typeof obj[key] === 'object') {\n return { ...obj, [key]: omitInternal(obj[key], rest) };\n }\n return obj;\n}\n"],"names":["omit","obj","keys","reduce","result","key","omitInternal","split","rest","length"],"mappings":";;;;+BAAgBA;;;eAAAA;;;AAAT,SAASA,KAAoCC,GAAM,EAAEC,IAAc;IACtE,OAAOA,KAAKC,MAAM,CAAC,CAACC,QAAQC,MAAQC,aAAa;YAAE,GAAGF,MAAM;QAAC,GAAGC,IAAIE,KAAK,CAAC,OAAON;AACrF;AAEA,SAASK,aAA4CL,GAAM,EAAE,CAACI,KAAK,GAAGG,KAAe;IACjF,IAAI,CAACA,KAAKC,MAAM,EAAE;QACd,OAAOR,GAAG,CAACI,IAAI;IACnB,OAAO,IAAI,OAAOJ,GAAG,CAACI,IAAI,KAAK,UAAU;QACrC,OAAO;YAAE,GAAGJ,GAAG;YAAE,CAACI,IAAI,EAAEC,aAAaL,GAAG,CAACI,IAAI,EAAEG;QAAM;IACzD;IACA,OAAOP;AACX"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context } from '../types';
|
|
2
2
|
import { LoaderOptions } from './types';
|
|
3
|
-
export declare function styleLoader({ isProduction, isWebComponent }: Context, { esModule }?: LoaderOptions): string | {
|
|
3
|
+
export declare function styleLoader({ isProduction, isWebComponent, emitExposedDependencies }: Context, { esModule }?: LoaderOptions): string | {
|
|
4
4
|
loader: string;
|
|
5
5
|
options: {
|
|
6
6
|
esModule: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-loader.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/loaders/style-loader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,wBAAgB,WAAW,CACvB,EAAE,YAAY,EAAE,cAAc,EAAE,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"style-loader.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/loaders/style-loader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,wBAAgB,WAAW,CACvB,EAAE,YAAY,EAAE,cAAc,EAAE,uBAAuB,EAAE,EAAE,OAAO,EAClE,EAAE,QAAQ,EAAE,GAAE,aAAkB;;;;;EAOnC"}
|
|
@@ -14,8 +14,8 @@ function _interop_require_default(obj) {
|
|
|
14
14
|
default: obj
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
function styleLoader({ isProduction, isWebComponent }, { esModule } = {}) {
|
|
18
|
-
const loader = isProduction || isWebComponent ? _minicssextractplugin.default.loader : 'style-loader';
|
|
17
|
+
function styleLoader({ isProduction, isWebComponent, emitExposedDependencies }, { esModule } = {}) {
|
|
18
|
+
const loader = isProduction || isWebComponent || emitExposedDependencies ? _minicssextractplugin.default.loader : 'style-loader';
|
|
19
19
|
return esModule ? {
|
|
20
20
|
loader,
|
|
21
21
|
options: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/webpack/configs/loaders/style-loader.ts"],"sourcesContent":["import MiniCssExtractPlugin from 'mini-css-extract-plugin';\nimport { Context } from '../types';\nimport { LoaderOptions } from './types';\n\nexport function styleLoader(\n { isProduction, isWebComponent }: Context,\n { esModule }: LoaderOptions = {}\n) {\n const loader
|
|
1
|
+
{"version":3,"sources":["../../../../src/webpack/configs/loaders/style-loader.ts"],"sourcesContent":["import MiniCssExtractPlugin from 'mini-css-extract-plugin';\nimport { Context } from '../types';\nimport { LoaderOptions } from './types';\n\nexport function styleLoader(\n { isProduction, isWebComponent, emitExposedDependencies }: Context,\n { esModule }: LoaderOptions = {}\n) {\n const loader =\n isProduction || isWebComponent || emitExposedDependencies\n ? MiniCssExtractPlugin.loader\n : 'style-loader';\n return esModule ? { loader, options: { esModule } } : loader;\n}\n"],"names":["styleLoader","isProduction","isWebComponent","emitExposedDependencies","esModule","loader","MiniCssExtractPlugin","options"],"mappings":";;;;+BAIgBA;;;eAAAA;;;6EAJiB;;;;;;AAI1B,SAASA,YACZ,EAAEC,YAAY,EAAEC,cAAc,EAAEC,uBAAuB,EAAW,EAClE,EAAEC,QAAQ,EAAiB,GAAG,CAAC,CAAC;IAEhC,MAAMC,SACFJ,gBAAgBC,kBAAkBC,0BAC5BG,6BAAoB,CAACD,MAAM,GAC3B;IACV,OAAOD,WAAW;QAAEC;QAAQE,SAAS;YAAEH;QAAS;IAAE,IAAIC;AAC1D"}
|
|
@@ -97,6 +97,11 @@ function webComponentConfig(optimization, context) {
|
|
|
97
97
|
type: 'css/mini-extract',
|
|
98
98
|
chunks: 'all',
|
|
99
99
|
enforce: true
|
|
100
|
+
},
|
|
101
|
+
servicetitan: {
|
|
102
|
+
name: 'servicetitan',
|
|
103
|
+
test: /[\\/]node_modules[\\/]@servicetitan[\\/]/,
|
|
104
|
+
chunks: 'all'
|
|
100
105
|
}
|
|
101
106
|
});
|
|
102
107
|
if (!isProduction) {
|
|
@@ -112,11 +117,6 @@ function webComponentConfig(optimization, context) {
|
|
|
112
117
|
name: 'kendo',
|
|
113
118
|
test: /[\\/]node_modules[\\/](@progress|@telerik)[\\/]/,
|
|
114
119
|
chunks: 'all'
|
|
115
|
-
},
|
|
116
|
-
servicetitan: {
|
|
117
|
-
name: 'servicetitan',
|
|
118
|
-
test: /[\\/]node_modules[\\/]@servicetitan[\\/]/,
|
|
119
|
-
chunks: 'all'
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/webpack/configs/optimization-config.ts"],"sourcesContent":["import CssMinimizerWebpackPlugin from 'css-minimizer-webpack-plugin';\nimport TerserPlugin from 'terser-webpack-plugin';\nimport { Configuration } from 'webpack';\nimport { Context, Overrides } from './types';\n\ntype Config = Configuration['optimization'];\ntype ConfigWithCacheGroups = Config & { splitChunks: { cacheGroups: Record<string, any> } };\ntype Result = Pick<Configuration, 'optimization'>;\n\nexport function optimizationConfig(context: Context, _: Overrides): Result {\n const { emitExposedDependencies, headless, isProduction } = context;\n\n const optimization: ConfigWithCacheGroups = {\n chunkIds: isProduction ? 'deterministic' : 'named',\n moduleIds: 'size',\n mangleExports: 'size',\n splitChunks: { cacheGroups: {} },\n };\n\n if (emitExposedDependencies) {\n optimization.runtimeChunk = false;\n } else if (!headless && isProduction) {\n optimization.runtimeChunk = 'single';\n }\n\n [minimizeConfig, sharedDependenciesConfig, webComponentConfig].forEach(handler =>\n handler(optimization, context)\n );\n\n return { optimization };\n}\n\nfunction minimizeConfig(optimization: ConfigWithCacheGroups, context: Context) {\n const { isProduction, codeCoverage } = context;\n if (!isProduction) {\n return;\n }\n\n const minifyJs = context.minify?.js ?? true;\n const minifyCss = context.minify?.css ?? true;\n optimization.minimize = !codeCoverage && (!!minifyJs || !!minifyCss);\n if (!optimization.minimize) {\n return;\n }\n\n const terserOptions = {\n compress: false,\n mangle: false,\n ...(typeof minifyJs === 'object' ? minifyJs : {}),\n };\n\n const cssMinimizerPluginOptions = {\n ...(typeof minifyCss === 'object' ? minifyCss : {}),\n };\n\n optimization.minimizer = [\n ...(minifyJs ? [new TerserPlugin({ terserOptions })] : []),\n ...(minifyCss ? [new CssMinimizerWebpackPlugin(cssMinimizerPluginOptions)] : []),\n ];\n}\n\nfunction sharedDependenciesConfig(optimization: ConfigWithCacheGroups, context: Context) {\n const { emitExposedDependencies } = context;\n if (!emitExposedDependencies) {\n return;\n }\n\n Object.assign(optimization.splitChunks.cacheGroups, {\n anvil2: {\n test: /@servicetitan[\\\\/]anvil2[\\\\/].*\\.css$/,\n name: 'anvil2',\n chunks: 'all',\n enforce: true,\n },\n });\n}\n\nfunction webComponentConfig(optimization: ConfigWithCacheGroups, context: Context) {\n const { headless, isWebComponent, isProduction } = context;\n if (!isWebComponent || headless) {\n return;\n }\n\n Object.assign(optimization.splitChunks.cacheGroups, {\n styles: {\n name: 'main',\n type: 'css/mini-extract',\n chunks: 'all',\n enforce: true,\n },\n });\n\n if (!isProduction) {\n return;\n }\n\n Object.assign(optimization.splitChunks.cacheGroups, {\n common: {\n name: 'common',\n test: /[\\\\/]node_modules[\\\\/](axios|classnames|formstate|mobx|mobx-react|mobx-utils|react|react-dom|react-router|react-router-dom)[\\\\/]/,\n chunks: 'all',\n },\n kendo: {\n name: 'kendo',\n test: /[\\\\/]node_modules[\\\\/](@progress|@telerik)[\\\\/]/,\n chunks: 'all',\n },\n
|
|
1
|
+
{"version":3,"sources":["../../../src/webpack/configs/optimization-config.ts"],"sourcesContent":["import CssMinimizerWebpackPlugin from 'css-minimizer-webpack-plugin';\nimport TerserPlugin from 'terser-webpack-plugin';\nimport { Configuration } from 'webpack';\nimport { Context, Overrides } from './types';\n\ntype Config = Configuration['optimization'];\ntype ConfigWithCacheGroups = Config & { splitChunks: { cacheGroups: Record<string, any> } };\ntype Result = Pick<Configuration, 'optimization'>;\n\nexport function optimizationConfig(context: Context, _: Overrides): Result {\n const { emitExposedDependencies, headless, isProduction } = context;\n\n const optimization: ConfigWithCacheGroups = {\n chunkIds: isProduction ? 'deterministic' : 'named',\n moduleIds: 'size',\n mangleExports: 'size',\n splitChunks: { cacheGroups: {} },\n };\n\n if (emitExposedDependencies) {\n optimization.runtimeChunk = false;\n } else if (!headless && isProduction) {\n optimization.runtimeChunk = 'single';\n }\n\n [minimizeConfig, sharedDependenciesConfig, webComponentConfig].forEach(handler =>\n handler(optimization, context)\n );\n\n return { optimization };\n}\n\nfunction minimizeConfig(optimization: ConfigWithCacheGroups, context: Context) {\n const { isProduction, codeCoverage } = context;\n if (!isProduction) {\n return;\n }\n\n const minifyJs = context.minify?.js ?? true;\n const minifyCss = context.minify?.css ?? true;\n optimization.minimize = !codeCoverage && (!!minifyJs || !!minifyCss);\n if (!optimization.minimize) {\n return;\n }\n\n const terserOptions = {\n compress: false,\n mangle: false,\n ...(typeof minifyJs === 'object' ? minifyJs : {}),\n };\n\n const cssMinimizerPluginOptions = {\n ...(typeof minifyCss === 'object' ? minifyCss : {}),\n };\n\n optimization.minimizer = [\n ...(minifyJs ? [new TerserPlugin({ terserOptions })] : []),\n ...(minifyCss ? [new CssMinimizerWebpackPlugin(cssMinimizerPluginOptions)] : []),\n ];\n}\n\nfunction sharedDependenciesConfig(optimization: ConfigWithCacheGroups, context: Context) {\n const { emitExposedDependencies } = context;\n if (!emitExposedDependencies) {\n return;\n }\n\n Object.assign(optimization.splitChunks.cacheGroups, {\n anvil2: {\n test: /@servicetitan[\\\\/]anvil2[\\\\/].*\\.css$/,\n name: 'anvil2',\n chunks: 'all',\n enforce: true,\n },\n });\n}\n\nfunction webComponentConfig(optimization: ConfigWithCacheGroups, context: Context) {\n const { headless, isWebComponent, isProduction } = context;\n if (!isWebComponent || headless) {\n return;\n }\n\n Object.assign(optimization.splitChunks.cacheGroups, {\n styles: {\n name: 'main',\n type: 'css/mini-extract',\n chunks: 'all',\n enforce: true,\n },\n servicetitan: {\n name: 'servicetitan',\n test: /[\\\\/]node_modules[\\\\/]@servicetitan[\\\\/]/,\n chunks: 'all',\n },\n });\n\n if (!isProduction) {\n return;\n }\n\n Object.assign(optimization.splitChunks.cacheGroups, {\n common: {\n name: 'common',\n test: /[\\\\/]node_modules[\\\\/](axios|classnames|formstate|mobx|mobx-react|mobx-utils|react|react-dom|react-router|react-router-dom)[\\\\/]/,\n chunks: 'all',\n },\n kendo: {\n name: 'kendo',\n test: /[\\\\/]node_modules[\\\\/](@progress|@telerik)[\\\\/]/,\n chunks: 'all',\n },\n });\n}\n"],"names":["optimizationConfig","context","_","emitExposedDependencies","headless","isProduction","optimization","chunkIds","moduleIds","mangleExports","splitChunks","cacheGroups","runtimeChunk","minimizeConfig","sharedDependenciesConfig","webComponentConfig","forEach","handler","codeCoverage","minifyJs","minify","js","minifyCss","css","minimize","terserOptions","compress","mangle","cssMinimizerPluginOptions","minimizer","TerserPlugin","CssMinimizerWebpackPlugin","Object","assign","anvil2","test","name","chunks","enforce","isWebComponent","styles","type","servicetitan","common","kendo"],"mappings":";;;;+BASgBA;;;eAAAA;;;kFATsB;4EACb;;;;;;AAQlB,SAASA,mBAAmBC,OAAgB,EAAEC,CAAY;IAC7D,MAAM,EAAEC,uBAAuB,EAAEC,QAAQ,EAAEC,YAAY,EAAE,GAAGJ;IAE5D,MAAMK,eAAsC;QACxCC,UAAUF,eAAe,kBAAkB;QAC3CG,WAAW;QACXC,eAAe;QACfC,aAAa;YAAEC,aAAa,CAAC;QAAE;IACnC;IAEA,IAAIR,yBAAyB;QACzBG,aAAaM,YAAY,GAAG;IAChC,OAAO,IAAI,CAACR,YAAYC,cAAc;QAClCC,aAAaM,YAAY,GAAG;IAChC;IAEA;QAACC;QAAgBC;QAA0BC;KAAmB,CAACC,OAAO,CAACC,CAAAA,UACnEA,QAAQX,cAAcL;IAG1B,OAAO;QAAEK;IAAa;AAC1B;AAEA,SAASO,eAAeP,YAAmC,EAAEL,OAAgB;QAMxDA,iBACCA;IANlB,MAAM,EAAEI,YAAY,EAAEa,YAAY,EAAE,GAAGjB;IACvC,IAAI,CAACI,cAAc;QACf;IACJ;QAEiBJ;IAAjB,MAAMkB,WAAWlB,CAAAA,sBAAAA,kBAAAA,QAAQmB,MAAM,cAAdnB,sCAAAA,gBAAgBoB,EAAE,cAAlBpB,gCAAAA,qBAAsB;QACrBA;IAAlB,MAAMqB,YAAYrB,CAAAA,uBAAAA,mBAAAA,QAAQmB,MAAM,cAAdnB,uCAAAA,iBAAgBsB,GAAG,cAAnBtB,iCAAAA,sBAAuB;IACzCK,aAAakB,QAAQ,GAAG,CAACN,gBAAiB,CAAA,CAAC,CAACC,YAAY,CAAC,CAACG,SAAQ;IAClE,IAAI,CAAChB,aAAakB,QAAQ,EAAE;QACxB;IACJ;IAEA,MAAMC,gBAAgB;QAClBC,UAAU;QACVC,QAAQ;QACR,GAAI,OAAOR,aAAa,WAAWA,WAAW,CAAC,CAAC;IACpD;IAEA,MAAMS,4BAA4B;QAC9B,GAAI,OAAON,cAAc,WAAWA,YAAY,CAAC,CAAC;IACtD;IAEAhB,aAAauB,SAAS,GAAG;WACjBV,WAAW;YAAC,IAAIW,4BAAY,CAAC;gBAAEL;YAAc;SAAG,GAAG,EAAE;WACrDH,YAAY;YAAC,IAAIS,kCAAyB,CAACH;SAA2B,GAAG,EAAE;KAClF;AACL;AAEA,SAASd,yBAAyBR,YAAmC,EAAEL,OAAgB;IACnF,MAAM,EAAEE,uBAAuB,EAAE,GAAGF;IACpC,IAAI,CAACE,yBAAyB;QAC1B;IACJ;IAEA6B,OAAOC,MAAM,CAAC3B,aAAaI,WAAW,CAACC,WAAW,EAAE;QAChDuB,QAAQ;YACJC,MAAM;YACNC,MAAM;YACNC,QAAQ;YACRC,SAAS;QACb;IACJ;AACJ;AAEA,SAASvB,mBAAmBT,YAAmC,EAAEL,OAAgB;IAC7E,MAAM,EAAEG,QAAQ,EAAEmC,cAAc,EAAElC,YAAY,EAAE,GAAGJ;IACnD,IAAI,CAACsC,kBAAkBnC,UAAU;QAC7B;IACJ;IAEA4B,OAAOC,MAAM,CAAC3B,aAAaI,WAAW,CAACC,WAAW,EAAE;QAChD6B,QAAQ;YACJJ,MAAM;YACNK,MAAM;YACNJ,QAAQ;YACRC,SAAS;QACb;QACAI,cAAc;YACVN,MAAM;YACND,MAAM;YACNE,QAAQ;QACZ;IACJ;IAEA,IAAI,CAAChC,cAAc;QACf;IACJ;IAEA2B,OAAOC,MAAM,CAAC3B,aAAaI,WAAW,CAACC,WAAW,EAAE;QAChDgC,QAAQ;YACJP,MAAM;YACND,MAAM;YACNE,QAAQ;QACZ;QACAO,OAAO;YACHR,MAAM;YACND,MAAM;YACNE,QAAQ;QACZ;IACJ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/output-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAI7C,KAAK,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;AAE5C,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"output-config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/output-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAI7C,KAAK,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;AAE5C,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAoBnE"}
|
|
@@ -20,21 +20,15 @@ function outputConfig(context, _) {
|
|
|
20
20
|
const output = {
|
|
21
21
|
filename: '[name].bundle.js',
|
|
22
22
|
path: getOutputPath(context),
|
|
23
|
+
clean: getClean(context),
|
|
23
24
|
...emitExposedDependencies ? {
|
|
24
25
|
chunkLoadingGlobal: `sharedChunk${name}`
|
|
25
26
|
} : {}
|
|
26
27
|
};
|
|
27
28
|
if (isProduction) {
|
|
28
29
|
const cdnPath = process.env.CLIENT_CDN_PATH;
|
|
29
|
-
const exposedDependenciesDir = (0, _utils.getBundleType)({
|
|
30
|
-
...context,
|
|
31
|
-
emitExposedDependencies: true
|
|
32
|
-
});
|
|
33
30
|
Object.assign(output, {
|
|
34
31
|
filename: '[name].[contenthash].bundle.js',
|
|
35
|
-
clean: exposedDependenciesDir && !emitExposedDependencies ? {
|
|
36
|
-
keep: new RegExp(exposedDependenciesDir)
|
|
37
|
-
} : true,
|
|
38
32
|
...isWebComponent ? {
|
|
39
33
|
uniqueName: name
|
|
40
34
|
} : {},
|
|
@@ -47,6 +41,19 @@ function outputConfig(context, _) {
|
|
|
47
41
|
output
|
|
48
42
|
};
|
|
49
43
|
}
|
|
44
|
+
function getClean(context) {
|
|
45
|
+
const { emitExposedDependencies } = context;
|
|
46
|
+
if (emitExposedDependencies) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
const exposedDependenciesDir = (0, _utils.getBundleType)({
|
|
50
|
+
...context,
|
|
51
|
+
emitExposedDependencies: true
|
|
52
|
+
});
|
|
53
|
+
return exposedDependenciesDir ? {
|
|
54
|
+
keep: new RegExp(exposedDependenciesDir)
|
|
55
|
+
} : true;
|
|
56
|
+
}
|
|
50
57
|
function getOutputPath(context) {
|
|
51
58
|
const { destination, emitExposedDependencies } = context;
|
|
52
59
|
var _getBundleType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/webpack/configs/output-config.ts"],"sourcesContent":["import path from 'path';\nimport { Configuration } from 'webpack';\nimport { Context, Overrides } from './types';\nimport { getBundleType } from './utils';\n\ntype Config = Configuration['output'];\ntype Result = Pick<Configuration, 'output'>;\n\nexport function outputConfig(context: Context, _: Overrides): Result {\n const { emitExposedDependencies, isProduction, isWebComponent, name } = context;\n\n const output: Config = {\n filename: '[name].bundle.js',\n path: getOutputPath(context),\n ...(emitExposedDependencies ? { chunkLoadingGlobal: `sharedChunk${name}` } : {}),\n };\n\n if (isProduction) {\n const cdnPath = process.env.CLIENT_CDN_PATH;\n
|
|
1
|
+
{"version":3,"sources":["../../../src/webpack/configs/output-config.ts"],"sourcesContent":["import path from 'path';\nimport { Configuration } from 'webpack';\nimport { Context, Overrides } from './types';\nimport { getBundleType } from './utils';\n\ntype Config = Configuration['output'];\ntype Result = Pick<Configuration, 'output'>;\n\nexport function outputConfig(context: Context, _: Overrides): Result {\n const { emitExposedDependencies, isProduction, isWebComponent, name } = context;\n\n const output: Config = {\n filename: '[name].bundle.js',\n path: getOutputPath(context),\n clean: getClean(context),\n ...(emitExposedDependencies ? { chunkLoadingGlobal: `sharedChunk${name}` } : {}),\n };\n\n if (isProduction) {\n const cdnPath = process.env.CLIENT_CDN_PATH;\n Object.assign(output, {\n filename: '[name].[contenthash].bundle.js',\n ...(isWebComponent ? { uniqueName: name } : {}),\n ...(cdnPath ? { publicPath: cdnPath } : {}),\n });\n }\n\n return { output };\n}\n\nfunction getClean(context: Context): NonNullable<Config>['clean'] {\n const { emitExposedDependencies } = context;\n if (emitExposedDependencies) {\n return true;\n }\n const exposedDependenciesDir = getBundleType({ ...context, emitExposedDependencies: true });\n return exposedDependenciesDir ? { keep: new RegExp(exposedDependenciesDir) } : true;\n}\n\nfunction getOutputPath(context: Context) {\n const { destination, emitExposedDependencies } = context;\n\n const subdir = getBundleType(context) ?? '';\n if (typeof emitExposedDependencies === 'object') {\n const { output } = emitExposedDependencies;\n if (output?.path) {\n return path.join(output.path, subdir);\n }\n }\n\n return path.join(process.cwd(), destination, 'bundle', subdir);\n}\n"],"names":["outputConfig","context","_","emitExposedDependencies","isProduction","isWebComponent","name","output","filename","path","getOutputPath","clean","getClean","chunkLoadingGlobal","cdnPath","process","env","CLIENT_CDN_PATH","Object","assign","uniqueName","publicPath","exposedDependenciesDir","getBundleType","keep","RegExp","destination","subdir","join","cwd"],"mappings":";;;;+BAQgBA;;;eAAAA;;;6DARC;uBAGa;;;;;;AAKvB,SAASA,aAAaC,OAAgB,EAAEC,CAAY;IACvD,MAAM,EAAEC,uBAAuB,EAAEC,YAAY,EAAEC,cAAc,EAAEC,IAAI,EAAE,GAAGL;IAExE,MAAMM,SAAiB;QACnBC,UAAU;QACVC,MAAMC,cAAcT;QACpBU,OAAOC,SAASX;QAChB,GAAIE,0BAA0B;YAAEU,oBAAoB,CAAC,WAAW,EAAEP,MAAM;QAAC,IAAI,CAAC,CAAC;IACnF;IAEA,IAAIF,cAAc;QACd,MAAMU,UAAUC,QAAQC,GAAG,CAACC,eAAe;QAC3CC,OAAOC,MAAM,CAACZ,QAAQ;YAClBC,UAAU;YACV,GAAIH,iBAAiB;gBAAEe,YAAYd;YAAK,IAAI,CAAC,CAAC;YAC9C,GAAIQ,UAAU;gBAAEO,YAAYP;YAAQ,IAAI,CAAC,CAAC;QAC9C;IACJ;IAEA,OAAO;QAAEP;IAAO;AACpB;AAEA,SAASK,SAASX,OAAgB;IAC9B,MAAM,EAAEE,uBAAuB,EAAE,GAAGF;IACpC,IAAIE,yBAAyB;QACzB,OAAO;IACX;IACA,MAAMmB,yBAAyBC,IAAAA,oBAAa,EAAC;QAAE,GAAGtB,OAAO;QAAEE,yBAAyB;IAAK;IACzF,OAAOmB,yBAAyB;QAAEE,MAAM,IAAIC,OAAOH;IAAwB,IAAI;AACnF;AAEA,SAASZ,cAAcT,OAAgB;IACnC,MAAM,EAAEyB,WAAW,EAAEvB,uBAAuB,EAAE,GAAGF;QAElCsB;IAAf,MAAMI,SAASJ,CAAAA,iBAAAA,IAAAA,oBAAa,EAACtB,sBAAdsB,4BAAAA,iBAA0B;IACzC,IAAI,OAAOpB,4BAA4B,UAAU;QAC7C,MAAM,EAAEI,MAAM,EAAE,GAAGJ;QACnB,IAAII,mBAAAA,6BAAAA,OAAQE,IAAI,EAAE;YACd,OAAOA,aAAI,CAACmB,IAAI,CAACrB,OAAOE,IAAI,EAAEkB;QAClC;IACJ;IAEA,OAAOlB,aAAI,CAACmB,IAAI,CAACb,QAAQc,GAAG,IAAIH,aAAa,UAAUC;AAC3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets-manifest-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/assets-manifest-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAQ9C,UAAU,WAAW;IACjB,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,EAAE,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,qCA+BlE;
|
|
1
|
+
{"version":3,"file":"assets-manifest-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/assets-manifest-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAQ9C,UAAU,WAAW;IACjB,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,EAAE,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,qCA+BlE;AASD,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,OAAO,2BAMjE"}
|
|
@@ -35,13 +35,13 @@ function assetsManifestPlugin(context, _) {
|
|
|
35
35
|
output: 'entrypoints.json',
|
|
36
36
|
transform (assets) {
|
|
37
37
|
const getAssetsByType = (type)=>{
|
|
38
|
-
return Object.values(assets.entrypoints).
|
|
38
|
+
return Object.values(assets.entrypoints).flatMap(({ assets })=>{
|
|
39
39
|
var _assets_type;
|
|
40
40
|
return (_assets_type = assets[type]) !== null && _assets_type !== void 0 ? _assets_type : [];
|
|
41
|
-
})
|
|
41
|
+
});
|
|
42
42
|
};
|
|
43
43
|
return {
|
|
44
|
-
css: getAssetsByType('css'),
|
|
44
|
+
css: ensureDesignSystemCssIsFirst(getAssetsByType('css')),
|
|
45
45
|
js: getAssetsByType('js')
|
|
46
46
|
};
|
|
47
47
|
},
|
|
@@ -55,6 +55,13 @@ function assetsManifestPlugin(context, _) {
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
+
function ensureDesignSystemCssIsFirst(cssAssets) {
|
|
59
|
+
const offset = cssAssets.findIndex((name)=>name.startsWith('servicetitan'));
|
|
60
|
+
return offset > 0 ? [
|
|
61
|
+
cssAssets[offset],
|
|
62
|
+
...cssAssets.filter((_, index)=>index !== offset)
|
|
63
|
+
] : cssAssets;
|
|
64
|
+
}
|
|
58
65
|
function getExposedDependenciesEntryPoints(context) {
|
|
59
66
|
const metadataPath = getExposedDependenciesMetadataPath(context);
|
|
60
67
|
const metadata = (0, _utils1.readJsonSafe)(metadataPath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/webpack/configs/plugins/assets-manifest-plugin.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { WebpackAssetsManifest } from 'webpack-assets-manifest';\nimport { Context, Overrides } from '../types';\nimport { generateMetadata } from '../utils';\nimport { readJsonSafe } from '../../../utils';\n\ninterface Metadata {\n entryPointsPath: string;\n}\n\ninterface EntryPoints {\n css: string[];\n js: string[];\n}\n\nexport function assetsManifestPlugin(context: Context, _: Overrides) {\n if (!(context.isWebComponent || context.emitExposedDependencies)) {\n return;\n }\n\n return new WebpackAssetsManifest({\n entrypoints: true,\n output: 'entrypoints.json',\n transform(assets: {\n entrypoints: Record<string, { assets: Record<string, string[]> }>;\n }): EntryPoints {\n const getAssetsByType = (type: string) => {\n return Object.values(assets.entrypoints)\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/webpack/configs/plugins/assets-manifest-plugin.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { WebpackAssetsManifest } from 'webpack-assets-manifest';\nimport { Context, Overrides } from '../types';\nimport { generateMetadata } from '../utils';\nimport { readJsonSafe } from '../../../utils';\n\ninterface Metadata {\n entryPointsPath: string;\n}\n\ninterface EntryPoints {\n css: string[];\n js: string[];\n}\n\nexport function assetsManifestPlugin(context: Context, _: Overrides) {\n if (!(context.isWebComponent || context.emitExposedDependencies)) {\n return;\n }\n\n return new WebpackAssetsManifest({\n entrypoints: true,\n output: 'entrypoints.json',\n transform(assets: {\n entrypoints: Record<string, { assets: Record<string, string[]> }>;\n }): EntryPoints {\n const getAssetsByType = (type: string) => {\n return Object.values(assets.entrypoints).flatMap(\n ({ assets }) => assets[type] ?? []\n );\n };\n\n return {\n css: ensureDesignSystemCssIsFirst(getAssetsByType('css')),\n js: getAssetsByType('js'),\n };\n },\n // eslint-disable-next-line @typescript-eslint/require-await\n done: async (manifest: WebpackAssetsManifest) => {\n if (context.emitExposedDependencies) {\n generateExposedDependenciesMetadata(context, manifest);\n } else {\n generateMetadata(context);\n }\n },\n });\n}\n\nfunction ensureDesignSystemCssIsFirst(cssAssets: string[]) {\n const offset = cssAssets.findIndex(name => name.startsWith('servicetitan'));\n return offset > 0\n ? [cssAssets[offset], ...cssAssets.filter((_, index) => index !== offset)]\n : cssAssets;\n}\n\nexport function getExposedDependenciesEntryPoints(context: Context) {\n const metadataPath = getExposedDependenciesMetadataPath(context);\n const metadata = readJsonSafe<Metadata>(metadataPath);\n if (metadata?.entryPointsPath) {\n return readJsonSafe<EntryPoints>(metadata.entryPointsPath);\n }\n}\n\nfunction generateExposedDependenciesMetadata(context: Context, manifest: WebpackAssetsManifest) {\n const { destination } = context;\n if (!fs.existsSync(destination)) {\n fs.mkdirSync(destination, { recursive: true });\n }\n\n const metadataPath = getExposedDependenciesMetadataPath(context);\n const metadata: Metadata = { entryPointsPath: manifest.getOutputPath() };\n fs.writeFileSync(metadataPath, JSON.stringify(metadata, null, 2), 'utf-8');\n}\n\nfunction getExposedDependenciesMetadataPath({ destination }: Context) {\n return path.join(destination, 'exposed-dependencies-metadata.json');\n}\n"],"names":["assetsManifestPlugin","getExposedDependenciesEntryPoints","context","_","isWebComponent","emitExposedDependencies","WebpackAssetsManifest","entrypoints","output","transform","assets","getAssetsByType","type","Object","values","flatMap","css","ensureDesignSystemCssIsFirst","js","done","manifest","generateExposedDependenciesMetadata","generateMetadata","cssAssets","offset","findIndex","name","startsWith","filter","index","metadataPath","getExposedDependenciesMetadataPath","metadata","readJsonSafe","entryPointsPath","destination","fs","existsSync","mkdirSync","recursive","getOutputPath","writeFileSync","JSON","stringify","path","join"],"mappings":";;;;;;;;;;;QAgBgBA;eAAAA;;QAwCAC;eAAAA;;;2DAxDD;6DACE;uCACqB;uBAEL;wBACJ;;;;;;AAWtB,SAASD,qBAAqBE,OAAgB,EAAEC,CAAY;IAC/D,IAAI,CAAED,CAAAA,QAAQE,cAAc,IAAIF,QAAQG,uBAAuB,AAAD,GAAI;QAC9D;IACJ;IAEA,OAAO,IAAIC,4CAAqB,CAAC;QAC7BC,aAAa;QACbC,QAAQ;QACRC,WAAUC,MAET;YACG,MAAMC,kBAAkB,CAACC;gBACrB,OAAOC,OAAOC,MAAM,CAACJ,OAAOH,WAAW,EAAEQ,OAAO,CAC5C,CAAC,EAAEL,MAAM,EAAE;wBAAKA;2BAAAA,CAAAA,eAAAA,MAAM,CAACE,KAAK,cAAZF,0BAAAA,eAAgB,EAAE;;YAE1C;YAEA,OAAO;gBACHM,KAAKC,6BAA6BN,gBAAgB;gBAClDO,IAAIP,gBAAgB;YACxB;QACJ;QACA,4DAA4D;QAC5DQ,MAAM,OAAOC;YACT,IAAIlB,QAAQG,uBAAuB,EAAE;gBACjCgB,oCAAoCnB,SAASkB;YACjD,OAAO;gBACHE,IAAAA,uBAAgB,EAACpB;YACrB;QACJ;IACJ;AACJ;AAEA,SAASe,6BAA6BM,SAAmB;IACrD,MAAMC,SAASD,UAAUE,SAAS,CAACC,CAAAA,OAAQA,KAAKC,UAAU,CAAC;IAC3D,OAAOH,SAAS,IACV;QAACD,SAAS,CAACC,OAAO;WAAKD,UAAUK,MAAM,CAAC,CAACzB,GAAG0B,QAAUA,UAAUL;KAAQ,GACxED;AACV;AAEO,SAAStB,kCAAkCC,OAAgB;IAC9D,MAAM4B,eAAeC,mCAAmC7B;IACxD,MAAM8B,WAAWC,IAAAA,oBAAY,EAAWH;IACxC,IAAIE,qBAAAA,+BAAAA,SAAUE,eAAe,EAAE;QAC3B,OAAOD,IAAAA,oBAAY,EAAcD,SAASE,eAAe;IAC7D;AACJ;AAEA,SAASb,oCAAoCnB,OAAgB,EAAEkB,QAA+B;IAC1F,MAAM,EAAEe,WAAW,EAAE,GAAGjC;IACxB,IAAI,CAACkC,WAAE,CAACC,UAAU,CAACF,cAAc;QAC7BC,WAAE,CAACE,SAAS,CAACH,aAAa;YAAEI,WAAW;QAAK;IAChD;IAEA,MAAMT,eAAeC,mCAAmC7B;IACxD,MAAM8B,WAAqB;QAAEE,iBAAiBd,SAASoB,aAAa;IAAG;IACvEJ,WAAE,CAACK,aAAa,CAACX,cAAcY,KAAKC,SAAS,CAACX,UAAU,MAAM,IAAI;AACtE;AAEA,SAASD,mCAAmC,EAAEI,WAAW,EAAW;IAChE,OAAOS,aAAI,CAACC,IAAI,CAACV,aAAa;AAClC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/startup",
|
|
3
|
-
"version": "32.
|
|
3
|
+
"version": "32.3.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://docs.st.dev/docs/frontend/startup",
|
|
6
6
|
"repository": {
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"bin": "./bin/index.js",
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/cpx": "~1.5.5",
|
|
28
|
+
"@types/debug": "^4.1.12",
|
|
28
29
|
"@types/eslint": "~9.6.1",
|
|
29
30
|
"@types/less": "~3.0.8",
|
|
30
31
|
"@types/lodash.memoize": "^4.1.9",
|
|
@@ -33,26 +34,26 @@
|
|
|
33
34
|
"@types/yargs": "~17.0.24"
|
|
34
35
|
},
|
|
35
36
|
"dependencies": {
|
|
36
|
-
"@babel/preset-env": "~7.28.
|
|
37
|
+
"@babel/preset-env": "~7.28.5",
|
|
37
38
|
"@jest/core": "~29.7.0",
|
|
38
39
|
"@jest/types": "~29.6.3",
|
|
39
40
|
"@jsdevtools/coverage-istanbul-loader": "^3.0.5",
|
|
40
|
-
"@servicetitan/eslint-config": "32.
|
|
41
|
-
"@servicetitan/stylelint-config": "32.
|
|
41
|
+
"@servicetitan/eslint-config": "32.3.0",
|
|
42
|
+
"@servicetitan/stylelint-config": "32.3.0",
|
|
42
43
|
"@svgr/webpack": "^8.1.0",
|
|
43
44
|
"@swc/cli": "^0.5.0",
|
|
44
45
|
"@swc/core": "1.13.5",
|
|
45
|
-
"@types/debug": "^4.1.12",
|
|
46
46
|
"@types/jest": "~29.5.12",
|
|
47
47
|
"@vitest/coverage-v8": "^3.2.4",
|
|
48
48
|
"chalk": "~4.1.2",
|
|
49
|
+
"cli-table3": "^0.6.5",
|
|
49
50
|
"cpx2": "8.0.0",
|
|
50
51
|
"css-loader": "~7.1.2",
|
|
51
52
|
"css-minimizer-webpack-plugin": "^7.0.2",
|
|
52
53
|
"debounce": "^2.2.0",
|
|
53
54
|
"debug": "^4.4.3",
|
|
54
55
|
"deepmerge": "~4.3.1",
|
|
55
|
-
"eslint": "~9.
|
|
56
|
+
"eslint": "~9.38.0",
|
|
56
57
|
"execa": "~5.1.1",
|
|
57
58
|
"glob": "~11.0.3",
|
|
58
59
|
"html-webpack-plugin": "~5.6.4",
|
|
@@ -63,33 +64,34 @@
|
|
|
63
64
|
"jest-environment-jsdom": "^29.7.0",
|
|
64
65
|
"jest-fetch-mock": "~3.0.3",
|
|
65
66
|
"json5": "^2.2.3",
|
|
66
|
-
"
|
|
67
|
-
"
|
|
67
|
+
"jwa": "^1.4.2",
|
|
68
|
+
"lerna": "~9.0.0",
|
|
69
|
+
"less": "~4.4.2",
|
|
68
70
|
"less-loader": "~12.3.0",
|
|
69
71
|
"less-plugin-npm-import": "~2.1.0",
|
|
70
72
|
"lodash.memoize": "^4.1.2",
|
|
71
|
-
"memfs": "~4.
|
|
73
|
+
"memfs": "~4.49.0",
|
|
72
74
|
"mini-css-extract-plugin": "~2.9.4",
|
|
73
75
|
"moment-locales-webpack-plugin": "~1.2.0",
|
|
74
76
|
"multimatch": "~5.0.0",
|
|
75
77
|
"portfinder": "~1.0.38",
|
|
76
78
|
"postcss": "~8.5.6",
|
|
77
79
|
"prettier": "~3.6.2",
|
|
78
|
-
"sass": "~1.
|
|
79
|
-
"sass-loader": "~16.0.
|
|
80
|
-
"semver": "~7.7.
|
|
80
|
+
"sass": "~1.93.2",
|
|
81
|
+
"sass-loader": "~16.0.6",
|
|
82
|
+
"semver": "~7.7.3",
|
|
81
83
|
"source-map-loader": "~5.0.0",
|
|
82
84
|
"style-loader": "~4.0.0",
|
|
83
|
-
"stylelint": "~16.
|
|
84
|
-
"terminal-link": "^
|
|
85
|
+
"stylelint": "~16.25.0",
|
|
86
|
+
"terminal-link": "^5.0.0",
|
|
85
87
|
"terser-webpack-plugin": "^5.3.14",
|
|
86
|
-
"ts-jest": "29.4.
|
|
88
|
+
"ts-jest": "29.4.5",
|
|
87
89
|
"ts-node": "~10.9.2",
|
|
88
90
|
"typed-css-modules": "~0.9.1",
|
|
89
|
-
"typescript": "5.9.
|
|
91
|
+
"typescript": "5.9.3",
|
|
90
92
|
"vitest": "^3.2.4",
|
|
91
|
-
"webpack": "~5.
|
|
92
|
-
"webpack-assets-manifest": "~6.
|
|
93
|
+
"webpack": "~5.102.1",
|
|
94
|
+
"webpack-assets-manifest": "~6.3.0",
|
|
93
95
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
94
96
|
"webpack-dev-server": "~5.2.2",
|
|
95
97
|
"webpack-filter-warnings-plugin": "~1.2.1",
|
|
@@ -101,7 +103,7 @@
|
|
|
101
103
|
"yargs": "~17.7.2"
|
|
102
104
|
},
|
|
103
105
|
"peerDependencies": {
|
|
104
|
-
"moment": "
|
|
106
|
+
"moment": ">=2.30.1"
|
|
105
107
|
},
|
|
106
108
|
"peerDependenciesMeta": {
|
|
107
109
|
"moment": {
|
|
@@ -112,6 +114,10 @@
|
|
|
112
114
|
"@swc/cli": [
|
|
113
115
|
"Update when https://github.com/swc-project/swc/issues/10535 is resolved",
|
|
114
116
|
"See also SwcCompilePackage.execute in file://./src/cli/tasks/swc-compile-package.ts"
|
|
117
|
+
],
|
|
118
|
+
"jwa": [
|
|
119
|
+
"@progress/kendo-licensing@1.3.5 -> jsonwebtoken@9.0.2 -> jws@3.2.2 -> jwa@1.4.1",
|
|
120
|
+
"Forcing ^1.4.2 to fix Node v25 incompatibility in 1.4.1 (see https://github.com/auth0/node-jsonwebtoken/issues/992)"
|
|
115
121
|
]
|
|
116
122
|
},
|
|
117
123
|
"publishConfig": {
|
|
@@ -120,5 +126,5 @@
|
|
|
120
126
|
"cli": {
|
|
121
127
|
"webpack": false
|
|
122
128
|
},
|
|
123
|
-
"gitHead": "
|
|
129
|
+
"gitHead": "201392862b3cb12500b3c8c4f6310b101b87201b"
|
|
124
130
|
}
|
|
@@ -46,6 +46,16 @@ describe(`[startup] ${BundlePackage.name}`, () => {
|
|
|
46
46
|
});
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
+
describe('with "code-coverage"', () => {
|
|
50
|
+
beforeEach(() => (args.codeCoverage = true));
|
|
51
|
+
|
|
52
|
+
test('bundles with code coverage', async () => {
|
|
53
|
+
await subject();
|
|
54
|
+
|
|
55
|
+
expect(bundle).toHaveBeenCalledWith(expect.objectContaining({ codeCoverage: true }));
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
49
59
|
describe('with "config"', () => {
|
|
50
60
|
beforeEach(() => (args.config = 'foo.config.js'));
|
|
51
61
|
|
|
@@ -56,7 +66,7 @@ describe(`[startup] ${BundlePackage.name}`, () => {
|
|
|
56
66
|
});
|
|
57
67
|
|
|
58
68
|
describe('with "exposed-dependencies"', () => {
|
|
59
|
-
beforeEach(() => (args
|
|
69
|
+
beforeEach(() => (args.exposedDependencies = true));
|
|
60
70
|
|
|
61
71
|
test('ignores config file', async () => {
|
|
62
72
|
await subject();
|
|
@@ -69,7 +79,7 @@ describe(`[startup] ${BundlePackage.name}`, () => {
|
|
|
69
79
|
});
|
|
70
80
|
|
|
71
81
|
describe('with "exposed-dependencies"', () => {
|
|
72
|
-
beforeEach(() => (args
|
|
82
|
+
beforeEach(() => (args.exposedDependencies = true));
|
|
73
83
|
|
|
74
84
|
test('bundles exposed dependencies', async () => {
|
|
75
85
|
await subject();
|
|
@@ -102,6 +112,16 @@ describe(`[startup] ${BundlePackage.name}`, () => {
|
|
|
102
112
|
});
|
|
103
113
|
});
|
|
104
114
|
|
|
115
|
+
describe('with "use-watch-config"', () => {
|
|
116
|
+
beforeEach(() => (args.useWatchConfig = true));
|
|
117
|
+
|
|
118
|
+
test('bundles package with useWatchConfig', async () => {
|
|
119
|
+
await subject();
|
|
120
|
+
|
|
121
|
+
expect(bundle).toHaveBeenCalledWith(expect.objectContaining({ useWatchConfig: true }));
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
|
|
105
125
|
describe('when tsconfig\'s compilerOptions.module is not "esnext"', () => {
|
|
106
126
|
beforeEach(() => {
|
|
107
127
|
vol.fromJSON({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { vol, fs } from 'memfs';
|
|
2
2
|
import { execSync } from 'child_process';
|
|
3
3
|
import { getStartupVersion, log } from '../../../utils';
|
|
4
|
-
import { gitCloneRepo, isCI } from '../../utils';
|
|
4
|
+
import { gitCloneRepo, isCI, npmWhoAmI } from '../../utils';
|
|
5
5
|
|
|
6
6
|
import { Install } from '../install';
|
|
7
7
|
|
|
@@ -11,6 +11,7 @@ jest.mock('../../utils', () => ({
|
|
|
11
11
|
...jest.requireActual('../../utils'),
|
|
12
12
|
gitCloneRepo: jest.fn(),
|
|
13
13
|
isCI: jest.fn(),
|
|
14
|
+
npmWhoAmI: jest.fn(),
|
|
14
15
|
}));
|
|
15
16
|
jest.mock('../../../utils', () => ({
|
|
16
17
|
...jest.requireActual('../../../utils'),
|
|
@@ -37,11 +38,12 @@ describe(`${Install.name}`, () => {
|
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
beforeEach(() => {
|
|
40
|
-
args =
|
|
41
|
+
args = {};
|
|
41
42
|
jest.clearAllMocks();
|
|
42
43
|
jest.mocked(gitCloneRepo).mockResolvedValue(true);
|
|
43
44
|
jest.mocked(getStartupVersion).mockReturnValue(startupVersion);
|
|
44
45
|
jest.mocked(isCI).mockReturnValue(false);
|
|
46
|
+
jest.mocked(npmWhoAmI).mockReturnValue(undefined);
|
|
45
47
|
jest.spyOn(fs, 'mkdtempSync').mockImplementation(() => tempDirPath);
|
|
46
48
|
volFromJSON();
|
|
47
49
|
});
|
|
@@ -105,7 +107,11 @@ describe(`${Install.name}`, () => {
|
|
|
105
107
|
test('does not configure NPM token', async () => {
|
|
106
108
|
await subject();
|
|
107
109
|
|
|
108
|
-
expect(
|
|
110
|
+
expect(gitCloneRepo).not.toHaveBeenCalled();
|
|
111
|
+
expect(execSync).not.toHaveBeenCalledWith(
|
|
112
|
+
expect.stringMatching(/npm config/),
|
|
113
|
+
expect.anything()
|
|
114
|
+
);
|
|
109
115
|
});
|
|
110
116
|
}
|
|
111
117
|
|
|
@@ -113,10 +119,29 @@ describe(`${Install.name}`, () => {
|
|
|
113
119
|
test('does not delete project token', async () => {
|
|
114
120
|
await subject();
|
|
115
121
|
|
|
116
|
-
expect(execSync).not.toHaveBeenCalledWith(
|
|
122
|
+
expect(execSync).not.toHaveBeenCalledWith(
|
|
123
|
+
expect.stringMatching(/npm config delete/),
|
|
124
|
+
expect.anything()
|
|
125
|
+
);
|
|
117
126
|
});
|
|
118
127
|
}
|
|
119
128
|
|
|
129
|
+
describe('when "st-team" is already logged in', () => {
|
|
130
|
+
beforeEach(() => jest.mocked(npmWhoAmI).mockReturnValue('st-team'));
|
|
131
|
+
|
|
132
|
+
itDoesNotConfigureNpmToken();
|
|
133
|
+
|
|
134
|
+
describe('with --token', () => {
|
|
135
|
+
beforeEach(() => (args = { token: true }));
|
|
136
|
+
|
|
137
|
+
test('configures NPM token', async () => {
|
|
138
|
+
await subject();
|
|
139
|
+
|
|
140
|
+
expect(execSync).toHaveBeenCalledWith(expect.stringMatching(/npm config set/));
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
|
|
120
145
|
describe('when .npmrc uses an environment variable', () => {
|
|
121
146
|
beforeEach(() => {
|
|
122
147
|
volFromJSON({
|
|
@@ -195,6 +220,19 @@ describe(`${Install.name}`, () => {
|
|
|
195
220
|
itDoesNotConfigureNpmToken();
|
|
196
221
|
});
|
|
197
222
|
|
|
223
|
+
describe('with --token', () => {
|
|
224
|
+
beforeEach(() => (args = { token: true }));
|
|
225
|
+
|
|
226
|
+
test('does not run "npm i"', async () => {
|
|
227
|
+
await subject();
|
|
228
|
+
|
|
229
|
+
expect(execSync).not.toHaveBeenCalledWith(
|
|
230
|
+
expect.stringMatching(/npm i/),
|
|
231
|
+
expect.anything()
|
|
232
|
+
);
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
|
|
198
236
|
function itLogsError(message: string | RegExp) {
|
|
199
237
|
test('logs error', async () => {
|
|
200
238
|
await subject();
|