@adamhl8/configs 0.15.23 → 0.15.24

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
- {"version":3,"file":"knip.d.ts","names":[],"sources":["../src/knip.ts"],"sourcesContent":[],"mappings":";;;;cASM;;EAAA,SAAA,OAIyB,EAAA,CAAA,IAAA,CAAA;EAElB,SAAA,MAA0F,EAAA,KAAA;CAAA;AAAhE,cAA1B,UAA0B,EAAd,aAAc,CAAA,UAAA,EAAA,OAAmB,UAAnB,CAAA"}
1
+ {"version":3,"file":"knip.d.ts","names":[],"sources":["../src/knip.ts"],"sourcesContent":[],"mappings":";;;cAca;;;IAAA,KAAA,CAAA,EAAA,MAA2E,GAAA,MAAA,EAAA,GAAA,SAAA;IAAA,OAAA,CAAA,EAAA,MAAA,GAAA,MAAA,EAAA,GAAA,SAAA;;;;;;;;;;IAC6muP,MAAA,CAAA,EAAA,MAAA,GAAA,MAAA,EAAA,GAAA,SAAA;;;MAAoP,SAAA;;IAA0rzB,MAAA,CAAA,EAAA,MAAA,GAAA,MAAA,EAAA,GAAA,SAAA;IAA+G,KAAA,CAAA,EAAA,MAAA,GAAA,MAAA,EAAA,GAAA,SAAA;IAA8D,OAAA,CAAA,EAAA,MAAA,GAAA,MAAA,EAAA,GAAA,SAAA;MAAyD,SAAA;OAA4D,CAAA,EAAA,MAAA,GAAA,OAAA,GAAA,MAAA,EAAA,GAAA;;;IAD93iR,OAAA,CAAA,EAAA,MAAA,GAAA,MAAA,EAAA,GAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gKAC8quP;;0FAAoP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAA0rzB;;+BAA+G;mCAA8D;8BAAyD;iCAA4D"}
package/dist/knip.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"knip.js","names":["knipConfig: MergeConfigFn<KnipConfig, typeof baseConfig>"],"sources":["../src/knip.ts"],"sourcesContent":["import type { KnipConfig } from \"knip\"\n\nimport type { MergeConfigFn } from \"./utils.ts\"\nimport { createMergeConfigFn } from \"./utils.ts\"\n\n// Normally, specifying the `./src/index.ts` entry would cause knip to complain about a redundant entry because it gets automatically included via the tsdown plugin.\n// However, in projects that _don't_ use tsdown, the `./src/index.ts` entry would be missing entirely.\n// To handle this, we specify it and disable the tsdown plugin. This makes knip work in both cases.\n\nconst baseConfig = {\n entry: [\"./src/index.ts\", \"**/*.test.ts\", \"./tsdown.config.ts\"],\n project: [\"**\"],\n tsdown: false,\n} as const satisfies KnipConfig\n\nexport const knipConfig: MergeConfigFn<KnipConfig, typeof baseConfig> = createMergeConfigFn(baseConfig)\n"],"mappings":";AAeA,MAAaA,aAA2D,oBANrD;CACjB,OAAO;EAAC;EAAkB;EAAgB;EAAqB;CAC/D,SAAS,CAAC,KAAK;CACf,QAAQ;CACT,CAEsG"}
1
+ {"version":3,"file":"knip.js","names":[],"sources":["../src/knip.ts"],"sourcesContent":["import type { KnipConfig } from \"knip\"\n\nimport { createMergeConfigFn } from \"./utils.ts\"\n\n// Normally, specifying the `./src/index.ts` entry would cause knip to complain about a redundant entry because it gets automatically included via the tsdown plugin.\n// However, in projects that _don't_ use tsdown, the `./src/index.ts` entry would be missing entirely.\n// To handle this, we specify it and disable the tsdown plugin. This makes knip work in both cases.\n\nconst baseConfig = {\n entry: [\"./src/index.ts\", \"**/*.test.ts\", \"./tsdown.config.ts\"],\n project: [\"**\"],\n tsdown: false,\n} as const satisfies KnipConfig\n\nexport const knipConfig = createMergeConfigFn<KnipConfig, typeof baseConfig>(baseConfig)\n"],"mappings":";AAcA,MAAa,aAAa,oBANP;CACjB,OAAO;EAAC;EAAkB;EAAgB;EAAqB;CAC/D,SAAS,CAAC,KAAK;CACf,QAAQ;CACT,CAEuF"}
@@ -1,8 +1,46 @@
1
- import { MergeConfigFn } from "./utils.js";
2
- import { Config } from "prettier";
1
+ import { OptionalMergeConfigFn } from "./utils.js";
2
+ import * as prettier0 from "prettier";
3
3
 
4
4
  //#region src/prettier.d.ts
5
- declare const baseConfig: {
5
+ declare const prettierConfig: OptionalMergeConfigFn<{
6
+ [x: string]: unknown;
7
+ overrides?: Array<{
8
+ files: string | string[];
9
+ excludeFiles?: string | string[];
10
+ options?: prettier0.Options;
11
+ }>;
12
+ semi?: boolean;
13
+ singleQuote?: boolean;
14
+ jsxSingleQuote?: boolean;
15
+ trailingComma?: "none" | "es5" | "all";
16
+ bracketSpacing?: boolean;
17
+ objectWrap?: "preserve" | "collapse";
18
+ bracketSameLine?: boolean;
19
+ rangeStart?: number;
20
+ rangeEnd?: number;
21
+ parser?: prettier0.LiteralUnion<prettier0.BuiltInParserName>;
22
+ filepath?: string;
23
+ requirePragma?: boolean;
24
+ insertPragma?: boolean;
25
+ checkIgnorePragma?: boolean;
26
+ proseWrap?: "always" | "never" | "preserve";
27
+ arrowParens?: "avoid" | "always";
28
+ plugins?: Array<string | URL | prettier0.Plugin>;
29
+ htmlWhitespaceSensitivity?: "css" | "strict" | "ignore";
30
+ endOfLine?: "auto" | "lf" | "crlf" | "cr";
31
+ quoteProps?: "as-needed" | "consistent" | "preserve";
32
+ vueIndentScriptAndStyle?: boolean;
33
+ embeddedLanguageFormatting?: "auto" | "off";
34
+ singleAttributePerLine?: boolean;
35
+ experimentalOperatorPosition?: "start" | "end";
36
+ experimentalTernaries?: boolean;
37
+ jsxBracketSameLine?: boolean;
38
+ printWidth?: number;
39
+ tabWidth?: number;
40
+ useTabs?: boolean;
41
+ parentParser?: string | undefined | undefined;
42
+ __embeddedInHtml?: boolean | undefined | undefined;
43
+ }, {
6
44
  readonly printWidth: 120;
7
45
  readonly semi: false;
8
46
  readonly plugins: ["@prettier/plugin-xml", "prettier-plugin-sh", "prettier-plugin-toml", "prettier-plugin-astro", "prettier-plugin-tailwindcss"];
@@ -18,8 +56,7 @@ declare const baseConfig: {
18
56
  readonly parser: "astro";
19
57
  };
20
58
  }];
21
- };
22
- declare const prettierConfig: MergeConfigFn<Config, typeof baseConfig>;
59
+ }>;
23
60
  //#endregion
24
61
  export { prettierConfig };
25
62
  //# sourceMappingURL=prettier.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prettier.d.ts","names":[],"sources":["../src/prettier.ts"],"sourcesContent":[],"mappings":";;;;cAKM;;EAAA,SAAA,IA0BqB,EAAA,KAAA;EAEd,SAAA,OAAA,EAA0F,CAAA,sBAAA,EAAA,oBAAA,EAAA,sBAAA,EAAA,uBAAA,EAAA,6BAAA,CAAA;EAAA,SAAA,kBAAA,EAAA,kBAAA;WAA5D,SAAA,EAAA,CAAA;IAAe,SAAA,KAAA,EAAA,SAAA;IAA7B,SAAA,OAAA,EAAA;MAAa,SAAA,aAAA,EAAA,MAAA;;;;;;;;;cAA7B,gBAAgB,cAAc,eAAe"}
1
+ {"version":3,"file":"prettier.d.ts","names":[],"sources":["../src/prettier.ts"],"sourcesContent":[],"mappings":";;;;cAoCa;;;;IAAA,YAAA,CAAmF,EAAA,MAAA,GAAA,MAAA,EAAA;IAAA,OAAA,CAAA,EAAA,SAAA,CACwpP,OADxpP;;;;;;;;;EAArE,UAAA,CAAA,EAAA,MAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"prettier.js","names":["prettierConfig: MergeConfigFn<Config, typeof baseConfig>"],"sources":["../src/prettier.ts"],"sourcesContent":["import type { Config } from \"prettier\"\n\nimport type { MergeConfigFn } from \"./utils.ts\"\nimport { createMergeConfigFn } from \"./utils.ts\"\n\nconst baseConfig = {\n printWidth: 120,\n semi: false,\n plugins: [\n \"@prettier/plugin-xml\",\n \"prettier-plugin-sh\",\n \"prettier-plugin-toml\",\n \"prettier-plugin-astro\",\n \"prettier-plugin-tailwindcss\",\n ],\n tailwindStylesheet: \"./src/global.css\",\n overrides: [\n {\n // https://github.com/prettier/prettier/issues/15956\n files: \"*.jsonc\",\n options: {\n trailingComma: \"none\",\n },\n },\n {\n files: \"*.astro\",\n options: {\n parser: \"astro\",\n },\n },\n ],\n} as const satisfies Config\n\nexport const prettierConfig: MergeConfigFn<Config, typeof baseConfig> = createMergeConfigFn(baseConfig)\n"],"mappings":";AAiCA,MAAaA,iBAA2D,oBA5BrD;CACjB,YAAY;CACZ,MAAM;CACN,SAAS;EACP;EACA;EACA;EACA;EACA;EACD;CACD,oBAAoB;CACpB,WAAW,CACT;EAEE,OAAO;EACP,SAAS,EACP,eAAe,QAChB;EACF,EACD;EACE,OAAO;EACP,SAAS,EACP,QAAQ,SACT;EACF,CACF;CACF,CAEsG"}
1
+ {"version":3,"file":"prettier.js","names":[],"sources":["../src/prettier.ts"],"sourcesContent":["import type { Config } from \"prettier\"\nimport type { Simplify } from \"type-fest\"\n\nimport { createMergeConfigFn } from \"./utils.ts\"\n\n// for some reason the Config type from prettier doesn't satisfy AnyObj unless we simplify it\ntype PrettierConfig = Simplify<Config>\n\nconst baseConfig = {\n printWidth: 120,\n semi: false,\n plugins: [\n \"@prettier/plugin-xml\",\n \"prettier-plugin-sh\",\n \"prettier-plugin-toml\",\n \"prettier-plugin-astro\",\n \"prettier-plugin-tailwindcss\",\n ],\n tailwindStylesheet: \"./src/global.css\",\n overrides: [\n {\n // https://github.com/prettier/prettier/issues/15956\n files: \"*.jsonc\",\n options: {\n trailingComma: \"none\",\n },\n },\n {\n files: \"*.astro\",\n options: {\n parser: \"astro\",\n },\n },\n ],\n} as const satisfies PrettierConfig\n\nexport const prettierConfig = createMergeConfigFn<PrettierConfig, typeof baseConfig>(baseConfig)\n"],"mappings":";AAoCA,MAAa,iBAAiB,oBA5BX;CACjB,YAAY;CACZ,MAAM;CACN,SAAS;EACP;EACA;EACA;EACA;EACA;EACD;CACD,oBAAoB;CACpB,WAAW,CACT;EAEE,OAAO;EACP,SAAS,EACP,eAAe,QAChB;EACF,EACD;EACE,OAAO;EACP,SAAS,EACP,QAAQ,SACT;EACF,CACF;CACF,CAE+F"}
package/dist/tsdown.d.ts CHANGED
@@ -1,10 +1,70 @@
1
- import { MergeConfigFn } from "./utils.js";
2
- import { SetRequired } from "type-fest";
3
- import { NormalizedUserConfig } from "tsdown";
1
+ import { MergeConfigFn, OptionalMergeConfigFn } from "./utils.js";
2
+ import * as rolldown0 from "rolldown";
3
+ import * as tsdown0 from "tsdown";
4
+ import * as rolldown_plugin_dts0 from "rolldown-plugin-dts";
5
+ import * as publint0 from "publint";
6
+ import * as hookable0 from "hookable";
4
7
 
5
8
  //#region src/tsdown.d.ts
6
- type StrictUserConfig = SetRequired<NormalizedUserConfig, "platform">;
7
- declare const baseConfig: {
9
+ declare const tsdownConfig: MergeConfigFn<{
10
+ entry?: rolldown0.InputOption;
11
+ external?: rolldown0.ExternalOption;
12
+ noExternal?: (string | RegExp | (string | RegExp)[]) | ((id: string, importer: string | undefined) => boolean | null | undefined | void);
13
+ skipNodeModulesBundle?: boolean;
14
+ alias?: Record<string, string>;
15
+ tsconfig?: string | boolean;
16
+ target?: string | string[] | false;
17
+ env?: Record<string, any>;
18
+ define?: Record<string, string>;
19
+ shims?: boolean;
20
+ treeshake?: boolean;
21
+ loader?: tsdown0.ModuleTypes;
22
+ removeNodeProtocol?: boolean;
23
+ nodeProtocol?: "strip" | boolean;
24
+ plugins?: rolldown0.RolldownPluginOption<any>;
25
+ inputOptions?: rolldown0.InputOptions | ((options: rolldown0.InputOptions, format: tsdown0.NormalizedFormat, context: {
26
+ cjsDts: boolean;
27
+ }) => void | rolldown0.InputOptions | Promise<void | rolldown0.InputOptions | null> | null);
28
+ format?: tsdown0.Format | tsdown0.Format[];
29
+ globalName?: string;
30
+ outDir?: string;
31
+ sourcemap?: tsdown0.Sourcemap;
32
+ clean?: boolean | string[];
33
+ minify?: boolean | "dce-only" | rolldown0.MinifyOptions;
34
+ footer?: tsdown0.ChunkAddon;
35
+ banner?: tsdown0.ChunkAddon;
36
+ unbundle?: boolean;
37
+ bundle?: boolean;
38
+ fixedExtension?: boolean;
39
+ outExtensions?: tsdown0.OutExtensionFactory;
40
+ hash?: boolean;
41
+ cjsDefault?: boolean;
42
+ outputOptions?: rolldown0.OutputOptions | ((options: rolldown0.OutputOptions, format: tsdown0.NormalizedFormat, context: {
43
+ cjsDts: boolean;
44
+ }) => void | rolldown0.OutputOptions | Promise<void | rolldown0.OutputOptions | null> | null);
45
+ cwd?: string;
46
+ name?: string;
47
+ silent?: boolean;
48
+ logLevel?: "silent" | ("error" | "warn" | "info");
49
+ failOnWarn?: boolean;
50
+ customLogger?: tsdown0.Logger;
51
+ fromVite?: boolean | "vitest";
52
+ watch?: boolean | (string | string[]);
53
+ ignoreWatch?: string | RegExp | (string | RegExp)[];
54
+ onSuccess?: string | ((config: tsdown0.ResolvedOptions, signal: AbortSignal) => void | Promise<void>);
55
+ dts?: boolean | rolldown_plugin_dts0.Options;
56
+ unused?: boolean | UnusedOptions;
57
+ publint?: boolean | publint0.Options;
58
+ attw?: boolean | tsdown0.AttwOptions;
59
+ report?: boolean | tsdown0.ReportOptions;
60
+ globImport?: boolean;
61
+ exports?: boolean | tsdown0.ExportsOptions;
62
+ publicDir?: tsdown0.CopyOptions | tsdown0.CopyOptionsFn;
63
+ copy?: tsdown0.CopyOptions | tsdown0.CopyOptionsFn;
64
+ hooks?: Partial<tsdown0.TsdownHooks> | ((hooks: hookable0.Hookable<tsdown0.TsdownHooks>) => void | Promise<void>);
65
+ workspace?: tsdown0.Workspace | (string | string[]) | true;
66
+ platform: "node" | "neutral" | "browser";
67
+ }, {
8
68
  readonly entry: ["./src/index.ts"];
9
69
  readonly unbundle: true;
10
70
  readonly target: false;
@@ -22,8 +82,8 @@ declare const baseConfig: {
22
82
  };
23
83
  readonly publint: true;
24
84
  readonly failOnWarn: true;
25
- };
26
- declare const binConfig: {
85
+ }>;
86
+ declare const tsdownBinConfig: OptionalMergeConfigFn<Omit<tsdown0.Options, "config" | "filter" | "configLoader">, {
27
87
  readonly entry: [];
28
88
  readonly platform: "node";
29
89
  readonly outExtensions: () => {
@@ -39,9 +99,7 @@ declare const binConfig: {
39
99
  readonly minify: "dce-only";
40
100
  readonly hash: false;
41
101
  readonly failOnWarn: true;
42
- };
43
- declare const tsdownConfig: MergeConfigFn<StrictUserConfig, typeof baseConfig>;
44
- declare const tsdownBinConfig: MergeConfigFn<NormalizedUserConfig, typeof binConfig>;
102
+ }>;
45
103
  //#endregion
46
104
  export { tsdownBinConfig, tsdownConfig };
47
105
  //# sourceMappingURL=tsdown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tsdown.d.ts","names":[],"sources":["../src/tsdown.ts"],"sourcesContent":[],"mappings":";;;;;KAOK,gBAAA,GAAmB,YAAY;cAE9B;EAFD,SAAA,KAAA,EAAA,CAAA,gBAAgB,CAAA;EAAA,SAAA,QAAA,EAAA,IAAA;WAAe,MAAA,EAAA,KAAA;WAAZ,QAAA,EAAA,SAAA;EAAW,SAAA,MAAA,EAAA,UAAA;EAE7B,SAAA,SAkB+B,EAAA,IAAA;EAE/B,SAAA,IAWmC,EAAA,KAAA;EAE5B,SAAA,GAAA,EAAA;IAAkG,SAAA,UAAA,EAAA,IAAA;IAAtE,SAAA,SAAA,EAAA,IAAA;;WAAd,IAAA,EAAA;IAAa,SAAA,KAAA,EAAA,OAAA;IAC3B,SAAA,OAAuG,EAAA,SAAA;EAAA,CAAA;WAAxE,OAAA,EAAA,IAAA;WAA6B,UAAA,EAAA,IAAA;;cAdnE,SAcqC,EAAA;;;;;;;;;;;;;;;;;cAD9B,cAAc,cAAc,yBAAyB;cACrD,iBAAiB,cAAc,6BAA6B"}
1
+ {"version":3,"file":"tsdown.d.ts","names":[],"sources":["../src/tsdown.ts"],"sourcesContent":[],"mappings":";;;;;;;;cAyCa;UAAyF,SAAA,CAAA;;;;;;;EAAzF,GAAA,CAAA,QAAA,CAAA,MAAyF,EAAA,GAAA,CAAA;EAAA,MAAA,CAAA,QAAA,CAAA,MAAA,EAAA,MAAA,CAAA;OAAA,CAAA,EAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA7E,SAAA,MAAA,EAAA,KAAA;EACZ,SAAA,QAAA,EAAwF,SAAA;EAAA,SAAA,MAAA,EAAA,UAAA;WAAA,SAAzE,EAAA,IAAA;WAAA,IAAA,EAAA,KAAA;WAAA,GAAA,EAAA;IAAA,SAAA,UAAA,EAAA,IAAA;;;;;;;;;;cAAf,iBAAe,sBAAA,KAAyE,OAAA,CAAzE,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"tsdown.js","names":["tsdownConfig: MergeConfigFn<StrictUserConfig, typeof baseConfig>","tsdownBinConfig: MergeConfigFn<NormalizedUserConfig, typeof binConfig>"],"sources":["../src/tsdown.ts"],"sourcesContent":["import type { NormalizedUserConfig } from \"tsdown\"\nimport type { SetRequired } from \"type-fest\"\n\nimport type { MergeConfigFn } from \"./utils.ts\"\nimport { createMergeConfigFn } from \"./utils.ts\"\n\n// force projects to specify platform\ntype StrictUserConfig = SetRequired<NormalizedUserConfig, \"platform\">\n\nconst baseConfig = {\n entry: [\"./src/index.ts\"],\n unbundle: true,\n target: false,\n platform: \"neutral\",\n minify: \"dce-only\",\n sourcemap: true,\n hash: false,\n dts: {\n newContext: true,\n sourcemap: true,\n },\n attw: {\n level: \"error\",\n profile: \"esmOnly\",\n },\n publint: true,\n failOnWarn: true,\n} as const satisfies StrictUserConfig\n\nconst binConfig = {\n ...baseConfig,\n entry: [],\n platform: \"node\",\n outExtensions: () => ({ js: \"\" }),\n copy: [],\n unbundle: false,\n sourcemap: false,\n dts: false,\n attw: false,\n publint: false,\n} as const satisfies NormalizedUserConfig\n\nexport const tsdownConfig: MergeConfigFn<StrictUserConfig, typeof baseConfig> = createMergeConfigFn(baseConfig)\nexport const tsdownBinConfig: MergeConfigFn<NormalizedUserConfig, typeof binConfig> = createMergeConfigFn(binConfig)\n"],"mappings":";AASA,MAAM,aAAa;CACjB,OAAO,CAAC,iBAAiB;CACzB,UAAU;CACV,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,WAAW;CACX,MAAM;CACN,KAAK;EACH,YAAY;EACZ,WAAW;EACZ;CACD,MAAM;EACJ,OAAO;EACP,SAAS;EACV;CACD,SAAS;CACT,YAAY;CACb;AAED,MAAM,YAAY;CAChB,GAAG;CACH,OAAO,EAAE;CACT,UAAU;CACV,sBAAsB,EAAE,IAAI,IAAI;CAChC,MAAM,EAAE;CACR,UAAU;CACV,WAAW;CACX,KAAK;CACL,MAAM;CACN,SAAS;CACV;AAED,MAAaA,eAAmE,oBAAoB,WAAW;AAC/G,MAAaC,kBAAyE,oBAAoB,UAAU"}
1
+ {"version":3,"file":"tsdown.js","names":[],"sources":["../src/tsdown.ts"],"sourcesContent":["import type { NormalizedUserConfig } from \"tsdown\"\nimport type { SetRequired } from \"type-fest\"\n\nimport { createMergeConfigFn } from \"./utils.ts\"\n\n// force projects to specify platform\ntype StrictUserConfig = SetRequired<NormalizedUserConfig, \"platform\">\n\nconst baseConfig = {\n entry: [\"./src/index.ts\"],\n unbundle: true,\n target: false,\n platform: \"neutral\",\n minify: \"dce-only\",\n sourcemap: true,\n hash: false,\n dts: {\n newContext: true,\n sourcemap: true,\n },\n attw: {\n level: \"error\",\n profile: \"esmOnly\",\n },\n publint: true,\n failOnWarn: true,\n} as const satisfies StrictUserConfig\n\nconst binConfig = {\n ...baseConfig,\n entry: [],\n platform: \"node\",\n outExtensions: () => ({ js: \"\" }),\n copy: [],\n unbundle: false,\n sourcemap: false,\n dts: false,\n attw: false,\n publint: false,\n} as const satisfies NormalizedUserConfig\n\nexport const tsdownConfig = createMergeConfigFn<StrictUserConfig, typeof baseConfig, true>(baseConfig)\nexport const tsdownBinConfig = createMergeConfigFn<NormalizedUserConfig, typeof binConfig>(binConfig)\n"],"mappings":";AAQA,MAAM,aAAa;CACjB,OAAO,CAAC,iBAAiB;CACzB,UAAU;CACV,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,WAAW;CACX,MAAM;CACN,KAAK;EACH,YAAY;EACZ,WAAW;EACZ;CACD,MAAM;EACJ,OAAO;EACP,SAAS;EACV;CACD,SAAS;CACT,YAAY;CACb;AAED,MAAM,YAAY;CAChB,GAAG;CACH,OAAO,EAAE;CACT,UAAU;CACV,sBAAsB,EAAE,IAAI,IAAI;CAChC,MAAM,EAAE;CACR,UAAU;CACV,WAAW;CACX,KAAK;CACL,MAAM;CACN,SAAS;CACV;AAED,MAAa,eAAe,oBAA+D,WAAW;AACtG,MAAa,kBAAkB,oBAA4D,UAAU"}
package/dist/utils.d.ts CHANGED
@@ -1,13 +1,27 @@
1
1
  import { MergeDeep } from "type-fest";
2
2
 
3
3
  //#region src/utils.d.ts
4
- type MergeDeepConcat<D, S> = MergeDeep<D, S, {
5
- arrayMergeMode: "spread";
6
- }>;
7
- interface MergeConfigFn<UserConfigType, BaseConfig extends UserConfigType> {
4
+
5
+ /**
6
+ * Type representing a merge config function, where the `UserConfig` passed in is merged with `BaseConfig`.
7
+ */
8
+ interface MergeConfigFn<UserConfig, BaseConfig> {
9
+ <UserConfigToMerge extends UserConfig>(userConfig: UserConfigToMerge): MergeDeep<BaseConfig, UserConfigToMerge, {
10
+ arrayMergeMode: "spread";
11
+ }>;
12
+ }
13
+ /**
14
+ * Type representing an overloaded function signature for MergeConfigFn:
15
+ * - if `UserConfig` is not provided, the return type is `BaseConfig`
16
+ * - if `UserConfig` is provided, the return type is the merged type of `BaseConfig` and `UserConfig`.
17
+ *
18
+ * This is needed to handle the fact that the `userConfig` argument is optional.
19
+ *
20
+ * Note that this extends `MergeConfigFn`, so this type has both function signatures on it.
21
+ */
22
+ interface OptionalMergeConfigFn<UserConfig, BaseConfig> extends MergeConfigFn<UserConfig, BaseConfig> {
8
23
  (): BaseConfig;
9
- <UserConfig extends UserConfigType>(userConfig: UserConfig): MergeDeepConcat<BaseConfig, UserConfig>;
10
24
  }
11
25
  //#endregion
12
- export { MergeConfigFn };
26
+ export { MergeConfigFn, OptionalMergeConfigFn };
13
27
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","names":[],"sources":["../src/utils.ts"],"sourcesContent":[],"mappings":";;;KAeK,wBAAwB,UAAU,GAAG;;AAbA,CAAA,CAAA;AAatB,UAEH,aAFG,CAAA,cAAA,EAAA,mBAE8C,cAF9C,CAAA,CAAA;MAId,UAJiC;sBAMjB,cANoB,CAAA,CAAA,UAAA,EAMQ,UANR,CAAA,EAMqB,eANrB,CAMqC,UANrC,EAMiD,UANjD,CAAA"}
1
+ {"version":3,"file":"utils.d.ts","names":[],"sources":["../src/utils.ts"],"sourcesContent":[],"mappings":";;;;;AAkBA;;AAE6B,UAFZ,aAEY,CAAA,UAAA,EAAA,UAAA,CAAA,CAAA;6BAAA,UACb,CAAA,CAAA,UAAA,EAAA,iBAAA,CAAA,EACX,SADW,CACD,UADC,EACW,iBADX,EAAA;IACD,cAAA,EAAA,QAAA;;;;AAaf;;;;;;;;UAAiB,sDAAsD,cAAc,YAAY;MAC3F"}
package/dist/utils.js CHANGED
@@ -1,15 +1,14 @@
1
1
  import { mergeWith } from "es-toolkit";
2
- import { clone, isPlainObject } from "remeda";
2
+ import { clone } from "remeda";
3
3
  function merge(target, source) {
4
4
  return mergeWith(target, source, (objValue, srcValue) => Array.isArray(objValue) ? objValue.concat(srcValue) : void 0);
5
5
  }
6
6
  function createMergeConfigFn(baseConfig) {
7
- function mergeConfig(userConfig) {
7
+ const mergeConfigFn = (userConfig) => {
8
8
  if (userConfig === void 0) return baseConfig;
9
- if (!(isPlainObject(baseConfig) && isPlainObject(userConfig))) throw new Error(`target and/or source is not an object: target='${baseConfig}'\nsource='${userConfig}'`);
10
9
  return merge(clone(baseConfig), clone(userConfig));
11
- }
12
- return mergeConfig;
10
+ };
11
+ return mergeConfigFn;
13
12
  }
14
13
  export { createMergeConfigFn };
15
14
 
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":[],"sources":["../src/utils.ts"],"sourcesContent":["import { mergeWith } from \"es-toolkit\"\nimport { clone, isPlainObject } from \"remeda\"\nimport type { MergeDeep } from \"type-fest\"\n\ntype AnyObj = Record<PropertyKey, unknown>\n\n/**\n * A wrapper around es-toolkit's `mergeWith` with a custom merge function that concatenates arrays.\n */\nfunction merge<T extends AnyObj, S extends AnyObj>(target: T, source: S): T & S {\n return mergeWith(target, source, (objValue: unknown, srcValue: unknown) =>\n Array.isArray(objValue) ? objValue.concat(srcValue) : undefined,\n )\n}\n\ntype MergeDeepConcat<D, S> = MergeDeep<D, S, { arrayMergeMode: \"spread\" }>\n\nexport interface MergeConfigFn<UserConfigType, BaseConfig extends UserConfigType> {\n // if `userConfig` is not provided, return the type of `baseConfig`\n (): BaseConfig\n // if `userConfig` is provided, instead of returning `BaseConfig & UserConfig` (from `merge`), return a more friendly type using `MergeDeep`\n <UserConfig extends UserConfigType>(userConfig: UserConfig): MergeDeepConcat<BaseConfig, UserConfig>\n}\n\n/**\n * Creates a config merge function with proper type overloads for merging with a base config.\n */\nexport function createMergeConfigFn<UserConfigType, BaseConfig extends UserConfigType>(\n baseConfig: BaseConfig,\n): MergeConfigFn<UserConfigType, BaseConfig> {\n function mergeConfig(): BaseConfig\n\n function mergeConfig<UserConfig extends UserConfigType>(\n userConfig: UserConfig,\n ): MergeDeepConcat<BaseConfig, UserConfig>\n\n function mergeConfig<UserConfig extends UserConfigType>(userConfig?: UserConfig) {\n if (userConfig === undefined) return baseConfig\n\n if (!(isPlainObject(baseConfig) && isPlainObject(userConfig)))\n throw new Error(`target and/or source is not an object: target='${baseConfig}'\\nsource='${userConfig}'`)\n\n // clone both target and source so we never mutate the original objects\n return merge(clone(baseConfig), clone(userConfig))\n }\n\n return mergeConfig\n}\n"],"mappings":";;AASA,SAAS,MAA0C,QAAW,QAAkB;AAC9E,QAAO,UAAU,QAAQ,SAAS,UAAmB,aACnD,MAAM,QAAQ,SAAS,GAAG,SAAS,OAAO,SAAS,GAAG,KAAA,EACvD;;AAeH,SAAgB,oBACd,YAC2C;CAO3C,SAAS,YAA+C,YAAyB;AAC/E,MAAI,eAAe,KAAA,EAAW,QAAO;AAErC,MAAI,EAAE,cAAc,WAAW,IAAI,cAAc,WAAW,EAC1D,OAAM,IAAI,MAAM,kDAAkD,WAAW,aAAa,WAAW,GAAG;AAG1G,SAAO,MAAM,MAAM,WAAW,EAAE,MAAM,WAAW,CAAC;;AAGpD,QAAO"}
1
+ {"version":3,"file":"utils.js","names":[],"sources":["../src/utils.ts"],"sourcesContent":["import { mergeWith } from \"es-toolkit\"\nimport { clone } from \"remeda\"\nimport type { MergeDeep } from \"type-fest\"\n\ntype AnyObj = Record<PropertyKey, unknown>\n\n/**\n * A wrapper around es-toolkit's `mergeWith` with a custom merge function that concatenates arrays.\n */\nfunction merge<T extends AnyObj, S extends AnyObj>(target: T, source: S): T & S {\n return mergeWith(target, source, (objValue: unknown, srcValue: unknown) =>\n Array.isArray(objValue) ? objValue.concat(srcValue) : undefined,\n )\n}\n\n/**\n * Type representing a merge config function, where the `UserConfig` passed in is merged with `BaseConfig`.\n */\nexport interface MergeConfigFn<UserConfig, BaseConfig> {\n // biome-ignore lint/style/useShorthandFunctionType: need to use call signature type\n <UserConfigToMerge extends UserConfig>(\n userConfig: UserConfigToMerge,\n ): MergeDeep<BaseConfig, UserConfigToMerge, { arrayMergeMode: \"spread\" }>\n // instead of returning `BaseConfig & UserConfig` (from `merge`), return a more friendly type using `MergeDeep`\n}\n\n/**\n * Type representing an overloaded function signature for MergeConfigFn:\n * - if `UserConfig` is not provided, the return type is `BaseConfig`\n * - if `UserConfig` is provided, the return type is the merged type of `BaseConfig` and `UserConfig`.\n *\n * This is needed to handle the fact that the `userConfig` argument is optional.\n *\n * Note that this extends `MergeConfigFn`, so this type has both function signatures on it.\n */\nexport interface OptionalMergeConfigFn<UserConfig, BaseConfig> extends MergeConfigFn<UserConfig, BaseConfig> {\n (): BaseConfig\n}\n\n/**\n * Creates a config merge function with proper type overloads for merging with a base config.\n */\nexport function createMergeConfigFn<\n UserConfig extends AnyObj,\n BaseConfig extends UserConfig,\n Required extends boolean = false, // if true, the created merge config function requires a userConfig to be passed in\n>(baseConfig: BaseConfig) {\n // we don't care about the specific type of userConfig here because we assert mergeConfigFn as the correct type below\n const mergeConfigFn = (userConfig?: AnyObj) => {\n if (userConfig === undefined) return baseConfig\n // clone both target and source so we never mutate the original objects\n return merge(clone(baseConfig), clone(userConfig))\n }\n\n return mergeConfigFn as Required extends true // if Required is true\n ? MergeConfigFn<UserConfig, BaseConfig> // then the merge config function requires a userConfig to be passed in\n : OptionalMergeConfigFn<UserConfig, BaseConfig> // else, userConfig is optional\n}\n"],"mappings":";;AASA,SAAS,MAA0C,QAAW,QAAkB;AAC9E,QAAO,UAAU,QAAQ,SAAS,UAAmB,aACnD,MAAM,QAAQ,SAAS,GAAG,SAAS,OAAO,SAAS,GAAG,KAAA,EACvD;;AA8BH,SAAgB,oBAId,YAAwB;CAExB,MAAM,iBAAiB,eAAwB;AAC7C,MAAI,eAAe,KAAA,EAAW,QAAO;AAErC,SAAO,MAAM,MAAM,WAAW,EAAE,MAAM,WAAW,CAAC;;AAGpD,QAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamhl8/configs",
3
- "version": "0.15.23",
3
+ "version": "0.15.24",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",