@servicetitan/startup 26.0.0 → 26.0.2-canary.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/__mocks__/create-package.js +14 -5
- package/dist/__mocks__/index.js +31 -18
- package/dist/cli/commands/build.js +83 -34
- package/dist/cli/commands/bundle-package.js +91 -39
- package/dist/cli/commands/eslint.js +74 -31
- package/dist/cli/commands/get-command.js +16 -16
- package/dist/cli/commands/get-user-commands.js +9 -9
- package/dist/cli/commands/index.js +45 -32
- package/dist/cli/commands/init.js +93 -42
- package/dist/cli/commands/install.js +77 -32
- package/dist/cli/commands/kendo-ui-license.js +86 -39
- package/dist/cli/commands/mfe-publish.js +176 -79
- package/dist/cli/commands/prepare-package.js +84 -35
- package/dist/cli/commands/start.js +107 -58
- package/dist/cli/commands/styles-check.js +63 -35
- package/dist/cli/commands/tests.js +77 -32
- package/dist/cli/commands/types.d.ts +1 -1
- package/dist/cli/commands/types.js +3 -3
- package/dist/cli/index.js +23 -18
- package/dist/cli/utils/assets-copy.js +52 -23
- package/dist/cli/utils/bundle.js +130 -56
- package/dist/cli/utils/cli-git.js +4 -4
- package/dist/cli/utils/cli-npm.js +73 -27
- package/dist/cli/utils/cli-os.js +14 -15
- package/dist/cli/utils/compile-less.d.ts +1 -1
- package/dist/cli/utils/compile-less.js +42 -18
- package/dist/cli/utils/compile-sass.d.ts +1 -1
- package/dist/cli/utils/compile-sass.js +41 -17
- package/dist/cli/utils/eslint.js +70 -34
- package/dist/cli/utils/get-module-type.js +17 -11
- package/dist/cli/utils/index.js +42 -29
- package/dist/cli/utils/is-module-installed.d.ts +1 -1
- package/dist/cli/utils/is-module-installed.js +4 -5
- package/dist/cli/utils/lerna-exec.js +52 -20
- package/dist/cli/utils/maybe-create-git-folder.d.ts +1 -1
- package/dist/cli/utils/maybe-create-git-folder.js +9 -7
- package/dist/cli/utils/publish.d.ts +1 -1
- package/dist/cli/utils/publish.js +3 -3
- package/dist/cli/utils/set-node-options.js +28 -12
- package/dist/cli/utils/styles-copy.js +52 -23
- package/dist/cli/utils/tcm.js +60 -34
- package/dist/cli/utils/tsc.js +46 -18
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/jest/index.js +4 -4
- package/dist/utils/debug.d.ts +1 -1
- package/dist/utils/debug.js +9 -7
- package/dist/utils/find-packages.d.ts +1 -1
- package/dist/utils/find-packages.js +37 -20
- package/dist/utils/get-destination-folders.js +27 -22
- package/dist/utils/get-folders.js +15 -9
- package/dist/utils/get-jest-config.js +78 -36
- package/dist/utils/get-package-data.d.ts +5 -2
- package/dist/utils/get-package-data.js +14 -8
- package/dist/utils/get-package-name.d.ts +1 -1
- package/dist/utils/get-package-name.js +10 -8
- package/dist/utils/get-packages.js +37 -19
- package/dist/utils/get-startup-version.d.ts +1 -1
- package/dist/utils/get-startup-version.js +16 -9
- package/dist/utils/get-tsconfig.d.ts +1 -1
- package/dist/utils/get-tsconfig.js +13 -9
- package/dist/utils/index.js +44 -31
- package/dist/utils/load-shared-dependencies.d.ts +5 -2
- package/dist/utils/load-shared-dependencies.js +12 -6
- package/dist/utils/log.d.ts +5 -2
- package/dist/utils/log.js +13 -12
- package/dist/utils/read-json.d.ts +1 -1
- package/dist/utils/read-json.js +10 -9
- package/dist/utils/to-array.d.ts +1 -1
- package/dist/utils/to-array.js +3 -3
- package/dist/webpack/__mocks__/file-rules.d.ts +1 -1
- package/dist/webpack/__mocks__/file-rules.js +3 -3
- package/dist/webpack/__mocks__/index.d.ts +1 -1
- package/dist/webpack/__mocks__/index.js +32 -19
- package/dist/webpack/configs/amd-config.js +3 -3
- package/dist/webpack/configs/cache-config.js +5 -5
- package/dist/webpack/configs/dev-server-config.js +38 -20
- package/dist/webpack/configs/dev-server-config.js.map +1 -1
- package/dist/webpack/configs/devtool-config.js +4 -5
- package/dist/webpack/configs/entry.config.js +4 -4
- package/dist/webpack/configs/externals-config.js +9 -7
- package/dist/webpack/configs/index.js +43 -30
- package/dist/webpack/configs/loaders/css-loader.js +15 -9
- package/dist/webpack/configs/loaders/index.js +34 -21
- package/dist/webpack/configs/loaders/less-loader.d.ts +1 -1
- package/dist/webpack/configs/loaders/less-loader.js +3 -3
- package/dist/webpack/configs/loaders/style-loader.js +11 -8
- package/dist/webpack/configs/loaders/types.d.ts +1 -1
- package/dist/webpack/configs/loaders/types.js +3 -3
- package/dist/webpack/configs/module-config.js +4 -4
- package/dist/webpack/configs/optimization-config.js +3 -3
- package/dist/webpack/configs/output-config.js +20 -9
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js +15 -10
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js +10 -8
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js +21 -14
- package/dist/webpack/configs/plugins/define-web-component-name-plugin.js +4 -4
- package/dist/webpack/configs/plugins/filter-warnings-plugin.js +3 -3
- package/dist/webpack/configs/plugins/html-plugin.js +43 -22
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.d.ts +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.js +5 -6
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js +5 -5
- package/dist/webpack/configs/plugins/ignore-plugin/index.js +31 -18
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.d.ts +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.js +6 -4
- package/dist/webpack/configs/plugins/index.js +42 -29
- package/dist/webpack/configs/plugins/mini-css-extract-plugin.js +20 -11
- package/dist/webpack/configs/plugins/moment-locales-plugin.js +9 -7
- package/dist/webpack/configs/plugins/provide-react-plugin.js +4 -4
- package/dist/webpack/configs/plugins/ts-checker-plugin.js +31 -23
- package/dist/webpack/configs/plugins/virtual-modules-plugin.js +14 -10
- package/dist/webpack/configs/plugins-config.js +4 -4
- package/dist/webpack/configs/resolve-config.js +3 -3
- package/dist/webpack/configs/rules/css-rules.js +25 -16
- package/dist/webpack/configs/rules/font-rules.js +3 -3
- package/dist/webpack/configs/rules/image-rules.js +3 -3
- package/dist/webpack/configs/rules/index.js +38 -25
- package/dist/webpack/configs/rules/js-rules.js +3 -3
- package/dist/webpack/configs/rules/less-rules.js +9 -5
- package/dist/webpack/configs/rules/scss-rules.js +9 -5
- package/dist/webpack/configs/rules/svg-rules.js +3 -3
- package/dist/webpack/configs/rules/tsx-rules.js +3 -3
- package/dist/webpack/configs/rules-config.js +8 -6
- package/dist/webpack/configs/stats-config.js +3 -3
- package/dist/webpack/configs/types.js +3 -3
- package/dist/webpack/configs/utils/generate-metadata.js +21 -14
- package/dist/webpack/configs/utils/get-web-components-version.js +16 -9
- package/dist/webpack/configs/utils/index.js +31 -18
- package/dist/webpack/create-webpack-config.js +70 -30
- package/dist/webpack/index.js +32 -19
- package/dist/webpack/loaders/expose-loader/index.d.ts +1 -1
- package/dist/webpack/loaders/expose-loader/index.js +11 -5
- package/dist/webpack/loaders/expose-loader/runtime/get-global-this.d.ts +1 -1
- package/dist/webpack/loaders/expose-loader/runtime/get-global-this.js +3 -4
- package/dist/webpack/loaders/expose-loader/utils/contextify-request.d.ts +1 -1
- package/dist/webpack/loaders/expose-loader/utils/contextify-request.js +23 -21
- package/dist/webpack/loaders/expose-loader/utils/get-new-user-request.d.ts +1 -1
- package/dist/webpack/loaders/expose-loader/utils/get-new-user-request.js +18 -9
- package/dist/webpack/loaders/expose-loader/utils/index.d.ts +1 -1
- package/dist/webpack/loaders/expose-loader/utils/index.js +33 -20
- package/dist/webpack/loaders/expose-loader/utils/stringify-request.d.ts +1 -1
- package/dist/webpack/loaders/expose-loader/utils/stringify-request.js +23 -19
- package/dist/webpack/types.d.ts +1 -1
- package/dist/webpack/types.js +3 -3
- package/dist/webpack/utils/bundle.d.ts +1 -1
- package/dist/webpack/utils/bundle.js +3 -3
- package/dist/webpack/utils/feature-cohort.js +6 -6
- package/dist/webpack/utils/get-caller-filename.d.ts +1 -1
- package/dist/webpack/utils/get-caller-filename.js +4 -5
- package/dist/webpack/utils/hash-mod.d.ts +1 -1
- package/dist/webpack/utils/hash-mod.js +3 -3
- package/dist/webpack/utils/index.js +34 -21
- package/dist/webpack/utils/split-by-entry.d.ts +6 -2
- package/dist/webpack/utils/split-by-entry.js +4 -5
- package/dist/webpack/utils/testing/compile.d.ts +1 -1
- package/dist/webpack/utils/testing/compile.js +3 -3
- package/dist/webpack/utils/testing/execute.d.ts +11 -5
- package/dist/webpack/utils/testing/execute.js +17 -10
- package/dist/webpack/utils/testing/get-compiler.d.ts +4 -2
- package/dist/webpack/utils/testing/get-compiler.js +37 -30
- package/dist/webpack/utils/testing/get-errors.d.ts +1 -1
- package/dist/webpack/utils/testing/get-errors.js +4 -4
- package/dist/webpack/utils/testing/get-module-source.d.ts +1 -1
- package/dist/webpack/utils/testing/get-module-source.js +9 -4
- package/dist/webpack/utils/testing/get-warnings.d.ts +1 -1
- package/dist/webpack/utils/testing/get-warnings.js +4 -4
- package/dist/webpack/utils/testing/index.d.ts +16 -6
- package/dist/webpack/utils/testing/index.js +12 -12
- package/dist/webpack/utils/testing/normalize-errors.d.ts +1 -1
- package/dist/webpack/utils/testing/normalize-errors.js +3 -3
- package/dist/webpack/utils/testing/read-asset.d.ts +1 -1
- package/dist/webpack/utils/testing/read-asset.js +12 -10
- package/dist/webpack/utils/testing/read-assets.d.ts +1 -1
- package/dist/webpack/utils/testing/read-assets.js +4 -4
- package/package.json +7 -8
- package/src/index.ts +1 -0
- package/src/webpack/__tests__/create-webpack-config.test.ts +4 -0
- package/src/webpack/configs/dev-server-config.ts +6 -1
|
@@ -1,25 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
Object.defineProperty(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
__exportStar
|
|
23
|
-
__exportStar
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
var __createBinding =
|
|
3
|
+
(this && this.__createBinding) ||
|
|
4
|
+
(Object.create
|
|
5
|
+
? function (o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return m[k];
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}
|
|
18
|
+
: function (o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
});
|
|
22
|
+
var __exportStar =
|
|
23
|
+
(this && this.__exportStar) ||
|
|
24
|
+
function (m, exports) {
|
|
25
|
+
for (var p in m)
|
|
26
|
+
if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p))
|
|
27
|
+
__createBinding(exports, m, p);
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
30
|
+
__exportStar(require('./css-rules'), exports);
|
|
31
|
+
__exportStar(require('./font-rules'), exports);
|
|
32
|
+
__exportStar(require('./image-rules'), exports);
|
|
33
|
+
__exportStar(require('./js-rules'), exports);
|
|
34
|
+
__exportStar(require('./less-rules'), exports);
|
|
35
|
+
__exportStar(require('./scss-rules'), exports);
|
|
36
|
+
__exportStar(require('./svg-rules'), exports);
|
|
37
|
+
__exportStar(require('./tsx-rules'), exports);
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.jsRules = void 0;
|
|
4
4
|
function jsRules(_) {
|
|
5
5
|
return [
|
|
@@ -16,4 +16,4 @@ function jsRules(_) {
|
|
|
16
16
|
];
|
|
17
17
|
}
|
|
18
18
|
exports.jsRules = jsRules;
|
|
19
|
-
//# sourceMappingURL=js-rules.js.map
|
|
19
|
+
//# sourceMappingURL=js-rules.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.lessRules = void 0;
|
|
4
|
-
const loaders_1 = require(
|
|
4
|
+
const loaders_1 = require('../loaders');
|
|
5
5
|
function lessRules(context) {
|
|
6
6
|
return [
|
|
7
7
|
{
|
|
@@ -15,9 +15,13 @@ function lessRules(context) {
|
|
|
15
15
|
{
|
|
16
16
|
test: /(\.less)$/,
|
|
17
17
|
exclude: /\.module.less$/,
|
|
18
|
-
use: [
|
|
18
|
+
use: [
|
|
19
|
+
(0, loaders_1.styleLoader)(context),
|
|
20
|
+
(0, loaders_1.cssLoader)(context),
|
|
21
|
+
(0, loaders_1.lessLoader)(),
|
|
22
|
+
],
|
|
19
23
|
},
|
|
20
24
|
];
|
|
21
25
|
}
|
|
22
26
|
exports.lessRules = lessRules;
|
|
23
|
-
//# sourceMappingURL=less-rules.js.map
|
|
27
|
+
//# sourceMappingURL=less-rules.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.scssRules = void 0;
|
|
4
|
-
const loaders_1 = require(
|
|
4
|
+
const loaders_1 = require('../loaders');
|
|
5
5
|
function scssRules(context) {
|
|
6
6
|
return [
|
|
7
7
|
{
|
|
@@ -15,9 +15,13 @@ function scssRules(context) {
|
|
|
15
15
|
{
|
|
16
16
|
test: /(\.scss)$/,
|
|
17
17
|
exclude: /\.module.scss$/,
|
|
18
|
-
use: [
|
|
18
|
+
use: [
|
|
19
|
+
(0, loaders_1.styleLoader)(context),
|
|
20
|
+
(0, loaders_1.cssLoader)(context),
|
|
21
|
+
'sass-loader',
|
|
22
|
+
],
|
|
19
23
|
},
|
|
20
24
|
];
|
|
21
25
|
}
|
|
22
26
|
exports.scssRules = scssRules;
|
|
23
|
-
//# sourceMappingURL=scss-rules.js.map
|
|
27
|
+
//# sourceMappingURL=scss-rules.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.svgRules = void 0;
|
|
4
4
|
function svgRules(_) {
|
|
5
5
|
// Using [\\\/] because Windows uses backslash as path separator
|
|
@@ -57,4 +57,4 @@ function svgRules(_) {
|
|
|
57
57
|
];
|
|
58
58
|
}
|
|
59
59
|
exports.svgRules = svgRules;
|
|
60
|
-
//# sourceMappingURL=svg-rules.js.map
|
|
60
|
+
//# sourceMappingURL=svg-rules.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.tsxRules = void 0;
|
|
4
4
|
function tsxRules({ codeCoverage, esbuild, experimentalBundlers }) {
|
|
5
5
|
let loader = {
|
|
@@ -42,4 +42,4 @@ function tsxRules({ codeCoverage, esbuild, experimentalBundlers }) {
|
|
|
42
42
|
return [rule];
|
|
43
43
|
}
|
|
44
44
|
exports.tsxRules = tsxRules;
|
|
45
|
-
//# sourceMappingURL=tsx-rules.js.map
|
|
45
|
+
//# sourceMappingURL=tsx-rules.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.rulesConfig = void 0;
|
|
4
|
-
const utils_1 = require(
|
|
5
|
-
const rules_1 = require(
|
|
4
|
+
const utils_1 = require('../utils');
|
|
5
|
+
const rules_1 = require('./rules');
|
|
6
6
|
function rulesConfig(context, _) {
|
|
7
7
|
const rules = [
|
|
8
8
|
rules_1.jsRules,
|
|
@@ -13,7 +13,9 @@ function rulesConfig(context, _) {
|
|
|
13
13
|
sharedDependenciesRules,
|
|
14
14
|
].flatMap(fn => fn(context));
|
|
15
15
|
if (!context.isCustomStyleRules) {
|
|
16
|
-
rules.push(
|
|
16
|
+
rules.push(
|
|
17
|
+
...[rules_1.scssRules, rules_1.lessRules, rules_1.cssRules].flatMap(fn => fn(context))
|
|
18
|
+
);
|
|
17
19
|
}
|
|
18
20
|
return { rules };
|
|
19
21
|
}
|
|
@@ -30,4 +32,4 @@ function sharedDependenciesRules(context) {
|
|
|
30
32
|
options: { exposes: variable },
|
|
31
33
|
}));
|
|
32
34
|
}
|
|
33
|
-
//# sourceMappingURL=rules-config.js.map
|
|
35
|
+
//# sourceMappingURL=rules-config.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.statsConfig = void 0;
|
|
4
4
|
function statsConfig(_context, _) {
|
|
5
5
|
const stats = {
|
|
@@ -13,4 +13,4 @@ function statsConfig(_context, _) {
|
|
|
13
13
|
return { stats };
|
|
14
14
|
}
|
|
15
15
|
exports.statsConfig = statsConfig;
|
|
16
|
-
//# sourceMappingURL=stats-config.js.map
|
|
16
|
+
//# sourceMappingURL=stats-config.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
//# sourceMappingURL=types.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -1,34 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault =
|
|
3
|
+
(this && this.__importDefault) ||
|
|
4
|
+
function (mod) {
|
|
5
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
6
|
+
};
|
|
7
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
6
8
|
exports.generateMetadata = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require(
|
|
8
|
-
const path_1 = __importDefault(require(
|
|
9
|
-
const utils_1 = require(
|
|
10
|
-
const get_web_components_version_1 = require(
|
|
9
|
+
const fs_1 = __importDefault(require('fs'));
|
|
10
|
+
const path_1 = __importDefault(require('path'));
|
|
11
|
+
const utils_1 = require('../../../utils');
|
|
12
|
+
const get_web_components_version_1 = require('./get-web-components-version');
|
|
11
13
|
function generateMetadata(context) {
|
|
12
14
|
const { destination, name, packageData, sharedDependencies } = context;
|
|
13
15
|
const outputFile = `./${destination}/metadata.json`;
|
|
14
16
|
if (!fs_1.default.existsSync(`./${destination}`)) {
|
|
15
17
|
fs_1.default.mkdirSync(`./${destination}`, { recursive: true });
|
|
16
18
|
}
|
|
17
|
-
const full = (0, utils_1.readJsonSafe)(
|
|
18
|
-
|
|
19
|
+
const full = (0, utils_1.readJsonSafe)(
|
|
20
|
+
path_1.default.join(destination, 'bundle', 'full', 'entrypoints.json')
|
|
21
|
+
);
|
|
22
|
+
const light = (0, utils_1.readJsonSafe)(
|
|
23
|
+
path_1.default.join(destination, 'bundle', 'light', 'entrypoints.json')
|
|
24
|
+
);
|
|
19
25
|
const metadata = {
|
|
20
26
|
name,
|
|
21
27
|
bundledWith: {
|
|
22
28
|
'@servicetitan/startup': (0, utils_1.getStartupVersion)(),
|
|
23
|
-
'@servicetitan/web-components': (0,
|
|
29
|
+
'@servicetitan/web-components': (0,
|
|
30
|
+
get_web_components_version_1.getWebComponentsVersion)(),
|
|
24
31
|
},
|
|
25
32
|
sharedDependencies,
|
|
26
33
|
dependencies: packageData.dependencies,
|
|
27
|
-
entrypoints: Object.assign(Object.assign({},
|
|
34
|
+
entrypoints: Object.assign(Object.assign({}, full ? { full } : {}), light ? { light } : {}),
|
|
28
35
|
};
|
|
29
36
|
fs_1.default.writeFileSync(outputFile, JSON.stringify(metadata, null, 2), 'utf8');
|
|
30
37
|
/* istanbul ignore next: debug only */
|
|
31
38
|
utils_1.log.debug('generate-metadata', `${outputFile}:`, () => JSON.stringify(metadata));
|
|
32
39
|
}
|
|
33
40
|
exports.generateMetadata = generateMetadata;
|
|
34
|
-
//# sourceMappingURL=generate-metadata.js.map
|
|
41
|
+
//# sourceMappingURL=generate-metadata.js.map
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault =
|
|
3
|
+
(this && this.__importDefault) ||
|
|
4
|
+
function (mod) {
|
|
5
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
6
|
+
};
|
|
7
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
6
8
|
exports.getWebComponentsVersion = void 0;
|
|
7
|
-
const path_1 = __importDefault(require(
|
|
8
|
-
const utils_1 = require(
|
|
9
|
+
const path_1 = __importDefault(require('path'));
|
|
10
|
+
const utils_1 = require('../../../utils');
|
|
9
11
|
function getWebComponentsVersion() {
|
|
10
|
-
return (0, utils_1.readJson)(
|
|
12
|
+
return (0, utils_1.readJson)(
|
|
13
|
+
path_1.default.join(
|
|
14
|
+
path_1.default.dirname(require.resolve('@servicetitan/web-components')),
|
|
15
|
+
'../package.json'
|
|
16
|
+
)
|
|
17
|
+
).version;
|
|
11
18
|
}
|
|
12
19
|
exports.getWebComponentsVersion = getWebComponentsVersion;
|
|
13
|
-
//# sourceMappingURL=get-web-components-version.js.map
|
|
20
|
+
//# sourceMappingURL=get-web-components-version.js.map
|
|
@@ -1,18 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
Object.defineProperty(
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
var __createBinding =
|
|
3
|
+
(this && this.__createBinding) ||
|
|
4
|
+
(Object.create
|
|
5
|
+
? function (o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return m[k];
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}
|
|
18
|
+
: function (o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
});
|
|
22
|
+
var __exportStar =
|
|
23
|
+
(this && this.__exportStar) ||
|
|
24
|
+
function (m, exports) {
|
|
25
|
+
for (var p in m)
|
|
26
|
+
if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p))
|
|
27
|
+
__createBinding(exports, m, p);
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
30
|
+
__exportStar(require('./generate-metadata'), exports);
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,38 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.createWebpackConfig = void 0;
|
|
4
|
-
const webpack_merge_1 = require(
|
|
5
|
-
const yargs_1 = require(
|
|
6
|
-
const utils_1 = require(
|
|
7
|
-
const utils_2 = require(
|
|
8
|
-
const configs_1 = require(
|
|
9
|
-
const utils_3 = require(
|
|
4
|
+
const webpack_merge_1 = require('webpack-merge');
|
|
5
|
+
const yargs_1 = require('yargs');
|
|
6
|
+
const utils_1 = require('../cli/utils');
|
|
7
|
+
const utils_2 = require('../utils');
|
|
8
|
+
const configs_1 = require('./configs');
|
|
9
|
+
const utils_3 = require('./utils');
|
|
10
10
|
function createWebpackConfig(overrides, options = {}) {
|
|
11
11
|
var _a, _b, _c;
|
|
12
12
|
const { configuration = {} } = overrides;
|
|
13
13
|
const { source, destination } = (0, utils_2.getFolders)();
|
|
14
14
|
const packageData = (0, utils_2.getPackageData)();
|
|
15
|
-
const sharedDependencies = (0, utils_2.loadSharedDependencies)(
|
|
16
|
-
|
|
17
|
-
sharedDependencies
|
|
18
|
-
|
|
15
|
+
const sharedDependencies = (0, utils_2.loadSharedDependencies)(
|
|
16
|
+
packageData.dependencies,
|
|
17
|
+
packageData.sharedDependencies
|
|
18
|
+
);
|
|
19
|
+
const context = Object.assign(
|
|
20
|
+
Object.assign(
|
|
21
|
+
{
|
|
22
|
+
codeCoverage:
|
|
23
|
+
(_a = options.codeCoverage) !== null && _a !== void 0
|
|
24
|
+
? _a
|
|
25
|
+
: !!yargs_1.argv['code-coverage'],
|
|
26
|
+
destination,
|
|
27
|
+
esbuild:
|
|
28
|
+
(_b = options.esbuild) !== null && _b !== void 0 ? _b : !!yargs_1.argv.esbuild,
|
|
29
|
+
experimentalBundlers:
|
|
30
|
+
(_c = options.experimentalBundlers) !== null && _c !== void 0
|
|
31
|
+
? _c
|
|
32
|
+
: !!yargs_1.argv['experimental-bundlers'],
|
|
33
|
+
isCustomStyleRules: (0, utils_2.isCustomStyleRules)(),
|
|
34
|
+
isExposeSharedDependencies: (0, utils_2.isExposeSharedDependencies)(),
|
|
35
|
+
isLegacyRoot: (0, utils_2.isLegacyRoot)(),
|
|
36
|
+
isProduction: configuration.mode === 'production',
|
|
37
|
+
isWebComponent: (0, utils_2.isWebComponent)(),
|
|
38
|
+
name: '',
|
|
39
|
+
},
|
|
40
|
+
options
|
|
41
|
+
),
|
|
42
|
+
{ packageData, sharedDependencies, source }
|
|
43
|
+
);
|
|
19
44
|
if (context.isWebComponent && isCalledFromCustomWebpackConfigFile()) {
|
|
20
|
-
throw new Error(
|
|
45
|
+
throw new Error(
|
|
46
|
+
'You cannot call createWebpackConfig in a custom webpack config file in a web component (MFE) project. Export webpack configuration itself as a default export from the config file instead.'
|
|
47
|
+
);
|
|
21
48
|
}
|
|
22
|
-
const result = (0, webpack_merge_1.merge)(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
49
|
+
const result = (0, webpack_merge_1.merge)(
|
|
50
|
+
[
|
|
51
|
+
configs_1.cacheConfig,
|
|
52
|
+
configs_1.devServerConfig,
|
|
53
|
+
configs_1.devtoolConfig,
|
|
54
|
+
configs_1.entryConfig,
|
|
55
|
+
configs_1.externalsConfig,
|
|
56
|
+
configs_1.moduleConfig,
|
|
57
|
+
configs_1.optimizationConfig,
|
|
58
|
+
configs_1.outputConfig,
|
|
59
|
+
configs_1.pluginsConfig,
|
|
60
|
+
configs_1.resolveConfig,
|
|
61
|
+
configs_1.statsConfig,
|
|
62
|
+
configs_1.amdConfig,
|
|
63
|
+
].reduce(
|
|
64
|
+
(result, fn) => Object.assign(Object.assign({}, result), fn(context, overrides)),
|
|
65
|
+
{}
|
|
66
|
+
),
|
|
67
|
+
configuration
|
|
68
|
+
);
|
|
36
69
|
/* istanbul ignore next: debug only */
|
|
37
70
|
utils_2.log.debug('create-webpack-config', () => stringify(result));
|
|
38
71
|
return result;
|
|
@@ -40,7 +73,9 @@ function createWebpackConfig(overrides, options = {}) {
|
|
|
40
73
|
exports.createWebpackConfig = createWebpackConfig;
|
|
41
74
|
function isCalledFromCustomWebpackConfigFile() {
|
|
42
75
|
const callerFileName = (0, utils_3.getCallerFile)();
|
|
43
|
-
return [utils_1.webpackDevConfigFileName, utils_1.webpackProdConfigFileName].some(
|
|
76
|
+
return [utils_1.webpackDevConfigFileName, utils_1.webpackProdConfigFileName].some(
|
|
77
|
+
configFileName => callerFileName.includes(configFileName)
|
|
78
|
+
);
|
|
44
79
|
}
|
|
45
80
|
/* istanbul ignore next: debug only */
|
|
46
81
|
function stringify(configuration) {
|
|
@@ -55,7 +90,12 @@ function stringify(configuration) {
|
|
|
55
90
|
if (key === 'plugins' && Array.isArray(value)) {
|
|
56
91
|
return value.map(plugin => {
|
|
57
92
|
var _a, _b;
|
|
58
|
-
const name =
|
|
93
|
+
const name =
|
|
94
|
+
(_b =
|
|
95
|
+
(_a = plugin.constructor) === null || _a === void 0 ? void 0 : _a.name) !==
|
|
96
|
+
null && _b !== void 0
|
|
97
|
+
? _b
|
|
98
|
+
: plugin.name;
|
|
59
99
|
return name ? { [name]: plugin } : plugin;
|
|
60
100
|
});
|
|
61
101
|
}
|
|
@@ -63,4 +103,4 @@ function stringify(configuration) {
|
|
|
63
103
|
}
|
|
64
104
|
return JSON.stringify(configuration, replacer, 2);
|
|
65
105
|
}
|
|
66
|
-
//# sourceMappingURL=create-webpack-config.js.map
|
|
106
|
+
//# sourceMappingURL=create-webpack-config.js.map
|
package/dist/webpack/index.js
CHANGED
|
@@ -1,19 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
Object.defineProperty(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
var __createBinding =
|
|
3
|
+
(this && this.__createBinding) ||
|
|
4
|
+
(Object.create
|
|
5
|
+
? function (o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return m[k];
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}
|
|
18
|
+
: function (o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
});
|
|
22
|
+
var __exportStar =
|
|
23
|
+
(this && this.__exportStar) ||
|
|
24
|
+
function (m, exports) {
|
|
25
|
+
for (var p in m)
|
|
26
|
+
if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p))
|
|
27
|
+
__createBinding(exports, m, p);
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
30
|
+
__exportStar(require('./create-webpack-config'), exports);
|
|
31
|
+
__exportStar(require('./types'), exports);
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
const utils_1 = require(
|
|
1
|
+
'use strict';
|
|
2
|
+
const utils_1 = require('./utils');
|
|
3
3
|
// eslint-disable-next-line func-style
|
|
4
4
|
const loader = function () {
|
|
5
5
|
const { exposes } = this.getOptions({
|
|
@@ -23,10 +23,16 @@ const loader = function () {
|
|
|
23
23
|
* Change the request from an absolute to a relative path, this prevents [chunkhash] values
|
|
24
24
|
* from changing when running webpack builds in different directories.
|
|
25
25
|
*/
|
|
26
|
-
const request = (0, utils_1.stringifyRequest)(
|
|
26
|
+
const request = (0, utils_1.stringifyRequest)(
|
|
27
|
+
context,
|
|
28
|
+
`-!${(0, utils_1.contextifyRequest)(context, this.remainingRequest)}`
|
|
29
|
+
);
|
|
27
30
|
let code = '';
|
|
28
31
|
code += `var ___EXPOSE_LOADER_IMPORT___ = require(${request});\n`;
|
|
29
|
-
code += `var ___EXPOSE_LOADER_GLOBAL_THIS___ = require(${(0, utils_1.stringifyRequest)(
|
|
32
|
+
code += `var ___EXPOSE_LOADER_GLOBAL_THIS___ = require(${(0, utils_1.stringifyRequest)(
|
|
33
|
+
context,
|
|
34
|
+
require.resolve('./runtime/get-global-this')
|
|
35
|
+
)});\n`;
|
|
30
36
|
/**
|
|
31
37
|
* Initialization of the storage for the webpack modules cache.
|
|
32
38
|
* It has the following structure: <storage>.<scope>.<module_id>
|
|
@@ -98,4 +104,4 @@ const loader = function () {
|
|
|
98
104
|
callback(null, code);
|
|
99
105
|
};
|
|
100
106
|
module.exports = loader;
|
|
101
|
-
//# sourceMappingURL=index.js.map
|
|
107
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
//# sourceMappingURL=get-global-this.d.ts.map
|
|
1
|
+
//# sourceMappingURL=get-global-this.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
// @ts-nocheck
|
|
4
4
|
module.exports = (function () {
|
|
@@ -9,8 +9,7 @@ module.exports = (function () {
|
|
|
9
9
|
try {
|
|
10
10
|
// This works if eval is allowed (see CSP)
|
|
11
11
|
result = this || new Function('return this')();
|
|
12
|
-
}
|
|
13
|
-
catch (e) {
|
|
12
|
+
} catch (e) {
|
|
14
13
|
// This works if the window reference is available
|
|
15
14
|
if (typeof window === 'object') {
|
|
16
15
|
return window;
|
|
@@ -26,4 +25,4 @@ module.exports = (function () {
|
|
|
26
25
|
}
|
|
27
26
|
return result;
|
|
28
27
|
})();
|
|
29
|
-
//# sourceMappingURL=get-global-this.js.map
|
|
28
|
+
//# sourceMappingURL=get-global-this.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare function contextifyRequest(context: string, request: string): string;
|
|
2
|
-
//# sourceMappingURL=contextify-request.d.ts.map
|
|
2
|
+
//# sourceMappingURL=contextify-request.d.ts.map
|