@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
package/dist/cli/init.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  buildUltraciteCommand,
4
4
  detectFrameworks,
5
5
  runInit
6
- } from "../shared/@outfitter/tooling-mxwc1n8w.js";
7
- import"../shared/@outfitter/tooling-dvwh9qve.js";
6
+ } from "../shared/@outfitter/tooling-9ram55dd.js";
7
+ import"../shared/@outfitter/tooling-jnrs9rqd.js";
8
8
  export {
9
9
  runInit,
10
10
  detectFrameworks,
@@ -38,6 +38,18 @@ type VerificationPlan = {
38
38
  * 2) fallback sequence: `typecheck`, `check|lint`, `build`, `test`
39
39
  */
40
40
  declare function createVerificationPlan(scripts: ScriptMap): VerificationPlan;
41
+ interface BunVersionCheckResult {
42
+ readonly matches: boolean;
43
+ readonly expected?: string;
44
+ readonly actual?: string;
45
+ }
46
+ /**
47
+ * Check that the local Bun version matches the pinned version in ".bun-version".
48
+ *
49
+ * @param projectRoot - Directory containing ".bun-version" (defaults to cwd)
50
+ * @returns Result indicating whether versions match
51
+ */
52
+ declare function checkBunVersion(projectRoot?: string): BunVersionCheckResult;
41
53
  interface PrePushOptions {
42
54
  force?: boolean;
43
55
  }
@@ -45,4 +57,4 @@ interface PrePushOptions {
45
57
  * Main pre-push command
46
58
  */
47
59
  declare function runPrePush(options?: PrePushOptions): Promise<void>;
48
- export { runPrePush, isTestOnlyPath, isScaffoldBranch, isReleaseBranch, isRedPhaseBranch, hasPackageSourceChanges, createVerificationPlan, canBypassRedPhaseByChangedFiles, areFilesTestOnly, VerificationPlan, PushChangedFiles, PrePushOptions };
60
+ export { runPrePush, isTestOnlyPath, isScaffoldBranch, isReleaseBranch, isRedPhaseBranch, hasPackageSourceChanges, createVerificationPlan, checkBunVersion, canBypassRedPhaseByChangedFiles, areFilesTestOnly, VerificationPlan, PushChangedFiles, PrePushOptions, BunVersionCheckResult };
@@ -2,6 +2,7 @@
2
2
  import {
3
3
  areFilesTestOnly,
4
4
  canBypassRedPhaseByChangedFiles,
5
+ checkBunVersion,
5
6
  createVerificationPlan,
6
7
  hasPackageSourceChanges,
7
8
  isRedPhaseBranch,
@@ -9,9 +10,9 @@ import {
9
10
  isScaffoldBranch,
10
11
  isTestOnlyPath,
11
12
  runPrePush
12
- } from "../shared/@outfitter/tooling-2n2dpsaa.js";
13
- import"../shared/@outfitter/tooling-qk5xgmxr.js";
14
- import"../shared/@outfitter/tooling-dvwh9qve.js";
13
+ } from "../shared/@outfitter/tooling-d363b88r.js";
14
+ import"../shared/@outfitter/tooling-875svjnz.js";
15
+ import"../shared/@outfitter/tooling-jnrs9rqd.js";
15
16
  export {
16
17
  runPrePush,
17
18
  isTestOnlyPath,
@@ -20,6 +21,7 @@ export {
20
21
  isRedPhaseBranch,
21
22
  hasPackageSourceChanges,
22
23
  createVerificationPlan,
24
+ checkBunVersion,
23
25
  canBypassRedPhaseByChangedFiles,
24
26
  areFilesTestOnly
25
27
  };
@@ -1,8 +1,9 @@
1
1
  // @bun
2
2
  import {
3
3
  runUpgradeBun
4
- } from "../shared/@outfitter/tooling-9yzd08v1.js";
5
- import"../shared/@outfitter/tooling-dvwh9qve.js";
4
+ } from "../shared/@outfitter/tooling-pq47jv6t.js";
5
+ import"../shared/@outfitter/tooling-mkynjra9.js";
6
+ import"../shared/@outfitter/tooling-jnrs9rqd.js";
6
7
  export {
7
8
  runUpgradeBun
8
9
  };
package/dist/index.d.ts CHANGED
@@ -1,186 +1,6 @@
1
- import { ZodType } from "zod";
2
- /** Coverage classification for a single declaration. */
3
- type CoverageLevel = "documented" | "partial" | "undocumented";
4
- /** Result for a single exported declaration. */
5
- interface DeclarationCoverage {
6
- readonly name: string;
7
- readonly kind: string;
8
- readonly level: CoverageLevel;
9
- readonly file: string;
10
- readonly line: number;
11
- }
12
- /** Coverage summary statistics. */
13
- interface CoverageSummary {
14
- readonly documented: number;
15
- readonly partial: number;
16
- readonly undocumented: number;
17
- readonly total: number;
18
- readonly percentage: number;
19
- }
20
- /** Per-package TSDoc coverage stats. */
21
- interface PackageCoverage {
22
- readonly name: string;
23
- readonly path: string;
24
- readonly declarations: readonly DeclarationCoverage[];
25
- readonly documented: number;
26
- readonly partial: number;
27
- readonly undocumented: number;
28
- readonly total: number;
29
- readonly percentage: number;
30
- }
31
- /** Aggregated result across all packages. */
32
- interface TsDocCheckResult {
33
- readonly ok: boolean;
34
- readonly packages: readonly PackageCoverage[];
35
- readonly summary: CoverageSummary;
36
- }
37
- /** Zod schema for {@link CoverageLevel}. */
38
- declare const coverageLevelSchema: ZodType<CoverageLevel>;
39
- /** Zod schema for {@link DeclarationCoverage}. */
40
- declare const declarationCoverageSchema: ZodType<DeclarationCoverage>;
41
- /** Zod schema for {@link PackageCoverage}. */
42
- declare const packageCoverageSchema: ZodType<PackageCoverage>;
43
- /** Zod schema for {@link TsDocCheckResult}. */
44
- declare const tsDocCheckResultSchema: ZodType<TsDocCheckResult>;
45
- /** Options for the check-tsdoc command. */
46
- interface CheckTsDocOptions {
47
- readonly strict?: boolean | undefined;
48
- readonly json?: boolean | undefined;
49
- readonly minCoverage?: number | undefined;
50
- readonly cwd?: string | undefined;
51
- readonly paths?: readonly string[] | undefined;
52
- }
53
- /**
54
- * Analyze TSDoc coverage across workspace packages.
55
- *
56
- * Pure function that discovers packages, analyzes TSDoc coverage on exported
57
- * declarations, and returns the aggregated result. Does not print output or
58
- * call `process.exit()`.
59
- *
60
- * @param options - Analysis options (paths, strict mode, coverage threshold)
61
- * @returns Aggregated coverage result across all packages, or `null` if no packages found
62
- */
63
- declare function analyzeCheckTsdoc(options?: CheckTsDocOptions): TsDocCheckResult | null;
64
- /**
65
- * Print a TSDoc coverage result in human-readable format.
66
- *
67
- * Renders a bar chart per package with summary statistics. Writes to stdout/stderr.
68
- *
69
- * @param result - The coverage result to print
70
- * @param options - Display options (strict mode, coverage threshold for warning)
71
- */
72
- declare function printCheckTsdocHuman(result: TsDocCheckResult, options?: {
73
- strict?: boolean | undefined;
74
- minCoverage?: number | undefined;
75
- }): void;
76
- import { ZodType as ZodType2 } from "zod";
77
- /**
78
- * File entry in a block.
79
- */
80
- interface FileEntry {
81
- /** Destination path relative to project root */
82
- path: string;
83
- /** File contents (embedded in registry) */
84
- content: string;
85
- /** Whether to chmod +x after copying */
86
- executable?: boolean | undefined;
87
- /** Whether to process as a template (future) */
88
- template?: boolean | undefined;
89
- }
90
- /**
91
- * Schema for a file entry in a block.
92
- * Represents a file that will be copied to the user's project.
93
- */
94
- declare const FileEntrySchema: ZodType2<FileEntry>;
95
- /**
96
- * Block in the registry.
97
- */
98
- interface Block {
99
- /** Block name (matches the key in blocks record) */
100
- name: string;
101
- /** Human-readable description */
102
- description: string;
103
- /** Files included in this block */
104
- files?: FileEntry[] | undefined;
105
- /** npm dependencies to add to package.json */
106
- dependencies?: Record<string, string> | undefined;
107
- /** npm devDependencies to add to package.json */
108
- devDependencies?: Record<string, string> | undefined;
109
- /** Other blocks this block extends (for composite blocks) */
110
- extends?: string[] | undefined;
111
- }
112
- /**
113
- * Schema for a block in the registry.
114
- * A block is a collection of related files that can be added together.
115
- */
116
- declare const BlockSchema: ZodType2<Block>;
117
- /**
118
- * Complete registry structure.
119
- */
120
- interface Registry {
121
- /** Registry schema version */
122
- version: string;
123
- /** Map of block name to block definition */
124
- blocks: Record<string, Block>;
125
- }
126
- /**
127
- * Schema for the complete registry.
128
- * Contains all available blocks with their files and metadata.
129
- */
130
- declare const RegistrySchema: ZodType2<Registry>;
131
- /**
132
- * Block definition used in the build script.
133
- * Specifies how to collect source files into a block.
134
- */
135
- interface BlockDefinition {
136
- /** Human-readable description */
137
- description: string;
138
- /** Source file paths (relative to repo root) */
139
- files?: string[];
140
- /** Remap source paths to destination paths */
141
- remap?: Record<string, string>;
142
- /** npm dependencies */
143
- dependencies?: Record<string, string>;
144
- /** npm devDependencies */
145
- devDependencies?: Record<string, string>;
146
- /** Other blocks this block extends */
147
- extends?: string[];
148
- }
149
- /**
150
- * Configuration for the registry build.
151
- */
152
- interface RegistryBuildConfig {
153
- /** Registry schema version */
154
- version: string;
155
- /** Block definitions */
156
- blocks: Record<string, BlockDefinition>;
157
- }
158
- /**
159
- * Result of adding a block to a project.
160
- */
161
- interface AddBlockResult {
162
- /** Files that were created */
163
- created: string[];
164
- /** Files that were skipped (already exist) */
165
- skipped: string[];
166
- /** Files that were overwritten (with --force) */
167
- overwritten: string[];
168
- /** Dependencies added to package.json */
169
- dependencies: Record<string, string>;
170
- /** devDependencies added to package.json */
171
- devDependencies: Record<string, string>;
172
- }
173
- /**
174
- * Options for the add command.
175
- */
176
- interface AddBlockOptions {
177
- /** Overwrite existing files */
178
- force?: boolean;
179
- /** Show what would be added without making changes */
180
- dryRun?: boolean;
181
- /** Working directory (defaults to cwd) */
182
- cwd?: string;
183
- }
184
- /** Package version, read from package.json at load time. */
185
- declare const VERSION: string;
186
- export { tsDocCheckResultSchema, printCheckTsdocHuman, packageCoverageSchema, declarationCoverageSchema, coverageLevelSchema, analyzeCheckTsdoc, VERSION, TsDocCheckResult, RegistrySchema, RegistryBuildConfig, Registry, PackageCoverage, FileEntrySchema, FileEntry, DeclarationCoverage, CoverageLevel, CheckTsDocOptions, BlockSchema, BlockDefinition, Block, AddBlockResult, AddBlockOptions };
1
+ import { CheckTsDocOptions, CoverageLevel, DeclarationCoverage, PackageCoverage, TsDocCheckResult, analyzeCheckTsdoc, coverageLevelSchema, declarationCoverageSchema, packageCoverageSchema, printCheckTsdocHuman, tsDocCheckResultSchema } from "./shared/@outfitter/tooling-njw4z34x.js";
2
+ import { ParsedSemver, isTypesBunVersionCompatible, parseSemver } from "./shared/@outfitter/tooling-vjmhvpjq.js";
3
+ import { VERSION } from "./shared/@outfitter/tooling-9vs606gq.js";
4
+ import "./shared/@outfitter/tooling-xqwn46sx.js";
5
+ import { AddBlockOptions, AddBlockResult, Block, BlockDefinition, BlockSchema, FileEntry, FileEntrySchema, Registry, RegistryBuildConfig, RegistrySchema } from "./shared/@outfitter/tooling-sjm8nebx.js";
6
+ export { tsDocCheckResultSchema, printCheckTsdocHuman, parseSemver, packageCoverageSchema, isTypesBunVersionCompatible, declarationCoverageSchema, coverageLevelSchema, analyzeCheckTsdoc, VERSION, TsDocCheckResult, RegistrySchema, RegistryBuildConfig, Registry, ParsedSemver, PackageCoverage, FileEntrySchema, FileEntry, DeclarationCoverage, CoverageLevel, CheckTsDocOptions, BlockSchema, BlockDefinition, Block, AddBlockResult, AddBlockOptions };
package/dist/index.js CHANGED
@@ -1,42 +1,4 @@
1
- import {
2
- VERSION,
3
- analyzeCheckTsdoc,
4
- coverageLevelSchema,
5
- declarationCoverageSchema,
6
- packageCoverageSchema,
7
- printCheckTsdocHuman,
8
- tsDocCheckResultSchema
9
- } from "./shared/chunk-cmde0fwx.js";
10
- import"./shared/chunk-3s189drz.js";
11
- // src/registry/schema.ts
12
- import { z } from "zod";
13
- var FileEntrySchema = z.object({
14
- path: z.string().min(1),
15
- content: z.string(),
16
- executable: z.boolean().optional(),
17
- template: z.boolean().optional()
18
- });
19
- var BlockSchema = z.object({
20
- name: z.string().min(1),
21
- description: z.string().min(1),
22
- files: z.array(FileEntrySchema).optional(),
23
- dependencies: z.record(z.string(), z.string()).optional(),
24
- devDependencies: z.record(z.string(), z.string()).optional(),
25
- extends: z.array(z.string()).optional()
26
- });
27
- var RegistrySchema = z.object({
28
- version: z.string(),
29
- blocks: z.record(z.string(), BlockSchema)
30
- });
31
- export {
32
- tsDocCheckResultSchema,
33
- printCheckTsdocHuman,
34
- packageCoverageSchema,
35
- declarationCoverageSchema,
36
- coverageLevelSchema,
37
- analyzeCheckTsdoc,
38
- VERSION,
39
- RegistrySchema,
40
- FileEntrySchema,
41
- BlockSchema
42
- };
1
+ export { analyzeCheckTsdoc, coverageLevelSchema, declarationCoverageSchema, packageCoverageSchema, printCheckTsdocHuman, tsDocCheckResultSchema } from "./cli/check-tsdoc.js";
2
+ export { isTypesBunVersionCompatible, parseSemver } from "./bun-version-compat.js";
3
+ export { BlockSchema, FileEntrySchema, RegistrySchema } from "./registry/index.js";
4
+ export { VERSION } from "./version.js";
@@ -1,6 +1,4 @@
1
1
  import { RegistryBuildConfig } from "../shared/@outfitter/tooling-sjm8nebx.js";
2
- /**
3
- * Registry build configuration
4
- */
2
+ /** Registry build configuration with dynamically resolved versions. */
5
3
  declare const REGISTRY_CONFIG: RegistryBuildConfig;
6
4
  export { REGISTRY_CONFIG };
@@ -1,16 +1,104 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- import"../shared/@outfitter/tooling-dvwh9qve.js";
3
+ import"../shared/@outfitter/tooling-jnrs9rqd.js";
4
4
 
5
5
  // packages/tooling/src/registry/build.ts
6
6
  import {
7
- existsSync,
7
+ existsSync as existsSync2,
8
8
  mkdirSync,
9
- readFileSync,
10
- statSync,
9
+ readFileSync as readFileSync2,
10
+ statSync as statSync2,
11
11
  writeFileSync
12
12
  } from "fs";
13
- import { dirname, join } from "path";
13
+ import { dirname as dirname2, join as join2 } from "path";
14
+ import { fileURLToPath as fileURLToPath2 } from "url";
15
+
16
+ // packages/presets/dist/index.js
17
+ import { existsSync, readdirSync, readFileSync, statSync } from "fs";
18
+ import { dirname, isAbsolute, join, relative, resolve } from "path";
19
+ import { fileURLToPath } from "url";
20
+ var DEPENDENCY_SECTIONS = [
21
+ "dependencies",
22
+ "devDependencies",
23
+ "peerDependencies",
24
+ "optionalDependencies"
25
+ ];
26
+ function isRecord(value) {
27
+ return typeof value === "object" && value !== null && !Array.isArray(value);
28
+ }
29
+ function loadWorkspaceCatalog(packageDir) {
30
+ let dir = packageDir;
31
+ for (let i = 0;i < 10; i++) {
32
+ const rootPkgPath = join(dir, "package.json");
33
+ if (existsSync(rootPkgPath)) {
34
+ try {
35
+ const raw = JSON.parse(readFileSync(rootPkgPath, "utf-8"));
36
+ if (isRecord(raw) && isRecord(raw["catalog"])) {
37
+ const catalog = {};
38
+ for (const [name, version] of Object.entries(raw["catalog"])) {
39
+ if (typeof version === "string") {
40
+ catalog[name] = version;
41
+ }
42
+ }
43
+ return catalog;
44
+ }
45
+ } catch {}
46
+ }
47
+ const parent = dirname(dir);
48
+ if (parent === dir)
49
+ break;
50
+ dir = parent;
51
+ }
52
+ return {};
53
+ }
54
+ function getResolvedVersions() {
55
+ const packageDir = join(dirname(fileURLToPath(import.meta.url)), "..");
56
+ const packageJsonPath = join(packageDir, "package.json");
57
+ const raw = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
58
+ if (!isRecord(raw)) {
59
+ throw new Error("@outfitter/presets package.json must be a JSON object");
60
+ }
61
+ const all = {};
62
+ let hasCatalogRefs = false;
63
+ for (const section of DEPENDENCY_SECTIONS) {
64
+ const deps = raw[section];
65
+ if (!isRecord(deps))
66
+ continue;
67
+ for (const [name, version] of Object.entries(deps)) {
68
+ if (typeof version === "string") {
69
+ if (version === "catalog:") {
70
+ hasCatalogRefs = true;
71
+ } else {
72
+ all[name] = version;
73
+ }
74
+ }
75
+ }
76
+ }
77
+ if (hasCatalogRefs) {
78
+ const catalog = loadWorkspaceCatalog(packageDir);
79
+ const unresolved = [];
80
+ for (const section of DEPENDENCY_SECTIONS) {
81
+ const deps = raw[section];
82
+ if (!isRecord(deps))
83
+ continue;
84
+ for (const [name, version] of Object.entries(deps)) {
85
+ if (version === "catalog:") {
86
+ if (catalog[name]) {
87
+ all[name] = catalog[name];
88
+ } else {
89
+ unresolved.push(name);
90
+ }
91
+ }
92
+ }
93
+ }
94
+ if (unresolved.length > 0) {
95
+ throw new Error(`Unresolvable catalog: references (no catalog entry found): ${unresolved.join(", ")}`);
96
+ }
97
+ }
98
+ return { all };
99
+ }
100
+
101
+ // packages/tooling/src/registry/build.ts
14
102
  function log(message) {
15
103
  process.stdout.write(`${message}
16
104
  `);
@@ -18,31 +106,31 @@ function log(message) {
18
106
  function findRepoRoot(startDir) {
19
107
  let dir = startDir;
20
108
  while (dir !== "/") {
21
- const pkgPath = join(dir, "package.json");
22
- if (existsSync(pkgPath)) {
23
- const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
109
+ const pkgPath = join2(dir, "package.json");
110
+ if (existsSync2(pkgPath)) {
111
+ const pkg = JSON.parse(readFileSync2(pkgPath, "utf-8"));
24
112
  if (pkg.workspaces) {
25
113
  return dir;
26
114
  }
27
115
  }
28
- dir = dirname(dir);
116
+ dir = dirname2(dir);
29
117
  }
30
118
  throw new Error("Could not find repository root");
31
119
  }
32
120
  function isExecutable(filePath) {
33
121
  try {
34
- const stats = statSync(filePath);
122
+ const stats = statSync2(filePath);
35
123
  return (stats.mode & 64) !== 0;
36
124
  } catch {
37
125
  return false;
38
126
  }
39
127
  }
40
128
  function readFileEntry(repoRoot, sourcePath, destPath) {
41
- const fullPath = join(repoRoot, sourcePath);
42
- if (!existsSync(fullPath)) {
129
+ const fullPath = join2(repoRoot, sourcePath);
130
+ if (!existsSync2(fullPath)) {
43
131
  throw new Error(`Source file not found: ${fullPath}`);
44
132
  }
45
- const content = readFileSync(fullPath, "utf-8");
133
+ const content = readFileSync2(fullPath, "utf-8");
46
134
  const executable = isExecutable(fullPath);
47
135
  return {
48
136
  path: destPath,
@@ -82,56 +170,97 @@ function buildRegistry(config, repoRoot) {
82
170
  blocks
83
171
  };
84
172
  }
85
- var REGISTRY_CONFIG = {
86
- version: "1.0.0",
87
- blocks: {
88
- claude: {
89
- description: "Claude Code settings and hooks for automated formatting",
90
- files: [".claude/settings.json", ".claude/hooks/format-code-on-stop.sh"]
91
- },
92
- biome: {
93
- description: "Biome linter/formatter configuration via Ultracite",
94
- files: ["packages/tooling/biome.json"],
95
- remap: { "packages/tooling/biome.json": "biome.json" },
96
- devDependencies: { ultracite: "^7.2.3" }
97
- },
98
- lefthook: {
99
- description: "Git hooks via Lefthook for pre-commit and pre-push",
100
- files: ["packages/tooling/lefthook.yml"],
101
- remap: { "packages/tooling/lefthook.yml": ".lefthook.yml" },
102
- devDependencies: {
103
- "@outfitter/tooling": "^0.2.4",
104
- lefthook: "^2.1.1",
105
- ultracite: "^7.2.3"
106
- }
107
- },
108
- markdownlint: {
109
- description: "Markdown linting configuration via markdownlint-cli2",
110
- files: ["packages/tooling/.markdownlint-cli2.jsonc"],
111
- remap: {
112
- "packages/tooling/.markdownlint-cli2.jsonc": ".markdownlint-cli2.jsonc"
113
- }
114
- },
115
- bootstrap: {
116
- description: "Project bootstrap script for installing tools and dependencies",
117
- files: ["packages/tooling/templates/bootstrap.sh"],
118
- remap: {
119
- "packages/tooling/templates/bootstrap.sh": "scripts/bootstrap.sh"
173
+ function resolveVersion(versions, name) {
174
+ const version = versions[name];
175
+ if (!version) {
176
+ throw new Error(`Missing resolved version for "${name}" in @outfitter/presets`);
177
+ }
178
+ return version;
179
+ }
180
+ function getWorkspacePackageVersion(relativePackageJsonPath) {
181
+ const pkgPath = join2(dirname2(fileURLToPath2(import.meta.url)), relativePackageJsonPath);
182
+ const pkg = JSON.parse(readFileSync2(pkgPath, "utf-8"));
183
+ if (typeof pkg.version !== "string") {
184
+ throw new Error(`Expected version in package.json at ${pkgPath}`);
185
+ }
186
+ return `^${pkg.version}`;
187
+ }
188
+ function getToolingVersion() {
189
+ return getWorkspacePackageVersion("../../package.json");
190
+ }
191
+ function getOxlintPluginVersion() {
192
+ return getWorkspacePackageVersion("../../../oxlint-plugin/package.json");
193
+ }
194
+ function createRegistryConfig() {
195
+ const { all: versions } = getResolvedVersions();
196
+ const toolingVersion = getToolingVersion();
197
+ const oxlintPluginVersion = getOxlintPluginVersion();
198
+ return {
199
+ version: "1.0.0",
200
+ blocks: {
201
+ claude: {
202
+ description: "Claude Code settings and hooks for automated formatting",
203
+ files: [
204
+ ".claude/settings.json",
205
+ ".claude/hooks/format-code-on-stop.sh"
206
+ ]
207
+ },
208
+ linter: {
209
+ description: "Linter and formatter configuration (oxlint/oxfmt) via Ultracite",
210
+ files: [
211
+ "packages/tooling/configs/.oxlintrc.json",
212
+ "packages/tooling/configs/.oxfmtrc.jsonc"
213
+ ],
214
+ remap: {
215
+ "packages/tooling/configs/.oxlintrc.json": ".oxlintrc.json",
216
+ "packages/tooling/configs/.oxfmtrc.jsonc": ".oxfmtrc.jsonc"
217
+ },
218
+ devDependencies: {
219
+ "@outfitter/oxlint-plugin": oxlintPluginVersion,
220
+ ultracite: resolveVersion(versions, "ultracite"),
221
+ oxlint: resolveVersion(versions, "oxlint"),
222
+ oxfmt: resolveVersion(versions, "oxfmt")
223
+ }
224
+ },
225
+ lefthook: {
226
+ description: "Git hooks via Lefthook for pre-commit and pre-push",
227
+ files: ["packages/tooling/lefthook.yml"],
228
+ remap: { "packages/tooling/lefthook.yml": ".lefthook.yml" },
229
+ devDependencies: {
230
+ "@outfitter/tooling": toolingVersion,
231
+ lefthook: resolveVersion(versions, "lefthook"),
232
+ ultracite: resolveVersion(versions, "ultracite")
233
+ }
234
+ },
235
+ markdownlint: {
236
+ description: "Markdown linting configuration via markdownlint-cli2",
237
+ files: ["packages/tooling/.markdownlint-cli2.jsonc"],
238
+ remap: {
239
+ "packages/tooling/.markdownlint-cli2.jsonc": ".markdownlint-cli2.jsonc"
240
+ }
241
+ },
242
+ bootstrap: {
243
+ description: "Project bootstrap script for installing tools and dependencies",
244
+ files: ["packages/tooling/templates/bootstrap.sh"],
245
+ remap: {
246
+ "packages/tooling/templates/bootstrap.sh": "scripts/bootstrap.sh"
247
+ }
248
+ },
249
+ scaffolding: {
250
+ description: "Full starter kit: Claude settings, oxlint/oxfmt, Lefthook, markdownlint, and bootstrap script",
251
+ extends: ["claude", "linter", "lefthook", "markdownlint", "bootstrap"]
120
252
  }
121
- },
122
- scaffolding: {
123
- description: "Full starter kit: Claude settings, Biome, Lefthook, markdownlint, and bootstrap script",
124
- extends: ["claude", "biome", "lefthook", "markdownlint", "bootstrap"]
125
253
  }
126
- }
127
- };
254
+ };
255
+ }
256
+ var REGISTRY_CONFIG = createRegistryConfig();
128
257
  function main() {
129
- const scriptDir = dirname(new URL(import.meta.url).pathname);
258
+ const scriptDir = dirname2(new URL(import.meta.url).pathname);
130
259
  const repoRoot = findRepoRoot(scriptDir);
131
- const outputDir = join(repoRoot, "packages/tooling/registry");
132
- const outputPath = join(outputDir, "registry.json");
260
+ const outputDir = join2(repoRoot, "packages/tooling/registry");
261
+ const outputPath = join2(outputDir, "registry.json");
133
262
  log(`Building registry from: ${repoRoot}`);
134
- if (!existsSync(outputDir)) {
263
+ if (!existsSync2(outputDir)) {
135
264
  mkdirSync(outputDir, { recursive: true });
136
265
  }
137
266
  const registry = buildRegistry(REGISTRY_CONFIG, repoRoot);
@@ -1,13 +1 @@
1
- // @bun
2
- import"../shared/@outfitter/tooling-kcvs6mys.js";
3
- import {
4
- BlockSchema,
5
- FileEntrySchema,
6
- RegistrySchema
7
- } from "../shared/@outfitter/tooling-wv09k6hr.js";
8
- import"../shared/@outfitter/tooling-dvwh9qve.js";
9
- export {
10
- RegistrySchema,
11
- FileEntrySchema,
12
- BlockSchema
13
- };
1
+ export { BlockSchema, FileEntrySchema, RegistrySchema } from "./schema.js";
@@ -1,10 +1,26 @@
1
1
  // @bun
2
- import {
3
- BlockSchema,
4
- FileEntrySchema,
5
- RegistrySchema
6
- } from "../shared/@outfitter/tooling-wv09k6hr.js";
7
- import"../shared/@outfitter/tooling-dvwh9qve.js";
2
+ import"../shared/@outfitter/tooling-jnrs9rqd.js";
3
+
4
+ // packages/tooling/src/registry/schema.ts
5
+ import { z } from "zod";
6
+ var FileEntrySchema = z.object({
7
+ path: z.string().min(1),
8
+ content: z.string(),
9
+ executable: z.boolean().optional(),
10
+ template: z.boolean().optional()
11
+ });
12
+ var BlockSchema = z.object({
13
+ name: z.string().min(1),
14
+ description: z.string().min(1),
15
+ files: z.array(FileEntrySchema).optional(),
16
+ dependencies: z.record(z.string(), z.string()).optional(),
17
+ devDependencies: z.record(z.string(), z.string()).optional(),
18
+ extends: z.array(z.string()).optional()
19
+ });
20
+ var RegistrySchema = z.object({
21
+ version: z.string(),
22
+ blocks: z.record(z.string(), BlockSchema)
23
+ });
8
24
  export {
9
25
  RegistrySchema,
10
26
  FileEntrySchema,