@adamhl8/configs 0.17.7 → 0.17.9

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,5 +1,5 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.2.6/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.3.4/schema.json",
3
3
  "root": false,
4
4
  "vcs": {
5
5
  "enabled": true,
@@ -159,6 +159,7 @@
159
159
  "noPrecisionLoss": "error",
160
160
  "noPrivateImports": "error",
161
161
  "noProcessGlobal": "error",
162
+ "noQwikUseVisibleTask": "off",
162
163
  "noReactPropAssignments": "error",
163
164
  "noRenderReturnValue": "error",
164
165
  "noRestrictedElements": "error",
@@ -191,11 +192,13 @@
191
192
  "useExhaustiveDependencies": "error",
192
193
  "useGraphqlNamedOperations": "error",
193
194
  "useHookAtTopLevel": "error",
195
+ "useImageSize": "error",
194
196
  "useImportExtensions": "error",
195
197
  "useIsNan": "error",
196
198
  "useJsonImportAttributes": "error",
197
199
  "useJsxKeyInIterable": "error",
198
200
  "useParseIntRadix": "error",
201
+ "useQwikClasslist": "off",
199
202
  "useSingleJsDocAsterisk": "error",
200
203
  "useUniqueElementIds": "error",
201
204
  "useValidForDirection": "error",
@@ -203,18 +206,20 @@
203
206
  "useYield": "error"
204
207
  },
205
208
  "nursery": {
209
+ "noContinue": "off",
206
210
  "noDeprecatedImports": "error",
207
211
  "noDuplicateDependencies": "error",
212
+ "noEmptySource": "error",
208
213
  "noFloatingPromises": "error",
209
214
  "noImportCycles": "error",
215
+ "noIncrementDecrement": "error",
210
216
  "noJsxLiterals": "error",
211
217
  "noMisusedPromises": "error",
212
218
  "noNextAsyncClientComponent": "error",
213
- "noNonNullAssertedOptionalChain": "error",
214
- "noQwikUseVisibleTask": "error",
219
+ "noParametersOnlyUsedInRecursion": "error",
215
220
  "noReactForwardRef": "error",
216
- "noSecrets": "off",
217
221
  "noShadow": "error",
222
+ "noUnknownAttribute": "error",
218
223
  "noUnnecessaryConditions": "error",
219
224
  "noUnresolvedImports": "off",
220
225
  "noUnusedExpressions": "error",
@@ -224,19 +229,15 @@
224
229
  "noVueDuplicateKeys": "error",
225
230
  "noVueReservedKeys": "error",
226
231
  "noVueReservedProps": "error",
227
- "useAnchorHref": "error",
228
232
  "useConsistentArrowReturn": "error",
229
- "useConsistentTypeDefinitions": "error",
230
233
  "useDeprecatedDate": "error",
231
234
  "useExhaustiveSwitchCases": "error",
232
235
  "useExplicitType": "off",
233
- "useImageSize": "error",
234
236
  "useMaxParams": "error",
235
- "useQwikClasslist": "error",
236
237
  "useQwikMethodUsage": "off",
237
238
  "useQwikValidLexicalScope": "off",
238
- "useReactFunctionComponents": "error",
239
239
  "useSortedClasses": "error",
240
+ "useVueDefineMacrosOrder": "error",
240
241
  "useVueMultiWordComponentNames": "error"
241
242
  },
242
243
  "performance": {
@@ -257,7 +258,8 @@
257
258
  "noBlankTarget": "error",
258
259
  "noDangerouslySetInnerHtml": "error",
259
260
  "noDangerouslySetInnerHtmlWithChildren": "error",
260
- "noGlobalEval": "error"
261
+ "noGlobalEval": "error",
262
+ "noSecrets": "off"
261
263
  },
262
264
  "style": {
263
265
  "noCommonJs": "error",
@@ -303,6 +305,7 @@
303
305
  }
304
306
  },
305
307
  "useConsistentObjectDefinitions": "error",
308
+ "useConsistentTypeDefinitions": "error",
306
309
  "useConst": "error",
307
310
  "useDefaultParameterLast": "error",
308
311
  "useDefaultSwitchClause": "error",
@@ -330,6 +333,7 @@
330
333
  "useNumberNamespace": "error",
331
334
  "useNumericSeparators": "error",
332
335
  "useObjectSpread": "error",
336
+ "useReactFunctionComponents": "error",
333
337
  "useReadonlyClassProperties": "error",
334
338
  "useSelfClosingElements": "error",
335
339
  "useShorthandAssign": "error",
@@ -400,6 +404,7 @@
400
404
  "noMisleadingInstantiator": "error",
401
405
  "noMisplacedAssertion": "error",
402
406
  "noMisrefactoredShorthandAssign": "error",
407
+ "noNonNullAssertedOptionalChain": "error",
403
408
  "noOctalEscape": "error",
404
409
  "noPrototypeBuiltins": "error",
405
410
  "noQuickfixBiome": "error",
@@ -12,6 +12,11 @@ declare const knipConfig: OptionalMergeConfigFn<{
12
12
  entry?: string | string[] | undefined;
13
13
  project?: string | string[] | undefined;
14
14
  } | undefined;
15
+ 'astro-db'?: string | boolean | string[] | {
16
+ config?: string | string[] | undefined;
17
+ entry?: string | string[] | undefined;
18
+ project?: string | string[] | undefined;
19
+ } | undefined;
15
20
  ava?: string | boolean | string[] | {
16
21
  config?: string | string[] | undefined;
17
22
  entry?: string | string[] | undefined;
@@ -97,6 +102,11 @@ declare const knipConfig: OptionalMergeConfigFn<{
97
102
  entry?: string | string[] | undefined;
98
103
  project?: string | string[] | undefined;
99
104
  } | undefined;
105
+ danger?: string | boolean | string[] | {
106
+ config?: string | string[] | undefined;
107
+ entry?: string | string[] | undefined;
108
+ project?: string | string[] | undefined;
109
+ } | undefined;
100
110
  'dependency-cruiser'?: string | boolean | string[] | {
101
111
  config?: string | string[] | undefined;
102
112
  entry?: string | string[] | undefined;
@@ -217,6 +227,11 @@ declare const knipConfig: OptionalMergeConfigFn<{
217
227
  entry?: string | string[] | undefined;
218
228
  project?: string | string[] | undefined;
219
229
  } | undefined;
230
+ mdxlint?: string | boolean | string[] | {
231
+ config?: string | string[] | undefined;
232
+ entry?: string | string[] | undefined;
233
+ project?: string | string[] | undefined;
234
+ } | undefined;
220
235
  metro?: string | boolean | string[] | {
221
236
  config?: string | string[] | undefined;
222
237
  entry?: string | string[] | undefined;
@@ -583,6 +598,11 @@ declare const knipConfig: OptionalMergeConfigFn<{
583
598
  entry?: string | string[] | undefined;
584
599
  project?: string | string[] | undefined;
585
600
  } | undefined;
601
+ 'astro-db'?: string | boolean | string[] | {
602
+ config?: string | string[] | undefined;
603
+ entry?: string | string[] | undefined;
604
+ project?: string | string[] | undefined;
605
+ } | undefined;
586
606
  ava?: string | boolean | string[] | {
587
607
  config?: string | string[] | undefined;
588
608
  entry?: string | string[] | undefined;
@@ -668,6 +688,11 @@ declare const knipConfig: OptionalMergeConfigFn<{
668
688
  entry?: string | string[] | undefined;
669
689
  project?: string | string[] | undefined;
670
690
  } | undefined;
691
+ danger?: string | boolean | string[] | {
692
+ config?: string | string[] | undefined;
693
+ entry?: string | string[] | undefined;
694
+ project?: string | string[] | undefined;
695
+ } | undefined;
671
696
  'dependency-cruiser'?: string | boolean | string[] | {
672
697
  config?: string | string[] | undefined;
673
698
  entry?: string | string[] | undefined;
@@ -788,6 +813,11 @@ declare const knipConfig: OptionalMergeConfigFn<{
788
813
  entry?: string | string[] | undefined;
789
814
  project?: string | string[] | undefined;
790
815
  } | undefined;
816
+ mdxlint?: string | boolean | string[] | {
817
+ config?: string | string[] | undefined;
818
+ entry?: string | string[] | undefined;
819
+ project?: string | string[] | undefined;
820
+ } | undefined;
791
821
  metro?: string | boolean | string[] | {
792
822
  config?: string | string[] | undefined;
793
823
  entry?: string | string[] | undefined;
@@ -1167,14 +1197,8 @@ declare const knipConfig: OptionalMergeConfigFn<{
1167
1197
  ignoreDependencies?: (string | RegExp)[] | undefined;
1168
1198
  ignoreMembers?: (string | RegExp)[] | undefined;
1169
1199
  ignoreUnresolved?: (string | RegExp)[] | undefined;
1170
- ignoreExportsUsedInFile?: boolean | {
1171
- class?: boolean | undefined;
1172
- enum?: boolean | undefined;
1173
- function?: boolean | undefined;
1174
- interface?: boolean | undefined;
1175
- member?: boolean | undefined;
1176
- type?: boolean | undefined;
1177
- } | undefined;
1200
+ ignoreExportsUsedInFile?: boolean | Record<string, boolean | undefined> | undefined;
1201
+ ignoreIssues?: Record<string, ("exports" | "files" | "dependencies" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers")[]> | undefined;
1178
1202
  ignoreWorkspaces?: string[] | undefined;
1179
1203
  includeEntryExports?: boolean | undefined;
1180
1204
  compilers?: Record<string, true | ((filename: string, contents: string) => string) | ((filename: string, contents: string) => Promise<string>)> | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"knip.d.ts","names":[],"sources":["../../src/configs/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;;;;;;;;;;;;;;;;;;;;IAAjE,OAAA,CAAA,EAAA,MAAA,GAAA,MAAA,EAAA,GAAA,SAAA"}
1
+ {"version":3,"file":"knip.d.ts","names":[],"sources":["../../src/configs/knip.ts"],"sourcesContent":[],"mappings":";;;cAca;;;IAAA,KAAA,CAAA,EAAA,MAA2E,GAAA,MAAA,EAAA,GAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;EAAjE,CAAA,GAAA,SAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"prettier.d.ts","names":[],"sources":["../../src/configs/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
+ {"version":3,"file":"prettier.d.ts","names":[],"sources":["../../src/configs/prettier.ts"],"sourcesContent":[],"mappings":";;;;cAoCa;;;;IAAA,YAAA,CAAmF,EAAA,MAAA,GAAA,MAAA,EAAA;IAAA,OACwpP,CAAA,EADxpP,SAAA,CACwpP,OAAA;;;;;;;;EAD7tP,eAAA,CAAA,EAAA,OAAA"}
@@ -1,6 +1,7 @@
1
1
  import { MergeConfigFn, OptionalMergeConfigFn } from "./utils.js";
2
2
  import * as rolldown0 from "rolldown";
3
3
  import * as tsdown0 from "tsdown";
4
+ import { UserConfig } from "tsdown";
4
5
  import * as rolldown_plugin_dts0 from "rolldown-plugin-dts";
5
6
  import * as publint0 from "publint";
6
7
  import * as hookable0 from "hookable";
@@ -18,7 +19,7 @@ declare const tsdownConfig: MergeConfigFn<{
18
19
  env?: Record<string, any>;
19
20
  define?: Record<string, string>;
20
21
  shims?: boolean;
21
- treeshake?: boolean;
22
+ treeshake?: boolean | rolldown0.TreeshakingOptions;
22
23
  loader?: rolldown0.ModuleTypes;
23
24
  removeNodeProtocol?: boolean;
24
25
  nodeProtocol?: "strip" | boolean;
@@ -52,7 +53,8 @@ declare const tsdownConfig: MergeConfigFn<{
52
53
  fromVite?: boolean | "vitest";
53
54
  watch?: boolean | (string | string[]);
54
55
  ignoreWatch?: string | RegExp | (string | RegExp)[];
55
- onSuccess?: string | ((config: tsdown0.ResolvedOptions, signal: AbortSignal) => void | Promise<void>);
56
+ onSuccess?: string | ((config: tsdown0.ResolvedConfig, signal: AbortSignal) => void | Promise<void>);
57
+ debug?: boolean | tsdown0.DebugOptions;
56
58
  dts?: boolean | rolldown_plugin_dts0.Options;
57
59
  unused?: boolean | UnusedOptions;
58
60
  publint?: boolean | publint0.Options;
@@ -70,6 +72,7 @@ declare const tsdownConfig: MergeConfigFn<{
70
72
  readonly unbundle: true;
71
73
  readonly target: false;
72
74
  readonly platform: "neutral";
75
+ readonly fixedExtension: false;
73
76
  readonly minify: "dce-only";
74
77
  readonly sourcemap: true;
75
78
  readonly hash: false;
@@ -84,7 +87,7 @@ declare const tsdownConfig: MergeConfigFn<{
84
87
  readonly publint: true;
85
88
  readonly failOnWarn: true;
86
89
  }>;
87
- declare const tsdownBinConfig: OptionalMergeConfigFn<Omit<tsdown0.Options, "config" | "filter" | "configLoader">, {
90
+ declare const tsdownBinConfig: OptionalMergeConfigFn<UserConfig, {
88
91
  readonly entry: [];
89
92
  readonly platform: "node";
90
93
  readonly outExtensions: () => {
@@ -97,6 +100,7 @@ declare const tsdownBinConfig: OptionalMergeConfigFn<Omit<tsdown0.Options, "conf
97
100
  readonly attw: false;
98
101
  readonly publint: false;
99
102
  readonly target: false;
103
+ readonly fixedExtension: false;
100
104
  readonly minify: "dce-only";
101
105
  readonly hash: false;
102
106
  readonly failOnWarn: true;
@@ -1 +1 @@
1
- {"version":3,"file":"tsdown.d.ts","names":[],"sources":["../../src/configs/tsdown.ts"],"sourcesContent":[],"mappings":";;;;;;;;cAyCa;UAAyF,SAAA,CAAA;;;;;;;EAAzF,MAAA,CAAA,EAAA,MAAyF,GAAA,MAAA,EAAA,GAAA,KAAA;EAAA,GAAA,CAAA,QAAA,CAAA,MAAA,EAAA,GAAA,CAAA;QAAA,CAAA,QAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA7E,SAAA,MAAA,EAAA,UAAA;EACZ,SAAA,SAAwF,EAAA,IAAA;EAAA,SAAA,IAAA,EAAA,KAAA;WAAA,GAAzE,EAAA;IAAA,SAAA,UAAA,EAAA,IAAA;IAAA,SAAA,SAAA,EAAA,IAAA;EAAA,CAAA;;;;;;;;cAAf,iBAAe,sBAAA,KAAyE,OAAA,CAAzE,OAAA"}
1
+ {"version":3,"file":"tsdown.d.ts","names":[],"sources":["../../src/configs/tsdown.ts"],"sourcesContent":[],"mappings":";;;;;;;;;cA0Ca;UAAyF,SAAA,CAAA;;;;;;;EAAzF,MAAA,CAAA,EAAA,MAAyF,GAAA,MAAA,EAAA,GAAA,KAAA;EAAA,GAAA,CAAA,QAAA,CAAA,MAAA,EAAA,GAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA7E,SAAA,cAAA,EAAA,KAAA;EACZ,SAAA,MAAA,EAAA,UAA8E;;;;;;;;;;;;;;cAA9E,iBAAe,sBAAA"}
@@ -4,6 +4,7 @@ const baseConfig = {
4
4
  unbundle: true,
5
5
  target: false,
6
6
  platform: "neutral",
7
+ fixedExtension: false,
7
8
  minify: "dce-only",
8
9
  sourcemap: true,
9
10
  hash: false,
@@ -1 +1 @@
1
- {"version":3,"file":"tsdown.js","names":[],"sources":["../../src/configs/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"}
1
+ {"version":3,"file":"tsdown.js","names":[],"sources":["../../src/configs/tsdown.ts"],"sourcesContent":["import type { UserConfig } from \"tsdown\"\nimport type { SetRequired } from \"type-fest\"\n\nimport { createMergeConfigFn } from \"./utils.ts\"\n\n// force projects to specify platform\ntype StrictUserConfig = SetRequired<UserConfig, \"platform\">\n\nconst baseConfig = {\n entry: [\"./src/index.ts\"],\n unbundle: true,\n target: false,\n platform: \"neutral\",\n fixedExtension: false,\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 UserConfig\n\nexport const tsdownConfig = createMergeConfigFn<StrictUserConfig, typeof baseConfig, true>(baseConfig)\nexport const tsdownBinConfig = createMergeConfigFn<UserConfig, typeof binConfig>(binConfig)\n"],"mappings":";AAQA,MAAM,aAAa;CACjB,OAAO,CAAC,iBAAiB;CACzB,UAAU;CACV,QAAQ;CACR,UAAU;CACV,gBAAgB;CAChB,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,oBAAkD,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/configs/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"}
1
+ {"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/configs/utils.ts"],"sourcesContent":[],"mappings":";;;;;AAkBA;;AAGgB,UAHC,aAGD,CAAA,UAAA,EAAA,UAAA,CAAA,CAAA;EACD,CAAA,0BAFc,UAEd,CAAA,CAAA,UAAA,EADC,iBACD,CAAA,EAAV,SAAU,CAAA,UAAA,EAAY,iBAAZ,EAAA;IAAY,cAAA,EAAA,QAAA;EAAtB,CAAA,CAAA;;AAaL;;;;;;;;;UAAiB,sDAAsD,cAAc,YAAY;MAC3F"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":[],"sources":["../../src/configs/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"}
1
+ {"version":3,"file":"utils.js","names":[],"sources":["../../src/configs/utils.ts"],"sourcesContent":["import { mergeWith } from \"es-toolkit\"\nimport { clone } from \"remeda\"\nimport type { MergeDeep } from \"type-fest\"\n\ntype AnyObj = object\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.17.7",
3
+ "version": "0.17.9",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,29 +39,29 @@
39
39
  "typescript": "^5.0.0"
40
40
  },
41
41
  "dependencies": {
42
- "@optique/core": "^0.6.1",
43
- "@optique/run": "^0.6.1",
42
+ "@optique/core": "^0.6.2",
43
+ "@optique/run": "^0.6.2",
44
44
  "@prettier/plugin-xml": "^3.4.2",
45
- "es-toolkit": "^1.40.0",
46
- "get-tsconfig": "^4.12.0",
45
+ "es-toolkit": "^1.41.0",
46
+ "get-tsconfig": "^4.13.0",
47
47
  "picocolors": "^1.1.1",
48
48
  "prettier-plugin-astro": "^0.14.1",
49
49
  "prettier-plugin-sh": "^0.18.0",
50
- "prettier-plugin-tailwindcss": "^0.7.0",
50
+ "prettier-plugin-tailwindcss": "^0.7.1",
51
51
  "prettier-plugin-toml": "^2.0.6",
52
52
  "remeda": "^2.32.0",
53
53
  "ts-explicit-errors": "^4.0.1",
54
- "tsdown": "^0.15.7",
55
- "type-fest": "^5.1.0"
54
+ "tsdown": "^0.16.1",
55
+ "type-fest": "^5.2.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@arethetypeswrong/core": "^0.18.2",
59
- "@biomejs/biome": "^2.2.6",
60
- "@types/bun": "^1.3.0",
61
- "knip": "^5.65.0",
59
+ "@biomejs/biome": "^2.3.4",
60
+ "@types/bun": "^1.3.2",
61
+ "knip": "^5.68.0",
62
62
  "markdown-toc": "^1.2.0",
63
63
  "prettier": "^3.6.2",
64
- "publint": "^0.3.14",
64
+ "publint": "^0.3.15",
65
65
  "typescript": "^5.9.3"
66
66
  },
67
67
  "publishConfig": {