@outfitter/tooling 0.3.0 → 0.3.4

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 (53) hide show
  1. package/.markdownlint-cli2.jsonc +55 -55
  2. package/README.md +21 -21
  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.js +2 -2
  6. package/dist/cli/check-bunup-registry.js +2 -2
  7. package/dist/cli/check-changeset.js +2 -2
  8. package/dist/cli/check-clean-tree.js +2 -2
  9. package/dist/cli/check-exports.js +2 -2
  10. package/dist/cli/check-markdown-links.d.ts +42 -0
  11. package/dist/cli/check-markdown-links.js +13 -0
  12. package/dist/cli/check-readme-imports.d.ts +2 -3
  13. package/dist/cli/check-readme-imports.js +4 -4
  14. package/dist/cli/check-tsdoc.js +2 -2
  15. package/dist/cli/check.js +2 -2
  16. package/dist/cli/fix.js +2 -2
  17. package/dist/cli/index.js +49 -1221
  18. package/dist/cli/init.js +2 -2
  19. package/dist/cli/pre-push.d.ts +13 -1
  20. package/dist/cli/pre-push.js +5 -3
  21. package/dist/cli/upgrade-bun.js +3 -2
  22. package/dist/index.d.ts +6 -186
  23. package/dist/index.js +4 -42
  24. package/dist/registry/build.d.ts +1 -3
  25. package/dist/registry/build.js +187 -58
  26. package/dist/registry/index.js +1 -13
  27. package/dist/registry/schema.js +22 -6
  28. package/dist/shared/@outfitter/{tooling-9errkcvk.js → tooling-1hez6j9d.js} +1 -1
  29. package/dist/shared/@outfitter/{tooling-cj5vsa9k.js → tooling-6cxfdx0q.js} +21 -18
  30. package/dist/shared/@outfitter/{tooling-qk5xgmxr.js → tooling-875svjnz.js} +5 -4
  31. package/dist/shared/@outfitter/{tooling-mxwc1n8w.js → tooling-9ram55dd.js} +4 -3
  32. package/dist/shared/@outfitter/{tooling-0x5q15ec.js → tooling-a4bfx4be.js} +1 -1
  33. package/dist/shared/@outfitter/{tooling-r9976n43.js → tooling-amrbp7cm.js} +6 -4
  34. package/dist/shared/@outfitter/{tooling-2n2dpsaa.js → tooling-d363b88r.js} +38 -12
  35. package/dist/shared/@outfitter/{tooling-1y8w5ahg.js → tooling-gcdvsqqp.js} +7 -4
  36. package/dist/shared/@outfitter/{tooling-enjcenja.js → tooling-h04te11c.js} +6 -4
  37. package/dist/shared/@outfitter/tooling-ja1zg5yc.js +214 -0
  38. package/dist/shared/@outfitter/tooling-mkynjra9.js +23 -0
  39. package/dist/shared/@outfitter/{tooling-9yzd08v1.js → tooling-pq47jv6t.js} +72 -5
  40. package/dist/shared/@outfitter/tooling-vjmhvpjq.d.ts +29 -0
  41. package/dist/shared/@outfitter/{tooling-t17gnh9b.js → tooling-wwm97f47.js} +8 -5
  42. package/dist/version.js +1 -1
  43. package/package.json +134 -130
  44. package/registry/registry.json +18 -11
  45. package/tsconfig.preset.bun.json +5 -5
  46. package/tsconfig.preset.json +33 -33
  47. package/biome.json +0 -81
  48. package/dist/shared/@outfitter/tooling-kcvs6mys.js +0 -1
  49. package/dist/shared/@outfitter/tooling-wv09k6hr.js +0 -23
  50. package/dist/shared/chunk-3s189drz.js +0 -4
  51. package/dist/shared/chunk-7tdgbqb0.js +0 -197
  52. package/dist/shared/chunk-cmde0fwx.js +0 -421
  53. /package/dist/shared/@outfitter/{tooling-dvwh9qve.js → tooling-jnrs9rqd.js} +0 -0
@@ -1,66 +1,66 @@
1
1
  {
2
- // Outfitter markdownlint preset
3
- // https://github.com/DavidAnson/markdownlint
2
+ // Outfitter markdownlint preset
3
+ // https://github.com/DavidAnson/markdownlint
4
4
 
5
- "config": {
6
- // Headings
7
- "MD003": { "style": "atx" }, // ATX-style headings (# Heading)
8
- "MD022": { "lines_above": 1, "lines_below": 1 }, // Blank lines around headings
9
- "MD024": { "siblings_only": true }, // Allow duplicate headings in different sections
10
- "MD041": false, // First line doesn't need to be h1 (frontmatter, etc.)
5
+ "config": {
6
+ // Headings
7
+ "MD003": { "style": "atx" }, // ATX-style headings (# Heading)
8
+ "MD022": { "lines_above": 1, "lines_below": 1 }, // Blank lines around headings
9
+ "MD024": { "siblings_only": true }, // Allow duplicate headings in different sections
10
+ "MD041": false, // First line doesn't need to be h1 (frontmatter, etc.)
11
11
 
12
- // Line length - disabled for prose flexibility
13
- "MD013": false,
12
+ // Line length - disabled for prose flexibility
13
+ "MD013": false,
14
14
 
15
- // Lists
16
- "MD004": { "style": "dash" }, // Unordered list style: dash (-)
17
- "MD007": { "indent": 2 }, // List indentation: 2 spaces
18
- "MD032": true, // Blank lines around lists
15
+ // Lists
16
+ "MD004": { "style": "dash" }, // Unordered list style: dash (-)
17
+ "MD007": { "indent": 2 }, // List indentation: 2 spaces
18
+ "MD032": true, // Blank lines around lists
19
19
 
20
- // Code blocks
21
- "MD040": true, // Fenced code blocks should have a language
22
- "MD046": { "style": "fenced" }, // Code block style: fenced (```)
23
- "MD048": { "style": "backtick" }, // Code fence style: backticks
20
+ // Code blocks
21
+ "MD040": true, // Fenced code blocks should have a language
22
+ "MD046": { "style": "fenced" }, // Code block style: fenced (```)
23
+ "MD048": { "style": "backtick" }, // Code fence style: backticks
24
24
 
25
- // Links
26
- "MD034": true, // No bare URLs (use <url> or [text](url))
25
+ // Links
26
+ "MD034": true, // No bare URLs (use <url> or [text](url))
27
27
 
28
- // Whitespace
29
- "MD009": { "br_spaces": 2 }, // Allow 2 trailing spaces for <br>
30
- "MD010": { "spaces_per_tab": 2 }, // Tabs to spaces
31
- "MD012": { "maximum": 1 }, // Max 1 consecutive blank line
32
- "MD047": true, // Files should end with newline
28
+ // Whitespace
29
+ "MD009": { "br_spaces": 2 }, // Allow 2 trailing spaces for <br>
30
+ "MD010": { "spaces_per_tab": 2 }, // Tabs to spaces
31
+ "MD012": { "maximum": 1 }, // Max 1 consecutive blank line
32
+ "MD047": true, // Files should end with newline
33
33
 
34
- // HTML - allow for GitHub-specific elements
35
- "MD033": {
36
- "allowed_elements": [
37
- "details",
38
- "summary",
39
- "kbd",
40
- "br",
41
- "sup",
42
- "sub",
43
- "img",
44
- "picture",
45
- "source",
46
- "a"
47
- ]
48
- },
34
+ // HTML - allow for GitHub-specific elements
35
+ "MD033": {
36
+ "allowed_elements": [
37
+ "details",
38
+ "summary",
39
+ "kbd",
40
+ "br",
41
+ "sup",
42
+ "sub",
43
+ "img",
44
+ "picture",
45
+ "source",
46
+ "a",
47
+ ],
48
+ },
49
49
 
50
- // Emphasis
51
- "MD049": { "style": "asterisk" }, // Emphasis style: *italic*
52
- "MD050": { "style": "asterisk" } // Strong style: **bold**
53
- },
50
+ // Emphasis
51
+ "MD049": { "style": "asterisk" }, // Emphasis style: *italic*
52
+ "MD050": { "style": "asterisk" }, // Strong style: **bold**
53
+ },
54
54
 
55
- // Ignore patterns
56
- "ignores": [
57
- "node_modules/**",
58
- "**/node_modules/**",
59
- "dist/**",
60
- "**/dist/**",
61
- ".turbo/**",
62
- "**/.turbo/**",
63
- "CHANGELOG.md",
64
- "**/CHANGELOG.md"
65
- ]
55
+ // Ignore patterns
56
+ "ignores": [
57
+ "node_modules/**",
58
+ "**/node_modules/**",
59
+ "dist/**",
60
+ "**/dist/**",
61
+ ".turbo/**",
62
+ "**/.turbo/**",
63
+ "CHANGELOG.md",
64
+ "**/CHANGELOG.md",
65
+ ],
66
66
  }
package/README.md CHANGED
@@ -4,7 +4,7 @@ Dev tooling configuration presets and CLI for Outfitter projects.
4
4
 
5
5
  ## Features
6
6
 
7
- - **Configuration Presets**: Biome, TypeScript, Lefthook, and markdownlint configs
7
+ - **Configuration Presets**: oxlint, TypeScript, Lefthook, and markdownlint configs
8
8
  - **CLI Commands**: Initialize configs, upgrade Bun, TDD-aware pre-push hooks
9
9
  - **Registry System**: Composable config blocks for scaffolding
10
10
 
@@ -15,7 +15,8 @@ bun add -D @outfitter/tooling
15
15
  ```
16
16
 
17
17
  Peer dependencies (optional):
18
- - `ultracite` — Biome wrapper for formatting/linting
18
+
19
+ - `ultracite` — oxlint/oxfmt wrapper for formatting/linting
19
20
  - `lefthook` — Git hooks
20
21
  - `markdownlint-cli2` — Markdown linting
21
22
 
@@ -23,7 +24,7 @@ Peer dependencies (optional):
23
24
 
24
25
  ### `tooling init`
25
26
 
26
- Initialize tooling configuration in the current project. Copies preset configs for Biome, TypeScript, Lefthook, and markdownlint.
27
+ Initialize tooling configuration in the current project. Copies preset configs for oxlint, TypeScript, Lefthook, and markdownlint.
27
28
 
28
29
  ```bash
29
30
  bunx @outfitter/tooling init
@@ -50,6 +51,7 @@ bunx @outfitter/tooling fix src/
50
51
  ### `tooling upgrade-bun [version]`
51
52
 
52
53
  Upgrade Bun version across the project. Updates:
54
+
53
55
  - `.bun-version`
54
56
  - `engines.bun` in all package.json files
55
57
  - `@types/bun` dependency versions (leaves "latest" alone)
@@ -71,11 +73,13 @@ bunx @outfitter/tooling upgrade-bun 1.4.0 --no-install
71
73
  TDD-aware pre-push strict verification hook. Detects RED phase branches and skips verification by design.
72
74
 
73
75
  RED phase branches follow these patterns:
76
+
74
77
  - `*-tests` (e.g., `feature/auth-tests`)
75
78
  - `*/tests` (e.g., `feature/auth/tests`)
76
79
  - `*_tests` (e.g., `feature/auth_tests`)
77
80
 
78
81
  Verification order:
82
+
79
83
  1. Run `verify:ci` if present.
80
84
  2. Otherwise run strict fallback: `typecheck`, `check|lint`, `build`, `test`.
81
85
 
@@ -169,16 +173,6 @@ bunx @outfitter/tooling check-readme-imports --json
169
173
 
170
174
  ## Configuration Presets
171
175
 
172
- ### Biome
173
-
174
- Extends our Biome config in your `biome.json`:
175
-
176
- ```json
177
- {
178
- "extends": ["@outfitter/tooling/biome.json"]
179
- }
180
- ```
181
-
182
176
  ### TypeScript
183
177
 
184
178
  Extends our TypeScript config in your `tsconfig.json`:
@@ -207,6 +201,7 @@ extends:
207
201
  ```
208
202
 
209
203
  Default hooks:
204
+
210
205
  - **pre-commit**: Runs ultracite on staged files, typechecks
211
206
  - **pre-push**: Runs TDD-aware strict verification via `tooling pre-push`
212
207
 
@@ -224,8 +219,9 @@ cp node_modules/@outfitter/tooling/.markdownlint-cli2.jsonc .
224
219
  The tooling package includes a registry of composable config blocks for the `outfitter` CLI scaffolding system.
225
220
 
226
221
  Available blocks:
222
+
227
223
  - `claude` — Claude Code settings and hooks
228
- - `biome` — Biome/Ultracite configuration
224
+ - `linter` — oxlint/Ultracite configuration
229
225
  - `lefthook` — Git hooks configuration
230
226
  - `markdownlint` — Markdown linting configuration
231
227
  - `bootstrap` — Project bootstrap script
@@ -245,13 +241,17 @@ bun run apps/outfitter/src/cli.ts repo check boundary-invocations --cwd .
245
241
 
246
242
  ## Exports
247
243
 
248
- | Export | Description |
249
- |--------|-------------|
250
- | `./biome.json` | Biome configuration preset |
251
- | `./tsconfig.preset.json` | TypeScript preset (general) |
252
- | `./tsconfig.preset.bun.json` | TypeScript preset (Bun) |
253
- | `./lefthook.yml` | Lefthook hooks configuration |
254
- | `./.markdownlint-cli2.jsonc` | markdownlint configuration |
244
+ | Export | Description |
245
+ | ---------------------------- | -------------------------------------- |
246
+ | `./registry` | Tooling block registry API |
247
+ | `./tsconfig` | Alias for `./tsconfig.preset.json` |
248
+ | `./tsconfig-bun` | Alias for `./tsconfig.preset.bun.json` |
249
+ | `./tsconfig.preset.json` | TypeScript preset (general) |
250
+ | `./tsconfig.preset.bun.json` | TypeScript preset (Bun) |
251
+ | `./lefthook` | Alias for `./lefthook.yml` |
252
+ | `./lefthook.yml` | Lefthook hooks configuration |
253
+ | `./.markdownlint-cli2` | Alias for `./.markdownlint-cli2.jsonc` |
254
+ | `./.markdownlint-cli2.jsonc` | markdownlint configuration |
255
255
 
256
256
  ## Related
257
257
 
@@ -0,0 +1,2 @@
1
+ import { ParsedSemver, isTypesBunVersionCompatible, parseSemver } from "./shared/@outfitter/tooling-vjmhvpjq.js";
2
+ export { parseSemver, isTypesBunVersionCompatible, ParsedSemver };
@@ -0,0 +1,10 @@
1
+ // @bun
2
+ import {
3
+ isTypesBunVersionCompatible,
4
+ parseSemver
5
+ } from "./shared/@outfitter/tooling-mkynjra9.js";
6
+ import"./shared/@outfitter/tooling-jnrs9rqd.js";
7
+ export {
8
+ parseSemver,
9
+ isTypesBunVersionCompatible
10
+ };
@@ -4,8 +4,8 @@ import {
4
4
  findBoundaryViolations,
5
5
  readScriptEntries,
6
6
  runCheckBoundaryInvocations
7
- } from "../shared/@outfitter/tooling-r9976n43.js";
8
- import"../shared/@outfitter/tooling-dvwh9qve.js";
7
+ } from "../shared/@outfitter/tooling-amrbp7cm.js";
8
+ import"../shared/@outfitter/tooling-jnrs9rqd.js";
9
9
  export {
10
10
  runCheckBoundaryInvocations,
11
11
  readScriptEntries,
@@ -3,8 +3,8 @@ import {
3
3
  extractBunupFilterName,
4
4
  findUnregisteredPackages,
5
5
  runCheckBunupRegistry
6
- } from "../shared/@outfitter/tooling-t17gnh9b.js";
7
- import"../shared/@outfitter/tooling-dvwh9qve.js";
6
+ } from "../shared/@outfitter/tooling-wwm97f47.js";
7
+ import"../shared/@outfitter/tooling-jnrs9rqd.js";
8
8
  export {
9
9
  runCheckBunupRegistry,
10
10
  findUnregisteredPackages,
@@ -7,8 +7,8 @@ import {
7
7
  parseChangesetFrontmatterPackageNames,
8
8
  parseIgnoredPackagesFromChangesetConfig,
9
9
  runCheckChangeset
10
- } from "../shared/@outfitter/tooling-cj5vsa9k.js";
11
- import"../shared/@outfitter/tooling-dvwh9qve.js";
10
+ } from "../shared/@outfitter/tooling-6cxfdx0q.js";
11
+ import"../shared/@outfitter/tooling-jnrs9rqd.js";
12
12
  export {
13
13
  runCheckChangeset,
14
14
  parseIgnoredPackagesFromChangesetConfig,
@@ -4,8 +4,8 @@ import {
4
4
  parseGitDiff,
5
5
  parseUntrackedFiles,
6
6
  runCheckCleanTree
7
- } from "../shared/@outfitter/tooling-1y8w5ahg.js";
8
- import"../shared/@outfitter/tooling-dvwh9qve.js";
7
+ } from "../shared/@outfitter/tooling-gcdvsqqp.js";
8
+ import"../shared/@outfitter/tooling-jnrs9rqd.js";
9
9
  export {
10
10
  runCheckCleanTree,
11
11
  parseUntrackedFiles,
@@ -4,8 +4,8 @@ import {
4
4
  entryToSubpath,
5
5
  resolveJsonMode,
6
6
  runCheckExports
7
- } from "../shared/@outfitter/tooling-enjcenja.js";
8
- import"../shared/@outfitter/tooling-dvwh9qve.js";
7
+ } from "../shared/@outfitter/tooling-h04te11c.js";
8
+ import"../shared/@outfitter/tooling-jnrs9rqd.js";
9
9
  export {
10
10
  runCheckExports,
11
11
  resolveJsonMode,
@@ -0,0 +1,42 @@
1
+ /** A relative link extracted from a markdown file. */
2
+ interface MarkdownLink {
3
+ /** The link target path (anchors stripped). */
4
+ readonly target: string;
5
+ /** 1-based line number where the link appears. */
6
+ readonly line: number;
7
+ }
8
+ /** A broken link with its source file context. */
9
+ interface BrokenLink {
10
+ /** Relative path of the source markdown file. */
11
+ readonly source: string;
12
+ /** The link target that could not be resolved. */
13
+ readonly target: string;
14
+ /** 1-based line number in the source file. */
15
+ readonly line: number;
16
+ }
17
+ /**
18
+ * Extract relative markdown links from content, skipping external URLs,
19
+ * bare anchors, code fences, and inline code.
20
+ *
21
+ * @param content - Raw markdown content
22
+ * @returns Array of extracted links with line numbers
23
+ */
24
+ declare function extractMarkdownLinks(content: string): MarkdownLink[];
25
+ /**
26
+ * Validate that relative links in the given markdown files resolve to
27
+ * existing files on disk.
28
+ *
29
+ * @param rootDir - Absolute path to the project root
30
+ * @param files - Relative file paths (from rootDir) to check
31
+ * @returns Array of broken links
32
+ */
33
+ declare function validateLinks(rootDir: string, files: readonly string[]): Promise<BrokenLink[]>;
34
+ /**
35
+ * Run check-markdown-links across the project.
36
+ *
37
+ * @param rootDir - Project root directory
38
+ * @param patterns - Glob patterns for file discovery (defaults to standard set)
39
+ * @returns Exit code (0 = all valid, 1 = broken links found)
40
+ */
41
+ declare function runCheckMarkdownLinks(rootDir: string, patterns?: readonly string[]): Promise<number>;
42
+ export { validateLinks, runCheckMarkdownLinks, extractMarkdownLinks, MarkdownLink, BrokenLink };
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env bun
2
+ // @bun
3
+ import {
4
+ extractMarkdownLinks,
5
+ runCheckMarkdownLinks,
6
+ validateLinks
7
+ } from "../shared/@outfitter/tooling-ja1zg5yc.js";
8
+ import"../shared/@outfitter/tooling-jnrs9rqd.js";
9
+ export {
10
+ validateLinks,
11
+ runCheckMarkdownLinks,
12
+ extractMarkdownLinks
13
+ };
@@ -53,9 +53,8 @@ declare function resolveJsonMode(options?: CheckReadmeImportsOptions): boolean;
53
53
  /**
54
54
  * Run check-readme-imports across all workspace packages.
55
55
  *
56
- * Finds README.md files in `packages/` and `docs/packages/`, extracts
57
- * import examples, and validates each subpath against the corresponding
58
- * package.json exports.
56
+ * Finds README.md files in `packages/`, extracts import examples, and
57
+ * validates each subpath against the corresponding package.json exports.
59
58
  */
60
59
  declare function runCheckReadmeImports(options?: CheckReadmeImportsOptions): Promise<void>;
61
60
  export { runCheckReadmeImports, resolveJsonMode, parseSpecifier, isExportedSubpath, extractImports, ImportExample, ImportCheckResult, ExportMap, CheckReadmeImportsOptions };
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"../shared/@outfitter/tooling-dvwh9qve.js";
2
+ import"../shared/@outfitter/tooling-jnrs9rqd.js";
3
3
 
4
4
  // packages/tooling/src/cli/check-readme-imports.ts
5
5
  import { resolve } from "path";
@@ -91,7 +91,7 @@ function resolveJsonMode(options = {}) {
91
91
  async function runCheckReadmeImports(options = {}) {
92
92
  const cwd = process.cwd();
93
93
  const readmeGlob = new Bun.Glob("**/README.md");
94
- const readmeDirs = ["packages", "docs/packages"];
94
+ const readmeDirs = ["packages"];
95
95
  const readmePaths = [];
96
96
  for (const dir of readmeDirs) {
97
97
  const fullDir = resolve(cwd, dir);
@@ -127,7 +127,7 @@ async function runCheckReadmeImports(options = {}) {
127
127
  }
128
128
  const results = [];
129
129
  let hasInvalid = false;
130
- for (const readmePath of readmePaths.sort()) {
130
+ for (const readmePath of readmePaths.toSorted()) {
131
131
  const content = await Bun.file(readmePath).text();
132
132
  const relativePath = readmePath.replace(`${cwd}/`, "");
133
133
  const imports = extractImports(content, relativePath);
@@ -187,7 +187,7 @@ async function runCheckReadmeImports(options = {}) {
187
187
  `);
188
188
  }
189
189
  }
190
- process.exit(hasInvalid ? 1 : 0);
190
+ process.exitCode = hasInvalid ? 1 : 0;
191
191
  }
192
192
  export {
193
193
  runCheckReadmeImports,
@@ -15,8 +15,8 @@ import {
15
15
  resolveJsonMode,
16
16
  runCheckTsdoc,
17
17
  tsDocCheckResultSchema
18
- } from "../shared/@outfitter/tooling-qk5xgmxr.js";
19
- import"../shared/@outfitter/tooling-dvwh9qve.js";
18
+ } from "../shared/@outfitter/tooling-875svjnz.js";
19
+ import"../shared/@outfitter/tooling-jnrs9rqd.js";
20
20
  export {
21
21
  tsDocCheckResultSchema,
22
22
  runCheckTsdoc,
package/dist/cli/check.js CHANGED
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  buildCheckCommand,
4
4
  runCheck
5
- } from "../shared/@outfitter/tooling-0x5q15ec.js";
6
- import"../shared/@outfitter/tooling-dvwh9qve.js";
5
+ } from "../shared/@outfitter/tooling-a4bfx4be.js";
6
+ import"../shared/@outfitter/tooling-jnrs9rqd.js";
7
7
  export {
8
8
  runCheck,
9
9
  buildCheckCommand
package/dist/cli/fix.js CHANGED
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  buildFixCommand,
4
4
  runFix
5
- } from "../shared/@outfitter/tooling-9errkcvk.js";
6
- import"../shared/@outfitter/tooling-dvwh9qve.js";
5
+ } from "../shared/@outfitter/tooling-1hez6j9d.js";
6
+ import"../shared/@outfitter/tooling-jnrs9rqd.js";
7
7
  export {
8
8
  runFix,
9
9
  buildFixCommand