@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/tcm.js
CHANGED
|
@@ -1,23 +1,47 @@
|
|
|
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.tcmWatch = exports.tcm = void 0;
|
|
16
|
-
const glob_1 = require(
|
|
17
|
-
const chokidar_1 = __importDefault(require(
|
|
18
|
-
const typed_css_modules_1 = __importDefault(require(
|
|
19
|
-
const utils_1 = require(
|
|
20
|
-
const _1 = require(
|
|
40
|
+
const glob_1 = require('glob');
|
|
41
|
+
const chokidar_1 = __importDefault(require('chokidar'));
|
|
42
|
+
const typed_css_modules_1 = __importDefault(require('typed-css-modules'));
|
|
43
|
+
const utils_1 = require('../../utils');
|
|
44
|
+
const _1 = require('.');
|
|
21
45
|
function compile(filePath) {
|
|
22
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
47
|
if (filePath.endsWith('.less')) {
|
|
@@ -31,32 +55,34 @@ function compile(filePath) {
|
|
|
31
55
|
function run() {
|
|
32
56
|
return __awaiter(this, arguments, void 0, function* ({ watch } = {}) {
|
|
33
57
|
const { source } = (0, utils_1.getFolders)();
|
|
34
|
-
const filesPattern = `${source}/**/*.module.{${_1.styleExtensions.join()}}`.replace(
|
|
58
|
+
const filesPattern = `${source}/**/*.module.{${_1.styleExtensions.join()}}`.replace(
|
|
59
|
+
/\\/g,
|
|
60
|
+
'/'
|
|
61
|
+
);
|
|
35
62
|
const creator = new typed_css_modules_1.default({
|
|
36
63
|
camelCase: true,
|
|
37
64
|
namedExports: true,
|
|
38
65
|
});
|
|
39
|
-
const writeFile =
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
66
|
+
const writeFile = filePath =>
|
|
67
|
+
__awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
try {
|
|
69
|
+
const initialContents = yield compile(filePath);
|
|
70
|
+
const content = yield creator.create(filePath, initialContents, !!watch);
|
|
71
|
+
yield content.writeFile();
|
|
72
|
+
} catch (error) {
|
|
73
|
+
utils_1.log.error(String(error));
|
|
74
|
+
}
|
|
75
|
+
});
|
|
49
76
|
if (!watch) {
|
|
50
77
|
const files = yield (0, glob_1.glob)(filesPattern);
|
|
51
78
|
yield Promise.all(files.map(writeFile));
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
79
|
+
} else {
|
|
54
80
|
utils_1.log.info('Watch ' + filesPattern + '...');
|
|
55
81
|
const watcher = chokidar_1.default.watch([filesPattern], { ignoreInitial: true });
|
|
56
82
|
watcher.on('add', writeFile);
|
|
57
83
|
watcher.on('change', writeFile);
|
|
58
84
|
if (process.env.NODE_ENV !== 'test') {
|
|
59
|
-
yield new Promise(() => {
|
|
85
|
+
yield new Promise(() => {});
|
|
60
86
|
}
|
|
61
87
|
}
|
|
62
88
|
});
|
|
@@ -74,4 +100,4 @@ function tcmWatch() {
|
|
|
74
100
|
});
|
|
75
101
|
}
|
|
76
102
|
exports.tcmWatch = tcmWatch;
|
|
77
|
-
//# sourceMappingURL=tcm.js.map
|
|
103
|
+
//# sourceMappingURL=tcm.js.map
|
package/dist/cli/utils/tsc.js
CHANGED
|
@@ -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.tscWatch = exports.tsc = void 0;
|
|
16
|
-
const execa_1 = __importDefault(require(
|
|
17
|
-
const utils_1 = require(
|
|
40
|
+
const execa_1 = __importDefault(require('execa'));
|
|
41
|
+
const utils_1 = require('../../utils');
|
|
18
42
|
function tsc(packages) {
|
|
19
43
|
utils_1.log.info('Building TypeScript files...');
|
|
20
44
|
return transpile(packages);
|
|
@@ -39,7 +63,11 @@ function transpile(packages_1) {
|
|
|
39
63
|
* Exclude dependant packages as they will be built through project references
|
|
40
64
|
*/
|
|
41
65
|
function collapsePackages(packages) {
|
|
42
|
-
const dependencies = new Set(
|
|
66
|
+
const dependencies = new Set(
|
|
67
|
+
Object.values(
|
|
68
|
+
(0, utils_1.getPackagesGraph)({ scope: packages.map(({ name }) => name) })
|
|
69
|
+
).flat()
|
|
70
|
+
);
|
|
43
71
|
return packages.filter(({ name }) => !dependencies.has(name));
|
|
44
72
|
}
|
|
45
|
-
//# sourceMappingURL=tsc.js.map
|
|
73
|
+
//# sourceMappingURL=tsc.js.map
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./webpack"), exports);
|
|
18
18
|
__exportStar(require("./jest"), exports);
|
|
19
|
+
__exportStar(require("./utils/get-packages"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,yCAAuB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,yCAAuB;AACvB,uDAAqC"}
|
package/dist/jest/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.createJestConfig = void 0;
|
|
4
|
-
const utils_1 = require(
|
|
4
|
+
const utils_1 = require('../utils');
|
|
5
5
|
function createJestConfig() {
|
|
6
6
|
return (0, utils_1.getJestConfig)();
|
|
7
7
|
}
|
|
8
8
|
exports.createJestConfig = createJestConfig;
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
package/dist/utils/debug.d.ts
CHANGED
package/dist/utils/debug.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
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.createDebug = void 0;
|
|
7
|
-
const debug_1 = __importDefault(require(
|
|
9
|
+
const debug_1 = __importDefault(require('debug'));
|
|
8
10
|
const CONTEXT = 'startup';
|
|
9
11
|
function createDebug(namespace) {
|
|
10
12
|
const result = (0, debug_1.default)(CONTEXT).extend(namespace);
|
|
@@ -16,4 +18,4 @@ function createDebug(namespace) {
|
|
|
16
18
|
});
|
|
17
19
|
}
|
|
18
20
|
exports.createDebug = createDebug;
|
|
19
|
-
//# sourceMappingURL=debug.js.map
|
|
21
|
+
//# sourceMappingURL=debug.js.map
|
|
@@ -1,13 +1,15 @@
|
|
|
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.findPackages = void 0;
|
|
7
|
-
const glob_1 = require(
|
|
8
|
-
const path_1 = __importDefault(require(
|
|
9
|
-
const read_json_1 = require(
|
|
10
|
-
const log_1 = require(
|
|
9
|
+
const glob_1 = require('glob');
|
|
10
|
+
const path_1 = __importDefault(require('path'));
|
|
11
|
+
const read_json_1 = require('./read-json');
|
|
12
|
+
const log_1 = require('./log');
|
|
11
13
|
function findPackages() {
|
|
12
14
|
const workspaces = findWorkspaces();
|
|
13
15
|
if (!workspaces) {
|
|
@@ -16,13 +18,18 @@ function findPackages() {
|
|
|
16
18
|
const result = workspaces
|
|
17
19
|
.flatMap(pattern => (0, glob_1.globSync)(pattern))
|
|
18
20
|
.map(location => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const dir = path_1.default.resolve(location);
|
|
22
|
+
const file = path_1.default.join(dir, 'package.json');
|
|
23
|
+
return Object.assign(Object.assign({}, (0, read_json_1.readJsonSafe)(file)), {
|
|
24
|
+
location: dir,
|
|
25
|
+
});
|
|
26
|
+
})
|
|
23
27
|
.filter(({ name }) => name !== undefined);
|
|
24
28
|
/* istanbul ignore next: debug only */
|
|
25
|
-
log_1.log.debug(
|
|
29
|
+
log_1.log.debug(
|
|
30
|
+
`find-packages`,
|
|
31
|
+
() => `found packages: ${JSON.stringify(result.map(({ name }) => name))}`
|
|
32
|
+
);
|
|
26
33
|
return result;
|
|
27
34
|
}
|
|
28
35
|
exports.findPackages = findPackages;
|
|
@@ -32,21 +39,31 @@ function findWorkspaces() {
|
|
|
32
39
|
do {
|
|
33
40
|
const packageJson = path_1.default.resolve(path_1.default.join(directory, 'package.json'));
|
|
34
41
|
log_1.log.debug('find-packages', `reading: ${packageJson}`);
|
|
35
|
-
let workspaces =
|
|
42
|
+
let workspaces =
|
|
43
|
+
(_a = (0, read_json_1.readJsonSafe)(packageJson)) === null || _a === void 0
|
|
44
|
+
? void 0
|
|
45
|
+
: _a.workspaces;
|
|
36
46
|
if (!workspaces) {
|
|
37
47
|
const lernaJson = path_1.default.resolve(path_1.default.join(directory, 'lerna.json'));
|
|
38
48
|
log_1.log.debug('find-packages', `reading: ${lernaJson}`);
|
|
39
|
-
workspaces =
|
|
49
|
+
workspaces =
|
|
50
|
+
(_b = (0, read_json_1.readJsonSafe)(lernaJson)) === null || _b === void 0
|
|
51
|
+
? void 0
|
|
52
|
+
: _b.packages;
|
|
40
53
|
}
|
|
41
54
|
if (workspaces) {
|
|
42
55
|
workspaces = workspaces.map(
|
|
43
|
-
|
|
44
|
-
|
|
56
|
+
// Note, glob requires "/" as path separator, even on Windows
|
|
57
|
+
workspace => path_1.default.join(directory, workspace).replace(/\\/g, '/')
|
|
58
|
+
);
|
|
45
59
|
/* istanbul ignore next: debug only */
|
|
46
|
-
log_1.log.debug(
|
|
60
|
+
log_1.log.debug(
|
|
61
|
+
'find-packages',
|
|
62
|
+
() => `found workspaces: ${JSON.stringify(workspaces)}`
|
|
63
|
+
);
|
|
47
64
|
return workspaces;
|
|
48
65
|
}
|
|
49
66
|
directory = path_1.default.resolve(path_1.default.join(directory, '../'));
|
|
50
67
|
} while (path_1.default.parse(directory).name);
|
|
51
68
|
}
|
|
52
|
-
//# sourceMappingURL=find-packages.js.map
|
|
69
|
+
//# sourceMappingURL=find-packages.js.map
|
|
@@ -1,12 +1,14 @@
|
|
|
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.getDestinationFolders = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require(
|
|
8
|
-
const path_1 = __importDefault(require(
|
|
9
|
-
const _1 = require(
|
|
9
|
+
const fs_1 = __importDefault(require('fs'));
|
|
10
|
+
const path_1 = __importDefault(require('path'));
|
|
11
|
+
const _1 = require('.');
|
|
10
12
|
/**
|
|
11
13
|
* Returns compilation targets for all packages
|
|
12
14
|
*/
|
|
@@ -14,20 +16,23 @@ function getDestinationFolders() {
|
|
|
14
16
|
const packages = (0, _1.getPackages)();
|
|
15
17
|
return packages
|
|
16
18
|
.map(({ location }) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
var _a;
|
|
20
|
+
const tsConfigPath = path_1.default.join(location, 'tsconfig.json');
|
|
21
|
+
if (!fs_1.default.existsSync(tsConfigPath)) {
|
|
22
|
+
return '';
|
|
23
|
+
}
|
|
24
|
+
const { outDir } =
|
|
25
|
+
(_a = (0, _1.readJson)(tsConfigPath).compilerOptions) !== null && _a !== void 0
|
|
26
|
+
? _a
|
|
27
|
+
: {};
|
|
28
|
+
if (!outDir) {
|
|
29
|
+
return '';
|
|
30
|
+
}
|
|
31
|
+
return path_1.default
|
|
32
|
+
.join('/', path_1.default.relative(process.cwd(), location), outDir, '/')
|
|
33
|
+
.replace(/\\/g, '/');
|
|
34
|
+
})
|
|
30
35
|
.filter(path => !!path);
|
|
31
36
|
}
|
|
32
37
|
exports.getDestinationFolders = getDestinationFolders;
|
|
33
|
-
//# sourceMappingURL=get-destination-folders.js.map
|
|
38
|
+
//# sourceMappingURL=get-destination-folders.js.map
|
|
@@ -1,17 +1,23 @@
|
|
|
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.getFolders = void 0;
|
|
7
|
-
const path_1 = __importDefault(require(
|
|
8
|
-
const _1 = require(
|
|
9
|
+
const path_1 = __importDefault(require('path'));
|
|
10
|
+
const _1 = require('.');
|
|
9
11
|
/**
|
|
10
12
|
* Returns folders of sources and compilation target
|
|
11
13
|
*/
|
|
12
14
|
function getFolders(location = './') {
|
|
13
15
|
var _a;
|
|
14
|
-
const { rootDir, outDir } =
|
|
16
|
+
const { rootDir, outDir } =
|
|
17
|
+
(_a = (0, _1.readJson)(path_1.default.join(location, 'tsconfig.json')).compilerOptions) !==
|
|
18
|
+
null && _a !== void 0
|
|
19
|
+
? _a
|
|
20
|
+
: {};
|
|
15
21
|
if (!rootDir) {
|
|
16
22
|
throw '"compilerOptions.rootDir" must be defined in the "tsconfig.json"!';
|
|
17
23
|
}
|
|
@@ -24,4 +30,4 @@ function getFolders(location = './') {
|
|
|
24
30
|
};
|
|
25
31
|
}
|
|
26
32
|
exports.getFolders = getFolders;
|
|
27
|
-
//# sourceMappingURL=get-folders.js.map
|
|
33
|
+
//# sourceMappingURL=get-folders.js.map
|
|
@@ -1,25 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
var __rest =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
t
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
var __rest =
|
|
3
|
+
(this && this.__rest) ||
|
|
4
|
+
function (s, e) {
|
|
5
|
+
var t = {};
|
|
6
|
+
for (var p in s)
|
|
7
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
8
|
+
if (s != null && typeof Object.getOwnPropertySymbols === 'function')
|
|
9
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
10
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
11
|
+
t[p[i]] = s[p[i]];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
var __importDefault =
|
|
16
|
+
(this && this.__importDefault) ||
|
|
17
|
+
function (mod) {
|
|
18
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
17
21
|
exports.getJestConfigCLI = exports.getJestConfig = void 0;
|
|
18
|
-
const path_1 = __importDefault(require(
|
|
19
|
-
const get_configuration_1 = require(
|
|
20
|
-
const get_destination_folders_1 = require(
|
|
21
|
-
const to_array_1 = require(
|
|
22
|
-
const getJestConfigBase = ({
|
|
22
|
+
const path_1 = __importDefault(require('path'));
|
|
23
|
+
const get_configuration_1 = require('./get-configuration');
|
|
24
|
+
const get_destination_folders_1 = require('./get-destination-folders');
|
|
25
|
+
const to_array_1 = require('./to-array');
|
|
26
|
+
const getJestConfigBase = ({
|
|
27
|
+
coveragePathIgnorePatterns = [],
|
|
28
|
+
setupFiles = [],
|
|
29
|
+
testPathIgnorePatterns = [],
|
|
30
|
+
}) => {
|
|
23
31
|
const transform = {
|
|
24
32
|
'^.+\\.jsx?$': [
|
|
25
33
|
'babel-jest',
|
|
@@ -43,7 +51,10 @@ const getJestConfigBase = ({ coveragePathIgnorePatterns = [], setupFiles = [], t
|
|
|
43
51
|
...(0, get_destination_folders_1.getDestinationFolders)(),
|
|
44
52
|
...(0, to_array_1.toArray)(testPathIgnorePatterns),
|
|
45
53
|
],
|
|
46
|
-
setupFiles: [
|
|
54
|
+
setupFiles: [
|
|
55
|
+
path_1.default.join(__dirname, '../../jest/setup.js'),
|
|
56
|
+
...(0, to_array_1.toArray)(setupFiles),
|
|
57
|
+
],
|
|
47
58
|
coveragePathIgnorePatterns: ['^.+\\.d\\.ts$', ...coveragePathIgnorePatterns],
|
|
48
59
|
coverageReporters: ['html-spa', 'text', 'json', 'cobertura', 'lcov'],
|
|
49
60
|
collectCoverageFrom: ['**/*.{ts,tsx}'],
|
|
@@ -54,25 +65,56 @@ const getJestConfigBase = ({ coveragePathIgnorePatterns = [], setupFiles = [], t
|
|
|
54
65
|
* Jest config files.
|
|
55
66
|
*/
|
|
56
67
|
const getJestConfig = () => {
|
|
57
|
-
const _a = (0, get_configuration_1.getJestConfiguration)(),
|
|
58
|
-
|
|
59
|
-
coveragePathIgnorePatterns,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
68
|
+
const _a = (0, get_configuration_1.getJestConfiguration)(),
|
|
69
|
+
{ coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns } = _a,
|
|
70
|
+
config = __rest(_a, ['coveragePathIgnorePatterns', 'setupFiles', 'testPathIgnorePatterns']);
|
|
71
|
+
return Object.assign(
|
|
72
|
+
Object.assign(
|
|
73
|
+
{},
|
|
74
|
+
getJestConfigBase({
|
|
75
|
+
coveragePathIgnorePatterns,
|
|
76
|
+
setupFiles,
|
|
77
|
+
testPathIgnorePatterns,
|
|
78
|
+
})
|
|
79
|
+
),
|
|
80
|
+
config
|
|
81
|
+
);
|
|
63
82
|
};
|
|
64
83
|
exports.getJestConfig = getJestConfig;
|
|
65
84
|
/**
|
|
66
85
|
* Get Jest config for running it using jest CLI (see jest runCLI function)
|
|
67
86
|
*/
|
|
68
|
-
const getJestConfigCLI =
|
|
69
|
-
const _a = Object.assign(
|
|
87
|
+
const getJestConfigCLI = args => {
|
|
88
|
+
const _a = Object.assign(
|
|
89
|
+
Object.assign({}, (0, get_configuration_1.getJestConfiguration)()),
|
|
90
|
+
args
|
|
91
|
+
),
|
|
92
|
+
{ coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns, globals } = _a,
|
|
93
|
+
config = __rest(_a, [
|
|
94
|
+
'coveragePathIgnorePatterns',
|
|
95
|
+
'setupFiles',
|
|
96
|
+
'testPathIgnorePatterns',
|
|
97
|
+
'globals',
|
|
98
|
+
]);
|
|
70
99
|
const _b = getJestConfigBase({
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
100
|
+
coveragePathIgnorePatterns,
|
|
101
|
+
setupFiles,
|
|
102
|
+
testPathIgnorePatterns,
|
|
103
|
+
}),
|
|
104
|
+
{ collectCoverageFrom, moduleNameMapper, transform } = _b,
|
|
105
|
+
rest = __rest(_b, ['collectCoverageFrom', 'moduleNameMapper', 'transform']);
|
|
106
|
+
return Object.assign(
|
|
107
|
+
Object.assign(
|
|
108
|
+
{
|
|
109
|
+
collectCoverageFrom: JSON.stringify(collectCoverageFrom),
|
|
110
|
+
globals: JSON.stringify(globals),
|
|
111
|
+
moduleNameMapper: JSON.stringify(moduleNameMapper),
|
|
112
|
+
transform: JSON.stringify(transform),
|
|
113
|
+
},
|
|
114
|
+
rest
|
|
115
|
+
),
|
|
116
|
+
config
|
|
117
|
+
);
|
|
76
118
|
};
|
|
77
119
|
exports.getJestConfigCLI = getJestConfigCLI;
|
|
78
|
-
//# sourceMappingURL=get-jest-config.js.map
|
|
120
|
+
//# sourceMappingURL=get-jest-config.js.map
|
|
@@ -3,5 +3,8 @@ export declare function getPackageData(): {
|
|
|
3
3
|
dependencies: Record<string, string>;
|
|
4
4
|
sharedDependencies?: Record<string, string>;
|
|
5
5
|
};
|
|
6
|
-
export declare function getPackageDependencyVersion(
|
|
7
|
-
|
|
6
|
+
export declare function getPackageDependencyVersion(
|
|
7
|
+
dependency: string,
|
|
8
|
+
defaultVersion?: string
|
|
9
|
+
): any;
|
|
10
|
+
//# sourceMappingURL=get-package-data.d.ts.map
|