@servicetitan/startup 22.20.0 → 23.0.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/cli/utils/compile-sass.d.ts +1 -1
- package/dist/cli/utils/compile-sass.d.ts.map +1 -1
- package/dist/cli/utils/compile-sass.js +13 -5
- package/dist/cli/utils/compile-sass.js.map +1 -1
- package/dist/cli/utils/tcm.d.ts.map +1 -1
- package/dist/cli/utils/tcm.js +14 -7
- package/dist/cli/utils/tcm.js.map +1 -1
- package/dist/cli/utils/tsc.js +4 -2
- package/dist/cli/utils/tsc.js.map +1 -1
- package/dist/utils/get-jest-config.d.ts.map +1 -1
- package/dist/utils/get-jest-config.js +19 -14
- package/dist/utils/get-jest-config.js.map +1 -1
- package/dist/webpack/configs/amd-config.d.ts +6 -0
- package/dist/webpack/configs/amd-config.d.ts.map +1 -0
- package/dist/webpack/configs/amd-config.js +8 -0
- package/dist/webpack/configs/amd-config.js.map +1 -0
- package/dist/webpack/configs/dev-server-config.d.ts.map +1 -1
- package/dist/webpack/configs/dev-server-config.js +1 -5
- package/dist/webpack/configs/dev-server-config.js.map +1 -1
- package/dist/webpack/configs/index.d.ts +1 -0
- package/dist/webpack/configs/index.d.ts.map +1 -1
- package/dist/webpack/configs/index.js +1 -0
- package/dist/webpack/configs/index.js.map +1 -1
- package/dist/webpack/configs/utils/generate-metadata.d.ts.map +1 -1
- package/dist/webpack/configs/utils/generate-metadata.js +5 -1
- package/dist/webpack/configs/utils/generate-metadata.js.map +1 -1
- package/dist/webpack/configs/utils/get-web-components-version.d.ts +2 -0
- package/dist/webpack/configs/utils/get-web-components-version.d.ts.map +1 -0
- package/dist/webpack/configs/utils/get-web-components-version.js +13 -0
- package/dist/webpack/configs/utils/get-web-components-version.js.map +1 -0
- package/dist/webpack/create-webpack-config.d.ts.map +1 -1
- package/dist/webpack/create-webpack-config.js +1 -0
- package/dist/webpack/create-webpack-config.js.map +1 -1
- package/dist/webpack/utils/testing/normalize-errors.js +1 -1
- package/dist/webpack/utils/testing/normalize-errors.js.map +1 -1
- package/package.json +14 -13
- package/src/cli/utils/__tests__/tcm.test.ts +15 -6
- package/src/cli/utils/__tests__/tsc.test.ts +1 -1
- package/src/cli/utils/compile-sass.ts +3 -7
- package/src/cli/utils/tcm.ts +13 -11
- package/src/cli/utils/tsc.ts +7 -9
- package/src/utils/__tests__/get-jest-config.test.ts +16 -39
- package/src/utils/get-jest-config.ts +33 -46
- package/src/webpack/__tests__/create-webpack-config.test.ts +5 -1
- package/src/webpack/configs/amd-config.ts +8 -0
- package/src/webpack/configs/dev-server-config.ts +2 -9
- package/src/webpack/configs/index.ts +1 -0
- package/src/webpack/configs/utils/__tests__/generate-metadata.test.ts +8 -1
- package/src/webpack/configs/utils/__tests__/get-web-components-version.test.ts +25 -0
- package/src/webpack/configs/utils/generate-metadata.ts +5 -1
- package/src/webpack/configs/utils/get-web-components-version.ts +8 -0
- package/src/webpack/create-webpack-config.ts +2 -0
- package/src/webpack/loaders/expose-loader/__tests__/__snapshots__/index.test.ts.snap +14 -14
- package/src/webpack/utils/testing/normalize-errors.ts +1 -1
- package/template/.gitignore +3 -0
- package/template/.stylelintignore +1 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function compileSass(filePath: string): string
|
|
1
|
+
export declare function compileSass(filePath: string): Promise<string>;
|
|
2
2
|
//# sourceMappingURL=compile-sass.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile-sass.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/compile-sass.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compile-sass.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/compile-sass.ts"],"names":[],"mappings":"AAIA,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,mBAIjD"}
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
13
|
};
|
|
5
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
15
|
exports.compileSass = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
16
|
const path_1 = __importDefault(require("path"));
|
|
9
17
|
const sass_1 = __importDefault(require("sass"));
|
|
10
18
|
function compileSass(filePath) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
const loadPaths = [path_1.default.dirname(filePath), '../../node_modules', 'node_modules'];
|
|
21
|
+
const result = yield sass_1.default.compileAsync(filePath, { loadPaths });
|
|
22
|
+
return result.css.toString();
|
|
14
23
|
});
|
|
15
|
-
return result.css.toString();
|
|
16
24
|
}
|
|
17
25
|
exports.compileSass = compileSass;
|
|
18
26
|
//# sourceMappingURL=compile-sass.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile-sass.js","sourceRoot":"","sources":["../../../src/cli/utils/compile-sass.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compile-sass.js","sourceRoot":"","sources":["../../../src/cli/utils/compile-sass.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAwB;AAExB,gDAAwB;AAExB,SAAsB,WAAW,CAAC,QAAgB;;QAC9C,MAAM,SAAS,GAAG,CAAC,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,oBAAoB,EAAE,cAAc,CAAC,CAAC;QACjF,MAAM,MAAM,GAAG,MAAM,cAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;QAChE,OAAO,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACjC,CAAC;CAAA;AAJD,kCAIC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tcm.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/tcm.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tcm.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/tcm.ts"],"names":[],"mappings":"AA2DA,wBAAsB,GAAG,kBAIxB;AAED,wBAAsB,QAAQ,kBAE7B"}
|
package/dist/cli/utils/tcm.js
CHANGED
|
@@ -19,21 +19,28 @@ const chokidar_1 = __importDefault(require("chokidar"));
|
|
|
19
19
|
const typed_css_modules_1 = __importDefault(require("typed-css-modules"));
|
|
20
20
|
const utils_1 = require("../../utils");
|
|
21
21
|
const _1 = require(".");
|
|
22
|
+
function compile(filePath) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
if (filePath.endsWith('.less')) {
|
|
25
|
+
return (0, _1.compileLess)(filePath);
|
|
26
|
+
}
|
|
27
|
+
if (filePath.endsWith('.scss')) {
|
|
28
|
+
return (0, _1.compileSass)(filePath);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
22
32
|
function run({ watch } = {}) {
|
|
23
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
34
|
const { source } = (0, utils_1.getFolders)();
|
|
25
|
-
const filesPattern = `${source}/**/*.module.{${_1.styleExtensions.join()}}
|
|
35
|
+
const filesPattern = `${source}/**/*.module.{${_1.styleExtensions.join()}}`.replace(/\\/g, '/');
|
|
26
36
|
const creator = new typed_css_modules_1.default({
|
|
27
37
|
camelCase: true,
|
|
28
38
|
namedExports: true,
|
|
29
39
|
});
|
|
30
40
|
const writeFile = (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
31
41
|
try {
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
: filePath.endsWith('.scss')
|
|
35
|
-
? (0, _1.compileSass)(filePath)
|
|
36
|
-
: undefined, !!watch);
|
|
42
|
+
const initialContents = yield compile(filePath);
|
|
43
|
+
const content = yield creator.create(filePath, initialContents, !!watch);
|
|
37
44
|
yield content.writeFile();
|
|
38
45
|
}
|
|
39
46
|
catch (error) {
|
|
@@ -46,7 +53,7 @@ function run({ watch } = {}) {
|
|
|
46
53
|
}
|
|
47
54
|
else {
|
|
48
55
|
utils_1.log.info('Watch ' + filesPattern + '...');
|
|
49
|
-
const watcher = chokidar_1.default.watch([filesPattern
|
|
56
|
+
const watcher = chokidar_1.default.watch([filesPattern], { ignoreInitial: true });
|
|
50
57
|
watcher.on('add', writeFile);
|
|
51
58
|
watcher.on('change', writeFile);
|
|
52
59
|
if (process.env.NODE_ENV !== 'test') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tcm.js","sourceRoot":"","sources":["../../../src/cli/utils/tcm.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,gDAAwB;AACxB,wDAAgC;AAEhC,0EAA2C;AAE3C,uCAA8C;AAC9C,wBAA8D;AAM9D,SAAe,GAAG,CAAC,EAAE,KAAK,KAAiB,EAAE;;QACzC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,kBAAU,GAAE,CAAC;QAEhC,MAAM,YAAY,GAAG,GAAG,MAAM,iBAAiB,kBAAe,CAAC,IAAI,EAAE,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"tcm.js","sourceRoot":"","sources":["../../../src/cli/utils/tcm.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,gDAAwB;AACxB,wDAAgC;AAEhC,0EAA2C;AAE3C,uCAA8C;AAC9C,wBAA8D;AAM9D,SAAe,OAAO,CAAC,QAAgB;;QACnC,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YAC5B,OAAO,IAAA,cAAW,EAAC,QAAQ,CAAC,CAAC;SAChC;QACD,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YAC5B,OAAO,IAAA,cAAW,EAAC,QAAQ,CAAC,CAAC;SAChC;IACL,CAAC;CAAA;AAED,SAAe,GAAG,CAAC,EAAE,KAAK,KAAiB,EAAE;;QACzC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,kBAAU,GAAE,CAAC;QAEhC,MAAM,YAAY,GAAG,GAAG,MAAM,iBAAiB,kBAAe,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAE7F,MAAM,OAAO,GAAG,IAAI,2BAAU,CAAC;YAC3B,SAAS,EAAE,IAAI;YACf,YAAY,EAAE,IAAI;SACrB,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG,CAAO,QAAgB,EAAE,EAAE;YACzC,IAAI;gBACA,MAAM,eAAe,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAChD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;gBACzE,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC;aAC7B;YAAC,OAAO,KAAK,EAAE;gBACZ,WAAG,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;aAC5B;QACL,CAAC,CAAA,CAAC;QAEF,IAAI,CAAC,KAAK,EAAE;YACR,MAAM,KAAK,GAAG,MAAM,cAAI,CAAC,SAAS,CAAC,cAAI,CAAC,CAAC,YAAY,CAAC,CAAC;YAEvD,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;SAC3C;aAAM;YACH,WAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,YAAY,GAAG,KAAK,CAAC,CAAC;YAE1C,MAAM,OAAO,GAAG,kBAAQ,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;YACxE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;YAC7B,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;YAEhC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE;gBACjC,MAAM,IAAI,OAAO,CAAO,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;aACrC;SACJ;IACL,CAAC;CAAA;AAED,SAAsB,GAAG;;QACrB,WAAG,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAC;QAExE,MAAM,GAAG,EAAE,CAAC;IAChB,CAAC;CAAA;AAJD,kBAIC;AAED,SAAsB,QAAQ;;QAC1B,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/B,CAAC;CAAA;AAFD,4BAEC"}
|
package/dist/cli/utils/tsc.js
CHANGED
|
@@ -26,11 +26,13 @@ function tscWatch(packages) {
|
|
|
26
26
|
exports.tscWatch = tscWatch;
|
|
27
27
|
function transpile(packages, options = []) {
|
|
28
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
|
|
29
|
+
const args = [
|
|
30
30
|
'-b',
|
|
31
31
|
...options,
|
|
32
32
|
...collapsePackages(packages).map(({ location }) => (0, utils_1.getTsConfig)(location)),
|
|
33
|
-
]
|
|
33
|
+
];
|
|
34
|
+
utils_1.log.debug('tsc', `Running tsc ${args.join(' ')}`);
|
|
35
|
+
yield (0, execa_1.default)('tsc', args, { stdio: 'inherit' });
|
|
34
36
|
});
|
|
35
37
|
}
|
|
36
38
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsc.js","sourceRoot":"","sources":["../../../src/cli/utils/tsc.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA0B;AAE1B,uCAA0E;AAE1E,SAAgB,GAAG,CAAC,QAAmB;IACnC,WAAG,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;IACzC,OAAO,SAAS,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC;AAHD,kBAGC;AAED,SAAgB,QAAQ,CAAC,QAAmB;IACxC,OAAO,SAAS,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,uBAAuB,CAAC,CAAC,CAAC;AAChE,CAAC;AAFD,4BAEC;AAED,SAAe,SAAS,CAAC,QAAmB,EAAE,UAAoB,EAAE;;QAChE,MAAM,
|
|
1
|
+
{"version":3,"file":"tsc.js","sourceRoot":"","sources":["../../../src/cli/utils/tsc.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA0B;AAE1B,uCAA0E;AAE1E,SAAgB,GAAG,CAAC,QAAmB;IACnC,WAAG,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;IACzC,OAAO,SAAS,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC;AAHD,kBAGC;AAED,SAAgB,QAAQ,CAAC,QAAmB;IACxC,OAAO,SAAS,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,uBAAuB,CAAC,CAAC,CAAC;AAChE,CAAC;AAFD,4BAEC;AAED,SAAe,SAAS,CAAC,QAAmB,EAAE,UAAoB,EAAE;;QAChE,MAAM,IAAI,GAAG;YACT,IAAI;YACJ,GAAG,OAAO;YACV,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,IAAA,mBAAW,EAAC,QAAQ,CAAC,CAAC;SAC7E,CAAC;QACF,WAAG,CAAC,KAAK,CAAC,KAAK,EAAE,eAAe,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAClD,MAAM,IAAA,eAAK,EAAC,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IACnD,CAAC;CAAA;AAED;;GAEG;AACH,SAAS,gBAAgB,CAAC,QAAmB;IACzC,MAAM,YAAY,GAAG,IAAI,GAAG,CACxB,MAAM,CAAC,MAAM,CAAC,IAAA,wBAAgB,EAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CACtF,CAAC;IAEF,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-jest-config.d.ts","sourceRoot":"","sources":["../../src/utils/get-jest-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAwB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"get-jest-config.d.ts","sourceRoot":"","sources":["../../src/utils/get-jest-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAwB,MAAM,qBAAqB,CAAC;AA4C9E;;;GAGG;AACH,eAAO,MAAM,aAAa,QAAO,iBAWhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,SAAU,OAAO,IAAI,KAAG,OAAO,IAoB3D,CAAC"}
|
|
@@ -19,29 +19,25 @@ const path_1 = __importDefault(require("path"));
|
|
|
19
19
|
const get_configuration_1 = require("./get-configuration");
|
|
20
20
|
const get_destination_folders_1 = require("./get-destination-folders");
|
|
21
21
|
const to_array_1 = require("./to-array");
|
|
22
|
-
const getJestConfigBase = (
|
|
22
|
+
const getJestConfigBase = ({ coveragePathIgnorePatterns = [], setupFiles = [], testPathIgnorePatterns = [], }) => {
|
|
23
23
|
const transform = {
|
|
24
24
|
'^.+\\.jsx?$': [
|
|
25
25
|
'babel-jest',
|
|
26
26
|
{ presets: [['@babel/preset-env', { targets: { node: 'current' } }]] },
|
|
27
27
|
],
|
|
28
|
-
'^.+\\.tsx?$': 'ts-jest',
|
|
28
|
+
'^.+\\.tsx?$': ['ts-jest', { tsconfig: './tsconfig.test.json' }],
|
|
29
29
|
};
|
|
30
30
|
const moduleNameMapper = {
|
|
31
31
|
'\\.(css|scss|less|png|svg|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$': 'identity-obj-proxy',
|
|
32
32
|
};
|
|
33
|
-
const globals = Object.assign({ 'ts-jest': {
|
|
34
|
-
tsconfig: './tsconfig.test.json',
|
|
35
|
-
} }, globalsOverrides);
|
|
36
33
|
return {
|
|
37
34
|
verbose: true,
|
|
38
35
|
testEnvironment: 'jsdom',
|
|
39
36
|
testRunner: 'jest-circus/runner',
|
|
40
|
-
transformIgnorePatterns: ['node_modules/(
|
|
37
|
+
transformIgnorePatterns: ['node_modules/(?!(@servicetitan|@react-hook|nanoid)/)'],
|
|
41
38
|
modulePathIgnorePatterns: ['<rootDir>/.*/__mocks__'],
|
|
42
|
-
transform
|
|
43
|
-
moduleNameMapper
|
|
44
|
-
globals: stringify ? JSON.stringify(globals) : globals,
|
|
39
|
+
transform,
|
|
40
|
+
moduleNameMapper,
|
|
45
41
|
testPathIgnorePatterns: [
|
|
46
42
|
'\\.yalc',
|
|
47
43
|
...(0, get_destination_folders_1.getDestinationFolders)(),
|
|
@@ -49,7 +45,7 @@ const getJestConfigBase = (stringify, testPathIgnorePatterns = [], setupFiles =
|
|
|
49
45
|
],
|
|
50
46
|
setupFiles: [path_1.default.join(__dirname, '../../jest/setup.js'), ...(0, to_array_1.toArray)(setupFiles)],
|
|
51
47
|
coveragePathIgnorePatterns: ['^.+\\.d\\.ts$', ...coveragePathIgnorePatterns],
|
|
52
|
-
coverageReporters: ['html-spa', 'text', 'json', 'cobertura'],
|
|
48
|
+
coverageReporters: ['html-spa', 'text', 'json', 'cobertura', 'lcov'],
|
|
53
49
|
collectCoverageFrom: ['**/*.{ts,tsx}'],
|
|
54
50
|
};
|
|
55
51
|
};
|
|
@@ -58,16 +54,25 @@ const getJestConfigBase = (stringify, testPathIgnorePatterns = [], setupFiles =
|
|
|
58
54
|
* Jest config files.
|
|
59
55
|
*/
|
|
60
56
|
const getJestConfig = () => {
|
|
61
|
-
const _a =
|
|
62
|
-
return Object.assign(Object.assign({}, getJestConfigBase(
|
|
57
|
+
const _a = (0, get_configuration_1.getJestConfiguration)(), { coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns } = _a, config = __rest(_a, ["coveragePathIgnorePatterns", "setupFiles", "testPathIgnorePatterns"]);
|
|
58
|
+
return Object.assign(Object.assign({}, getJestConfigBase({
|
|
59
|
+
coveragePathIgnorePatterns,
|
|
60
|
+
setupFiles,
|
|
61
|
+
testPathIgnorePatterns,
|
|
62
|
+
})), config);
|
|
63
63
|
};
|
|
64
64
|
exports.getJestConfig = getJestConfig;
|
|
65
65
|
/**
|
|
66
66
|
* Get Jest config for running it using jest CLI (see jest runCLI function)
|
|
67
67
|
*/
|
|
68
68
|
const getJestConfigCLI = (args) => {
|
|
69
|
-
const _a = Object.assign(Object.assign({}, (0, get_configuration_1.getJestConfiguration)()), args), {
|
|
70
|
-
|
|
69
|
+
const _a = Object.assign(Object.assign({}, (0, get_configuration_1.getJestConfiguration)()), args), { coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns, globals } = _a, config = __rest(_a, ["coveragePathIgnorePatterns", "setupFiles", "testPathIgnorePatterns", "globals"]);
|
|
70
|
+
const _b = getJestConfigBase({
|
|
71
|
+
coveragePathIgnorePatterns,
|
|
72
|
+
setupFiles,
|
|
73
|
+
testPathIgnorePatterns,
|
|
74
|
+
}), { collectCoverageFrom, moduleNameMapper, transform } = _b, rest = __rest(_b, ["collectCoverageFrom", "moduleNameMapper", "transform"]);
|
|
75
|
+
return Object.assign(Object.assign({ collectCoverageFrom: JSON.stringify(collectCoverageFrom), globals: JSON.stringify(globals), moduleNameMapper: JSON.stringify(moduleNameMapper), transform: JSON.stringify(transform) }, rest), config);
|
|
71
76
|
};
|
|
72
77
|
exports.getJestConfigCLI = getJestConfigCLI;
|
|
73
78
|
//# sourceMappingURL=get-jest-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-jest-config.js","sourceRoot":"","sources":["../../src/utils/get-jest-config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gDAAwB;AAExB,2DAA8E;AAC9E,uEAAkE;AAClE,yCAAqC;AAErC,MAAM,iBAAiB,GAAG,
|
|
1
|
+
{"version":3,"file":"get-jest-config.js","sourceRoot":"","sources":["../../src/utils/get-jest-config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gDAAwB;AAExB,2DAA8E;AAC9E,uEAAkE;AAClE,yCAAqC;AAErC,MAAM,iBAAiB,GAAG,CAAC,EACvB,0BAA0B,GAAG,EAAE,EAC/B,UAAU,GAAG,EAAE,EACf,sBAAsB,GAAG,EAAE,GAK9B,EAAE,EAAE;IACD,MAAM,SAAS,GAAG;QACd,aAAa,EAAE;YACX,YAAY;YACZ,EAAE,OAAO,EAAE,CAAC,CAAC,mBAAmB,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,EAAE;SACzE;QACD,aAAa,EAAE,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,sBAAsB,EAAE,CAAC;KACnE,CAAC;IACF,MAAM,gBAAgB,GAAG;QACrB,iEAAiE,EAAE,oBAAoB;KAC1F,CAAC;IAEF,OAAO;QACH,OAAO,EAAE,IAAI;QACb,eAAe,EAAE,OAAO;QACxB,UAAU,EAAE,oBAAoB;QAChC,uBAAuB,EAAE,CAAC,sDAAsD,CAAC;QACjF,wBAAwB,EAAE,CAAC,wBAAwB,CAAC;QACpD,SAAS;QACT,gBAAgB;QAChB,sBAAsB,EAAE;YACpB,SAAS;YACT,GAAG,IAAA,+CAAqB,GAAE;YAC1B,GAAG,IAAA,kBAAO,EAAC,sBAAsB,CAAC;SACrC;QACD,UAAU,EAAE,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,qBAAqB,CAAC,EAAE,GAAG,IAAA,kBAAO,EAAC,UAAU,CAAC,CAAC;QACjF,0BAA0B,EAAE,CAAC,eAAe,EAAE,GAAG,0BAA0B,CAAC;QAC5E,iBAAiB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC;QACpE,mBAAmB,EAAE,CAAC,eAAe,CAAC;KACzC,CAAC;AACN,CAAC,CAAC;AAEF;;;GAGG;AACI,MAAM,aAAa,GAAG,GAAsB,EAAE;IACjD,MAAM,KACF,IAAA,wCAAoB,GAAyB,EAD3C,EAAE,0BAA0B,EAAE,UAAU,EAAE,sBAAsB,OACrB,EAD0B,MAAM,cAA3E,sEAA6E,CAClC,CAAC;IAClD,uCACO,iBAAiB,CAAC;QACjB,0BAA0B;QAC1B,UAAU;QACV,sBAAsB;KACzB,CAAC,GACC,MAAM,EACX;AACN,CAAC,CAAC;AAXW,QAAA,aAAa,iBAWxB;AAEF;;GAEG;AACI,MAAM,gBAAgB,GAAG,CAAC,IAAiB,EAAe,EAAE;IAC/D,MAAM,qCACC,IAAA,wCAAoB,GAAE,GACtB,IAAI,CACV,EAHK,EAAE,0BAA0B,EAAE,UAAU,EAAE,sBAAsB,EAAE,OAAO,OAG9E,EAHmF,MAAM,cAApF,iFAAsF,CAG3F,CAAC;IAEF,MAAM,KAAgE,iBAAiB,CAAC;QACpF,0BAA0B;QAC1B,UAAU;QACV,sBAAsB;KACzB,CAAC,EAJI,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,SAAS,OAItD,EAJ2D,IAAI,cAA3D,wDAA6D,CAIjE,CAAC;IAEH,qCACI,mBAAmB,EAAE,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,EACxD,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAChC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAClD,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IACjC,IAAI,GACJ,MAAM,EACX;AACN,CAAC,CAAC;AApBW,QAAA,gBAAgB,oBAoB3B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Configuration } from 'webpack';
|
|
2
|
+
import { Context, Overrides } from './types';
|
|
3
|
+
declare type Result = Pick<Configuration, 'amd'>;
|
|
4
|
+
export declare function amdConfig(_context: Context, _: Overrides): Result;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=amd-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"amd-config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/amd-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE7C,aAAK,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;AAEzC,wBAAgB,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAEjE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"amd-config.js","sourceRoot":"","sources":["../../../src/webpack/configs/amd-config.ts"],"names":[],"mappings":";;;AAKA,SAAgB,SAAS,CAAC,QAAiB,EAAE,CAAY;IACrD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;AAC1B,CAAC;AAFD,8BAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-server-config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/dev-server-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev-server-config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/dev-server-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAG7C,aAAK,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,GAAG,SAAS,CAAC;AAE3D,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,GAAG,MAAM,CAmB9E"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.devServerConfig = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
4
|
const utils_1 = require("../../utils");
|
|
9
5
|
const stats_config_1 = require("./stats-config");
|
|
10
6
|
function devServerConfig(context, overrides) {
|
|
@@ -21,7 +17,7 @@ exports.devServerConfig = devServerConfig;
|
|
|
21
17
|
function watchOptionsConfig() {
|
|
22
18
|
const watchIgnore = (0, utils_1.getPackages)({ scope: (0, utils_1.getPackageName)() })
|
|
23
19
|
.filter(({ type }) => type === utils_1.PackageType.TSC)
|
|
24
|
-
.map(({ location }) =>
|
|
20
|
+
.map(({ location }) => location);
|
|
25
21
|
return watchIgnore.length ? { watchOptions: { ignored: watchIgnore } } : undefined;
|
|
26
22
|
}
|
|
27
23
|
//# sourceMappingURL=dev-server-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-server-config.js","sourceRoot":"","sources":["../../../src/webpack/configs/dev-server-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev-server-config.js","sourceRoot":"","sources":["../../../src/webpack/configs/dev-server-config.ts"],"names":[],"mappings":";;;AACA,uCAAkG;AAClG,iDAA6C;AAM7C,SAAgB,eAAe,CAAC,OAAgB,EAAE,SAAoB;IAClE,IAAI,OAAO,CAAC,YAAY,EAAE;QACtB,OAAO;KACV;IAED,MAAM,SAAS,+CACX,IAAI,EAAE,IAAI,EACV,kBAAkB,EAAE,IAAI,EACxB,WAAW,EAAE,IAAI,EACjB,OAAO,EAAE;YACL,6BAA6B,EAAE,GAAG;YAClC,8BAA8B,EAAE,gDAAgD;SACnF,IACE,kBAAkB,EAAE,GACpB,IAAA,0BAAW,EAAC,OAAO,EAAE,SAAS,CAAC,GAC/B,IAAA,iCAAyB,GAAE,CACjC,CAAC;IAEF,OAAO,EAAE,SAAS,EAAE,CAAC;AACzB,CAAC;AAnBD,0CAmBC;AAED,SAAS,kBAAkB;IACvB,MAAM,WAAW,GAAG,IAAA,mBAAW,EAAC,EAAE,KAAK,EAAE,IAAA,sBAAc,GAAE,EAAE,CAAC;SACvD,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,mBAAW,CAAC,GAAG,CAAC;SAC9C,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC;IAErC,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACvF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC"}
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./amd-config"), exports);
|
|
17
18
|
__exportStar(require("./cache-config"), exports);
|
|
18
19
|
__exportStar(require("./dev-server-config"), exports);
|
|
19
20
|
__exportStar(require("./devtool-config"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/webpack/configs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,sDAAoC;AACpC,mDAAiC;AACjC,iDAA+B;AAC/B,qDAAmC;AACnC,kDAAgC;AAChC,wDAAsC;AACtC,kDAAgC;AAChC,mDAAiC;AACjC,mDAAiC;AACjC,iDAA+B;AAC/B,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/webpack/configs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,iDAA+B;AAC/B,sDAAoC;AACpC,mDAAiC;AACjC,iDAA+B;AAC/B,qDAAmC;AACnC,kDAAgC;AAChC,wDAAsC;AACtC,kDAAgC;AAChC,mDAAiC;AACjC,mDAAiC;AACjC,iDAA+B;AAC/B,0CAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-metadata.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/utils/generate-metadata.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"generate-metadata.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/utils/generate-metadata.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAKnC,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,QAyBhD"}
|
|
@@ -8,6 +8,7 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const utils_1 = require("../../../utils");
|
|
10
10
|
const get_startup_version_1 = require("./get-startup-version");
|
|
11
|
+
const get_web_components_version_1 = require("./get-web-components-version");
|
|
11
12
|
function generateMetadata(context) {
|
|
12
13
|
const { destination, name, packageData, sharedDependencies } = context;
|
|
13
14
|
const outputFile = `./${destination}/metadata.json`;
|
|
@@ -18,7 +19,10 @@ function generateMetadata(context) {
|
|
|
18
19
|
const light = (0, utils_1.readJsonSafe)(path_1.default.join(destination, 'bundle', 'light', 'entrypoints.json'));
|
|
19
20
|
const metadata = {
|
|
20
21
|
name,
|
|
21
|
-
bundledWith: {
|
|
22
|
+
bundledWith: {
|
|
23
|
+
'@servicetitan/startup': (0, get_startup_version_1.getStartupVersion)(),
|
|
24
|
+
'@servicetitan/web-components': (0, get_web_components_version_1.getWebComponentsVersion)(),
|
|
25
|
+
},
|
|
22
26
|
sharedDependencies,
|
|
23
27
|
dependencies: packageData.dependencies,
|
|
24
28
|
entrypoints: Object.assign(Object.assign({}, (full ? { full } : {})), (light ? { light } : {})),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-metadata.js","sourceRoot":"","sources":["../../../../src/webpack/configs/utils/generate-metadata.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,0CAAmD;AAGnD,+DAA0D;
|
|
1
|
+
{"version":3,"file":"generate-metadata.js","sourceRoot":"","sources":["../../../../src/webpack/configs/utils/generate-metadata.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,0CAAmD;AAGnD,+DAA0D;AAC1D,6EAAuE;AAEvE,SAAgB,gBAAgB,CAAC,OAAgB;IAC7C,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC;IACvE,MAAM,UAAU,GAAG,KAAK,WAAW,gBAAgB,CAAC;IAEpD,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,KAAK,WAAW,EAAE,CAAC,EAAE;QACpC,YAAE,CAAC,SAAS,CAAC,KAAK,WAAW,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;KACzD;IAED,MAAM,IAAI,GAAG,IAAA,oBAAY,EAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC;IACxF,MAAM,KAAK,GAAG,IAAA,oBAAY,EAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAC1F,MAAM,QAAQ,GAAG;QACb,IAAI;QACJ,WAAW,EAAE;YACT,uBAAuB,EAAE,IAAA,uCAAiB,GAAE;YAC5C,8BAA8B,EAAE,IAAA,oDAAuB,GAAE;SAC5D;QACD,kBAAkB;QAClB,YAAY,EAAE,WAAW,CAAC,YAAY;QACtC,WAAW,kCAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAE;KAC1E,CAAC;IAEF,YAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAExE,sCAAsC;IACtC,WAAG,CAAC,KAAK,CAAC,mBAAmB,EAAE,GAAG,UAAU,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;AACrF,CAAC;AAzBD,4CAyBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-web-components-version.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/utils/get-web-components-version.ts"],"names":[],"mappings":"AAGA,wBAAgB,uBAAuB,QAItC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getWebComponentsVersion = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const utils_1 = require("../../../utils");
|
|
9
|
+
function getWebComponentsVersion() {
|
|
10
|
+
return (0, utils_1.readJson)(path_1.default.join(path_1.default.dirname(require.resolve('@servicetitan/web-components')), '../package.json')).version;
|
|
11
|
+
}
|
|
12
|
+
exports.getWebComponentsVersion = getWebComponentsVersion;
|
|
13
|
+
//# sourceMappingURL=get-web-components-version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-web-components-version.js","sourceRoot":"","sources":["../../../../src/webpack/configs/utils/get-web-components-version.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,0CAA0C;AAE1C,SAAgB,uBAAuB;IACnC,OAAO,IAAA,gBAAQ,EACX,cAAI,CAAC,IAAI,CAAC,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAC9F,CAAC,OAAO,CAAC;AACd,CAAC;AAJD,0DAIC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-webpack-config.d.ts","sourceRoot":"","sources":["../../src/webpack/create-webpack-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"create-webpack-config.d.ts","sourceRoot":"","sources":["../../src/webpack/create-webpack-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AA6BxC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAG7C,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,GAAE,OAAY,GAAG,aAAa,CAsD9F"}
|
|
@@ -34,6 +34,7 @@ function createWebpackConfig(overrides, options = {}) {
|
|
|
34
34
|
configs_1.pluginsConfig,
|
|
35
35
|
configs_1.resolveConfig,
|
|
36
36
|
configs_1.statsConfig,
|
|
37
|
+
configs_1.amdConfig,
|
|
37
38
|
].reduce((result, fn) => (Object.assign(Object.assign({}, result), fn(context, overrides))), {}), configuration);
|
|
38
39
|
/* istanbul ignore next: debug only */
|
|
39
40
|
utils_2.log.debug('create-webpack-config', () => stringify(result));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-webpack-config.js","sourceRoot":"","sources":["../../src/webpack/create-webpack-config.ts"],"names":[],"mappings":";;;;;;AACA,kEAAkC;AAClC,iCAAwC;AAExC,wCAAmF;AACnF,oCAQkB;AAClB,
|
|
1
|
+
{"version":3,"file":"create-webpack-config.js","sourceRoot":"","sources":["../../src/webpack/create-webpack-config.ts"],"names":[],"mappings":";;;;;;AACA,kEAAkC;AAClC,iCAAwC;AAExC,wCAAmF;AACnF,oCAQkB;AAClB,uCAcmB;AAEnB,mCAAwC;AAExC,SAAgB,mBAAmB,CAAC,SAAoB,EAAE,UAAmB,EAAE;;IAC3E,MAAM,EAAE,aAAa,GAAG,EAAE,EAAE,GAAG,SAAS,CAAC;IAEzC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,kBAAU,GAAE,CAAC;IAC7C,MAAM,WAAW,GAAG,IAAA,sBAAc,GAAE,CAAC;IACrC,MAAM,kBAAkB,GAAG,IAAA,8BAAsB,EAC7C,WAAW,CAAC,YAAY,EACxB,WAAW,CAAC,kBAAkB,CACjC,CAAC;IAEF,MAAM,OAAO,iCACT,WAAW,EACX,OAAO,EAAE,MAAA,MAAA,OAAO,CAAC,OAAO,mCAAI,CAAC,CAAE,YAAkB,CAAC,OAAO,mCAAI,KAAK,EAClE,oBAAoB,EAChB,MAAA,MAAA,OAAO,CAAC,oBAAoB,mCAAI,CAAC,CAAE,YAAkB,CAAC,uBAAuB,CAAC,mCAAI,KAAK,EAC3F,kBAAkB,EAAE,IAAA,0BAAkB,GAAE,EACxC,0BAA0B,EAAE,IAAA,kCAA0B,GAAE,EACxD,YAAY,EAAE,aAAa,CAAC,IAAI,KAAK,YAAY,EACjD,cAAc,EAAE,IAAA,sBAAc,GAAE,EAChC,IAAI,EAAE,EAAE,IACL,OAAO,KACV,WAAW;QACX,kBAAkB;QAClB,MAAM,GACT,CAAC;IAEF,IAAI,OAAO,CAAC,cAAc,IAAI,mCAAmC,EAAE,EAAE;QACjE,MAAM,IAAI,KAAK,CACX,6LAA6L,CAChM,CAAC;KACL;IAED,MAAM,MAAM,GAAG,IAAA,uBAAK,EAChB;QACI,qBAAW;QACX,yBAAe;QACf,uBAAa;QACb,qBAAW;QACX,yBAAe;QACf,sBAAY;QACZ,4BAAkB;QAClB,sBAAY;QACZ,uBAAa;QACb,uBAAa;QACb,qBAAW;QACX,mBAAS;KACZ,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,iCAAM,MAAM,GAAK,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,EAAG,EAAE,EAAE,CAAC,EACxE,aAAa,CAChB,CAAC;IAEF,sCAAsC;IACtC,WAAG,CAAC,KAAK,CAAC,uBAAuB,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAE5D,OAAO,MAAM,CAAC;AAClB,CAAC;AAtDD,kDAsDC;AAED,SAAS,mCAAmC;IACxC,MAAM,cAAc,GAAG,IAAA,qBAAa,GAAE,CAAC;IACvC,OAAO,CAAC,gCAAwB,EAAE,iCAAyB,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAC/E,cAAc,CAAC,QAAQ,CAAC,cAAc,CAAC,CAC1C,CAAC;AACN,CAAC;AAED,sCAAsC;AACtC,SAAS,SAAS,CAAC,aAAkB;IACjC,SAAS,QAAQ,CAAC,GAAW,EAAE,KAAU;;QACrC,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;YAC7B,OAAO,YAAY,MAAA,KAAK,CAAC,IAAI,mCAAI,EAAE,GAAG,CAAC;SAC1C;QACD,IAAI,KAAK,YAAY,MAAM,EAAE;YACzB,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;SACxB;QACD,IAAI,GAAG,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC3C,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;;gBACtB,MAAM,IAAI,GAAG,MAAA,MAAA,MAAM,CAAC,WAAW,0CAAE,IAAI,mCAAI,MAAM,CAAC,IAAI,CAAC;gBACrD,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;YAC9C,CAAC,CAAC,CAAC;SACN;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -12,7 +12,7 @@ function removeCWD(str) {
|
|
|
12
12
|
return str.replace(new RegExp(cwd, 'g'), '');
|
|
13
13
|
}
|
|
14
14
|
function normalizeErrors(errors) {
|
|
15
|
-
return errors.map(error => removeCWD(error.
|
|
15
|
+
return errors.map(error => removeCWD(error.message.split('\n').slice(0, 2).join('\n')));
|
|
16
16
|
}
|
|
17
17
|
exports.normalizeErrors = normalizeErrors;
|
|
18
18
|
//# sourceMappingURL=normalize-errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-errors.js","sourceRoot":"","sources":["../../../../src/webpack/utils/testing/normalize-errors.ts"],"names":[],"mappings":";;;AAEA,SAAS,SAAS,CAAC,GAAW;IAC1B,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;IAC3C,IAAI,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAExB,IAAI,KAAK,EAAE;QACP,6CAA6C;QAC7C,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC9B,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;KACjC;IAED,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;AACjD,CAAC;AAED,SAAgB,eAAe,CAAC,MAAsB;IAClD,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"normalize-errors.js","sourceRoot":"","sources":["../../../../src/webpack/utils/testing/normalize-errors.ts"],"names":[],"mappings":";;;AAEA,SAAS,SAAS,CAAC,GAAW;IAC1B,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;IAC3C,IAAI,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAExB,IAAI,KAAK,EAAE;QACP,6CAA6C;QAC7C,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC9B,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;KACjC;IAED,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;AACjD,CAAC;AAED,SAAgB,eAAe,CAAC,MAAsB;IAClD,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC5F,CAAC;AAFD,0CAEC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/startup",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "23.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://docs.st.dev/docs/frontend/startup",
|
|
6
6
|
"repository": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"bin": "./bin/index.js",
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/cpx": "~1.5.2",
|
|
27
|
-
"@types/eslint": "~8.
|
|
27
|
+
"@types/eslint": "~8.56.2",
|
|
28
28
|
"@types/less": "~3.0.3",
|
|
29
29
|
"@types/mini-css-extract-plugin": "~2.4.0",
|
|
30
30
|
"@types/moment-locales-webpack-plugin": "~1.2.2",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@babel/preset-env": "~7.22.20",
|
|
38
|
-
"@jest/core": "~
|
|
39
|
-
"@jest/types": "~
|
|
38
|
+
"@jest/core": "~29.7.0",
|
|
39
|
+
"@jest/types": "~29.6.3",
|
|
40
40
|
"@lerna/exec": "~5.6.2",
|
|
41
|
-
"@servicetitan/eslint-config": "
|
|
42
|
-
"@servicetitan/stylelint-config": "
|
|
41
|
+
"@servicetitan/eslint-config": "23.0.0",
|
|
42
|
+
"@servicetitan/stylelint-config": "23.0.0",
|
|
43
43
|
"@swc/core": "1.3.100",
|
|
44
44
|
"@types/jest": "~27.4.0",
|
|
45
45
|
"chalk": "~4.1.2",
|
|
@@ -49,20 +49,21 @@
|
|
|
49
49
|
"debug": "^4.3.4",
|
|
50
50
|
"deepmerge": "~4.3.1",
|
|
51
51
|
"esbuild-loader": "~4.0.2",
|
|
52
|
-
"eslint": "~8.
|
|
52
|
+
"eslint": "~8.56.0",
|
|
53
53
|
"execa": "~5.1.1",
|
|
54
54
|
"fork-ts-checker-webpack-plugin": "~7.3.0",
|
|
55
55
|
"glob": "~7.2.0",
|
|
56
56
|
"html-webpack-plugin": "~5.5.3",
|
|
57
57
|
"identity-obj-proxy": "~3.0.0",
|
|
58
|
-
"jest": "~
|
|
59
|
-
"jest-circus": "~
|
|
58
|
+
"jest": "~29.7.0",
|
|
59
|
+
"jest-circus": "~29.7.0",
|
|
60
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
60
61
|
"jest-fetch-mock": "~3.0.3",
|
|
61
62
|
"lerna": "~5.6.2",
|
|
62
63
|
"less": "~4.2.0",
|
|
63
64
|
"less-loader": "~10.2.0",
|
|
64
65
|
"less-plugin-npm-import": "~2.1.0",
|
|
65
|
-
"memfs": "~
|
|
66
|
+
"memfs": "~4.7.0",
|
|
66
67
|
"mini-css-extract-plugin": "~2.7.6",
|
|
67
68
|
"moment": "^2.29.4",
|
|
68
69
|
"moment-locales-webpack-plugin": "~1.2.0",
|
|
@@ -74,10 +75,10 @@
|
|
|
74
75
|
"style-loader": "~3.3.3",
|
|
75
76
|
"stylelint": "~14.16.1",
|
|
76
77
|
"swc-loader": "0.2.3",
|
|
77
|
-
"ts-jest": "~
|
|
78
|
+
"ts-jest": "~29.1.2",
|
|
78
79
|
"ts-loader": "~9.4.4",
|
|
79
80
|
"ts-node": "~10.9.1",
|
|
80
|
-
"typed-css-modules": "~0.
|
|
81
|
+
"typed-css-modules": "~0.8.1",
|
|
81
82
|
"typescript": "~4.7.4",
|
|
82
83
|
"username": "~5.1.0",
|
|
83
84
|
"webpack": "~5.78.0",
|
|
@@ -97,5 +98,5 @@
|
|
|
97
98
|
"cli": {
|
|
98
99
|
"webpack": false
|
|
99
100
|
},
|
|
100
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "45876ed36415ad78d3ec4ef3783d6df1430504d3"
|
|
101
102
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @jest-environment node
|
|
3
|
+
*/
|
|
2
4
|
import chokidar from 'chokidar';
|
|
5
|
+
import fs from 'fs';
|
|
3
6
|
|
|
4
7
|
import { getFolders, log } from '../../../utils';
|
|
5
8
|
import * as sassModule from '../compile-sass';
|
|
@@ -7,26 +10,32 @@ import * as sassModule from '../compile-sass';
|
|
|
7
10
|
import { styleExtensions } from '..';
|
|
8
11
|
import { tcm, tcmWatch } from '../tcm';
|
|
9
12
|
|
|
10
|
-
jest.mock('fs', () => fs);
|
|
11
13
|
jest.mock('../../../utils', () => ({
|
|
12
14
|
...jest.requireActual('../../../utils'),
|
|
13
15
|
getFolders: jest.fn(),
|
|
14
16
|
log: { error: jest.fn(), info: jest.fn() }, // suppress test output
|
|
15
17
|
}));
|
|
16
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Note: These tests don't use memfs because the typed-css-modules package
|
|
21
|
+
* uses node: URLs to import the fs modules, which bypasses the memfs filesystem
|
|
22
|
+
* (as of memfs ~4.6.0).
|
|
23
|
+
*/
|
|
24
|
+
|
|
17
25
|
describe('[startup] Cli Utils', () => {
|
|
18
|
-
const source = 'src';
|
|
26
|
+
const source = fs.mkdtempSync('src');
|
|
19
27
|
|
|
20
28
|
beforeEach(() => {
|
|
21
29
|
jest.resetAllMocks();
|
|
22
30
|
jest.mocked(getFolders).mockReturnValue({ source, destination: undefined });
|
|
31
|
+
fs.readdirSync(source).forEach(file => fs.rmSync(`${source}/${file}`));
|
|
23
32
|
});
|
|
24
33
|
|
|
25
|
-
|
|
34
|
+
afterAll(() => fs.rmSync(source, { recursive: true }));
|
|
26
35
|
|
|
27
36
|
function mockStylesModule(module: string, id = 'foo') {
|
|
28
37
|
const content = `.${id} { display: none; }`;
|
|
29
|
-
|
|
38
|
+
fs.writeFileSync(`${source}/${module}`, content);
|
|
30
39
|
}
|
|
31
40
|
|
|
32
41
|
function expectTypeDefinitions(module: string, id = 'foo') {
|
|
@@ -78,7 +87,7 @@ describe('[startup] Cli Utils', () => {
|
|
|
78
87
|
beforeEach(() => {
|
|
79
88
|
fsWatcher = { on: jest.fn() };
|
|
80
89
|
watchSpy = jest.spyOn(chokidar, 'watch').mockReturnValue(fsWatcher as any);
|
|
81
|
-
|
|
90
|
+
fs.writeFileSync(`${source}/foo.bar`, '');
|
|
82
91
|
});
|
|
83
92
|
|
|
84
93
|
const subject = () => tcmWatch();
|
|
@@ -9,7 +9,7 @@ jest.mock('fs', () => fs);
|
|
|
9
9
|
jest.mock('execa', () => jest.fn());
|
|
10
10
|
jest.mock('../../../utils', () => ({
|
|
11
11
|
...jest.requireActual('../../../utils'),
|
|
12
|
-
log: { info: jest.fn() }, // suppress test output
|
|
12
|
+
log: { info: jest.fn(), debug: jest.fn() }, // suppress test output
|
|
13
13
|
getPackagesGraph: jest.fn(),
|
|
14
14
|
}));
|
|
15
15
|
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
1
|
import path from 'path';
|
|
3
2
|
|
|
4
3
|
import sass from 'sass';
|
|
5
4
|
|
|
6
|
-
export function compileSass(filePath: string) {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
includePaths: [path.dirname(filePath), '../../node_modules', 'node_modules'],
|
|
10
|
-
});
|
|
11
|
-
|
|
5
|
+
export async function compileSass(filePath: string) {
|
|
6
|
+
const loadPaths = [path.dirname(filePath), '../../node_modules', 'node_modules'];
|
|
7
|
+
const result = await sass.compileAsync(filePath, { loadPaths });
|
|
12
8
|
return result.css.toString();
|
|
13
9
|
}
|
package/src/cli/utils/tcm.ts
CHANGED
|
@@ -11,10 +11,19 @@ interface RunOptions {
|
|
|
11
11
|
watch?: boolean;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
async function compile(filePath: string) {
|
|
15
|
+
if (filePath.endsWith('.less')) {
|
|
16
|
+
return compileLess(filePath);
|
|
17
|
+
}
|
|
18
|
+
if (filePath.endsWith('.scss')) {
|
|
19
|
+
return compileSass(filePath);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
14
23
|
async function run({ watch }: RunOptions = {}) {
|
|
15
24
|
const { source } = getFolders();
|
|
16
25
|
|
|
17
|
-
const filesPattern = `${source}/**/*.module.{${styleExtensions.join()}}
|
|
26
|
+
const filesPattern = `${source}/**/*.module.{${styleExtensions.join()}}`.replace(/\\/g, '/');
|
|
18
27
|
|
|
19
28
|
const creator = new DtsCreator({
|
|
20
29
|
camelCase: true,
|
|
@@ -23,15 +32,8 @@ async function run({ watch }: RunOptions = {}) {
|
|
|
23
32
|
|
|
24
33
|
const writeFile = async (filePath: string) => {
|
|
25
34
|
try {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
filePath.endsWith('.less')
|
|
29
|
-
? await compileLess(filePath)
|
|
30
|
-
: filePath.endsWith('.scss')
|
|
31
|
-
? compileSass(filePath)
|
|
32
|
-
: undefined,
|
|
33
|
-
!!watch
|
|
34
|
-
);
|
|
35
|
+
const initialContents = await compile(filePath);
|
|
36
|
+
const content = await creator.create(filePath, initialContents, !!watch);
|
|
35
37
|
await content.writeFile();
|
|
36
38
|
} catch (error) {
|
|
37
39
|
log.error(String(error));
|
|
@@ -45,7 +47,7 @@ async function run({ watch }: RunOptions = {}) {
|
|
|
45
47
|
} else {
|
|
46
48
|
log.info('Watch ' + filesPattern + '...');
|
|
47
49
|
|
|
48
|
-
const watcher = chokidar.watch([filesPattern
|
|
50
|
+
const watcher = chokidar.watch([filesPattern], { ignoreInitial: true });
|
|
49
51
|
watcher.on('add', writeFile);
|
|
50
52
|
watcher.on('change', writeFile);
|
|
51
53
|
|
package/src/cli/utils/tsc.ts
CHANGED
|
@@ -12,15 +12,13 @@ export function tscWatch(packages: Package[]) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
async function transpile(packages: Package[], options: string[] = []) {
|
|
15
|
-
|
|
16
|
-
'
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{ stdio: 'inherit' }
|
|
23
|
-
);
|
|
15
|
+
const args = [
|
|
16
|
+
'-b',
|
|
17
|
+
...options,
|
|
18
|
+
...collapsePackages(packages).map(({ location }) => getTsConfig(location)),
|
|
19
|
+
];
|
|
20
|
+
log.debug('tsc', `Running tsc ${args.join(' ')}`);
|
|
21
|
+
await execa('tsc', args, { stdio: 'inherit' });
|
|
24
22
|
}
|
|
25
23
|
|
|
26
24
|
/**
|
|
@@ -13,27 +13,26 @@ jest.mock('../get-configuration', () => ({
|
|
|
13
13
|
|
|
14
14
|
describe('[startup] Utils', () => {
|
|
15
15
|
const destinationFolders = ['dist'];
|
|
16
|
-
const defaultConfig = {
|
|
16
|
+
const defaultConfig: Record<string, any> = {
|
|
17
17
|
verbose: true,
|
|
18
18
|
testEnvironment: 'jsdom',
|
|
19
19
|
testRunner: 'jest-circus/runner',
|
|
20
|
-
transformIgnorePatterns: ['node_modules/(
|
|
20
|
+
transformIgnorePatterns: ['node_modules/(?!(@servicetitan|@react-hook|nanoid)/)'],
|
|
21
21
|
modulePathIgnorePatterns: ['<rootDir>/.*/__mocks__'],
|
|
22
22
|
transform: {
|
|
23
23
|
'^.+\\.jsx?$': [
|
|
24
24
|
'babel-jest',
|
|
25
25
|
{ presets: [['@babel/preset-env', { targets: { node: 'current' } }]] },
|
|
26
26
|
],
|
|
27
|
-
'^.+\\.tsx?$': 'ts-jest',
|
|
27
|
+
'^.+\\.tsx?$': ['ts-jest', { tsconfig: './tsconfig.test.json' }],
|
|
28
28
|
},
|
|
29
29
|
moduleNameMapper: {
|
|
30
30
|
'\\.(css|scss|less|png|svg|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$': 'identity-obj-proxy',
|
|
31
31
|
},
|
|
32
|
-
globals: { 'ts-jest': { tsconfig: './tsconfig.test.json' } },
|
|
33
32
|
testPathIgnorePatterns: ['\\.yalc', ...destinationFolders],
|
|
34
33
|
setupFiles: [expect.stringContaining(path.join('jest', 'setup.js'))],
|
|
35
34
|
coveragePathIgnorePatterns: ['^.+\\.d\\.ts$'],
|
|
36
|
-
coverageReporters: ['html-spa', 'text', 'json', 'cobertura'],
|
|
35
|
+
coverageReporters: ['html-spa', 'text', 'json', 'cobertura', 'lcov'],
|
|
37
36
|
collectCoverageFrom: ['**/*.{ts,tsx}'],
|
|
38
37
|
};
|
|
39
38
|
|
|
@@ -73,25 +72,6 @@ describe('[startup] Utils', () => {
|
|
|
73
72
|
}
|
|
74
73
|
);
|
|
75
74
|
|
|
76
|
-
describe.each(['globals'])(
|
|
77
|
-
'with custom "%s"',
|
|
78
|
-
(option: keyof Pick<typeof defaultConfig, 'globals'>) => {
|
|
79
|
-
const customValue = { foo: 'bar' };
|
|
80
|
-
|
|
81
|
-
beforeEach(() => {
|
|
82
|
-
jest.mocked(getJestConfiguration).mockReturnValue({ [option]: customValue });
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
test(`merges custom value with "${option}"`, () => {
|
|
86
|
-
expect(subject()).toEqual(
|
|
87
|
-
expect.objectContaining({
|
|
88
|
-
[option]: { ...defaultConfig[option], ...customValue },
|
|
89
|
-
})
|
|
90
|
-
);
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
);
|
|
94
|
-
|
|
95
75
|
describe('with other custom options', () => {
|
|
96
76
|
const customOptions = { resetMocks: true, testEnvironment: 'node' };
|
|
97
77
|
|
|
@@ -104,31 +84,28 @@ describe('[startup] Utils', () => {
|
|
|
104
84
|
});
|
|
105
85
|
|
|
106
86
|
describe(`${getJestConfigCLI.name}`, () => {
|
|
107
|
-
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
88
|
+
const args: Config.Argv = { _: [], $0: '', runInBand: true };
|
|
89
|
+
const globals = { foo: 'bar' };
|
|
108
90
|
|
|
109
91
|
const subject = () => getJestConfigCLI(args);
|
|
110
92
|
|
|
111
93
|
beforeEach(() => {
|
|
112
|
-
|
|
113
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
114
|
-
args = { _: [], $0: '', ...commandLineOptions };
|
|
94
|
+
jest.mocked(getJestConfiguration).mockReturnValue({ globals });
|
|
115
95
|
});
|
|
116
96
|
|
|
117
|
-
const stringified
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
];
|
|
97
|
+
const stringified = ['collectCoverageFrom', 'moduleNameMapper', 'transform'].reduce(
|
|
98
|
+
(result, key) => ({ ...result, [key]: JSON.stringify(defaultConfig[key]) }),
|
|
99
|
+
{ globals: JSON.stringify(globals) }
|
|
100
|
+
);
|
|
122
101
|
|
|
123
|
-
test(`merges command line args with default config and stringifies "${
|
|
124
|
-
|
|
125
|
-
)}"`, () => {
|
|
102
|
+
test(`merges command line args with default config and stringifies "${Object.keys(
|
|
103
|
+
stringified
|
|
104
|
+
).join('", "')}"`, () => {
|
|
126
105
|
expect(subject()).toEqual({
|
|
127
106
|
...defaultConfig,
|
|
128
107
|
...args,
|
|
129
|
-
...
|
|
130
|
-
stringified.map(option => [option, JSON.stringify(defaultConfig[option])])
|
|
131
|
-
),
|
|
108
|
+
...stringified,
|
|
132
109
|
});
|
|
133
110
|
});
|
|
134
111
|
});
|
|
@@ -4,39 +4,34 @@ import { JestConfiguration, getJestConfiguration } from './get-configuration';
|
|
|
4
4
|
import { getDestinationFolders } from './get-destination-folders';
|
|
5
5
|
import { toArray } from './to-array';
|
|
6
6
|
|
|
7
|
-
const getJestConfigBase = (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
const getJestConfigBase = ({
|
|
8
|
+
coveragePathIgnorePatterns = [],
|
|
9
|
+
setupFiles = [],
|
|
10
|
+
testPathIgnorePatterns = [],
|
|
11
|
+
}: {
|
|
12
|
+
coveragePathIgnorePatterns?: string[];
|
|
13
|
+
setupFiles?: string[];
|
|
14
|
+
testPathIgnorePatterns?: string[];
|
|
15
|
+
}) => {
|
|
14
16
|
const transform = {
|
|
15
17
|
'^.+\\.jsx?$': [
|
|
16
18
|
'babel-jest',
|
|
17
19
|
{ presets: [['@babel/preset-env', { targets: { node: 'current' } }]] },
|
|
18
20
|
],
|
|
19
|
-
'^.+\\.tsx?$': 'ts-jest',
|
|
21
|
+
'^.+\\.tsx?$': ['ts-jest', { tsconfig: './tsconfig.test.json' }],
|
|
20
22
|
};
|
|
21
23
|
const moduleNameMapper = {
|
|
22
24
|
'\\.(css|scss|less|png|svg|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$': 'identity-obj-proxy',
|
|
23
25
|
};
|
|
24
|
-
const globals = {
|
|
25
|
-
'ts-jest': {
|
|
26
|
-
tsconfig: './tsconfig.test.json',
|
|
27
|
-
},
|
|
28
|
-
...globalsOverrides,
|
|
29
|
-
};
|
|
30
26
|
|
|
31
27
|
return {
|
|
32
28
|
verbose: true,
|
|
33
29
|
testEnvironment: 'jsdom',
|
|
34
30
|
testRunner: 'jest-circus/runner',
|
|
35
|
-
transformIgnorePatterns: ['node_modules/(
|
|
31
|
+
transformIgnorePatterns: ['node_modules/(?!(@servicetitan|@react-hook|nanoid)/)'],
|
|
36
32
|
modulePathIgnorePatterns: ['<rootDir>/.*/__mocks__'],
|
|
37
|
-
transform
|
|
38
|
-
moduleNameMapper
|
|
39
|
-
globals: stringify ? JSON.stringify(globals) : globals,
|
|
33
|
+
transform,
|
|
34
|
+
moduleNameMapper,
|
|
40
35
|
testPathIgnorePatterns: [
|
|
41
36
|
'\\.yalc',
|
|
42
37
|
...getDestinationFolders(),
|
|
@@ -44,7 +39,7 @@ const getJestConfigBase = (
|
|
|
44
39
|
],
|
|
45
40
|
setupFiles: [path.join(__dirname, '../../jest/setup.js'), ...toArray(setupFiles)],
|
|
46
41
|
coveragePathIgnorePatterns: ['^.+\\.d\\.ts$', ...coveragePathIgnorePatterns],
|
|
47
|
-
coverageReporters: ['html-spa', 'text', 'json', 'cobertura'],
|
|
42
|
+
coverageReporters: ['html-spa', 'text', 'json', 'cobertura', 'lcov'],
|
|
48
43
|
collectCoverageFrom: ['**/*.{ts,tsx}'],
|
|
49
44
|
};
|
|
50
45
|
};
|
|
@@ -54,21 +49,14 @@ const getJestConfigBase = (
|
|
|
54
49
|
* Jest config files.
|
|
55
50
|
*/
|
|
56
51
|
export const getJestConfig = (): JestConfiguration => {
|
|
57
|
-
const {
|
|
58
|
-
|
|
59
|
-
setupFiles = [],
|
|
60
|
-
coveragePathIgnorePatterns = [],
|
|
61
|
-
globals = {},
|
|
62
|
-
...config
|
|
63
|
-
} = { ...getJestConfiguration() };
|
|
52
|
+
const { coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns, ...config } =
|
|
53
|
+
getJestConfiguration() as Record<string, any>;
|
|
64
54
|
return {
|
|
65
|
-
...getJestConfigBase(
|
|
66
|
-
false,
|
|
67
|
-
testPathIgnorePatterns,
|
|
68
|
-
setupFiles,
|
|
55
|
+
...getJestConfigBase({
|
|
69
56
|
coveragePathIgnorePatterns,
|
|
70
|
-
|
|
71
|
-
|
|
57
|
+
setupFiles,
|
|
58
|
+
testPathIgnorePatterns,
|
|
59
|
+
}),
|
|
72
60
|
...config,
|
|
73
61
|
};
|
|
74
62
|
};
|
|
@@ -77,24 +65,23 @@ export const getJestConfig = (): JestConfiguration => {
|
|
|
77
65
|
* Get Jest config for running it using jest CLI (see jest runCLI function)
|
|
78
66
|
*/
|
|
79
67
|
export const getJestConfigCLI = (args: Config.Argv): Config.Argv => {
|
|
80
|
-
const {
|
|
81
|
-
testPathIgnorePatterns = [],
|
|
82
|
-
setupFiles = [],
|
|
83
|
-
coveragePathIgnorePatterns = [],
|
|
84
|
-
globals = {},
|
|
85
|
-
...config
|
|
86
|
-
} = {
|
|
68
|
+
const { coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns, globals, ...config } = {
|
|
87
69
|
...getJestConfiguration(),
|
|
88
70
|
...args,
|
|
89
71
|
};
|
|
72
|
+
|
|
73
|
+
const { collectCoverageFrom, moduleNameMapper, transform, ...rest } = getJestConfigBase({
|
|
74
|
+
coveragePathIgnorePatterns,
|
|
75
|
+
setupFiles,
|
|
76
|
+
testPathIgnorePatterns,
|
|
77
|
+
});
|
|
78
|
+
|
|
90
79
|
return {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
globals
|
|
97
|
-
),
|
|
80
|
+
collectCoverageFrom: JSON.stringify(collectCoverageFrom),
|
|
81
|
+
globals: JSON.stringify(globals),
|
|
82
|
+
moduleNameMapper: JSON.stringify(moduleNameMapper),
|
|
83
|
+
transform: JSON.stringify(transform),
|
|
84
|
+
...rest,
|
|
98
85
|
...config,
|
|
99
86
|
};
|
|
100
87
|
};
|
|
@@ -174,6 +174,10 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
174
174
|
});
|
|
175
175
|
});
|
|
176
176
|
|
|
177
|
+
test('configures "amd"', () => {
|
|
178
|
+
expect(subject().amd).toEqual(false);
|
|
179
|
+
});
|
|
180
|
+
|
|
177
181
|
test('configures "devServer"', () => {
|
|
178
182
|
expect(subject().devServer).toEqual({
|
|
179
183
|
port: 8080,
|
|
@@ -206,7 +210,7 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
206
210
|
test('configures "devServer.watchOptions" to ignore TSC packages', () => {
|
|
207
211
|
const ignored = packages
|
|
208
212
|
.filter(({ type }) => type === PackageType.TSC)
|
|
209
|
-
.map(({ location }) =>
|
|
213
|
+
.map(({ location }) => location);
|
|
210
214
|
expect(subject().devServer?.watchOptions).toEqual({ ignored });
|
|
211
215
|
});
|
|
212
216
|
});
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
1
|
import { Configuration } from 'webpack';
|
|
3
|
-
import {
|
|
4
|
-
PackageType,
|
|
5
|
-
getDevServerConfiguration,
|
|
6
|
-
getFolders,
|
|
7
|
-
getPackageName,
|
|
8
|
-
getPackages,
|
|
9
|
-
} from '../../utils';
|
|
2
|
+
import { PackageType, getDevServerConfiguration, getPackageName, getPackages } from '../../utils';
|
|
10
3
|
import { statsConfig } from './stats-config';
|
|
11
4
|
import { Context, Overrides } from './types';
|
|
12
5
|
|
|
@@ -37,7 +30,7 @@ export function devServerConfig(context: Context, overrides: Overrides): Result
|
|
|
37
30
|
function watchOptionsConfig() {
|
|
38
31
|
const watchIgnore = getPackages({ scope: getPackageName() })
|
|
39
32
|
.filter(({ type }) => type === PackageType.TSC)
|
|
40
|
-
.map(({ location }) =>
|
|
33
|
+
.map(({ location }) => location);
|
|
41
34
|
|
|
42
35
|
return watchIgnore.length ? { watchOptions: { ignored: watchIgnore } } : undefined;
|
|
43
36
|
}
|
|
@@ -3,16 +3,19 @@ import * as mockedFs from 'fs';
|
|
|
3
3
|
import { createPackage } from '../../../../__mocks__';
|
|
4
4
|
import { Context } from '../../types';
|
|
5
5
|
import { getStartupVersion } from '../get-startup-version';
|
|
6
|
+
import { getWebComponentsVersion } from '../get-web-components-version';
|
|
6
7
|
|
|
7
8
|
import { generateMetadata } from '../generate-metadata';
|
|
8
9
|
|
|
9
10
|
jest.mock('fs', () => fs);
|
|
10
11
|
jest.mock('../get-startup-version');
|
|
12
|
+
jest.mock('../get-web-components-version');
|
|
11
13
|
|
|
12
14
|
describe(`[startup] ${generateMetadata.name}`, () => {
|
|
13
15
|
const pkg = createPackage({});
|
|
14
16
|
const destination = 'dist';
|
|
15
17
|
const startupVersion = '1.0';
|
|
18
|
+
const webComponentsVersion = '2.0';
|
|
16
19
|
let context: Partial<Context>;
|
|
17
20
|
|
|
18
21
|
function generatedMetadata(destination: string) {
|
|
@@ -26,6 +29,7 @@ describe(`[startup] ${generateMetadata.name}`, () => {
|
|
|
26
29
|
beforeEach(() => {
|
|
27
30
|
vol.fromJSON(packageFS());
|
|
28
31
|
jest.mocked(getStartupVersion).mockReturnValue(startupVersion);
|
|
32
|
+
jest.mocked(getWebComponentsVersion).mockReturnValue(webComponentsVersion);
|
|
29
33
|
|
|
30
34
|
context = {
|
|
31
35
|
destination,
|
|
@@ -44,7 +48,10 @@ describe(`[startup] ${generateMetadata.name}`, () => {
|
|
|
44
48
|
|
|
45
49
|
expect(generatedMetadata(destination)).toEqual({
|
|
46
50
|
name: context.name,
|
|
47
|
-
bundledWith: {
|
|
51
|
+
bundledWith: {
|
|
52
|
+
'@servicetitan/startup': startupVersion,
|
|
53
|
+
'@servicetitan/web-components': webComponentsVersion,
|
|
54
|
+
},
|
|
48
55
|
dependencies: context.packageData!.dependencies,
|
|
49
56
|
sharedDependencies: context.sharedDependencies,
|
|
50
57
|
entrypoints: {},
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { fs, vol } from 'memfs';
|
|
2
|
+
|
|
3
|
+
import { getWebComponentsVersion } from '../get-web-components-version';
|
|
4
|
+
|
|
5
|
+
jest.mock('fs', () => fs);
|
|
6
|
+
|
|
7
|
+
describe(`[startup] ${getWebComponentsVersion.name}`, () => {
|
|
8
|
+
const webComponentsVersion = '1.2.3';
|
|
9
|
+
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
vol.fromJSON({
|
|
12
|
+
'packages/web-components/package.json': JSON.stringify({
|
|
13
|
+
version: webComponentsVersion,
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
afterEach(() => vol.reset());
|
|
19
|
+
|
|
20
|
+
const subject = () => getWebComponentsVersion();
|
|
21
|
+
|
|
22
|
+
test('returns version from @servicetitan/web-components package', () => {
|
|
23
|
+
expect(subject()).toEqual(webComponentsVersion);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -4,6 +4,7 @@ import { log, readJsonSafe } from '../../../utils';
|
|
|
4
4
|
import { Context } from '../types';
|
|
5
5
|
|
|
6
6
|
import { getStartupVersion } from './get-startup-version';
|
|
7
|
+
import { getWebComponentsVersion } from './get-web-components-version';
|
|
7
8
|
|
|
8
9
|
export function generateMetadata(context: Context) {
|
|
9
10
|
const { destination, name, packageData, sharedDependencies } = context;
|
|
@@ -17,7 +18,10 @@ export function generateMetadata(context: Context) {
|
|
|
17
18
|
const light = readJsonSafe(path.join(destination, 'bundle', 'light', 'entrypoints.json'));
|
|
18
19
|
const metadata = {
|
|
19
20
|
name,
|
|
20
|
-
bundledWith: {
|
|
21
|
+
bundledWith: {
|
|
22
|
+
'@servicetitan/startup': getStartupVersion(),
|
|
23
|
+
'@servicetitan/web-components': getWebComponentsVersion(),
|
|
24
|
+
},
|
|
21
25
|
sharedDependencies,
|
|
22
26
|
dependencies: packageData.dependencies,
|
|
23
27
|
entrypoints: { ...(full ? { full } : {}), ...(light ? { light } : {}) },
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
} from '../utils';
|
|
15
15
|
import {
|
|
16
16
|
Context,
|
|
17
|
+
amdConfig,
|
|
17
18
|
cacheConfig,
|
|
18
19
|
devServerConfig,
|
|
19
20
|
devtoolConfig,
|
|
@@ -74,6 +75,7 @@ export function createWebpackConfig(overrides: Overrides, options: Options = {})
|
|
|
74
75
|
pluginsConfig,
|
|
75
76
|
resolveConfig,
|
|
76
77
|
statsConfig,
|
|
78
|
+
amdConfig,
|
|
77
79
|
].reduce((result, fn) => ({ ...result, ...fn(context, overrides) }), {}),
|
|
78
80
|
configuration
|
|
79
81
|
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`expose-loader should work for a nested property for a global object: errors 1`] = `
|
|
3
|
+
exports[`expose-loader should work for a nested property for a global object: errors 1`] = `[]`;
|
|
4
4
|
|
|
5
5
|
exports[`expose-loader should work for a nested property for a global object: module 1`] = `
|
|
6
|
-
"var ___EXPOSE_LOADER_IMPORT___ = require(
|
|
7
|
-
var ___EXPOSE_LOADER_GLOBAL_THIS___ = require(
|
|
6
|
+
"var ___EXPOSE_LOADER_IMPORT___ = require("-!./configuration.expose-loader.js");
|
|
7
|
+
var ___EXPOSE_LOADER_GLOBAL_THIS___ = require("../../runtime/get-global-this.ts");
|
|
8
8
|
var ___EXPOSE_LOADER_STORAGE_KEY___ = Symbol.for('SERVICETITAN_EXPOSE_LOADER_STORAGE');
|
|
9
9
|
if (___EXPOSE_LOADER_GLOBAL_THIS___[___EXPOSE_LOADER_STORAGE_KEY___] === undefined) {
|
|
10
10
|
___EXPOSE_LOADER_GLOBAL_THIS___[___EXPOSE_LOADER_STORAGE_KEY___] = Object.assign(
|
|
@@ -48,7 +48,7 @@ ___EXPOSE_LOADER_GLOBAL_THIS___.SharedDependencies.Configuration = new Proxy(
|
|
|
48
48
|
if (prop === 'getStorage') {
|
|
49
49
|
return Reflect.get(target, prop, receiver);
|
|
50
50
|
}
|
|
51
|
-
return getModule(require.resolveWeak(
|
|
51
|
+
return getModule(require.resolveWeak("-!./configuration.expose-loader.js"))
|
|
52
52
|
},
|
|
53
53
|
}
|
|
54
54
|
);
|
|
@@ -57,8 +57,8 @@ module.exports = ___EXPOSE_LOADER_IMPORT___;
|
|
|
57
57
|
`;
|
|
58
58
|
|
|
59
59
|
exports[`expose-loader should work for a nested property for a global object: result 1`] = `
|
|
60
|
-
|
|
61
|
-
"configuration":
|
|
60
|
+
{
|
|
61
|
+
"configuration": {
|
|
62
62
|
"get": [Function],
|
|
63
63
|
"set": [Function],
|
|
64
64
|
"version": "1.0.0",
|
|
@@ -66,13 +66,13 @@ Object {
|
|
|
66
66
|
}
|
|
67
67
|
`;
|
|
68
68
|
|
|
69
|
-
exports[`expose-loader should work for a nested property for a global object: warnings 1`] = `
|
|
69
|
+
exports[`expose-loader should work for a nested property for a global object: warnings 1`] = `[]`;
|
|
70
70
|
|
|
71
|
-
exports[`expose-loader should work: errors 1`] = `
|
|
71
|
+
exports[`expose-loader should work: errors 1`] = `[]`;
|
|
72
72
|
|
|
73
73
|
exports[`expose-loader should work: module 1`] = `
|
|
74
|
-
"var ___EXPOSE_LOADER_IMPORT___ = require(
|
|
75
|
-
var ___EXPOSE_LOADER_GLOBAL_THIS___ = require(
|
|
74
|
+
"var ___EXPOSE_LOADER_IMPORT___ = require("-!./configuration.expose-loader.js");
|
|
75
|
+
var ___EXPOSE_LOADER_GLOBAL_THIS___ = require("../../runtime/get-global-this.ts");
|
|
76
76
|
var ___EXPOSE_LOADER_STORAGE_KEY___ = Symbol.for('SERVICETITAN_EXPOSE_LOADER_STORAGE');
|
|
77
77
|
if (___EXPOSE_LOADER_GLOBAL_THIS___[___EXPOSE_LOADER_STORAGE_KEY___] === undefined) {
|
|
78
78
|
___EXPOSE_LOADER_GLOBAL_THIS___[___EXPOSE_LOADER_STORAGE_KEY___] = Object.assign(
|
|
@@ -113,7 +113,7 @@ ___EXPOSE_LOADER_GLOBAL_THIS___.Configuration = new Proxy(
|
|
|
113
113
|
if (prop === 'getStorage') {
|
|
114
114
|
return Reflect.get(target, prop, receiver);
|
|
115
115
|
}
|
|
116
|
-
return getModule(require.resolveWeak(
|
|
116
|
+
return getModule(require.resolveWeak("-!./configuration.expose-loader.js"))
|
|
117
117
|
},
|
|
118
118
|
}
|
|
119
119
|
);
|
|
@@ -122,8 +122,8 @@ module.exports = ___EXPOSE_LOADER_IMPORT___;
|
|
|
122
122
|
`;
|
|
123
123
|
|
|
124
124
|
exports[`expose-loader should work: result 1`] = `
|
|
125
|
-
|
|
126
|
-
"configuration":
|
|
125
|
+
{
|
|
126
|
+
"configuration": {
|
|
127
127
|
"get": [Function],
|
|
128
128
|
"set": [Function],
|
|
129
129
|
"version": "1.0.0",
|
|
@@ -131,4 +131,4 @@ Object {
|
|
|
131
131
|
}
|
|
132
132
|
`;
|
|
133
133
|
|
|
134
|
-
exports[`expose-loader should work: warnings 1`] = `
|
|
134
|
+
exports[`expose-loader should work: warnings 1`] = `[]`;
|
|
@@ -14,5 +14,5 @@ function removeCWD(str: string) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export function normalizeErrors(errors: WebpackError[]) {
|
|
17
|
-
return errors.map(error => removeCWD(error.
|
|
17
|
+
return errors.map(error => removeCWD(error.message.split('\n').slice(0, 2).join('\n')));
|
|
18
18
|
}
|
package/template/.gitignore
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/coverage
|