@outfitter/tooling 0.2.3 → 0.3.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.
Files changed (35) hide show
  1. package/README.md +69 -1
  2. package/biome.json +1 -1
  3. package/dist/cli/check-changeset.d.ts +12 -10
  4. package/dist/cli/check-changeset.js +7 -1
  5. package/dist/cli/check-exports.d.ts +2 -2
  6. package/dist/cli/check-exports.js +3 -1
  7. package/dist/cli/check-readme-imports.d.ts +3 -2
  8. package/dist/cli/check-readme-imports.js +5 -1
  9. package/dist/cli/check-tsdoc.d.ts +2 -0
  10. package/dist/cli/check-tsdoc.js +36 -0
  11. package/dist/cli/index.js +208 -51
  12. package/dist/cli/pre-push.d.ts +8 -1
  13. package/dist/cli/pre-push.js +6 -1
  14. package/dist/index.d.ts +79 -4
  15. package/dist/index.js +17 -6
  16. package/dist/registry/build.d.ts +1 -1
  17. package/dist/registry/build.js +8 -5
  18. package/dist/registry/index.d.ts +2 -2
  19. package/dist/registry/index.js +1 -1
  20. package/dist/registry/schema.d.ts +1 -1
  21. package/dist/registry/schema.js +1 -1
  22. package/dist/shared/@outfitter/{tooling-8sd32ts6.js → tooling-2n2dpsaa.js} +48 -2
  23. package/dist/shared/@outfitter/tooling-cj5vsa9k.js +184 -0
  24. package/dist/shared/@outfitter/{tooling-tf22zt9p.js → tooling-enjcenja.js} +5 -2
  25. package/dist/shared/@outfitter/tooling-njw4z34x.d.ts +140 -0
  26. package/dist/shared/@outfitter/tooling-qk5xgmxr.js +405 -0
  27. package/dist/shared/@outfitter/{tooling-q0d60xb3.d.ts → tooling-wesswf21.d.ts} +2 -1
  28. package/dist/shared/@outfitter/{tooling-g83d0kjv.js → tooling-wv09k6hr.js} +3 -3
  29. package/dist/shared/{chunk-6a7tjcgm.js → chunk-7tdgbqb0.js} +5 -1
  30. package/dist/shared/chunk-cmde0fwx.js +421 -0
  31. package/dist/version.d.ts +1 -1
  32. package/package.json +14 -6
  33. package/registry/registry.json +6 -6
  34. package/dist/shared/@outfitter/tooling-3w8vr2w3.js +0 -94
  35. package/dist/shared/chunk-8aenrm6f.js +0 -18
package/README.md CHANGED
@@ -98,6 +98,75 @@ bunx @outfitter/tooling check-boundary-invocations
98
98
  When this fails, replace direct source execution with canonical command surfaces
99
99
  (`outfitter repo ...` in monorepo scripts, or package bins for standalone use).
100
100
 
101
+ ### `tooling check-bunup-registry`
102
+
103
+ Validate that packages using `bunup --filter` are registered in `bunup.config.ts`.
104
+
105
+ ```bash
106
+ bunx @outfitter/tooling check-bunup-registry
107
+ ```
108
+
109
+ ### `tooling check-changeset`
110
+
111
+ Validate that PRs touching package source include a changeset.
112
+
113
+ ```bash
114
+ bunx @outfitter/tooling check-changeset
115
+
116
+ # Skip the check (e.g. for non-package changes)
117
+ bunx @outfitter/tooling check-changeset --skip
118
+ ```
119
+
120
+ ### `tooling check-exports`
121
+
122
+ Validate that `package.json` exports match source entry points.
123
+
124
+ ```bash
125
+ bunx @outfitter/tooling check-exports
126
+
127
+ # Machine-readable output
128
+ bunx @outfitter/tooling check-exports --json
129
+ ```
130
+
131
+ ### `tooling check-tsdoc`
132
+
133
+ Check TSDoc coverage on exported declarations.
134
+
135
+ ```bash
136
+ bunx @outfitter/tooling check-tsdoc
137
+
138
+ # Check specific packages
139
+ bunx @outfitter/tooling check-tsdoc packages/cli packages/contracts
140
+
141
+ # Strict mode with coverage threshold
142
+ bunx @outfitter/tooling check-tsdoc --strict --min-coverage 80
143
+
144
+ # JSON output
145
+ bunx @outfitter/tooling check-tsdoc --json
146
+ ```
147
+
148
+ ### `tooling check-clean-tree`
149
+
150
+ Assert the working tree is clean (no modified or untracked files).
151
+
152
+ ```bash
153
+ bunx @outfitter/tooling check-clean-tree
154
+
155
+ # Check specific paths only
156
+ bunx @outfitter/tooling check-clean-tree --paths packages/cli packages/contracts
157
+ ```
158
+
159
+ ### `tooling check-readme-imports`
160
+
161
+ Validate that README import examples match package exports.
162
+
163
+ ```bash
164
+ bunx @outfitter/tooling check-readme-imports
165
+
166
+ # Machine-readable output
167
+ bunx @outfitter/tooling check-readme-imports --json
168
+ ```
169
+
101
170
  ## Configuration Presets
102
171
 
103
172
  ### Biome
@@ -188,7 +257,6 @@ bun run apps/outfitter/src/cli.ts repo check boundary-invocations --cwd .
188
257
 
189
258
  - [@outfitter/contracts](../contracts/README.md) — Result types and error patterns
190
259
  - [@outfitter/cli](../cli/README.md) — CLI framework
191
- - [@outfitter/kit](../kit/README.md) — Version coordination
192
260
 
193
261
  ## License
194
262
 
package/biome.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.3.12/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.4.4/schema.json",
3
3
  "root": false,
4
4
  "javascript": {
5
5
  "globals": ["Bun"]
@@ -1,17 +1,12 @@
1
- /**
2
- * Check-changeset command — validates PRs touching package source include a changeset.
3
- *
4
- * Pure core functions for detecting changed packages and verifying changeset
5
- * presence. The CLI runner in {@link runCheckChangeset} handles git discovery
6
- * and output.
7
- *
8
- * @packageDocumentation
9
- */
10
1
  /** Result of checking whether changesets are required */
11
2
  interface ChangesetCheckResult {
12
3
  readonly ok: boolean;
13
4
  readonly missingFor: string[];
14
5
  }
6
+ interface ChangesetIgnoredReference {
7
+ readonly file: string;
8
+ readonly packages: string[];
9
+ }
15
10
  /**
16
11
  * Extract unique package names from changed file paths.
17
12
  *
@@ -44,6 +39,13 @@ declare function getChangedChangesetFiles(files: string[]): string[];
44
39
  * @param changesetFiles - Changeset filenames found in `.changeset/`
45
40
  */
46
41
  declare function checkChangesetRequired(changedPackages: string[], changesetFiles: string[]): ChangesetCheckResult;
42
+ declare function parseIgnoredPackagesFromChangesetConfig(jsonContent: string): string[];
43
+ declare function parseChangesetFrontmatterPackageNames(markdownContent: string): string[];
44
+ declare function findIgnoredPackageReferences(input: {
45
+ readonly changesetFiles: readonly string[];
46
+ readonly ignoredPackages: readonly string[];
47
+ readonly readChangesetFile: (filename: string) => string;
48
+ }): ChangesetIgnoredReference[];
47
49
  interface CheckChangesetOptions {
48
50
  readonly skip?: boolean;
49
51
  }
@@ -61,4 +63,4 @@ interface CheckChangesetOptions {
61
63
  * - Git diff fails (local dev without origin)
62
64
  */
63
65
  declare function runCheckChangeset(options?: CheckChangesetOptions): Promise<void>;
64
- export { runCheckChangeset, getChangedPackagePaths, getChangedChangesetFiles, checkChangesetRequired, CheckChangesetOptions, ChangesetCheckResult };
66
+ export { runCheckChangeset, parseIgnoredPackagesFromChangesetConfig, parseChangesetFrontmatterPackageNames, getChangedPackagePaths, getChangedChangesetFiles, findIgnoredPackageReferences, checkChangesetRequired, CheckChangesetOptions, ChangesetIgnoredReference, ChangesetCheckResult };
@@ -1,14 +1,20 @@
1
1
  // @bun
2
2
  import {
3
3
  checkChangesetRequired,
4
+ findIgnoredPackageReferences,
4
5
  getChangedChangesetFiles,
5
6
  getChangedPackagePaths,
7
+ parseChangesetFrontmatterPackageNames,
8
+ parseIgnoredPackagesFromChangesetConfig,
6
9
  runCheckChangeset
7
- } from "../shared/@outfitter/tooling-3w8vr2w3.js";
10
+ } from "../shared/@outfitter/tooling-cj5vsa9k.js";
8
11
  import"../shared/@outfitter/tooling-dvwh9qve.js";
9
12
  export {
10
13
  runCheckChangeset,
14
+ parseIgnoredPackagesFromChangesetConfig,
15
+ parseChangesetFrontmatterPackageNames,
11
16
  getChangedPackagePaths,
12
17
  getChangedChangesetFiles,
18
+ findIgnoredPackageReferences,
13
19
  checkChangesetRequired
14
20
  };
@@ -1,2 +1,2 @@
1
- import { CheckExportsOptions, CheckResult, CompareInput, ExportDrift, ExportMap, PackageResult, compareExports, entryToSubpath, runCheckExports } from "../shared/@outfitter/tooling-q0d60xb3";
2
- export { runCheckExports, entryToSubpath, compareExports, PackageResult, ExportMap, ExportDrift, CompareInput, CheckResult, CheckExportsOptions };
1
+ import { CheckExportsOptions, CheckResult, CompareInput, ExportDrift, ExportMap, PackageResult, compareExports, entryToSubpath, resolveJsonMode, runCheckExports } from "../shared/@outfitter/tooling-wesswf21.js";
2
+ export { runCheckExports, resolveJsonMode, entryToSubpath, compareExports, PackageResult, ExportMap, ExportDrift, CompareInput, CheckResult, CheckExportsOptions };
@@ -2,11 +2,13 @@
2
2
  import {
3
3
  compareExports,
4
4
  entryToSubpath,
5
+ resolveJsonMode,
5
6
  runCheckExports
6
- } from "../shared/@outfitter/tooling-tf22zt9p.js";
7
+ } from "../shared/@outfitter/tooling-enjcenja.js";
7
8
  import"../shared/@outfitter/tooling-dvwh9qve.js";
8
9
  export {
9
10
  runCheckExports,
11
+ resolveJsonMode,
10
12
  entryToSubpath,
11
13
  compareExports
12
14
  };
@@ -1,4 +1,4 @@
1
- import { ExportMap } from "../shared/@outfitter/tooling-q0d60xb3";
1
+ import { ExportMap } from "../shared/@outfitter/tooling-wesswf21.js";
2
2
  /** An import example extracted from a markdown code block */
3
3
  interface ImportExample {
4
4
  /** Package name, e.g. "@outfitter/cli" */
@@ -49,6 +49,7 @@ declare function isExportedSubpath(subpath: string, exports: ExportMap): boolean
49
49
  interface CheckReadmeImportsOptions {
50
50
  readonly json?: boolean;
51
51
  }
52
+ declare function resolveJsonMode(options?: CheckReadmeImportsOptions): boolean;
52
53
  /**
53
54
  * Run check-readme-imports across all workspace packages.
54
55
  *
@@ -57,4 +58,4 @@ interface CheckReadmeImportsOptions {
57
58
  * package.json exports.
58
59
  */
59
60
  declare function runCheckReadmeImports(options?: CheckReadmeImportsOptions): Promise<void>;
60
- export { runCheckReadmeImports, parseSpecifier, isExportedSubpath, extractImports, ImportExample, ImportCheckResult, ExportMap, CheckReadmeImportsOptions };
61
+ export { runCheckReadmeImports, resolveJsonMode, parseSpecifier, isExportedSubpath, extractImports, ImportExample, ImportCheckResult, ExportMap, CheckReadmeImportsOptions };
@@ -85,6 +85,9 @@ var COLORS = {
85
85
  blue: "\x1B[34m",
86
86
  dim: "\x1B[2m"
87
87
  };
88
+ function resolveJsonMode(options = {}) {
89
+ return options.json ?? process.env["OUTFITTER_JSON"] === "1";
90
+ }
88
91
  async function runCheckReadmeImports(options = {}) {
89
92
  const cwd = process.cwd();
90
93
  const readmeGlob = new Bun.Glob("**/README.md");
@@ -151,7 +154,7 @@ async function runCheckReadmeImports(options = {}) {
151
154
  hasInvalid = true;
152
155
  }
153
156
  }
154
- if (options.json) {
157
+ if (resolveJsonMode(options)) {
155
158
  const output = {
156
159
  ok: !hasInvalid,
157
160
  files: results
@@ -188,6 +191,7 @@ async function runCheckReadmeImports(options = {}) {
188
191
  }
189
192
  export {
190
193
  runCheckReadmeImports,
194
+ resolveJsonMode,
191
195
  parseSpecifier,
192
196
  isExportedSubpath,
193
197
  extractImports
@@ -0,0 +1,2 @@
1
+ import { CheckTsDocOptions, CoverageLevel, CoverageSummary, DeclarationCoverage, PackageCoverage, TsDocCheckResult, analyzeCheckTsdoc, analyzeSourceFile, calculateCoverage, classifyDeclaration, coverageLevelSchema, coverageSummarySchema, declarationCoverageSchema, getDeclarationKind, getDeclarationName, isExportedDeclaration, packageCoverageSchema, printCheckTsdocHuman, resolveJsonMode, runCheckTsdoc, tsDocCheckResultSchema } from "../shared/@outfitter/tooling-njw4z34x.js";
2
+ 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,36 @@
1
+ // @bun
2
+ import {
3
+ analyzeCheckTsdoc,
4
+ analyzeSourceFile,
5
+ calculateCoverage,
6
+ classifyDeclaration,
7
+ coverageLevelSchema,
8
+ coverageSummarySchema,
9
+ declarationCoverageSchema,
10
+ getDeclarationKind,
11
+ getDeclarationName,
12
+ isExportedDeclaration,
13
+ packageCoverageSchema,
14
+ printCheckTsdocHuman,
15
+ resolveJsonMode,
16
+ runCheckTsdoc,
17
+ tsDocCheckResultSchema
18
+ } from "../shared/@outfitter/tooling-qk5xgmxr.js";
19
+ import"../shared/@outfitter/tooling-dvwh9qve.js";
20
+ export {
21
+ tsDocCheckResultSchema,
22
+ runCheckTsdoc,
23
+ resolveJsonMode,
24
+ printCheckTsdocHuman,
25
+ packageCoverageSchema,
26
+ isExportedDeclaration,
27
+ getDeclarationName,
28
+ getDeclarationKind,
29
+ declarationCoverageSchema,
30
+ coverageSummarySchema,
31
+ coverageLevelSchema,
32
+ classifyDeclaration,
33
+ calculateCoverage,
34
+ analyzeSourceFile,
35
+ analyzeCheckTsdoc
36
+ };