@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,33 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
var __decorate =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
var __decorate =
|
|
3
|
+
(this && this.__decorate) ||
|
|
4
|
+
function (decorators, target, key, desc) {
|
|
5
|
+
var c = arguments.length,
|
|
6
|
+
r =
|
|
7
|
+
c < 3
|
|
8
|
+
? target
|
|
9
|
+
: desc === null
|
|
10
|
+
? (desc = Object.getOwnPropertyDescriptor(target, key))
|
|
11
|
+
: desc,
|
|
12
|
+
d;
|
|
13
|
+
if (typeof Reflect === 'object' && typeof Reflect.decorate === 'function')
|
|
14
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
15
|
+
else
|
|
16
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
17
|
+
if ((d = decorators[i]))
|
|
18
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
19
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20
|
+
};
|
|
21
|
+
var __metadata =
|
|
22
|
+
(this && this.__metadata) ||
|
|
23
|
+
function (k, v) {
|
|
24
|
+
if (typeof Reflect === 'object' && typeof Reflect.metadata === 'function')
|
|
25
|
+
return Reflect.metadata(k, v);
|
|
26
|
+
};
|
|
27
|
+
var __awaiter =
|
|
28
|
+
(this && this.__awaiter) ||
|
|
29
|
+
function (thisArg, _arguments, P, generator) {
|
|
30
|
+
function adopt(value) {
|
|
31
|
+
return value instanceof P
|
|
32
|
+
? value
|
|
33
|
+
: new P(function (resolve) {
|
|
34
|
+
resolve(value);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) {
|
|
39
|
+
try {
|
|
40
|
+
step(generator.next(value));
|
|
41
|
+
} catch (e) {
|
|
42
|
+
reject(e);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function rejected(value) {
|
|
46
|
+
try {
|
|
47
|
+
step(generator['throw'](value));
|
|
48
|
+
} catch (e) {
|
|
49
|
+
reject(e);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function step(result) {
|
|
53
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
54
|
+
}
|
|
55
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
21
59
|
exports.Start = void 0;
|
|
22
|
-
const utils_1 = require(
|
|
23
|
-
const utils_2 = require(
|
|
60
|
+
const utils_1 = require('../../utils');
|
|
61
|
+
const utils_2 = require('../utils');
|
|
24
62
|
class Start {
|
|
25
63
|
constructor(args) {
|
|
26
|
-
Object.defineProperty(this,
|
|
64
|
+
Object.defineProperty(this, 'args', {
|
|
27
65
|
enumerable: true,
|
|
28
66
|
configurable: true,
|
|
29
67
|
writable: true,
|
|
30
|
-
value: args
|
|
68
|
+
value: args,
|
|
31
69
|
});
|
|
32
70
|
}
|
|
33
71
|
description() {
|
|
@@ -35,7 +73,9 @@ class Start {
|
|
|
35
73
|
}
|
|
36
74
|
execute() {
|
|
37
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
const packages = (0, utils_1.splitPackagesByType)(
|
|
76
|
+
const packages = (0, utils_1.splitPackagesByType)(
|
|
77
|
+
(0, utils_1.getPackages)({ scope: this.args.scope, ignore: this.args.ignore })
|
|
78
|
+
);
|
|
39
79
|
const packagesWithPreparation = [
|
|
40
80
|
...packages[utils_1.PackageType.TSC],
|
|
41
81
|
...packages[utils_1.PackageType.Webpack],
|
|
@@ -53,45 +93,54 @@ class Start {
|
|
|
53
93
|
yield Promise.all([
|
|
54
94
|
...(packagesWithPreparation.length
|
|
55
95
|
? [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
96
|
+
(0, utils_2.lernaExec)({
|
|
97
|
+
'cmd': 'startup prepare-package',
|
|
98
|
+
'scope': packagesWithPreparation.map(({ name }) => name),
|
|
99
|
+
'parallel': true,
|
|
100
|
+
'stream': true,
|
|
101
|
+
'--': ['--watch'],
|
|
102
|
+
}),
|
|
103
|
+
]
|
|
104
|
+
: []),
|
|
105
|
+
...(packages[utils_1.PackageType.TSC].length
|
|
106
|
+
? [(0, utils_2.tscWatch)(packages[utils_1.PackageType.TSC])]
|
|
64
107
|
: []),
|
|
65
|
-
...(packages[utils_1.PackageType.TSC].length ? [(0, utils_2.tscWatch)(packages[utils_1.PackageType.TSC])] : []),
|
|
66
108
|
...(packages[utils_1.PackageType.Webpack].length
|
|
67
109
|
? [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
110
|
+
(0, utils_2.lernaExec)({
|
|
111
|
+
'cmd': 'startup bundle-package',
|
|
112
|
+
'scope': packages[utils_1.PackageType.Webpack].map(
|
|
113
|
+
({ name }) => name
|
|
114
|
+
),
|
|
115
|
+
'parallel': true,
|
|
116
|
+
'stream': true,
|
|
117
|
+
'--': [
|
|
118
|
+
'--color',
|
|
119
|
+
'--watch',
|
|
120
|
+
this.args.config ? `--config "${this.args.config}"` : undefined,
|
|
121
|
+
this.args['code-coverage'] ? '--code-coverage' : undefined,
|
|
122
|
+
this.args.esbuild ? '--esbuild' : undefined,
|
|
123
|
+
this.args['experimental-bundlers']
|
|
124
|
+
? '--experimental-bundlers'
|
|
125
|
+
: undefined,
|
|
126
|
+
].filter(item => !!item),
|
|
127
|
+
}),
|
|
128
|
+
]
|
|
85
129
|
: []),
|
|
86
130
|
]);
|
|
87
131
|
});
|
|
88
132
|
}
|
|
89
133
|
}
|
|
90
134
|
exports.Start = Start;
|
|
91
|
-
__decorate(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
135
|
+
__decorate(
|
|
136
|
+
[
|
|
137
|
+
utils_1.logErrors,
|
|
138
|
+
__metadata('design:type', Function),
|
|
139
|
+
__metadata('design:paramtypes', []),
|
|
140
|
+
__metadata('design:returntype', Promise),
|
|
141
|
+
],
|
|
142
|
+
Start.prototype,
|
|
143
|
+
'execute',
|
|
144
|
+
null
|
|
145
|
+
);
|
|
146
|
+
//# sourceMappingURL=start.js.map
|
|
@@ -1,22 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
var __awaiter =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
var __awaiter =
|
|
3
|
+
(this && this.__awaiter) ||
|
|
4
|
+
function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) {
|
|
6
|
+
return value instanceof P
|
|
7
|
+
? value
|
|
8
|
+
: new P(function (resolve) {
|
|
9
|
+
resolve(value);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
13
|
+
function fulfilled(value) {
|
|
14
|
+
try {
|
|
15
|
+
step(generator.next(value));
|
|
16
|
+
} catch (e) {
|
|
17
|
+
reject(e);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function rejected(value) {
|
|
21
|
+
try {
|
|
22
|
+
step(generator['throw'](value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function step(result) {
|
|
28
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
29
|
+
}
|
|
30
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
var __importDefault =
|
|
34
|
+
(this && this.__importDefault) ||
|
|
35
|
+
function (mod) {
|
|
36
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
15
39
|
exports.StylesCheck = void 0;
|
|
16
|
-
const fs_1 = __importDefault(require(
|
|
17
|
-
const path_1 = __importDefault(require(
|
|
18
|
-
const process_1 = __importDefault(require(
|
|
19
|
-
const utils_1 = require(
|
|
40
|
+
const fs_1 = __importDefault(require('fs'));
|
|
41
|
+
const path_1 = __importDefault(require('path'));
|
|
42
|
+
const process_1 = __importDefault(require('process'));
|
|
43
|
+
const utils_1 = require('../../utils');
|
|
20
44
|
const styleCheckError = [
|
|
21
45
|
'!!!!!!!!!!!!! STYLE CHECK ERROR !!!!!!!!!!!!!',
|
|
22
46
|
'Style check failed with following errors:',
|
|
@@ -24,8 +48,8 @@ const styleCheckError = [
|
|
|
24
48
|
const designSystem = 'design-system.css';
|
|
25
49
|
var PackageType;
|
|
26
50
|
(function (PackageType) {
|
|
27
|
-
PackageType[
|
|
28
|
-
PackageType[
|
|
51
|
+
PackageType['App'] = 'app';
|
|
52
|
+
PackageType['WebComponent'] = 'web_component';
|
|
29
53
|
})(PackageType || (PackageType = {}));
|
|
30
54
|
function readDir(startPath, filter) {
|
|
31
55
|
let out = [];
|
|
@@ -38,8 +62,7 @@ function readDir(startPath, filter) {
|
|
|
38
62
|
const stat = fs_1.default.lstatSync(filename);
|
|
39
63
|
if (stat.isDirectory()) {
|
|
40
64
|
out = [...out, ...readDir(filename, filter)];
|
|
41
|
-
}
|
|
42
|
-
else if (filter.some(f => filename.endsWith(f))) {
|
|
65
|
+
} else if (filter.some(f => filename.endsWith(f))) {
|
|
43
66
|
out.push(filename);
|
|
44
67
|
}
|
|
45
68
|
}
|
|
@@ -61,8 +84,10 @@ const checkStyleFiles = (files, packageType) => {
|
|
|
61
84
|
"@import '~@servicetitan/design-system/dist/system.min.css';",
|
|
62
85
|
];
|
|
63
86
|
for (const file of files) {
|
|
64
|
-
if (
|
|
65
|
-
|
|
87
|
+
if (
|
|
88
|
+
[PackageType.App, PackageType.WebComponent].includes(packageType) &&
|
|
89
|
+
file.relativePath === designSystem
|
|
90
|
+
) {
|
|
66
91
|
continue;
|
|
67
92
|
}
|
|
68
93
|
const content = fs_1.default.readFileSync(file.path);
|
|
@@ -74,11 +99,10 @@ const checkStyleFiles = (files, packageType) => {
|
|
|
74
99
|
}
|
|
75
100
|
return errors.length ? errors : undefined;
|
|
76
101
|
};
|
|
77
|
-
const checkErrors =
|
|
102
|
+
const checkErrors = errors => {
|
|
78
103
|
if (!errors) {
|
|
79
104
|
utils_1.log.info('style check: OK');
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
105
|
+
} else {
|
|
82
106
|
utils_1.log.error([...styleCheckError, ...errors].join('\n'));
|
|
83
107
|
throw new Error('style check error, please check logs above');
|
|
84
108
|
}
|
|
@@ -88,9 +112,15 @@ function checkStylesLib(_files) {
|
|
|
88
112
|
}
|
|
89
113
|
function checkStylesApp(files) {
|
|
90
114
|
const { dependencies, sharedDependencies } = (0, utils_1.getPackageData)();
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
|
|
115
|
+
if (
|
|
116
|
+
(0, utils_1.loadSharedDependencies)(dependencies, sharedDependencies)[
|
|
117
|
+
'@servicetitan/design-system'
|
|
118
|
+
] &&
|
|
119
|
+
!files.some(f => f.relativePath === designSystem)
|
|
120
|
+
) {
|
|
121
|
+
utils_1.log.warning(
|
|
122
|
+
"application doesn't have design-system.css. Please check https://docs.st.dev/docs/frontend/micro-frontends#host-configuration"
|
|
123
|
+
);
|
|
94
124
|
}
|
|
95
125
|
checkErrors(checkStyleFiles(files, PackageType.App));
|
|
96
126
|
}
|
|
@@ -115,15 +145,13 @@ class StylesCheck {
|
|
|
115
145
|
const files = findStyleFiles(process_1.default.cwd(), projectFolders.source);
|
|
116
146
|
if (!(0, utils_1.isBundle)()) {
|
|
117
147
|
checkStylesLib(files);
|
|
118
|
-
}
|
|
119
|
-
else if ((0, utils_1.isWebComponent)()) {
|
|
148
|
+
} else if ((0, utils_1.isWebComponent)()) {
|
|
120
149
|
checkStylesWebComponent(files);
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
150
|
+
} else {
|
|
123
151
|
checkStylesApp(files);
|
|
124
152
|
}
|
|
125
153
|
});
|
|
126
154
|
}
|
|
127
155
|
}
|
|
128
156
|
exports.StylesCheck = StylesCheck;
|
|
129
|
-
//# sourceMappingURL=styles-check.js.map
|
|
157
|
+
//# sourceMappingURL=styles-check.js.map
|
|
@@ -1,36 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
var __decorate =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
var __decorate =
|
|
3
|
+
(this && this.__decorate) ||
|
|
4
|
+
function (decorators, target, key, desc) {
|
|
5
|
+
var c = arguments.length,
|
|
6
|
+
r =
|
|
7
|
+
c < 3
|
|
8
|
+
? target
|
|
9
|
+
: desc === null
|
|
10
|
+
? (desc = Object.getOwnPropertyDescriptor(target, key))
|
|
11
|
+
: desc,
|
|
12
|
+
d;
|
|
13
|
+
if (typeof Reflect === 'object' && typeof Reflect.decorate === 'function')
|
|
14
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
15
|
+
else
|
|
16
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
17
|
+
if ((d = decorators[i]))
|
|
18
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
19
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20
|
+
};
|
|
21
|
+
var __metadata =
|
|
22
|
+
(this && this.__metadata) ||
|
|
23
|
+
function (k, v) {
|
|
24
|
+
if (typeof Reflect === 'object' && typeof Reflect.metadata === 'function')
|
|
25
|
+
return Reflect.metadata(k, v);
|
|
26
|
+
};
|
|
27
|
+
var __awaiter =
|
|
28
|
+
(this && this.__awaiter) ||
|
|
29
|
+
function (thisArg, _arguments, P, generator) {
|
|
30
|
+
function adopt(value) {
|
|
31
|
+
return value instanceof P
|
|
32
|
+
? value
|
|
33
|
+
: new P(function (resolve) {
|
|
34
|
+
resolve(value);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) {
|
|
39
|
+
try {
|
|
40
|
+
step(generator.next(value));
|
|
41
|
+
} catch (e) {
|
|
42
|
+
reject(e);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function rejected(value) {
|
|
46
|
+
try {
|
|
47
|
+
step(generator['throw'](value));
|
|
48
|
+
} catch (e) {
|
|
49
|
+
reject(e);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function step(result) {
|
|
53
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
54
|
+
}
|
|
55
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
21
59
|
exports.Tests = void 0;
|
|
22
|
-
const core_1 = require(
|
|
23
|
-
const utils_1 = require(
|
|
60
|
+
const core_1 = require('@jest/core');
|
|
61
|
+
const utils_1 = require('../../utils');
|
|
24
62
|
/**
|
|
25
63
|
* Named as tests to exclude it from the Jest pattern
|
|
26
64
|
*/
|
|
27
65
|
class Tests {
|
|
28
66
|
constructor(args) {
|
|
29
|
-
Object.defineProperty(this,
|
|
67
|
+
Object.defineProperty(this, 'args', {
|
|
30
68
|
enumerable: true,
|
|
31
69
|
configurable: true,
|
|
32
70
|
writable: true,
|
|
33
|
-
value: args
|
|
71
|
+
value: args,
|
|
34
72
|
});
|
|
35
73
|
}
|
|
36
74
|
description() {
|
|
@@ -39,7 +77,9 @@ class Tests {
|
|
|
39
77
|
execute() {
|
|
40
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
79
|
const jestConfig = (0, utils_1.getJestConfigCLI)(this.args);
|
|
42
|
-
const {
|
|
80
|
+
const {
|
|
81
|
+
results: { success },
|
|
82
|
+
} = yield (0, core_1.runCLI)(jestConfig, [process.cwd()]);
|
|
43
83
|
if (!success) {
|
|
44
84
|
// eslint-disable-next-line require-atomic-updates
|
|
45
85
|
process.exitCode = 1;
|
|
@@ -48,10 +88,15 @@ class Tests {
|
|
|
48
88
|
}
|
|
49
89
|
}
|
|
50
90
|
exports.Tests = Tests;
|
|
51
|
-
__decorate(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
91
|
+
__decorate(
|
|
92
|
+
[
|
|
93
|
+
utils_1.logErrors,
|
|
94
|
+
__metadata('design:type', Function),
|
|
95
|
+
__metadata('design:paramtypes', []),
|
|
96
|
+
__metadata('design:returntype', Promise),
|
|
97
|
+
],
|
|
98
|
+
Tests.prototype,
|
|
99
|
+
'execute',
|
|
100
|
+
null
|
|
101
|
+
);
|
|
102
|
+
//# sourceMappingURL=tests.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
|
package/dist/cli/index.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault =
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault =
|
|
3
|
+
(this && this.__importDefault) ||
|
|
4
|
+
function (mod) {
|
|
5
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
6
|
+
};
|
|
5
7
|
var _a;
|
|
6
|
-
Object.defineProperty(exports,
|
|
7
|
-
const execa_1 = __importDefault(require(
|
|
8
|
-
const yargs_1 = require(
|
|
9
|
-
const utils_1 = require(
|
|
10
|
-
const commands_1 = require(
|
|
11
|
-
const utils_2 = require(
|
|
12
|
-
const maybe_create_git_folder_1 = require(
|
|
8
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
|
+
const execa_1 = __importDefault(require('execa'));
|
|
10
|
+
const yargs_1 = require('yargs');
|
|
11
|
+
const utils_1 = require('../utils');
|
|
12
|
+
const commands_1 = require('./commands');
|
|
13
|
+
const utils_2 = require('./utils');
|
|
14
|
+
const maybe_create_git_folder_1 = require('./utils/maybe-create-git-folder');
|
|
13
15
|
const argvSync = yargs_1.argv;
|
|
14
16
|
const name = (_a = argvSync._[0]) === null || _a === void 0 ? void 0 : _a.toString();
|
|
15
17
|
if (!name) {
|
|
@@ -26,13 +28,16 @@ if (!Command) {
|
|
|
26
28
|
(0, maybe_create_git_folder_1.maybeCreateGitFolder)();
|
|
27
29
|
if ((0, utils_2.setNodeOptions)(name)) {
|
|
28
30
|
// Run command in child process with amended NODE_OPTIONS
|
|
29
|
-
(0, execa_1.default)(process.argv[0], process.argv.slice(1), { stdio: 'inherit' }).catch(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
31
|
+
(0, execa_1.default)(process.argv[0], process.argv.slice(1), { stdio: 'inherit' }).catch(
|
|
32
|
+
reason => {
|
|
33
|
+
process.exit(reason.exitCode);
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
} else {
|
|
34
37
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
35
|
-
const command = new Command(
|
|
38
|
+
const command = new Command(
|
|
39
|
+
Object.assign(Object.assign({}, argvSync), { _: argvSync._.slice(1) })
|
|
40
|
+
);
|
|
36
41
|
command.execute().catch(() => {
|
|
37
42
|
process.exit(1);
|
|
38
43
|
});
|
|
@@ -48,4 +53,4 @@ function usage() {
|
|
|
48
53
|
function write(text) {
|
|
49
54
|
return console.info(text); // eslint-disable-line no-console
|
|
50
55
|
}
|
|
51
|
-
//# sourceMappingURL=index.js.map
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,27 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
var __awaiter =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
var __awaiter =
|
|
3
|
+
(this && this.__awaiter) ||
|
|
4
|
+
function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) {
|
|
6
|
+
return value instanceof P
|
|
7
|
+
? value
|
|
8
|
+
: new P(function (resolve) {
|
|
9
|
+
resolve(value);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
13
|
+
function fulfilled(value) {
|
|
14
|
+
try {
|
|
15
|
+
step(generator.next(value));
|
|
16
|
+
} catch (e) {
|
|
17
|
+
reject(e);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function rejected(value) {
|
|
21
|
+
try {
|
|
22
|
+
step(generator['throw'](value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function step(result) {
|
|
28
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
29
|
+
}
|
|
30
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
var __importDefault =
|
|
34
|
+
(this && this.__importDefault) ||
|
|
35
|
+
function (mod) {
|
|
36
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
15
39
|
exports.assetsCopyWatch = exports.assetsCopy = void 0;
|
|
16
|
-
const cpx_1 = __importDefault(require(
|
|
17
|
-
const util_1 = __importDefault(require(
|
|
18
|
-
const utils_1 = require(
|
|
19
|
-
const _1 = require(
|
|
40
|
+
const cpx_1 = __importDefault(require('cpx'));
|
|
41
|
+
const util_1 = __importDefault(require('util'));
|
|
42
|
+
const utils_1 = require('../../utils');
|
|
43
|
+
const _1 = require('.');
|
|
20
44
|
function assetsCopy() {
|
|
21
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
46
|
const { source, destination } = (0, utils_1.getFolders)();
|
|
23
47
|
utils_1.log.info('Copying asset files...');
|
|
24
|
-
yield util_1.default.promisify(cpx_1.default.copy)(
|
|
48
|
+
yield util_1.default.promisify(cpx_1.default.copy)(
|
|
49
|
+
`${source}/**/*.{${_1.assetExtensions.join()}}`,
|
|
50
|
+
destination
|
|
51
|
+
);
|
|
25
52
|
});
|
|
26
53
|
}
|
|
27
54
|
exports.assetsCopy = assetsCopy;
|
|
@@ -29,11 +56,13 @@ function assetsCopyWatch() {
|
|
|
29
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
57
|
const { source, destination } = (0, utils_1.getFolders)();
|
|
31
58
|
yield new Promise((_0, reject) => {
|
|
32
|
-
cpx_1.default
|
|
33
|
-
|
|
34
|
-
|
|
59
|
+
cpx_1.default
|
|
60
|
+
.watch(`${source}/**/*.{${_1.assetExtensions.join()}}`, destination, {
|
|
61
|
+
initialCopy: false,
|
|
62
|
+
})
|
|
63
|
+
.on('watch-error', reject);
|
|
35
64
|
});
|
|
36
65
|
});
|
|
37
66
|
}
|
|
38
67
|
exports.assetsCopyWatch = assetsCopyWatch;
|
|
39
|
-
//# sourceMappingURL=assets-copy.js.map
|
|
68
|
+
//# sourceMappingURL=assets-copy.js.map
|