@workleap/swc-configs 2.1.2 → 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,11 @@
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
+
3
9
  ## 2.1.2
4
10
 
5
11
  ### 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
package/dist/build.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { defineBuildConfig } from './chunk-5DI7IZIG.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
@@ -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
@@ -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
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
package/dist/dev.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { defineDevConfig } from './chunk-IQX2HH4E.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
@@ -131,12 +135,16 @@ function defineBuildConfig(targets, options = {}) {
131
135
  // src/dev.ts
132
136
  function defineDevConfig(targets, options = {}) {
133
137
  const {
138
+ baseUrl,
134
139
  fastRefresh = true,
135
140
  parser = "typescript",
141
+ paths,
136
142
  transformers = []
137
143
  } = options;
138
144
  const config = {
139
145
  jsc: {
146
+ baseUrl,
147
+ paths,
140
148
  parser: parser === "ecmascript" ? {
141
149
  syntax: "ecmascript",
142
150
  jsx: true
@@ -177,12 +185,16 @@ function defineDevConfig(targets, options = {}) {
177
185
  // src/jest.ts
178
186
  function defineJestConfig(options = {}) {
179
187
  const {
180
- react = false,
188
+ baseUrl,
181
189
  parser = "typescript",
190
+ paths,
191
+ react = false,
182
192
  transformers = []
183
193
  } = options;
184
194
  const config = {
185
195
  jsc: {
196
+ baseUrl,
197
+ paths,
186
198
  parser: parser === "ecmascript" ? {
187
199
  syntax: "ecmascript",
188
200
  jsx: react
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  export { browserslistToSwc, createSwcTargetsFromBrowserslistEntries } from './chunk-MGMFB3UY.mjs';
2
- export { defineBuildConfig } from './chunk-5DI7IZIG.mjs';
3
- export { defineDevConfig } from './chunk-IQX2HH4E.mjs';
4
- export { defineJestConfig } from './chunk-BAXEZBXT.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
package/dist/jest.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { defineJestConfig } from './chunk-BAXEZBXT.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.2",
4
+ "version": "2.2.0",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
7
7
  "workleap",
@@ -32,16 +32,16 @@
32
32
  "directory": "packages/swc-configs"
33
33
  },
34
34
  "devDependencies": {
35
- "@swc/core": "1.3.85",
36
- "@swc/helpers": "0.5.2",
35
+ "@swc/core": "1.3.99",
36
+ "@swc/helpers": "0.5.3",
37
37
  "@swc/jest": "0.2.29",
38
- "@types/jest": "29.5.5",
39
- "browserslist": "4.21.10",
38
+ "@types/jest": "29.5.10",
39
+ "browserslist": "4.22.1",
40
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.1",
44
+ "@workleap/eslint-plugin": "3.0.0",
45
45
  "@workleap/tsup-configs": "3.0.1",
46
46
  "@workleap/typescript-configs": "3.0.2"
47
47
  },