@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,40 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
var __decorate =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
+
var __importDefault =
|
|
59
|
+
(this && this.__importDefault) ||
|
|
60
|
+
function (mod) {
|
|
61
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
62
|
+
};
|
|
63
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
24
64
|
exports.MFEPackageClean = exports.MFEPackagePublish = exports.MFEPublish = void 0;
|
|
25
|
-
const path_1 = __importDefault(require(
|
|
26
|
-
const utils_1 = require(
|
|
27
|
-
const utils_2 = require(
|
|
28
|
-
const cli_git_1 = require(
|
|
29
|
-
const cli_npm_1 = require(
|
|
30
|
-
const publish_1 = require(
|
|
65
|
+
const path_1 = __importDefault(require('path'));
|
|
66
|
+
const utils_1 = require('../../utils');
|
|
67
|
+
const utils_2 = require('../utils');
|
|
68
|
+
const cli_git_1 = require('../utils/cli-git');
|
|
69
|
+
const cli_npm_1 = require('../utils/cli-npm');
|
|
70
|
+
const publish_1 = require('../utils/publish');
|
|
31
71
|
class MFEPublish {
|
|
32
72
|
constructor(args) {
|
|
33
|
-
Object.defineProperty(this,
|
|
73
|
+
Object.defineProperty(this, 'args', {
|
|
34
74
|
enumerable: true,
|
|
35
75
|
configurable: true,
|
|
36
76
|
writable: true,
|
|
37
|
-
value: args
|
|
77
|
+
value: args,
|
|
38
78
|
});
|
|
39
79
|
}
|
|
40
80
|
description() {
|
|
@@ -43,16 +83,32 @@ class MFEPublish {
|
|
|
43
83
|
execute() {
|
|
44
84
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
85
|
var _a, _b;
|
|
46
|
-
let packages =
|
|
86
|
+
let packages =
|
|
87
|
+
(_a = (0, utils_1.splitPackagesByType)((0, utils_1.getPackages)())[
|
|
88
|
+
utils_1.PackageType.Webpack
|
|
89
|
+
]) !== null && _a !== void 0
|
|
90
|
+
? _a
|
|
91
|
+
: [];
|
|
47
92
|
packages = packages.filter(p => {
|
|
48
93
|
var _a;
|
|
49
|
-
const packageJson = (0, utils_1.readJson)(
|
|
50
|
-
|
|
94
|
+
const packageJson = (0, utils_1.readJson)(
|
|
95
|
+
path_1.default.join(p.location, 'package.json')
|
|
96
|
+
);
|
|
97
|
+
return (
|
|
98
|
+
((_a =
|
|
99
|
+
packageJson === null || packageJson === void 0
|
|
100
|
+
? void 0
|
|
101
|
+
: packageJson.cli) === null || _a === void 0
|
|
102
|
+
? void 0
|
|
103
|
+
: _a['web-component']) === true
|
|
104
|
+
);
|
|
51
105
|
});
|
|
52
106
|
if (this.args.scope) {
|
|
53
|
-
packages = packages.filter(p =>
|
|
54
|
-
|
|
55
|
-
|
|
107
|
+
packages = packages.filter(p =>
|
|
108
|
+
Array.isArray(this.args.scope)
|
|
109
|
+
? this.args.scope.includes(p.name)
|
|
110
|
+
: this.args.scope === p.name
|
|
111
|
+
);
|
|
56
112
|
}
|
|
57
113
|
if (!packages.length) {
|
|
58
114
|
throw new Error('no packages found for publication');
|
|
@@ -81,19 +137,24 @@ class MFEPublish {
|
|
|
81
137
|
}
|
|
82
138
|
}
|
|
83
139
|
exports.MFEPublish = MFEPublish;
|
|
84
|
-
__decorate(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
140
|
+
__decorate(
|
|
141
|
+
[
|
|
142
|
+
utils_1.logErrors,
|
|
143
|
+
__metadata('design:type', Function),
|
|
144
|
+
__metadata('design:paramtypes', []),
|
|
145
|
+
__metadata('design:returntype', Promise),
|
|
146
|
+
],
|
|
147
|
+
MFEPublish.prototype,
|
|
148
|
+
'execute',
|
|
149
|
+
null
|
|
150
|
+
);
|
|
90
151
|
class MFEPackagePublish {
|
|
91
152
|
constructor(args) {
|
|
92
|
-
Object.defineProperty(this,
|
|
153
|
+
Object.defineProperty(this, 'args', {
|
|
93
154
|
enumerable: true,
|
|
94
155
|
configurable: true,
|
|
95
156
|
writable: true,
|
|
96
|
-
value: args
|
|
157
|
+
value: args,
|
|
97
158
|
});
|
|
98
159
|
}
|
|
99
160
|
description() {
|
|
@@ -116,15 +177,21 @@ class MFEPackagePublish {
|
|
|
116
177
|
return;
|
|
117
178
|
}
|
|
118
179
|
if (!data.isBranchConfigured && !data.force) {
|
|
119
|
-
utils_1.log.info(
|
|
180
|
+
utils_1.log.info(
|
|
181
|
+
'branch is not configured for publishing, use --force flag to publish if needed'
|
|
182
|
+
);
|
|
120
183
|
return;
|
|
121
184
|
}
|
|
122
185
|
const versions = (0, cli_npm_1.npmGetPackageVersions)(data.registry, packageName);
|
|
123
186
|
const dryRunPrefix = data.dry ? '(dry-run) ' : '';
|
|
124
187
|
if (versions.includes(data.version)) {
|
|
125
|
-
utils_1.log.info(
|
|
188
|
+
utils_1.log.info(
|
|
189
|
+
`${dryRunPrefix}${packageName} version ${data.version} is already published, skipping publish`
|
|
190
|
+
);
|
|
126
191
|
if (data.tag) {
|
|
127
|
-
utils_1.log.info(
|
|
192
|
+
utils_1.log.info(
|
|
193
|
+
`${dryRunPrefix}adding tag "${data.tag}" to ${packageName} version ${data.version}`
|
|
194
|
+
);
|
|
128
195
|
if (!data.dry) {
|
|
129
196
|
yield (0, cli_npm_1.npmTagVersion)({
|
|
130
197
|
packageName,
|
|
@@ -144,8 +211,7 @@ class MFEPackagePublish {
|
|
|
144
211
|
}
|
|
145
212
|
if (data.dry) {
|
|
146
213
|
yield (0, cli_npm_1.npmPublishDry)();
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
214
|
+
} else {
|
|
149
215
|
yield (0, cli_npm_1.npmPublish)(data.tag);
|
|
150
216
|
}
|
|
151
217
|
utils_1.log.info(`${dryRunPrefix}published ${packageName} version ${data.version}`);
|
|
@@ -154,11 +220,15 @@ class MFEPackagePublish {
|
|
|
154
220
|
getPublishData() {
|
|
155
221
|
var _a, _b, _c;
|
|
156
222
|
const cli = this.args;
|
|
157
|
-
const branch =
|
|
223
|
+
const branch =
|
|
224
|
+
(_a = cli.branch) !== null && _a !== void 0 ? _a : (0, cli_git_1.gitGetBranch)();
|
|
158
225
|
const branchConfig = getBranchConfigs()[branch];
|
|
159
226
|
let buildVersion = cli.build;
|
|
160
227
|
if (!buildVersion) {
|
|
161
|
-
buildVersion = (0, publish_1.getDefaultBuildVersion)(
|
|
228
|
+
buildVersion = (0, publish_1.getDefaultBuildVersion)(
|
|
229
|
+
branch,
|
|
230
|
+
(0, cli_git_1.gitGetCommitHash)()
|
|
231
|
+
);
|
|
162
232
|
}
|
|
163
233
|
if (!buildVersion) {
|
|
164
234
|
throw new Error('build version is not set');
|
|
@@ -166,14 +236,21 @@ class MFEPackagePublish {
|
|
|
166
236
|
let tag;
|
|
167
237
|
if (cli.tag === false) {
|
|
168
238
|
tag = '';
|
|
169
|
-
}
|
|
170
|
-
else if (cli.tag) {
|
|
239
|
+
} else if (cli.tag) {
|
|
171
240
|
tag = cli.tag;
|
|
241
|
+
} else {
|
|
242
|
+
tag =
|
|
243
|
+
(_b =
|
|
244
|
+
branchConfig === null || branchConfig === void 0
|
|
245
|
+
? void 0
|
|
246
|
+
: branchConfig.tag) !== null && _b !== void 0
|
|
247
|
+
? _b
|
|
248
|
+
: '';
|
|
172
249
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
250
|
+
const registry =
|
|
251
|
+
(_c = cli.registry) !== null && _c !== void 0
|
|
252
|
+
? _c
|
|
253
|
+
: 'https://verdaccio.servicetitan.com';
|
|
177
254
|
return {
|
|
178
255
|
tag,
|
|
179
256
|
version: '0.0.0-' + buildVersion,
|
|
@@ -186,19 +263,24 @@ class MFEPackagePublish {
|
|
|
186
263
|
}
|
|
187
264
|
}
|
|
188
265
|
exports.MFEPackagePublish = MFEPackagePublish;
|
|
189
|
-
__decorate(
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
266
|
+
__decorate(
|
|
267
|
+
[
|
|
268
|
+
utils_1.logErrors,
|
|
269
|
+
__metadata('design:type', Function),
|
|
270
|
+
__metadata('design:paramtypes', []),
|
|
271
|
+
__metadata('design:returntype', Promise),
|
|
272
|
+
],
|
|
273
|
+
MFEPackagePublish.prototype,
|
|
274
|
+
'execute',
|
|
275
|
+
null
|
|
276
|
+
);
|
|
195
277
|
class MFEPackageClean {
|
|
196
278
|
constructor(args) {
|
|
197
|
-
Object.defineProperty(this,
|
|
279
|
+
Object.defineProperty(this, 'args', {
|
|
198
280
|
enumerable: true,
|
|
199
281
|
configurable: true,
|
|
200
282
|
writable: true,
|
|
201
|
-
value: args
|
|
283
|
+
value: args,
|
|
202
284
|
});
|
|
203
285
|
}
|
|
204
286
|
description() {
|
|
@@ -213,7 +295,10 @@ class MFEPackageClean {
|
|
|
213
295
|
const packageJson = (0, utils_1.readJson)('package.json');
|
|
214
296
|
const packageName = packageJson.name;
|
|
215
297
|
const branchedVersions = this.getBranchedVersions(packageName, data.registry);
|
|
216
|
-
utils_1.log.info(
|
|
298
|
+
utils_1.log.info(
|
|
299
|
+
`branched versions (${data.count}):`,
|
|
300
|
+
JSON.stringify(branchedVersions, undefined, 4)
|
|
301
|
+
);
|
|
217
302
|
const branchedVersionsToClean = {};
|
|
218
303
|
for (const branch of Object.keys(branchedVersions)) {
|
|
219
304
|
// limit branches for now
|
|
@@ -223,14 +308,19 @@ class MFEPackageClean {
|
|
|
223
308
|
branchedVersions[branch].sort(([, adt], [, bdt]) => (adt > bdt ? -1 : 1));
|
|
224
309
|
branchedVersionsToClean[branch] = branchedVersions[branch].slice(data.count);
|
|
225
310
|
}
|
|
226
|
-
utils_1.log.info(
|
|
227
|
-
|
|
311
|
+
utils_1.log.info(
|
|
312
|
+
'found versions for unpublish:',
|
|
313
|
+
JSON.stringify(branchedVersionsToClean, undefined, 4)
|
|
314
|
+
);
|
|
315
|
+
const unVersions = Object.keys(branchedVersionsToClean).reduce(
|
|
316
|
+
(out, br) => [...out, ...branchedVersionsToClean[br].map(([v]) => v)],
|
|
317
|
+
[]
|
|
318
|
+
);
|
|
228
319
|
for (const version of unVersions) {
|
|
229
320
|
try {
|
|
230
321
|
// eslint-disable-next-line no-await-in-loop
|
|
231
322
|
yield (0, cli_npm_1.npmUnpublish)(data.registry, packageName, version);
|
|
232
|
-
}
|
|
233
|
-
catch (_a) {
|
|
323
|
+
} catch (_a) {
|
|
234
324
|
utils_1.log.error(`error while removing ${packageName} version ${version}`);
|
|
235
325
|
}
|
|
236
326
|
}
|
|
@@ -264,7 +354,9 @@ class MFEPackageClean {
|
|
|
264
354
|
addVersion('master', version, dt);
|
|
265
355
|
continue;
|
|
266
356
|
}
|
|
267
|
-
const match1 = buildVersion.match(
|
|
357
|
+
const match1 = buildVersion.match(
|
|
358
|
+
/^(\d+)\.(\d+)\.(\d+)-([\dA-Za-z\-]+).([\dA-Za-z]+)$/
|
|
359
|
+
);
|
|
268
360
|
if (match1 === null || match1 === void 0 ? void 0 : match1.length) {
|
|
269
361
|
// branch version generated by nerdbank versioning
|
|
270
362
|
addVersion(match1[4], version, dt);
|
|
@@ -285,12 +377,17 @@ class MFEPackageClean {
|
|
|
285
377
|
}
|
|
286
378
|
}
|
|
287
379
|
exports.MFEPackageClean = MFEPackageClean;
|
|
288
|
-
__decorate(
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
380
|
+
__decorate(
|
|
381
|
+
[
|
|
382
|
+
utils_1.logErrors,
|
|
383
|
+
__metadata('design:type', Function),
|
|
384
|
+
__metadata('design:paramtypes', []),
|
|
385
|
+
__metadata('design:returntype', Promise),
|
|
386
|
+
],
|
|
387
|
+
MFEPackageClean.prototype,
|
|
388
|
+
'execute',
|
|
389
|
+
null
|
|
390
|
+
);
|
|
294
391
|
const getBranchConfigs = () => {
|
|
295
392
|
// ToDo: add ability to configure it in a package.json
|
|
296
393
|
return {
|
|
@@ -300,4 +397,4 @@ const getBranchConfigs = () => {
|
|
|
300
397
|
master: { tag: 'prod' },
|
|
301
398
|
};
|
|
302
399
|
};
|
|
303
|
-
//# sourceMappingURL=mfe-publish.js.map
|
|
400
|
+
//# sourceMappingURL=mfe-publish.js.map
|
|
@@ -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.PreparePackage = 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 PreparePackage {
|
|
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() {
|
|
@@ -36,11 +74,17 @@ class PreparePackage {
|
|
|
36
74
|
execute() {
|
|
37
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
76
|
if (!this.args.watch) {
|
|
39
|
-
yield Promise.all([...(!(0, utils_1.isBundle)() ? [(0, utils_2.assetsCopy)(), (0, utils_2.stylesCopy)()] : []), (0, utils_2.tcm)()]);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
77
|
yield Promise.all([
|
|
43
|
-
...(!(0, utils_1.isBundle)()
|
|
78
|
+
...(!(0, utils_1.isBundle)()
|
|
79
|
+
? [(0, utils_2.assetsCopy)(), (0, utils_2.stylesCopy)()]
|
|
80
|
+
: []),
|
|
81
|
+
(0, utils_2.tcm)(),
|
|
82
|
+
]);
|
|
83
|
+
} else {
|
|
84
|
+
yield Promise.all([
|
|
85
|
+
...(!(0, utils_1.isBundle)()
|
|
86
|
+
? [(0, utils_2.assetsCopyWatch)(), (0, utils_2.stylesCopyWatch)()]
|
|
87
|
+
: []),
|
|
44
88
|
(0, utils_2.tcmWatch)(),
|
|
45
89
|
]);
|
|
46
90
|
}
|
|
@@ -48,10 +92,15 @@ class PreparePackage {
|
|
|
48
92
|
}
|
|
49
93
|
}
|
|
50
94
|
exports.PreparePackage = PreparePackage;
|
|
51
|
-
__decorate(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
95
|
+
__decorate(
|
|
96
|
+
[
|
|
97
|
+
utils_1.logErrors,
|
|
98
|
+
__metadata('design:type', Function),
|
|
99
|
+
__metadata('design:paramtypes', []),
|
|
100
|
+
__metadata('design:returntype', Promise),
|
|
101
|
+
],
|
|
102
|
+
PreparePackage.prototype,
|
|
103
|
+
'execute',
|
|
104
|
+
null
|
|
105
|
+
);
|
|
106
|
+
//# sourceMappingURL=prepare-package.js.map
|