@workleap/tsup-configs 2.0.0 → 2.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,19 +1,25 @@
1
1
  # @workleap/tsup-configs
2
2
 
3
+ ## 2.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#92](https://github.com/gsoft-inc/wl-web-configs/pull/92) [`66e8f10`](https://github.com/gsoft-inc/wl-web-configs/commit/66e8f1033a987523c65fe9e61f53dac6d2e38777) Thanks [@ofrogon](https://github.com/ofrogon)! - Migrate project from GitHub organization
8
+
3
9
  ## 2.0.0
4
10
 
5
11
  ### Major Changes
6
12
 
7
- - [#85](https://github.com/workleap/wl-web-configs/pull/85) [`bad2df7`](https://github.com/workleap/wl-web-configs/commit/bad2df75593fb70d431d73bdced653b157c50caa) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated TSUP configuration and added a new SWC config package
13
+ - [#85](https://github.com/gsoft-inc/wl-web-configs/pull/85) [`bad2df7`](https://github.com/gsoft-inc/wl-web-configs/commit/bad2df75593fb70d431d73bdced653b157c50caa) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated TSUP configuration and added a new SWC config package
8
14
 
9
15
  ## 1.0.1
10
16
 
11
17
  ### Patch Changes
12
18
 
13
- - [#74](https://github.com/workleap/wl-web-configs/pull/74) [`43c9eb1`](https://github.com/workleap/wl-web-configs/commit/43c9eb11e61896855666c44beb0e711c82a560a3) Thanks [@alexasselin008](https://github.com/alexasselin008)! - Updated installation documentation
19
+ - [#74](https://github.com/gsoft-inc/wl-web-configs/pull/74) [`43c9eb1`](https://github.com/gsoft-inc/wl-web-configs/commit/43c9eb11e61896855666c44beb0e711c82a560a3) Thanks [@alexasselin008](https://github.com/alexasselin008)! - Updated installation documentation
14
20
 
15
21
  ## 1.0.0
16
22
 
17
23
  ### Major Changes
18
24
 
19
- - [#55](https://github.com/workleap/wl-web-configs/pull/55) [`228dc8c`](https://github.com/workleap/wl-web-configs/commit/228dc8cf3a0b3bc82e7c5380c876284583158599) Thanks [@alexasselin008](https://github.com/alexasselin008)! - Initial release
25
+ - [#55](https://github.com/gsoft-inc/wl-web-configs/pull/55) [`228dc8c`](https://github.com/gsoft-inc/wl-web-configs/commit/228dc8cf3a0b3bc82e7c5380c876284583158599) Thanks [@alexasselin008](https://github.com/alexasselin008)! - Initial release
package/README.md CHANGED
@@ -12,19 +12,19 @@ Install the following packages:
12
12
  **With pnpm**
13
13
 
14
14
  ```shell
15
- pnpm add -D @workleap/tsup-configs tsup
15
+ pnpm add -D @workleap/tsup-configs tsup typescript
16
16
  ```
17
17
 
18
18
  **With yarn**
19
19
 
20
20
  ```shell
21
- yarn add -D @workleap/tsup-configs tsup
21
+ yarn add -D @workleap/tsup-configs tsup typescript
22
22
  ```
23
23
 
24
24
  **With npm**
25
25
 
26
26
  ```shell
27
- npm install -D @workleap/tsup-configs tsup
27
+ npm install -D @workleap/tsup-configs tsup typescript
28
28
  ```
29
29
 
30
30
  ## Usage
@@ -57,6 +57,7 @@ The provided options will be merged with the default options. Given that a provi
57
57
 
58
58
  ```ts
59
59
  // tsup.dev.ts
60
+
60
61
  import { defineDevConfig, DefaultDevOptions } from "@workleap/tsup-configs";
61
62
 
62
63
  export default defineDevConfig({
@@ -68,6 +69,7 @@ export default defineDevConfig({
68
69
 
69
70
  ```ts
70
71
  // tsup.build.ts
72
+
71
73
  import { defineBuildConfig } from "@workleap/tsup-configs";
72
74
 
73
75
  export default defineBuildConfig();
@@ -77,6 +79,7 @@ You can override any existing options:
77
79
 
78
80
  ```ts
79
81
  // tsup.build.ts
82
+
80
83
  import { defineBuildConfig } from "@workleap/tsup-configs";
81
84
 
82
85
  export default defineBuildConfig({
@@ -88,6 +91,7 @@ The provided options will be merged with the default options. Given that a provi
88
91
 
89
92
  ```ts
90
93
  // tsup.build.ts
94
+
91
95
  import { defineBuildConfig, DefaultBuildOptions } from "@workleap/tsup-configs";
92
96
 
93
97
  export default defineBuildConfig({
@@ -110,6 +114,7 @@ If you want to use additional tsup options or override the default ones, you can
110
114
 
111
115
  ```ts
112
116
  // tsup.config.ts
117
+
113
118
  import { defineBuildConfig } from "@workleap/tsup-configs";
114
119
 
115
120
  export default defineBuildConfig({
@@ -124,7 +129,7 @@ export default defineBuildConfig({
124
129
 
125
130
  ### CJS support
126
131
 
127
- To support CJS projects, the package is build for ESM and CJS formats. To support CJS, `type: "module"` has been temporary removed from the `package.json` file.
132
+ 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.
128
133
 
129
134
  Once all our projects use ESM, CJS support can be removed.
130
135
 
@@ -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,8 @@
1
+ 'use strict';
2
+
3
+ // src/applyTransformers.ts
4
+ function applyTransformers(config, transformers, context) {
5
+ return transformers.reduce((acc, transformer) => transformer(acc, context), config);
6
+ }
7
+
8
+ exports.applyTransformers = applyTransformers;
@@ -0,0 +1 @@
1
+ export { applyTransformers } from './chunk-3UBBOKDF.mjs';
package/dist/build.d.ts CHANGED
@@ -1,16 +1,9 @@
1
1
  import { Options } from 'tsup';
2
- import { DefineConfigOptions } from './defineConfig.js';
2
+ import { TsupConfigTransformer } from './applyTransformers.js';
3
3
 
4
- declare const DefaultBuildOptions: {
5
- clean: true;
6
- dts: true;
7
- treeshake: true;
8
- entry: string[];
9
- outDir: string;
10
- format: string;
11
- target: "esnext";
12
- platform: "browser";
13
- };
14
- declare function defineBuildConfig(options?: DefineConfigOptions): Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
4
+ interface DefineBuildConfigOptions extends Options {
5
+ transformers?: TsupConfigTransformer[];
6
+ }
7
+ declare function defineBuildConfig(options?: DefineBuildConfigOptions): Options;
15
8
 
16
- export { DefaultBuildOptions, defineBuildConfig };
9
+ export { DefineBuildConfigOptions, defineBuildConfig };
package/dist/build.js CHANGED
@@ -1,48 +1,31 @@
1
1
  'use strict';
2
2
 
3
- var tsup = require('tsup');
4
-
5
- // src/defineConfig.ts
6
- function defineConfig(baseOptions, userOptions) {
7
- if (!userOptions || Array.isArray(userOptions) && userOptions.length === 0) {
8
- return tsup.defineConfig(baseOptions);
9
- }
10
- if (typeof userOptions === "function") {
11
- return tsup.defineConfig((...args) => ({
12
- ...baseOptions,
13
- ...userOptions(...args)
14
- }));
15
- }
16
- if (Array.isArray(userOptions)) {
17
- return tsup.defineConfig(
18
- userOptions.map((configItem) => {
19
- return {
20
- ...baseOptions,
21
- ...configItem
22
- };
23
- })
24
- );
25
- }
26
- return tsup.defineConfig({
27
- ...baseOptions,
28
- ...userOptions
29
- });
3
+ // src/applyTransformers.ts
4
+ function applyTransformers(config, transformers, context) {
5
+ return transformers.reduce((acc, transformer) => transformer(acc, context), config);
30
6
  }
31
7
 
32
8
  // src/build.ts
33
- var DefaultBuildOptions = {
34
- clean: true,
35
- dts: true,
36
- treeshake: true,
37
- entry: ["./src"],
38
- outDir: "./dist",
39
- format: "esm",
40
- target: "esnext",
41
- platform: "browser"
42
- };
43
- function defineBuildConfig(options) {
44
- return defineConfig(DefaultBuildOptions, options);
9
+ function defineBuildConfig(options = {}) {
10
+ const {
11
+ transformers = [],
12
+ ...rest
13
+ } = options;
14
+ const config = {
15
+ clean: true,
16
+ dts: true,
17
+ treeshake: true,
18
+ entry: ["./src"],
19
+ outDir: "./dist",
20
+ format: "esm",
21
+ target: "esnext",
22
+ platform: "browser",
23
+ ...rest
24
+ };
25
+ const transformedConfig = applyTransformers(config, transformers, {
26
+ environment: "build"
27
+ });
28
+ return transformedConfig;
45
29
  }
46
30
 
47
- exports.DefaultBuildOptions = DefaultBuildOptions;
48
31
  exports.defineBuildConfig = defineBuildConfig;
package/dist/build.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { DefaultBuildOptions, defineBuildConfig } from './chunk-AJHZ7CZ5.mjs';
2
- import './chunk-OUAGRIOH.mjs';
1
+ export { defineBuildConfig } from './chunk-JENCWRR7.mjs';
2
+ import './chunk-3UBBOKDF.mjs';
@@ -0,0 +1,6 @@
1
+ // src/applyTransformers.ts
2
+ function applyTransformers(config, transformers, context) {
3
+ return transformers.reduce((acc, transformer) => transformer(acc, context), config);
4
+ }
5
+
6
+ export { applyTransformers };
@@ -0,0 +1,26 @@
1
+ import { applyTransformers } from './chunk-3UBBOKDF.mjs';
2
+
3
+ // src/dev.ts
4
+ function defineDevConfig(options = {}) {
5
+ const {
6
+ transformers = [],
7
+ ...rest
8
+ } = options;
9
+ const config = {
10
+ dts: true,
11
+ watch: true,
12
+ entry: ["./src"],
13
+ outDir: "./dist",
14
+ format: "esm",
15
+ target: "esnext",
16
+ platform: "browser",
17
+ sourcemap: "inline",
18
+ ...rest
19
+ };
20
+ const transformedConfig = applyTransformers(config, transformers, {
21
+ environment: "dev"
22
+ });
23
+ return transformedConfig;
24
+ }
25
+
26
+ export { defineDevConfig };
@@ -0,0 +1,26 @@
1
+ import { applyTransformers } from './chunk-3UBBOKDF.mjs';
2
+
3
+ // src/build.ts
4
+ function defineBuildConfig(options = {}) {
5
+ const {
6
+ transformers = [],
7
+ ...rest
8
+ } = options;
9
+ const config = {
10
+ clean: true,
11
+ dts: true,
12
+ treeshake: true,
13
+ entry: ["./src"],
14
+ outDir: "./dist",
15
+ format: "esm",
16
+ target: "esnext",
17
+ platform: "browser",
18
+ ...rest
19
+ };
20
+ const transformedConfig = applyTransformers(config, transformers, {
21
+ environment: "build"
22
+ });
23
+ return transformedConfig;
24
+ }
25
+
26
+ export { defineBuildConfig };
package/dist/dev.d.ts CHANGED
@@ -1,16 +1,9 @@
1
1
  import { Options } from 'tsup';
2
- import { DefineConfigOptions } from './defineConfig.js';
2
+ import { TsupConfigTransformer } from './applyTransformers.js';
3
3
 
4
- declare const DefaultDevOptions: {
5
- dts: true;
6
- watch: true;
7
- entry: string[];
8
- outDir: string;
9
- format: string;
10
- target: "esnext";
11
- platform: "browser";
12
- sourcemap: "inline";
13
- };
14
- declare function defineDevConfig(options?: DefineConfigOptions): Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
4
+ interface DefineDevConfigOptions extends Options {
5
+ transformers?: TsupConfigTransformer[];
6
+ }
7
+ declare function defineDevConfig(options?: DefineDevConfigOptions): Options;
15
8
 
16
- export { DefaultDevOptions, defineDevConfig };
9
+ export { DefineDevConfigOptions, defineDevConfig };
package/dist/dev.js CHANGED
@@ -1,48 +1,31 @@
1
1
  'use strict';
2
2
 
3
- var tsup = require('tsup');
4
-
5
- // src/defineConfig.ts
6
- function defineConfig(baseOptions, userOptions) {
7
- if (!userOptions || Array.isArray(userOptions) && userOptions.length === 0) {
8
- return tsup.defineConfig(baseOptions);
9
- }
10
- if (typeof userOptions === "function") {
11
- return tsup.defineConfig((...args) => ({
12
- ...baseOptions,
13
- ...userOptions(...args)
14
- }));
15
- }
16
- if (Array.isArray(userOptions)) {
17
- return tsup.defineConfig(
18
- userOptions.map((configItem) => {
19
- return {
20
- ...baseOptions,
21
- ...configItem
22
- };
23
- })
24
- );
25
- }
26
- return tsup.defineConfig({
27
- ...baseOptions,
28
- ...userOptions
29
- });
3
+ // src/applyTransformers.ts
4
+ function applyTransformers(config, transformers, context) {
5
+ return transformers.reduce((acc, transformer) => transformer(acc, context), config);
30
6
  }
31
7
 
32
8
  // src/dev.ts
33
- var DefaultDevOptions = {
34
- dts: true,
35
- watch: true,
36
- entry: ["./src"],
37
- outDir: "./dist",
38
- format: "esm",
39
- target: "esnext",
40
- platform: "browser",
41
- sourcemap: "inline"
42
- };
43
- function defineDevConfig(options) {
44
- return defineConfig(DefaultDevOptions, options);
9
+ function defineDevConfig(options = {}) {
10
+ const {
11
+ transformers = [],
12
+ ...rest
13
+ } = options;
14
+ const config = {
15
+ dts: true,
16
+ watch: true,
17
+ entry: ["./src"],
18
+ outDir: "./dist",
19
+ format: "esm",
20
+ target: "esnext",
21
+ platform: "browser",
22
+ sourcemap: "inline",
23
+ ...rest
24
+ };
25
+ const transformedConfig = applyTransformers(config, transformers, {
26
+ environment: "dev"
27
+ });
28
+ return transformedConfig;
45
29
  }
46
30
 
47
- exports.DefaultDevOptions = DefaultDevOptions;
48
31
  exports.defineDevConfig = defineDevConfig;
package/dist/dev.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { DefaultDevOptions, defineDevConfig } from './chunk-TG5YPRC3.mjs';
2
- import './chunk-OUAGRIOH.mjs';
1
+ export { defineDevConfig } from './chunk-DQ32U23F.mjs';
2
+ import './chunk-3UBBOKDF.mjs';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { DefaultBuildOptions, defineBuildConfig } from './build.js';
2
- export { DefineConfigOptions } from './defineConfig.js';
3
- export { DefaultDevOptions, defineDevConfig } from './dev.js';
1
+ export { TsupConfigTransformer, TsupConfigTransformerContext } from './applyTransformers.js';
2
+ export { DefineBuildConfigOptions, defineBuildConfig } from './build.js';
3
+ export { DefineDevConfigOptions, defineDevConfig } from './dev.js';
4
4
  import 'tsup';
package/dist/index.js CHANGED
@@ -1,65 +1,55 @@
1
1
  'use strict';
2
2
 
3
- var tsup = require('tsup');
4
-
5
- // src/defineConfig.ts
6
- function defineConfig(baseOptions, userOptions) {
7
- if (!userOptions || Array.isArray(userOptions) && userOptions.length === 0) {
8
- return tsup.defineConfig(baseOptions);
9
- }
10
- if (typeof userOptions === "function") {
11
- return tsup.defineConfig((...args) => ({
12
- ...baseOptions,
13
- ...userOptions(...args)
14
- }));
15
- }
16
- if (Array.isArray(userOptions)) {
17
- return tsup.defineConfig(
18
- userOptions.map((configItem) => {
19
- return {
20
- ...baseOptions,
21
- ...configItem
22
- };
23
- })
24
- );
25
- }
26
- return tsup.defineConfig({
27
- ...baseOptions,
28
- ...userOptions
29
- });
3
+ // src/applyTransformers.ts
4
+ function applyTransformers(config, transformers, context) {
5
+ return transformers.reduce((acc, transformer) => transformer(acc, context), config);
30
6
  }
31
7
 
32
8
  // src/build.ts
33
- var DefaultBuildOptions = {
34
- clean: true,
35
- dts: true,
36
- treeshake: true,
37
- entry: ["./src"],
38
- outDir: "./dist",
39
- format: "esm",
40
- target: "esnext",
41
- platform: "browser"
42
- };
43
- function defineBuildConfig(options) {
44
- return defineConfig(DefaultBuildOptions, options);
9
+ function defineBuildConfig(options = {}) {
10
+ const {
11
+ transformers = [],
12
+ ...rest
13
+ } = options;
14
+ const config = {
15
+ clean: true,
16
+ dts: true,
17
+ treeshake: true,
18
+ entry: ["./src"],
19
+ outDir: "./dist",
20
+ format: "esm",
21
+ target: "esnext",
22
+ platform: "browser",
23
+ ...rest
24
+ };
25
+ const transformedConfig = applyTransformers(config, transformers, {
26
+ environment: "build"
27
+ });
28
+ return transformedConfig;
45
29
  }
46
30
 
47
31
  // src/dev.ts
48
- var DefaultDevOptions = {
49
- dts: true,
50
- watch: true,
51
- entry: ["./src"],
52
- outDir: "./dist",
53
- format: "esm",
54
- target: "esnext",
55
- platform: "browser",
56
- sourcemap: "inline"
57
- };
58
- function defineDevConfig(options) {
59
- return defineConfig(DefaultDevOptions, options);
32
+ function defineDevConfig(options = {}) {
33
+ const {
34
+ transformers = [],
35
+ ...rest
36
+ } = options;
37
+ const config = {
38
+ dts: true,
39
+ watch: true,
40
+ entry: ["./src"],
41
+ outDir: "./dist",
42
+ format: "esm",
43
+ target: "esnext",
44
+ platform: "browser",
45
+ sourcemap: "inline",
46
+ ...rest
47
+ };
48
+ const transformedConfig = applyTransformers(config, transformers, {
49
+ environment: "dev"
50
+ });
51
+ return transformedConfig;
60
52
  }
61
53
 
62
- exports.DefaultBuildOptions = DefaultBuildOptions;
63
- exports.DefaultDevOptions = DefaultDevOptions;
64
54
  exports.defineBuildConfig = defineBuildConfig;
65
55
  exports.defineDevConfig = defineDevConfig;
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- export { DefaultBuildOptions, defineBuildConfig } from './chunk-AJHZ7CZ5.mjs';
2
- export { DefaultDevOptions, defineDevConfig } from './chunk-TG5YPRC3.mjs';
3
- import './chunk-OUAGRIOH.mjs';
1
+ export { defineBuildConfig } from './chunk-JENCWRR7.mjs';
2
+ export { defineDevConfig } from './chunk-DQ32U23F.mjs';
3
+ import './chunk-3UBBOKDF.mjs';
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.0",
5
+ "version": "2.0.1",
6
6
  "license": "Apache-2.0",
7
7
  "keywords": [
8
8
  "workleap",
@@ -11,14 +11,15 @@
11
11
  ],
12
12
  "repository": {
13
13
  "type": "git",
14
- "url": "git+https://github.com/workleap/wl-web-configs.git",
14
+ "url": "git+https://github.com/gsoft-inc/wl-web-configs.git",
15
15
  "directory": "packages/tsup-configs"
16
16
  },
17
17
  "exports": {
18
18
  ".": {
19
19
  "require": "./dist/index.js",
20
20
  "import": "./dist/index.mjs",
21
- "types": "./dist/index.d.ts"
21
+ "types": "./dist/index.d.ts",
22
+ "default": "./dist/index.mjs"
22
23
  }
23
24
  },
24
25
  "files": [
@@ -26,6 +27,10 @@
26
27
  "CHANGELOG.md",
27
28
  "README.md"
28
29
  ],
30
+ "peerDependencies": {
31
+ "tsup": "*",
32
+ "typescript": "*"
33
+ },
29
34
  "devDependencies": {
30
35
  "@swc/core": "1.3.62",
31
36
  "@swc/helpers": "0.5.1",
@@ -35,12 +40,9 @@
35
40
  "ts-node": "10.9.1",
36
41
  "tsup": "6.7.0",
37
42
  "typescript": "5.0.4",
38
- "@workleap/eslint-plugin": "1.8.2",
39
- "@workleap/swc-configs": "1.0.0",
40
- "@workleap/typescript-configs": "2.3.2"
41
- },
42
- "peerDependencies": {
43
- "tsup": "*"
43
+ "@workleap/eslint-plugin": "1.8.3",
44
+ "@workleap/swc-configs": "1.0.1",
45
+ "@workleap/typescript-configs": "2.3.3"
44
46
  },
45
47
  "publishConfig": {
46
48
  "access": "public",
@@ -1,18 +0,0 @@
1
- import { defineConfig } from './chunk-OUAGRIOH.mjs';
2
-
3
- // src/build.ts
4
- var DefaultBuildOptions = {
5
- clean: true,
6
- dts: true,
7
- treeshake: true,
8
- entry: ["./src"],
9
- outDir: "./dist",
10
- format: "esm",
11
- target: "esnext",
12
- platform: "browser"
13
- };
14
- function defineBuildConfig(options) {
15
- return defineConfig(DefaultBuildOptions, options);
16
- }
17
-
18
- export { DefaultBuildOptions, defineBuildConfig };
@@ -1,30 +0,0 @@
1
- import { defineConfig as defineConfig$1 } from 'tsup';
2
-
3
- // src/defineConfig.ts
4
- function defineConfig(baseOptions, userOptions) {
5
- if (!userOptions || Array.isArray(userOptions) && userOptions.length === 0) {
6
- return defineConfig$1(baseOptions);
7
- }
8
- if (typeof userOptions === "function") {
9
- return defineConfig$1((...args) => ({
10
- ...baseOptions,
11
- ...userOptions(...args)
12
- }));
13
- }
14
- if (Array.isArray(userOptions)) {
15
- return defineConfig$1(
16
- userOptions.map((configItem) => {
17
- return {
18
- ...baseOptions,
19
- ...configItem
20
- };
21
- })
22
- );
23
- }
24
- return defineConfig$1({
25
- ...baseOptions,
26
- ...userOptions
27
- });
28
- }
29
-
30
- export { defineConfig };
@@ -1,18 +0,0 @@
1
- import { defineConfig } from './chunk-OUAGRIOH.mjs';
2
-
3
- // src/dev.ts
4
- var DefaultDevOptions = {
5
- dts: true,
6
- watch: true,
7
- entry: ["./src"],
8
- outDir: "./dist",
9
- format: "esm",
10
- target: "esnext",
11
- platform: "browser",
12
- sourcemap: "inline"
13
- };
14
- function defineDevConfig(options) {
15
- return defineConfig(DefaultDevOptions, options);
16
- }
17
-
18
- export { DefaultDevOptions, defineDevConfig };
@@ -1,6 +0,0 @@
1
- import { defineConfig as defineConfig$1, Options } from 'tsup';
2
-
3
- type DefineConfigOptions = Parameters<typeof defineConfig$1>[0];
4
- declare function defineConfig(baseOptions: Options, userOptions?: DefineConfigOptions): ReturnType<typeof defineConfig$1>;
5
-
6
- export { DefineConfigOptions, defineConfig };
@@ -1,32 +0,0 @@
1
- 'use strict';
2
-
3
- var tsup = require('tsup');
4
-
5
- // src/defineConfig.ts
6
- function defineConfig(baseOptions, userOptions) {
7
- if (!userOptions || Array.isArray(userOptions) && userOptions.length === 0) {
8
- return tsup.defineConfig(baseOptions);
9
- }
10
- if (typeof userOptions === "function") {
11
- return tsup.defineConfig((...args) => ({
12
- ...baseOptions,
13
- ...userOptions(...args)
14
- }));
15
- }
16
- if (Array.isArray(userOptions)) {
17
- return tsup.defineConfig(
18
- userOptions.map((configItem) => {
19
- return {
20
- ...baseOptions,
21
- ...configItem
22
- };
23
- })
24
- );
25
- }
26
- return tsup.defineConfig({
27
- ...baseOptions,
28
- ...userOptions
29
- });
30
- }
31
-
32
- exports.defineConfig = defineConfig;
@@ -1 +0,0 @@
1
- export { defineConfig } from './chunk-OUAGRIOH.mjs';