@outfitter/tooling 0.3.3 → 0.3.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.
Files changed (94) hide show
  1. package/.markdownlint-cli2.jsonc +55 -55
  2. package/README.md +33 -24
  3. package/dist/bun-version-compat.d.ts +2 -0
  4. package/dist/bun-version-compat.js +10 -0
  5. package/dist/cli/check-boundary-invocations.d.ts +34 -0
  6. package/dist/cli/check-boundary-invocations.js +14 -0
  7. package/dist/cli/check-bunup-registry.d.ts +36 -0
  8. package/dist/cli/check-bunup-registry.js +12 -0
  9. package/dist/cli/check-changeset.d.ts +82 -0
  10. package/dist/cli/check-changeset.js +24 -0
  11. package/dist/cli/check-clean-tree.d.ts +36 -0
  12. package/dist/cli/check-clean-tree.js +14 -0
  13. package/dist/cli/check-exports.d.ts +3 -0
  14. package/dist/cli/check-exports.js +17 -0
  15. package/dist/cli/check-home-paths.d.ts +31 -0
  16. package/dist/cli/check-home-paths.js +12 -0
  17. package/dist/cli/check-markdown-links.d.ts +42 -0
  18. package/dist/cli/check-markdown-links.js +13 -0
  19. package/dist/cli/check-readme-imports.d.ts +61 -0
  20. package/dist/{shared/chunk-7tdgbqb0.js → cli/check-readme-imports.js} +7 -6
  21. package/dist/cli/check-tsdoc.d.ts +5 -0
  22. package/dist/cli/check-tsdoc.js +42 -0
  23. package/dist/cli/check.d.ts +19 -0
  24. package/dist/cli/check.js +10 -0
  25. package/dist/cli/fix.d.ts +19 -0
  26. package/dist/cli/fix.js +10 -0
  27. package/dist/cli/index.js +61 -1218
  28. package/dist/cli/init.d.ts +31 -0
  29. package/dist/cli/init.js +12 -0
  30. package/dist/cli/internal/exports-analysis.d.ts +2 -0
  31. package/dist/cli/internal/exports-analysis.js +10 -0
  32. package/dist/cli/internal/exports-fs.d.ts +17 -0
  33. package/dist/cli/internal/exports-fs.js +9 -0
  34. package/dist/cli/internal/pre-push-checks.d.ts +2 -0
  35. package/dist/cli/internal/pre-push-checks.js +37 -0
  36. package/dist/cli/internal/tsdoc-analysis.d.ts +3 -0
  37. package/dist/cli/internal/tsdoc-analysis.js +26 -0
  38. package/dist/cli/internal/tsdoc-formatting.d.ts +3 -0
  39. package/dist/cli/internal/tsdoc-formatting.js +10 -0
  40. package/dist/cli/internal/tsdoc-types.d.ts +2 -0
  41. package/dist/cli/internal/tsdoc-types.js +16 -0
  42. package/dist/cli/pre-push.d.ts +7 -0
  43. package/dist/cli/pre-push.js +29 -0
  44. package/dist/cli/upgrade-bun.d.ts +8 -0
  45. package/dist/cli/upgrade-bun.js +9 -0
  46. package/dist/index.d.ts +9 -186
  47. package/dist/index.js +4 -42
  48. package/dist/registry/build.d.ts +4 -0
  49. package/dist/registry/build.js +279 -0
  50. package/dist/registry/index.d.ts +3 -0
  51. package/dist/registry/index.js +1 -0
  52. package/dist/registry/schema.d.ts +2 -0
  53. package/dist/registry/schema.js +28 -0
  54. package/dist/shared/@outfitter/tooling-0zjz8eg9.js +106 -0
  55. package/dist/shared/@outfitter/tooling-1hez6j9d.js +21 -0
  56. package/dist/shared/@outfitter/tooling-2vv5y3s4.js +145 -0
  57. package/dist/shared/{chunk-cmde0fwx.js → @outfitter/tooling-5xxctk9b.js} +12 -138
  58. package/dist/shared/@outfitter/tooling-5ynz680q.js +59 -0
  59. package/dist/shared/@outfitter/tooling-7437rmy6.js +39 -0
  60. package/dist/shared/@outfitter/tooling-8qcwr06t.d.ts +74 -0
  61. package/dist/shared/@outfitter/tooling-9ram55dd.js +69 -0
  62. package/dist/shared/@outfitter/tooling-9vs606gq.d.ts +3 -0
  63. package/dist/shared/@outfitter/tooling-a4bfx4be.js +21 -0
  64. package/dist/shared/@outfitter/tooling-a59br34g.js +32 -0
  65. package/dist/shared/@outfitter/tooling-a6q3zh7t.js +86 -0
  66. package/dist/shared/@outfitter/tooling-amrbp7cm.js +102 -0
  67. package/dist/shared/@outfitter/tooling-ayps7c4x.js +58 -0
  68. package/dist/shared/@outfitter/tooling-c8q6mj8z.js +228 -0
  69. package/dist/shared/@outfitter/tooling-cb0b8wsx.d.ts +57 -0
  70. package/dist/shared/@outfitter/tooling-ctmgnap5.js +19 -0
  71. package/dist/shared/@outfitter/tooling-f8q38e9z.d.ts +16 -0
  72. package/dist/shared/@outfitter/tooling-gcdvsqqp.js +73 -0
  73. package/dist/shared/@outfitter/tooling-h5dnevjw.js +139 -0
  74. package/dist/shared/@outfitter/tooling-j8d1h2zd.d.ts +10 -0
  75. package/dist/shared/@outfitter/tooling-ja1zg5yc.js +214 -0
  76. package/dist/shared/@outfitter/tooling-jnrs9rqd.js +4 -0
  77. package/dist/shared/@outfitter/tooling-mkynjra9.js +23 -0
  78. package/dist/shared/@outfitter/tooling-mq2xvz96.js +285 -0
  79. package/dist/shared/@outfitter/tooling-pq47jv6t.js +213 -0
  80. package/dist/shared/@outfitter/tooling-sjm8nebx.d.ts +109 -0
  81. package/dist/shared/@outfitter/tooling-stgnc2zx.d.ts +85 -0
  82. package/dist/shared/@outfitter/tooling-tj9p41vj.d.ts +55 -0
  83. package/dist/shared/@outfitter/tooling-vjmhvpjq.d.ts +29 -0
  84. package/dist/shared/@outfitter/tooling-wwm97f47.js +81 -0
  85. package/dist/shared/@outfitter/tooling-y43b117h.d.ts +13 -0
  86. package/dist/version.d.ts +2 -0
  87. package/dist/version.js +8 -0
  88. package/lefthook.yml +5 -1
  89. package/package.json +140 -131
  90. package/registry/registry.json +19 -12
  91. package/tsconfig.preset.bun.json +5 -5
  92. package/tsconfig.preset.json +33 -33
  93. package/biome.json +0 -81
  94. package/dist/shared/chunk-3s189drz.js +0 -4
@@ -0,0 +1,61 @@
1
+ import "../shared/@outfitter/tooling-y43b117h.js";
2
+ import { ExportMap } from "../shared/@outfitter/tooling-cb0b8wsx.js";
3
+ /** An import example extracted from a markdown code block */
4
+ interface ImportExample {
5
+ /** Package name, e.g. "@outfitter/cli" */
6
+ readonly packageName: string;
7
+ /** Export subpath, e.g. "./output" or "." */
8
+ readonly subpath: string;
9
+ /** Full import specifier, e.g. "@outfitter/cli/output" */
10
+ readonly fullSpecifier: string;
11
+ /** File where the import was found */
12
+ readonly file: string;
13
+ /** 1-based line number */
14
+ readonly line: number;
15
+ }
16
+ /** Result of checking imports in a single file */
17
+ interface ImportCheckResult {
18
+ readonly file: string;
19
+ readonly valid: ImportExample[];
20
+ readonly invalid: ImportExample[];
21
+ }
22
+ /**
23
+ * Parse a full import specifier into package name and subpath.
24
+ *
25
+ * Only recognizes `@outfitter/*` scoped packages.
26
+ *
27
+ * @example
28
+ * parseSpecifier("@outfitter/cli/output")
29
+ * // { packageName: "@outfitter/cli", subpath: "./output" }
30
+ *
31
+ * parseSpecifier("@outfitter/contracts")
32
+ * // { packageName: "@outfitter/contracts", subpath: "." }
33
+ */
34
+ declare function parseSpecifier(specifier: string): {
35
+ packageName: string;
36
+ subpath: string;
37
+ } | null;
38
+ /**
39
+ * Extract import specifiers from markdown content.
40
+ *
41
+ * Only extracts imports from fenced code blocks (typescript, ts,
42
+ * javascript, js). Skips blocks preceded by a non-contractual HTML comment.
43
+ * Deduplicates by full specifier within a single file.
44
+ */
45
+ declare function extractImports(content: string, file: string): ImportExample[];
46
+ /**
47
+ * Check whether a subpath exists in a package.json map.
48
+ */
49
+ declare function isExportedSubpath(subpath: string, exports: ExportMap): boolean;
50
+ interface CheckReadmeImportsOptions {
51
+ readonly json?: boolean;
52
+ }
53
+ declare function resolveJsonMode(options?: CheckReadmeImportsOptions): boolean;
54
+ /**
55
+ * Run check-readme-imports across all workspace packages.
56
+ *
57
+ * Finds README.md files in `packages/`, extracts import examples, and
58
+ * validates each subpath against the corresponding package.json exports.
59
+ */
60
+ declare function runCheckReadmeImports(options?: CheckReadmeImportsOptions): Promise<void>;
61
+ export { runCheckReadmeImports, resolveJsonMode, parseSpecifier, isExportedSubpath, extractImports, ImportExample, ImportCheckResult, ExportMap, CheckReadmeImportsOptions };
@@ -1,7 +1,8 @@
1
- import"./chunk-3s189drz.js";
1
+ // @bun
2
+ import"../shared/@outfitter/tooling-jnrs9rqd.js";
2
3
 
3
- // src/cli/check-readme-imports.ts
4
- import { resolve } from "node:path";
4
+ // packages/tooling/src/cli/check-readme-imports.ts
5
+ import { resolve } from "path";
5
6
  function parseSpecifier(specifier) {
6
7
  if (!specifier.startsWith("@outfitter/")) {
7
8
  return null;
@@ -90,7 +91,7 @@ function resolveJsonMode(options = {}) {
90
91
  async function runCheckReadmeImports(options = {}) {
91
92
  const cwd = process.cwd();
92
93
  const readmeGlob = new Bun.Glob("**/README.md");
93
- const readmeDirs = ["packages", "docs/packages"];
94
+ const readmeDirs = ["packages"];
94
95
  const readmePaths = [];
95
96
  for (const dir of readmeDirs) {
96
97
  const fullDir = resolve(cwd, dir);
@@ -126,7 +127,7 @@ async function runCheckReadmeImports(options = {}) {
126
127
  }
127
128
  const results = [];
128
129
  let hasInvalid = false;
129
- for (const readmePath of readmePaths.sort()) {
130
+ for (const readmePath of readmePaths.toSorted()) {
130
131
  const content = await Bun.file(readmePath).text();
131
132
  const relativePath = readmePath.replace(`${cwd}/`, "");
132
133
  const imports = extractImports(content, relativePath);
@@ -186,7 +187,7 @@ async function runCheckReadmeImports(options = {}) {
186
187
  `);
187
188
  }
188
189
  }
189
- process.exit(hasInvalid ? 1 : 0);
190
+ process.exitCode = hasInvalid ? 1 : 0;
190
191
  }
191
192
  export {
192
193
  runCheckReadmeImports,
@@ -0,0 +1,5 @@
1
+ import { runCheckTsdoc } from "../shared/@outfitter/tooling-j8d1h2zd.js";
2
+ import { printCheckTsdocHuman, resolveJsonMode } from "../shared/@outfitter/tooling-f8q38e9z.js";
3
+ import { analyzeCheckTsdoc, analyzeSourceFile, calculateCoverage, classifyDeclaration, getDeclarationKind, getDeclarationName, isExportedDeclaration } from "../shared/@outfitter/tooling-stgnc2zx.js";
4
+ import { CheckTsDocOptions, CoverageLevel, CoverageSummary, DeclarationCoverage, PackageCoverage, TsDocCheckResult, coverageLevelSchema, coverageSummarySchema, declarationCoverageSchema, packageCoverageSchema, tsDocCheckResultSchema } from "../shared/@outfitter/tooling-tj9p41vj.js";
5
+ export { tsDocCheckResultSchema, runCheckTsdoc, resolveJsonMode, printCheckTsdocHuman, packageCoverageSchema, isExportedDeclaration, getDeclarationName, getDeclarationKind, declarationCoverageSchema, coverageSummarySchema, coverageLevelSchema, classifyDeclaration, calculateCoverage, analyzeSourceFile, analyzeCheckTsdoc, TsDocCheckResult, PackageCoverage, DeclarationCoverage, CoverageSummary, CoverageLevel, CheckTsDocOptions };
@@ -0,0 +1,42 @@
1
+ // @bun
2
+ import {
3
+ runCheckTsdoc
4
+ } from "../shared/@outfitter/tooling-a59br34g.js";
5
+ import {
6
+ coverageLevelSchema,
7
+ coverageSummarySchema,
8
+ declarationCoverageSchema,
9
+ packageCoverageSchema,
10
+ tsDocCheckResultSchema
11
+ } from "../shared/@outfitter/tooling-7437rmy6.js";
12
+ import {
13
+ printCheckTsdocHuman,
14
+ resolveJsonMode
15
+ } from "../shared/@outfitter/tooling-5ynz680q.js";
16
+ import {
17
+ analyzeCheckTsdoc,
18
+ analyzeSourceFile,
19
+ calculateCoverage,
20
+ classifyDeclaration,
21
+ getDeclarationKind,
22
+ getDeclarationName,
23
+ isExportedDeclaration
24
+ } from "../shared/@outfitter/tooling-5xxctk9b.js";
25
+ import"../shared/@outfitter/tooling-jnrs9rqd.js";
26
+ export {
27
+ tsDocCheckResultSchema,
28
+ runCheckTsdoc,
29
+ resolveJsonMode,
30
+ printCheckTsdocHuman,
31
+ packageCoverageSchema,
32
+ isExportedDeclaration,
33
+ getDeclarationName,
34
+ getDeclarationKind,
35
+ declarationCoverageSchema,
36
+ coverageSummarySchema,
37
+ coverageLevelSchema,
38
+ classifyDeclaration,
39
+ calculateCoverage,
40
+ analyzeSourceFile,
41
+ analyzeCheckTsdoc
42
+ };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * CLI check command - Run linting checks (wraps ultracite)
3
+ */
4
+ /** Options for the check command */
5
+ interface CheckOptions {
6
+ paths?: string[];
7
+ }
8
+ /**
9
+ * Build the ultracite check command
10
+ * @param options - Command options
11
+ * @returns Array of command arguments
12
+ */
13
+ declare function buildCheckCommand(options: CheckOptions): string[];
14
+ /**
15
+ * Run the check command
16
+ * @param paths - Paths to check
17
+ */
18
+ declare function runCheck(paths?: string[]): Promise<void>;
19
+ export { runCheck, buildCheckCommand };
@@ -0,0 +1,10 @@
1
+ // @bun
2
+ import {
3
+ buildCheckCommand,
4
+ runCheck
5
+ } from "../shared/@outfitter/tooling-a4bfx4be.js";
6
+ import"../shared/@outfitter/tooling-jnrs9rqd.js";
7
+ export {
8
+ runCheck,
9
+ buildCheckCommand
10
+ };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * CLI fix command - Fix linting issues (wraps ultracite)
3
+ */
4
+ /** Options for the fix command */
5
+ interface FixOptions {
6
+ paths?: string[];
7
+ }
8
+ /**
9
+ * Build the ultracite fix command
10
+ * @param options - Command options
11
+ * @returns Array of command arguments
12
+ */
13
+ declare function buildFixCommand(options: FixOptions): string[];
14
+ /**
15
+ * Run the fix command
16
+ * @param paths - Paths to fix
17
+ */
18
+ declare function runFix(paths?: string[]): Promise<void>;
19
+ export { runFix, buildFixCommand };
@@ -0,0 +1,10 @@
1
+ // @bun
2
+ import {
3
+ buildFixCommand,
4
+ runFix
5
+ } from "../shared/@outfitter/tooling-1hez6j9d.js";
6
+ import"../shared/@outfitter/tooling-jnrs9rqd.js";
7
+ export {
8
+ runFix,
9
+ buildFixCommand
10
+ };