@adamhl8/configs 0.17.14 → 0.18.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
- {"version":3,"file":"knip.d.ts","names":[],"sources":["../../src/configs/knip.ts"],"sourcesContent":[],"mappings":";;;;cAca,YAAU,sBAAA;;;EAAV,SAAA,MAA2E,EAAA,KAAA"}
1
+ {"version":3,"file":"knip.d.ts","names":[],"sources":["../../src/configs/knip.ts"],"sourcesContent":[],"mappings":";;;cAca;;;IAAA,KAAA,CAAA,EAAA,MAAiF,GAAA,MAAA,EAAA,GAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;EAAvE,CAAA,GAAA,SAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"knip.js","names":[],"sources":["../../src/configs/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
+ {"version":3,"file":"knip.js","names":[],"sources":["../../src/configs/knip.ts"],"sourcesContent":["import type { RawConfiguration } from \"knip/dist/types/config\"\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 RawConfiguration\n\nexport const knipConfig = createMergeConfigFn<RawConfiguration, typeof baseConfig>(baseConfig)\n"],"mappings":";AAcA,MAAa,aAAa,oBANP;CACjB,OAAO;EAAC;EAAkB;EAAgB;EAAqB;CAC/D,SAAS,CAAC,KAAK;CACf,QAAQ;CACT,CAE6F"}
@@ -27,9 +27,10 @@ declare const tsdownConfig: MergeConfigFn<{
27
27
  inputOptions?: rolldown0.InputOptions | ((options: rolldown0.InputOptions, format: tsdown0.NormalizedFormat, context: {
28
28
  cjsDts: boolean;
29
29
  }) => void | rolldown0.InputOptions | Promise<void | rolldown0.InputOptions | null> | null);
30
- format?: tsdown0.Format | tsdown0.Format[];
30
+ format?: tsdown0.Format | tsdown0.Format[] | Partial<Record<tsdown0.Format, Partial<tsdown0.ResolvedConfig>>>;
31
31
  globalName?: string;
32
32
  outDir?: string;
33
+ write?: boolean;
33
34
  sourcemap?: tsdown0.Sourcemap;
34
35
  clean?: boolean | string[];
35
36
  minify?: boolean | "dce-only" | rolldown0.MinifyOptions;
@@ -53,8 +54,8 @@ declare const tsdownConfig: MergeConfigFn<{
53
54
  fromVite?: boolean | "vitest";
54
55
  watch?: boolean | (string | string[]);
55
56
  ignoreWatch?: string | RegExp | (string | RegExp)[];
56
- onSuccess?: string | ((config: tsdown0.ResolvedConfig, signal: AbortSignal) => void | Promise<void>);
57
57
  debug?: tsdown0.WithEnabled<tsdown0.DebugOptions>;
58
+ onSuccess?: string | ((config: tsdown0.ResolvedConfig, signal: AbortSignal) => void | Promise<void>);
58
59
  dts?: tsdown0.WithEnabled<rolldown_plugin_dts0.Options>;
59
60
  unused?: tsdown0.WithEnabled<UnusedOptions>;
60
61
  publint?: tsdown0.WithEnabled<publint0.Options>;
@@ -1 +1 @@
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,IAAA,EAAA;IACZ,SAAA,KAA8E,EAAA,OAAA;;;;;;cAA9E,iBAAe,sBAAA"}
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,OAAA,EAAA,IAAA;EACZ,SAAA,UAA8E,EAAA,IAAA;;cAA9E,iBAAe,sBAAA"}
@@ -13,7 +13,7 @@ function cli() {
13
13
  return run(object({
14
14
  write: option("-w", "--write", { description: message`Write changes to files` }),
15
15
  skipAlias: option("--skip-alias", { description: message`Skip transforming relative imports to use an alias` }),
16
- fileIgnorePatterns: multiple(option("-f", "--file-ignore", string({ metavar: "PATTERN" }), { description: message`Additional glob patterns for files to ignore (only applies to import fixes)` })),
16
+ fileIgnorePatterns: multiple(option("-f", "--file-ignore", string({ metavar: "PATTERN" }), { description: message`Additional glob patterns for files to ignore` })),
17
17
  importIgnoreStrings: multiple(option("-i", "--import-ignore", string(), { description: message`An import path *containing* the given string will be ignored` }))
18
18
  }), {
19
19
  programName: "ts-import-fix",
@@ -167,19 +167,23 @@ async function fixImports(filePaths, { write, importIgnoreStrings, skipAlias })
167
167
  if (IMPORT_ERRORS.length > 0) return err(`failed to transform some imports:\n${IMPORT_ERRORS.join("\n")}`, void 0);
168
168
  }
169
169
  const FILES_GLOB = "**/*.{ts,tsx,js,jsx,astro}";
170
- const BASE_IGNORE_PATTERNS = ["node_modules/", "dist/"];
170
+ const BASE_IGNORE_PATTERNS = [
171
+ ".git/",
172
+ "node_modules/",
173
+ "dist/"
174
+ ];
171
175
  async function tsImportFix() {
172
176
  const { fileIgnorePatterns, ...fixImportsOptions } = cli();
173
177
  const errors = [];
174
- const fixImportsIgnorePatterns = [
178
+ const allFileIgnorePatterns = [
175
179
  ...BASE_IGNORE_PATTERNS,
176
180
  "astro.config.ts",
177
181
  ...fileIgnorePatterns
178
182
  ];
179
- const [fixImportsFilePaths, checkExportsFilePaths] = await Promise.all([Array.fromAsync(fs.glob(FILES_GLOB, { exclude: fixImportsIgnorePatterns })), Array.fromAsync(fs.glob(FILES_GLOB, { exclude: BASE_IGNORE_PATTERNS }))]);
180
- const fixImportsResult = await fixImports(fixImportsFilePaths, fixImportsOptions);
183
+ const filePaths = await Array.fromAsync(fs.glob(FILES_GLOB, { exclude: allFileIgnorePatterns }));
184
+ const fixImportsResult = await fixImports(filePaths, fixImportsOptions);
181
185
  if (isErr(fixImportsResult)) errors.push(fixImportsResult);
182
- const checkExportsResult = await checkExports(checkExportsFilePaths);
186
+ const checkExportsResult = await checkExports(filePaths);
183
187
  if (isErr(checkExportsResult)) errors.push(checkExportsResult);
184
188
  return errors;
185
189
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamhl8/configs",
3
- "version": "0.17.14",
3
+ "version": "0.18.0",
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.7.0",
43
- "@optique/run": "^0.7.0",
42
+ "@optique/core": "^0.8.0",
43
+ "@optique/run": "^0.8.0",
44
44
  "@prettier/plugin-xml": "^3.4.2",
45
45
  "es-toolkit": "^1.42.0",
46
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.1",
50
+ "prettier-plugin-tailwindcss": "^0.7.2",
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.17.0-beta.1",
55
- "type-fest": "^5.2.0"
54
+ "tsdown": "^0.17.2",
55
+ "type-fest": "^5.3.1"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@arethetypeswrong/core": "^0.18.2",
59
59
  "@biomejs/biome": "^2.3.8",
60
- "@types/bun": "^1.3.3",
61
- "knip": "^5.70.2",
60
+ "@types/bun": "^1.3.4",
61
+ "knip": "^5.73.1",
62
62
  "markdown-toc": "^1.2.0",
63
- "prettier": "^3.7.2",
64
- "publint": "^0.3.15",
63
+ "prettier": "^3.7.4",
64
+ "publint": "^0.3.16",
65
65
  "typescript": "^5.9.3"
66
66
  },
67
67
  "publishConfig": {