@workleap/tsup-configs 2.0.1 → 3.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/CHANGELOG.md +6 -0
- package/README.md +7 -120
- package/dist/index.d.ts +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @workleap/tsup-configs
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#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
|
|
8
|
+
|
|
3
9
|
## 2.0.1
|
|
4
10
|
|
|
5
11
|
### 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)
|
|
6
4
|
[](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
|
-
|
|
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
|
-
|
|
10
|
+
## 🤝 Contributing
|
|
69
11
|
|
|
70
|
-
|
|
71
|
-
// tsup.build.ts
|
|
12
|
+
View the [contributor's documentation](../../CONTRIBUTING.md).
|
|
72
13
|
|
|
73
|
-
|
|
14
|
+
### Notes
|
|
74
15
|
|
|
75
|
-
|
|
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,
|
|
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
|
+
|
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": "
|
|
5
|
+
"version": "3.0.0",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"workleap",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"ts-node": "10.9.1",
|
|
41
41
|
"tsup": "6.7.0",
|
|
42
42
|
"typescript": "5.0.4",
|
|
43
|
-
"@workleap/eslint-plugin": "
|
|
44
|
-
"@workleap/swc-configs": "
|
|
45
|
-
"@workleap/typescript-configs": "
|
|
43
|
+
"@workleap/eslint-plugin": "2.0.0",
|
|
44
|
+
"@workleap/swc-configs": "2.0.0",
|
|
45
|
+
"@workleap/typescript-configs": "3.0.0"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public",
|