@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
package/dist/cli/utils/bundle.js
CHANGED
|
@@ -1,37 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
var __awaiter =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
-
var t = {};
|
|
13
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
-
t[p] = s[p];
|
|
15
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
-
t[p[i]] = s[p[i]];
|
|
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
|
+
});
|
|
19
11
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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 __rest =
|
|
34
|
+
(this && this.__rest) ||
|
|
35
|
+
function (s, e) {
|
|
36
|
+
var t = {};
|
|
37
|
+
for (var p in s)
|
|
38
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
39
|
+
if (s != null && typeof Object.getOwnPropertySymbols === 'function')
|
|
40
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
41
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
42
|
+
t[p[i]] = s[p[i]];
|
|
43
|
+
}
|
|
44
|
+
return t;
|
|
45
|
+
};
|
|
46
|
+
var __importDefault =
|
|
47
|
+
(this && this.__importDefault) ||
|
|
48
|
+
function (mod) {
|
|
49
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
50
|
+
};
|
|
51
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
52
|
+
exports.bundleWatch =
|
|
53
|
+
exports.bundle =
|
|
54
|
+
exports.webpackProdConfigFileName =
|
|
55
|
+
exports.webpackDevConfigFileName =
|
|
56
|
+
void 0;
|
|
57
|
+
const fs_1 = __importDefault(require('fs'));
|
|
58
|
+
const path_1 = __importDefault(require('path'));
|
|
59
|
+
const crypto_1 = __importDefault(require('crypto'));
|
|
60
|
+
const portfinder_1 = require('portfinder');
|
|
61
|
+
const webpack_1 = __importDefault(require('webpack'));
|
|
62
|
+
const webpack_dev_server_1 = __importDefault(require('webpack-dev-server'));
|
|
63
|
+
const utils_1 = require('../../utils');
|
|
64
|
+
const webpack_2 = require('../../webpack');
|
|
35
65
|
function getName() {
|
|
36
66
|
const packageName = (0, utils_1.getPackageName)()
|
|
37
67
|
.replace(/\//g, '-')
|
|
@@ -52,15 +82,30 @@ function bundle() {
|
|
|
52
82
|
const webpackOptions = { name, buildStat, codeCoverage, esbuild, experimentalBundlers };
|
|
53
83
|
if ((0, utils_1.isWebComponent)()) {
|
|
54
84
|
const webpackConfig = {
|
|
55
|
-
configuration: Object.assign(
|
|
85
|
+
configuration: Object.assign(
|
|
86
|
+
Object.assign(
|
|
87
|
+
{},
|
|
88
|
+
config === null || config === void 0 ? void 0 : config.configuration
|
|
89
|
+
),
|
|
90
|
+
{ mode }
|
|
91
|
+
),
|
|
56
92
|
plugins: config === null || config === void 0 ? void 0 : config.plugins,
|
|
57
93
|
};
|
|
58
94
|
return Promise.all([
|
|
59
|
-
run(
|
|
95
|
+
run(
|
|
96
|
+
(0, webpack_2.createWebpackConfig)(
|
|
97
|
+
webpackConfig,
|
|
98
|
+
Object.assign({ embed: true }, webpackOptions)
|
|
99
|
+
)
|
|
100
|
+
),
|
|
60
101
|
run((0, webpack_2.createWebpackConfig)(webpackConfig, webpackOptions)),
|
|
61
102
|
]);
|
|
62
103
|
}
|
|
63
|
-
return run(
|
|
104
|
+
return run(
|
|
105
|
+
config !== null && config !== void 0
|
|
106
|
+
? config
|
|
107
|
+
: (0, webpack_2.createWebpackConfig)({ configuration: { mode } }, webpackOptions)
|
|
108
|
+
);
|
|
64
109
|
});
|
|
65
110
|
}
|
|
66
111
|
exports.bundle = bundle;
|
|
@@ -69,30 +114,51 @@ function bundleWatch() {
|
|
|
69
114
|
utils_1.log.info('Bundling the package...');
|
|
70
115
|
const name = getName();
|
|
71
116
|
const mode = 'development';
|
|
72
|
-
const config = readWebpackConfig(
|
|
117
|
+
const config = readWebpackConfig(
|
|
118
|
+
Object.assign(Object.assign({}, options), {
|
|
119
|
+
fallback: `./${exports.webpackDevConfigFileName}`,
|
|
120
|
+
})
|
|
121
|
+
);
|
|
73
122
|
const { codeCoverage, esbuild, experimentalBundlers } = options;
|
|
74
123
|
if ((0, utils_1.isWebComponent)()) {
|
|
75
124
|
const webpackConfig = {
|
|
76
|
-
configuration: Object.assign(
|
|
125
|
+
configuration: Object.assign(
|
|
126
|
+
Object.assign(
|
|
127
|
+
{},
|
|
128
|
+
config === null || config === void 0 ? void 0 : config.configuration
|
|
129
|
+
),
|
|
130
|
+
{ mode }
|
|
131
|
+
),
|
|
77
132
|
plugins: config === null || config === void 0 ? void 0 : config.plugins,
|
|
78
133
|
};
|
|
79
134
|
return Promise.all([
|
|
80
|
-
runWatch(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
135
|
+
runWatch(
|
|
136
|
+
(0, webpack_2.createWebpackConfig)(webpackConfig, {
|
|
137
|
+
codeCoverage,
|
|
138
|
+
embed: true,
|
|
139
|
+
name,
|
|
140
|
+
esbuild,
|
|
141
|
+
experimentalBundlers,
|
|
142
|
+
})
|
|
143
|
+
),
|
|
144
|
+
runServe(
|
|
145
|
+
(0, webpack_2.createWebpackConfig)(webpackConfig, {
|
|
146
|
+
name,
|
|
147
|
+
codeCoverage,
|
|
148
|
+
esbuild,
|
|
149
|
+
experimentalBundlers,
|
|
150
|
+
})
|
|
151
|
+
),
|
|
93
152
|
]);
|
|
94
153
|
}
|
|
95
|
-
return runServe(
|
|
154
|
+
return runServe(
|
|
155
|
+
config !== null && config !== void 0
|
|
156
|
+
? config
|
|
157
|
+
: (0, webpack_2.createWebpackConfig)(
|
|
158
|
+
{ configuration: { mode } },
|
|
159
|
+
{ name, codeCoverage, esbuild, experimentalBundlers }
|
|
160
|
+
)
|
|
161
|
+
);
|
|
96
162
|
});
|
|
97
163
|
}
|
|
98
164
|
exports.bundleWatch = bundleWatch;
|
|
@@ -111,7 +177,11 @@ function run(config) {
|
|
|
111
177
|
const stats = yield new Promise((resolve, reject) => {
|
|
112
178
|
compiler.run((error, stats) => {
|
|
113
179
|
if (!stats || error) {
|
|
114
|
-
return reject(
|
|
180
|
+
return reject(
|
|
181
|
+
error !== null && error !== void 0
|
|
182
|
+
? error
|
|
183
|
+
: new Error('Something went wrong.')
|
|
184
|
+
);
|
|
115
185
|
}
|
|
116
186
|
if (stats.hasErrors()) {
|
|
117
187
|
return reject(stats.toString('errors-only'));
|
|
@@ -125,7 +195,8 @@ function run(config) {
|
|
|
125
195
|
function runServe(_a) {
|
|
126
196
|
return __awaiter(this, void 0, void 0, function* () {
|
|
127
197
|
var _b;
|
|
128
|
-
var { devServer = {} } = _a,
|
|
198
|
+
var { devServer = {} } = _a,
|
|
199
|
+
config = __rest(_a, ['devServer']);
|
|
129
200
|
const compiler = (0, webpack_1.default)(config);
|
|
130
201
|
const host = (_b = devServer.host) !== null && _b !== void 0 ? _b : 'localhost';
|
|
131
202
|
const port = yield (0, portfinder_1.getPortPromise)({
|
|
@@ -133,7 +204,10 @@ function runServe(_a) {
|
|
|
133
204
|
host,
|
|
134
205
|
});
|
|
135
206
|
return new Promise((_0, reject) => {
|
|
136
|
-
const server = new webpack_dev_server_1.default(
|
|
207
|
+
const server = new webpack_dev_server_1.default(
|
|
208
|
+
Object.assign(Object.assign({}, devServer), { host, port }),
|
|
209
|
+
compiler
|
|
210
|
+
);
|
|
137
211
|
server.startCallback(e => {
|
|
138
212
|
if (e) {
|
|
139
213
|
server.stopCallback(() => {
|
|
@@ -158,4 +232,4 @@ function runWatch(config) {
|
|
|
158
232
|
});
|
|
159
233
|
});
|
|
160
234
|
}
|
|
161
|
-
//# sourceMappingURL=bundle.js.map
|
|
235
|
+
//# sourceMappingURL=bundle.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.gitGetCommitHash = exports.gitGetBranch = void 0;
|
|
4
|
-
const cli_os_1 = require(
|
|
4
|
+
const cli_os_1 = require('./cli-os');
|
|
5
5
|
const gitGetBranch = () => {
|
|
6
6
|
return (0, cli_os_1.runCommandOutput)('git rev-parse --abbrev-ref HEAD').trim();
|
|
7
7
|
};
|
|
@@ -10,4 +10,4 @@ const gitGetCommitHash = () => {
|
|
|
10
10
|
return (0, cli_os_1.runCommandOutput)('git rev-parse --short HEAD').trim();
|
|
11
11
|
};
|
|
12
12
|
exports.gitGetCommitHash = gitGetCommitHash;
|
|
13
|
-
//# sourceMappingURL=cli-git.js.map
|
|
13
|
+
//# sourceMappingURL=cli-git.js.map
|
|
@@ -1,42 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
var __awaiter =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
34
|
+
exports.npmTagVersion =
|
|
35
|
+
exports.npmPackageSet =
|
|
36
|
+
exports.npmPublish =
|
|
37
|
+
exports.npmPublishDry =
|
|
38
|
+
exports.npmUnpublish =
|
|
39
|
+
exports.npmGetPackageVersionDates =
|
|
40
|
+
exports.npmGetPackageVersions =
|
|
41
|
+
void 0;
|
|
42
|
+
const cli_os_1 = require('./cli-os');
|
|
14
43
|
function npmGetPackageVersions(registry, packageName) {
|
|
15
44
|
try {
|
|
16
|
-
const v = (0, cli_os_1.runCommandOutput)(
|
|
45
|
+
const v = (0, cli_os_1.runCommandOutput)(
|
|
46
|
+
`npm show ${packageName} versions --registry ${registry} --json`,
|
|
47
|
+
{ timeout: 10000 }
|
|
48
|
+
);
|
|
17
49
|
return JSON.parse(v);
|
|
18
|
-
}
|
|
19
|
-
catch (_a) {
|
|
50
|
+
} catch (_a) {
|
|
20
51
|
return [];
|
|
21
52
|
}
|
|
22
53
|
}
|
|
23
54
|
exports.npmGetPackageVersions = npmGetPackageVersions;
|
|
24
55
|
function npmGetPackageVersionDates(registry, packageName) {
|
|
25
56
|
try {
|
|
26
|
-
const v = (0, cli_os_1.runCommandOutput)(
|
|
27
|
-
|
|
28
|
-
|
|
57
|
+
const v = (0, cli_os_1.runCommandOutput)(
|
|
58
|
+
`npm view ${packageName} time --registry ${registry} --json`,
|
|
59
|
+
{
|
|
60
|
+
timeout: 10000,
|
|
61
|
+
}
|
|
62
|
+
);
|
|
29
63
|
const map = JSON.parse(v);
|
|
30
|
-
return Object.keys(map).reduce(
|
|
31
|
-
|
|
32
|
-
|
|
64
|
+
return Object.keys(map).reduce(
|
|
65
|
+
(out, version) => [...out, [version, new Date(map[version])]],
|
|
66
|
+
[]
|
|
67
|
+
);
|
|
68
|
+
} catch (_a) {
|
|
33
69
|
return [];
|
|
34
70
|
}
|
|
35
71
|
}
|
|
36
72
|
exports.npmGetPackageVersionDates = npmGetPackageVersionDates;
|
|
37
73
|
function npmUnpublish(registry, packageName, packageVersion) {
|
|
38
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
-
yield (0,
|
|
75
|
+
yield (0,
|
|
76
|
+
cli_os_1.runCommand)(`npm unpublish ${packageName}@${packageVersion} --registry ${registry}`, {
|
|
40
77
|
timeout: 10000,
|
|
41
78
|
});
|
|
42
79
|
});
|
|
@@ -61,9 +98,18 @@ function npmPackageSet(key, value) {
|
|
|
61
98
|
}
|
|
62
99
|
exports.npmPackageSet = npmPackageSet;
|
|
63
100
|
function npmTagVersion(_a) {
|
|
64
|
-
return __awaiter(
|
|
65
|
-
|
|
66
|
-
|
|
101
|
+
return __awaiter(
|
|
102
|
+
this,
|
|
103
|
+
arguments,
|
|
104
|
+
void 0,
|
|
105
|
+
function* ({ packageName, packageVersion, registry, tag }) {
|
|
106
|
+
yield (0, cli_os_1.runCommand)(
|
|
107
|
+
`npm dist-tag ${
|
|
108
|
+
registry ? `--registry=${registry} ` : ''
|
|
109
|
+
}add ${packageName}@${packageVersion} ${tag}`
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
);
|
|
67
113
|
}
|
|
68
114
|
exports.npmTagVersion = npmTagVersion;
|
|
69
|
-
//# sourceMappingURL=cli-npm.js.map
|
|
115
|
+
//# sourceMappingURL=cli-npm.js.map
|
package/dist/cli/utils/cli-os.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.runCommandOutput = exports.runCommand = void 0;
|
|
4
|
-
const child_process_1 = require(
|
|
5
|
-
const utils_1 = require(
|
|
4
|
+
const child_process_1 = require('child_process');
|
|
5
|
+
const utils_1 = require('../../utils');
|
|
6
6
|
const runCommand = (command, opts) => {
|
|
7
7
|
return new Promise((resolve, reject) => {
|
|
8
8
|
const commandArray = Array.isArray(command)
|
|
9
9
|
? command
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
.filter(c => !!c)
|
|
11
|
+
.map(c => c.toString())
|
|
12
|
+
.join(' ')
|
|
13
|
+
.split(' ')
|
|
14
14
|
: command.split(' ');
|
|
15
15
|
const fullCommand = commandArray.join(' ');
|
|
16
16
|
const commandName = commandArray.shift();
|
|
@@ -26,8 +26,7 @@ const runCommand = (command, opts) => {
|
|
|
26
26
|
utils_1.log.info(`command finished with code ${code}`, fullCommand);
|
|
27
27
|
if (code) {
|
|
28
28
|
reject();
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
29
|
+
} else {
|
|
31
30
|
resolve();
|
|
32
31
|
}
|
|
33
32
|
});
|
|
@@ -37,10 +36,10 @@ exports.runCommand = runCommand;
|
|
|
37
36
|
const runCommandOutput = (command, options) => {
|
|
38
37
|
const commandArray = Array.isArray(command)
|
|
39
38
|
? command
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
.filter(c => !!c)
|
|
40
|
+
.map(c => c.toString())
|
|
41
|
+
.join(' ')
|
|
42
|
+
.split(' ')
|
|
44
43
|
: command.split(' ');
|
|
45
44
|
const fullCommand = commandArray.join(' ');
|
|
46
45
|
const commandName = commandArray.shift();
|
|
@@ -53,4 +52,4 @@ const runCommandOutput = (command, options) => {
|
|
|
53
52
|
return result;
|
|
54
53
|
};
|
|
55
54
|
exports.runCommandOutput = runCommandOutput;
|
|
56
|
-
//# sourceMappingURL=cli-os.js.map
|
|
55
|
+
//# sourceMappingURL=cli-os.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare function compileLess(filePath: string): Promise<string>;
|
|
2
|
-
//# sourceMappingURL=compile-less.d.ts.map
|
|
2
|
+
//# sourceMappingURL=compile-less.d.ts.map
|
|
@@ -1,21 +1,45 @@
|
|
|
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.compileLess = void 0;
|
|
16
|
-
const fs_1 = __importDefault(require(
|
|
17
|
-
const path_1 = __importDefault(require(
|
|
18
|
-
const less_1 = __importDefault(require(
|
|
40
|
+
const fs_1 = __importDefault(require('fs'));
|
|
41
|
+
const path_1 = __importDefault(require('path'));
|
|
42
|
+
const less_1 = __importDefault(require('less'));
|
|
19
43
|
const lessPackageImporter = require('less-plugin-npm-import');
|
|
20
44
|
function compileLess(filePath) {
|
|
21
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -28,4 +52,4 @@ function compileLess(filePath) {
|
|
|
28
52
|
});
|
|
29
53
|
}
|
|
30
54
|
exports.compileLess = compileLess;
|
|
31
|
-
//# sourceMappingURL=compile-less.js.map
|
|
55
|
+
//# sourceMappingURL=compile-less.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare function compileSass(filePath: string): Promise<string>;
|
|
2
|
-
//# sourceMappingURL=compile-sass.d.ts.map
|
|
2
|
+
//# sourceMappingURL=compile-sass.d.ts.map
|
|
@@ -1,20 +1,44 @@
|
|
|
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.compileSass = void 0;
|
|
16
|
-
const path_1 = __importDefault(require(
|
|
17
|
-
const sass_1 = __importDefault(require(
|
|
40
|
+
const path_1 = __importDefault(require('path'));
|
|
41
|
+
const sass_1 = __importDefault(require('sass'));
|
|
18
42
|
function compileSass(filePath) {
|
|
19
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
44
|
const loadPaths = [path_1.default.dirname(filePath), '../../node_modules', 'node_modules'];
|
|
@@ -23,4 +47,4 @@ function compileSass(filePath) {
|
|
|
23
47
|
});
|
|
24
48
|
}
|
|
25
49
|
exports.compileSass = compileSass;
|
|
26
|
-
//# sourceMappingURL=compile-sass.js.map
|
|
50
|
+
//# sourceMappingURL=compile-sass.js.map
|