@servicetitan/startup 31.3.2 → 31.5.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 +0 -7
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +28 -17
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/bundle-package.d.ts +1 -1
- package/dist/cli/commands/bundle-package.d.ts.map +1 -1
- package/dist/cli/commands/bundle-package.js +13 -21
- package/dist/cli/commands/bundle-package.js.map +1 -1
- package/dist/cli/commands/clean.js +1 -1
- package/dist/cli/commands/clean.js.map +1 -1
- package/dist/cli/commands/eslint.d.ts +0 -1
- package/dist/cli/commands/eslint.d.ts.map +1 -1
- package/dist/cli/commands/eslint.js +0 -3
- 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 +3 -1
- package/dist/cli/commands/get-command.js.map +1 -1
- package/dist/cli/commands/get-user-commands.js +3 -2
- package/dist/cli/commands/get-user-commands.js.map +1 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/commands/mfe-package-clean.d.ts +3 -4
- package/dist/cli/commands/mfe-package-clean.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-clean.js +0 -3
- package/dist/cli/commands/mfe-package-clean.js.map +1 -1
- package/dist/cli/commands/mfe-package-publish.d.ts +9 -4
- package/dist/cli/commands/mfe-package-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-publish.js +70 -47
- package/dist/cli/commands/mfe-package-publish.js.map +1 -1
- package/dist/cli/commands/mfe-publish.d.ts +3 -3
- package/dist/cli/commands/mfe-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-publish.js +7 -1
- package/dist/cli/commands/mfe-publish.js.map +1 -1
- package/dist/cli/commands/prepare-package.d.ts +0 -1
- package/dist/cli/commands/prepare-package.d.ts.map +1 -1
- package/dist/cli/commands/prepare-package.js +0 -3
- package/dist/cli/commands/prepare-package.js.map +1 -1
- package/dist/cli/commands/review/review.js.map +1 -1
- package/dist/cli/commands/review/rules/require-one-anvil-uikit-contrib-version.js.map +1 -1
- package/dist/cli/commands/review/rules/require-one-collection-version.js.map +1 -1
- package/dist/cli/commands/review/rules/require-one-uikit-version.js.map +1 -1
- package/dist/cli/commands/run-task.d.ts +0 -1
- package/dist/cli/commands/run-task.d.ts.map +1 -1
- package/dist/cli/commands/run-task.js +0 -3
- package/dist/cli/commands/run-task.js.map +1 -1
- package/dist/cli/commands/start.d.ts +0 -8
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +28 -16
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/styles-check.d.ts +0 -1
- package/dist/cli/commands/styles-check.d.ts.map +1 -1
- package/dist/cli/commands/styles-check.js +40 -99
- package/dist/cli/commands/styles-check.js.map +1 -1
- package/dist/cli/commands/tests.js.map +1 -1
- package/dist/cli/commands/types.d.ts +1 -1
- package/dist/cli/commands/types.d.ts.map +1 -1
- package/dist/cli/commands/upload-sourcemaps.d.ts +22 -0
- package/dist/cli/commands/upload-sourcemaps.d.ts.map +1 -0
- package/dist/cli/commands/upload-sourcemaps.js +179 -0
- package/dist/cli/commands/upload-sourcemaps.js.map +1 -0
- package/dist/cli/tasks/cli-task.js.map +1 -1
- package/dist/cli/tasks/swc-compile-package.js.map +1 -1
- package/dist/cli/tasks/task.js.map +1 -1
- package/dist/cli/tasks/tsc-compile-package.js.map +1 -1
- package/dist/cli/tasks/tsc-compile.js.map +1 -1
- package/dist/cli/utils/bundle.d.ts +4 -1
- package/dist/cli/utils/bundle.d.ts.map +1 -1
- package/dist/cli/utils/bundle.js +67 -74
- package/dist/cli/utils/bundle.js.map +1 -1
- package/dist/cli/utils/cli-os.js +2 -2
- package/dist/cli/utils/cli-os.js.map +1 -1
- package/dist/cli/utils/ts-config.js.map +1 -1
- package/dist/utils/find-packages.d.ts.map +1 -1
- package/dist/utils/find-packages.js +3 -4
- package/dist/utils/find-packages.js.map +1 -1
- package/dist/utils/find-up.d.ts +2 -0
- package/dist/utils/find-up.d.ts.map +1 -0
- package/dist/utils/find-up.js +28 -0
- package/dist/utils/find-up.js.map +1 -0
- package/dist/utils/get-configuration.d.ts +3 -1
- 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/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/log.js.map +1 -1
- package/dist/webpack/configs/cache-config.d.ts +6 -0
- package/dist/webpack/configs/cache-config.d.ts.map +1 -0
- package/dist/webpack/configs/cache-config.js +52 -0
- package/dist/webpack/configs/cache-config.js.map +1 -0
- package/dist/webpack/configs/dev-server-config.js +1 -1
- package/dist/webpack/configs/dev-server-config.js.map +1 -1
- package/dist/webpack/configs/entry.config.d.ts.map +1 -1
- package/dist/webpack/configs/entry.config.js +15 -6
- package/dist/webpack/configs/entry.config.js.map +1 -1
- package/dist/webpack/configs/externals-config.d.ts.map +1 -1
- package/dist/webpack/configs/externals-config.js +6 -2
- package/dist/webpack/configs/externals-config.js.map +1 -1
- package/dist/webpack/configs/index.d.ts +1 -0
- package/dist/webpack/configs/index.d.ts.map +1 -1
- package/dist/webpack/configs/index.js +1 -0
- package/dist/webpack/configs/index.js.map +1 -1
- package/dist/webpack/configs/optimization-config.d.ts.map +1 -1
- package/dist/webpack/configs/optimization-config.js +7 -11
- 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 +25 -4
- package/dist/webpack/configs/output-config.js.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.d.ts +6 -0
- package/dist/webpack/configs/plugins/assets-manifest-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js +50 -8
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js +3 -7
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js +3 -2
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-instance-dependencies-plugin.js +2 -2
- package/dist/webpack/configs/plugins/define-exposed-instance-dependencies-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/html-plugin.d.ts +1 -1
- package/dist/webpack/configs/plugins/html-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/html-plugin.js +2 -3
- package/dist/webpack/configs/plugins/html-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/html-tags-plugin.d.ts +4 -0
- package/dist/webpack/configs/plugins/html-tags-plugin.d.ts.map +1 -0
- package/dist/webpack/configs/plugins/html-tags-plugin.js +49 -0
- package/dist/webpack/configs/plugins/html-tags-plugin.js.map +1 -0
- package/dist/webpack/configs/plugins/index.d.ts +2 -0
- package/dist/webpack/configs/plugins/index.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/index.js +2 -0
- package/dist/webpack/configs/plugins/index.js.map +1 -1
- package/dist/webpack/configs/plugins/remove-empty-scripts-plugin.d.ts +4 -0
- package/dist/webpack/configs/plugins/remove-empty-scripts-plugin.d.ts.map +1 -0
- package/dist/webpack/configs/plugins/remove-empty-scripts-plugin.js +25 -0
- package/dist/webpack/configs/plugins/remove-empty-scripts-plugin.js.map +1 -0
- package/dist/webpack/configs/plugins/virtual-modules-plugin.d.ts +1 -0
- package/dist/webpack/configs/plugins/virtual-modules-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/virtual-modules-plugin.js +23 -14
- package/dist/webpack/configs/plugins/virtual-modules-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins-config.d.ts.map +1 -1
- package/dist/webpack/configs/plugins-config.js +2 -0
- package/dist/webpack/configs/plugins-config.js.map +1 -1
- package/dist/webpack/configs/rules/css-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/css-rules.js +13 -18
- package/dist/webpack/configs/rules/css-rules.js.map +1 -1
- package/dist/webpack/configs/utils/get-bundle-type.d.ts +3 -0
- package/dist/webpack/configs/utils/get-bundle-type.d.ts.map +1 -0
- package/dist/webpack/configs/utils/get-bundle-type.js +24 -0
- package/dist/webpack/configs/utils/get-bundle-type.js.map +1 -0
- package/dist/webpack/configs/utils/index.d.ts +1 -0
- package/dist/webpack/configs/utils/index.d.ts.map +1 -1
- package/dist/webpack/configs/utils/index.js +1 -0
- package/dist/webpack/configs/utils/index.js.map +1 -1
- package/dist/webpack/create-webpack-config.d.ts.map +1 -1
- package/dist/webpack/create-webpack-config.js +37 -48
- package/dist/webpack/create-webpack-config.js.map +1 -1
- package/dist/webpack/types.d.ts +4 -0
- package/dist/webpack/types.d.ts.map +1 -1
- package/dist/webpack/utils/index.d.ts +1 -0
- package/dist/webpack/utils/index.d.ts.map +1 -1
- package/dist/webpack/utils/index.js +1 -0
- package/dist/webpack/utils/index.js.map +1 -1
- package/dist/webpack/utils/stringify-config.d.ts +2 -0
- package/dist/webpack/utils/stringify-config.d.ts.map +1 -0
- package/dist/webpack/utils/stringify-config.js +35 -0
- package/dist/webpack/utils/stringify-config.js.map +1 -0
- package/package.json +17 -15
- package/src/cli/commands/__tests__/build.test.ts +19 -2
- package/src/cli/commands/__tests__/bundle-package.test.ts +29 -8
- package/src/cli/commands/__tests__/clean.test.ts +2 -0
- package/src/cli/commands/__tests__/get-user-commands.test.ts +1 -1
- package/src/cli/commands/__tests__/mfe-package-publish.test.ts +91 -15
- package/src/cli/commands/__tests__/mfe-publish.test.ts +2 -0
- package/src/cli/commands/__tests__/start.test.ts +15 -1
- package/src/cli/commands/__tests__/styles-check.test.ts +27 -80
- package/src/cli/commands/__tests__/upload-sourcemaps.test.ts +127 -0
- package/src/cli/commands/build.ts +33 -17
- package/src/cli/commands/bundle-package.ts +10 -19
- package/src/cli/commands/clean.ts +1 -1
- package/src/cli/commands/eslint.ts +0 -4
- package/src/cli/commands/get-command.ts +2 -0
- package/src/cli/commands/get-user-commands.ts +1 -1
- package/src/cli/commands/mfe-package-clean.ts +2 -6
- package/src/cli/commands/mfe-package-publish.ts +104 -70
- package/src/cli/commands/mfe-publish.ts +8 -5
- package/src/cli/commands/prepare-package.ts +0 -4
- package/src/cli/commands/run-task.ts +0 -4
- package/src/cli/commands/start.ts +22 -5
- package/src/cli/commands/styles-check.ts +28 -131
- package/src/cli/commands/types.ts +1 -1
- package/src/cli/commands/upload-sourcemaps.ts +108 -0
- package/src/cli/utils/__tests__/bundle.test.ts +119 -9
- package/src/cli/utils/__tests__/cli-os.test.ts +2 -2
- package/src/cli/utils/__tests__/compile.test.ts +2 -0
- package/src/cli/utils/__tests__/type-check.test.ts +2 -0
- package/src/cli/utils/bundle.ts +76 -54
- package/src/cli/utils/cli-os.ts +2 -2
- package/src/utils/__tests__/get-configuration.test.ts +1 -1
- package/src/utils/find-packages.ts +3 -5
- package/src/utils/find-up.ts +12 -0
- package/src/utils/get-configuration.ts +2 -0
- package/src/utils/index.ts +1 -0
- package/src/webpack/__mocks__/style-rules.ts +1 -1
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +274 -45
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +25 -1
- package/src/webpack/__tests__/create-webpack-config.test.ts +9 -57
- package/src/webpack/configs/cache-config.ts +37 -0
- package/src/webpack/configs/dev-server-config.ts +1 -1
- package/src/webpack/configs/entry.config.ts +18 -8
- package/src/webpack/configs/externals-config.ts +7 -2
- package/src/webpack/configs/index.ts +1 -0
- package/src/webpack/configs/optimization-config.ts +7 -11
- package/src/webpack/configs/output-config.ts +23 -7
- package/src/webpack/configs/plugins/assets-manifest-plugin.ts +46 -10
- package/src/webpack/configs/plugins/bundle-analyser-plugin.ts +1 -6
- package/src/webpack/configs/plugins/define-exposed-dependencies-plugin.ts +3 -2
- package/src/webpack/configs/plugins/define-exposed-instance-dependencies-plugin.ts +2 -2
- package/src/webpack/configs/plugins/html-plugin.ts +2 -3
- package/src/webpack/configs/plugins/html-tags-plugin.ts +28 -0
- package/src/webpack/configs/plugins/index.ts +2 -0
- package/src/webpack/configs/plugins/remove-empty-scripts-plugin.ts +11 -0
- package/src/webpack/configs/plugins/virtual-modules-plugin.ts +27 -16
- package/src/webpack/configs/plugins-config.ts +4 -0
- package/src/webpack/configs/rules/css-rules.ts +19 -20
- package/src/webpack/configs/utils/get-bundle-type.ts +22 -0
- package/src/webpack/configs/utils/index.ts +1 -0
- package/src/webpack/create-webpack-config.ts +46 -52
- package/src/webpack/types.ts +4 -0
- package/src/webpack/utils/index.ts +1 -0
- package/src/webpack/utils/stringify-config.ts +19 -0
|
@@ -2,25 +2,40 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get assetsManifestPlugin () {
|
|
8
13
|
return assetsManifestPlugin;
|
|
14
|
+
},
|
|
15
|
+
get getExposedDependenciesEntryPoints () {
|
|
16
|
+
return getExposedDependenciesEntryPoints;
|
|
9
17
|
}
|
|
10
18
|
});
|
|
19
|
+
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
20
|
+
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
11
21
|
const _webpackassetsmanifest = require("webpack-assets-manifest");
|
|
12
22
|
const _utils = require("../utils");
|
|
23
|
+
const _utils1 = require("../../../utils");
|
|
24
|
+
function _interop_require_default(obj) {
|
|
25
|
+
return obj && obj.__esModule ? obj : {
|
|
26
|
+
default: obj
|
|
27
|
+
};
|
|
28
|
+
}
|
|
13
29
|
function assetsManifestPlugin(context, _) {
|
|
14
|
-
if (!context.isWebComponent) {
|
|
30
|
+
if (!(context.isWebComponent || context.emitExposedDependencies)) {
|
|
15
31
|
return;
|
|
16
32
|
}
|
|
17
33
|
return new _webpackassetsmanifest.WebpackAssetsManifest({
|
|
18
34
|
entrypoints: true,
|
|
19
35
|
output: 'entrypoints.json',
|
|
20
36
|
transform (assets) {
|
|
21
|
-
const entrypoints = assets.entrypoints;
|
|
22
37
|
const getAssetsByType = (type)=>{
|
|
23
|
-
return Object.values(entrypoints).map(({ assets })=>{
|
|
38
|
+
return Object.values(assets.entrypoints).map(({ assets })=>{
|
|
24
39
|
var _assets_type;
|
|
25
40
|
return (_assets_type = assets[type]) !== null && _assets_type !== void 0 ? _assets_type : [];
|
|
26
41
|
}).flat();
|
|
@@ -31,10 +46,37 @@ function assetsManifestPlugin(context, _) {
|
|
|
31
46
|
};
|
|
32
47
|
},
|
|
33
48
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
34
|
-
done: async (
|
|
35
|
-
|
|
49
|
+
done: async (manifest)=>{
|
|
50
|
+
if (context.emitExposedDependencies) {
|
|
51
|
+
generateExposedDependenciesMetadata(context, manifest);
|
|
52
|
+
} else {
|
|
53
|
+
(0, _utils.generateMetadata)(context);
|
|
54
|
+
}
|
|
36
55
|
}
|
|
37
56
|
});
|
|
38
57
|
}
|
|
58
|
+
function getExposedDependenciesEntryPoints(context) {
|
|
59
|
+
const metadataPath = getExposedDependenciesMetadataPath(context);
|
|
60
|
+
const metadata = (0, _utils1.readJsonSafe)(metadataPath);
|
|
61
|
+
if (metadata === null || metadata === void 0 ? void 0 : metadata.entryPointsPath) {
|
|
62
|
+
return (0, _utils1.readJsonSafe)(metadata.entryPointsPath);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function generateExposedDependenciesMetadata(context, manifest) {
|
|
66
|
+
const { destination } = context;
|
|
67
|
+
if (!_fs.default.existsSync(destination)) {
|
|
68
|
+
_fs.default.mkdirSync(destination, {
|
|
69
|
+
recursive: true
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
const metadataPath = getExposedDependenciesMetadataPath(context);
|
|
73
|
+
const metadata = {
|
|
74
|
+
entryPointsPath: manifest.getOutputPath()
|
|
75
|
+
};
|
|
76
|
+
_fs.default.writeFileSync(metadataPath, JSON.stringify(metadata, null, 2), 'utf-8');
|
|
77
|
+
}
|
|
78
|
+
function getExposedDependenciesMetadataPath({ destination }) {
|
|
79
|
+
return _path.default.join(destination, 'exposed-dependencies-metadata.json');
|
|
80
|
+
}
|
|
39
81
|
|
|
40
82
|
//# sourceMappingURL=assets-manifest-plugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/webpack/configs/plugins/assets-manifest-plugin.ts"],"sourcesContent":["import { WebpackAssetsManifest } from 'webpack-assets-manifest';\nimport { Context, Overrides } from '../types';\nimport { generateMetadata } from '../utils';\n\nexport function assetsManifestPlugin(context: Context, _: Overrides) {\n if (!context.isWebComponent) {\n return;\n }\n\n return new WebpackAssetsManifest({\n entrypoints: true,\n output: 'entrypoints.json',\n transform(assets
|
|
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 .map(({ assets }) => assets[type] ?? [])\n .flat();\n };\n\n return {\n css: 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\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","map","flat","css","js","done","manifest","generateExposedDependenciesMetadata","generateMetadata","metadataPath","getExposedDependenciesMetadataPath","metadata","readJsonSafe","entryPointsPath","destination","fs","existsSync","mkdirSync","recursive","getOutputPath","writeFileSync","JSON","stringify","path","join"],"mappings":";;;;;;;;;;;QAgBgBA;eAAAA;;QAiCAC;eAAAA;;;2DAjDD;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,EAClCQ,GAAG,CAAC,CAAC,EAAEL,MAAM,EAAE;wBAAKA;2BAAAA,CAAAA,eAAAA,MAAM,CAACE,KAAK,cAAZF,0BAAAA,eAAgB,EAAE;mBACtCM,IAAI;YACb;YAEA,OAAO;gBACHC,KAAKN,gBAAgB;gBACrBO,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;AAEO,SAASD,kCAAkCC,OAAgB;IAC9D,MAAMqB,eAAeC,mCAAmCtB;IACxD,MAAMuB,WAAWC,IAAAA,oBAAY,EAAWH;IACxC,IAAIE,qBAAAA,+BAAAA,SAAUE,eAAe,EAAE;QAC3B,OAAOD,IAAAA,oBAAY,EAAcD,SAASE,eAAe;IAC7D;AACJ;AAEA,SAASN,oCAAoCnB,OAAgB,EAAEkB,QAA+B;IAC1F,MAAM,EAAEQ,WAAW,EAAE,GAAG1B;IACxB,IAAI,CAAC2B,WAAE,CAACC,UAAU,CAACF,cAAc;QAC7BC,WAAE,CAACE,SAAS,CAACH,aAAa;YAAEI,WAAW;QAAK;IAChD;IAEA,MAAMT,eAAeC,mCAAmCtB;IACxD,MAAMuB,WAAqB;QAAEE,iBAAiBP,SAASa,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle-analyser-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/bundle-analyser-plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"bundle-analyser-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/bundle-analyser-plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG9C,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,OAUlE"}
|
|
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "bundleAnalyzerPlugin", {
|
|
|
10
10
|
});
|
|
11
11
|
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
12
12
|
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
|
13
|
+
const _utils = require("../utils");
|
|
13
14
|
function _interop_require_default(obj) {
|
|
14
15
|
return obj && obj.__esModule ? obj : {
|
|
15
16
|
default: obj
|
|
@@ -26,19 +27,14 @@ function bundleAnalyzerPlugin(context, _) {
|
|
|
26
27
|
reportTitle: getReportTitle(context)
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
|
-
function getBundleType({ embed, isWebComponent }) {
|
|
30
|
-
if (isWebComponent) {
|
|
31
|
-
return embed ? 'light' : 'full';
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
30
|
function getReportFileName(context) {
|
|
35
|
-
const type = getBundleType(context);
|
|
31
|
+
const type = (0, _utils.getBundleType)(context);
|
|
36
32
|
const qualifier = type ? `-${type}` : '';
|
|
37
33
|
return `${context.packageData.name}${qualifier}-bundle-${Date.now()}.html`;
|
|
38
34
|
}
|
|
39
35
|
function getReportTitle(context) {
|
|
40
36
|
const unscopedName = context.packageData.name.replace(/^@[^/]+\//, '');
|
|
41
|
-
const type = getBundleType(context);
|
|
37
|
+
const type = (0, _utils.getBundleType)(context);
|
|
42
38
|
const qualifier = type ? ` (${type})` : '';
|
|
43
39
|
return `${unscopedName}${qualifier} ${formatDate(new Date())}`;
|
|
44
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/webpack/configs/plugins/bundle-analyser-plugin.ts"],"sourcesContent":["import path from 'path';\nimport os from 'os';\nconst BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;\nimport { Context, Overrides } from '../types';\n\nexport function bundleAnalyzerPlugin(context: Context, _: Overrides) {\n if (!context.buildStat) {\n return;\n }\n\n return new BundleAnalyzerPlugin({\n analyzerMode: 'static',\n reportFilename: path.join(os.tmpdir(), getReportFileName(context)),\n reportTitle: getReportTitle(context),\n });\n}\n\nfunction
|
|
1
|
+
{"version":3,"sources":["../../../../src/webpack/configs/plugins/bundle-analyser-plugin.ts"],"sourcesContent":["import path from 'path';\nimport os from 'os';\nconst BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;\nimport { Context, Overrides } from '../types';\nimport { getBundleType } from '../utils';\n\nexport function bundleAnalyzerPlugin(context: Context, _: Overrides) {\n if (!context.buildStat) {\n return;\n }\n\n return new BundleAnalyzerPlugin({\n analyzerMode: 'static',\n reportFilename: path.join(os.tmpdir(), getReportFileName(context)),\n reportTitle: getReportTitle(context),\n });\n}\n\nfunction getReportFileName(context: Context) {\n const type = getBundleType(context);\n const qualifier = type ? `-${type}` : '';\n return `${context.packageData.name}${qualifier}-bundle-${Date.now()}.html`;\n}\n\nfunction getReportTitle(context: Context) {\n const unscopedName = context.packageData.name.replace(/^@[^/]+\\//, '');\n const type = getBundleType(context);\n const qualifier = type ? ` (${type})` : '';\n return `${unscopedName}${qualifier} ${formatDate(new Date())}`;\n}\n\nfunction formatDate(date: Date) {\n const yyyy = date.getFullYear();\n const mm = date.getMonth() + 1;\n const dd = date.getDate();\n const HH = date.getHours();\n const MM = date.getMinutes();\n return `${yyyy}-${mm}-${dd} ${HH}:${MM}`;\n}\n"],"names":["bundleAnalyzerPlugin","BundleAnalyzerPlugin","require","context","_","buildStat","analyzerMode","reportFilename","path","join","os","tmpdir","getReportFileName","reportTitle","getReportTitle","type","getBundleType","qualifier","packageData","name","Date","now","unscopedName","replace","formatDate","date","yyyy","getFullYear","mm","getMonth","dd","getDate","HH","getHours","MM","getMinutes"],"mappings":";;;;+BAMgBA;;;eAAAA;;;6DANC;2DACF;uBAGe;;;;;;AAF9B,MAAMC,uBAAuBC,QAAQ,2BAA2BD,oBAAoB;AAI7E,SAASD,qBAAqBG,OAAgB,EAAEC,CAAY;IAC/D,IAAI,CAACD,QAAQE,SAAS,EAAE;QACpB;IACJ;IAEA,OAAO,IAAIJ,qBAAqB;QAC5BK,cAAc;QACdC,gBAAgBC,aAAI,CAACC,IAAI,CAACC,WAAE,CAACC,MAAM,IAAIC,kBAAkBT;QACzDU,aAAaC,eAAeX;IAChC;AACJ;AAEA,SAASS,kBAAkBT,OAAgB;IACvC,MAAMY,OAAOC,IAAAA,oBAAa,EAACb;IAC3B,MAAMc,YAAYF,OAAO,CAAC,CAAC,EAAEA,MAAM,GAAG;IACtC,OAAO,GAAGZ,QAAQe,WAAW,CAACC,IAAI,GAAGF,UAAU,QAAQ,EAAEG,KAAKC,GAAG,GAAG,KAAK,CAAC;AAC9E;AAEA,SAASP,eAAeX,OAAgB;IACpC,MAAMmB,eAAenB,QAAQe,WAAW,CAACC,IAAI,CAACI,OAAO,CAAC,aAAa;IACnE,MAAMR,OAAOC,IAAAA,oBAAa,EAACb;IAC3B,MAAMc,YAAYF,OAAO,CAAC,EAAE,EAAEA,KAAK,CAAC,CAAC,GAAG;IACxC,OAAO,GAAGO,eAAeL,UAAU,CAAC,EAAEO,WAAW,IAAIJ,SAAS;AAClE;AAEA,SAASI,WAAWC,IAAU;IAC1B,MAAMC,OAAOD,KAAKE,WAAW;IAC7B,MAAMC,KAAKH,KAAKI,QAAQ,KAAK;IAC7B,MAAMC,KAAKL,KAAKM,OAAO;IACvB,MAAMC,KAAKP,KAAKQ,QAAQ;IACxB,MAAMC,KAAKT,KAAKU,UAAU;IAC1B,OAAO,GAAGT,KAAK,CAAC,EAAEE,GAAG,CAAC,EAAEE,GAAG,CAAC,EAAEE,GAAG,CAAC,EAAEE,IAAI;AAC5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-exposed-dependencies-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/define-exposed-dependencies-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"define-exposed-dependencies-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/define-exposed-dependencies-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,4BAyB7E"}
|
|
@@ -11,10 +11,11 @@ Object.defineProperty(exports, "defineExposedDependenciesPlugin", {
|
|
|
11
11
|
const _webpack = require("webpack");
|
|
12
12
|
const _utils = require("../../../utils");
|
|
13
13
|
function defineExposedDependenciesPlugin(context, _) {
|
|
14
|
-
const {
|
|
15
|
-
if (!isExposeSharedDependencies) {
|
|
14
|
+
const { emitExposedDependencies, isExposeSharedDependencies } = context;
|
|
15
|
+
if (!isExposeSharedDependencies || emitExposedDependencies) {
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
+
const { packageData, sharedDependencies } = context;
|
|
18
19
|
return new _webpack.DefinePlugin({
|
|
19
20
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
20
21
|
EXPOSED_DEPENDENCIES: JSON.stringify(Object.entries(sharedDependencies).reduce((result, [dependency, variable])=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/webpack/configs/plugins/define-exposed-dependencies-plugin.ts"],"sourcesContent":["import { DefinePlugin } from 'webpack';\nimport { getPackageDependencyVersion } from '../../../utils';\nimport { Context, Overrides } from '../types';\n\nexport function defineExposedDependenciesPlugin(context: Context, _: Overrides) {\n const {
|
|
1
|
+
{"version":3,"sources":["../../../../src/webpack/configs/plugins/define-exposed-dependencies-plugin.ts"],"sourcesContent":["import { DefinePlugin } from 'webpack';\nimport { getPackageDependencyVersion } from '../../../utils';\nimport { Context, Overrides } from '../types';\n\nexport function defineExposedDependenciesPlugin(context: Context, _: Overrides) {\n const { emitExposedDependencies, isExposeSharedDependencies } = context;\n if (!isExposeSharedDependencies || emitExposedDependencies) {\n return;\n }\n\n const { packageData, sharedDependencies } = context;\n return new DefinePlugin({\n // eslint-disable-next-line @typescript-eslint/naming-convention\n EXPOSED_DEPENDENCIES: JSON.stringify(\n Object.entries(sharedDependencies).reduce(\n (result, [dependency, variable]) =>\n Object.assign(result, {\n [dependency]: {\n version: getPackageDependencyVersion(\n dependency,\n packageData.dependencies?.[dependency]\n ),\n variable,\n },\n }),\n {}\n )\n ),\n });\n}\n"],"names":["defineExposedDependenciesPlugin","context","_","emitExposedDependencies","isExposeSharedDependencies","packageData","sharedDependencies","DefinePlugin","EXPOSED_DEPENDENCIES","JSON","stringify","Object","entries","reduce","result","dependency","variable","assign","version","getPackageDependencyVersion","dependencies"],"mappings":";;;;+BAIgBA;;;eAAAA;;;yBAJa;uBACe;AAGrC,SAASA,gCAAgCC,OAAgB,EAAEC,CAAY;IAC1E,MAAM,EAAEC,uBAAuB,EAAEC,0BAA0B,EAAE,GAAGH;IAChE,IAAI,CAACG,8BAA8BD,yBAAyB;QACxD;IACJ;IAEA,MAAM,EAAEE,WAAW,EAAEC,kBAAkB,EAAE,GAAGL;IAC5C,OAAO,IAAIM,qBAAY,CAAC;QACpB,gEAAgE;QAChEC,sBAAsBC,KAAKC,SAAS,CAChCC,OAAOC,OAAO,CAACN,oBAAoBO,MAAM,CACrC,CAACC,QAAQ,CAACC,YAAYC,SAAS;gBAKfX;mBAJZM,OAAOM,MAAM,CAACH,QAAQ;gBAClB,CAACC,WAAW,EAAE;oBACVG,SAASC,IAAAA,kCAA2B,EAChCJ,aACAV,4BAAAA,YAAYe,YAAY,cAAxBf,gDAAAA,yBAA0B,CAACU,WAAW;oBAE1CC;gBACJ;YACJ;WACJ,CAAC;IAGb;AACJ"}
|
|
@@ -11,8 +11,8 @@ Object.defineProperty(exports, "defineExposedInstanceDependenciesPlugin", {
|
|
|
11
11
|
const _webpack = require("webpack");
|
|
12
12
|
const _getlaunchdarklysdkversion = require("../utils/get-launchdarkly-sdk-version");
|
|
13
13
|
function defineExposedInstanceDependenciesPlugin(context, _) {
|
|
14
|
-
const { isExposeSharedDependencies } = context;
|
|
15
|
-
if (!isExposeSharedDependencies) {
|
|
14
|
+
const { emitExposedDependencies, isExposeSharedDependencies } = context;
|
|
15
|
+
if (!isExposeSharedDependencies || emitExposedDependencies) {
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
const instanceDependencies = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/webpack/configs/plugins/define-exposed-instance-dependencies-plugin.ts"],"sourcesContent":["import { DefinePlugin } from 'webpack';\nimport { Context, Overrides } from '../types';\nimport { getLaunchDarklySdkVersion } from '../utils/get-launchdarkly-sdk-version';\n\nexport function defineExposedInstanceDependenciesPlugin(context: Context, _: Overrides) {\n const { isExposeSharedDependencies } = context;\n if (!isExposeSharedDependencies) {\n return;\n }\n\n const instanceDependencies = {\n launchDarkly: { version: getLaunchDarklySdkVersion() },\n };\n\n return new DefinePlugin({\n // eslint-disable-next-line @typescript-eslint/naming-convention\n EXPOSED_INSTANCE_DEPENDENCIES: JSON.stringify(instanceDependencies),\n });\n}\n"],"names":["defineExposedInstanceDependenciesPlugin","context","_","isExposeSharedDependencies","instanceDependencies","launchDarkly","version","getLaunchDarklySdkVersion","DefinePlugin","EXPOSED_INSTANCE_DEPENDENCIES","JSON","stringify"],"mappings":";;;;+BAIgBA;;;eAAAA;;;yBAJa;2CAEa;AAEnC,SAASA,wCAAwCC,OAAgB,EAAEC,CAAY;IAClF,MAAM,EAAEC,0BAA0B,EAAE,
|
|
1
|
+
{"version":3,"sources":["../../../../src/webpack/configs/plugins/define-exposed-instance-dependencies-plugin.ts"],"sourcesContent":["import { DefinePlugin } from 'webpack';\nimport { Context, Overrides } from '../types';\nimport { getLaunchDarklySdkVersion } from '../utils/get-launchdarkly-sdk-version';\n\nexport function defineExposedInstanceDependenciesPlugin(context: Context, _: Overrides) {\n const { emitExposedDependencies, isExposeSharedDependencies } = context;\n if (!isExposeSharedDependencies || emitExposedDependencies) {\n return;\n }\n\n const instanceDependencies = {\n launchDarkly: { version: getLaunchDarklySdkVersion() },\n };\n\n return new DefinePlugin({\n // eslint-disable-next-line @typescript-eslint/naming-convention\n EXPOSED_INSTANCE_DEPENDENCIES: JSON.stringify(instanceDependencies),\n });\n}\n"],"names":["defineExposedInstanceDependenciesPlugin","context","_","emitExposedDependencies","isExposeSharedDependencies","instanceDependencies","launchDarkly","version","getLaunchDarklySdkVersion","DefinePlugin","EXPOSED_INSTANCE_DEPENDENCIES","JSON","stringify"],"mappings":";;;;+BAIgBA;;;eAAAA;;;yBAJa;2CAEa;AAEnC,SAASA,wCAAwCC,OAAgB,EAAEC,CAAY;IAClF,MAAM,EAAEC,uBAAuB,EAAEC,0BAA0B,EAAE,GAAGH;IAChE,IAAI,CAACG,8BAA8BD,yBAAyB;QACxD;IACJ;IAEA,MAAME,uBAAuB;QACzBC,cAAc;YAAEC,SAASC,IAAAA,oDAAyB;QAAG;IACzD;IAEA,OAAO,IAAIC,qBAAY,CAAC;QACpB,gEAAgE;QAChEC,+BAA+BC,KAAKC,SAAS,CAACP;IAClD;AACJ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
|
2
2
|
import { Context, Overrides } from '../types';
|
|
3
|
-
export declare function htmlPlugin({ embed, headless, isWebComponent, name }: Context, { plugins }: Overrides): HtmlWebpackPlugin | undefined;
|
|
3
|
+
export declare function htmlPlugin({ embed, emitExposedDependencies, headless, isWebComponent, name }: Context, { plugins }: Overrides): HtmlWebpackPlugin | undefined;
|
|
4
4
|
//# sourceMappingURL=html-plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/html-plugin.ts"],"names":[],"mappings":"AACA,OAAO,iBAA0D,MAAM,qBAAqB,CAAC;AAE7F,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,UAAU,CACtB,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"html-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/html-plugin.ts"],"names":[],"mappings":"AACA,OAAO,iBAA0D,MAAM,qBAAqB,CAAC;AAE7F,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,UAAU,CACtB,EAAE,KAAK,EAAE,uBAAuB,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,EAAE,OAAO,EAC3E,EAAE,OAAO,EAAE,EAAE,SAAS,iCA+CzB"}
|
|
@@ -16,14 +16,13 @@ function _interop_require_default(obj) {
|
|
|
16
16
|
default: obj
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
function htmlPlugin({ embed, headless, isWebComponent, name }, { plugins }) {
|
|
19
|
+
function htmlPlugin({ embed, emitExposedDependencies, headless, isWebComponent, name }, { plugins }) {
|
|
20
20
|
const { HtmlWebpackPlugin: htmlWebpackPluginOptions = {} } = plugins !== null && plugins !== void 0 ? plugins : {};
|
|
21
|
-
if (embed || headless) {
|
|
21
|
+
if (embed || headless || emitExposedDependencies) {
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
return new _htmlwebpackplugin.default((0, _deepmerge.default)({
|
|
25
25
|
title: 'ServiceTitan',
|
|
26
|
-
hash: true,
|
|
27
26
|
...isWebComponent ? {
|
|
28
27
|
inject: false,
|
|
29
28
|
publicPath: '/',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/webpack/configs/plugins/html-plugin.ts"],"sourcesContent":["import deepmerge from 'deepmerge';\nimport HtmlWebpackPlugin, { Options as HtmlWebpackPluginOptions } from 'html-webpack-plugin';\nimport { splitByEntry } from '../../utils';\nimport { Context, Overrides } from '../types';\n\nexport function htmlPlugin(\n { embed, headless, isWebComponent, name }: Context,\n { plugins }: Overrides\n) {\n const { HtmlWebpackPlugin: htmlWebpackPluginOptions = {} } = plugins ?? {};\n\n if (embed || headless) {\n return;\n }\n\n return new HtmlWebpackPlugin(\n deepmerge<HtmlWebpackPluginOptions>(\n {\n title: 'ServiceTitan',\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/webpack/configs/plugins/html-plugin.ts"],"sourcesContent":["import deepmerge from 'deepmerge';\nimport HtmlWebpackPlugin, { Options as HtmlWebpackPluginOptions } from 'html-webpack-plugin';\nimport { splitByEntry } from '../../utils';\nimport { Context, Overrides } from '../types';\n\nexport function htmlPlugin(\n { embed, emitExposedDependencies, headless, isWebComponent, name }: Context,\n { plugins }: Overrides\n) {\n const { HtmlWebpackPlugin: htmlWebpackPluginOptions = {} } = plugins ?? {};\n\n if (embed || headless || emitExposedDependencies) {\n return;\n }\n\n return new HtmlWebpackPlugin(\n deepmerge<HtmlWebpackPluginOptions>(\n {\n title: 'ServiceTitan',\n ...(isWebComponent\n ? {\n inject: false,\n publicPath: '/',\n templateContent: ({\n htmlWebpackPlugin: {\n tags: { headTags, bodyTags },\n files,\n },\n }) => {\n const styleUrls = encodeURIComponent(JSON.stringify(files.css));\n return `\n <!DOCTYPE html>\n <html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n ${headTags}\n </head>\n <body>\n <${name} style-urls=\"${styleUrls}\" />\n\n ${bodyTags}\n </body>\n </html>\n `;\n },\n }\n : {}),\n templateParameters: {\n splitByEntry,\n },\n },\n htmlWebpackPluginOptions\n )\n );\n}\n"],"names":["htmlPlugin","embed","emitExposedDependencies","headless","isWebComponent","name","plugins","HtmlWebpackPlugin","htmlWebpackPluginOptions","deepmerge","title","inject","publicPath","templateContent","htmlWebpackPlugin","tags","headTags","bodyTags","files","styleUrls","encodeURIComponent","JSON","stringify","css","templateParameters","splitByEntry"],"mappings":";;;;+BAKgBA;;;eAAAA;;;kEALM;0EACiD;uBAC1C;;;;;;AAGtB,SAASA,WACZ,EAAEC,KAAK,EAAEC,uBAAuB,EAAEC,QAAQ,EAAEC,cAAc,EAAEC,IAAI,EAAW,EAC3E,EAAEC,OAAO,EAAa;IAEtB,MAAM,EAAEC,mBAAmBC,2BAA2B,CAAC,CAAC,EAAE,GAAGF,oBAAAA,qBAAAA,UAAW,CAAC;IAEzE,IAAIL,SAASE,YAAYD,yBAAyB;QAC9C;IACJ;IAEA,OAAO,IAAIK,0BAAiB,CACxBE,IAAAA,kBAAS,EACL;QACIC,OAAO;QACP,GAAIN,iBACE;YACIO,QAAQ;YACRC,YAAY;YACZC,iBAAiB,CAAC,EACdC,mBAAmB,EACfC,MAAM,EAAEC,QAAQ,EAAEC,QAAQ,EAAE,EAC5BC,KAAK,EACR,EACJ;gBACG,MAAMC,YAAYC,mBAAmBC,KAAKC,SAAS,CAACJ,MAAMK,GAAG;gBAC7D,OAAO,CAAC;;;;;wCAKE,EAAEP,SAAS;;;yCAGV,EAAEX,KAAK,aAAa,EAAEc,UAAU;;wCAEjC,EAAEF,SAAS;;;4BAGvB,CAAC;YACH;QACJ,IACA,CAAC,CAAC;QACRO,oBAAoB;YAChBC,cAAAA,mBAAY;QAChB;IACJ,GACAjB;AAGZ"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import HtmlWebpackTagsPlugin from 'html-webpack-tags-plugin';
|
|
2
|
+
import { Context, Overrides } from '../types';
|
|
3
|
+
export declare function htmlTagsPlugin(context: Context, _overrides: Overrides): HtmlWebpackTagsPlugin | undefined;
|
|
4
|
+
//# sourceMappingURL=html-tags-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-tags-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/html-tags-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAI9C,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,qCAYrE"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "htmlTagsPlugin", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return htmlTagsPlugin;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _htmlwebpacktagsplugin = /*#__PURE__*/ _interop_require_default(require("html-webpack-tags-plugin"));
|
|
12
|
+
const _utils = require("../utils");
|
|
13
|
+
const _assetsmanifestplugin = require("./assets-manifest-plugin");
|
|
14
|
+
function _interop_require_default(obj) {
|
|
15
|
+
return obj && obj.__esModule ? obj : {
|
|
16
|
+
default: obj
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function htmlTagsPlugin(context, _overrides) {
|
|
20
|
+
const { emitExposedDependencies, isExposeSharedDependencies } = context;
|
|
21
|
+
if (!isExposeSharedDependencies || emitExposedDependencies) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const sharedEntryPoints = getSharedEntryPoints(context);
|
|
25
|
+
if (!sharedEntryPoints.length) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
return new _htmlwebpacktagsplugin.default({
|
|
29
|
+
tags: sharedEntryPoints,
|
|
30
|
+
append: false
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function getSharedEntryPoints(context) {
|
|
34
|
+
const dirname = (0, _utils.getBundleType)({
|
|
35
|
+
...context,
|
|
36
|
+
emitExposedDependencies: true
|
|
37
|
+
});
|
|
38
|
+
if (!dirname) {
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
var _getExposedDependenciesEntryPoints;
|
|
42
|
+
const { css = [], js = [] } = (_getExposedDependenciesEntryPoints = (0, _assetsmanifestplugin.getExposedDependenciesEntryPoints)(context)) !== null && _getExposedDependenciesEntryPoints !== void 0 ? _getExposedDependenciesEntryPoints : {};
|
|
43
|
+
return [
|
|
44
|
+
...css,
|
|
45
|
+
...js
|
|
46
|
+
].map((name)=>`${dirname}/${name}`);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=html-tags-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/webpack/configs/plugins/html-tags-plugin.ts"],"sourcesContent":["import HtmlWebpackTagsPlugin from 'html-webpack-tags-plugin';\nimport { Context, Overrides } from '../types';\nimport { getBundleType } from '../utils';\nimport { getExposedDependenciesEntryPoints } from './assets-manifest-plugin';\n\nexport function htmlTagsPlugin(context: Context, _overrides: Overrides) {\n const { emitExposedDependencies, isExposeSharedDependencies } = context;\n if (!isExposeSharedDependencies || emitExposedDependencies) {\n return;\n }\n\n const sharedEntryPoints = getSharedEntryPoints(context);\n if (!sharedEntryPoints.length) {\n return;\n }\n\n return new HtmlWebpackTagsPlugin({ tags: sharedEntryPoints, append: false });\n}\n\nfunction getSharedEntryPoints(context: Context) {\n const dirname = getBundleType({ ...context, emitExposedDependencies: true });\n if (!dirname) {\n return [];\n }\n\n const { css = [], js = [] } = getExposedDependenciesEntryPoints(context) ?? {};\n return [...css, ...js].map(name => `${dirname}/${name}`);\n}\n"],"names":["htmlTagsPlugin","context","_overrides","emitExposedDependencies","isExposeSharedDependencies","sharedEntryPoints","getSharedEntryPoints","length","HtmlWebpackTagsPlugin","tags","append","dirname","getBundleType","getExposedDependenciesEntryPoints","css","js","map","name"],"mappings":";;;;+BAKgBA;;;eAAAA;;;8EALkB;uBAEJ;sCACoB;;;;;;AAE3C,SAASA,eAAeC,OAAgB,EAAEC,UAAqB;IAClE,MAAM,EAAEC,uBAAuB,EAAEC,0BAA0B,EAAE,GAAGH;IAChE,IAAI,CAACG,8BAA8BD,yBAAyB;QACxD;IACJ;IAEA,MAAME,oBAAoBC,qBAAqBL;IAC/C,IAAI,CAACI,kBAAkBE,MAAM,EAAE;QAC3B;IACJ;IAEA,OAAO,IAAIC,8BAAqB,CAAC;QAAEC,MAAMJ;QAAmBK,QAAQ;IAAM;AAC9E;AAEA,SAASJ,qBAAqBL,OAAgB;IAC1C,MAAMU,UAAUC,IAAAA,oBAAa,EAAC;QAAE,GAAGX,OAAO;QAAEE,yBAAyB;IAAK;IAC1E,IAAI,CAACQ,SAAS;QACV,OAAO,EAAE;IACb;QAE8BE;IAA9B,MAAM,EAAEC,MAAM,EAAE,EAAEC,KAAK,EAAE,EAAE,GAAGF,CAAAA,qCAAAA,IAAAA,uDAAiC,EAACZ,sBAAlCY,gDAAAA,qCAA8C,CAAC;IAC7E,OAAO;WAAIC;WAAQC;KAAG,CAACC,GAAG,CAACC,CAAAA,OAAQ,GAAGN,QAAQ,CAAC,EAAEM,MAAM;AAC3D"}
|
|
@@ -5,9 +5,11 @@ export * from './define-exposed-instance-dependencies-plugin';
|
|
|
5
5
|
export * from './define-web-component-name-plugin';
|
|
6
6
|
export * from './filter-warnings-plugin';
|
|
7
7
|
export * from './html-plugin';
|
|
8
|
+
export * from './html-tags-plugin';
|
|
8
9
|
export * from './ignore-plugin';
|
|
9
10
|
export * from './mini-css-extract-plugin';
|
|
10
11
|
export * from './moment-locales-plugin';
|
|
12
|
+
export * from './remove-empty-scripts-plugin';
|
|
11
13
|
export * from './virtual-modules-plugin';
|
|
12
14
|
export * from './watch-run-plugin';
|
|
13
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sCAAsC,CAAC;AACrD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sCAAsC,CAAC;AACrD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC"}
|
|
@@ -9,9 +9,11 @@ _export_star(require("./define-exposed-instance-dependencies-plugin"), exports);
|
|
|
9
9
|
_export_star(require("./define-web-component-name-plugin"), exports);
|
|
10
10
|
_export_star(require("./filter-warnings-plugin"), exports);
|
|
11
11
|
_export_star(require("./html-plugin"), exports);
|
|
12
|
+
_export_star(require("./html-tags-plugin"), exports);
|
|
12
13
|
_export_star(require("./ignore-plugin"), exports);
|
|
13
14
|
_export_star(require("./mini-css-extract-plugin"), exports);
|
|
14
15
|
_export_star(require("./moment-locales-plugin"), exports);
|
|
16
|
+
_export_star(require("./remove-empty-scripts-plugin"), exports);
|
|
15
17
|
_export_star(require("./virtual-modules-plugin"), exports);
|
|
16
18
|
_export_star(require("./watch-run-plugin"), exports);
|
|
17
19
|
function _export_star(from, to) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/webpack/configs/plugins/index.ts"],"sourcesContent":["export * from './assets-manifest-plugin';\nexport * from './bundle-analyser-plugin';\nexport * from './define-exposed-dependencies-plugin';\nexport * from './define-exposed-instance-dependencies-plugin';\nexport * from './define-web-component-name-plugin';\nexport * from './filter-warnings-plugin';\nexport * from './html-plugin';\nexport * from './ignore-plugin';\nexport * from './mini-css-extract-plugin';\nexport * from './moment-locales-plugin';\nexport * from './virtual-modules-plugin';\nexport * from './watch-run-plugin';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/webpack/configs/plugins/index.ts"],"sourcesContent":["export * from './assets-manifest-plugin';\nexport * from './bundle-analyser-plugin';\nexport * from './define-exposed-dependencies-plugin';\nexport * from './define-exposed-instance-dependencies-plugin';\nexport * from './define-web-component-name-plugin';\nexport * from './filter-warnings-plugin';\nexport * from './html-plugin';\nexport * from './html-tags-plugin';\nexport * from './ignore-plugin';\nexport * from './mini-css-extract-plugin';\nexport * from './moment-locales-plugin';\nexport * from './remove-empty-scripts-plugin';\nexport * from './virtual-modules-plugin';\nexport * from './watch-run-plugin';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import RemoveEmptyScriptsPlugin from 'webpack-remove-empty-scripts';
|
|
2
|
+
import { Context, Overrides } from '../types';
|
|
3
|
+
export declare function removeEmptyScriptsPlugin(context: Context, _overrides: Overrides): RemoveEmptyScriptsPlugin | undefined;
|
|
4
|
+
//# sourceMappingURL=remove-empty-scripts-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-empty-scripts-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/remove-empty-scripts-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,wCAO/E"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "removeEmptyScriptsPlugin", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return removeEmptyScriptsPlugin;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _webpackremoveemptyscripts = /*#__PURE__*/ _interop_require_default(require("webpack-remove-empty-scripts"));
|
|
12
|
+
function _interop_require_default(obj) {
|
|
13
|
+
return obj && obj.__esModule ? obj : {
|
|
14
|
+
default: obj
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function removeEmptyScriptsPlugin(context, _overrides) {
|
|
18
|
+
const { emitExposedDependencies } = context;
|
|
19
|
+
if (!emitExposedDependencies) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
return new _webpackremoveemptyscripts.default();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=remove-empty-scripts-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/webpack/configs/plugins/remove-empty-scripts-plugin.ts"],"sourcesContent":["import RemoveEmptyScriptsPlugin from 'webpack-remove-empty-scripts';\nimport { Context, Overrides } from '../types';\n\nexport function removeEmptyScriptsPlugin(context: Context, _overrides: Overrides) {\n const { emitExposedDependencies } = context;\n if (!emitExposedDependencies) {\n return;\n }\n\n return new RemoveEmptyScriptsPlugin();\n}\n"],"names":["removeEmptyScriptsPlugin","context","_overrides","emitExposedDependencies","RemoveEmptyScriptsPlugin"],"mappings":";;;;+BAGgBA;;;eAAAA;;;kFAHqB;;;;;;AAG9B,SAASA,yBAAyBC,OAAgB,EAAEC,UAAqB;IAC5E,MAAM,EAAEC,uBAAuB,EAAE,GAAGF;IACpC,IAAI,CAACE,yBAAyB;QAC1B;IACJ;IAEA,OAAO,IAAIC,kCAAwB;AACvC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import VirtualModulesPlugin from 'webpack-virtual-modules';
|
|
2
2
|
import { Context, Overrides } from '../types';
|
|
3
3
|
export declare function virtualModulesPlugin(context: Context, _: Overrides): VirtualModulesPlugin | undefined;
|
|
4
|
+
export declare function getDesignSystemPath({ destination }: Context): string;
|
|
4
5
|
//# sourceMappingURL=virtual-modules-plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-modules-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/virtual-modules-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"virtual-modules-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/virtual-modules-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,oCAkBlE;AAED,wBAAgB,mBAAmB,CAAC,EAAE,WAAW,EAAE,EAAE,OAAO,UAE3D"}
|
|
@@ -2,9 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get getDesignSystemPath () {
|
|
13
|
+
return getDesignSystemPath;
|
|
14
|
+
},
|
|
15
|
+
get virtualModulesPlugin () {
|
|
8
16
|
return virtualModulesPlugin;
|
|
9
17
|
}
|
|
10
18
|
});
|
|
@@ -17,21 +25,22 @@ function _interop_require_default(obj) {
|
|
|
17
25
|
};
|
|
18
26
|
}
|
|
19
27
|
function virtualModulesPlugin(context, _) {
|
|
20
|
-
if (!context.isWebComponent) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
28
|
const { destination } = context;
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
const modules = {};
|
|
30
|
+
if (context.isWebComponent) {
|
|
31
|
+
const indexPath = _path.default.join(process.cwd(), destination, 'index');
|
|
32
|
+
modules[indexPath] = indexCode(context);
|
|
33
|
+
}
|
|
28
34
|
if (needsToIncludeDesignSystem(context)) {
|
|
29
|
-
const designSystemPath =
|
|
35
|
+
const designSystemPath = getDesignSystemPath(context);
|
|
30
36
|
if (!_fs.default.existsSync(designSystemPath)) {
|
|
31
37
|
modules[designSystemPath] = designSystemCode();
|
|
32
38
|
}
|
|
33
39
|
}
|
|
34
|
-
return new _webpackvirtualmodules.default(modules);
|
|
40
|
+
return Object.keys(modules).length ? new _webpackvirtualmodules.default(modules) : undefined;
|
|
41
|
+
}
|
|
42
|
+
function getDesignSystemPath({ destination }) {
|
|
43
|
+
return _path.default.join(process.cwd(), destination, 'design-system.css');
|
|
35
44
|
}
|
|
36
45
|
function designSystemCode() {
|
|
37
46
|
return [
|
|
@@ -55,8 +64,8 @@ function indexCode(context) {
|
|
|
55
64
|
`register(App, ${embed}, ${options});`
|
|
56
65
|
].join('\n');
|
|
57
66
|
}
|
|
58
|
-
function needsToIncludeDesignSystem({ embed, headless, packageData, sharedDependencies }) {
|
|
59
|
-
return !headless && // Depends on design system
|
|
67
|
+
function needsToIncludeDesignSystem({ embed, emitExposedDependencies, headless, isWebComponent, packageData, sharedDependencies }) {
|
|
68
|
+
return !!emitExposedDependencies && !!sharedDependencies['@servicetitan/design-system'] || isWebComponent && !headless && // Depends on design system
|
|
60
69
|
!!packageData.dependencies['@servicetitan/design-system'] && // ... and is not light bundle with private copy of design system
|
|
61
70
|
!(embed && !!sharedDependencies['@servicetitan/design-system']);
|
|
62
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/webpack/configs/plugins/virtual-modules-plugin.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport VirtualModulesPlugin from 'webpack-virtual-modules';\nimport { Context, Overrides } from '../types';\n\nexport function virtualModulesPlugin(context: Context, _: Overrides) {\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/webpack/configs/plugins/virtual-modules-plugin.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport VirtualModulesPlugin from 'webpack-virtual-modules';\nimport { Context, Overrides } from '../types';\n\nexport function virtualModulesPlugin(context: Context, _: Overrides) {\n const { destination } = context;\n\n const modules: ConstructorParameters<typeof VirtualModulesPlugin>[0] = {};\n\n if (context.isWebComponent) {\n const indexPath = path.join(process.cwd(), destination, 'index');\n modules[indexPath] = indexCode(context);\n }\n\n if (needsToIncludeDesignSystem(context)) {\n const designSystemPath = getDesignSystemPath(context);\n if (!fs.existsSync(designSystemPath)) {\n modules[designSystemPath] = designSystemCode();\n }\n }\n\n return Object.keys(modules).length ? new VirtualModulesPlugin(modules) : undefined;\n}\n\nexport function getDesignSystemPath({ destination }: Context) {\n return path.join(process.cwd(), destination, 'design-system.css');\n}\n\nfunction designSystemCode() {\n return [\n `@import '~@servicetitan/tokens/core/tokens.css';`,\n `@import '~@servicetitan/anvil-fonts/dist/css/anvil-fonts.css';`,\n `@import '~@servicetitan/design-system/dist/system.min.css';`,\n ].join('\\n');\n}\n\nfunction indexCode(context: Context) {\n const { embed = false, headless, isLegacyRoot, sharedDependencies } = context;\n if (headless) {\n return headlessIndex();\n }\n\n const options = `{ legacyRoot: ${isLegacyRoot}, sharedDependenciesNames: ${JSON.stringify(\n Object.keys(sharedDependencies)\n )} }`;\n return [\n ...(needsToIncludeDesignSystem(context) ? [`require('./design-system.css');`] : []),\n `import { register } from '@servicetitan/web-components';`,\n `import { App } from './app';`,\n `register(App, ${embed}, ${options});`,\n ].join('\\n');\n}\n\nfunction needsToIncludeDesignSystem({\n embed,\n emitExposedDependencies,\n headless,\n isWebComponent,\n packageData,\n sharedDependencies,\n}: Context) {\n return (\n (!!emitExposedDependencies && !!sharedDependencies['@servicetitan/design-system']) ||\n (isWebComponent &&\n !headless &&\n // Depends on design system\n !!packageData.dependencies['@servicetitan/design-system'] &&\n // ... and is not light bundle with private copy of design system\n !(embed && !!sharedDependencies['@servicetitan/design-system']))\n );\n}\n\nfunction headlessIndex() {\n return [\n \"import { registerHeadless } from '@servicetitan/web-components';\",\n \"import { connectedCallback, disconnectedCallback } from './headless';\",\n 'registerHeadless(connectedCallback, disconnectedCallback);',\n ].join('\\n');\n}\n"],"names":["getDesignSystemPath","virtualModulesPlugin","context","_","destination","modules","isWebComponent","indexPath","path","join","process","cwd","indexCode","needsToIncludeDesignSystem","designSystemPath","fs","existsSync","designSystemCode","Object","keys","length","VirtualModulesPlugin","undefined","embed","headless","isLegacyRoot","sharedDependencies","headlessIndex","options","JSON","stringify","emitExposedDependencies","packageData","dependencies"],"mappings":";;;;;;;;;;;QAyBgBA;eAAAA;;QApBAC;eAAAA;;;2DALD;6DACE;8EACgB;;;;;;AAG1B,SAASA,qBAAqBC,OAAgB,EAAEC,CAAY;IAC/D,MAAM,EAAEC,WAAW,EAAE,GAAGF;IAExB,MAAMG,UAAiE,CAAC;IAExE,IAAIH,QAAQI,cAAc,EAAE;QACxB,MAAMC,YAAYC,aAAI,CAACC,IAAI,CAACC,QAAQC,GAAG,IAAIP,aAAa;QACxDC,OAAO,CAACE,UAAU,GAAGK,UAAUV;IACnC;IAEA,IAAIW,2BAA2BX,UAAU;QACrC,MAAMY,mBAAmBd,oBAAoBE;QAC7C,IAAI,CAACa,WAAE,CAACC,UAAU,CAACF,mBAAmB;YAClCT,OAAO,CAACS,iBAAiB,GAAGG;QAChC;IACJ;IAEA,OAAOC,OAAOC,IAAI,CAACd,SAASe,MAAM,GAAG,IAAIC,8BAAoB,CAAChB,WAAWiB;AAC7E;AAEO,SAAStB,oBAAoB,EAAEI,WAAW,EAAW;IACxD,OAAOI,aAAI,CAACC,IAAI,CAACC,QAAQC,GAAG,IAAIP,aAAa;AACjD;AAEA,SAASa;IACL,OAAO;QACH,CAAC,gDAAgD,CAAC;QAClD,CAAC,8DAA8D,CAAC;QAChE,CAAC,2DAA2D,CAAC;KAChE,CAACR,IAAI,CAAC;AACX;AAEA,SAASG,UAAUV,OAAgB;IAC/B,MAAM,EAAEqB,QAAQ,KAAK,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,kBAAkB,EAAE,GAAGxB;IACtE,IAAIsB,UAAU;QACV,OAAOG;IACX;IAEA,MAAMC,UAAU,CAAC,cAAc,EAAEH,aAAa,2BAA2B,EAAEI,KAAKC,SAAS,CACrFZ,OAAOC,IAAI,CAACO,qBACd,EAAE,CAAC;IACL,OAAO;WACCb,2BAA2BX,WAAW;YAAC,CAAC,+BAA+B,CAAC;SAAC,GAAG,EAAE;QAClF,CAAC,wDAAwD,CAAC;QAC1D,CAAC,4BAA4B,CAAC;QAC9B,CAAC,cAAc,EAAEqB,MAAM,EAAE,EAAEK,QAAQ,EAAE,CAAC;KACzC,CAACnB,IAAI,CAAC;AACX;AAEA,SAASI,2BAA2B,EAChCU,KAAK,EACLQ,uBAAuB,EACvBP,QAAQ,EACRlB,cAAc,EACd0B,WAAW,EACXN,kBAAkB,EACZ;IACN,OACI,AAAC,CAAC,CAACK,2BAA2B,CAAC,CAACL,kBAAkB,CAAC,8BAA8B,IAChFpB,kBACG,CAACkB,YACD,2BAA2B;IAC3B,CAAC,CAACQ,YAAYC,YAAY,CAAC,8BAA8B,IACzD,iEAAiE;IACjE,CAAEV,CAAAA,SAAS,CAAC,CAACG,kBAAkB,CAAC,8BAA8B,AAAD;AAEzE;AAEA,SAASC;IACL,OAAO;QACH;QACA;QACA;KACH,CAAClB,IAAI,CAAC;AACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins-config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/plugins-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"plugins-config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/plugins-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAiBxC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAG7C,KAAK,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;AAE7C,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,GAAG,MAAM,CAqB5E"}
|
|
@@ -18,9 +18,11 @@ function pluginsConfig(context, overrides) {
|
|
|
18
18
|
_plugins.defineWebComponentNamePlugin,
|
|
19
19
|
_plugins.filterWarningsPlugin,
|
|
20
20
|
_plugins.htmlPlugin,
|
|
21
|
+
_plugins.htmlTagsPlugin,
|
|
21
22
|
_plugins.ignorePlugin,
|
|
22
23
|
_plugins.miniCssExtractPlugin,
|
|
23
24
|
_plugins.momentLocalesPlugin,
|
|
25
|
+
_plugins.removeEmptyScriptsPlugin,
|
|
24
26
|
_plugins.virtualModulesPlugin,
|
|
25
27
|
_plugins.watchRunPlugin
|
|
26
28
|
].map((fn)=>fn(context, overrides)).filter((plugin)=>!!plugin);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/webpack/configs/plugins-config.ts"],"sourcesContent":["import { Configuration } from 'webpack';\nimport {\n assetsManifestPlugin,\n bundleAnalyzerPlugin,\n defineExposedDependenciesPlugin,\n defineExposedInstanceDependenciesPlugin,\n defineWebComponentNamePlugin,\n filterWarningsPlugin,\n htmlPlugin,\n ignorePlugin,\n miniCssExtractPlugin,\n momentLocalesPlugin,\n virtualModulesPlugin,\n watchRunPlugin,\n} from './plugins';\nimport { Context, Overrides } from './types';\n\ntype Config = Configuration['plugins'];\ntype Result = Pick<Configuration, 'plugins'>;\n\nexport function pluginsConfig(context: Context, overrides: Overrides): Result {\n const plugins: Config = [\n assetsManifestPlugin,\n bundleAnalyzerPlugin,\n defineExposedDependenciesPlugin,\n defineExposedInstanceDependenciesPlugin,\n defineWebComponentNamePlugin,\n filterWarningsPlugin,\n htmlPlugin,\n ignorePlugin,\n miniCssExtractPlugin,\n momentLocalesPlugin,\n virtualModulesPlugin,\n watchRunPlugin,\n ]\n .map(fn => fn(context, overrides))\n .filter(plugin => !!plugin);\n\n return { plugins };\n}\n"],"names":["pluginsConfig","context","overrides","plugins","assetsManifestPlugin","bundleAnalyzerPlugin","defineExposedDependenciesPlugin","defineExposedInstanceDependenciesPlugin","defineWebComponentNamePlugin","filterWarningsPlugin","htmlPlugin","ignorePlugin","miniCssExtractPlugin","momentLocalesPlugin","virtualModulesPlugin","watchRunPlugin","map","fn","filter","plugin"],"mappings":";;;;+
|
|
1
|
+
{"version":3,"sources":["../../../src/webpack/configs/plugins-config.ts"],"sourcesContent":["import { Configuration } from 'webpack';\nimport {\n assetsManifestPlugin,\n bundleAnalyzerPlugin,\n defineExposedDependenciesPlugin,\n defineExposedInstanceDependenciesPlugin,\n defineWebComponentNamePlugin,\n filterWarningsPlugin,\n htmlPlugin,\n htmlTagsPlugin,\n ignorePlugin,\n miniCssExtractPlugin,\n momentLocalesPlugin,\n removeEmptyScriptsPlugin,\n virtualModulesPlugin,\n watchRunPlugin,\n} from './plugins';\nimport { Context, Overrides } from './types';\n\ntype Config = Configuration['plugins'];\ntype Result = Pick<Configuration, 'plugins'>;\n\nexport function pluginsConfig(context: Context, overrides: Overrides): Result {\n const plugins: Config = [\n assetsManifestPlugin,\n bundleAnalyzerPlugin,\n defineExposedDependenciesPlugin,\n defineExposedInstanceDependenciesPlugin,\n defineWebComponentNamePlugin,\n filterWarningsPlugin,\n htmlPlugin,\n htmlTagsPlugin,\n ignorePlugin,\n miniCssExtractPlugin,\n momentLocalesPlugin,\n removeEmptyScriptsPlugin,\n virtualModulesPlugin,\n watchRunPlugin,\n ]\n .map(fn => fn(context, overrides))\n .filter(plugin => !!plugin);\n\n return { plugins };\n}\n"],"names":["pluginsConfig","context","overrides","plugins","assetsManifestPlugin","bundleAnalyzerPlugin","defineExposedDependenciesPlugin","defineExposedInstanceDependenciesPlugin","defineWebComponentNamePlugin","filterWarningsPlugin","htmlPlugin","htmlTagsPlugin","ignorePlugin","miniCssExtractPlugin","momentLocalesPlugin","removeEmptyScriptsPlugin","virtualModulesPlugin","watchRunPlugin","map","fn","filter","plugin"],"mappings":";;;;+BAsBgBA;;;eAAAA;;;yBANT;AAMA,SAASA,cAAcC,OAAgB,EAAEC,SAAoB;IAChE,MAAMC,UAAkB;QACpBC,6BAAoB;QACpBC,6BAAoB;QACpBC,wCAA+B;QAC/BC,gDAAuC;QACvCC,qCAA4B;QAC5BC,6BAAoB;QACpBC,mBAAU;QACVC,uBAAc;QACdC,qBAAY;QACZC,6BAAoB;QACpBC,4BAAmB;QACnBC,iCAAwB;QACxBC,6BAAoB;QACpBC,uBAAc;KACjB,CACIC,GAAG,CAACC,CAAAA,KAAMA,GAAGlB,SAASC,YACtBkB,MAAM,CAACC,CAAAA,SAAU,CAAC,CAACA;IAExB,OAAO;QAAElB;IAAQ;AACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-rules.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/rules/css-rules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"css-rules.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/rules/css-rules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,EAAE,CAgCxD"}
|