@adamhl8/configs 0.15.4 → 0.15.5

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.
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env bun
2
+ import path from "node:path";
3
+ import process from "node:process";
4
+ const baseKnipPreprocessorPath = `${path.resolve(import.meta.dir, "../knip-preprocessor")}`;
5
+ const knipPreprocessorPathExt = await Bun.file(`${baseKnipPreprocessorPath}.ts`).exists() ? ".ts" : ".js";
6
+ const knipPreprocessorPath = `${baseKnipPreprocessorPath}${knipPreprocessorPathExt}`;
7
+ process.exitCode = Bun.spawnSync({
8
+ cmd: [
9
+ "bun",
10
+ "knip-bun",
11
+ "--preprocessor",
12
+ knipPreprocessorPath,
13
+ ...process.argv.slice(2)
14
+ ],
15
+ stdout: "inherit",
16
+ stderr: "inherit"
17
+ }).exitCode;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import * as type_fest_source_internal_type_js3 from "type-fest/source/internal/type.js";
2
- import * as type_fest4 from "type-fest";
3
- import * as type_fest_source_conditional_simplify_js3 from "type-fest/source/conditional-simplify.js";
4
- import * as type_fest_source_merge_deep_js0 from "type-fest/source/merge-deep.js";
1
+ import * as type_fest_source_internal_type_js7 from "type-fest/source/internal/type.js";
2
+ import * as type_fest9 from "type-fest";
3
+ import * as type_fest_source_conditional_simplify_js7 from "type-fest/source/conditional-simplify.js";
4
+ import * as type_fest_source_merge_deep_js1 from "type-fest/source/merge-deep.js";
5
5
  import { Config } from "prettier";
6
6
  import * as tsdown0 from "tsdown";
7
7
 
@@ -1164,11 +1164,11 @@ declare const knipConfig: {
1164
1164
  ignoreUnresolved?: (string | RegExp)[] | undefined;
1165
1165
  includeEntryExports?: boolean | undefined;
1166
1166
  }> | undefined;
1167
- }>(userConfig: UserConfig): type_fest_source_conditional_simplify_js3.ConditionalSimplifyDeep<[undefined] extends [{
1167
+ }>(userConfig: UserConfig): type_fest_source_conditional_simplify_js7.ConditionalSimplifyDeep<[undefined] extends [{
1168
1168
  readonly entry: ["./src/index.ts", "**/*.test.ts", "./tsdown.config.ts"];
1169
1169
  readonly project: ["**"];
1170
1170
  readonly tsdown: false;
1171
- } | type_fest_source_conditional_simplify_js3.ConditionalSimplifyDeep<UserConfig, type_fest_source_internal_type_js3.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest4.UnknownArray, object>] ? never : type_fest_source_conditional_simplify_js3.ConditionalSimplifyDeep<UserConfig, type_fest_source_internal_type_js3.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest4.UnknownArray, object> extends infer T ? T extends type_fest_source_conditional_simplify_js3.ConditionalSimplifyDeep<UserConfig, type_fest_source_internal_type_js3.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest4.UnknownArray, object> ? T extends type_fest4.UnknownRecord ? type_fest_source_merge_deep_js0.MergeDeepRecord<{
1171
+ } | type_fest_source_conditional_simplify_js7.ConditionalSimplifyDeep<UserConfig, type_fest_source_internal_type_js7.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest9.UnknownArray, object>] ? never : type_fest_source_conditional_simplify_js7.ConditionalSimplifyDeep<UserConfig, type_fest_source_internal_type_js7.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest9.UnknownArray, object> extends infer T ? T extends type_fest_source_conditional_simplify_js7.ConditionalSimplifyDeep<UserConfig, type_fest_source_internal_type_js7.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest9.UnknownArray, object> ? T extends type_fest9.UnknownRecord ? type_fest_source_merge_deep_js1.MergeDeepRecord<{
1172
1172
  readonly entry: ["./src/index.ts", "**/*.test.ts", "./tsdown.config.ts"];
1173
1173
  readonly project: ["**"];
1174
1174
  readonly tsdown: false;
@@ -1176,7 +1176,7 @@ declare const knipConfig: {
1176
1176
  recurseIntoArrays: false;
1177
1177
  spreadTopLevelArrays: true;
1178
1178
  arrayMergeMode: "spread";
1179
- }> : never : never : never, type_fest_source_internal_type_js3.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest4.UnknownArray, object>;
1179
+ }> : never : never : never, type_fest_source_internal_type_js7.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest9.UnknownArray, object>;
1180
1180
  };
1181
1181
  //#endregion
1182
1182
  //#region src/prettier.d.ts
@@ -1198,7 +1198,7 @@ declare const prettierConfig: {
1198
1198
  };
1199
1199
  }];
1200
1200
  };
1201
- <UserConfig extends Config>(userConfig: UserConfig): type_fest_source_conditional_simplify_js3.ConditionalSimplifyDeep<[undefined] extends [{
1201
+ <UserConfig extends Config>(userConfig: UserConfig): type_fest_source_conditional_simplify_js7.ConditionalSimplifyDeep<[undefined] extends [{
1202
1202
  readonly printWidth: 120;
1203
1203
  readonly semi: false;
1204
1204
  readonly plugins: ["@prettier/plugin-xml", "prettier-plugin-sh", "prettier-plugin-toml", "prettier-plugin-astro", "prettier-plugin-tailwindcss"];
@@ -1214,7 +1214,7 @@ declare const prettierConfig: {
1214
1214
  readonly parser: "astro";
1215
1215
  };
1216
1216
  }];
1217
- } | type_fest_source_conditional_simplify_js3.ConditionalSimplifyDeep<UserConfig, type_fest_source_internal_type_js3.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest4.UnknownArray, object>] ? never : type_fest_source_conditional_simplify_js3.ConditionalSimplifyDeep<UserConfig, type_fest_source_internal_type_js3.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest4.UnknownArray, object> extends infer T ? T extends type_fest_source_conditional_simplify_js3.ConditionalSimplifyDeep<UserConfig, type_fest_source_internal_type_js3.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest4.UnknownArray, object> ? T extends type_fest4.UnknownRecord ? type_fest_source_merge_deep_js0.MergeDeepRecord<{
1217
+ } | type_fest_source_conditional_simplify_js7.ConditionalSimplifyDeep<UserConfig, type_fest_source_internal_type_js7.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest9.UnknownArray, object>] ? never : type_fest_source_conditional_simplify_js7.ConditionalSimplifyDeep<UserConfig, type_fest_source_internal_type_js7.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest9.UnknownArray, object> extends infer T ? T extends type_fest_source_conditional_simplify_js7.ConditionalSimplifyDeep<UserConfig, type_fest_source_internal_type_js7.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest9.UnknownArray, object> ? T extends type_fest9.UnknownRecord ? type_fest_source_merge_deep_js1.MergeDeepRecord<{
1218
1218
  readonly printWidth: 120;
1219
1219
  readonly semi: false;
1220
1220
  readonly plugins: ["@prettier/plugin-xml", "prettier-plugin-sh", "prettier-plugin-toml", "prettier-plugin-astro", "prettier-plugin-tailwindcss"];
@@ -1234,7 +1234,7 @@ declare const prettierConfig: {
1234
1234
  recurseIntoArrays: false;
1235
1235
  spreadTopLevelArrays: true;
1236
1236
  arrayMergeMode: "spread";
1237
- }> : never : never : never, type_fest_source_internal_type_js3.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest4.UnknownArray, object>;
1237
+ }> : never : never : never, type_fest_source_internal_type_js7.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest9.UnknownArray, object>;
1238
1238
  };
1239
1239
  //#endregion
1240
1240
  //#region src/tsdown.d.ts
@@ -1257,7 +1257,7 @@ declare const tsdownConfig: {
1257
1257
  readonly publint: true;
1258
1258
  readonly failOnWarn: true;
1259
1259
  };
1260
- <UserConfig extends tsdown0.UserConfig>(userConfig: UserConfig): type_fest_source_conditional_simplify_js3.ConditionalSimplifyDeep<[undefined] extends [{
1260
+ <UserConfig extends tsdown0.UserConfig>(userConfig: UserConfig): type_fest_source_conditional_simplify_js7.ConditionalSimplifyDeep<[undefined] extends [{
1261
1261
  readonly entry: ["./src/index.ts"];
1262
1262
  readonly unbundle: true;
1263
1263
  readonly target: false;
@@ -1274,7 +1274,7 @@ declare const tsdownConfig: {
1274
1274
  };
1275
1275
  readonly publint: true;
1276
1276
  readonly failOnWarn: true;
1277
- } | type_fest_source_conditional_simplify_js3.ConditionalSimplifyDeep<UserConfig, type_fest_source_internal_type_js3.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest4.UnknownArray, object>] ? never : type_fest_source_conditional_simplify_js3.ConditionalSimplifyDeep<UserConfig, type_fest_source_internal_type_js3.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest4.UnknownArray, object> extends infer T ? T extends type_fest_source_conditional_simplify_js3.ConditionalSimplifyDeep<UserConfig, type_fest_source_internal_type_js3.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest4.UnknownArray, object> ? T extends type_fest4.UnknownRecord ? type_fest_source_merge_deep_js0.MergeDeepRecord<{
1277
+ } | type_fest_source_conditional_simplify_js7.ConditionalSimplifyDeep<UserConfig, type_fest_source_internal_type_js7.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest9.UnknownArray, object>] ? never : type_fest_source_conditional_simplify_js7.ConditionalSimplifyDeep<UserConfig, type_fest_source_internal_type_js7.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest9.UnknownArray, object> extends infer T ? T extends type_fest_source_conditional_simplify_js7.ConditionalSimplifyDeep<UserConfig, type_fest_source_internal_type_js7.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest9.UnknownArray, object> ? T extends type_fest9.UnknownRecord ? type_fest_source_merge_deep_js1.MergeDeepRecord<{
1278
1278
  readonly entry: ["./src/index.ts"];
1279
1279
  readonly unbundle: true;
1280
1280
  readonly target: false;
@@ -1295,7 +1295,7 @@ declare const tsdownConfig: {
1295
1295
  recurseIntoArrays: false;
1296
1296
  spreadTopLevelArrays: true;
1297
1297
  arrayMergeMode: "spread";
1298
- }> : never : never : never, type_fest_source_internal_type_js3.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest4.UnknownArray, object>;
1298
+ }> : never : never : never, type_fest_source_internal_type_js7.NonRecursiveType | Set<unknown> | Map<unknown, unknown> | type_fest9.UnknownArray, object>;
1299
1299
  };
1300
1300
  //#endregion
1301
1301
  export { knipConfig, prettierConfig, tsdownConfig };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["merge","baseConfig","baseConfig","baseConfig"],"sources":["../node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs","../node_modules/es-toolkit/dist/compat/predicate/isObjectLike.mjs","../node_modules/es-toolkit/dist/object/mergeWith.mjs","../src/utils.ts","../src/knip.ts","../src/prettier.ts","../src/tsdown.ts"],"sourcesContent":["function isUnsafeProperty(key) {\n return key === '__proto__';\n}\n\nexport { isUnsafeProperty };\n","function isObjectLike(value) {\n return typeof value === 'object' && value !== null;\n}\n\nexport { isObjectLike };\n","import { isUnsafeProperty } from '../_internal/isUnsafeProperty.mjs';\nimport { isObjectLike } from '../compat/predicate/isObjectLike.mjs';\n\nfunction mergeWith(target, source, merge) {\n const sourceKeys = Object.keys(source);\n for (let i = 0; i < sourceKeys.length; i++) {\n const key = sourceKeys[i];\n if (isUnsafeProperty(key)) {\n continue;\n }\n const sourceValue = source[key];\n const targetValue = target[key];\n const merged = merge(targetValue, sourceValue, key, target, source);\n if (merged !== undefined) {\n target[key] = merged;\n }\n else if (Array.isArray(sourceValue)) {\n target[key] = mergeWith(targetValue ?? [], sourceValue, merge);\n }\n else if (isObjectLike(targetValue) && isObjectLike(sourceValue)) {\n target[key] = mergeWith(targetValue ?? {}, sourceValue, merge);\n }\n else if (targetValue === undefined || sourceValue !== undefined) {\n target[key] = sourceValue;\n }\n }\n return target;\n}\n\nexport { mergeWith };\n","import { mergeWith } from \"es-toolkit\"\nimport { 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 */\nexport function 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 * Creates a config merge function with proper type overloads for merging with a base config.\n */\nexport function createMergeConfigFn<UserConfigType, BaseConfig extends UserConfigType>(baseConfig: BaseConfig) {\n //\n\n // if `userConfig` is not provided, return the type of `baseConfig`\n function mergeConfig(): BaseConfig\n\n // if `userConfig` is provided, instead of returning `BaseConfig & UserConfig` (from `merge`), return a more friendly type using `MergeDeep`\n function mergeConfig<UserConfig extends UserConfigType>(\n userConfig: UserConfig,\n ): MergeDeep<BaseConfig, UserConfig, { arrayMergeMode: \"spread\" }>\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 return merge(baseConfig, userConfig)\n }\n\n return mergeConfig\n}\n","import type { KnipConfig } from \"knip\"\n\n// biome-ignore lint/plugin: ignore\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","import type { Config } from \"prettier\"\n\n// biome-ignore lint/plugin: ignore\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 = createMergeConfigFn<Config, typeof baseConfig>(baseConfig)\n","import type { UserConfig } from \"tsdown\"\n\n// biome-ignore lint/plugin: ignore\nimport { createMergeConfigFn } from \"./utils.ts\"\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 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 UserConfig\n\nexport const tsdownConfig = createMergeConfigFn<UserConfig, typeof baseConfig>(baseConfig)\n"],"x_google_ignoreList":[0,1,2],"mappings":";AAAA,SAAS,iBAAiB,KAAK;AAC3B,QAAO,QAAQ;;ACDnB,SAAS,aAAa,OAAO;AACzB,QAAO,OAAO,UAAU,YAAY,UAAU;;ACElD,SAAS,UAAU,QAAQ,QAAQ,SAAO;CACtC,MAAM,aAAa,OAAO,KAAK,OAAO;AACtC,MAAK,IAAI,IAAI,GAAG,IAAI,WAAW,QAAQ,KAAK;EACxC,MAAM,MAAM,WAAW;AACvB,MAAI,iBAAiB,IAAI,CACrB;EAEJ,MAAM,cAAc,OAAO;EAC3B,MAAM,cAAc,OAAO;EAC3B,MAAM,SAASA,QAAM,aAAa,aAAa,KAAK,QAAQ,OAAO;AACnE,MAAI,WAAW,KAAA,EACX,QAAO,OAAO;WAET,MAAM,QAAQ,YAAY,CAC/B,QAAO,OAAO,UAAU,eAAe,EAAE,EAAE,aAAaA,QAAM;WAEzD,aAAa,YAAY,IAAI,aAAa,YAAY,CAC3D,QAAO,OAAO,UAAU,eAAe,EAAE,EAAE,aAAaA,QAAM;WAEzD,gBAAgB,KAAA,KAAa,gBAAgB,KAAA,EAClD,QAAO,OAAO;;AAGtB,QAAO;;ACjBX,SAAgB,MAA0C,QAAW,QAAkB;AACrF,QAAO,UAAU,QAAQ,SAAS,UAAmB,aACnD,MAAM,QAAQ,SAAS,GAAG,SAAS,OAAO,SAAS,GAAG,KAAA,EACvD;;AAMH,SAAgB,oBAAuE,cAAwB;CAW7G,SAAS,YAA+C,YAAyB;AAC/E,MAAI,eAAe,KAAA,EAAW,QAAOG;AAErC,MAAI,EAAE,cAAcA,aAAW,IAAI,cAAc,WAAW,EAC1D,OAAM,IAAI,MAAM,kDAAkDA,aAAW,aAAa,WAAW,GAAG;AAE1G,SAAO,MAAMA,cAAY,WAAW;;AAGtC,QAAO;;ACvBT,MAAa,aAAa,oBANP;CACjB,OAAO;EAAC;EAAkB;EAAgB;EAAqB;CAC/D,SAAS,CAAC,KAAK;CACf,QAAQ;CACT,CAEuF;ACkBxF,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,CAEuF;ACTxF,MAAa,eAAe,oBAnBT;CACjB,OAAO,CAAC,iBAAiB;CACzB,UAAU;CACV,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,WAAW;CACX,KAAK;EACH,YAAY;EACZ,WAAW;EACZ;CACD,MAAM;EACJ,OAAO;EACP,SAAS;EACV;CACD,SAAS;CACT,YAAY;CACb,CAEyF"}
1
+ {"version":3,"file":"index.js","names":["merge","baseConfig","baseConfig","baseConfig"],"sources":["../node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs","../node_modules/es-toolkit/dist/compat/predicate/isObjectLike.mjs","../node_modules/es-toolkit/dist/object/mergeWith.mjs","../src/utils.ts","../src/knip.ts","../src/prettier.ts","../src/tsdown.ts"],"sourcesContent":["function isUnsafeProperty(key) {\n return key === '__proto__';\n}\n\nexport { isUnsafeProperty };\n","function isObjectLike(value) {\n return typeof value === 'object' && value !== null;\n}\n\nexport { isObjectLike };\n","import { isUnsafeProperty } from '../_internal/isUnsafeProperty.mjs';\nimport { isObjectLike } from '../compat/predicate/isObjectLike.mjs';\n\nfunction mergeWith(target, source, merge) {\n const sourceKeys = Object.keys(source);\n for (let i = 0; i < sourceKeys.length; i++) {\n const key = sourceKeys[i];\n if (isUnsafeProperty(key)) {\n continue;\n }\n const sourceValue = source[key];\n const targetValue = target[key];\n const merged = merge(targetValue, sourceValue, key, target, source);\n if (merged !== undefined) {\n target[key] = merged;\n }\n else if (Array.isArray(sourceValue)) {\n target[key] = mergeWith(targetValue ?? [], sourceValue, merge);\n }\n else if (isObjectLike(targetValue) && isObjectLike(sourceValue)) {\n target[key] = mergeWith(targetValue ?? {}, sourceValue, merge);\n }\n else if (targetValue === undefined || sourceValue !== undefined) {\n target[key] = sourceValue;\n }\n }\n return target;\n}\n\nexport { mergeWith };\n","import { mergeWith } from \"es-toolkit\"\nimport { 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\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>(baseConfig: BaseConfig) {\n //\n\n // if `userConfig` is not provided, return the type of `baseConfig`\n function mergeConfig(): BaseConfig\n\n // if `userConfig` is provided, instead of returning `BaseConfig & UserConfig` (from `merge`), return a more friendly type using `MergeDeep`\n function mergeConfig<UserConfig extends UserConfigType>(\n userConfig: UserConfig,\n ): MergeDeep<BaseConfig, UserConfig, { arrayMergeMode: \"spread\" }>\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 return merge(baseConfig, userConfig)\n }\n\n return mergeConfig\n}\n","import type { KnipConfig } from \"knip\"\n\n// biome-ignore lint/plugin: ignore\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","import type { Config } from \"prettier\"\n\n// biome-ignore lint/plugin: ignore\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 = createMergeConfigFn<Config, typeof baseConfig>(baseConfig)\n","import type { UserConfig } from \"tsdown\"\n\n// biome-ignore lint/plugin: ignore\nimport { createMergeConfigFn } from \"./utils.ts\"\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 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 UserConfig\n\nexport const tsdownConfig = createMergeConfigFn<UserConfig, typeof baseConfig>(baseConfig)\n"],"x_google_ignoreList":[0,1,2],"mappings":";AAAA,SAAS,iBAAiB,KAAK;AAC3B,QAAO,QAAQ;;ACDnB,SAAS,aAAa,OAAO;AACzB,QAAO,OAAO,UAAU,YAAY,UAAU;;ACElD,SAAS,UAAU,QAAQ,QAAQ,SAAO;CACtC,MAAM,aAAa,OAAO,KAAK,OAAO;AACtC,MAAK,IAAI,IAAI,GAAG,IAAI,WAAW,QAAQ,KAAK;EACxC,MAAM,MAAM,WAAW;AACvB,MAAI,iBAAiB,IAAI,CACrB;EAEJ,MAAM,cAAc,OAAO;EAC3B,MAAM,cAAc,OAAO;EAC3B,MAAM,SAASA,QAAM,aAAa,aAAa,KAAK,QAAQ,OAAO;AACnE,MAAI,WAAW,KAAA,EACX,QAAO,OAAO;WAET,MAAM,QAAQ,YAAY,CAC/B,QAAO,OAAO,UAAU,eAAe,EAAE,EAAE,aAAaA,QAAM;WAEzD,aAAa,YAAY,IAAI,aAAa,YAAY,CAC3D,QAAO,OAAO,UAAU,eAAe,EAAE,EAAE,aAAaA,QAAM;WAEzD,gBAAgB,KAAA,KAAa,gBAAgB,KAAA,EAClD,QAAO,OAAO;;AAGtB,QAAO;;ACjBX,SAAS,MAA0C,QAAW,QAAkB;AAC9E,QAAO,UAAU,QAAQ,SAAS,UAAmB,aACnD,MAAM,QAAQ,SAAS,GAAG,SAAS,OAAO,SAAS,GAAG,KAAA,EACvD;;AAMH,SAAgB,oBAAuE,cAAwB;CAW7G,SAAS,YAA+C,YAAyB;AAC/E,MAAI,eAAe,KAAA,EAAW,QAAOG;AAErC,MAAI,EAAE,cAAcA,aAAW,IAAI,cAAc,WAAW,EAC1D,OAAM,IAAI,MAAM,kDAAkDA,aAAW,aAAa,WAAW,GAAG;AAE1G,SAAO,MAAMA,cAAY,WAAW;;AAGtC,QAAO;;ACvBT,MAAa,aAAa,oBANP;CACjB,OAAO;EAAC;EAAkB;EAAgB;EAAqB;CAC/D,SAAS,CAAC,KAAK;CACf,QAAQ;CACT,CAEuF;ACkBxF,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,CAEuF;ACTxF,MAAa,eAAe,oBAnBT;CACjB,OAAO,CAAC,iBAAiB;CACzB,UAAU;CACV,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,WAAW;CACX,KAAK;EACH,YAAY;EACZ,WAAW;EACZ;CACD,MAAM;EACJ,OAAO;EACP,SAAS;EACV;CACD,SAAS;CACT,YAAY;CACb,CAEyF"}
@@ -0,0 +1,9 @@
1
+ import { knipConfig } from "./index.ts";
2
+ const entries = knipConfig().entry;
3
+ const preprocess = (options) => {
4
+ const filteredConfigurationHints = [...options.configurationHints].filter((hint) => !(typeof hint.identifier === "string" && entries.includes(hint.identifier) && hint.type === "entry-empty"));
5
+ options.configurationHints = new Set(filteredConfigurationHints);
6
+ return options;
7
+ };
8
+ var knip_preprocessor_default = preprocess;
9
+ export { knip_preprocessor_default as default };
@@ -18,7 +18,6 @@
18
18
  "skipLibCheck": true,
19
19
  "noEmit": true,
20
20
 
21
- // Strictness
22
21
  "strict": true,
23
22
  "allowUnreachableCode": false,
24
23
  "allowUnusedLabels": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamhl8/configs",
3
- "version": "0.15.4",
3
+ "version": "0.15.5",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,17 +17,20 @@
17
17
  },
18
18
  "license": "MIT",
19
19
  "exports": {
20
- "./tsconfig": "./dist/tsconfig.json",
20
+ "./tsconfig": "./dist/tsconfig.base.json",
21
21
  "./biome": "./dist/biome.base.json",
22
22
  ".": {
23
23
  "types": "./dist/index.d.ts",
24
24
  "import": "./dist/index.js"
25
25
  }
26
26
  },
27
+ "directories": {
28
+ "bin": "dist/bin/"
29
+ },
27
30
  "files": ["dist/"],
28
31
  "scripts": {
29
32
  "bundle": "bun lint && bun tsdown",
30
- "lint": "bun generate-biome-rules.ts && tsc --noEmit && biome check --write",
33
+ "lint": "bun generate-biome-rules.ts && tsc --noEmit && biome check --write && bun ./src/bin/adamhl-knip.ts",
31
34
  "postinstall": "mkdir -p ./node_modules/@adamhl8/configs/dist/ && cp -r ./src/biome-plugins/ ./node_modules/@adamhl8/configs/dist/",
32
35
  "prepare": "find .githooks -type f -exec ln -srf {} .git/hooks/ \\; || true",
33
36
  "prepublishOnly": "bun bundle"
@@ -43,7 +46,7 @@
43
46
  "devDependencies": {
44
47
  "@arethetypeswrong/core": "^0.18.2",
45
48
  "@biomejs/biome": "^2.2.4",
46
- "@types/bun": "^1.2.21",
49
+ "@types/bun": "^1.2.22",
47
50
  "es-toolkit": "^1.39.10",
48
51
  "knip": "^5.63.1",
49
52
  "prettier": "^3.6.2",