@servicetitan/startup 36.1.1 → 36.1.2-canary.2
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/bin/_run.js +77 -0
- package/bin/cpx.js +3 -0
- package/bin/eslint.js +3 -0
- package/bin/jest.js +3 -0
- package/bin/js-yaml.js +3 -0
- package/bin/json5.js +3 -0
- package/bin/kendo-ui-license.js +3 -0
- package/bin/lerna.js +3 -0
- package/bin/lessc.js +3 -0
- package/bin/patch-package.js +3 -0
- package/bin/prettier.js +3 -0
- package/bin/sass.js +3 -0
- package/bin/semver.js +3 -0
- package/bin/spack.js +3 -0
- package/bin/stylelint.js +3 -0
- package/bin/swc.js +3 -0
- package/bin/swcx.js +3 -0
- package/bin/tcm.js +3 -0
- package/bin/ts-jest.js +3 -0
- package/bin/ts-node-cwd.js +3 -0
- package/bin/ts-node-esm.js +3 -0
- package/bin/ts-node-script.js +3 -0
- package/bin/ts-node-transpile-only.js +3 -0
- package/bin/ts-node.js +3 -0
- package/bin/ts-script.js +3 -0
- package/bin/tsc.js +3 -0
- package/bin/tsserver.js +3 -0
- package/bin/vitest.js +3 -0
- package/bin/webpack-bundle-analyzer.js +3 -0
- package/bin/webpack-dev-server.js +3 -0
- package/bin/webpack.js +3 -0
- package/dist/cli/commands/clean.d.ts +1 -0
- package/dist/cli/commands/clean.d.ts.map +1 -1
- package/dist/cli/commands/clean.js +18 -8
- package/dist/cli/commands/clean.js.map +1 -1
- package/dist/cli/commands/coverage-finalize.d.ts +16 -0
- package/dist/cli/commands/coverage-finalize.d.ts.map +1 -0
- package/dist/cli/commands/coverage-finalize.js +41 -0
- package/dist/cli/commands/coverage-finalize.js.map +1 -0
- package/dist/cli/commands/install.js +1 -1
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/kendo-ui-license.js +1 -2
- package/dist/cli/commands/kendo-ui-license.js.map +1 -1
- package/dist/cli/commands/prepare-package.js +2 -2
- package/dist/cli/commands/prepare-package.js.map +1 -1
- package/dist/cli/commands/registry/coverage-finalize.d.ts +5 -0
- package/dist/cli/commands/registry/coverage-finalize.d.ts.map +1 -0
- package/dist/cli/commands/registry/coverage-finalize.js +17 -0
- package/dist/cli/commands/registry/coverage-finalize.js.map +1 -0
- package/dist/cli/commands/review/review.d.ts.map +1 -1
- package/dist/cli/commands/review/review.js +8 -7
- package/dist/cli/commands/review/review.js.map +1 -1
- package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.d.ts +0 -1
- package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.d.ts.map +1 -1
- package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js +12 -18
- package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js.map +1 -1
- package/dist/cli/commands/review/rules/require-project-version-in-root-node-modules.d.ts.map +1 -1
- package/dist/cli/commands/review/rules/require-project-version-in-root-node-modules.js +9 -4
- package/dist/cli/commands/review/rules/require-project-version-in-root-node-modules.js.map +1 -1
- package/dist/cli/commands/review/types.d.ts +2 -8
- package/dist/cli/commands/review/types.d.ts.map +1 -1
- package/dist/cli/commands/review/types.js.map +1 -1
- package/dist/cli/utils/index.d.ts +0 -3
- package/dist/cli/utils/index.d.ts.map +1 -1
- package/dist/cli/utils/index.js +0 -3
- package/dist/cli/utils/index.js.map +1 -1
- package/dist/cypress/config/webpack-config.js +0 -1
- package/dist/cypress/config/webpack-config.js.map +1 -1
- package/dist/storybook-config/webpack-final.d.ts.map +1 -1
- package/dist/storybook-config/webpack-final.js +0 -6
- package/dist/storybook-config/webpack-final.js.map +1 -1
- package/dist/utils/default-excludes.d.ts +14 -0
- package/dist/utils/default-excludes.d.ts.map +1 -0
- package/dist/utils/default-excludes.js +23 -0
- package/dist/utils/default-excludes.js.map +1 -0
- package/dist/utils/find-packages.d.ts.map +1 -1
- package/dist/utils/find-packages.js +15 -0
- package/dist/utils/find-packages.js.map +1 -1
- package/dist/utils/get-coverage-aliases.d.ts +23 -0
- package/dist/utils/get-coverage-aliases.d.ts.map +1 -0
- package/dist/utils/get-coverage-aliases.js +41 -0
- package/dist/utils/get-coverage-aliases.js.map +1 -0
- package/dist/utils/get-coverage-source-patterns.d.ts +21 -0
- package/dist/utils/get-coverage-source-patterns.d.ts.map +1 -0
- package/dist/utils/get-coverage-source-patterns.js +39 -0
- package/dist/utils/get-coverage-source-patterns.js.map +1 -0
- package/dist/utils/get-jest-config.d.ts.map +1 -1
- package/dist/utils/get-jest-config.js +2 -1
- package/dist/utils/get-jest-config.js.map +1 -1
- package/dist/utils/prettify.js +1 -1
- package/dist/utils/prettify.js.map +1 -1
- package/dist/webpack/configs/cache-config.d.ts.map +1 -1
- package/dist/webpack/configs/cache-config.js +3 -1
- package/dist/webpack/configs/cache-config.js.map +1 -1
- package/dist/webpack/configs/rules/ts-coverage-rules.d.ts +22 -0
- package/dist/webpack/configs/rules/ts-coverage-rules.d.ts.map +1 -0
- package/dist/webpack/configs/rules/ts-coverage-rules.js +48 -0
- package/dist/webpack/configs/rules/ts-coverage-rules.js.map +1 -0
- package/eslint/config.mjs +2 -0
- package/package.json +54 -18
- package/src/__tests__/postinstall.test.ts +173 -0
- package/src/cli/commands/__tests__/clean.test.ts +30 -12
- package/src/cli/commands/__tests__/install.test.ts +3 -1
- package/src/cli/commands/__tests__/kendo-ui-license.test.ts +4 -4
- package/src/cli/commands/__tests__/prepare-package.test.ts +2 -3
- package/src/cli/commands/clean.ts +18 -9
- package/src/cli/commands/install.ts +1 -1
- package/src/cli/commands/kendo-ui-license.ts +1 -1
- package/src/cli/commands/prepare-package.ts +1 -1
- package/src/cli/commands/review/__mocks__/index.ts +1 -0
- package/src/cli/commands/review/__mocks__/mock-package-manager.ts +20 -0
- package/src/cli/commands/review/__tests__/review.test.ts +23 -31
- package/src/cli/commands/review/review.ts +11 -7
- package/src/cli/commands/review/rules/__mocks__/mock-project.ts +2 -1
- package/src/cli/commands/review/rules/__tests__/require-compatible-launch-darkly-sdk.test.ts +39 -49
- package/src/cli/commands/review/rules/__tests__/require-project-version-in-root-node-modules.test.ts +35 -22
- package/src/cli/commands/review/rules/require-compatible-launch-darkly-sdk.ts +13 -28
- package/src/cli/commands/review/rules/require-project-version-in-root-node-modules.ts +10 -3
- package/src/cli/commands/review/types.ts +3 -12
- package/src/cli/utils/index.ts +10 -3
- package/src/cypress/config/__tests__/webpack-config.test.ts +0 -9
- package/src/cypress/config/webpack-config.ts +0 -1
- package/src/postinstall.js +106 -14
- package/src/scripts/__tests__/generate-bin-wrappers.test.ts +226 -0
- package/src/scripts/generate-bin-wrappers.js +205 -0
- package/src/storybook-config/__tests__/webpack-final.test.ts +0 -25
- package/src/storybook-config/webpack-final.ts +0 -4
- package/src/utils/__tests__/get-jest-config.test.ts +3 -1
- package/src/utils/__tests__/get-packages.test.ts +47 -2
- package/src/utils/__tests__/prettify.test.ts +1 -1
- package/src/utils/find-packages.ts +16 -0
- package/src/utils/get-jest-config.ts +4 -1
- package/src/utils/prettify.ts +1 -1
- package/src/webpack/configs/cache-config.ts +3 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-coverage-aliases.d.ts","sourceRoot":"","sources":["../../src/utils/get-coverage-aliases.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAuB3D"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "getCoverageAliases", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return getCoverageAliases;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _nodefs = /*#__PURE__*/ _interop_require_default(require("node:fs"));
|
|
12
|
+
const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
|
|
13
|
+
const _findpackages = require("./find-packages");
|
|
14
|
+
const _gettsconfig = require("./get-tsconfig");
|
|
15
|
+
const _readjson = require("./read-json");
|
|
16
|
+
function _interop_require_default(obj) {
|
|
17
|
+
return obj && obj.__esModule ? obj : {
|
|
18
|
+
default: obj
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function getCoverageAliases() {
|
|
22
|
+
const packages = (0, _findpackages.findPackages)();
|
|
23
|
+
const aliases = {};
|
|
24
|
+
for (const pkg of packages){
|
|
25
|
+
var _tsConfig_compilerOptions;
|
|
26
|
+
// Only alias packages that are consumed as libraries (have a main entry point).
|
|
27
|
+
// Apps / webpack bundles have no main and are never imported by other packages.
|
|
28
|
+
if (!pkg.main) continue;
|
|
29
|
+
const tsConfigPath = (0, _gettsconfig.getTsConfig)(pkg.location);
|
|
30
|
+
if (!_nodefs.default.existsSync(tsConfigPath)) continue;
|
|
31
|
+
const tsConfig = (0, _readjson.readJsonSafe)(tsConfigPath);
|
|
32
|
+
const rootDir = tsConfig === null || tsConfig === void 0 ? void 0 : (_tsConfig_compilerOptions = tsConfig.compilerOptions) === null || _tsConfig_compilerOptions === void 0 ? void 0 : _tsConfig_compilerOptions.rootDir;
|
|
33
|
+
if (!rootDir) continue;
|
|
34
|
+
const srcDir = _nodepath.default.resolve(pkg.location, rootDir);
|
|
35
|
+
if (!_nodefs.default.existsSync(srcDir)) continue;
|
|
36
|
+
aliases[pkg.name] = srcDir;
|
|
37
|
+
}
|
|
38
|
+
return aliases;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=get-coverage-aliases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/get-coverage-aliases.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport { findPackages } from './find-packages';\nimport { getTsConfig } from './get-tsconfig';\nimport { readJsonSafe } from './read-json';\n\n/**\n * Returns a webpack `resolve.alias` map that redirects workspace package imports\n * to their TypeScript source directories when building with code coverage enabled.\n *\n * For each workspace package that declares a `main` entry point, this function:\n * 1. Reads `compilerOptions.rootDir` from the package's tsconfig\n * 2. Builds an alias from the package name to its resolved source root directory\n *\n * This ensures that the coverage-istanbul-loader instruments the original TypeScript\n * source files (rather than compiled `dist/*.js` output), so coverage data contains\n * correct `src/` file paths and TypeScript source positions — matching what jest and\n * vitest produce.\n *\n * Only packages with both a `main` field and a tsconfig `compilerOptions.rootDir`\n * are included. Packages without `main` (e.g. webpack bundle apps) are skipped\n * since they are not imported by other packages and need no alias.\n *\n * Example: for a package `@scope/common` at `packages/common` with\n * `tsconfig.json` containing `{ \"compilerOptions\": { \"rootDir\": \"src\" } }`,\n * the returned alias is `{ \"@scope/common\": \"/abs/path/packages/common/src\" }`.\n */\nexport function getCoverageAliases(): Record<string, string> {\n const packages = findPackages();\n const aliases: Record<string, string> = {};\n\n for (const pkg of packages) {\n // Only alias packages that are consumed as libraries (have a main entry point).\n // Apps / webpack bundles have no main and are never imported by other packages.\n if (!pkg.main) continue;\n\n const tsConfigPath = getTsConfig(pkg.location);\n if (!fs.existsSync(tsConfigPath)) continue;\n\n const tsConfig = readJsonSafe<{ compilerOptions?: { rootDir?: string } }>(tsConfigPath);\n const rootDir = tsConfig?.compilerOptions?.rootDir;\n if (!rootDir) continue;\n\n const srcDir = path.resolve(pkg.location, rootDir);\n if (!fs.existsSync(srcDir)) continue;\n\n aliases[pkg.name] = srcDir;\n }\n\n return aliases;\n}\n"],"names":["getCoverageAliases","packages","findPackages","aliases","pkg","tsConfig","main","tsConfigPath","getTsConfig","location","fs","existsSync","readJsonSafe","rootDir","compilerOptions","srcDir","path","resolve","name"],"mappings":";;;;+BA2BgBA;;;eAAAA;;;+DA3BD;iEACE;8BACY;6BACD;0BACC;;;;;;AAuBtB,SAASA;IACZ,MAAMC,WAAWC,IAAAA,0BAAY;IAC7B,MAAMC,UAAkC,CAAC;IAEzC,KAAK,MAAMC,OAAOH,SAAU;YASRI;QARhB,gFAAgF;QAChF,gFAAgF;QAChF,IAAI,CAACD,IAAIE,IAAI,EAAE;QAEf,MAAMC,eAAeC,IAAAA,wBAAW,EAACJ,IAAIK,QAAQ;QAC7C,IAAI,CAACC,eAAE,CAACC,UAAU,CAACJ,eAAe;QAElC,MAAMF,WAAWO,IAAAA,sBAAY,EAA6CL;QAC1E,MAAMM,UAAUR,qBAAAA,gCAAAA,4BAAAA,SAAUS,eAAe,cAAzBT,gDAAAA,0BAA2BQ,OAAO;QAClD,IAAI,CAACA,SAAS;QAEd,MAAME,SAASC,iBAAI,CAACC,OAAO,CAACb,IAAIK,QAAQ,EAAEI;QAC1C,IAAI,CAACH,eAAE,CAACC,UAAU,CAACI,SAAS;QAE5BZ,OAAO,CAACC,IAAIc,IAAI,CAAC,GAAGH;IACxB;IAEA,OAAOZ;AACX"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns glob patterns scoped to each workspace package's source directory,
|
|
3
|
+
* suitable for use as `collectCoverageFrom` (Jest) or `coverage.include` (Vitest).
|
|
4
|
+
*
|
|
5
|
+
* The source directory is read from `compilerOptions.rootDir` in each package's
|
|
6
|
+
* tsconfig rather than assumed to be `src/`, since rootDir is configurable.
|
|
7
|
+
* Falls back to `src` if no rootDir is found.
|
|
8
|
+
*
|
|
9
|
+
* Patterns are relative to `process.cwd()` (the project root). For a workspace
|
|
10
|
+
* whose resolved location is `/root/packages/application` with rootDir `src`,
|
|
11
|
+
* the returned pattern is `packages/application/src/**\/*.{ts,tsx}`.
|
|
12
|
+
*
|
|
13
|
+
* This avoids collecting coverage for unrelated files such as `.yalc/`,
|
|
14
|
+
* `node_modules/`, config files in the repo root, `.storybook/`, etc.
|
|
15
|
+
*
|
|
16
|
+
* If no workspace packages are found (e.g. a single-package repo without a
|
|
17
|
+
* workspaces config) the function falls back to `['**\/*.{ts,tsx}']` so that
|
|
18
|
+
* coverage collection still works.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getCoverageSourcePatterns(): string[];
|
|
21
|
+
//# sourceMappingURL=get-coverage-source-patterns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-coverage-source-patterns.d.ts","sourceRoot":"","sources":["../../src/utils/get-coverage-source-patterns.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,EAAE,CAiBpD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "getCoverageSourcePatterns", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return getCoverageSourcePatterns;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _nodefs = /*#__PURE__*/ _interop_require_default(require("node:fs"));
|
|
12
|
+
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
13
|
+
const _findpackages = require("./find-packages");
|
|
14
|
+
const _gettsconfig = require("./get-tsconfig");
|
|
15
|
+
const _readjson = require("./read-json");
|
|
16
|
+
function _interop_require_default(obj) {
|
|
17
|
+
return obj && obj.__esModule ? obj : {
|
|
18
|
+
default: obj
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function getCoverageSourcePatterns() {
|
|
22
|
+
const packages = (0, _findpackages.findPackages)();
|
|
23
|
+
if (packages.length === 0) {
|
|
24
|
+
return [
|
|
25
|
+
'**/*.{ts,tsx}'
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
return packages.map((pkg)=>{
|
|
29
|
+
var _ref;
|
|
30
|
+
var _tsConfig_compilerOptions;
|
|
31
|
+
const tsConfigPath = (0, _gettsconfig.getTsConfig)(pkg.location);
|
|
32
|
+
const tsConfig = _nodefs.default.existsSync(tsConfigPath) ? (0, _readjson.readJsonSafe)(tsConfigPath) : undefined;
|
|
33
|
+
const rootDir = (_ref = tsConfig === null || tsConfig === void 0 ? void 0 : (_tsConfig_compilerOptions = tsConfig.compilerOptions) === null || _tsConfig_compilerOptions === void 0 ? void 0 : _tsConfig_compilerOptions.rootDir) !== null && _ref !== void 0 ? _ref : 'src';
|
|
34
|
+
const rel = _path.default.relative(process.cwd(), pkg.location).replace(/\\/g, '/');
|
|
35
|
+
return `${rel}/${rootDir}/**/*.{ts,tsx}`;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=get-coverage-source-patterns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/get-coverage-source-patterns.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'path';\nimport { findPackages } from './find-packages';\nimport { getTsConfig } from './get-tsconfig';\nimport { readJsonSafe } from './read-json';\n\n/**\n * Returns glob patterns scoped to each workspace package's source directory,\n * suitable for use as `collectCoverageFrom` (Jest) or `coverage.include` (Vitest).\n *\n * The source directory is read from `compilerOptions.rootDir` in each package's\n * tsconfig rather than assumed to be `src/`, since rootDir is configurable.\n * Falls back to `src` if no rootDir is found.\n *\n * Patterns are relative to `process.cwd()` (the project root). For a workspace\n * whose resolved location is `/root/packages/application` with rootDir `src`,\n * the returned pattern is `packages/application/src/**\\/*.{ts,tsx}`.\n *\n * This avoids collecting coverage for unrelated files such as `.yalc/`,\n * `node_modules/`, config files in the repo root, `.storybook/`, etc.\n *\n * If no workspace packages are found (e.g. a single-package repo without a\n * workspaces config) the function falls back to `['**\\/*.{ts,tsx}']` so that\n * coverage collection still works.\n */\nexport function getCoverageSourcePatterns(): string[] {\n const packages = findPackages();\n\n if (packages.length === 0) {\n return ['**/*.{ts,tsx}'];\n }\n\n return packages.map(pkg => {\n const tsConfigPath = getTsConfig(pkg.location);\n const tsConfig = fs.existsSync(tsConfigPath)\n ? readJsonSafe<{ compilerOptions?: { rootDir?: string } }>(tsConfigPath)\n : undefined;\n const rootDir = tsConfig?.compilerOptions?.rootDir ?? 'src';\n\n const rel = path.relative(process.cwd(), pkg.location).replace(/\\\\/g, '/');\n return `${rel}/${rootDir}/**/*.{ts,tsx}`;\n });\n}\n"],"names":["getCoverageSourcePatterns","packages","findPackages","length","map","pkg","tsConfig","tsConfigPath","getTsConfig","location","fs","existsSync","readJsonSafe","undefined","rootDir","compilerOptions","rel","path","relative","process","cwd","replace"],"mappings":";;;;+BAyBgBA;;;eAAAA;;;+DAzBD;6DACE;8BACY;6BACD;0BACC;;;;;;AAqBtB,SAASA;IACZ,MAAMC,WAAWC,IAAAA,0BAAY;IAE7B,IAAID,SAASE,MAAM,KAAK,GAAG;QACvB,OAAO;YAAC;SAAgB;IAC5B;IAEA,OAAOF,SAASG,GAAG,CAACC,CAAAA;;YAKAC;QAJhB,MAAMC,eAAeC,IAAAA,wBAAW,EAACH,IAAII,QAAQ;QAC7C,MAAMH,WAAWI,eAAE,CAACC,UAAU,CAACJ,gBACzBK,IAAAA,sBAAY,EAA6CL,gBACzDM;QACN,MAAMC,kBAAUR,qBAAAA,gCAAAA,4BAAAA,SAAUS,eAAe,cAAzBT,gDAAAA,0BAA2BQ,OAAO,uCAAI;QAEtD,MAAME,MAAMC,aAAI,CAACC,QAAQ,CAACC,QAAQC,GAAG,IAAIf,IAAII,QAAQ,EAAEY,OAAO,CAAC,OAAO;QACtE,OAAO,GAAGL,IAAI,CAAC,EAAEF,QAAQ,cAAc,CAAC;IAC5C;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-jest-config.d.ts","sourceRoot":"","sources":["../../src/utils/get-jest-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"get-jest-config.d.ts","sourceRoot":"","sources":["../../src/utils/get-jest-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAoCrC;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAoC/D"}
|
|
@@ -51,8 +51,9 @@ function getDefaultJestConfiguration() {
|
|
|
51
51
|
...(0, _getdestinationfolders.getDestinationFolders)()
|
|
52
52
|
],
|
|
53
53
|
testRunner: 'jest-circus/runner',
|
|
54
|
+
// Under pnpm, dependencies are nested (e.g. node_modules/.pnpm/…/node_modules/pkg); the extra lookahead skips the inner node_modules.
|
|
54
55
|
transformIgnorePatterns: [
|
|
55
|
-
'node_modules/(?!(@servicetitan|@react-hook|nanoid|axios)/)'
|
|
56
|
+
'node_modules/(?!.*node_modules/)(?!(@servicetitan|@react-hook|nanoid|axios)/)'
|
|
56
57
|
],
|
|
57
58
|
verbose: true
|
|
58
59
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/get-jest-config.ts"],"sourcesContent":["import { Config } from '@jest/types';\nimport path from 'path';\nimport { getJestConfiguration } from './get-configuration';\nimport { getDestinationFolders } from './get-destination-folders';\nimport { omit } from './omit';\nimport { toArray } from './to-array';\n\nfunction getDefaultJestConfiguration() {\n const moduleNameMapper = {\n '\\\\.(css|scss|less|png|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$': 'identity-obj-proxy',\n };\n\n return {\n collectCoverageFrom: ['**/*.{ts,tsx}'],\n coveragePathIgnorePatterns: ['^.+\\\\.d\\\\.ts$'],\n coverageReporters: ['html-spa', 'text', 'json', 'cobertura', 'lcov'],\n moduleNameMapper,\n modulePathIgnorePatterns: ['<rootDir>/.*/__mocks__'],\n preset: path.join(__dirname, '../../jest'),\n resolver: '@servicetitan/startup/jest-resolver',\n setupFiles: [path.join(__dirname, '../../jest/setup.js')],\n testEnvironment: 'jsdom',\n testPathIgnorePatterns: ['\\\\.yalc', ...getDestinationFolders()],\n testRunner: 'jest-circus/runner',\n transformIgnorePatterns: ['node_modules/(?!(@servicetitan|@react-hook|nanoid|axios)/)'],\n verbose: true,\n } as Omit<Config.Argv, 'collectCoverageFrom' | 'moduleNameMapper' | 'setupFiles'> & {\n collectCoverageFrom: string[];\n moduleNameMapper: Record<string, string>;\n setupFiles: string[];\n };\n}\n\n/**\n * Get Jest config for running it using jest CLI (see jest runCLI function)\n */\nexport function getJestConfigCLI(args: Config.Argv): Config.Argv {\n const {\n coveragePathIgnorePatterns,\n omitDefault = [],\n setupFiles,\n testPathIgnorePatterns,\n ...config\n } = {\n ...getJestConfiguration(),\n ...args,\n };\n\n const defaultConfig = omit(getDefaultJestConfiguration(), omitDefault);\n\n let moduleNameMapper: Record<string, string> | undefined =\n typeof config.moduleNameMapper === 'string'\n ? JSON.parse(config.moduleNameMapper)\n : config.moduleNameMapper;\n\n if (defaultConfig.moduleNameMapper) {\n moduleNameMapper = { ...moduleNameMapper, ...defaultConfig.moduleNameMapper };\n }\n\n const reporters: string[] | undefined =\n typeof config.reporters === 'string' ? [config.reporters] : config.reporters;\n\n return stringifyForCLI({\n ...mergeArrayValues(defaultConfig, {\n coveragePathIgnorePatterns,\n setupFiles,\n testPathIgnorePatterns,\n }),\n ...config,\n ...(moduleNameMapper ? { moduleNameMapper } : {}),\n ...(reporters ? { reporters } : {}),\n });\n}\n\nfunction mergeArrayValues(\n config: any,\n arrayValues: {\n coveragePathIgnorePatterns?: string | string[];\n setupFiles?: string | string[];\n testPathIgnorePatterns?: string | string[];\n }\n) {\n return Object.keys(arrayValues).reduce((result, key: keyof typeof arrayValues) => {\n const newValue = arrayValues[key];\n if (newValue) {\n result[key] = [...toArray(result[key]), ...toArray(newValue)];\n }\n return result;\n }, config);\n}\n\nfunction stringifyForCLI(config: any): Config.Argv {\n return ['collectCoverageFrom', 'globals', 'moduleNameMapper', 'transform'].reduce(\n (result, key) => {\n const value = result[key];\n if (value && typeof value !== 'string') {\n result[key] = JSON.stringify(result[key]);\n }\n return result;\n },\n config\n );\n}\n"],"names":["getJestConfigCLI","getDefaultJestConfiguration","moduleNameMapper","collectCoverageFrom","coveragePathIgnorePatterns","coverageReporters","modulePathIgnorePatterns","preset","path","join","__dirname","resolver","setupFiles","testEnvironment","testPathIgnorePatterns","getDestinationFolders","testRunner","transformIgnorePatterns","verbose","args","omitDefault","config","getJestConfiguration","defaultConfig","omit","JSON","parse","reporters","stringifyForCLI","mergeArrayValues","arrayValues","Object","keys","reduce","result","key","newValue","toArray","value","stringify"],"mappings":";;;;+
|
|
1
|
+
{"version":3,"sources":["../../src/utils/get-jest-config.ts"],"sourcesContent":["import { Config } from '@jest/types';\nimport path from 'path';\nimport { getJestConfiguration } from './get-configuration';\nimport { getDestinationFolders } from './get-destination-folders';\nimport { omit } from './omit';\nimport { toArray } from './to-array';\n\nfunction getDefaultJestConfiguration() {\n const moduleNameMapper = {\n '\\\\.(css|scss|less|png|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$': 'identity-obj-proxy',\n };\n\n return {\n collectCoverageFrom: ['**/*.{ts,tsx}'],\n coveragePathIgnorePatterns: ['^.+\\\\.d\\\\.ts$'],\n coverageReporters: ['html-spa', 'text', 'json', 'cobertura', 'lcov'],\n moduleNameMapper,\n modulePathIgnorePatterns: ['<rootDir>/.*/__mocks__'],\n preset: path.join(__dirname, '../../jest'),\n resolver: '@servicetitan/startup/jest-resolver',\n setupFiles: [path.join(__dirname, '../../jest/setup.js')],\n testEnvironment: 'jsdom',\n testPathIgnorePatterns: ['\\\\.yalc', ...getDestinationFolders()],\n testRunner: 'jest-circus/runner',\n // Under pnpm, dependencies are nested (e.g. node_modules/.pnpm/…/node_modules/pkg); the extra lookahead skips the inner node_modules.\n transformIgnorePatterns: [\n 'node_modules/(?!.*node_modules/)(?!(@servicetitan|@react-hook|nanoid|axios)/)',\n ],\n verbose: true,\n } as Omit<Config.Argv, 'collectCoverageFrom' | 'moduleNameMapper' | 'setupFiles'> & {\n collectCoverageFrom: string[];\n moduleNameMapper: Record<string, string>;\n setupFiles: string[];\n };\n}\n\n/**\n * Get Jest config for running it using jest CLI (see jest runCLI function)\n */\nexport function getJestConfigCLI(args: Config.Argv): Config.Argv {\n const {\n coveragePathIgnorePatterns,\n omitDefault = [],\n setupFiles,\n testPathIgnorePatterns,\n ...config\n } = {\n ...getJestConfiguration(),\n ...args,\n };\n\n const defaultConfig = omit(getDefaultJestConfiguration(), omitDefault);\n\n let moduleNameMapper: Record<string, string> | undefined =\n typeof config.moduleNameMapper === 'string'\n ? JSON.parse(config.moduleNameMapper)\n : config.moduleNameMapper;\n\n if (defaultConfig.moduleNameMapper) {\n moduleNameMapper = { ...moduleNameMapper, ...defaultConfig.moduleNameMapper };\n }\n\n const reporters: string[] | undefined =\n typeof config.reporters === 'string' ? [config.reporters] : config.reporters;\n\n return stringifyForCLI({\n ...mergeArrayValues(defaultConfig, {\n coveragePathIgnorePatterns,\n setupFiles,\n testPathIgnorePatterns,\n }),\n ...config,\n ...(moduleNameMapper ? { moduleNameMapper } : {}),\n ...(reporters ? { reporters } : {}),\n });\n}\n\nfunction mergeArrayValues(\n config: any,\n arrayValues: {\n coveragePathIgnorePatterns?: string | string[];\n setupFiles?: string | string[];\n testPathIgnorePatterns?: string | string[];\n }\n) {\n return Object.keys(arrayValues).reduce((result, key: keyof typeof arrayValues) => {\n const newValue = arrayValues[key];\n if (newValue) {\n result[key] = [...toArray(result[key]), ...toArray(newValue)];\n }\n return result;\n }, config);\n}\n\nfunction stringifyForCLI(config: any): Config.Argv {\n return ['collectCoverageFrom', 'globals', 'moduleNameMapper', 'transform'].reduce(\n (result, key) => {\n const value = result[key];\n if (value && typeof value !== 'string') {\n result[key] = JSON.stringify(result[key]);\n }\n return result;\n },\n config\n );\n}\n"],"names":["getJestConfigCLI","getDefaultJestConfiguration","moduleNameMapper","collectCoverageFrom","coveragePathIgnorePatterns","coverageReporters","modulePathIgnorePatterns","preset","path","join","__dirname","resolver","setupFiles","testEnvironment","testPathIgnorePatterns","getDestinationFolders","testRunner","transformIgnorePatterns","verbose","args","omitDefault","config","getJestConfiguration","defaultConfig","omit","JSON","parse","reporters","stringifyForCLI","mergeArrayValues","arrayValues","Object","keys","reduce","result","key","newValue","toArray","value","stringify"],"mappings":";;;;+BAuCgBA;;;eAAAA;;;6DAtCC;kCACoB;uCACC;sBACjB;yBACG;;;;;;AAExB,SAASC;IACL,MAAMC,mBAAmB;QACrB,+DAA+D;IACnE;IAEA,OAAO;QACHC,qBAAqB;YAAC;SAAgB;QACtCC,4BAA4B;YAAC;SAAgB;QAC7CC,mBAAmB;YAAC;YAAY;YAAQ;YAAQ;YAAa;SAAO;QACpEH;QACAI,0BAA0B;YAAC;SAAyB;QACpDC,QAAQC,aAAI,CAACC,IAAI,CAACC,WAAW;QAC7BC,UAAU;QACVC,YAAY;YAACJ,aAAI,CAACC,IAAI,CAACC,WAAW;SAAuB;QACzDG,iBAAiB;QACjBC,wBAAwB;YAAC;eAAcC,IAAAA,4CAAqB;SAAG;QAC/DC,YAAY;QACZ,sIAAsI;QACtIC,yBAAyB;YACrB;SACH;QACDC,SAAS;IACb;AAKJ;AAKO,SAASlB,iBAAiBmB,IAAiB;IAC9C,MAAM,EACFf,0BAA0B,EAC1BgB,cAAc,EAAE,EAChBR,UAAU,EACVE,sBAAsB,EACtB,GAAGO,QACN,GAAG;QACA,GAAGC,IAAAA,sCAAoB,GAAE;QACzB,GAAGH,IAAI;IACX;IAEA,MAAMI,gBAAgBC,IAAAA,UAAI,EAACvB,+BAA+BmB;IAE1D,IAAIlB,mBACA,OAAOmB,OAAOnB,gBAAgB,KAAK,WAC7BuB,KAAKC,KAAK,CAACL,OAAOnB,gBAAgB,IAClCmB,OAAOnB,gBAAgB;IAEjC,IAAIqB,cAAcrB,gBAAgB,EAAE;QAChCA,mBAAmB;YAAE,GAAGA,gBAAgB;YAAE,GAAGqB,cAAcrB,gBAAgB;QAAC;IAChF;IAEA,MAAMyB,YACF,OAAON,OAAOM,SAAS,KAAK,WAAW;QAACN,OAAOM,SAAS;KAAC,GAAGN,OAAOM,SAAS;IAEhF,OAAOC,gBAAgB;QACnB,GAAGC,iBAAiBN,eAAe;YAC/BnB;YACAQ;YACAE;QACJ,EAAE;QACF,GAAGO,MAAM;QACT,GAAInB,mBAAmB;YAAEA;QAAiB,IAAI,CAAC,CAAC;QAChD,GAAIyB,YAAY;YAAEA;QAAU,IAAI,CAAC,CAAC;IACtC;AACJ;AAEA,SAASE,iBACLR,MAAW,EACXS,WAIC;IAED,OAAOC,OAAOC,IAAI,CAACF,aAAaG,MAAM,CAAC,CAACC,QAAQC;QAC5C,MAAMC,WAAWN,WAAW,CAACK,IAAI;QACjC,IAAIC,UAAU;YACVF,MAAM,CAACC,IAAI,GAAG;mBAAIE,IAAAA,gBAAO,EAACH,MAAM,CAACC,IAAI;mBAAME,IAAAA,gBAAO,EAACD;aAAU;QACjE;QACA,OAAOF;IACX,GAAGb;AACP;AAEA,SAASO,gBAAgBP,MAAW;IAChC,OAAO;QAAC;QAAuB;QAAW;QAAoB;KAAY,CAACY,MAAM,CAC7E,CAACC,QAAQC;QACL,MAAMG,QAAQJ,MAAM,CAACC,IAAI;QACzB,IAAIG,SAAS,OAAOA,UAAU,UAAU;YACpCJ,MAAM,CAACC,IAAI,GAAGV,KAAKc,SAAS,CAACL,MAAM,CAACC,IAAI;QAC5C;QACA,OAAOD;IACX,GACAb;AAER"}
|
package/dist/utils/prettify.js
CHANGED
|
@@ -19,7 +19,7 @@ _export(exports, {
|
|
|
19
19
|
const _nodechild_process = require("node:child_process");
|
|
20
20
|
const _nodeutil = require("node:util");
|
|
21
21
|
function getCommand(filename) {
|
|
22
|
-
return `
|
|
22
|
+
return `prettier -w "${filename}"`;
|
|
23
23
|
}
|
|
24
24
|
function createError(exitCode) {
|
|
25
25
|
return new Error(`prettier failed with exit code ${exitCode}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/prettify.ts"],"sourcesContent":["import { exec, execSync } from 'node:child_process';\nimport { promisify } from 'node:util';\n\nfunction getCommand(filename: string) {\n return `
|
|
1
|
+
{"version":3,"sources":["../../src/utils/prettify.ts"],"sourcesContent":["import { exec, execSync } from 'node:child_process';\nimport { promisify } from 'node:util';\n\nfunction getCommand(filename: string) {\n return `prettier -w \"${filename}\"`;\n}\n\nfunction createError(exitCode: number) {\n return new Error(`prettier failed with exit code ${exitCode}`);\n}\n\n/**\n * Format a file using Prettier.\n * @param filename - The path to the file to format\n * @throws Error if Prettier fails\n */\nexport async function prettify(filename: string) {\n try {\n await promisify(exec)(getCommand(filename));\n } catch (error: any) {\n throw createError(error.exitCode);\n }\n}\n\n/**\n * Format a file using Prettier.\n * @param filename - The path to the file to format\n * @throws Error if Prettier fails\n */\nexport function prettifySync(filename: string) {\n try {\n execSync(getCommand(filename), { stdio: ['pipe', 'ignore', 'pipe'] });\n } catch (error: any) {\n throw createError(error.status);\n }\n}\n"],"names":["prettify","prettifySync","getCommand","filename","createError","exitCode","Error","promisify","exec","error","execSync","stdio","status"],"mappings":";;;;;;;;;;;QAgBsBA;eAAAA;;QAaNC;eAAAA;;;mCA7Be;0BACL;AAE1B,SAASC,WAAWC,QAAgB;IAChC,OAAO,CAAC,aAAa,EAAEA,SAAS,CAAC,CAAC;AACtC;AAEA,SAASC,YAAYC,QAAgB;IACjC,OAAO,IAAIC,MAAM,CAAC,+BAA+B,EAAED,UAAU;AACjE;AAOO,eAAeL,SAASG,QAAgB;IAC3C,IAAI;QACA,MAAMI,IAAAA,mBAAS,EAACC,uBAAI,EAAEN,WAAWC;IACrC,EAAE,OAAOM,OAAY;QACjB,MAAML,YAAYK,MAAMJ,QAAQ;IACpC;AACJ;AAOO,SAASJ,aAAaE,QAAgB;IACzC,IAAI;QACAO,IAAAA,2BAAQ,EAACR,WAAWC,WAAW;YAAEQ,OAAO;gBAAC;gBAAQ;gBAAU;aAAO;QAAC;IACvE,EAAE,OAAOF,OAAY;QACjB,MAAML,YAAYK,MAAMG,MAAM;IAClC;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/cache-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cache-config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/cache-config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAG7C,KAAK,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,uBAAuB,CAAC,GAAG,SAAS,CAAC;AAIjF,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,GAAG,MAAM,CAkB3E"}
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "cacheConfig", {
|
|
|
8
8
|
return cacheConfig;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
+
const _install = require("@servicetitan/install");
|
|
11
12
|
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
12
13
|
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
13
14
|
const _utils = require("../../utils");
|
|
@@ -43,8 +44,9 @@ function cacheConfig(context, _overrides) {
|
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
46
|
function findPackageLock() {
|
|
47
|
+
const { lockFileName } = (0, _install.getPackageManager)();
|
|
46
48
|
return (0, _utils.findUp)((directory)=>{
|
|
47
|
-
const lockFile = _path.default.resolve(_path.default.join(directory),
|
|
49
|
+
const lockFile = _path.default.resolve(_path.default.join(directory), lockFileName);
|
|
48
50
|
return _fs.default.existsSync(lockFile) ? lockFile : undefined;
|
|
49
51
|
});
|
|
50
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/webpack/configs/cache-config.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { Configuration } from 'webpack';\nimport { findUp } from '../../utils';\nimport { Context, Overrides } from './types';\n\ntype Config = Configuration['cache'];\ntype Result = Pick<Configuration, 'cache' | 'infrastructureLogging'> | undefined;\n\nconst CACHE_VERSION = '1';\n\nexport function cacheConfig(context: Context, _overrides: Overrides): Result {\n const { emitExposedDependencies } = context;\n if (!emitExposedDependencies) {\n return;\n }\n\n const packageLock = findPackageLock();\n const cache: Config = {\n type: 'filesystem',\n version: CACHE_VERSION,\n ...(packageLock ? { buildDependencies: { packageLock: [packageLock] } } : {}),\n };\n\n return {\n cache,\n // Suppress \"Serializing big strings impacts deserialization performance\" warnings\n infrastructureLogging: { level: 'error' },\n };\n}\n\nfunction findPackageLock() {\n return findUp(directory => {\n const lockFile = path.resolve(path.join(directory),
|
|
1
|
+
{"version":3,"sources":["../../../src/webpack/configs/cache-config.ts"],"sourcesContent":["import { getPackageManager } from '@servicetitan/install';\nimport fs from 'fs';\nimport path from 'path';\nimport { Configuration } from 'webpack';\nimport { findUp } from '../../utils';\nimport { Context, Overrides } from './types';\n\ntype Config = Configuration['cache'];\ntype Result = Pick<Configuration, 'cache' | 'infrastructureLogging'> | undefined;\n\nconst CACHE_VERSION = '1';\n\nexport function cacheConfig(context: Context, _overrides: Overrides): Result {\n const { emitExposedDependencies } = context;\n if (!emitExposedDependencies) {\n return;\n }\n\n const packageLock = findPackageLock();\n const cache: Config = {\n type: 'filesystem',\n version: CACHE_VERSION,\n ...(packageLock ? { buildDependencies: { packageLock: [packageLock] } } : {}),\n };\n\n return {\n cache,\n // Suppress \"Serializing big strings impacts deserialization performance\" warnings\n infrastructureLogging: { level: 'error' },\n };\n}\n\nfunction findPackageLock() {\n const { lockFileName } = getPackageManager();\n return findUp(directory => {\n const lockFile = path.resolve(path.join(directory), lockFileName);\n return fs.existsSync(lockFile) ? lockFile : undefined;\n });\n}\n"],"names":["cacheConfig","CACHE_VERSION","context","_overrides","emitExposedDependencies","packageLock","findPackageLock","cache","type","version","buildDependencies","infrastructureLogging","level","lockFileName","getPackageManager","findUp","directory","lockFile","path","resolve","join","fs","existsSync","undefined"],"mappings":";;;;+BAYgBA;;;eAAAA;;;yBAZkB;2DACnB;6DACE;uBAEM;;;;;;AAMvB,MAAMC,gBAAgB;AAEf,SAASD,YAAYE,OAAgB,EAAEC,UAAqB;IAC/D,MAAM,EAAEC,uBAAuB,EAAE,GAAGF;IACpC,IAAI,CAACE,yBAAyB;QAC1B;IACJ;IAEA,MAAMC,cAAcC;IACpB,MAAMC,QAAgB;QAClBC,MAAM;QACNC,SAASR;QACT,GAAII,cAAc;YAAEK,mBAAmB;gBAAEL,aAAa;oBAACA;iBAAY;YAAC;QAAE,IAAI,CAAC,CAAC;IAChF;IAEA,OAAO;QACHE;QACA,kFAAkF;QAClFI,uBAAuB;YAAEC,OAAO;QAAQ;IAC5C;AACJ;AAEA,SAASN;IACL,MAAM,EAAEO,YAAY,EAAE,GAAGC,IAAAA,0BAAiB;IAC1C,OAAOC,IAAAA,aAAM,EAACC,CAAAA;QACV,MAAMC,WAAWC,aAAI,CAACC,OAAO,CAACD,aAAI,CAACE,IAAI,CAACJ,YAAYH;QACpD,OAAOQ,WAAE,CAACC,UAAU,CAACL,YAAYA,WAAWM;IAChD;AACJ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { RuleSetRule } from 'webpack';
|
|
2
|
+
import { Context } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Webpack rules for TypeScript source files when building with code coverage.
|
|
5
|
+
*
|
|
6
|
+
* Normally the main webpack build only processes pre-compiled `.js` files
|
|
7
|
+
* (TypeScript is compiled to JS before webpack runs). When code coverage is
|
|
8
|
+
* enabled, workspace package imports are aliased from their `dist/` output to
|
|
9
|
+
* their `src/` TypeScript source (via `resolve.alias` in `resolve-config.ts`),
|
|
10
|
+
* so webpack now encounters raw `.ts`/`.tsx` files that need a compiler.
|
|
11
|
+
*
|
|
12
|
+
* Processing order for `.ts`/`.tsx` files:
|
|
13
|
+
* 1. `coverage-istanbul-loader` (`enforce: 'pre'`) — instruments the original
|
|
14
|
+
* TypeScript source, recording fnMap/statementMap positions from the TS AST.
|
|
15
|
+
* `parserPlugins: ['typescript', 'jsx']` lets babel parse TypeScript syntax.
|
|
16
|
+
* 2. `swc-loader` (normal) — compiles the instrumented TypeScript to JavaScript.
|
|
17
|
+
*
|
|
18
|
+
* This mirrors the cypress component test webpack config, ensuring e2e coverage
|
|
19
|
+
* uses the same instrumentation strategy and produces matching source positions.
|
|
20
|
+
*/
|
|
21
|
+
export declare function tsCoverageRules({ codeCoverage }: Context): RuleSetRule[];
|
|
22
|
+
//# sourceMappingURL=ts-coverage-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ts-coverage-rules.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/rules/ts-coverage-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAI3C,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAAC,EAAE,YAAY,EAAE,EAAE,OAAO,GAAG,WAAW,EAAE,CA+BxE"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "tsCoverageRules", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return tsCoverageRules;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _tasks = require("../../../cli/tasks");
|
|
12
|
+
const _utils = require("../../../cli/utils");
|
|
13
|
+
const _utils1 = require("../../../utils");
|
|
14
|
+
function tsCoverageRules({ codeCoverage }) {
|
|
15
|
+
if (!codeCoverage) {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
const tsConfig = new _utils.TSConfig((0, _utils1.getTsConfigWithFallback)());
|
|
19
|
+
const swcOptions = (0, _tasks.getSwcOptions)(tsConfig);
|
|
20
|
+
return [
|
|
21
|
+
{
|
|
22
|
+
test: /\.tsx?$/,
|
|
23
|
+
exclude: /(node_modules|\.yalc)/,
|
|
24
|
+
use: {
|
|
25
|
+
loader: 'swc-loader',
|
|
26
|
+
options: swcOptions
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
enforce: 'pre',
|
|
31
|
+
test: /\.tsx?$/,
|
|
32
|
+
exclude: /(node_modules|\.yalc)/,
|
|
33
|
+
use: {
|
|
34
|
+
loader: '@jsdevtools/coverage-istanbul-loader',
|
|
35
|
+
options: {
|
|
36
|
+
compact: false,
|
|
37
|
+
produceSourceMap: true,
|
|
38
|
+
parserPlugins: [
|
|
39
|
+
'typescript',
|
|
40
|
+
'jsx'
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=ts-coverage-rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/webpack/configs/rules/ts-coverage-rules.ts"],"sourcesContent":["import type { RuleSetRule } from 'webpack';\nimport { getSwcOptions } from '../../../cli/tasks';\nimport { TSConfig } from '../../../cli/utils';\nimport { getTsConfigWithFallback } from '../../../utils';\nimport { Context } from '../types';\n\n/**\n * Webpack rules for TypeScript source files when building with code coverage.\n *\n * Normally the main webpack build only processes pre-compiled `.js` files\n * (TypeScript is compiled to JS before webpack runs). When code coverage is\n * enabled, workspace package imports are aliased from their `dist/` output to\n * their `src/` TypeScript source (via `resolve.alias` in `resolve-config.ts`),\n * so webpack now encounters raw `.ts`/`.tsx` files that need a compiler.\n *\n * Processing order for `.ts`/`.tsx` files:\n * 1. `coverage-istanbul-loader` (`enforce: 'pre'`) — instruments the original\n * TypeScript source, recording fnMap/statementMap positions from the TS AST.\n * `parserPlugins: ['typescript', 'jsx']` lets babel parse TypeScript syntax.\n * 2. `swc-loader` (normal) — compiles the instrumented TypeScript to JavaScript.\n *\n * This mirrors the cypress component test webpack config, ensuring e2e coverage\n * uses the same instrumentation strategy and produces matching source positions.\n */\nexport function tsCoverageRules({ codeCoverage }: Context): RuleSetRule[] {\n if (!codeCoverage) {\n return [];\n }\n\n const tsConfig = new TSConfig(getTsConfigWithFallback());\n const swcOptions = getSwcOptions(tsConfig);\n\n return [\n {\n test: /\\.tsx?$/,\n exclude: /(node_modules|\\.yalc)/,\n use: {\n loader: 'swc-loader',\n options: swcOptions,\n },\n },\n {\n enforce: 'pre',\n test: /\\.tsx?$/,\n exclude: /(node_modules|\\.yalc)/,\n use: {\n loader: '@jsdevtools/coverage-istanbul-loader',\n options: {\n compact: false,\n produceSourceMap: true,\n parserPlugins: ['typescript', 'jsx'],\n },\n },\n },\n ];\n}\n"],"names":["tsCoverageRules","codeCoverage","tsConfig","TSConfig","getTsConfigWithFallback","swcOptions","getSwcOptions","test","exclude","use","loader","options","enforce","compact","produceSourceMap","parserPlugins"],"mappings":";;;;+BAwBgBA;;;eAAAA;;;uBAvBc;uBACL;wBACe;AAqBjC,SAASA,gBAAgB,EAAEC,YAAY,EAAW;IACrD,IAAI,CAACA,cAAc;QACf,OAAO,EAAE;IACb;IAEA,MAAMC,WAAW,IAAIC,eAAQ,CAACC,IAAAA,+BAAuB;IACrD,MAAMC,aAAaC,IAAAA,oBAAa,EAACJ;IAEjC,OAAO;QACH;YACIK,MAAM;YACNC,SAAS;YACTC,KAAK;gBACDC,QAAQ;gBACRC,SAASN;YACb;QACJ;QACA;YACIO,SAAS;YACTL,MAAM;YACNC,SAAS;YACTC,KAAK;gBACDC,QAAQ;gBACRC,SAAS;oBACLE,SAAS;oBACTC,kBAAkB;oBAClBC,eAAe;wBAAC;wBAAc;qBAAM;gBACxC;YACJ;QACJ;KACH;AACL"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/startup",
|
|
3
|
-
"version": "36.1.
|
|
3
|
+
"version": "36.1.2-canary.2",
|
|
4
4
|
"description": "CLI to create multi-package Lerna projects with TypeScript and React",
|
|
5
5
|
"homepage": "https://docs.st.dev/docs/frontend/uikit/startup",
|
|
6
6
|
"repository": {
|
|
@@ -17,12 +17,13 @@
|
|
|
17
17
|
"typings": "./dist/index.d.ts",
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
|
20
|
-
"
|
|
21
|
-
"
|
|
20
|
+
"default": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts"
|
|
22
22
|
},
|
|
23
23
|
"./@types/cypress": {
|
|
24
24
|
"types": "./dist/cypress/types/index.d.ts"
|
|
25
25
|
},
|
|
26
|
+
"./eslint/config": "./eslint/config.mjs",
|
|
26
27
|
"./cypress-config": "./dist/cypress/config/index.js",
|
|
27
28
|
"./jest-preset": "./jest/jest-preset.js",
|
|
28
29
|
"./jest-resolver": "./dist/jest/resolver.js",
|
|
@@ -34,20 +35,55 @@
|
|
|
34
35
|
"files": [
|
|
35
36
|
"bin",
|
|
36
37
|
"dist",
|
|
38
|
+
"eslint",
|
|
37
39
|
"jest",
|
|
38
40
|
"patches",
|
|
39
41
|
"src",
|
|
40
42
|
"tsconfig"
|
|
41
43
|
],
|
|
42
|
-
"bin":
|
|
44
|
+
"bin": {
|
|
45
|
+
"startup": "./bin/index.js",
|
|
46
|
+
"cpx": "./bin/cpx.js",
|
|
47
|
+
"eslint": "./bin/eslint.js",
|
|
48
|
+
"jest": "./bin/jest.js",
|
|
49
|
+
"js-yaml": "./bin/js-yaml.js",
|
|
50
|
+
"json5": "./bin/json5.js",
|
|
51
|
+
"kendo-ui-license": "./bin/kendo-ui-license.js",
|
|
52
|
+
"lerna": "./bin/lerna.js",
|
|
53
|
+
"lessc": "./bin/lessc.js",
|
|
54
|
+
"patch-package": "./bin/patch-package.js",
|
|
55
|
+
"prettier": "./bin/prettier.js",
|
|
56
|
+
"sass": "./bin/sass.js",
|
|
57
|
+
"semver": "./bin/semver.js",
|
|
58
|
+
"spack": "./bin/spack.js",
|
|
59
|
+
"stylelint": "./bin/stylelint.js",
|
|
60
|
+
"swc": "./bin/swc.js",
|
|
61
|
+
"swcx": "./bin/swcx.js",
|
|
62
|
+
"tcm": "./bin/tcm.js",
|
|
63
|
+
"ts-jest": "./bin/ts-jest.js",
|
|
64
|
+
"ts-node": "./bin/ts-node.js",
|
|
65
|
+
"ts-node-cwd": "./bin/ts-node-cwd.js",
|
|
66
|
+
"ts-node-esm": "./bin/ts-node-esm.js",
|
|
67
|
+
"ts-node-script": "./bin/ts-node-script.js",
|
|
68
|
+
"ts-node-transpile-only": "./bin/ts-node-transpile-only.js",
|
|
69
|
+
"ts-script": "./bin/ts-script.js",
|
|
70
|
+
"tsc": "./bin/tsc.js",
|
|
71
|
+
"tsserver": "./bin/tsserver.js",
|
|
72
|
+
"vitest": "./bin/vitest.js",
|
|
73
|
+
"webpack": "./bin/webpack.js",
|
|
74
|
+
"webpack-bundle-analyzer": "./bin/webpack-bundle-analyzer.js",
|
|
75
|
+
"webpack-dev-server": "./bin/webpack-dev-server.js"
|
|
76
|
+
},
|
|
43
77
|
"scripts": {
|
|
44
|
-
"postinstall": "node ./src/postinstall.js"
|
|
78
|
+
"postinstall": "node ./src/postinstall.js",
|
|
79
|
+
"prepare": "node ./src/scripts/generate-bin-wrappers.js"
|
|
45
80
|
},
|
|
46
81
|
"devDependencies": {
|
|
47
82
|
"@swc/types": "^0.1.26",
|
|
48
83
|
"@types/cpx": "~1.5.5",
|
|
49
84
|
"@types/debug": "^4.1.12",
|
|
50
85
|
"@types/eslint": "~9.6.1",
|
|
86
|
+
"@types/js-yaml": "^4.0.9",
|
|
51
87
|
"@types/less": "~3.0.8",
|
|
52
88
|
"@types/lodash.kebabcase": "^4.1.9",
|
|
53
89
|
"@types/lodash.memoize": "^4.1.9",
|
|
@@ -60,19 +96,19 @@
|
|
|
60
96
|
"@jest/core": "~30.3.0",
|
|
61
97
|
"@jest/types": "~30.3.0",
|
|
62
98
|
"@jsdevtools/coverage-istanbul-loader": "^3.0.5",
|
|
63
|
-
"@servicetitan/eslint-config": "36.
|
|
64
|
-
"@servicetitan/install": "36.
|
|
65
|
-
"@servicetitan/startup-utils": "36.
|
|
66
|
-
"@servicetitan/stylelint-config": "36.
|
|
99
|
+
"@servicetitan/eslint-config": "36.0.0",
|
|
100
|
+
"@servicetitan/install": "36.0.0",
|
|
101
|
+
"@servicetitan/startup-utils": "36.0.0",
|
|
102
|
+
"@servicetitan/stylelint-config": "36.0.0",
|
|
67
103
|
"@svgr/webpack": "^8.1.0",
|
|
68
|
-
"@swc/cli": "^0.8.
|
|
69
|
-
"@swc/core": "1.15.
|
|
104
|
+
"@swc/cli": "^0.8.0",
|
|
105
|
+
"@swc/core": "1.15.21",
|
|
70
106
|
"@types/debug": "^4.1.12",
|
|
71
107
|
"@types/jest": "~30.0.0",
|
|
72
|
-
"@vitest/coverage-v8": "^4.1.
|
|
108
|
+
"@vitest/coverage-v8": "^4.1.2",
|
|
73
109
|
"chalk": "~4.1.2",
|
|
74
110
|
"cli-table3": "^0.6.5",
|
|
75
|
-
"cpx2": "8.0.
|
|
111
|
+
"cpx2": "8.0.0",
|
|
76
112
|
"css-loader": "~7.1.4",
|
|
77
113
|
"css-minimizer-webpack-plugin": "^8.0.0",
|
|
78
114
|
"debug": "^4.4.3",
|
|
@@ -87,6 +123,7 @@
|
|
|
87
123
|
"jest-circus": "~30.3.0",
|
|
88
124
|
"jest-environment-jsdom": "^30.3.0",
|
|
89
125
|
"jest-fetch-mock": "~3.0.3",
|
|
126
|
+
"js-yaml": "~4.1.0",
|
|
90
127
|
"json5": "^2.2.3",
|
|
91
128
|
"lerna": "~9.0.7",
|
|
92
129
|
"less": "~4.6.4",
|
|
@@ -102,7 +139,7 @@
|
|
|
102
139
|
"portfinder": "~1.0.38",
|
|
103
140
|
"postcss": "~8.5.8",
|
|
104
141
|
"prettier": "~3.8.1",
|
|
105
|
-
"sass": "~1.
|
|
142
|
+
"sass": "~1.98.0",
|
|
106
143
|
"sass-loader": "~16.0.7",
|
|
107
144
|
"semver": "~7.7.4",
|
|
108
145
|
"source-map-loader": "~5.0.0",
|
|
@@ -111,11 +148,11 @@
|
|
|
111
148
|
"swc-loader": "^0.2.7",
|
|
112
149
|
"terminal-link": "^5.0.0",
|
|
113
150
|
"terser-webpack-plugin": "^5.4.0",
|
|
114
|
-
"ts-jest": "29.4.
|
|
151
|
+
"ts-jest": "29.4.6",
|
|
115
152
|
"ts-node": "~10.9.2",
|
|
116
153
|
"typed-css-modules": "~0.9.1",
|
|
117
154
|
"typescript": "5.9.3",
|
|
118
|
-
"vitest": "^4.1.
|
|
155
|
+
"vitest": "^4.1.2",
|
|
119
156
|
"webpack": "~5.105.4",
|
|
120
157
|
"webpack-assets-manifest": "~6.5.1",
|
|
121
158
|
"webpack-bundle-analyzer": "^5.3.0",
|
|
@@ -146,6 +183,5 @@
|
|
|
146
183
|
},
|
|
147
184
|
"cli": {
|
|
148
185
|
"webpack": false
|
|
149
|
-
}
|
|
150
|
-
"gitHead": "613ecdc5bb02a009292843c9674bcd18f408bcfa"
|
|
186
|
+
}
|
|
151
187
|
}
|