@workleap/swc-configs 2.1.1 → 2.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @workleap/swc-configs
2
2
 
3
+ ## 2.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#173](https://github.com/gsoft-inc/wl-web-configs/pull/173) [`65df9e7`](https://github.com/gsoft-inc/wl-web-configs/commit/65df9e7bd00bf631c0769d9abe90a5029f5187a0) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Added the `baseUrl` and `paths` predefined options.
8
+
9
+ ## 2.1.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#143](https://github.com/gsoft-inc/wl-web-configs/pull/143) [`334088f`](https://github.com/gsoft-inc/wl-web-configs/commit/334088fac63aad6cc245ee3300da076e5c201287) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated to SWC 1.3.85
14
+
3
15
  ## 2.1.1
4
16
 
5
17
  ### Patch Changes
@@ -6,4 +6,4 @@ interface SwcConfigTransformerContext {
6
6
  type SwcConfigTransformer = (config: Config, context: SwcConfigTransformerContext) => Config;
7
7
  declare function applyTransformers(config: Config, transformers: SwcConfigTransformer[], context: SwcConfigTransformerContext): Config;
8
8
 
9
- export { SwcConfigTransformer, SwcConfigTransformerContext, applyTransformers };
9
+ export { type SwcConfigTransformer, type SwcConfigTransformerContext, applyTransformers };
@@ -6,4 +6,4 @@ interface SwcConfigTransformerContext {
6
6
  type SwcConfigTransformer = (config: Config, context: SwcConfigTransformerContext) => Config;
7
7
  declare function applyTransformers(config: Config, transformers: SwcConfigTransformer[], context: SwcConfigTransformerContext): Config;
8
8
 
9
- export { SwcConfigTransformer, SwcConfigTransformerContext, applyTransformers };
9
+ export { type SwcConfigTransformer, type SwcConfigTransformerContext, applyTransformers };
@@ -6,4 +6,4 @@ interface BrowserslistToSwcOptions extends Omit<browserslist.Options, "path"> {
6
6
  }
7
7
  declare function browserslistToSwc(options?: BrowserslistToSwcOptions): Record<keyof readonly ["ie", "edge", "firefox", "chrome", "safari", "opera", "ios", "android", "op_mob", "and_chr", "and_ff", "ie_mob", "samsung"], string>;
8
8
 
9
- export { BrowserslistToSwcOptions, browserslistToSwc, createSwcTargetsFromBrowserslistEntries };
9
+ export { type BrowserslistToSwcOptions, browserslistToSwc, createSwcTargetsFromBrowserslistEntries };
@@ -6,4 +6,4 @@ interface BrowserslistToSwcOptions extends Omit<browserslist.Options, "path"> {
6
6
  }
7
7
  declare function browserslistToSwc(options?: BrowserslistToSwcOptions): Record<keyof readonly ["ie", "edge", "firefox", "chrome", "safari", "opera", "ios", "android", "op_mob", "and_chr", "and_ff", "ie_mob", "samsung"], string>;
8
8
 
9
- export { BrowserslistToSwcOptions, browserslistToSwc, createSwcTargetsFromBrowserslistEntries };
9
+ export { type BrowserslistToSwcOptions, browserslistToSwc, createSwcTargetsFromBrowserslistEntries };
package/dist/build.d.mts CHANGED
@@ -2,9 +2,11 @@ import { Config } from '@swc/core';
2
2
  import { SwcConfigTransformer } from './applyTransformers.mjs';
3
3
 
4
4
  interface DefineBuildConfigOptions {
5
+ baseUrl?: NonNullable<Config["jsc"]>["baseUrl"];
5
6
  parser?: "ecmascript" | "typescript";
7
+ paths?: NonNullable<Config["jsc"]>["paths"];
6
8
  transformers?: SwcConfigTransformer[];
7
9
  }
8
10
  declare function defineBuildConfig(targets: Record<string, string>, options?: DefineBuildConfigOptions): Config;
9
11
 
10
- export { DefineBuildConfigOptions, defineBuildConfig };
12
+ export { type DefineBuildConfigOptions, defineBuildConfig };
package/dist/build.d.ts CHANGED
@@ -2,9 +2,11 @@ import { Config } from '@swc/core';
2
2
  import { SwcConfigTransformer } from './applyTransformers.js';
3
3
 
4
4
  interface DefineBuildConfigOptions {
5
+ baseUrl?: NonNullable<Config["jsc"]>["baseUrl"];
5
6
  parser?: "ecmascript" | "typescript";
7
+ paths?: NonNullable<Config["jsc"]>["paths"];
6
8
  transformers?: SwcConfigTransformer[];
7
9
  }
8
10
  declare function defineBuildConfig(targets: Record<string, string>, options?: DefineBuildConfigOptions): Config;
9
11
 
10
- export { DefineBuildConfigOptions, defineBuildConfig };
12
+ export { type DefineBuildConfigOptions, defineBuildConfig };
package/dist/build.js CHANGED
@@ -8,11 +8,15 @@ function applyTransformers(config, transformers, context) {
8
8
  // src/build.ts
9
9
  function defineBuildConfig(targets, options = {}) {
10
10
  const {
11
+ baseUrl,
11
12
  parser = "typescript",
13
+ paths,
12
14
  transformers = []
13
15
  } = options;
14
16
  const config = {
15
17
  jsc: {
18
+ baseUrl,
19
+ paths,
16
20
  parser: parser === "ecmascript" ? {
17
21
  syntax: "ecmascript",
18
22
  jsx: true
@@ -39,11 +43,7 @@ function defineBuildConfig(targets, options = {}) {
39
43
  },
40
44
  module: {
41
45
  // The output module resolution system that the code will be compiled for.
42
- type: "es6",
43
- // Prevent SWC from exporting the `__esModule` property.
44
- strict: true,
45
- // Preserve dynamic imports.
46
- ignoreDynamic: true
46
+ type: "es6"
47
47
  },
48
48
  env: {
49
49
  // jsc.target is not provided because the provided targets takes precedence.
package/dist/build.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { defineBuildConfig } from './chunk-PTGQ44ZX.mjs';
1
+ export { defineBuildConfig } from './chunk-OLWWFWTT.mjs';
2
2
  import './chunk-3UBBOKDF.mjs';
@@ -3,12 +3,16 @@ import { applyTransformers } from './chunk-3UBBOKDF.mjs';
3
3
  // src/dev.ts
4
4
  function defineDevConfig(targets, options = {}) {
5
5
  const {
6
+ baseUrl,
6
7
  fastRefresh = true,
7
8
  parser = "typescript",
9
+ paths,
8
10
  transformers = []
9
11
  } = options;
10
12
  const config = {
11
13
  jsc: {
14
+ baseUrl,
15
+ paths,
12
16
  parser: parser === "ecmascript" ? {
13
17
  syntax: "ecmascript",
14
18
  jsx: true
@@ -33,11 +37,7 @@ function defineDevConfig(targets, options = {}) {
33
37
  },
34
38
  module: {
35
39
  // The output module resolution system that the code will be compiled for.
36
- type: "es6",
37
- // Prevent SWC from exporting the `__esModule` property.
38
- strict: true,
39
- // Preserve dynamic imports.
40
- ignoreDynamic: true
40
+ type: "es6"
41
41
  },
42
42
  env: {
43
43
  // jsc.target is not provided because the provided targets takes precedence.
@@ -3,12 +3,16 @@ import { applyTransformers } from './chunk-3UBBOKDF.mjs';
3
3
  // src/jest.ts
4
4
  function defineJestConfig(options = {}) {
5
5
  const {
6
- react = false,
6
+ baseUrl,
7
7
  parser = "typescript",
8
+ paths,
9
+ react = false,
8
10
  transformers = []
9
11
  } = options;
10
12
  const config = {
11
13
  jsc: {
14
+ baseUrl,
15
+ paths,
12
16
  parser: parser === "ecmascript" ? {
13
17
  syntax: "ecmascript",
14
18
  jsx: react
@@ -29,11 +33,7 @@ function defineJestConfig(options = {}) {
29
33
  },
30
34
  module: {
31
35
  // The output module resolution system that the code will be compiled for.
32
- type: "es6",
33
- // Prevent SWC from exporting the `__esModule` property.
34
- strict: true,
35
- // Preserve dynamic imports.
36
- ignoreDynamic: true
36
+ type: "es6"
37
37
  }
38
38
  };
39
39
  const transformedConfig = applyTransformers(config, transformers, {
@@ -3,11 +3,15 @@ import { applyTransformers } from './chunk-3UBBOKDF.mjs';
3
3
  // src/build.ts
4
4
  function defineBuildConfig(targets, options = {}) {
5
5
  const {
6
+ baseUrl,
6
7
  parser = "typescript",
8
+ paths,
7
9
  transformers = []
8
10
  } = options;
9
11
  const config = {
10
12
  jsc: {
13
+ baseUrl,
14
+ paths,
11
15
  parser: parser === "ecmascript" ? {
12
16
  syntax: "ecmascript",
13
17
  jsx: true
@@ -34,11 +38,7 @@ function defineBuildConfig(targets, options = {}) {
34
38
  },
35
39
  module: {
36
40
  // The output module resolution system that the code will be compiled for.
37
- type: "es6",
38
- // Prevent SWC from exporting the `__esModule` property.
39
- strict: true,
40
- // Preserve dynamic imports.
41
- ignoreDynamic: true
41
+ type: "es6"
42
42
  },
43
43
  env: {
44
44
  // jsc.target is not provided because the provided targets takes precedence.
package/dist/dev.d.mts CHANGED
@@ -2,10 +2,12 @@ import { Config } from '@swc/core';
2
2
  import { SwcConfigTransformer } from './applyTransformers.mjs';
3
3
 
4
4
  interface DefineDevConfigOptions {
5
+ baseUrl?: NonNullable<Config["jsc"]>["baseUrl"];
5
6
  fastRefresh?: boolean;
6
7
  parser?: "ecmascript" | "typescript";
8
+ paths?: NonNullable<Config["jsc"]>["paths"];
7
9
  transformers?: SwcConfigTransformer[];
8
10
  }
9
11
  declare function defineDevConfig(targets: Record<string, string>, options?: DefineDevConfigOptions): Config;
10
12
 
11
- export { DefineDevConfigOptions, defineDevConfig };
13
+ export { type DefineDevConfigOptions, defineDevConfig };
package/dist/dev.d.ts CHANGED
@@ -2,10 +2,12 @@ import { Config } from '@swc/core';
2
2
  import { SwcConfigTransformer } from './applyTransformers.js';
3
3
 
4
4
  interface DefineDevConfigOptions {
5
+ baseUrl?: NonNullable<Config["jsc"]>["baseUrl"];
5
6
  fastRefresh?: boolean;
6
7
  parser?: "ecmascript" | "typescript";
8
+ paths?: NonNullable<Config["jsc"]>["paths"];
7
9
  transformers?: SwcConfigTransformer[];
8
10
  }
9
11
  declare function defineDevConfig(targets: Record<string, string>, options?: DefineDevConfigOptions): Config;
10
12
 
11
- export { DefineDevConfigOptions, defineDevConfig };
13
+ export { type DefineDevConfigOptions, defineDevConfig };
package/dist/dev.js CHANGED
@@ -8,12 +8,16 @@ function applyTransformers(config, transformers, context) {
8
8
  // src/dev.ts
9
9
  function defineDevConfig(targets, options = {}) {
10
10
  const {
11
+ baseUrl,
11
12
  fastRefresh = true,
12
13
  parser = "typescript",
14
+ paths,
13
15
  transformers = []
14
16
  } = options;
15
17
  const config = {
16
18
  jsc: {
19
+ baseUrl,
20
+ paths,
17
21
  parser: parser === "ecmascript" ? {
18
22
  syntax: "ecmascript",
19
23
  jsx: true
@@ -38,11 +42,7 @@ function defineDevConfig(targets, options = {}) {
38
42
  },
39
43
  module: {
40
44
  // The output module resolution system that the code will be compiled for.
41
- type: "es6",
42
- // Prevent SWC from exporting the `__esModule` property.
43
- strict: true,
44
- // Preserve dynamic imports.
45
- ignoreDynamic: true
45
+ type: "es6"
46
46
  },
47
47
  env: {
48
48
  // jsc.target is not provided because the provided targets takes precedence.
package/dist/dev.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { defineDevConfig } from './chunk-HMVMGPPX.mjs';
1
+ export { defineDevConfig } from './chunk-G3VHSALI.mjs';
2
2
  import './chunk-3UBBOKDF.mjs';
package/dist/index.js CHANGED
@@ -84,11 +84,15 @@ function applyTransformers(config, transformers, context) {
84
84
  // src/build.ts
85
85
  function defineBuildConfig(targets, options = {}) {
86
86
  const {
87
+ baseUrl,
87
88
  parser = "typescript",
89
+ paths,
88
90
  transformers = []
89
91
  } = options;
90
92
  const config = {
91
93
  jsc: {
94
+ baseUrl,
95
+ paths,
92
96
  parser: parser === "ecmascript" ? {
93
97
  syntax: "ecmascript",
94
98
  jsx: true
@@ -115,11 +119,7 @@ function defineBuildConfig(targets, options = {}) {
115
119
  },
116
120
  module: {
117
121
  // The output module resolution system that the code will be compiled for.
118
- type: "es6",
119
- // Prevent SWC from exporting the `__esModule` property.
120
- strict: true,
121
- // Preserve dynamic imports.
122
- ignoreDynamic: true
122
+ type: "es6"
123
123
  },
124
124
  env: {
125
125
  // jsc.target is not provided because the provided targets takes precedence.
@@ -135,12 +135,16 @@ function defineBuildConfig(targets, options = {}) {
135
135
  // src/dev.ts
136
136
  function defineDevConfig(targets, options = {}) {
137
137
  const {
138
+ baseUrl,
138
139
  fastRefresh = true,
139
140
  parser = "typescript",
141
+ paths,
140
142
  transformers = []
141
143
  } = options;
142
144
  const config = {
143
145
  jsc: {
146
+ baseUrl,
147
+ paths,
144
148
  parser: parser === "ecmascript" ? {
145
149
  syntax: "ecmascript",
146
150
  jsx: true
@@ -165,11 +169,7 @@ function defineDevConfig(targets, options = {}) {
165
169
  },
166
170
  module: {
167
171
  // The output module resolution system that the code will be compiled for.
168
- type: "es6",
169
- // Prevent SWC from exporting the `__esModule` property.
170
- strict: true,
171
- // Preserve dynamic imports.
172
- ignoreDynamic: true
172
+ type: "es6"
173
173
  },
174
174
  env: {
175
175
  // jsc.target is not provided because the provided targets takes precedence.
@@ -185,12 +185,16 @@ function defineDevConfig(targets, options = {}) {
185
185
  // src/jest.ts
186
186
  function defineJestConfig(options = {}) {
187
187
  const {
188
- react = false,
188
+ baseUrl,
189
189
  parser = "typescript",
190
+ paths,
191
+ react = false,
190
192
  transformers = []
191
193
  } = options;
192
194
  const config = {
193
195
  jsc: {
196
+ baseUrl,
197
+ paths,
194
198
  parser: parser === "ecmascript" ? {
195
199
  syntax: "ecmascript",
196
200
  jsx: react
@@ -211,11 +215,7 @@ function defineJestConfig(options = {}) {
211
215
  },
212
216
  module: {
213
217
  // The output module resolution system that the code will be compiled for.
214
- type: "es6",
215
- // Prevent SWC from exporting the `__esModule` property.
216
- strict: true,
217
- // Preserve dynamic imports.
218
- ignoreDynamic: true
218
+ type: "es6"
219
219
  }
220
220
  };
221
221
  const transformedConfig = applyTransformers(config, transformers, {
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  export { browserslistToSwc, createSwcTargetsFromBrowserslistEntries } from './chunk-MGMFB3UY.mjs';
2
- export { defineBuildConfig } from './chunk-PTGQ44ZX.mjs';
3
- export { defineDevConfig } from './chunk-HMVMGPPX.mjs';
4
- export { defineJestConfig } from './chunk-MYINGMHM.mjs';
2
+ export { defineBuildConfig } from './chunk-OLWWFWTT.mjs';
3
+ export { defineDevConfig } from './chunk-G3VHSALI.mjs';
4
+ export { defineJestConfig } from './chunk-JXCM6TQ3.mjs';
5
5
  import './chunk-3UBBOKDF.mjs';
package/dist/jest.d.mts CHANGED
@@ -2,10 +2,12 @@ import { Config } from '@swc/core';
2
2
  import { SwcConfigTransformer } from './applyTransformers.mjs';
3
3
 
4
4
  interface DefineJestConfigOptions {
5
- react?: boolean;
5
+ baseUrl?: NonNullable<Config["jsc"]>["baseUrl"];
6
6
  parser?: "ecmascript" | "typescript";
7
+ paths?: NonNullable<Config["jsc"]>["paths"];
8
+ react?: boolean;
7
9
  transformers?: SwcConfigTransformer[];
8
10
  }
9
11
  declare function defineJestConfig(options?: DefineJestConfigOptions): Config;
10
12
 
11
- export { DefineJestConfigOptions, defineJestConfig };
13
+ export { type DefineJestConfigOptions, defineJestConfig };
package/dist/jest.d.ts CHANGED
@@ -2,10 +2,12 @@ import { Config } from '@swc/core';
2
2
  import { SwcConfigTransformer } from './applyTransformers.js';
3
3
 
4
4
  interface DefineJestConfigOptions {
5
- react?: boolean;
5
+ baseUrl?: NonNullable<Config["jsc"]>["baseUrl"];
6
6
  parser?: "ecmascript" | "typescript";
7
+ paths?: NonNullable<Config["jsc"]>["paths"];
8
+ react?: boolean;
7
9
  transformers?: SwcConfigTransformer[];
8
10
  }
9
11
  declare function defineJestConfig(options?: DefineJestConfigOptions): Config;
10
12
 
11
- export { DefineJestConfigOptions, defineJestConfig };
13
+ export { type DefineJestConfigOptions, defineJestConfig };
package/dist/jest.js CHANGED
@@ -8,12 +8,16 @@ function applyTransformers(config, transformers, context) {
8
8
  // src/jest.ts
9
9
  function defineJestConfig(options = {}) {
10
10
  const {
11
- react = false,
11
+ baseUrl,
12
12
  parser = "typescript",
13
+ paths,
14
+ react = false,
13
15
  transformers = []
14
16
  } = options;
15
17
  const config = {
16
18
  jsc: {
19
+ baseUrl,
20
+ paths,
17
21
  parser: parser === "ecmascript" ? {
18
22
  syntax: "ecmascript",
19
23
  jsx: react
@@ -34,11 +38,7 @@ function defineJestConfig(options = {}) {
34
38
  },
35
39
  module: {
36
40
  // The output module resolution system that the code will be compiled for.
37
- type: "es6",
38
- // Prevent SWC from exporting the `__esModule` property.
39
- strict: true,
40
- // Preserve dynamic imports.
41
- ignoreDynamic: true
41
+ type: "es6"
42
42
  }
43
43
  };
44
44
  const transformedConfig = applyTransformers(config, transformers, {
package/dist/jest.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { defineJestConfig } from './chunk-MYINGMHM.mjs';
1
+ export { defineJestConfig } from './chunk-JXCM6TQ3.mjs';
2
2
  import './chunk-3UBBOKDF.mjs';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@workleap/swc-configs",
3
3
  "description": "Workleap recommended SWC configs.",
4
- "version": "2.1.1",
4
+ "version": "2.2.0",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
7
7
  "workleap",
@@ -32,17 +32,17 @@
32
32
  "directory": "packages/swc-configs"
33
33
  },
34
34
  "devDependencies": {
35
- "@swc/core": "1.3.82",
36
- "@swc/helpers": "0.5.1",
35
+ "@swc/core": "1.3.99",
36
+ "@swc/helpers": "0.5.3",
37
37
  "@swc/jest": "0.2.29",
38
- "@types/jest": "29.5.4",
39
- "browserslist": "4.21.10",
40
- "jest": "29.6.4",
38
+ "@types/jest": "29.5.10",
39
+ "browserslist": "4.22.1",
40
+ "jest": "29.7.0",
41
41
  "ts-node": "10.9.1",
42
- "tsup": "7.2.0",
42
+ "tsup": "8.0.1",
43
43
  "typescript": "5.2.2",
44
- "@workleap/eslint-plugin": "2.1.0",
45
- "@workleap/tsup-configs": "3.0.0",
44
+ "@workleap/eslint-plugin": "3.0.0",
45
+ "@workleap/tsup-configs": "3.0.1",
46
46
  "@workleap/typescript-configs": "3.0.2"
47
47
  },
48
48
  "peerDependencies": {