@workleap/tsup-configs 2.0.1 → 3.0.1

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/tsup-configs
2
2
 
3
+ ## 3.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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
8
+
9
+ ## 3.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - [#98](https://github.com/gsoft-inc/wl-web-configs/pull/98) [`56ca32e`](https://github.com/gsoft-inc/wl-web-configs/commit/56ca32ee3194c51210aacc5189f3ebbec5a4a7b6) Thanks [@patricklafrance](https://github.com/patricklafrance)! - New start, every package has a major version bump
14
+
3
15
  ## 2.0.1
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -1,133 +1,19 @@
1
1
  # @workleap/tsup-configs
2
2
 
3
- Workleap's recommended [tsup](https://tsup.egoist.dev/) configs.
4
-
5
3
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](../../LICENSE)
6
4
  [![npm version](https://img.shields.io/npm/v/@workleap/tsup-configs)](https://www.npmjs.com/package/@workleap/tsup-configs)
7
5
 
8
- ## Installation
9
-
10
- Install the following packages:
11
-
12
- **With pnpm**
13
-
14
- ```shell
15
- pnpm add -D @workleap/tsup-configs tsup typescript
16
- ```
17
-
18
- **With yarn**
19
-
20
- ```shell
21
- yarn add -D @workleap/tsup-configs tsup typescript
22
- ```
23
-
24
- **With npm**
25
-
26
- ```shell
27
- npm install -D @workleap/tsup-configs tsup typescript
28
- ```
29
-
30
6
  ## Usage
31
7
 
32
- To build your React or TypeScript library project, follow these steps:
33
-
34
- 1. Create two files at the top of your project: `tsup.dev.ts` and `tsup.build.ts`.
35
-
36
- 2. Open the `tsup.dev.ts` file and add the following code:
37
-
38
- ```ts
39
- // tsup.dev.ts
40
- import { defineDevConfig } from "@workleap/tsup-configs";
41
-
42
- export default defineDevConfig();
43
- ```
44
-
45
- You can override any existing options:
46
-
47
- ```ts
48
- // tsup.dev.ts
49
- import { defineDevConfig } from "@workleap/tsup-configs";
50
-
51
- export default defineDevConfig({
52
- clean: true
53
- });
54
- ```
55
-
56
- The provided options will be merged with the default options. Given that a provided option match a default option, it will override the default option. If you prefer to extend the default option, you can import the `DefaultDevOptions` object and handle the merging code in your configuration file:
57
-
58
- ```ts
59
- // tsup.dev.ts
60
-
61
- import { defineDevConfig, DefaultDevOptions } from "@workleap/tsup-configs";
62
-
63
- export default defineDevConfig({
64
- format: ["cjs", ...DefaultDevOptions.format]
65
- });
66
- ```
8
+ View the [user's documentation](https://gsoft-inc.github.io/wl-web-configs/).
67
9
 
68
- 3. Open the `tsup.build.ts` file and add the following code:
10
+ ## 🤝 Contributing
69
11
 
70
- ```ts
71
- // tsup.build.ts
12
+ View the [contributor's documentation](../../CONTRIBUTING.md).
72
13
 
73
- import { defineBuildConfig } from "@workleap/tsup-configs";
14
+ ### Notes
74
15
 
75
- export default defineBuildConfig();
76
- ```
77
-
78
- You can override any existing options:
79
-
80
- ```ts
81
- // tsup.build.ts
82
-
83
- import { defineBuildConfig } from "@workleap/tsup-configs";
84
-
85
- export default defineBuildConfig({
86
- clean: true
87
- });
88
- ```
89
-
90
- The provided options will be merged with the default options. Given that a provided option matches a default option, it will override the default option. If you prefer to extend the default option, you can import the `DefaultBuildOptions` object and handle the merging code in your configuration file:
91
-
92
- ```ts
93
- // tsup.build.ts
94
-
95
- import { defineBuildConfig, DefaultBuildOptions } from "@workleap/tsup-configs";
96
-
97
- export default defineBuildConfig({
98
- format: ["cjs", ...DefaultBuildOptions.format]
99
- });
100
- ```
101
-
102
- 4. In your package.json file, add the following scripts:
103
-
104
- ```json
105
- "dev": "tsup --config ./tsup.dev.ts",
106
- "build": "tsup --config ./tsup.build.ts"
107
- ```
108
-
109
- Now you can use the `dev` script to run tsup in watch mode and the `build` script to build your library.
110
-
111
- ## Customization
112
-
113
- If you want to use additional tsup options or override the default ones, you can pass a custom tsup config to the functions exported by this packages:
114
-
115
- ```ts
116
- // tsup.config.ts
117
-
118
- import { defineBuildConfig } from "@workleap/tsup-configs";
119
-
120
- export default defineBuildConfig({
121
- entry: ["lib/index.ts"],
122
- format: ["cjs"]
123
- });
124
- ```
125
-
126
- [Check out all available options here](https://paka.dev/npm/tsup#module-index-export-Options) or the documentation website at https://tsup.egoist.dev/
127
-
128
- ## Maintainers notes
129
-
130
- ### CJS support
16
+ #### CJS support
131
17
 
132
18
  To support CJS projects, this package is build for ESM and CJS formats. To support CJS, `type: "module"` has been temporary removed from the `package.json` file.
133
19
 
@@ -135,4 +21,5 @@ Once all our projects use ESM, CJS support can be removed.
135
21
 
136
22
  ## License
137
23
 
138
- Copyright © 2023, GSoft inc. This code is licensed under the Apache License, Version 2.0. You may obtain a copy of this license at https://github.com/gsoft-inc/gsoft-license/blob/master/LICENSE.
24
+ Copyright © 2023, Workleap. This code is licensed under the Apache License, Version 2.0. You may obtain a copy of this license at https://github.com/gsoft-inc/workleap-license/blob/master/LICENSE.
25
+
@@ -0,0 +1,9 @@
1
+ import { Options } from 'tsup';
2
+
3
+ interface TsupConfigTransformerContext {
4
+ environment: "dev" | "build";
5
+ }
6
+ type TsupConfigTransformer = (config: Options, context: TsupConfigTransformerContext) => Options;
7
+ declare function applyTransformers(config: Options, transformers: TsupConfigTransformer[], context: TsupConfigTransformerContext): Options;
8
+
9
+ export { TsupConfigTransformer, TsupConfigTransformerContext, applyTransformers };
@@ -0,0 +1,9 @@
1
+ import { Options } from 'tsup';
2
+ import { TsupConfigTransformer } from './applyTransformers.mjs';
3
+
4
+ interface DefineBuildConfigOptions extends Options {
5
+ transformers?: TsupConfigTransformer[];
6
+ }
7
+ declare function defineBuildConfig(options?: DefineBuildConfigOptions): Options;
8
+
9
+ export { DefineBuildConfigOptions, defineBuildConfig };
package/dist/dev.d.mts ADDED
@@ -0,0 +1,9 @@
1
+ import { Options } from 'tsup';
2
+ import { TsupConfigTransformer } from './applyTransformers.mjs';
3
+
4
+ interface DefineDevConfigOptions extends Options {
5
+ transformers?: TsupConfigTransformer[];
6
+ }
7
+ declare function defineDevConfig(options?: DefineDevConfigOptions): Options;
8
+
9
+ export { DefineDevConfigOptions, defineDevConfig };
@@ -0,0 +1,4 @@
1
+ export { Options as TsupConfig } from 'tsup';
2
+ export { TsupConfigTransformer, TsupConfigTransformerContext } from './applyTransformers.mjs';
3
+ export { DefineBuildConfigOptions, defineBuildConfig } from './build.mjs';
4
+ export { DefineDevConfigOptions, defineDevConfig } from './dev.mjs';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
+ export { Options as TsupConfig } from 'tsup';
1
2
  export { TsupConfigTransformer, TsupConfigTransformerContext } from './applyTransformers.js';
2
3
  export { DefineBuildConfigOptions, defineBuildConfig } from './build.js';
3
4
  export { DefineDevConfigOptions, defineDevConfig } from './dev.js';
4
- import 'tsup';
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@workleap/tsup-configs",
3
3
  "author": "Workleap",
4
4
  "description": "Workleap's recommended tsup configs.",
5
- "version": "2.0.1",
5
+ "version": "3.0.1",
6
6
  "license": "Apache-2.0",
7
7
  "keywords": [
8
8
  "workleap",
@@ -16,12 +16,17 @@
16
16
  },
17
17
  "exports": {
18
18
  ".": {
19
- "require": "./dist/index.js",
20
- "import": "./dist/index.mjs",
21
- "types": "./dist/index.d.ts",
22
- "default": "./dist/index.mjs"
19
+ "require": {
20
+ "types": "./dist/index.d.ts",
21
+ "default": "./dist/index.js"
22
+ },
23
+ "import": {
24
+ "types": "./dist/index.d.mts",
25
+ "default": "./dist/index.mjs"
26
+ }
23
27
  }
24
28
  },
29
+ "types": "./dist/index.d.ts",
25
30
  "files": [
26
31
  "dist",
27
32
  "CHANGELOG.md",
@@ -32,17 +37,17 @@
32
37
  "typescript": "*"
33
38
  },
34
39
  "devDependencies": {
35
- "@swc/core": "1.3.62",
36
- "@swc/helpers": "0.5.1",
37
- "@swc/jest": "0.2.26",
38
- "@types/jest": "29.5.2",
39
- "jest": "29.5.0",
40
+ "@swc/core": "1.3.85",
41
+ "@swc/helpers": "0.5.2",
42
+ "@swc/jest": "0.2.29",
43
+ "@types/jest": "29.5.5",
44
+ "jest": "29.7.0",
40
45
  "ts-node": "10.9.1",
41
- "tsup": "6.7.0",
42
- "typescript": "5.0.4",
43
- "@workleap/eslint-plugin": "1.8.3",
44
- "@workleap/swc-configs": "1.0.1",
45
- "@workleap/typescript-configs": "2.3.3"
46
+ "tsup": "7.2.0",
47
+ "typescript": "5.2.2",
48
+ "@workleap/eslint-plugin": "2.1.1",
49
+ "@workleap/swc-configs": "2.1.2",
50
+ "@workleap/typescript-configs": "3.0.2"
46
51
  },
47
52
  "publishConfig": {
48
53
  "access": "public",