@servicetitan/startup 31.5.1 → 32.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/commands/build.d.ts +1 -1
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/bundle-package.d.ts +1 -1
- package/dist/cli/commands/bundle-package.d.ts.map +1 -1
- package/dist/cli/commands/bundle-package.js.map +1 -1
- package/dist/cli/commands/eslint.d.ts +1 -1
- package/dist/cli/commands/eslint.d.ts.map +1 -1
- package/dist/cli/commands/eslint.js.map +1 -1
- package/dist/cli/commands/get-command.js +2 -2
- package/dist/cli/commands/get-command.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -1
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +1 -1
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +3 -2
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +24 -43
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/install.d.ts +4 -0
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +91 -3
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/lint.d.ts +1 -1
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/commands/mfe-package-clean.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-clean.js +5 -7
- package/dist/cli/commands/mfe-package-clean.js.map +1 -1
- package/dist/cli/commands/mfe-package-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-publish.js +11 -15
- package/dist/cli/commands/mfe-package-publish.js.map +1 -1
- package/dist/cli/commands/mfe-publish.d.ts +1 -1
- package/dist/cli/commands/mfe-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-publish.js.map +1 -1
- package/dist/cli/commands/prepare-package.d.ts +1 -1
- package/dist/cli/commands/prepare-package.d.ts.map +1 -1
- package/dist/cli/commands/prepare-package.js.map +1 -1
- package/dist/cli/commands/review/rules/index.d.ts.map +1 -1
- package/dist/cli/commands/review/rules/index.js +4 -0
- package/dist/cli/commands/review/rules/index.js.map +1 -1
- package/dist/cli/commands/review/rules/require-all-react-dependencies.d.ts +14 -0
- package/dist/cli/commands/review/rules/require-all-react-dependencies.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/require-all-react-dependencies.js +64 -0
- package/dist/cli/commands/review/rules/require-all-react-dependencies.js.map +1 -0
- package/dist/cli/commands/review/rules/require-one-react-version.d.ts +5 -0
- package/dist/cli/commands/review/rules/require-one-react-version.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/require-one-react-version.js +25 -0
- package/dist/cli/commands/review/rules/require-one-react-version.js.map +1 -0
- package/dist/cli/commands/review/rules/require-one-uikit-version.d.ts.map +1 -1
- package/dist/cli/commands/review/rules/require-one-uikit-version.js +1 -0
- package/dist/cli/commands/review/rules/require-one-uikit-version.js.map +1 -1
- package/dist/cli/commands/review/utils/format-depends-on.d.ts +1 -0
- package/dist/cli/commands/review/utils/format-depends-on.d.ts.map +1 -1
- package/dist/cli/commands/review/utils/format-depends-on.js +15 -8
- package/dist/cli/commands/review/utils/format-depends-on.js.map +1 -1
- package/dist/cli/commands/review/utils/set-version.d.ts +2 -1
- package/dist/cli/commands/review/utils/set-version.d.ts.map +1 -1
- package/dist/cli/commands/review/utils/set-version.js +4 -2
- package/dist/cli/commands/review/utils/set-version.js.map +1 -1
- package/dist/cli/commands/start.d.ts +1 -1
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/test/index.d.ts +2 -0
- package/dist/cli/commands/test/index.d.ts.map +1 -0
- package/dist/cli/commands/test/index.js +20 -0
- package/dist/cli/commands/test/index.js.map +1 -0
- package/dist/cli/commands/test/runners/index.d.ts +3 -0
- package/dist/cli/commands/test/runners/index.d.ts.map +1 -0
- package/dist/cli/commands/test/runners/index.js +21 -0
- package/dist/cli/commands/test/runners/index.js.map +1 -0
- package/dist/cli/commands/test/runners/jest.d.ts +7 -0
- package/dist/cli/commands/test/runners/jest.d.ts.map +1 -0
- package/dist/cli/commands/test/runners/jest.js +43 -0
- package/dist/cli/commands/test/runners/jest.js.map +1 -0
- package/dist/cli/commands/test/runners/vitest.d.ts +4 -0
- package/dist/cli/commands/test/runners/vitest.d.ts.map +1 -0
- package/dist/cli/commands/test/runners/vitest.js +86 -0
- package/dist/cli/commands/test/runners/vitest.js.map +1 -0
- package/dist/cli/commands/test/tests.d.ts +18 -0
- package/dist/cli/commands/test/tests.d.ts.map +1 -0
- package/dist/cli/commands/{tests.js → test/tests.js} +10 -9
- package/dist/cli/commands/test/tests.js.map +1 -0
- package/dist/cli/commands/upload-sourcemaps.d.ts.map +1 -1
- package/dist/cli/commands/upload-sourcemaps.js +1 -1
- package/dist/cli/commands/upload-sourcemaps.js.map +1 -1
- package/dist/cli/index.js +1 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/utils/bundle.d.ts.map +1 -1
- package/dist/cli/utils/bundle.js +7 -4
- package/dist/cli/utils/bundle.js.map +1 -1
- package/dist/cli/utils/cli-git.d.ts +11 -2
- package/dist/cli/utils/cli-git.d.ts.map +1 -1
- package/dist/cli/utils/cli-git.js +60 -4
- package/dist/cli/utils/cli-git.js.map +1 -1
- package/dist/cli/utils/index.d.ts +6 -0
- package/dist/cli/utils/index.d.ts.map +1 -1
- package/dist/cli/utils/index.js +6 -0
- package/dist/cli/utils/index.js.map +1 -1
- package/dist/cli/utils/is-ci.d.ts +2 -0
- package/dist/cli/utils/is-ci.d.ts.map +1 -0
- package/dist/cli/utils/is-ci.js +15 -0
- package/dist/cli/utils/is-ci.js.map +1 -0
- package/dist/cli/utils/lerna-exec.d.ts.map +1 -1
- package/dist/cli/utils/lerna-exec.js +2 -1
- package/dist/cli/utils/lerna-exec.js.map +1 -1
- package/dist/cli/utils/set-node-options.d.ts.map +1 -1
- package/dist/cli/utils/set-node-options.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/get-branch-configs.d.ts +1 -1
- package/dist/utils/get-branch-configs.d.ts.map +1 -1
- package/dist/utils/get-branch-configs.js +2 -2
- package/dist/utils/get-branch-configs.js.map +1 -1
- package/dist/utils/get-configuration.d.ts +8 -2
- package/dist/utils/get-configuration.d.ts.map +1 -1
- package/dist/utils/get-configuration.js +10 -2
- package/dist/utils/get-configuration.js.map +1 -1
- package/dist/utils/get-jest-config.d.ts +1 -7
- package/dist/utils/get-jest-config.d.ts.map +1 -1
- package/dist/utils/get-jest-config.js +49 -58
- package/dist/utils/get-jest-config.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/webpack/utils/testing/get-compiler.js.map +1 -1
- package/package.json +16 -14
- package/src/cli/commands/__tests__/init.test.ts +21 -87
- package/src/cli/commands/__tests__/install.test.ts +174 -12
- package/src/cli/commands/__tests__/mfe-package-clean.test.ts +3 -6
- package/src/cli/commands/__tests__/mfe-package-publish.test.ts +6 -8
- package/src/cli/commands/__tests__/upload-sourcemaps.test.ts +7 -3
- package/src/cli/commands/build.ts +1 -1
- package/src/cli/commands/bundle-package.ts +1 -1
- package/src/cli/commands/eslint.ts +1 -1
- package/src/cli/commands/get-command.ts +1 -1
- package/src/cli/commands/index.ts +1 -1
- package/src/cli/commands/init.ts +18 -38
- package/src/cli/commands/install.ts +95 -6
- package/src/cli/commands/lint.ts +1 -1
- package/src/cli/commands/mfe-package-clean.ts +2 -4
- package/src/cli/commands/mfe-package-publish.ts +18 -6
- package/src/cli/commands/mfe-publish.ts +1 -1
- package/src/cli/commands/prepare-package.ts +1 -1
- package/src/cli/commands/review/rules/__tests__/require-all-react-dependencies.test.ts +132 -0
- package/src/cli/commands/review/rules/__tests__/require-one-package-version.test.ts +0 -1
- package/src/cli/commands/review/rules/__tests__/require-one-react-version.test.ts +22 -0
- package/src/cli/commands/review/rules/__tests__/{require-one-uikit-version.ts → require-one-uikit-version.test.ts} +1 -0
- package/src/cli/commands/review/rules/index.ts +4 -0
- package/src/cli/commands/review/rules/require-all-react-dependencies.ts +53 -0
- package/src/cli/commands/review/rules/require-one-react-version.ts +9 -0
- package/src/cli/commands/review/rules/require-one-uikit-version.ts +1 -0
- package/src/cli/commands/review/utils/__tests__/set-version.test.ts +18 -8
- package/src/cli/commands/review/utils/format-depends-on.ts +8 -5
- package/src/cli/commands/review/utils/set-version.ts +10 -2
- package/src/cli/commands/start.ts +1 -1
- package/src/cli/commands/test/__tests__/tests.test.ts +78 -0
- package/src/cli/commands/test/index.ts +1 -0
- package/src/cli/commands/{__tests__/tests.test.ts → test/runners/__tests__/jest.test.ts} +10 -13
- package/src/cli/commands/test/runners/__tests__/vitest.test.ts +150 -0
- package/src/cli/commands/test/runners/index.ts +2 -0
- package/src/cli/commands/{tests.ts → test/runners/jest.ts} +5 -16
- package/src/cli/commands/test/runners/vitest.ts +70 -0
- package/src/cli/commands/test/tests.ts +34 -0
- package/src/cli/commands/upload-sourcemaps.ts +2 -2
- package/src/cli/index.ts +1 -2
- package/src/cli/utils/__tests__/bundle.test.ts +1 -1
- package/src/cli/utils/__tests__/cli-git.test.ts +142 -6
- package/src/cli/utils/__tests__/eslint.test.ts +3 -2
- package/src/cli/utils/__tests__/is-ci.test.ts +40 -0
- package/src/cli/utils/__tests__/lerna-exec.test.ts +6 -3
- package/src/cli/utils/bundle.ts +8 -3
- package/src/cli/utils/cli-git.ts +55 -5
- package/src/cli/utils/index.ts +6 -0
- package/src/cli/utils/is-ci.ts +3 -0
- package/src/cli/utils/lerna-exec.ts +2 -1
- package/src/cli/utils/set-node-options.ts +2 -2
- package/src/index.ts +0 -1
- package/src/utils/__tests__/get-configuration.test.ts +48 -11
- package/src/utils/__tests__/get-jest-config.test.ts +35 -61
- package/src/utils/get-branch-configs.ts +1 -1
- package/src/utils/get-configuration.ts +14 -3
- package/src/utils/get-jest-config.ts +39 -47
- package/src/utils/index.ts +1 -0
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +1 -1
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +1 -1
- package/src/webpack/__tests__/create-webpack-config.test.ts +1 -1
- package/src/webpack/utils/testing/get-compiler.ts +1 -1
- package/dist/cli/commands/tests.d.ts +0 -13
- package/dist/cli/commands/tests.d.ts.map +0 -1
- package/dist/cli/commands/tests.js.map +0 -1
- package/dist/jest/index.d.ts +0 -2
- package/dist/jest/index.d.ts.map +0 -1
- package/dist/jest/index.js +0 -16
- package/dist/jest/index.js.map +0 -1
- package/src/jest/index.ts +0 -5
|
@@ -2,17 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
get getJestConfig () {
|
|
13
|
-
return getJestConfig;
|
|
14
|
-
},
|
|
15
|
-
get getJestConfigCLI () {
|
|
5
|
+
Object.defineProperty(exports, "getJestConfigCLI", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
16
8
|
return getJestConfigCLI;
|
|
17
9
|
}
|
|
18
10
|
});
|
|
@@ -25,29 +17,13 @@ function _interop_require_default(obj) {
|
|
|
25
17
|
default: obj
|
|
26
18
|
};
|
|
27
19
|
}
|
|
28
|
-
|
|
20
|
+
function getDefaultJestConfiguration({ coveragePathIgnorePatterns = [], setupFiles = [], testPathIgnorePatterns = [] }) {
|
|
29
21
|
const moduleNameMapper = {
|
|
30
|
-
'\\.(css|scss|less|png|svg|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$': 'identity-obj-proxy'
|
|
22
|
+
'\\.(css|scss|less|png|svg|svg\\?\\w+|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$': 'identity-obj-proxy'
|
|
31
23
|
};
|
|
32
24
|
return {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
testRunner: 'jest-circus/runner',
|
|
36
|
-
transformIgnorePatterns: [
|
|
37
|
-
'node_modules/(?!(@servicetitan|@react-hook|nanoid|axios)/)'
|
|
38
|
-
],
|
|
39
|
-
modulePathIgnorePatterns: [
|
|
40
|
-
'<rootDir>/.*/__mocks__'
|
|
41
|
-
],
|
|
42
|
-
moduleNameMapper,
|
|
43
|
-
testPathIgnorePatterns: [
|
|
44
|
-
'\\.yalc',
|
|
45
|
-
...(0, _getdestinationfolders.getDestinationFolders)(),
|
|
46
|
-
...(0, _toarray.toArray)(testPathIgnorePatterns)
|
|
47
|
-
],
|
|
48
|
-
setupFiles: [
|
|
49
|
-
_path.default.join(__dirname, '../../jest/setup.js'),
|
|
50
|
-
...(0, _toarray.toArray)(setupFiles)
|
|
25
|
+
collectCoverageFrom: [
|
|
26
|
+
'**/*.{ts,tsx}'
|
|
51
27
|
],
|
|
52
28
|
coveragePathIgnorePatterns: [
|
|
53
29
|
'^.+\\.d\\.ts$',
|
|
@@ -60,40 +36,55 @@ const getJestConfigBase = ({ coveragePathIgnorePatterns = [], setupFiles = [], t
|
|
|
60
36
|
'cobertura',
|
|
61
37
|
'lcov'
|
|
62
38
|
],
|
|
63
|
-
|
|
64
|
-
|
|
39
|
+
moduleNameMapper,
|
|
40
|
+
modulePathIgnorePatterns: [
|
|
41
|
+
'<rootDir>/.*/__mocks__'
|
|
42
|
+
],
|
|
43
|
+
preset: _path.default.join(__dirname, '../../jest'),
|
|
44
|
+
setupFiles: [
|
|
45
|
+
_path.default.join(__dirname, '../../jest/setup.js'),
|
|
46
|
+
...(0, _toarray.toArray)(setupFiles)
|
|
47
|
+
],
|
|
48
|
+
testEnvironment: 'jsdom',
|
|
49
|
+
testPathIgnorePatterns: [
|
|
50
|
+
'\\.yalc',
|
|
51
|
+
...(0, _getdestinationfolders.getDestinationFolders)(),
|
|
52
|
+
...(0, _toarray.toArray)(testPathIgnorePatterns)
|
|
65
53
|
],
|
|
66
|
-
|
|
54
|
+
testRunner: 'jest-circus/runner',
|
|
55
|
+
transformIgnorePatterns: [
|
|
56
|
+
'node_modules/(?!(@servicetitan|@react-hook|nanoid|axios)/)'
|
|
57
|
+
],
|
|
58
|
+
verbose: true
|
|
67
59
|
};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const { coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns, ...config } =
|
|
71
|
-
|
|
72
|
-
...
|
|
60
|
+
}
|
|
61
|
+
function getJestConfigCLI(args) {
|
|
62
|
+
const { coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns, ...config } = {
|
|
63
|
+
...(0, _getconfiguration.getJestConfiguration)(),
|
|
64
|
+
...args
|
|
65
|
+
};
|
|
66
|
+
return stringifyForCLI({
|
|
67
|
+
...getDefaultJestConfiguration({
|
|
73
68
|
coveragePathIgnorePatterns,
|
|
74
69
|
setupFiles,
|
|
75
70
|
testPathIgnorePatterns
|
|
76
71
|
}),
|
|
77
72
|
...config
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
const getJestConfigCLI = (args)=>{
|
|
81
|
-
const { coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns, globals, ...config } = {
|
|
82
|
-
...(0, _getconfiguration.getJestConfiguration)(),
|
|
83
|
-
...args
|
|
84
|
-
};
|
|
85
|
-
const { collectCoverageFrom, moduleNameMapper, ...rest } = getJestConfigBase({
|
|
86
|
-
coveragePathIgnorePatterns,
|
|
87
|
-
setupFiles,
|
|
88
|
-
testPathIgnorePatterns
|
|
89
73
|
});
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
74
|
+
}
|
|
75
|
+
function stringifyForCLI(config) {
|
|
76
|
+
return [
|
|
77
|
+
'collectCoverageFrom',
|
|
78
|
+
'globals',
|
|
79
|
+
'moduleNameMapper',
|
|
80
|
+
'transform'
|
|
81
|
+
].reduce((result, key)=>{
|
|
82
|
+
const value = result[key];
|
|
83
|
+
if (value && typeof value !== 'string') {
|
|
84
|
+
result[key] = JSON.stringify(result[key]);
|
|
85
|
+
}
|
|
86
|
+
return result;
|
|
87
|
+
}, config);
|
|
88
|
+
}
|
|
98
89
|
|
|
99
90
|
//# sourceMappingURL=get-jest-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/get-jest-config.ts"],"sourcesContent":["import
|
|
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 { toArray } from './to-array';\n\nfunction getDefaultJestConfiguration({\n coveragePathIgnorePatterns = [],\n setupFiles = [],\n testPathIgnorePatterns = [],\n}: {\n coveragePathIgnorePatterns?: string[];\n setupFiles?: string[];\n testPathIgnorePatterns?: string[];\n}) {\n const moduleNameMapper = {\n '\\\\.(css|scss|less|png|svg|svg\\\\?\\\\w+|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$':\n 'identity-obj-proxy',\n };\n\n return {\n collectCoverageFrom: ['**/*.{ts,tsx}'],\n coveragePathIgnorePatterns: ['^.+\\\\.d\\\\.ts$', ...coveragePathIgnorePatterns],\n coverageReporters: ['html-spa', 'text', 'json', 'cobertura', 'lcov'],\n moduleNameMapper,\n modulePathIgnorePatterns: ['<rootDir>/.*/__mocks__'],\n preset: path.join(__dirname, '../../jest'),\n setupFiles: [path.join(__dirname, '../../jest/setup.js'), ...toArray(setupFiles)],\n testEnvironment: 'jsdom',\n testPathIgnorePatterns: [\n '\\\\.yalc',\n ...getDestinationFolders(),\n ...toArray(testPathIgnorePatterns),\n ],\n testRunner: 'jest-circus/runner',\n transformIgnorePatterns: ['node_modules/(?!(@servicetitan|@react-hook|nanoid|axios)/)'],\n verbose: true,\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 { coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns, ...config } = {\n ...getJestConfiguration(),\n ...args,\n };\n\n return stringifyForCLI({\n ...getDefaultJestConfiguration({\n coveragePathIgnorePatterns,\n setupFiles,\n testPathIgnorePatterns,\n }),\n ...config,\n });\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","coveragePathIgnorePatterns","setupFiles","testPathIgnorePatterns","moduleNameMapper","collectCoverageFrom","coverageReporters","modulePathIgnorePatterns","preset","path","join","__dirname","toArray","testEnvironment","getDestinationFolders","testRunner","transformIgnorePatterns","verbose","args","config","getJestConfiguration","stringifyForCLI","reduce","result","key","value","JSON","stringify"],"mappings":";;;;+BA2CgBA;;;eAAAA;;;6DA1CC;kCACoB;uCACC;yBACd;;;;;;AAExB,SAASC,4BAA4B,EACjCC,6BAA6B,EAAE,EAC/BC,aAAa,EAAE,EACfC,yBAAyB,EAAE,EAK9B;IACG,MAAMC,mBAAmB;QACrB,8EACI;IACR;IAEA,OAAO;QACHC,qBAAqB;YAAC;SAAgB;QACtCJ,4BAA4B;YAAC;eAAoBA;SAA2B;QAC5EK,mBAAmB;YAAC;YAAY;YAAQ;YAAQ;YAAa;SAAO;QACpEF;QACAG,0BAA0B;YAAC;SAAyB;QACpDC,QAAQC,aAAI,CAACC,IAAI,CAACC,WAAW;QAC7BT,YAAY;YAACO,aAAI,CAACC,IAAI,CAACC,WAAW;eAA2BC,IAAAA,gBAAO,EAACV;SAAY;QACjFW,iBAAiB;QACjBV,wBAAwB;YACpB;eACGW,IAAAA,4CAAqB;eACrBF,IAAAA,gBAAO,EAACT;SACd;QACDY,YAAY;QACZC,yBAAyB;YAAC;SAA6D;QACvFC,SAAS;IACb;AACJ;AAKO,SAASlB,iBAAiBmB,IAAiB;IAC9C,MAAM,EAAEjB,0BAA0B,EAAEC,UAAU,EAAEC,sBAAsB,EAAE,GAAGgB,QAAQ,GAAG;QAClF,GAAGC,IAAAA,sCAAoB,GAAE;QACzB,GAAGF,IAAI;IACX;IAEA,OAAOG,gBAAgB;QACnB,GAAGrB,4BAA4B;YAC3BC;YACAC;YACAC;QACJ,EAAE;QACF,GAAGgB,MAAM;IACb;AACJ;AAEA,SAASE,gBAAgBF,MAAW;IAChC,OAAO;QAAC;QAAuB;QAAW;QAAoB;KAAY,CAACG,MAAM,CAC7E,CAACC,QAAQC;QACL,MAAMC,QAAQF,MAAM,CAACC,IAAI;QACzB,IAAIC,SAAS,OAAOA,UAAU,UAAU;YACpCF,MAAM,CAACC,IAAI,GAAGE,KAAKC,SAAS,CAACJ,MAAM,CAACC,IAAI;QAC5C;QACA,OAAOD;IACX,GACAJ;AAER"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
_export_star(require("./find-packages"), exports);
|
|
6
6
|
_export_star(require("./find-up"), exports);
|
|
7
7
|
_export_star(require("./format-duration"), exports);
|
|
8
|
+
_export_star(require("./get-branch-configs"), exports);
|
|
8
9
|
_export_star(require("./get-configuration"), exports);
|
|
9
10
|
_export_star(require("./get-destination-folders"), exports);
|
|
10
11
|
_export_star(require("./get-folders"), exports);
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './find-packages';\nexport * from './find-up';\nexport * from './format-duration';\nexport * from './get-configuration';\nexport * from './get-destination-folders';\nexport * from './get-folders';\nexport * from './get-jest-config';\nexport * from './get-package-data';\nexport * from './get-package-name';\nexport * from './get-packages';\nexport * from './get-startup-version';\nexport * from './get-tsconfig';\nexport * from './load-shared-dependencies';\nexport * from './log';\nexport * from './log-errors';\nexport * from './pick';\nexport * from './read-json';\nexport * from './to-array';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA"}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './find-packages';\nexport * from './find-up';\nexport * from './format-duration';\nexport * from './get-branch-configs';\nexport * from './get-configuration';\nexport * from './get-destination-folders';\nexport * from './get-folders';\nexport * from './get-jest-config';\nexport * from './get-package-data';\nexport * from './get-package-name';\nexport * from './get-packages';\nexport * from './get-startup-version';\nexport * from './get-tsconfig';\nexport * from './load-shared-dependencies';\nexport * from './log';\nexport * from './log-errors';\nexport * from './pick';\nexport * from './read-json';\nexport * from './to-array';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/webpack/utils/testing/get-compiler.ts"],"sourcesContent":["import path from 'path';\n\nimport webpack, { Configuration } from 'webpack';\nimport { merge } from 'webpack-merge';\n\nimport { createFsFromVolume, Volume } from 'memfs';\n\nexport function getCompilerFactory(cwd: string) {\n return function getCompiler(entry: string, loaderOptions = {}, config: Configuration = {}) {\n const compiler = webpack(\n merge(\n {\n mode: 'development',\n devtool: config.devtool ?? false,\n context: path.resolve(cwd, './__tests__/__mocks__'),\n entry: path.resolve(cwd, './__tests__/__mocks__', entry),\n output: {\n path: path.resolve(cwd, './__tests__/dist'),\n filename: '[name].bundle.js',\n chunkFilename: '[name].chunk.js',\n },\n module: {\n rules: [\n {\n test: new RegExp(`\\\\.${path.basename(cwd)}\\\\.\\\\w+$`, 'i'),\n rules: [\n {\n loader: require.resolve(cwd),\n options: loaderOptions,\n },\n ],\n },\n ],\n },\n plugins: [],\n },\n config\n )\n )
|
|
1
|
+
{"version":3,"sources":["../../../../src/webpack/utils/testing/get-compiler.ts"],"sourcesContent":["import path from 'path';\n\nimport webpack, { Configuration } from 'webpack';\nimport { merge } from 'webpack-merge';\n\nimport { createFsFromVolume, Volume } from 'memfs';\n\nexport function getCompilerFactory(cwd: string) {\n return function getCompiler(entry: string, loaderOptions = {}, config: Configuration = {}) {\n const compiler = webpack(\n merge(\n {\n mode: 'development',\n devtool: config.devtool ?? false,\n context: path.resolve(cwd, './__tests__/__mocks__'),\n entry: path.resolve(cwd, './__tests__/__mocks__', entry),\n output: {\n path: path.resolve(cwd, './__tests__/dist'),\n filename: '[name].bundle.js',\n chunkFilename: '[name].chunk.js',\n },\n module: {\n rules: [\n {\n test: new RegExp(`\\\\.${path.basename(cwd)}\\\\.\\\\w+$`, 'i'),\n rules: [\n {\n loader: require.resolve(cwd),\n options: loaderOptions,\n },\n ],\n },\n ],\n },\n plugins: [],\n },\n config\n )\n )!;\n\n compiler.outputFileSystem = createFsFromVolume(new Volume()) as any;\n\n return compiler;\n };\n}\n"],"names":["getCompilerFactory","cwd","getCompiler","entry","loaderOptions","config","compiler","webpack","merge","mode","devtool","context","path","resolve","output","filename","chunkFilename","module","rules","test","RegExp","basename","loader","require","options","plugins","outputFileSystem","createFsFromVolume","Volume"],"mappings":";;;;+BAOgBA;;;eAAAA;;;6DAPC;gEAEsB;8BACjB;uBAEqB;;;;;;AAEpC,SAASA,mBAAmBC,GAAW;IAC1C,OAAO,SAASC,YAAYC,KAAa,EAAEC,gBAAgB,CAAC,CAAC,EAAEC,SAAwB,CAAC,CAAC;YAKhEA;QAJrB,MAAMC,WAAWC,IAAAA,gBAAO,EACpBC,IAAAA,mBAAK,EACD;YACIC,MAAM;YACNC,SAASL,CAAAA,kBAAAA,OAAOK,OAAO,cAAdL,6BAAAA,kBAAkB;YAC3BM,SAASC,aAAI,CAACC,OAAO,CAACZ,KAAK;YAC3BE,OAAOS,aAAI,CAACC,OAAO,CAACZ,KAAK,yBAAyBE;YAClDW,QAAQ;gBACJF,MAAMA,aAAI,CAACC,OAAO,CAACZ,KAAK;gBACxBc,UAAU;gBACVC,eAAe;YACnB;YACAC,QAAQ;gBACJC,OAAO;oBACH;wBACIC,MAAM,IAAIC,OAAO,CAAC,GAAG,EAAER,aAAI,CAACS,QAAQ,CAACpB,KAAK,QAAQ,CAAC,EAAE;wBACrDiB,OAAO;4BACH;gCACII,QAAQC,QAAQV,OAAO,CAACZ;gCACxBuB,SAASpB;4BACb;yBACH;oBACL;iBACH;YACL;YACAqB,SAAS,EAAE;QACf,GACApB;QAIRC,SAASoB,gBAAgB,GAAGC,IAAAA,yBAAkB,EAAC,IAAIC,aAAM;QAEzD,OAAOtB;IACX;AACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/startup",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "32.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://docs.st.dev/docs/frontend/startup",
|
|
6
6
|
"repository": {
|
|
@@ -37,21 +37,22 @@
|
|
|
37
37
|
"@jest/core": "~29.7.0",
|
|
38
38
|
"@jest/types": "~29.6.3",
|
|
39
39
|
"@jsdevtools/coverage-istanbul-loader": "^3.0.5",
|
|
40
|
-
"@servicetitan/eslint-config": "
|
|
41
|
-
"@servicetitan/stylelint-config": "
|
|
40
|
+
"@servicetitan/eslint-config": "32.0.0",
|
|
41
|
+
"@servicetitan/stylelint-config": "32.0.0",
|
|
42
42
|
"@svgr/webpack": "^8.1.0",
|
|
43
43
|
"@swc/cli": "^0.5.0",
|
|
44
|
-
"@swc/core": "1.13.
|
|
44
|
+
"@swc/core": "1.13.5",
|
|
45
45
|
"@types/debug": "^4.1.12",
|
|
46
46
|
"@types/jest": "~29.5.12",
|
|
47
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
47
48
|
"chalk": "~4.1.2",
|
|
48
49
|
"cpx2": "8.0.0",
|
|
49
50
|
"css-loader": "~7.1.2",
|
|
50
51
|
"css-minimizer-webpack-plugin": "^7.0.2",
|
|
51
52
|
"debounce": "^2.2.0",
|
|
52
|
-
"debug": "^4.4.
|
|
53
|
+
"debug": "^4.4.3",
|
|
53
54
|
"deepmerge": "~4.3.1",
|
|
54
|
-
"eslint": "~9.
|
|
55
|
+
"eslint": "~9.35.0",
|
|
55
56
|
"execa": "~5.1.1",
|
|
56
57
|
"glob": "~11.0.3",
|
|
57
58
|
"html-webpack-plugin": "~5.6.4",
|
|
@@ -62,31 +63,32 @@
|
|
|
62
63
|
"jest-environment-jsdom": "^29.7.0",
|
|
63
64
|
"jest-fetch-mock": "~3.0.3",
|
|
64
65
|
"json5": "^2.2.3",
|
|
65
|
-
"lerna": "~8.2.
|
|
66
|
-
"less": "~4.4.
|
|
66
|
+
"lerna": "~8.2.4",
|
|
67
|
+
"less": "~4.4.1",
|
|
67
68
|
"less-loader": "~12.3.0",
|
|
68
69
|
"less-plugin-npm-import": "~2.1.0",
|
|
69
70
|
"lodash.memoize": "^4.1.2",
|
|
70
|
-
"memfs": "~4.
|
|
71
|
+
"memfs": "~4.38.2",
|
|
71
72
|
"mini-css-extract-plugin": "~2.9.4",
|
|
72
73
|
"moment-locales-webpack-plugin": "~1.2.0",
|
|
73
74
|
"multimatch": "~5.0.0",
|
|
74
|
-
"portfinder": "~1.0.
|
|
75
|
+
"portfinder": "~1.0.38",
|
|
75
76
|
"postcss": "~8.5.6",
|
|
76
77
|
"prettier": "~3.6.2",
|
|
77
|
-
"sass": "~1.
|
|
78
|
+
"sass": "~1.92.1",
|
|
78
79
|
"sass-loader": "~16.0.5",
|
|
79
80
|
"semver": "~7.7.2",
|
|
80
81
|
"source-map-loader": "~5.0.0",
|
|
81
82
|
"style-loader": "~4.0.0",
|
|
82
|
-
"stylelint": "~16.
|
|
83
|
+
"stylelint": "~16.24.0",
|
|
83
84
|
"terminal-link": "^4.0.0",
|
|
84
85
|
"terser-webpack-plugin": "^5.3.14",
|
|
85
86
|
"ts-jest": "29.4.1",
|
|
86
87
|
"ts-node": "~10.9.2",
|
|
87
88
|
"typed-css-modules": "~0.9.1",
|
|
88
89
|
"typescript": "5.9.2",
|
|
89
|
-
"
|
|
90
|
+
"vitest": "^3.2.4",
|
|
91
|
+
"webpack": "~5.101.3",
|
|
90
92
|
"webpack-assets-manifest": "~6.2.2",
|
|
91
93
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
92
94
|
"webpack-dev-server": "~5.2.2",
|
|
@@ -118,5 +120,5 @@
|
|
|
118
120
|
"cli": {
|
|
119
121
|
"webpack": false
|
|
120
122
|
},
|
|
121
|
-
"gitHead": "
|
|
123
|
+
"gitHead": "af064114b3ec8c08a4b693a66c4062a52b03504c"
|
|
122
124
|
}
|
|
@@ -2,40 +2,38 @@ import { fs, vol } from 'memfs';
|
|
|
2
2
|
import { mkdirSync, rmSync } from 'fs';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
|
|
5
|
+
import { log } from '../../../utils';
|
|
6
|
+
import { gitCloneRepo, gitIsReachable } from '../../utils';
|
|
5
7
|
import { Init } from '../init';
|
|
6
|
-
import { runCommand, runCommandOutput } from '../../utils/cli-os';
|
|
7
8
|
|
|
8
9
|
jest.mock('fs', () => fs);
|
|
9
|
-
jest.mock('../../utils
|
|
10
|
+
jest.mock('../../utils', () => ({
|
|
11
|
+
gitCloneRepo: jest.fn(),
|
|
12
|
+
gitIsReachable: jest.fn(),
|
|
13
|
+
}));
|
|
10
14
|
jest.mock('../../../utils', () => ({
|
|
11
|
-
log: {
|
|
15
|
+
log: { debug: jest.fn(), error: jest.fn(), info: jest.fn() },
|
|
12
16
|
}));
|
|
13
17
|
|
|
14
|
-
const webUrl = 'https://github.com/servicetitan/frontend-example.git';
|
|
15
|
-
const sshUrl = 'git@github.com:servicetitan/frontend-example.git';
|
|
16
|
-
|
|
17
18
|
describe(`[startup] ${Init.name}`, () => {
|
|
18
19
|
let args: ConstructorParameters<typeof Init>[0];
|
|
19
20
|
|
|
20
21
|
beforeEach(() => {
|
|
21
22
|
args = {};
|
|
22
23
|
vol.reset();
|
|
23
|
-
jest.
|
|
24
|
-
jest.mocked(runCommand).mockImplementation(jest.fn());
|
|
25
|
-
jest.mocked(runCommandOutput).mockImplementation(jest.fn());
|
|
24
|
+
jest.mocked(gitCloneRepo).mockResolvedValue(true);
|
|
26
25
|
jest.spyOn(fs, 'mkdirSync').mockImplementation(jest.fn());
|
|
27
26
|
jest.spyOn(fs, 'rmSync').mockImplementation(jest.fn());
|
|
27
|
+
jest.spyOn(log, 'error').mockImplementation(jest.fn()); // suppress error output
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
const subject = async () => new Init(args).execute();
|
|
31
31
|
|
|
32
|
-
test(
|
|
32
|
+
test('clones "frontend-example" to current directory', async () => {
|
|
33
33
|
const cwd = path.resolve('.');
|
|
34
34
|
await subject();
|
|
35
35
|
|
|
36
|
-
expect(
|
|
37
|
-
quiet: true,
|
|
38
|
-
});
|
|
36
|
+
expect(gitCloneRepo).toHaveBeenCalledWith({ destination: cwd, name: 'frontend-example' });
|
|
39
37
|
expect(rmSync).toHaveBeenCalledWith(path.join(cwd, '.git'), {
|
|
40
38
|
recursive: true,
|
|
41
39
|
force: true,
|
|
@@ -44,59 +42,18 @@ describe(`[startup] ${Init.name}`, () => {
|
|
|
44
42
|
expect(rmSync).toHaveBeenCalledWith(path.join(cwd, 'package-lock.json'));
|
|
45
43
|
});
|
|
46
44
|
|
|
47
|
-
describe(
|
|
48
|
-
beforeEach(() => jest.mocked(
|
|
49
|
-
|
|
50
|
-
test(`clones ${sshUrl} to current directory`, async () => {
|
|
51
|
-
await subject();
|
|
52
|
-
|
|
53
|
-
expect(runCommand).toHaveBeenCalledWith(
|
|
54
|
-
`git clone -q ${sshUrl} ${path.resolve('.')}`,
|
|
55
|
-
expect.anything()
|
|
56
|
-
);
|
|
57
|
-
});
|
|
45
|
+
describe('when cloning fails', () => {
|
|
46
|
+
beforeEach(() => jest.mocked(gitCloneRepo).mockResolvedValue(false));
|
|
58
47
|
|
|
59
|
-
describe(
|
|
48
|
+
describe('when repo is not reachable', () => {
|
|
60
49
|
beforeEach(() => {
|
|
61
|
-
jest.mocked(
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
test(`checks if ${webUrl} is reachable`, async () => {
|
|
65
|
-
await subject();
|
|
66
|
-
|
|
67
|
-
expect(runCommandOutput).toHaveBeenCalledWith(`git ls-remote -qt ${webUrl}`, {
|
|
68
|
-
quiet: true,
|
|
69
|
-
});
|
|
50
|
+
jest.mocked(gitIsReachable).mockReturnValue(false);
|
|
70
51
|
});
|
|
71
52
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
test(`checks if ${sshUrl} is reachable`, async () => {
|
|
80
|
-
await subject();
|
|
81
|
-
|
|
82
|
-
expect(runCommandOutput).toHaveBeenCalledWith(`git ls-remote -qt ${sshUrl}`, {
|
|
83
|
-
quiet: true,
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
describe(`when ${sshUrl} is also unreachable`, () => {
|
|
88
|
-
beforeEach(() =>
|
|
89
|
-
jest.mocked(runCommandOutput).mockImplementation(() => {
|
|
90
|
-
throw new Error('Oops');
|
|
91
|
-
})
|
|
92
|
-
);
|
|
93
|
-
|
|
94
|
-
test('raises error', async () => {
|
|
95
|
-
await expect(subject()).rejects.toThrow(
|
|
96
|
-
/could not read servicetitan\/frontend-example repository/
|
|
97
|
-
);
|
|
98
|
-
});
|
|
99
|
-
});
|
|
53
|
+
test('raises error', async () => {
|
|
54
|
+
await expect(subject()).rejects.toThrow(
|
|
55
|
+
/could not read servicetitan\/frontend-example repository/
|
|
56
|
+
);
|
|
100
57
|
});
|
|
101
58
|
});
|
|
102
59
|
});
|
|
@@ -104,15 +61,13 @@ describe(`[startup] ${Init.name}`, () => {
|
|
|
104
61
|
describe('with an output location', () => {
|
|
105
62
|
beforeEach(() => (args.output = 'foo/bar'));
|
|
106
63
|
|
|
107
|
-
test(
|
|
64
|
+
test('clones repo to output location', async () => {
|
|
108
65
|
const destination = path.resolve(args.output!);
|
|
109
66
|
|
|
110
67
|
await subject();
|
|
111
68
|
|
|
112
69
|
expect(mkdirSync).toHaveBeenCalledWith(destination, { recursive: true });
|
|
113
|
-
expect(
|
|
114
|
-
quiet: true,
|
|
115
|
-
});
|
|
70
|
+
expect(gitCloneRepo).toHaveBeenCalledWith(expect.objectContaining({ destination }));
|
|
116
71
|
});
|
|
117
72
|
|
|
118
73
|
describe('when output location is a file', () => {
|
|
@@ -131,25 +86,4 @@ describe(`[startup] ${Init.name}`, () => {
|
|
|
131
86
|
});
|
|
132
87
|
});
|
|
133
88
|
});
|
|
134
|
-
|
|
135
|
-
describe('when running in CI environment with GITHUB_TOKEN', () => {
|
|
136
|
-
const originalEnv = process.env;
|
|
137
|
-
const token = 'foo-bar';
|
|
138
|
-
|
|
139
|
-
beforeEach(() => {
|
|
140
|
-
process.env.CI = 'true';
|
|
141
|
-
process.env.GITHUB_TOKEN = token;
|
|
142
|
-
});
|
|
143
|
-
afterEach(() => (process.env = originalEnv));
|
|
144
|
-
|
|
145
|
-
test(`adds token to ${webUrl}`, async () => {
|
|
146
|
-
await subject();
|
|
147
|
-
|
|
148
|
-
const urlWithToken = webUrl.replace('github.com', `oauth2:${token}@github.com`);
|
|
149
|
-
expect(runCommand).toHaveBeenCalledWith(
|
|
150
|
-
`git clone -q ${urlWithToken} ${path.resolve('.')}`,
|
|
151
|
-
expect.anything()
|
|
152
|
-
);
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
89
|
});
|