@servicetitan/startup 35.2.0 → 35.3.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cypress/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/cypress/config/index.ts"],"sourcesContent":["export * from './webpack-config';\n"],"names":[],"mappings":";;;;qBAAc"}
@@ -1,4 +1,4 @@
1
1
  import type { Configuration } from 'webpack';
2
- import { Overrides } from '../webpack/configs';
2
+ import { Overrides } from '../../webpack/configs';
3
3
  export declare function webpackConfig(overrides?: Overrides): Configuration;
4
4
  //# sourceMappingURL=webpack-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webpack-config.d.ts","sourceRoot":"","sources":["../../../src/cypress/config/webpack-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7C,OAAO,EAAW,SAAS,EAAe,MAAM,uBAAuB,CAAC;AAExE,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,aAAa,CAiBlE"}
@@ -10,10 +10,10 @@ Object.defineProperty(exports, "webpackConfig", {
10
10
  });
11
11
  const _nodeutil = require("node:util");
12
12
  const _webpackmerge = /*#__PURE__*/ _interop_require_default(require("webpack-merge"));
13
- const _tasks = require("../cli/tasks");
14
- const _utils = require("../cli/utils");
15
- const _utils1 = require("../utils");
16
- const _configs = require("../webpack/configs");
13
+ const _tasks = require("../../cli/tasks");
14
+ const _utils = require("../../cli/utils");
15
+ const _utils1 = require("../../utils");
16
+ const _configs = require("../../webpack/configs");
17
17
  function _interop_require_default(obj) {
18
18
  return obj && obj.__esModule ? obj : {
19
19
  default: obj
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/cypress/config/webpack-config.ts"],"sourcesContent":["import { inspect } from 'node:util';\nimport type { Configuration } from 'webpack';\nimport merge from 'webpack-merge';\nimport { getSwcOptions } from '../../cli/tasks';\nimport { TSConfig } from '../../cli/utils';\nimport { getTsConfigWithFallback, log } from '../../utils';\nimport { Context, Overrides, rulesConfig } from '../../webpack/configs';\n\nexport function webpackConfig(overrides?: Overrides): Configuration {\n const context = getContext();\n const rules = getRules(context, overrides ?? {});\n\n /* istanbul ignore next: debug only */\n log.debug('cypress-config:webpack-config', () => inspect({ rules }, { depth: null }));\n\n const config: Configuration = {\n module: {\n rules,\n },\n resolve: {\n extensions: ['.ts', '.tsx', '.js', '.jsx'],\n },\n };\n\n return merge(config, overrides?.configuration ?? {});\n}\n\nfunction getContext(): Context {\n return {\n destination: '',\n isProduction: false,\n name: '',\n packageData: {} as any,\n sharedDependencies: {},\n source: '',\n };\n}\n\nfunction getRules(context: Context, overrides: Overrides) {\n const { rules } = rulesConfig(context, overrides);\n\n return [getSwcLoaderRule(), ...rules];\n}\n\nfunction getSwcLoaderRule() {\n const tsConfig = new TSConfig(getTsConfigWithFallback());\n\n const swcOptions = getSwcOptions(tsConfig);\n\n return {\n test: /\\.tsx?$/,\n exclude: /node_modules/,\n use: {\n loader: 'swc-loader',\n options: swcOptions,\n },\n };\n}\n"],"names":["webpackConfig","overrides","context","getContext","rules","getRules","log","debug","inspect","depth","config","module","resolve","extensions","merge","configuration","destination","isProduction","name","packageData","sharedDependencies","source","rulesConfig","getSwcLoaderRule","tsConfig","TSConfig","getTsConfigWithFallback","swcOptions","getSwcOptions","test","exclude","use","loader","options"],"mappings":";;;;+BAQgBA;;;eAAAA;;;0BARQ;qEAEN;uBACY;uBACL;wBACoB;yBACG;;;;;;AAEzC,SAASA,cAAcC,SAAqB;;IAC/C,MAAMC,UAAUC;IAChB,MAAMC,QAAQC,SAASH,SAASD,sBAAAA,uBAAAA,YAAa,CAAC;IAE9C,oCAAoC,GACpCK,WAAG,CAACC,KAAK,CAAC,iCAAiC,IAAMC,IAAAA,iBAAO,EAAC;YAAEJ;QAAM,GAAG;YAAEK,OAAO;QAAK;IAElF,MAAMC,SAAwB;QAC1BC,QAAQ;YACJP;QACJ;QACAQ,SAAS;YACLC,YAAY;gBAAC;gBAAO;gBAAQ;gBAAO;aAAO;QAC9C;IACJ;IAEA,OAAOC,IAAAA,qBAAK,EAACJ,gBAAQT,sBAAAA,gCAAAA,UAAWc,aAAa,uCAAI,CAAC;AACtD;AAEA,SAASZ;IACL,OAAO;QACHa,aAAa;QACbC,cAAc;QACdC,MAAM;QACNC,aAAa,CAAC;QACdC,oBAAoB,CAAC;QACrBC,QAAQ;IACZ;AACJ;AAEA,SAAShB,SAASH,OAAgB,EAAED,SAAoB;IACpD,MAAM,EAAEG,KAAK,EAAE,GAAGkB,IAAAA,oBAAW,EAACpB,SAASD;IAEvC,OAAO;QAACsB;WAAuBnB;KAAM;AACzC;AAEA,SAASmB;IACL,MAAMC,WAAW,IAAIC,eAAQ,CAACC,IAAAA,+BAAuB;IAErD,MAAMC,aAAaC,IAAAA,oBAAa,EAACJ;IAEjC,OAAO;QACHK,MAAM;QACNC,SAAS;QACTC,KAAK;YACDC,QAAQ;YACRC,SAASN;QACb;IACJ;AACJ"}
@@ -0,0 +1,9 @@
1
+ import type { mount } from 'cypress/react';
2
+ declare global {
3
+ namespace Cypress {
4
+ interface Chainable {
5
+ mount: typeof mount;
6
+ }
7
+ }
8
+ }
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cypress/types/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,CAAC,MAAM,CAAC;IAEX,UAAU,OAAO,CAAC;QACd,UAAU,SAAS;YACf,KAAK,EAAE,OAAO,KAAK,CAAC;SACvB;KACJ;CACJ"}
@@ -0,0 +1,7 @@
1
+ // @ts-expect-error Module is only exported, not used in this project
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/cypress/types/index.ts"],"sourcesContent":["// @ts-expect-error Module is only exported, not used in this project\nimport type { mount } from 'cypress/react';\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace Cypress {\n interface Chainable {\n mount: typeof mount;\n }\n }\n}\n"],"names":[],"mappings":"AAAA,qEAAqE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/startup",
3
- "version": "35.2.0",
3
+ "version": "35.3.0",
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": {
@@ -20,7 +20,10 @@
20
20
  "default": "./dist/index.js",
21
21
  "types": "./dist/index.d.ts"
22
22
  },
23
- "./cypress-config": "./dist/cypress-config/index.js",
23
+ "./@types/cypress": {
24
+ "types": "./dist/cypress/types/index.d.ts"
25
+ },
26
+ "./cypress-config": "./dist/cypress/config/index.js",
24
27
  "./jest-preset": "./jest/jest-preset.js",
25
28
  "./jest-resolver": "./dist/jest/resolver.js",
26
29
  "./jest-svg-transformer": "./dist/jest/svg-transformer.js",
@@ -57,13 +60,13 @@
57
60
  "@jest/core": "~30.3.0",
58
61
  "@jest/types": "~30.3.0",
59
62
  "@jsdevtools/coverage-istanbul-loader": "^3.0.5",
60
- "@servicetitan/eslint-config": "35.2.0",
61
- "@servicetitan/install": "35.2.0",
62
- "@servicetitan/startup-utils": "35.2.0",
63
- "@servicetitan/stylelint-config": "35.2.0",
63
+ "@servicetitan/eslint-config": "35.3.0",
64
+ "@servicetitan/install": "35.3.0",
65
+ "@servicetitan/startup-utils": "35.3.0",
66
+ "@servicetitan/stylelint-config": "35.3.0",
64
67
  "@svgr/webpack": "^8.1.0",
65
68
  "@swc/cli": "^0.8.0",
66
- "@swc/core": "1.15.18",
69
+ "@swc/core": "1.15.21",
67
70
  "@types/debug": "^4.1.12",
68
71
  "@types/jest": "~30.0.0",
69
72
  "@vitest/coverage-v8": "^4.1.0",
@@ -91,7 +94,7 @@
91
94
  "less-plugin-npm-import": "~2.1.0",
92
95
  "lodash.kebabcase": "^4.1.1",
93
96
  "lodash.memoize": "^4.1.2",
94
- "memfs": "~4.56.11",
97
+ "memfs": "~4.57.1",
95
98
  "mini-css-extract-plugin": "~2.10.1",
96
99
  "moment-locales-webpack-plugin": "~1.2.0",
97
100
  "multimatch": "~8.0.0",
@@ -126,11 +129,15 @@
126
129
  "yargs": "~18.0.0"
127
130
  },
128
131
  "peerDependencies": {
132
+ "cypress": ">=15.0.0",
129
133
  "moment": ">=2.30.1"
130
134
  },
131
135
  "peerDependenciesMeta": {
132
136
  "moment": {
133
137
  "optional": true
138
+ },
139
+ "cypress": {
140
+ "optional": true
134
141
  }
135
142
  },
136
143
  "DEVELOPER_NOTES": {},
@@ -140,5 +147,5 @@
140
147
  "cli": {
141
148
  "webpack": false
142
149
  },
143
- "gitHead": "3dee12f1c7b7d2cf01180a187bd2b919a56c1fed"
150
+ "gitHead": "a978fa979eaba3487c32cd9f948391957974f7d1"
144
151
  }
@@ -1,14 +1,14 @@
1
- import { log } from '../../utils';
2
- import { SwcCompilePackage, TscCompile, TscCompilePackage } from '../tasks';
3
- import { RunTask } from './run-task';
1
+ import { log } from '../../../utils';
2
+ import { SwcCompilePackage, TscCompile, TscCompilePackage } from '../../tasks';
3
+ import { RunTask } from '../run-task';
4
4
 
5
- jest.mock('../../utils', () => ({
6
- ...jest.requireActual('../../utils'),
5
+ jest.mock('../../../utils', () => ({
6
+ ...jest.requireActual('../../../utils'),
7
7
  log: { error: jest.fn(), text: jest.fn() },
8
8
  }));
9
- jest.mock('../tasks/swc-compile-package');
10
- jest.mock('../tasks/tsc-compile');
11
- jest.mock('../tasks/tsc-compile-package');
9
+ jest.mock('../../tasks/swc-compile-package');
10
+ jest.mock('../../tasks/tsc-compile');
11
+ jest.mock('../../tasks/tsc-compile-package');
12
12
 
13
13
  describe(`[startup] ${RunTask.name}`, () => {
14
14
  let args: ConstructorParameters<typeof RunTask>[0];
@@ -1,13 +1,13 @@
1
1
  import { fs, vol } from 'memfs';
2
- import { getSwcOptions } from '../../cli/tasks';
3
- import { TSConfig } from '../../cli/utils';
4
- import { getBaseTsConfig } from '../../utils';
5
- import { Overrides, rulesConfig } from '../../webpack/configs';
2
+ import { getSwcOptions } from '../../../cli/tasks';
3
+ import { TSConfig } from '../../../cli/utils';
4
+ import { getBaseTsConfig } from '../../../utils';
5
+ import { Overrides, rulesConfig } from '../../../webpack/configs';
6
6
  import { webpackConfig } from '../webpack-config';
7
7
 
8
8
  jest.mock('fs', () => fs);
9
- jest.mock('../../webpack/configs');
10
- jest.mock('../../cli/tasks');
9
+ jest.mock('../../../webpack/configs');
10
+ jest.mock('../../../cli/tasks');
11
11
 
12
12
  describe(`[startup/cypress-config] ${webpackConfig.name}`, () => {
13
13
  const mockRules: any[] = [
@@ -1,10 +1,10 @@
1
1
  import { inspect } from 'node:util';
2
2
  import type { Configuration } from 'webpack';
3
3
  import merge from 'webpack-merge';
4
- import { getSwcOptions } from '../cli/tasks';
5
- import { TSConfig } from '../cli/utils';
6
- import { getTsConfigWithFallback, log } from '../utils';
7
- import { Context, Overrides, rulesConfig } from '../webpack/configs';
4
+ import { getSwcOptions } from '../../cli/tasks';
5
+ import { TSConfig } from '../../cli/utils';
6
+ import { getTsConfigWithFallback, log } from '../../utils';
7
+ import { Context, Overrides, rulesConfig } from '../../webpack/configs';
8
8
 
9
9
  export function webpackConfig(overrides?: Overrides): Configuration {
10
10
  const context = getContext();
@@ -0,0 +1,11 @@
1
+ // @ts-expect-error Module is only exported, not used in this project
2
+ import type { mount } from 'cypress/react';
3
+
4
+ declare global {
5
+ // eslint-disable-next-line @typescript-eslint/no-namespace
6
+ namespace Cypress {
7
+ interface Chainable {
8
+ mount: typeof mount;
9
+ }
10
+ }
11
+ }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=run-task.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run-task.test.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/run-task.test.ts"],"names":[],"mappings":""}
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _utils = require("../../utils");
6
- const _tasks = require("../tasks");
7
- const _runtask = require("./run-task");
8
- jest.mock('../../utils', ()=>({
9
- ...jest.requireActual('../../utils'),
10
- log: {
11
- error: jest.fn(),
12
- text: jest.fn()
13
- }
14
- }));
15
- jest.mock('../tasks/swc-compile-package');
16
- jest.mock('../tasks/tsc-compile');
17
- jest.mock('../tasks/tsc-compile-package');
18
- describe(`[startup] ${_runtask.RunTask.name}`, ()=>{
19
- let args;
20
- beforeEach(()=>{
21
- jest.clearAllMocks();
22
- });
23
- const subject = ()=>new _runtask.RunTask(args).execute();
24
- const supportedTasks = {
25
- 'tsc-compile-package': _tasks.TscCompilePackage,
26
- 'swc-compile-package': _tasks.SwcCompilePackage,
27
- 'tsc-compile': _tasks.TscCompile
28
- };
29
- Object.entries(supportedTasks).forEach(([name, task])=>describe(`with ${name}`, ()=>{
30
- beforeEach(()=>args = {
31
- _: [
32
- name
33
- ]
34
- }); // eslint-disable-line @typescript-eslint/naming-convention
35
- test(`runs ${task.name}`, async ()=>{
36
- await subject();
37
- expect(jest.mocked(task).mock.instances[0].execute).toHaveBeenCalled();
38
- });
39
- }));
40
- describe('with empty args', ()=>{
41
- beforeEach(()=>args = {});
42
- test('logs error for undefined task', async ()=>{
43
- await subject();
44
- expect(_utils.log.error).toHaveBeenCalledWith('Unknown task: "undefined"');
45
- });
46
- });
47
- describe('with unrecognized task', ()=>{
48
- beforeEach(()=>args = {
49
- _: [
50
- 'foo'
51
- ]
52
- }); // eslint-disable-line @typescript-eslint/naming-convention
53
- test('logs error', async ()=>{
54
- var _args__;
55
- await subject();
56
- expect(_utils.log.error).toHaveBeenCalledWith(`Unknown task: "${(_args__ = args._) === null || _args__ === void 0 ? void 0 : _args__[0]}"`);
57
- });
58
- test('lists supported tasks', async ()=>{
59
- await subject();
60
- expect(_utils.log.text).toHaveBeenCalledWith(`\nSupported tasks: "${Object.keys(supportedTasks).join('", "')}"`);
61
- });
62
- });
63
- });
64
-
65
- //# sourceMappingURL=run-task.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/cli/commands/run-task.test.ts"],"sourcesContent":["import { log } from '../../utils';\nimport { SwcCompilePackage, TscCompile, TscCompilePackage } from '../tasks';\nimport { RunTask } from './run-task';\n\njest.mock('../../utils', () => ({\n ...jest.requireActual('../../utils'),\n log: { error: jest.fn(), text: jest.fn() },\n}));\njest.mock('../tasks/swc-compile-package');\njest.mock('../tasks/tsc-compile');\njest.mock('../tasks/tsc-compile-package');\n\ndescribe(`[startup] ${RunTask.name}`, () => {\n let args: ConstructorParameters<typeof RunTask>[0];\n\n beforeEach(() => {\n jest.clearAllMocks();\n });\n\n const subject = () => new RunTask(args).execute();\n\n const supportedTasks = {\n 'tsc-compile-package': TscCompilePackage,\n 'swc-compile-package': SwcCompilePackage,\n 'tsc-compile': TscCompile,\n };\n\n Object.entries(supportedTasks).forEach(([name, task]) =>\n describe(`with ${name}`, () => {\n beforeEach(() => (args = { _: [name] })); // eslint-disable-line @typescript-eslint/naming-convention\n\n test(`runs ${task.name}`, async () => {\n await subject();\n\n expect(jest.mocked(task).mock.instances[0].execute).toHaveBeenCalled();\n });\n })\n );\n\n describe('with empty args', () => {\n beforeEach(() => (args = {}));\n\n test('logs error for undefined task', async () => {\n await subject();\n\n expect(log.error).toHaveBeenCalledWith('Unknown task: \"undefined\"');\n });\n });\n\n describe('with unrecognized task', () => {\n beforeEach(() => (args = { _: ['foo'] })); // eslint-disable-line @typescript-eslint/naming-convention\n\n test('logs error', async () => {\n await subject();\n\n expect(log.error).toHaveBeenCalledWith(`Unknown task: \"${args._?.[0]}\"`);\n });\n\n test('lists supported tasks', async () => {\n await subject();\n\n expect(log.text).toHaveBeenCalledWith(\n `\\nSupported tasks: \"${Object.keys(supportedTasks).join('\", \"')}\"`\n );\n });\n });\n});\n"],"names":["jest","mock","requireActual","log","error","fn","text","describe","RunTask","name","args","beforeEach","clearAllMocks","subject","execute","supportedTasks","TscCompilePackage","SwcCompilePackage","TscCompile","Object","entries","forEach","task","_","test","expect","mocked","instances","toHaveBeenCalled","toHaveBeenCalledWith","keys","join"],"mappings":";;;;uBAAoB;uBAC6C;yBACzC;AAExBA,KAAKC,IAAI,CAAC,eAAe,IAAO,CAAA;QAC5B,GAAGD,KAAKE,aAAa,CAAC,cAAc;QACpCC,KAAK;YAAEC,OAAOJ,KAAKK,EAAE;YAAIC,MAAMN,KAAKK,EAAE;QAAG;IAC7C,CAAA;AACAL,KAAKC,IAAI,CAAC;AACVD,KAAKC,IAAI,CAAC;AACVD,KAAKC,IAAI,CAAC;AAEVM,SAAS,CAAC,UAAU,EAAEC,gBAAO,CAACC,IAAI,EAAE,EAAE;IAClC,IAAIC;IAEJC,WAAW;QACPX,KAAKY,aAAa;IACtB;IAEA,MAAMC,UAAU,IAAM,IAAIL,gBAAO,CAACE,MAAMI,OAAO;IAE/C,MAAMC,iBAAiB;QACnB,uBAAuBC,wBAAiB;QACxC,uBAAuBC,wBAAiB;QACxC,eAAeC,iBAAU;IAC7B;IAEAC,OAAOC,OAAO,CAACL,gBAAgBM,OAAO,CAAC,CAAC,CAACZ,MAAMa,KAAK,GAChDf,SAAS,CAAC,KAAK,EAAEE,MAAM,EAAE;YACrBE,WAAW,IAAOD,OAAO;oBAAEa,GAAG;wBAACd;qBAAK;gBAAC,IAAK,2DAA2D;YAErGe,KAAK,CAAC,KAAK,EAAEF,KAAKb,IAAI,EAAE,EAAE;gBACtB,MAAMI;gBAENY,OAAOzB,KAAK0B,MAAM,CAACJ,MAAMrB,IAAI,CAAC0B,SAAS,CAAC,EAAE,CAACb,OAAO,EAAEc,gBAAgB;YACxE;QACJ;IAGJrB,SAAS,mBAAmB;QACxBI,WAAW,IAAOD,OAAO,CAAC;QAE1Bc,KAAK,iCAAiC;YAClC,MAAMX;YAENY,OAAOtB,UAAG,CAACC,KAAK,EAAEyB,oBAAoB,CAAC;QAC3C;IACJ;IAEAtB,SAAS,0BAA0B;QAC/BI,WAAW,IAAOD,OAAO;gBAAEa,GAAG;oBAAC;iBAAM;YAAC,IAAK,2DAA2D;QAEtGC,KAAK,cAAc;gBAG0Cd;YAFzD,MAAMG;YAENY,OAAOtB,UAAG,CAACC,KAAK,EAAEyB,oBAAoB,CAAC,CAAC,eAAe,GAAEnB,UAAAA,KAAKa,CAAC,cAANb,8BAAAA,OAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QAC3E;QAEAc,KAAK,yBAAyB;YAC1B,MAAMX;YAENY,OAAOtB,UAAG,CAACG,IAAI,EAAEuB,oBAAoB,CACjC,CAAC,oBAAoB,EAAEV,OAAOW,IAAI,CAACf,gBAAgBgB,IAAI,CAAC,QAAQ,CAAC,CAAC;QAE1E;IACJ;AACJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cypress-config/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/cypress-config/index.ts"],"sourcesContent":["export * from './webpack-config';\n"],"names":[],"mappings":";;;;qBAAc"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"webpack-config.d.ts","sourceRoot":"","sources":["../../src/cypress-config/webpack-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7C,OAAO,EAAW,SAAS,EAAe,MAAM,oBAAoB,CAAC;AAErE,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,aAAa,CAiBlE"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/cypress-config/webpack-config.ts"],"sourcesContent":["import { inspect } from 'node:util';\nimport type { Configuration } from 'webpack';\nimport merge from 'webpack-merge';\nimport { getSwcOptions } from '../cli/tasks';\nimport { TSConfig } from '../cli/utils';\nimport { getTsConfigWithFallback, log } from '../utils';\nimport { Context, Overrides, rulesConfig } from '../webpack/configs';\n\nexport function webpackConfig(overrides?: Overrides): Configuration {\n const context = getContext();\n const rules = getRules(context, overrides ?? {});\n\n /* istanbul ignore next: debug only */\n log.debug('cypress-config:webpack-config', () => inspect({ rules }, { depth: null }));\n\n const config: Configuration = {\n module: {\n rules,\n },\n resolve: {\n extensions: ['.ts', '.tsx', '.js', '.jsx'],\n },\n };\n\n return merge(config, overrides?.configuration ?? {});\n}\n\nfunction getContext(): Context {\n return {\n destination: '',\n isProduction: false,\n name: '',\n packageData: {} as any,\n sharedDependencies: {},\n source: '',\n };\n}\n\nfunction getRules(context: Context, overrides: Overrides) {\n const { rules } = rulesConfig(context, overrides);\n\n return [getSwcLoaderRule(), ...rules];\n}\n\nfunction getSwcLoaderRule() {\n const tsConfig = new TSConfig(getTsConfigWithFallback());\n\n const swcOptions = getSwcOptions(tsConfig);\n\n return {\n test: /\\.tsx?$/,\n exclude: /node_modules/,\n use: {\n loader: 'swc-loader',\n options: swcOptions,\n },\n };\n}\n"],"names":["webpackConfig","overrides","context","getContext","rules","getRules","log","debug","inspect","depth","config","module","resolve","extensions","merge","configuration","destination","isProduction","name","packageData","sharedDependencies","source","rulesConfig","getSwcLoaderRule","tsConfig","TSConfig","getTsConfigWithFallback","swcOptions","getSwcOptions","test","exclude","use","loader","options"],"mappings":";;;;+BAQgBA;;;eAAAA;;;0BARQ;qEAEN;uBACY;uBACL;wBACoB;yBACG;;;;;;AAEzC,SAASA,cAAcC,SAAqB;;IAC/C,MAAMC,UAAUC;IAChB,MAAMC,QAAQC,SAASH,SAASD,sBAAAA,uBAAAA,YAAa,CAAC;IAE9C,oCAAoC,GACpCK,WAAG,CAACC,KAAK,CAAC,iCAAiC,IAAMC,IAAAA,iBAAO,EAAC;YAAEJ;QAAM,GAAG;YAAEK,OAAO;QAAK;IAElF,MAAMC,SAAwB;QAC1BC,QAAQ;YACJP;QACJ;QACAQ,SAAS;YACLC,YAAY;gBAAC;gBAAO;gBAAQ;gBAAO;aAAO;QAC9C;IACJ;IAEA,OAAOC,IAAAA,qBAAK,EAACJ,gBAAQT,sBAAAA,gCAAAA,UAAWc,aAAa,uCAAI,CAAC;AACtD;AAEA,SAASZ;IACL,OAAO;QACHa,aAAa;QACbC,cAAc;QACdC,MAAM;QACNC,aAAa,CAAC;QACdC,oBAAoB,CAAC;QACrBC,QAAQ;IACZ;AACJ;AAEA,SAAShB,SAASH,OAAgB,EAAED,SAAoB;IACpD,MAAM,EAAEG,KAAK,EAAE,GAAGkB,IAAAA,oBAAW,EAACpB,SAASD;IAEvC,OAAO;QAACsB;WAAuBnB;KAAM;AACzC;AAEA,SAASmB;IACL,MAAMC,WAAW,IAAIC,eAAQ,CAACC,IAAAA,+BAAuB;IAErD,MAAMC,aAAaC,IAAAA,oBAAa,EAACJ;IAEjC,OAAO;QACHK,MAAM;QACNC,SAAS;QACTC,KAAK;YACDC,QAAQ;YACRC,SAASN;QACb;IACJ;AACJ"}
File without changes