@alessiofrittoli/package-configs 1.3.0 → 1.4.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.
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../tsconfig/index.cjs");let t=require("tsdown");const n=(n={})=>(0,t.defineConfig)(async(t,r)=>{let{target:i,watch:a=t.watch,tsconfig:o=t.tsconfig,deps:s=t.deps,clean:c=t.clean??!a,...l}=typeof n==`function`?await n(t,r):n,u=i||(typeof o==`string`?e.getTSConfigCompilerTarget({filepath:o}):i);return{entry:[`src/**/index.ts`],format:[`cjs`,`esm`],dts:!0,shims:!0,clean:c,treeshake:!0,minify:!a,sourcemap:!!a,tsconfig:o,target:u,watch:a,deps:s,...l}});exports.tsdownConfig=n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../tsconfig/index.cjs");let t=require("tsdown");const n=(n={})=>(0,t.defineConfig)(async(t,r)=>{let{target:i,watch:a,tsconfig:o,deps:s,clean:c,outDir:l,parsedTsConfig:u,...d}=typeof n==`function`?await n(t,r):n,{target:f=i,watch:p=a,tsconfig:m=o,deps:h=s,clean:g=c??!p,outDir:_=l}=t,v=u||m||typeof m==`string`?e.parseTsConfig({filepath:typeof m==`string`?m:void 0}):void 0,y=_||v?.options.outDir||`dist`,b=f||v&&e.getTSConfigCompilerTarget({parsedTsConfig:v});return{entry:[`src/**/index.ts`],format:[`cjs`,`esm`],outDir:y,dts:!0,shims:!0,clean:g,treeshake:!0,minify:!p,sourcemap:!!p,tsconfig:m,target:b,watch:p,deps:h,...d}});exports.tsdownConfig=n;
@@ -1,6 +1,19 @@
1
+ import { ParsedCommandLine } from "typescript";
1
2
  import { InlineConfig, UserConfig, UserConfigFn as UserConfigFn$1, UserConfigFnContext } from "tsdown";
2
3
  //#region src/tsdown/index.d.ts
3
- export type UserConfigFn = (inlineConfig: InlineConfig, context: UserConfigFnContext) => UserConfig | Promise<UserConfig>;
4
+ export interface UserTsdownConfig extends UserConfig {
5
+ /**
6
+ * The already parsed TS config.
7
+ *
8
+ */
9
+ parsedTsConfig?: ParsedCommandLine;
10
+ }
11
+ export type UserConfigFn = (
12
+ /**
13
+ * Configurations set by CLI.
14
+ *
15
+ */
16
+ inlineConfig: InlineConfig, context: UserConfigFnContext) => UserTsdownConfig | Promise<UserTsdownConfig>;
4
17
  /**
5
18
  * Get `tsdown` base configuration.
6
19
  *
@@ -25,5 +38,5 @@ export type UserConfigFn = (inlineConfig: InlineConfig, context: UserConfigFnCon
25
38
  * | `target` | resolved tsconfig target |
26
39
  * | `deps` | `{ ... }` |
27
40
  */
28
- export declare const tsdownConfig: (options?: UserConfig | UserConfigFn) => UserConfigFn$1;
41
+ export declare const tsdownConfig: (options?: UserTsdownConfig | UserConfigFn) => UserConfigFn$1;
29
42
  //#endregion
@@ -1,6 +1,19 @@
1
+ import { ParsedCommandLine } from "typescript";
1
2
  import { InlineConfig, UserConfig, UserConfigFn as UserConfigFn$1, UserConfigFnContext } from "tsdown";
2
3
  //#region src/tsdown/index.d.ts
3
- export type UserConfigFn = (inlineConfig: InlineConfig, context: UserConfigFnContext) => UserConfig | Promise<UserConfig>;
4
+ export interface UserTsdownConfig extends UserConfig {
5
+ /**
6
+ * The already parsed TS config.
7
+ *
8
+ */
9
+ parsedTsConfig?: ParsedCommandLine;
10
+ }
11
+ export type UserConfigFn = (
12
+ /**
13
+ * Configurations set by CLI.
14
+ *
15
+ */
16
+ inlineConfig: InlineConfig, context: UserConfigFnContext) => UserTsdownConfig | Promise<UserTsdownConfig>;
4
17
  /**
5
18
  * Get `tsdown` base configuration.
6
19
  *
@@ -25,5 +38,5 @@ export type UserConfigFn = (inlineConfig: InlineConfig, context: UserConfigFnCon
25
38
  * | `target` | resolved tsconfig target |
26
39
  * | `deps` | `{ ... }` |
27
40
  */
28
- export declare const tsdownConfig: (options?: UserConfig | UserConfigFn) => UserConfigFn$1;
41
+ export declare const tsdownConfig: (options?: UserTsdownConfig | UserConfigFn) => UserConfigFn$1;
29
42
  //#endregion
@@ -1 +1 @@
1
- import{getTSConfigCompilerTarget as e}from"../tsconfig/index.mjs";import{defineConfig as t}from"tsdown";const n=(n={})=>t(async(t,r)=>{let{target:i,watch:a=t.watch,tsconfig:o=t.tsconfig,deps:s=t.deps,clean:c=t.clean??!a,...l}=typeof n==`function`?await n(t,r):n,u=i||(typeof o==`string`?e({filepath:o}):i);return{entry:[`src/**/index.ts`],format:[`cjs`,`esm`],dts:!0,shims:!0,clean:c,treeshake:!0,minify:!a,sourcemap:!!a,tsconfig:o,target:u,watch:a,deps:s,...l}});export{n as tsdownConfig};
1
+ import{getTSConfigCompilerTarget as e,parseTsConfig as t}from"../tsconfig/index.mjs";import{defineConfig as n}from"tsdown";const r=(r={})=>n(async(n,i)=>{let{target:a,watch:o,tsconfig:s,deps:c,clean:l,outDir:u,parsedTsConfig:d,...f}=typeof r==`function`?await r(n,i):r,{target:p=a,watch:m=o,tsconfig:h=s,deps:g=c,clean:_=l??!m,outDir:v=u}=n,y=d||h||typeof h==`string`?t({filepath:typeof h==`string`?h:void 0}):void 0,b=v||y?.options.outDir||`dist`,x=p||y&&e({parsedTsConfig:y});return{entry:[`src/**/index.ts`],format:[`cjs`,`esm`],outDir:b,dts:!0,shims:!0,clean:_,treeshake:!0,minify:!m,sourcemap:!!m,tsconfig:h,target:x,watch:m,deps:g,...f}});export{r as tsdownConfig};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alessiofrittoli/package-configs",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Utility library that offers base configurations for your packages.",
5
5
  "type": "module",
6
6
  "author": {