@rexezuge/cli 0.0.0-stage → 1.14.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 (127) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +142 -2
  3. package/dist/args.d.ts +22 -0
  4. package/dist/args.d.ts.map +1 -0
  5. package/dist/args.js +1 -0
  6. package/dist/args.js.map +7 -0
  7. package/dist/bin.d.ts +3 -0
  8. package/dist/bin.d.ts.map +1 -0
  9. package/dist/bin.js +2 -0
  10. package/dist/bin.js.map +7 -0
  11. package/dist/cli.d.ts +13 -0
  12. package/dist/cli.d.ts.map +1 -0
  13. package/dist/cli.js +18 -0
  14. package/dist/cli.js.map +7 -0
  15. package/dist/commands/doctor.d.ts +8 -0
  16. package/dist/commands/doctor.d.ts.map +1 -0
  17. package/dist/commands/doctor.js +1 -0
  18. package/dist/commands/doctor.js.map +7 -0
  19. package/dist/commands/godFiles.d.ts +7 -0
  20. package/dist/commands/godFiles.d.ts.map +1 -0
  21. package/dist/commands/godFiles.js +1 -0
  22. package/dist/commands/godFiles.js.map +7 -0
  23. package/dist/commands/identity.d.ts +26 -0
  24. package/dist/commands/identity.d.ts.map +1 -0
  25. package/dist/commands/identity.js +4 -0
  26. package/dist/commands/identity.js.map +7 -0
  27. package/dist/commands/locales.d.ts +7 -0
  28. package/dist/commands/locales.d.ts.map +1 -0
  29. package/dist/commands/locales.js +1 -0
  30. package/dist/commands/locales.js.map +7 -0
  31. package/dist/commands/migrations.d.ts +7 -0
  32. package/dist/commands/migrations.d.ts.map +1 -0
  33. package/dist/commands/migrations.js +1 -0
  34. package/dist/commands/migrations.js.map +7 -0
  35. package/dist/commands/scripts.d.ts +25 -0
  36. package/dist/commands/scripts.d.ts.map +1 -0
  37. package/dist/commands/scripts.js +1 -0
  38. package/dist/commands/scripts.js.map +7 -0
  39. package/dist/commands/spaShell.d.ts +7 -0
  40. package/dist/commands/spaShell.d.ts.map +1 -0
  41. package/dist/commands/spaShell.js +1 -0
  42. package/dist/commands/spaShell.js.map +7 -0
  43. package/dist/commands/sync.d.ts +7 -0
  44. package/dist/commands/sync.d.ts.map +1 -0
  45. package/dist/commands/sync.js +1 -0
  46. package/dist/commands/sync.js.map +7 -0
  47. package/dist/doctor/checks/catalog.d.ts +16 -0
  48. package/dist/doctor/checks/catalog.d.ts.map +1 -0
  49. package/dist/doctor/checks/catalog.js +1 -0
  50. package/dist/doctor/checks/catalog.js.map +7 -0
  51. package/dist/doctor/checks/files.d.ts +8 -0
  52. package/dist/doctor/checks/files.d.ts.map +1 -0
  53. package/dist/doctor/checks/files.js +1 -0
  54. package/dist/doctor/checks/files.js.map +7 -0
  55. package/dist/doctor/checks/manifest.d.ts +3 -0
  56. package/dist/doctor/checks/manifest.d.ts.map +1 -0
  57. package/dist/doctor/checks/manifest.js +1 -0
  58. package/dist/doctor/checks/manifest.js.map +7 -0
  59. package/dist/doctor/checks/presets.d.ts +7 -0
  60. package/dist/doctor/checks/presets.d.ts.map +1 -0
  61. package/dist/doctor/checks/presets.js +1 -0
  62. package/dist/doctor/checks/presets.js.map +7 -0
  63. package/dist/doctor/checks/vendored.d.ts +25 -0
  64. package/dist/doctor/checks/vendored.d.ts.map +1 -0
  65. package/dist/doctor/checks/vendored.js +1 -0
  66. package/dist/doctor/checks/vendored.js.map +7 -0
  67. package/dist/doctor/extensions.d.ts +26 -0
  68. package/dist/doctor/extensions.d.ts.map +1 -0
  69. package/dist/doctor/extensions.js +1 -0
  70. package/dist/doctor/extensions.js.map +7 -0
  71. package/dist/doctor/registry.d.ts +7 -0
  72. package/dist/doctor/registry.d.ts.map +1 -0
  73. package/dist/doctor/registry.js +1 -0
  74. package/dist/doctor/registry.js.map +7 -0
  75. package/dist/doctor/run.d.ts +13 -0
  76. package/dist/doctor/run.d.ts.map +1 -0
  77. package/dist/doctor/run.js +1 -0
  78. package/dist/doctor/run.js.map +7 -0
  79. package/dist/doctor/types.d.ts +75 -0
  80. package/dist/doctor/types.d.ts.map +1 -0
  81. package/dist/doctor/types.js +0 -0
  82. package/dist/doctor/types.js.map +7 -0
  83. package/dist/index.d.ts +18 -0
  84. package/dist/index.d.ts.map +1 -0
  85. package/dist/index.js +1 -0
  86. package/dist/index.js.map +7 -0
  87. package/dist/io.d.ts +22 -0
  88. package/dist/io.d.ts.map +1 -0
  89. package/dist/io.js +3 -0
  90. package/dist/io.js.map +7 -0
  91. package/dist/repo-json.d.ts +6 -0
  92. package/dist/repo-json.d.ts.map +1 -0
  93. package/dist/repo-json.js +1 -0
  94. package/dist/repo-json.js.map +7 -0
  95. package/dist/repo.d.ts +37 -0
  96. package/dist/repo.d.ts.map +1 -0
  97. package/dist/repo.js +1 -0
  98. package/dist/repo.js.map +7 -0
  99. package/dist/sync/fixes.d.ts +12 -0
  100. package/dist/sync/fixes.d.ts.map +1 -0
  101. package/dist/sync/fixes.js +6 -0
  102. package/dist/sync/fixes.js.map +7 -0
  103. package/dist/sync/plan.d.ts +46 -0
  104. package/dist/sync/plan.d.ts.map +1 -0
  105. package/dist/sync/plan.js +3 -0
  106. package/dist/sync/plan.js.map +7 -0
  107. package/dist/sync/run.d.ts +24 -0
  108. package/dist/sync/run.d.ts.map +1 -0
  109. package/dist/sync/run.js +1 -0
  110. package/dist/sync/run.js.map +7 -0
  111. package/dist/sync/workflows.d.ts +8 -0
  112. package/dist/sync/workflows.d.ts.map +1 -0
  113. package/dist/sync/workflows.js +1 -0
  114. package/dist/sync/workflows.js.map +7 -0
  115. package/dist/version.d.ts +14 -0
  116. package/dist/version.d.ts.map +1 -0
  117. package/dist/version.js +1 -0
  118. package/dist/version.js.map +7 -0
  119. package/dist/workflow-callers.d.ts +26 -0
  120. package/dist/workflow-callers.d.ts.map +1 -0
  121. package/dist/workflow-callers.js +34 -0
  122. package/dist/workflow-callers.js.map +7 -0
  123. package/dist/workspace-yaml.d.ts +28 -0
  124. package/dist/workspace-yaml.d.ts.map +1 -0
  125. package/dist/workspace-yaml.js +12 -0
  126. package/dist/workspace-yaml.js.map +7 -0
  127. package/package.json +47 -3
package/dist/io.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Where a command writes. A seam, so a test reads the output instead of capturing a process stream.
3
+ */
4
+ export interface Io {
5
+ out(line: string): void;
6
+ err(line: string): void;
7
+ }
8
+ export declare const processIo: Io;
9
+ /**
10
+ * An `Io` that records its lines, for tests.
11
+ */
12
+ export declare function memoryIo(): Io & {
13
+ readonly stdout: string[];
14
+ readonly stderr: string[];
15
+ };
16
+ /**
17
+ * A mistake in how a command was invoked. The runner prints the message and the usage and exits 1.
18
+ */
19
+ export declare class UsageError extends Error {
20
+ constructor(message: string);
21
+ }
22
+ //# sourceMappingURL=io.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../src/io.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,EAAE;IACjB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,eAAO,MAAM,SAAS,EAAE,EAGvB,CAAC;AAEF;;GAEG;AACH,wBAAgB,QAAQ,IAAI,EAAE,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAIxF;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;gBACvB,OAAO,EAAE,MAAM;CAI5B"}
package/dist/io.js ADDED
@@ -0,0 +1,3 @@
1
+ var e=Object.defineProperty;var o=(r,s)=>e(r,"name",{value:s,configurable:!0});const c={out:o(r=>process.stdout.write(`${r}
2
+ `),"out"),err:o(r=>process.stderr.write(`${r}
3
+ `),"err")};function u(){const r=[],s=[];return{stdout:r,stderr:s,out:o(t=>{r.push(t)},"out"),err:o(t=>{s.push(t)},"err")}}o(u,"memoryIo");class p extends Error{static{o(this,"UsageError")}constructor(s){super(s),this.name="UsageError"}}export{p as UsageError,u as memoryIo,c as processIo};
package/dist/io.js.map ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/io.ts"],
4
+ "sourcesContent": ["/**\n * Where a command writes. A seam, so a test reads the output instead of capturing a process stream.\n */\nexport interface Io {\n out(line: string): void;\n err(line: string): void;\n}\n\nexport const processIo: Io = {\n out: (line) => process.stdout.write(`${line}\\n`),\n err: (line) => process.stderr.write(`${line}\\n`),\n};\n\n/**\n * An `Io` that records its lines, for tests.\n */\nexport function memoryIo(): Io & { readonly stdout: string[]; readonly stderr: string[] } {\n const stdout: string[] = [];\n const stderr: string[] = [];\n return { stdout, stderr, out: (line) => void stdout.push(line), err: (line) => void stderr.push(line) };\n}\n\n/**\n * A mistake in how a command was invoked. The runner prints the message and the usage and exits 1.\n */\nexport class UsageError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'UsageError';\n }\n}\n"],
5
+ "mappings": "+EAQO,MAAMA,EAAgB,CAC3B,IAAKC,EAACC,GAAS,QAAQ,OAAO,MAAM,GAAGA,CAAI;CAAI,EAA1C,OACL,IAAKD,EAACC,GAAS,QAAQ,OAAO,MAAM,GAAGA,CAAI;CAAI,EAA1C,QAMD,SAAUC,GAAQ,CACtB,MAAMC,EAAmB,CAAA,EACnBC,EAAmB,CAAA,EACzB,MAAO,CAAE,OAAAD,EAAQ,OAAAC,EAAQ,IAAKJ,EAACC,GAAM,CAAQE,EAAO,KAAKF,CAAI,GAA/B,OAAkC,IAAKD,EAACC,GAAM,CAAQG,EAAO,KAAKH,CAAI,GAA/B,MAAgC,CACvG,CAJgBD,EAAAE,EAAA,YASV,MAAOG,UAAmB,KAAK,CAjBrC,MAiBqC,CAAAL,EAAA,mBACnC,YAAYM,EAAe,CACzB,MAAMA,CAAO,EACb,KAAK,KAAO,YACd",
6
+ "names": ["processIo", "__name", "line", "memoryIo", "stdout", "stderr", "UsageError", "message"]
7
+ }
@@ -0,0 +1,6 @@
1
+ import type { Repo } from './repo.ts';
2
+ /**
3
+ * The root package.json `scripts` block (empty when absent or unreadable).
4
+ */
5
+ export declare function rootScripts(repo: Repo): Record<string, string | undefined>;
6
+ //# sourceMappingURL=repo-json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repo-json.d.ts","sourceRoot":"","sources":["../src/repo-json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAI1E"}
@@ -0,0 +1 @@
1
+ var p=Object.defineProperty;var n=(o,t)=>p(o,"name",{value:t,configurable:!0});function e(o){const s=o.packages.find(c=>c.path==="package.json")?.json?.scripts;return typeof s=="object"&&s!==null?s:{}}n(e,"rootScripts");export{e as rootScripts};
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/repo-json.ts"],
4
+ "sourcesContent": ["import type { Repo } from './repo.ts';\n\n/**\n * The root package.json `scripts` block (empty when absent or unreadable).\n */\nexport function rootScripts(repo: Repo): Record<string, string | undefined> {\n const json = repo.packages.find((pkg) => pkg.path === 'package.json')?.json;\n const scripts = json?.['scripts'];\n return typeof scripts === 'object' && scripts !== null ? (scripts as Record<string, string | undefined>) : {};\n}\n"],
5
+ "mappings": "+EAKM,SAAUA,EAAYC,EAAU,CAEpC,MAAMC,EADOD,EAAK,SAAS,KAAME,GAAQA,EAAI,OAAS,cAAc,GAAG,MAChD,QACvB,OAAO,OAAOD,GAAY,UAAYA,IAAY,KAAQA,EAAiD,CAAA,CAC7G,CAJgBE,EAAAJ,EAAA",
6
+ "names": ["rootScripts", "repo", "scripts", "pkg", "__name"]
7
+ }
package/dist/repo.d.ts ADDED
@@ -0,0 +1,37 @@
1
+ import type { FamilyManifest } from '@rexezuge/tooling/manifest';
2
+ import type { WorkspaceYaml } from './workspace-yaml.ts';
3
+ /**
4
+ * One `package.json` in the repo, parsed. `json` is `null` when the file is unreadable JSON.
5
+ */
6
+ export interface PackageFile {
7
+ readonly path: string;
8
+ readonly json: Record<string, unknown> | null;
9
+ }
10
+ /**
11
+ * A read-only view of the repository under inspection. Doctor checks and sync fixes see the repo
12
+ * only through this, which is also what lets a test run them against a plain object.
13
+ */
14
+ export interface Repo {
15
+ readonly root: string;
16
+ /**
17
+ Repo-relative POSIX paths of every file, minus `node_modules`, `.git`, build output.
18
+ */
19
+ readonly files: readonly string[];
20
+ readonly manifest: FamilyManifest | null;
21
+ readonly manifestError: string | null;
22
+ readonly packages: readonly PackageFile[];
23
+ readonly workspace: WorkspaceYaml | null;
24
+ read(rel: string): string | null;
25
+ exists(rel: string): boolean;
26
+ /**
27
+ The symlink target of `rel`, or null when it is absent or not a symlink.
28
+ */
29
+ linkTarget(rel: string): string | null;
30
+ }
31
+ export declare function walkRepo(root: string): string[];
32
+ export declare function loadRepo(root: string): Repo;
33
+ /**
34
+ * The `@rexezuge/*` dependency specs in one package.json: name to spec, across the dependency fields.
35
+ */
36
+ export declare function kitDependencies(json: Record<string, unknown> | null): Map<string, string>;
37
+ //# sourceMappingURL=repo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../src/repo.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKzD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC/C;AAED;;;GAGG;AACH,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;MAEE;IACF,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IACzC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;IAC1C,QAAQ,CAAC,SAAS,EAAE,aAAa,GAAG,IAAI,CAAC;IACzC,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACjC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B;;MAEE;IACF,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CACxC;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAe/C;AAYD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAsC3C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAUzF"}
package/dist/repo.js ADDED
@@ -0,0 +1 @@
1
+ var p=Object.defineProperty;var s=(o,e)=>p(o,"name",{value:e,configurable:!0});import{existsSync as f,lstatSync as m,readdirSync as y,readFileSync as d,readlinkSync as k}from"node:fs";import a from"node:path";import{loadManifest as h,ManifestError as j}from"@rexezuge/tooling/manifest";import{parseWorkspaceYaml as S}from"./workspace-yaml.js";const g=new Set(["node_modules",".git","dist","coverage",".wrangler",".turbo",".next","build","out"]),b=2e4;function w(o){const e=[],c=s(t=>{for(const r of y(a.join(o,t),{withFileTypes:!0})){if(e.length>=b)return;const i=t===""?r.name:`${t}/${r.name}`;r.isDirectory()?g.has(r.name)||c(i):e.push(i)}},"visit");return c(""),e.sort((t,r)=>t.localeCompare(r))}s(w,"walkRepo");function x(o){if(o===null)return null;try{const e=JSON.parse(o);return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null}catch{return null}}s(x,"parseJson");function E(o){const e=a.resolve(o),c=s(n=>{try{return d(a.join(e,n),"utf8")}catch{return null}},"read");let t=null,r=null;try{t=h(e)}catch(n){r=n instanceof j?n.errors.join("; "):String(n)}const i=w(e),u=i.filter(n=>n==="package.json"||n.endsWith("/package.json")).map(n=>({path:n,json:x(c(n))})),l=c("pnpm-workspace.yaml");return{root:e,files:i,manifest:t,manifestError:r,packages:u,workspace:l===null?null:S(l),read:c,exists:s(n=>f(a.join(e,n)),"exists"),linkTarget:s(n=>{try{return m(a.join(e,n)).isSymbolicLink()?k(a.join(e,n)):null}catch{return null}},"linkTarget")}}s(E,"loadRepo");function F(o){const e=new Map;for(const c of["dependencies","devDependencies","peerDependencies","optionalDependencies"]){const t=o?.[c];if(!(typeof t!="object"||t===null))for(const[r,i]of Object.entries(t))r.startsWith("@rexezuge/")&&typeof i=="string"&&e.set(r,i)}return e}s(F,"kitDependencies");export{F as kitDependencies,E as loadRepo,w as walkRepo};
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/repo.ts"],
4
+ "sourcesContent": ["import { existsSync, lstatSync, readdirSync, readFileSync, readlinkSync } from 'node:fs';\nimport path from 'node:path';\nimport { loadManifest, ManifestError } from '@rexezuge/tooling/manifest';\nimport type { FamilyManifest } from '@rexezuge/tooling/manifest';\nimport { parseWorkspaceYaml } from './workspace-yaml.ts';\nimport type { WorkspaceYaml } from './workspace-yaml.ts';\n\nconst SKIP_DIRS = new Set(['node_modules', '.git', 'dist', 'coverage', '.wrangler', '.turbo', '.next', 'build', 'out']);\nconst MAX_FILES = 20_000;\n\n/**\n * One `package.json` in the repo, parsed. `json` is `null` when the file is unreadable JSON.\n */\nexport interface PackageFile {\n readonly path: string;\n readonly json: Record<string, unknown> | null;\n}\n\n/**\n * A read-only view of the repository under inspection. Doctor checks and sync fixes see the repo\n * only through this, which is also what lets a test run them against a plain object.\n */\nexport interface Repo {\n readonly root: string;\n /**\n Repo-relative POSIX paths of every file, minus `node_modules`, `.git`, build output.\n */\n readonly files: readonly string[];\n readonly manifest: FamilyManifest | null;\n readonly manifestError: string | null;\n readonly packages: readonly PackageFile[];\n readonly workspace: WorkspaceYaml | null;\n read(rel: string): string | null;\n exists(rel: string): boolean;\n /**\n The symlink target of `rel`, or null when it is absent or not a symlink.\n */\n linkTarget(rel: string): string | null;\n}\n\nexport function walkRepo(root: string): string[] {\n const out: string[] = [];\n const visit = (dir: string): void => {\n for (const entry of readdirSync(path.join(root, dir), { withFileTypes: true })) {\n if (out.length >= MAX_FILES) return;\n const rel = dir === '' ? entry.name : `${dir}/${entry.name}`;\n if (entry.isDirectory()) {\n if (!SKIP_DIRS.has(entry.name)) visit(rel);\n } else {\n out.push(rel);\n }\n }\n };\n visit('');\n return out.sort((a, b) => a.localeCompare(b));\n}\n\nfunction parseJson(text: string | null): Record<string, unknown> | null {\n if (text === null) return null;\n try {\n const value: unknown = JSON.parse(text);\n return typeof value === 'object' && value !== null && !Array.isArray(value) ? (value as Record<string, unknown>) : null;\n } catch {\n return null;\n }\n}\n\nexport function loadRepo(root: string): Repo {\n const absolute = path.resolve(root);\n const read = (rel: string): string | null => {\n try {\n return readFileSync(path.join(absolute, rel), 'utf8');\n } catch {\n return null;\n }\n };\n let manifest: FamilyManifest | null = null;\n let manifestError: string | null = null;\n try {\n manifest = loadManifest(absolute);\n } catch (error: unknown) {\n manifestError = error instanceof ManifestError ? error.errors.join('; ') : String(error);\n }\n const files = walkRepo(absolute);\n const packages = files\n .filter((file) => file === 'package.json' || file.endsWith('/package.json'))\n .map((file) => ({ path: file, json: parseJson(read(file)) }));\n const workspaceText = read('pnpm-workspace.yaml');\n return {\n root: absolute,\n files,\n manifest,\n manifestError,\n packages,\n workspace: workspaceText === null ? null : parseWorkspaceYaml(workspaceText),\n read,\n exists: (rel) => existsSync(path.join(absolute, rel)),\n linkTarget: (rel) => {\n try {\n return lstatSync(path.join(absolute, rel)).isSymbolicLink() ? readlinkSync(path.join(absolute, rel)) : null;\n } catch {\n return null;\n }\n },\n };\n}\n\n/**\n * The `@rexezuge/*` dependency specs in one package.json: name to spec, across the dependency fields.\n */\nexport function kitDependencies(json: Record<string, unknown> | null): Map<string, string> {\n const out = new Map<string, string>();\n for (const field of ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies']) {\n const block = json?.[field];\n if (typeof block !== 'object' || block === null) continue;\n for (const [name, spec] of Object.entries(block as Record<string, unknown>)) {\n if (name.startsWith('@rexezuge/') && typeof spec === 'string') out.set(name, spec);\n }\n }\n return out;\n}\n"],
5
+ "mappings": "+EAAA,OAAS,cAAAA,EAAY,aAAAC,EAAW,eAAAC,EAAa,gBAAAC,EAAc,gBAAAC,MAAoB,UAC/E,OAAOC,MAAU,YACjB,OAAS,gBAAAC,EAAc,iBAAAC,MAAqB,6BAE5C,OAAS,sBAAAC,MAA0B,sBAGnC,MAAMC,EAAY,IAAI,IAAI,CAAC,eAAgB,OAAQ,OAAQ,WAAY,YAAa,SAAU,QAAS,QAAS,KAAK,CAAC,EAChHC,EAAY,IAgCZ,SAAUC,EAASC,EAAY,CACnC,MAAMC,EAAgB,CAAA,EAChBC,EAAQC,EAACC,GAAqB,CAClC,UAAWC,KAASf,EAAYG,EAAK,KAAKO,EAAMI,CAAG,EAAG,CAAE,cAAe,EAAI,CAAE,EAAG,CAC9E,GAAIH,EAAI,QAAUH,EAAW,OAC7B,MAAMQ,EAAMF,IAAQ,GAAKC,EAAM,KAAO,GAAGD,CAAG,IAAIC,EAAM,IAAI,GACtDA,EAAM,YAAW,EACdR,EAAU,IAAIQ,EAAM,IAAI,GAAGH,EAAMI,CAAG,EAEzCL,EAAI,KAAKK,CAAG,CAEhB,CACF,EAVc,SAWd,OAAAJ,EAAM,EAAE,EACDD,EAAI,KAAK,CAACM,EAAGC,IAAMD,EAA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AaC,EAAK,KAAKoB,EAAUP,CAAG,CAAC,EAAI,IACzG,MAAQ,CACN,OAAO,IACT,CACF,EANY,cAQhB,CAtCgBH,EAAAS,EAAA,YA2CV,SAAUU,EAAgBC,EAAoC,CAClE,MAAMtB,EAAM,IAAI,IAChB,UAAWuB,IAAS,CAAC,eAAgB,kBAAmB,mBAAoB,sBAAsB,EAAG,CACnG,MAAMC,EAAQF,IAAOC,CAAK,EAC1B,GAAI,SAAOC,GAAU,UAAYA,IAAU,MAC3C,SAAW,CAACC,EAAMC,CAAI,IAAK,OAAO,QAAQF,CAAgC,EACpEC,EAAK,WAAW,YAAY,GAAK,OAAOC,GAAS,UAAU1B,EAAI,IAAIyB,EAAMC,CAAI,CAErF,CACA,OAAO1B,CACT,CAVgBE,EAAAmB,EAAA",
6
+ "names": ["existsSync", "lstatSync", "readdirSync", "readFileSync", "readlinkSync", "path", "loadManifest", "ManifestError", "parseWorkspaceYaml", "SKIP_DIRS", "MAX_FILES", "walkRepo", "root", "out", "visit", "__name", "dir", "entry", "rel", "a", "b", "parseJson", "text", "value", "loadRepo", "absolute", "read", "manifest", "manifestError", "error", "files", "packages", "file", "workspaceText", "kitDependencies", "json", "field", "block", "name", "spec"]
7
+ }
@@ -0,0 +1,12 @@
1
+ import type { Repo } from '../repo.ts';
2
+ import type { Plan } from './plan.ts';
3
+ /**
4
+ * A repair for one failing, auto-fixable check. It edits the plan, never the disk; whatever it cannot do
5
+ * safely it leaves alone, and the check keeps failing in the report that follows.
6
+ */
7
+ export type Fix = (repo: Repo, plan: Plan) => void;
8
+ /**
9
+ * Auto-fixes by check id. Ids absent here are reported by doctor and left to a human.
10
+ */
11
+ export declare const FIXES: Readonly<Record<string, Fix>>;
12
+ //# sourceMappingURL=fixes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixes.d.ts","sourceRoot":"","sources":["../../src/sync/fixes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAOvC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC;;;GAGG;AACH,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;AAgJnD;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAY/C,CAAC"}
@@ -0,0 +1,6 @@
1
+ var m=Object.defineProperty;var a=(n,t)=>m(n,"name",{value:t,configurable:!0});import{applyEdits as k,modify as w}from"jsonc-parser";import{kitDependencies as x}from"../repo.js";import{removeOverrides as h,setCatalogEntries as y}from"../workspace-yaml.js";import{CLI_VERSION as v}from"../version.js";import{CANONICAL_SCRIPTS as j}from"../doctor/checks/files.js";import{extendsPreset as E}from"../doctor/checks/presets.js";import{vendoredFiles as d,VENDORED_RULES as u}from"../doctor/checks/vendored.js";import{workflowFixes as S}from"./workflows.js";const l=a(n=>n.startsWith("@rexezuge/"),"isKit");function f(n,t,o){return k(n,w(n,t,o,{formattingOptions:{insertSpaces:!0,tabSize:2,eol:`
2
+ `}}))}a(f,"editJson");const b=a((n,t)=>{const o=new Map;for(const s of n.packages)for(const[c,p]of x(s.json))p.startsWith("workspace:")||o.set(c,`^${v}`);const e=new Set(n.workspace?.catalog.keys()),i=new Map([...o].filter(([s])=>!e.has(s)));if(i.size===0)return;const r=t.read("pnpm-workspace.yaml")??"";t.write("pnpm-workspace.yaml",y(r,i),`catalog: ${[...i.keys()].join(", ")}`)},"catalogPresent"),z=a((n,t)=>{const o=t.read("pnpm-workspace.yaml");o!==null&&n.workspace!==null&&t.write("pnpm-workspace.yaml",h(o,l),"remove @rexezuge/* overrides");for(const e of n.packages){const i=t.read(e.path),r=e.json?.pnpm?.overrides;if(i===null||r===void 0)continue;let s=i;const c=Object.keys(r).filter(l);for(const p of c)s=f(s,["pnpm","overrides",p],void 0);s!==i&&t.write(e.path,s,"remove @rexezuge/* pnpm.overrides")}},"noOverrides"),O=a((n,t)=>{for(const o of n.packages){let e=t.read(o.path);if(e===null)continue;const i=e;for(const r of["dependencies","devDependencies","peerDependencies","optionalDependencies"]){const s=o.json?.[r];for(const[c,p]of Object.entries(s??{}))l(c)&&typeof p=="string"&&!p.startsWith("catalog:")&&!p.startsWith("workspace:")&&(e=f(e,[r,c],"catalog:"))}e!==i&&t.write(o.path,e,"@rexezuge/* to catalog:")}},"catalogProtocol"),R=a((n,t)=>{const o=n.files.filter(e=>e==="tsconfig.json"||/^apps\/[^/]+\/tsconfig\.json$/.test(e));for(const e of o.length===0?["tsconfig.json"]:o){const i=t.read(e)??`{}
3
+ `;if(E(i))continue;const r=e==="tsconfig.json"?"base":/apps\/web\//.test(e)?"web":"worker";t.write(e,f(i,["extends"],`@rexezuge/tooling/tsconfig/${r}.json`),`extends the ${r} preset`)}},"tsconfigPreset"),T={printWidth:140,singleQuote:!0,semi:!0,useTabs:!1},A=a((n,t)=>{const o=n.files.filter(s=>/^\.prettierrc(?:\.json)?$/.test(s)),e=a(s=>{try{const c=JSON.parse(s??"");return Object.entries(c).every(([p,g])=>T[p]===g)}catch{return!1}},"redundant");if(o.some(s=>!e(n.read(s))))return;for(const s of o)t.delete(s,"redundant with the preset");const r=t.read("package.json");r!==null&&t.write("package.json",f(r,["prettier"],"@rexezuge/tooling/prettier"),"prettier preset")},"prettierPreset"),N=a((n,t)=>{if(!n.exists("AGENTS.md"))return;const o=n.read("CLAUDE.md");o!==null&&o!==n.read("AGENTS.md")||t.symlink("CLAUDE.md","AGENTS.md","symlink to AGENTS.md")},"claudeSymlink"),P=a((n,t)=>t.write(".nvmrc",`24
4
+ `,"Node 24"),"nodeVersion"),D={checks:"pnpm run typecheck && pnpm run lint:check && pnpm run test && pnpm run format:check",typecheck:"tsc --noEmit",lint:"eslint --fix --quiet .","lint:check":"eslint --quiet .",format:"prettier --write .","format:check":"prettier --check .",test:"vitest run","test:coverage":"vitest run --coverage",typegen:"wrangler types"},C=a((n,t)=>{const o=t.read("package.json"),e=n.packages.find(c=>c.path==="package.json")?.json;if(o===null||e===null||e===void 0)return;const i=e.scripts??{};let r=o;const s=[];for(const c of j)i[c]===void 0&&(r=f(r,["scripts",c],D[c]),s.push(c));s.length>0&&t.write("package.json",r,`scripts: ${s.join(", ")}`)},"canonicalScripts"),I=a((n,t)=>{const o=u.find(e=>e.key==="pages-function");if(o!==void 0)for(const e of d(n,o))(n.read(e)??"").includes("API_WORKER")&&t.write(e,`export { onRequest } from '@rexezuge/tooling/pages-proxy';
5
+ `,"one-line pages-proxy re-export")},"pagesFunction"),_=a((n,t)=>{const o=u.find(e=>e.key==="cloudflare-workers-mock");if(o!==void 0)for(const e of d(n,o))t.write(e,`export * from '@rexezuge/testing/cloudflare-workers';
6
+ `,"re-export of @rexezuge/testing")},"workersMock"),J={"catalog.present":b,"catalog.no-overrides":z,"catalog.protocol":O,"presets.tsconfig":R,"presets.prettier":A,"files.claude-symlink":N,"files.node-version":P,"scripts.canonical":C,"vendored.pages-function":I,"vendored.cloudflare-workers-mock":_,"workflows.callers":S};export{J as FIXES};
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/sync/fixes.ts"],
4
+ "sourcesContent": ["import { applyEdits, modify } from 'jsonc-parser';\nimport { kitDependencies } from '../repo.ts';\nimport type { Repo } from '../repo.ts';\nimport { removeOverrides, setCatalogEntries } from '../workspace-yaml.ts';\nimport { CLI_VERSION } from '../version.ts';\nimport { CANONICAL_SCRIPTS } from '../doctor/checks/files.ts';\nimport { extendsPreset } from '../doctor/checks/presets.ts';\nimport { vendoredFiles, VENDORED_RULES } from '../doctor/checks/vendored.ts';\nimport { workflowFixes } from './workflows.ts';\nimport type { Plan } from './plan.ts';\n\n/**\n * A repair for one failing, auto-fixable check. It edits the plan, never the disk; whatever it cannot do\n * safely it leaves alone, and the check keeps failing in the report that follows.\n */\nexport type Fix = (repo: Repo, plan: Plan) => void;\n\nconst isKit = (name: string): boolean => name.startsWith('@rexezuge/');\n\nfunction editJson(text: string, path: Array<string | number>, value: unknown): string {\n return applyEdits(text, modify(text, path, value, { formattingOptions: { insertSpaces: true, tabSize: 2, eol: '\\n' } }));\n}\n\nconst catalogPresent: Fix = (repo, plan) => {\n const wanted = new Map<string, string>();\n for (const pkg of repo.packages) {\n for (const [name, spec] of kitDependencies(pkg.json)) if (!spec.startsWith('workspace:')) wanted.set(name, `^${CLI_VERSION}`);\n }\n const have = new Set(repo.workspace?.catalog.keys());\n const missing = new Map([...wanted].filter(([name]) => !have.has(name)));\n if (missing.size === 0) return;\n const text = plan.read('pnpm-workspace.yaml') ?? '';\n plan.write('pnpm-workspace.yaml', setCatalogEntries(text, missing), `catalog: ${[...missing.keys()].join(', ')}`);\n};\n\nconst noOverrides: Fix = (repo, plan) => {\n const yaml = plan.read('pnpm-workspace.yaml');\n if (yaml !== null && repo.workspace !== null)\n plan.write('pnpm-workspace.yaml', removeOverrides(yaml, isKit), 'remove @rexezuge/* overrides');\n for (const pkg of repo.packages) {\n const text = plan.read(pkg.path);\n const nested = (pkg.json?.['pnpm'] as { overrides?: Record<string, unknown> } | undefined)?.overrides;\n if (text === null || nested === undefined) continue;\n let next = text;\n const pinned = Object.keys(nested).filter(isKit);\n for (const key of pinned) next = editJson(next, ['pnpm', 'overrides', key], undefined);\n if (next !== text) plan.write(pkg.path, next, 'remove @rexezuge/* pnpm.overrides');\n }\n};\n\nconst catalogProtocol: Fix = (repo, plan) => {\n for (const pkg of repo.packages) {\n let text = plan.read(pkg.path);\n if (text === null) continue;\n const before = text;\n for (const field of ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies']) {\n const block = pkg.json?.[field] as Record<string, unknown> | undefined;\n for (const [name, spec] of Object.entries(block ?? {})) {\n if (isKit(name) && typeof spec === 'string' && !spec.startsWith('catalog:') && !spec.startsWith('workspace:')) {\n text = editJson(text, [field, name], 'catalog:');\n }\n }\n }\n if (text !== before) plan.write(pkg.path, text, '@rexezuge/* to catalog:');\n }\n};\n\nconst tsconfigPreset: Fix = (repo, plan) => {\n const files = repo.files.filter((file) => file === 'tsconfig.json' || /^apps\\/[^/]+\\/tsconfig\\.json$/.test(file));\n for (const file of files.length === 0 ? ['tsconfig.json'] : files) {\n const text = plan.read(file) ?? '{}\\n';\n if (extendsPreset(text)) continue;\n const preset = file === 'tsconfig.json' ? 'base' : /apps\\/web\\//.test(file) ? 'web' : 'worker';\n plan.write(file, editJson(text, ['extends'], `@rexezuge/tooling/tsconfig/${preset}.json`), `extends the ${preset} preset`);\n }\n};\n\nconst PRETTIER_PRESET = { printWidth: 140, singleQuote: true, semi: true, useTabs: false } as const;\n\nconst prettierPreset: Fix = (repo, plan) => {\n const rc = repo.files.filter((file) => /^\\.prettierrc(?:\\.json)?$/.test(file));\n // Delete a hand-written rc only when it says nothing the preset does not (a custom option would be lost).\n const redundant = (text: string | null): boolean => {\n try {\n const parsed = JSON.parse(text ?? '') as Record<string, unknown>;\n return Object.entries(parsed).every(([key, value]) => (PRETTIER_PRESET as Record<string, unknown>)[key] === value);\n } catch {\n return false;\n }\n };\n const blocking = rc.some((file) => !redundant(repo.read(file)));\n if (blocking) return;\n for (const file of rc) plan.delete(file, 'redundant with the preset');\n const text = plan.read('package.json');\n if (text !== null) plan.write('package.json', editJson(text, ['prettier'], '@rexezuge/tooling/prettier'), 'prettier preset');\n};\n\nconst claudeSymlink: Fix = (repo, plan) => {\n if (!repo.exists('AGENTS.md')) return;\n const existing = repo.read('CLAUDE.md');\n if (existing !== null && existing !== repo.read('AGENTS.md')) return; // a distinct regular file is the repo's own text\n plan.symlink('CLAUDE.md', 'AGENTS.md', 'symlink to AGENTS.md');\n};\n\nconst nodeVersion: Fix = (_repo, plan) => plan.write('.nvmrc', '24\\n', 'Node 24');\n\nconst DEFAULT_SCRIPTS: Record<(typeof CANONICAL_SCRIPTS)[number], string> = {\n checks: 'pnpm run typecheck && pnpm run lint:check && pnpm run test && pnpm run format:check',\n typecheck: 'tsc --noEmit',\n lint: 'eslint --fix --quiet .',\n 'lint:check': 'eslint --quiet .',\n format: 'prettier --write .',\n 'format:check': 'prettier --check .',\n test: 'vitest run',\n 'test:coverage': 'vitest run --coverage',\n typegen: 'wrangler types',\n};\n\nconst canonicalScripts: Fix = (repo, plan) => {\n const text = plan.read('package.json');\n const json = repo.packages.find((pkg) => pkg.path === 'package.json')?.json;\n if (text === null || json === null || json === undefined) return;\n const scripts = (json['scripts'] ?? {}) as Record<string, unknown>;\n let next = text;\n const added: string[] = [];\n for (const name of CANONICAL_SCRIPTS) {\n if (scripts[name] !== undefined) continue;\n next = editJson(next, ['scripts', name], DEFAULT_SCRIPTS[name]);\n added.push(name);\n }\n if (added.length > 0) plan.write('package.json', next, `scripts: ${added.join(', ')}`);\n};\n\n/**\n * `functions/[[path]].ts` becomes the one-line re-export, but only for a file that is the proxy\n * (it names `API_WORKER`); any other function in that path is the repo's code and stays.\n */\nconst pagesFunction: Fix = (repo, plan) => {\n const rule = VENDORED_RULES.find((entry) => entry.key === 'pages-function');\n if (rule === undefined) return;\n for (const file of vendoredFiles(repo, rule)) {\n if ((repo.read(file) ?? '').includes('API_WORKER')) {\n plan.write(file, \"export { onRequest } from '@rexezuge/tooling/pages-proxy';\\n\", 'one-line pages-proxy re-export');\n }\n }\n};\n\n/**\n * The `cloudflare:workers` mock becomes a pure re-export of the kit's superset. Rewritten, not deleted:\n * suites import it by path.\n */\nconst workersMock: Fix = (repo, plan) => {\n const rule = VENDORED_RULES.find((entry) => entry.key === 'cloudflare-workers-mock');\n if (rule === undefined) return;\n for (const file of vendoredFiles(repo, rule)) {\n plan.write(file, \"export * from '@rexezuge/testing/cloudflare-workers';\\n\", 're-export of @rexezuge/testing');\n }\n};\n\n/**\n * Auto-fixes by check id. Ids absent here are reported by doctor and left to a human.\n */\nexport const FIXES: Readonly<Record<string, Fix>> = {\n 'catalog.present': catalogPresent,\n 'catalog.no-overrides': noOverrides,\n 'catalog.protocol': catalogProtocol,\n 'presets.tsconfig': tsconfigPreset,\n 'presets.prettier': prettierPreset,\n 'files.claude-symlink': claudeSymlink,\n 'files.node-version': nodeVersion,\n 'scripts.canonical': canonicalScripts,\n 'vendored.pages-function': pagesFunction,\n 'vendored.cloudflare-workers-mock': workersMock,\n 'workflows.callers': workflowFixes,\n};\n"],
5
+ "mappings": "+EAAA,OAAS,cAAAA,EAAY,UAAAC,MAAc,eACnC,OAAS,mBAAAC,MAAuB,aAEhC,OAAS,mBAAAC,EAAiB,qBAAAC,MAAyB,uBACnD,OAAS,eAAAC,MAAmB,gBAC5B,OAAS,qBAAAC,MAAyB,4BAClC,OAAS,iBAAAC,MAAqB,8BAC9B,OAAS,iBAAAC,EAAe,kBAAAC,MAAsB,+BAC9C,OAAS,iBAAAC,MAAqB,iBAS9B,MAAMC,EAAQC,EAACC,GAA0BA,EAAK,WAAW,YAAY,EAAvD,SAEd,SAASC,EAASC,EAAcC,EAA8BC,EAAc,CAC1E,OAAOjB,EAAWe,EAAMd,EAAOc,EAAMC,EAAMC,EAAO,CAAE,kBAAmB,CAAE,aAAc,GAAM,QAAS,EAAG,IAAK;CAAI,CAAE,CAAE,CAAC,CACzH,CAFSL,EAAAE,EAAA,YAIT,MAAMI,EAAsBN,EAAA,CAACO,EAAMC,IAAQ,CACzC,MAAMC,EAAS,IAAI,IACnB,UAAWC,KAAOH,EAAK,SACrB,SAAW,CAACN,EAAMU,CAAI,IAAKrB,EAAgBoB,EAAI,IAAI,EAAQC,EAAK,WAAW,YAAY,GAAGF,EAAO,IAAIR,EAAM,IAAIR,CAAW,EAAE,EAE9H,MAAMmB,EAAO,IAAI,IAAIL,EAAK,WAAW,QAAQ,KAAI,CAAE,EAC7CM,EAAU,IAAI,IAAI,CAAC,GAAGJ,CAAM,EAAE,OAAO,CAAC,CAACR,CAAI,IAAM,CAACW,EAAK,IAAIX,CAAI,CAAC,CAAC,EACvE,GAAIY,EAAQ,OAAS,EAAG,OACxB,MAAMV,EAAOK,EAAK,KAAK,qBAAq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KAAQ9B,EAAcW,EAAMoC,CAAI,GACpCpC,EAAK,KAAKmB,CAAI,GAAK,IAAI,SAAS,YAAY,GAC/ClB,EAAK,MAAMkB,EAAM;EAAgE,gCAAgC,CAGvH,EAR2B,iBAcrBmB,EAAmB7C,EAAA,CAACO,EAAMC,IAAQ,CACtC,MAAMmC,EAAO9C,EAAe,KAAM+C,GAAUA,EAAM,MAAQ,yBAAyB,EACnF,GAAID,IAAS,OACb,UAAWjB,KAAQ9B,EAAcW,EAAMoC,CAAI,EACzCnC,EAAK,MAAMkB,EAAM;EAA2D,gCAAgC,CAEhH,EANyB,eAWZoB,EAAuC,CAClD,kBAAmBxC,EACnB,uBAAwBQ,EACxB,mBAAoBM,EACpB,mBAAoBI,EACpB,mBAAoBK,EACpB,uBAAwBI,EACxB,qBAAsBE,EACtB,oBAAqBG,EACrB,0BAA2BI,EAC3B,mCAAoCG,EACpC,oBAAqB/C",
6
+ "names": ["applyEdits", "modify", "kitDependencies", "removeOverrides", "setCatalogEntries", "CLI_VERSION", "CANONICAL_SCRIPTS", "extendsPreset", "vendoredFiles", "VENDORED_RULES", "workflowFixes", "isKit", "__name", "name", "editJson", "text", "path", "value", "catalogPresent", "repo", "plan", "wanted", "pkg", "spec", "have", "missing", "noOverrides", "yaml", "nested", "next", "pinned", "key", "catalogProtocol", "before", "field", "block", "tsconfigPreset", "files", "file", "preset", "PRETTIER_PRESET", "prettierPreset", "rc", "redundant", "parsed", "claudeSymlink", "existing", "nodeVersion", "_repo", "DEFAULT_SCRIPTS", "canonicalScripts", "json", "scripts", "added", "pagesFunction", "rule", "entry", "workersMock", "FIXES"]
7
+ }
@@ -0,0 +1,46 @@
1
+ import type { Repo } from '../repo.ts';
2
+ export type Change = {
3
+ readonly op: 'write';
4
+ readonly path: string;
5
+ readonly content: string;
6
+ readonly note: string;
7
+ } | {
8
+ readonly op: 'symlink';
9
+ readonly path: string;
10
+ readonly target: string;
11
+ readonly note: string;
12
+ } | {
13
+ readonly op: 'delete';
14
+ readonly path: string;
15
+ readonly note: string;
16
+ };
17
+ /**
18
+ * The edits a sync would make, applied on top of the repo in memory so two fixes touching one file
19
+ * (the catalog and the overrides both live in pnpm-workspace.yaml) compose instead of overwriting each other.
20
+ */
21
+ export declare class Plan {
22
+ private readonly repo;
23
+ private readonly changes;
24
+ constructor(repo: Repo);
25
+ /**
26
+ The file as it will be after the plan, or null.
27
+ */
28
+ read(rel: string): string | null;
29
+ write(rel: string, content: string, note: string): void;
30
+ symlink(rel: string, target: string, note: string): void;
31
+ delete(rel: string, note: string): void;
32
+ get list(): readonly Change[];
33
+ /**
34
+ Write the plan to disk. Idempotent: a file already holding the planned content is rewritten with it.
35
+ */
36
+ apply(): void;
37
+ }
38
+ /**
39
+ * `+added -removed` line counts between two texts: a multiset comparison of lines, which is exact for
40
+ * pure additions and removals and an approximation for reorderings. A summary, not a patch.
41
+ */
42
+ export declare function lineDelta(before: string | null, after: string): {
43
+ added: number;
44
+ removed: number;
45
+ };
46
+ //# sourceMappingURL=plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/sync/plan.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,MAAM,MAAM,GACd;IAAE,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAChG;IAAE,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjG;IAAE,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5E;;;GAGG;AACH,qBAAa,IAAI;IAGH,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;gBAExB,IAAI,EAAE,IAAI;IAEvC;;MAEE;IACF,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAMhC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAIvD,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAIxD,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAIvC,IAAI,IAAI,IAAI,SAAS,MAAM,EAAE,CAE5B;IAED;;MAEE;IACF,KAAK,IAAI,IAAI;CAiBd;AAUD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAYlG"}
@@ -0,0 +1,3 @@
1
+ var h=Object.defineProperty;var s=(n,t)=>h(n,"name",{value:t,configurable:!0});import{lstatSync as f,mkdirSync as u,readlinkSync as d,rmSync as a,symlinkSync as g,writeFileSync as m}from"node:fs";import l from"node:path";class k{static{s(this,"Plan")}repo;changes=new Map;constructor(t){this.repo=t}read(t){const e=this.changes.get(t);return e===void 0?this.repo.read(t):e.op==="write"?e.content:null}write(t,e,r){this.changes.set(t,{op:"write",path:t,content:e,note:r})}symlink(t,e,r){this.changes.set(t,{op:"symlink",path:t,target:e,note:r})}delete(t,e){this.changes.set(t,{op:"delete",path:t,note:e})}get list(){return[...this.changes.values()].sort((t,e)=>t.path.localeCompare(e.path))}apply(){for(const t of this.list){const e=l.join(this.repo.root,t.path);if(t.op==="delete"){a(e,{force:!0});continue}if(u(l.dirname(e),{recursive:!0}),t.op==="write"){m(e,t.content);continue}f(e,{throwIfNoEntry:!1})!==void 0&&p(e)!==t.target&&a(e,{force:!0}),p(e)!==t.target&&g(t.target,e)}}}function p(n){try{return d(n)}catch{return null}}s(p,"readlinkSyncSafe");function v(n,t){const e=new Map;for(const o of(n??"").split(`
2
+ `))e.set(o,(e.get(o)??0)+1);let r=0;for(const o of t.split(`
3
+ `)){const c=e.get(o)??0;c>0?e.set(o,c-1):r+=1}let i=0;for(const o of e.values())i+=o;return{added:r,removed:n===null?0:i}}s(v,"lineDelta");export{k as Plan,v as lineDelta};
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/sync/plan.ts"],
4
+ "sourcesContent": ["import { lstatSync, mkdirSync, readlinkSync, rmSync, symlinkSync, writeFileSync } from 'node:fs';\nimport path from 'node:path';\nimport type { Repo } from '../repo.ts';\n\nexport type Change =\n | { readonly op: 'write'; readonly path: string; readonly content: string; readonly note: string }\n | { readonly op: 'symlink'; readonly path: string; readonly target: string; readonly note: string }\n | { readonly op: 'delete'; readonly path: string; readonly note: string };\n\n/**\n * The edits a sync would make, applied on top of the repo in memory so two fixes touching one file\n * (the catalog and the overrides both live in pnpm-workspace.yaml) compose instead of overwriting each other.\n */\nexport class Plan {\n private readonly changes = new Map<string, Change>();\n\n constructor(private readonly repo: Repo) {}\n\n /**\n The file as it will be after the plan, or null.\n */\n read(rel: string): string | null {\n const change = this.changes.get(rel);\n if (change === undefined) return this.repo.read(rel);\n return change.op === 'write' ? change.content : null;\n }\n\n write(rel: string, content: string, note: string): void {\n this.changes.set(rel, { op: 'write', path: rel, content, note });\n }\n\n symlink(rel: string, target: string, note: string): void {\n this.changes.set(rel, { op: 'symlink', path: rel, target, note });\n }\n\n delete(rel: string, note: string): void {\n this.changes.set(rel, { op: 'delete', path: rel, note });\n }\n\n get list(): readonly Change[] {\n return [...this.changes.values()].sort((a, b) => a.path.localeCompare(b.path));\n }\n\n /**\n Write the plan to disk. Idempotent: a file already holding the planned content is rewritten with it.\n */\n apply(): void {\n for (const change of this.list) {\n const full = path.join(this.repo.root, change.path);\n if (change.op === 'delete') {\n rmSync(full, { force: true });\n continue;\n }\n mkdirSync(path.dirname(full), { recursive: true });\n if (change.op === 'write') {\n writeFileSync(full, change.content);\n continue;\n }\n if (lstatSync(full, { throwIfNoEntry: false }) !== undefined && readlinkSyncSafe(full) !== change.target)\n rmSync(full, { force: true });\n if (readlinkSyncSafe(full) !== change.target) symlinkSync(change.target, full);\n }\n }\n}\n\nfunction readlinkSyncSafe(file: string): string | null {\n try {\n return readlinkSync(file);\n } catch {\n return null;\n }\n}\n\n/**\n * `+added -removed` line counts between two texts: a multiset comparison of lines, which is exact for\n * pure additions and removals and an approximation for reorderings. A summary, not a patch.\n */\nexport function lineDelta(before: string | null, after: string): { added: number; removed: number } {\n const counts = new Map<string, number>();\n for (const line of (before ?? '').split('\\n')) counts.set(line, (counts.get(line) ?? 0) + 1);\n let added = 0;\n for (const line of after.split('\\n')) {\n const have = counts.get(line) ?? 0;\n if (have > 0) counts.set(line, have - 1);\n else added += 1;\n }\n let removed = 0;\n for (const count of counts.values()) removed += count;\n return { added, removed: before === null ? 0 : removed };\n}\n"],
5
+ "mappings": "+EAAA,OAAS,aAAAA,EAAW,aAAAC,EAAW,gBAAAC,EAAc,UAAAC,EAAQ,eAAAC,EAAa,iBAAAC,MAAqB,UACvF,OAAOC,MAAU,YAYX,MAAOC,CAAI,CAbjB,MAaiB,CAAAC,EAAA,aAGc,KAFZ,QAAU,IAAI,IAE/B,YAA6BC,EAAU,CAAV,KAAA,KAAAA,CAAa,CAK1C,KAAKC,EAAW,CACd,MAAMC,EAAS,KAAK,QAAQ,IAAID,CAAG,EACnC,OAAIC,IAAW,OAAkB,KAAK,KAAK,KA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AO,IACT,CACF,CANSX,EAAAU,EAAA,oBAYH,SAAUE,EAAUC,EAAuBC,EAAa,CAC5D,MAAMC,EAAS,IAAI,IACnB,UAAWC,KAASH,GAAU,IAAI,MAAM;CAAI,EAAGE,EAAO,IAAIC,GAAOD,EAAO,IAAIC,CAAI,GAAK,GAAK,CAAC,EAC3F,IAAIC,EAAQ,EACZ,UAAWD,KAAQF,EAAM,MAAM;CAAI,EAAG,CACpC,MAAMI,EAAOH,EAAO,IAAIC,CAAI,GAAK,EAC7BE,EAAO,EAAGH,EAAO,IAAIC,EAAME,EAAO,CAAC,EAClCD,GAAS,CAChB,CACA,IAAIE,EAAU,EACd,UAAWC,KAASL,EAAO,OAAM,EAAII,GAAWC,EAChD,MAAO,CAAE,MAAAH,EAAO,QAASJ,IAAW,KAAO,EAAIM,CAAO,CACxD,CAZgBnB,EAAAY,EAAA",
6
+ "names": ["lstatSync", "mkdirSync", "readlinkSync", "rmSync", "symlinkSync", "writeFileSync", "path", "Plan", "__name", "repo", "rel", "change", "content", "note", "target", "a", "b", "full", "readlinkSyncSafe", "file", "lineDelta", "before", "after", "counts", "line", "added", "have", "removed", "count"]
7
+ }
@@ -0,0 +1,24 @@
1
+ import type { DoctorReport } from '../doctor/types.ts';
2
+ import type { Change } from './plan.ts';
3
+ export interface SyncResult {
4
+ readonly root: string;
5
+ readonly write: boolean;
6
+ readonly before: DoctorReport;
7
+ /**
8
+ Score after the plan is applied; null in a dry run, which changes nothing.
9
+ */
10
+ readonly after: DoctorReport | null;
11
+ readonly changes: ReadonlyArray<Change & {
12
+ added?: number;
13
+ removed?: number;
14
+ }>;
15
+ /**
16
+ Failing auto-fixable checks whose fix declined to act (a file that is the repo's own).
17
+ */
18
+ readonly unfixed: readonly string[];
19
+ }
20
+ /**
21
+ * Compute the plan for every failing auto-fixable check and, with `write`, apply it. Dry run is the default.
22
+ */
23
+ export declare function runSync(root: string, write: boolean): Promise<SyncResult>;
24
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/sync/run.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B;;MAEE;IACF,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,MAAM,GAAG;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/E;;MAEE;IACF,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED;;GAEG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAoB/E"}
@@ -0,0 +1 @@
1
+ var m=Object.defineProperty;var a=(r,i)=>m(r,"name",{value:i,configurable:!0});import{loadRepo as p}from"../repo.js";import{diagnose as u}from"../doctor/run.js";import{FIXES as y}from"./fixes.js";import{lineDelta as g,Plan as S}from"./plan.js";async function O(r,i){const o=p(r),s=await u(o),n=new S(o),f=[];for(const t of s.findings){const l=y[t.id];if(t.status!=="fail"||l===void 0)continue;const c=n.list.length,d=JSON.stringify(n.list);l(o,n),n.list.length===c&&JSON.stringify(n.list)===d&&f.push(t.id)}const e=n.list.map(t=>t.op!=="write"?t:{...t,...g(o.read(t.path),t.content)});return i?(n.apply(),{root:o.root,write:i,before:s,after:await u(p(r)),changes:e,unfixed:f}):{root:o.root,write:i,before:s,after:null,changes:e,unfixed:f}}a(O,"runSync");export{O as runSync};
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/sync/run.ts"],
4
+ "sourcesContent": ["import { loadRepo } from '../repo.ts';\nimport { diagnose } from '../doctor/run.ts';\nimport type { DoctorReport } from '../doctor/types.ts';\nimport { FIXES } from './fixes.ts';\nimport { lineDelta, Plan } from './plan.ts';\nimport type { Change } from './plan.ts';\n\nexport interface SyncResult {\n readonly root: string;\n readonly write: boolean;\n readonly before: DoctorReport;\n /**\n Score after the plan is applied; null in a dry run, which changes nothing.\n */\n readonly after: DoctorReport | null;\n readonly changes: ReadonlyArray<Change & { added?: number; removed?: number }>;\n /**\n Failing auto-fixable checks whose fix declined to act (a file that is the repo's own).\n */\n readonly unfixed: readonly string[];\n}\n\n/**\n * Compute the plan for every failing auto-fixable check and, with `write`, apply it. Dry run is the default.\n */\nexport async function runSync(root: string, write: boolean): Promise<SyncResult> {\n const repo = loadRepo(root);\n const before = await diagnose(repo);\n const plan = new Plan(repo);\n const unfixed: string[] = [];\n for (const finding of before.findings) {\n const fix = FIXES[finding.id];\n if (finding.status !== 'fail' || fix === undefined) continue;\n const size = plan.list.length;\n const touched = JSON.stringify(plan.list);\n fix(repo, plan);\n if (plan.list.length === size && JSON.stringify(plan.list) === touched) unfixed.push(finding.id);\n }\n const changes = plan.list.map((change) => {\n if (change.op !== 'write') return change;\n return { ...change, ...lineDelta(repo.read(change.path), change.content) };\n });\n if (!write) return { root: repo.root, write, before, after: null, changes, unfixed };\n plan.apply();\n return { root: repo.root, write, before, after: await diagnose(loadRepo(root)), changes, unfixed };\n}\n"],
5
+ "mappings": "+EAAA,OAAS,YAAAA,MAAgB,aACzB,OAAS,YAAAC,MAAgB,mBAEzB,OAAS,SAAAC,MAAa,aACtB,OAAS,aAAAC,EAAW,QAAAC,MAAY,YAqBhC,eAAsBC,EAAQC,EAAcC,EAAc,CACxD,MAAMC,EAAOR,EAASM,CAAI,EACpBG,EAAS,MAAMR,EAASO,CAAI,EAC5BE,EAAO,IAAIN,EAAKI,CAAI,EACpBG,EAAoB,CAAA,EAC1B,UAAWC,KAAWH,EAAO,SAAU,CACrC,MAAMI,EAAMX,EAAMU,EAAQ,EAAE,EAC5B,GAAIA,EAAQ,SAAW,QAAUC,IAAQ,OAAW,SACpD,MAAMC,EAAOJ,EAAK,KAAK,OACjBK,EAAU,KAAK,UAAUL,EAAK,IAAI,EACxCG,EAAIL,EAAME,CAAI,EACVA,EAAK,KAAK,SAAWI,GAAQ,KAAK,UAAUJ,EAAK,IAAI,IAAMK,GAASJ,EAAQ,KAAKC,EAAQ,EAAE,CACjG,CACA,MAAMI,EAAUN,EAAK,KAAK,IAAKO,GACzBA,EAAO,KAAO,QAAgBA,EAC3B,CAAE,GAAGA,EAAQ,GAAGd,EAAUK,EAAK,KAAKS,EAAO,IAAI,EAAGA,EAAO,OAAO,CAAC,CACzE,EACD,OAAKV,GACLG,EAAK,MAAK,EACH,CAAE,KAAMF,EAAK,KAAM,MAAAD,EAAO,OAAAE,EAAQ,MAAO,MAAMR,EAASD,EAASM,CAAI,CAAC,EAAG,QAAAU,EAAS,QAAAL,CAAO,GAF7E,CAAE,KAAMH,EAAK,KAAM,MAAAD,EAAO,OAAAE,EAAQ,MAAO,KAAM,QAAAO,EAAS,QAAAL,CAAO,CAGpF,CApBsBO,EAAAb,EAAA",
6
+ "names": ["loadRepo", "diagnose", "FIXES", "lineDelta", "Plan", "runSync", "root", "write", "repo", "before", "plan", "unfixed", "finding", "fix", "size", "touched", "changes", "change", "__name"]
7
+ }
@@ -0,0 +1,8 @@
1
+ import type { Repo } from '../repo.ts';
2
+ import type { Plan } from './plan.ts';
3
+ /**
4
+ * Replace every non-caller workflow whose name the family knows with its caller. The file keeps its
5
+ * name when it already has the family's, and is renamed to it otherwise (one caller per kind).
6
+ */
7
+ export declare function workflowFixes(repo: Repo, plan: Plan): void;
8
+ //# sourceMappingURL=workflows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/sync/workflows.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAItC;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAY1D"}
@@ -0,0 +1 @@
1
+ var c=Object.defineProperty;var r=(l,i)=>c(l,"name",{value:i,configurable:!0});import{WORKFLOW_REF as a}from"../workflow-callers.js";import{callerFile as s,callerKindForFile as d,renderCaller as w}from"../workflow-callers.js";const u=r(l=>l.includes(`uses: ${a}/`),"isCaller");function $(l,i){const t=new Set,f=l.files.filter(o=>/^\.github\/workflows\/[^/]+\.ya?ml$/.test(o));for(const o of f){if(u(l.read(o)??""))continue;const e=d(o);if(e===null||t.has(e))continue;t.add(e);const n=`.github/workflows/${s(e)}`;n!==o&&i.delete(o,`replaced by ${s(e)}`),i.write(n,w(e),`caller of ${e}`)}}r($,"workflowFixes");export{$ as workflowFixes};
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/sync/workflows.ts"],
4
+ "sourcesContent": ["import { WORKFLOW_REF } from '../workflow-callers.ts';\nimport { callerFile, callerKindForFile, renderCaller } from '../workflow-callers.ts';\nimport type { Repo } from '../repo.ts';\nimport type { Plan } from './plan.ts';\n\nconst isCaller = (content: string): boolean => content.includes(`uses: ${WORKFLOW_REF}/`);\n\n/**\n * Replace every non-caller workflow whose name the family knows with its caller. The file keeps its\n * name when it already has the family's, and is renamed to it otherwise (one caller per kind).\n */\nexport function workflowFixes(repo: Repo, plan: Plan): void {\n const claimed = new Set<string>();\n const workflows = repo.files.filter((entry) => /^\\.github\\/workflows\\/[^/]+\\.ya?ml$/.test(entry));\n for (const file of workflows) {\n if (isCaller(repo.read(file) ?? '')) continue;\n const kind = callerKindForFile(file);\n if (kind === null || claimed.has(kind)) continue;\n claimed.add(kind);\n const target = `.github/workflows/${callerFile(kind)}`;\n if (target !== file) plan.delete(file, `replaced by ${callerFile(kind)}`);\n plan.write(target, renderCaller(kind), `caller of ${kind}`);\n }\n}\n"],
5
+ "mappings": "+EAAA,OAAS,gBAAAA,MAAoB,yBAC7B,OAAS,cAAAC,EAAY,qBAAAC,EAAmB,gBAAAC,MAAoB,yBAI5D,MAAMC,EAAWC,EAACC,GAA6BA,EAAQ,SAAS,SAASN,CAAY,GAAG,EAAvE,YAMX,SAAUO,EAAcC,EAAYC,EAAU,CAClD,MAAMC,EAAU,IAAI,IACdC,EAAYH,EAAK,MAAM,OAAQI,GAAU,sCAAsC,KAAKA,CAAK,CAAC,EAChG,UAAWC,KAAQF,EAAW,CAC5B,GAAIP,EAASI,EAAK,KAAKK,CAAI,GAAK,EAAE,EAAG,SACrC,MAAMC,EAAOZ,EAAkBW,CAAI,EACnC,GAAIC,IAAS,MAAQJ,EAAQ,IAAII,CAAI,EAAG,SACxCJ,EAAQ,IAAII,CAAI,EAChB,MAAMC,EAAS,qBAAqBd,EAAWa,CAAI,CAAC,GAChDC,IAAWF,GAAMJ,EAAK,OAAOI,EAAM,eAAeZ,EAAWa,CAAI,CAAC,EAAE,EACxEL,EAAK,MAAMM,EAAQZ,EAAaW,CAAI,EAAG,aAAaA,CAAI,EAAE,CAC5D,CACF,CAZgBT,EAAAE,EAAA",
6
+ "names": ["WORKFLOW_REF", "callerFile", "callerKindForFile", "renderCaller", "isCaller", "__name", "content", "workflowFixes", "repo", "plan", "claimed", "workflows", "entry", "file", "kind", "target"]
7
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This CLI's own version, which is the SDK version it knows (the packages release in lockstep).
3
+ * Read from the package's `package.json` beside `dist/` (or `src/`), so it is offline and cannot drift.
4
+ */
5
+ export declare const CLI_VERSION: string;
6
+ /**
7
+ * `[major, minor, patch]` of the first semver in a range or version (`^1.12.0` is `[1, 12, 0]`), or null.
8
+ */
9
+ export declare function parseVersion(spec: string): [number, number, number] | null;
10
+ /**
11
+ * Whether `a` is at least `b` on major.minor (patch releases never matter to "is the repo current").
12
+ */
13
+ export declare function atLeastMinor(a: readonly number[], b: readonly number[]): boolean;
14
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,MAGtB,CAAC;AAEL;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAG1E;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAEhF"}
@@ -0,0 +1 @@
1
+ var t=Object.defineProperty;var n=(e,r)=>t(e,"name",{value:r,configurable:!0});import{readFileSync as o}from"node:fs";const s=(()=>{const e=o(new URL("../package.json",import.meta.url),"utf8");return JSON.parse(e).version})();function a(e){const r=/(\d{1,9})\.(\d{1,9})\.(\d{1,9})/.exec(e);return r===null?null:[Number(r[1]),Number(r[2]),Number(r[3])]}n(a,"parseVersion");function i(e,r){return e[0]===r[0]?(e[1]??0)>=(r[1]??0):(e[0]??0)>(r[0]??0)}n(i,"atLeastMinor");export{s as CLI_VERSION,i as atLeastMinor,a as parseVersion};
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/version.ts"],
4
+ "sourcesContent": ["import { readFileSync } from 'node:fs';\n\n/**\n * This CLI's own version, which is the SDK version it knows (the packages release in lockstep).\n * Read from the package's `package.json` beside `dist/` (or `src/`), so it is offline and cannot drift.\n */\nexport const CLI_VERSION: string = (() => {\n const raw = readFileSync(new URL('../package.json', import.meta.url), 'utf8');\n return (JSON.parse(raw) as { version: string }).version;\n})();\n\n/**\n * `[major, minor, patch]` of the first semver in a range or version (`^1.12.0` is `[1, 12, 0]`), or null.\n */\nexport function parseVersion(spec: string): [number, number, number] | null {\n const match = /(\\d{1,9})\\.(\\d{1,9})\\.(\\d{1,9})/.exec(spec);\n return match === null ? null : [Number(match[1]), Number(match[2]), Number(match[3])];\n}\n\n/**\n * Whether `a` is at least `b` on major.minor (patch releases never matter to \"is the repo current\").\n */\nexport function atLeastMinor(a: readonly number[], b: readonly number[]): boolean {\n return a[0] === b[0] ? (a[1] ?? 0) >= (b[1] ?? 0) : (a[0] ?? 0) > (b[0] ?? 0);\n}\n"],
5
+ "mappings": "+EAAA,OAAS,gBAAAA,MAAoB,UAMtB,MAAMC,GAAuB,IAAK,CACvC,MAAMC,EAAMF,EAAa,IAAI,IAAI,kBAAmB,YAAY,GAAG,EAAG,MAAM,EAC5E,OAAQ,KAAK,MAAME,CAAG,EAA0B,OAClD,GAAE,EAKI,SAAUC,EAAaC,EAAY,CACvC,MAAMC,EAAQ,kCAAkC,KAAKD,CAAI,EACzD,OAAOC,IAAU,KAAO,KAAO,CAAC,OAAOA,EAAM,CAAC,CAAC,EAAG,OAAOA,EAAM,CAAC,CAAC,EAAG,OAAOA,EAAM,CAAC,CAAC,CAAC,CACtF,CAHgBC,EAAAH,EAAA,gBAQV,SAAUI,EAAaC,EAAsBC,EAAoB,CACrE,OAAOD,EAAE,CAAC,IAAMC,EAAE,CAAC,GAAKD,EAAE,CAAC,GAAK,KAAOC,EAAE,CAAC,GAAK,IAAMD,EAAE,CAAC,GAAK,IAAMC,EAAE,CAAC,GAAK,EAC7E,CAFgBH,EAAAC,EAAA",
6
+ "names": ["readFileSync", "CLI_VERSION", "raw", "parseVersion", "spec", "match", "__name", "atLeastMinor", "a", "b"]
7
+ }
@@ -0,0 +1,26 @@
1
+ import type { FamilyManifest } from '@rexezuge/tooling/manifest';
2
+ /**
3
+ * The SDK's reusable workflows, which a consumer calls instead of copying (RFC 0001, "Repo workflows").
4
+ * They land in the SDK's `.github/workflows` and are tagged `v1`; until then the callers below are the contract.
5
+ */
6
+ export declare const WORKFLOW_REF = "Rexezuge-CloudflareWorkers/SDK/.github/workflows";
7
+ export declare const WORKFLOW_TAG = "v1";
8
+ export type CallerKind = 'ci' | 'cd' | 'version-update' | 'backup-d1' | 'backup-main' | 'upstream-sync';
9
+ /**
10
+ * A caller workflow: the whole file is one `uses:` of the SDK's reusable workflow with the repo's secrets.
11
+ */
12
+ export declare function renderCaller(kind: CallerKind): string;
13
+ /**
14
+ * The callers a repo with these features carries: CI, CD and the version bump always; the nightly D1 backup with `backupD1`.
15
+ */
16
+ export declare function callersFor(manifest: FamilyManifest | null): Array<{
17
+ path: string;
18
+ content: string;
19
+ }>;
20
+ /**
21
+ * Which caller replaces a workflow file, by the file name a consumer repo uses. Unknown names return null:
22
+ * a workflow the family has no equivalent for is the repo's own and is never replaced.
23
+ */
24
+ export declare function callerKindForFile(file: string): CallerKind | null;
25
+ export declare function callerFile(kind: CallerKind): string;
26
+ //# sourceMappingURL=workflow-callers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-callers.d.ts","sourceRoot":"","sources":["../src/workflow-callers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,YAAY,qDAAqD,CAAC;AAC/E,eAAO,MAAM,YAAY,OAAO,CAAC;AAEjC,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,gBAAgB,GAAG,WAAW,GAAG,aAAa,GAAG,eAAe,CAAC;AAgDxG;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAcrD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAIpG;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAiBjE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAEnD"}
@@ -0,0 +1,34 @@
1
+ var s=Object.defineProperty;var r=(e,n)=>s(e,"name",{value:n,configurable:!0});const t="Rexezuge-CloudflareWorkers/SDK/.github/workflows",u="v1",c={ci:{file:"continuous-integration.yml",workflow:"worker-ci",name:"Continuous Integration",on:`on:
2
+ push:
3
+ branches: [main]
4
+ pull_request:
5
+ workflow_dispatch:
6
+ `},cd:{file:"continuous-deployment.yml",workflow:"worker-cd",name:"Continuous Deployment",on:`on:
7
+ workflow_run:
8
+ workflows: ['Continuous Integration']
9
+ types: [completed]
10
+ branches: [main]
11
+ workflow_dispatch:
12
+ `},"version-update":{file:"scheduled-version-update.yml",workflow:"version-update",name:"Scheduled Version Update",on:`on:
13
+ schedule:
14
+ - cron: '0 0 1,15 * *'
15
+ workflow_dispatch:
16
+ `},"backup-d1":{file:"backup-d1.yml",workflow:"backup-d1",name:"Backup D1",on:`on:
17
+ schedule:
18
+ - cron: '0 3 * * *'
19
+ workflow_dispatch:
20
+ `},"backup-main":{file:"backup-main.yml",workflow:"backup-main",name:"Backup Main",on:`on:
21
+ push:
22
+ branches: [main]
23
+ schedule:
24
+ - cron: '0 0 5 * *'
25
+ `},"upstream-sync":{file:"upstream-sync.yml",workflow:"upstream-sync",name:"Upstream Sync",on:`on:
26
+ schedule:
27
+ - cron: '0 6 * * 1'
28
+ workflow_dispatch:
29
+ `}};function a(e){const n=c[e],o=e==="version-update"?`permissions:
30
+ contents: write
31
+
32
+ `:"";return[`# A thin caller: the pipeline lives in ${t}/${n.workflow}.yml (tag v1).`,"# Jobs switch on .rexezuge.jsonc features; change behaviour there or in the SDK, not here.",`name: ${n.name}
33
+ `,n.on,`${o}jobs:`,` ${n.workflow}:`,` uses: ${t}/${n.workflow}.yml@v1`," secrets: inherit",""].join(`
34
+ `)}r(a,"renderCaller");function l(e){const n=["ci","cd","version-update"];return e?.features?.backupD1===!0&&n.push("backup-d1"),n.map(o=>({path:`.github/workflows/${c[o].file}`,content:a(o)}))}r(l,"callersFor");function p(e){const n=e.replace(/^.*\//,"").replace(/\.ya?ml$/,"");return{"continuous-integration":"ci",ci:"ci","worker-ci":"ci","continuous-deployment":"cd",cd:"cd",deploy:"cd","worker-cd":"cd","scheduled-version-update":"version-update","version-update":"version-update","backup-d1":"backup-d1","backup-main":"backup-main","upstream-sync":"upstream-sync"}[n]??null}r(p,"callerKindForFile");function d(e){return c[e].file}r(d,"callerFile");export{t as WORKFLOW_REF,u as WORKFLOW_TAG,d as callerFile,p as callerKindForFile,l as callersFor,a as renderCaller};
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/workflow-callers.ts"],
4
+ "sourcesContent": ["import type { FamilyManifest } from '@rexezuge/tooling/manifest';\n\n/**\n * The SDK's reusable workflows, which a consumer calls instead of copying (RFC 0001, \"Repo workflows\").\n * They land in the SDK's `.github/workflows` and are tagged `v1`; until then the callers below are the contract.\n */\nexport const WORKFLOW_REF = 'Rexezuge-CloudflareWorkers/SDK/.github/workflows';\nexport const WORKFLOW_TAG = 'v1';\n\nexport type CallerKind = 'ci' | 'cd' | 'version-update' | 'backup-d1' | 'backup-main' | 'upstream-sync';\n\ninterface CallerSpec {\n readonly file: string;\n readonly workflow: string;\n readonly name: string;\n readonly on: string;\n}\n\nconst SPECS: Record<CallerKind, CallerSpec> = {\n ci: {\n file: 'continuous-integration.yml',\n workflow: 'worker-ci',\n name: 'Continuous Integration',\n on: 'on:\\n push:\\n branches: [main]\\n pull_request:\\n workflow_dispatch:\\n',\n },\n cd: {\n file: 'continuous-deployment.yml',\n workflow: 'worker-cd',\n name: 'Continuous Deployment',\n on: \"on:\\n workflow_run:\\n workflows: ['Continuous Integration']\\n types: [completed]\\n branches: [main]\\n workflow_dispatch:\\n\",\n },\n 'version-update': {\n file: 'scheduled-version-update.yml',\n workflow: 'version-update',\n name: 'Scheduled Version Update',\n on: \"on:\\n schedule:\\n - cron: '0 0 1,15 * *'\\n workflow_dispatch:\\n\",\n },\n 'backup-d1': {\n file: 'backup-d1.yml',\n workflow: 'backup-d1',\n name: 'Backup D1',\n on: \"on:\\n schedule:\\n - cron: '0 3 * * *'\\n workflow_dispatch:\\n\",\n },\n 'backup-main': {\n file: 'backup-main.yml',\n workflow: 'backup-main',\n name: 'Backup Main',\n on: \"on:\\n push:\\n branches: [main]\\n schedule:\\n - cron: '0 0 5 * *'\\n\",\n },\n 'upstream-sync': {\n file: 'upstream-sync.yml',\n workflow: 'upstream-sync',\n name: 'Upstream Sync',\n on: \"on:\\n schedule:\\n - cron: '0 6 * * 1'\\n workflow_dispatch:\\n\",\n },\n};\n\n/**\n * A caller workflow: the whole file is one `uses:` of the SDK's reusable workflow with the repo's secrets.\n */\nexport function renderCaller(kind: CallerKind): string {\n const spec = SPECS[kind];\n const permissions = kind === 'version-update' ? 'permissions:\\n contents: write\\n\\n' : '';\n return [\n `# A thin caller: the pipeline lives in ${WORKFLOW_REF}/${spec.workflow}.yml (tag ${WORKFLOW_TAG}).`,\n `# Jobs switch on .rexezuge.jsonc features; change behaviour there or in the SDK, not here.`,\n `name: ${spec.name}\\n`,\n spec.on,\n `${permissions}jobs:`,\n ` ${spec.workflow}:`,\n ` uses: ${WORKFLOW_REF}/${spec.workflow}.yml@${WORKFLOW_TAG}`,\n ' secrets: inherit',\n '',\n ].join('\\n');\n}\n\n/**\n * The callers a repo with these features carries: CI, CD and the version bump always; the nightly D1 backup with `backupD1`.\n */\nexport function callersFor(manifest: FamilyManifest | null): Array<{ path: string; content: string }> {\n const kinds: CallerKind[] = ['ci', 'cd', 'version-update'];\n if (manifest?.features?.backupD1 === true) kinds.push('backup-d1');\n return kinds.map((kind) => ({ path: `.github/workflows/${SPECS[kind].file}`, content: renderCaller(kind) }));\n}\n\n/**\n * Which caller replaces a workflow file, by the file name a consumer repo uses. Unknown names return null:\n * a workflow the family has no equivalent for is the repo's own and is never replaced.\n */\nexport function callerKindForFile(file: string): CallerKind | null {\n const base = file.replace(/^.*\\//, '').replace(/\\.ya?ml$/, '');\n const table: Record<string, CallerKind> = {\n 'continuous-integration': 'ci',\n ci: 'ci',\n 'worker-ci': 'ci',\n 'continuous-deployment': 'cd',\n cd: 'cd',\n deploy: 'cd',\n 'worker-cd': 'cd',\n 'scheduled-version-update': 'version-update',\n 'version-update': 'version-update',\n 'backup-d1': 'backup-d1',\n 'backup-main': 'backup-main',\n 'upstream-sync': 'upstream-sync',\n };\n return table[base] ?? null;\n}\n\nexport function callerFile(kind: CallerKind): string {\n return SPECS[kind].file;\n}\n"],
5
+ "mappings": "+EAMO,MAAMA,EAAe,mDACfC,EAAe,KAWtBC,EAAwC,CAC5C,GAAI,CACF,KAAM,6BACN,SAAU,YACV,KAAM,yBACN,GAAI;;;;;GAEN,GAAI,CACF,KAAM,4BACN,SAAU,YACV,KAAM,wBACN,GAAI;;;;;;GAEN,iBAAkB,CAChB,KAAM,+BACN,SAAU,iBACV,KAAM,2BACN,GAAI;;;;GAEN,YAAa,CACX,KAAM,gBACN,SAAU,YACV,KAAM,YACN,GAAI;;;;GAEN,cAAe,CACb,KAAM,kBACN,SAAU,cACV,KAAM,cACN,GAAI;;;;;GAEN,gBAAiB,CACf,KAAM,oBACN,SAAU,gBACV,KAAM,gBACN,GAAI;;;;IAOF,SAAUC,EAAaC,EAAgB,CAC3C,MAAMC,EAAOH,EAAME,CAAI,EACjBE,EAAcF,IAAS,iBAAmB;;;EAAwC,GACxF,MAAO,CACL,0CAA0CJ,CAAY,IAAIK,EAAK,QAAQ,iBACvE,6FACA,SAASA,EAAK,IAAI;EAClBA,EAAK,GACL,GAAGC,CAAW,QACd,KAAKD,EAAK,QAAQ,IAClB,aAAaL,CAAY,IAAIK,EAAK,QAAQ,UAC1C,uBACA,IACA,KAAK;CAAI,CACb,CAdgBE,EAAAJ,EAAA,gBAmBV,SAAUK,EAAWC,EAA+B,CACxD,MAAMC,EAAsB,CAAC,KAAM,KAAM,gBAAgB,EACzD,OAAID,GAAU,UAAU,WAAa,IAAMC,EAAM,KAAK,WAAW,EAC1DA,EAAM,IAAKN,IAAU,CAAE,KAAM,qBAAqBF,EAAME,CAAI,EAAE,IAAI,GAAI,QAASD,EAAaC,CAAI,CAAC,EAAG,CAC7G,CAJgBG,EAAAC,EAAA,cAUV,SAAUG,EAAkBC,EAAY,CAC5C,MAAMC,EAAOD,EAAK,QAAQ,QAAS,EAAE,EAAE,QAAQ,WAAY,EAAE,EAe7D,MAd0C,CACxC,yBAA0B,KAC1B,GAAI,KACJ,YAAa,KACb,wBAAyB,KACzB,GAAI,KACJ,OAAQ,KACR,YAAa,KACb,2BAA4B,iBAC5B,iBAAkB,iBAClB,YAAa,YACb,cAAe,cACf,gBAAiB,iBAENC,CAAI,GAAK,IACxB,CAjBgBN,EAAAI,EAAA,qBAmBV,SAAUG,EAAWV,EAAgB,CACzC,OAAOF,EAAME,CAAI,EAAE,IACrB,CAFgBG,EAAAO,EAAA",
6
+ "names": ["WORKFLOW_REF", "WORKFLOW_TAG", "SPECS", "renderCaller", "kind", "spec", "permissions", "__name", "callersFor", "manifest", "kinds", "callerKindForFile", "file", "base", "callerFile"]
7
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * A reader and editor for the three `pnpm-workspace.yaml` sections doctor and sync care about
3
+ * (`catalog`, `catalogs`, `overrides`), without a YAML dependency. It understands the shape pnpm
4
+ * writes (two-space indentation, `key: value`, quoted keys) and leaves every other line untouched.
5
+ */
6
+ export interface WorkspaceYaml {
7
+ readonly text: string;
8
+ /**
9
+ Entries of the default `catalog:` section.
10
+ */
11
+ readonly catalog: ReadonlyMap<string, string>;
12
+ /**
13
+ Entries of every named catalog under `catalogs:`.
14
+ */
15
+ readonly namedCatalogs: ReadonlyMap<string, ReadonlyMap<string, string>>;
16
+ readonly overrides: ReadonlyMap<string, string>;
17
+ }
18
+ export declare function parseWorkspaceYaml(text: string): WorkspaceYaml;
19
+ /**
20
+ * Set entries in the default `catalog:` section: existing keys are rewritten in place, new ones appended,
21
+ * and the section is created at the end of the file when absent.
22
+ */
23
+ export declare function setCatalogEntries(text: string, entries: ReadonlyMap<string, string>): string;
24
+ /**
25
+ * Remove `overrides:` entries whose key matches, dropping the section header when it empties.
26
+ */
27
+ export declare function removeOverrides(text: string, matches: (key: string) => boolean): string;
28
+ //# sourceMappingURL=workspace-yaml.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-yaml.d.ts","sourceRoot":"","sources":["../src/workspace-yaml.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;MAEE;IACF,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C;;MAEE;IACF,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACzE,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjD;AAmDD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAmB9D;AAID;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAsB5F;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,GAAG,MAAM,CAcvF"}
@@ -0,0 +1,12 @@
1
+ var $=Object.defineProperty;var c=(t,r)=>$(t,"name",{value:r,configurable:!0});function p(t){const r=t.indexOf(" #"),e=(r===-1?t:t.slice(0,r)).trim(),n=e[0];return(n==="'"||n==='"')&&e.endsWith(n)&&e.length>=2?e.slice(1,-1):e}c(p,"unquote");function a(t){const r=t.trim();if(r===""||r.startsWith("#"))return null;const e=r[0];let n;if(e==="'"||e==='"'){if(n=r.indexOf(e,1),n<0)return null;n+=1}else if(n=r.indexOf(":"),n<0)return null;const o=r.indexOf(":",n);return o===-1?null:[p(r.slice(0,n)),p(r.slice(o+1))]}c(a,"splitEntry");function d(t,r){const e=t.findIndex(o=>o.trimEnd()===`${r}:`);if(e===-1)return null;let n=e+1;for(;n<t.length&&(t[n]===""||/^\s/.test(t[n]??""));)n+=1;for(;n>e+1&&t[n-1]==="";)n-=1;return{header:e,start:e+1,end:n}}c(d,"sectionRange");function g(t,r){const e=d(t,r),n=new Map;if(e===null)return n;for(const o of t.slice(e.start,e.end)){const l=a(o);l!==null&&n.set(l[0],l[1])}return n}c(g,"entriesOf");function y(t){const r=t.split(`
2
+ `),e=new Map,n=d(r,"catalogs");if(n!==null){let o=null;for(const l of r.slice(n.start,n.end)){const i=/^ */.exec(l)?.[0].length??0,s=a(l);s!==null&&(i<=2&&s[1]===""?(o=new Map,e.set(s[0],o)):o!==null&&o.set(s[0],s[1]))}}return{text:t,catalog:g(r,"catalog"),namedCatalogs:e,overrides:g(r,"overrides")}}c(y,"parseWorkspaceYaml");const f=c(t=>`'${t}'`,"quoteKey");function v(t,r){const e=t.split(`
3
+ `),n=d(e,"catalog");if(n===null){const i=[...r].map(([u,m])=>` ${f(u)}: ${m}`),s=t.endsWith(`
4
+ `)||t===""?t:`${t}
5
+ `;return`${s}${s===""?"":`
6
+ `}catalog:
7
+ ${i.join(`
8
+ `)}
9
+ `}const o=new Map(r);for(let i=n.start;i<n.end;i+=1){const s=a(e[i]??""),u=s===null?void 0:o.get(s[0]);s===null||u===void 0||(e[i]=` ${f(s[0])}: ${u}`,o.delete(s[0]))}const l=[...o].map(([i,s])=>` ${f(i)}: ${s}`);return e.splice(n.end,0,...l),e.join(`
10
+ `)}c(v,"setCatalogEntries");function O(t,r){const e=t.split(`
11
+ `),n=d(e,"overrides");if(n===null)return t;const o=e.filter((i,s)=>{if(s<n.start||s>=n.end)return!0;const u=a(i);return u===null||!r(u[0])}),l=d(o,"overrides");return l!==null&&o.slice(l.start,l.end).every(i=>a(i)===null)&&o.splice(l.header,l.end-l.header),o.join(`
12
+ `)}c(O,"removeOverrides");export{y as parseWorkspaceYaml,O as removeOverrides,v as setCatalogEntries};
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/workspace-yaml.ts"],
4
+ "sourcesContent": ["/**\n * A reader and editor for the three `pnpm-workspace.yaml` sections doctor and sync care about\n * (`catalog`, `catalogs`, `overrides`), without a YAML dependency. It understands the shape pnpm\n * writes (two-space indentation, `key: value`, quoted keys) and leaves every other line untouched.\n */\n\nexport interface WorkspaceYaml {\n readonly text: string;\n /**\n Entries of the default `catalog:` section.\n */\n readonly catalog: ReadonlyMap<string, string>;\n /**\n Entries of every named catalog under `catalogs:`.\n */\n readonly namedCatalogs: ReadonlyMap<string, ReadonlyMap<string, string>>;\n readonly overrides: ReadonlyMap<string, string>;\n}\n\nfunction unquote(raw: string): string {\n const comment = raw.indexOf(' #');\n const trimmed = (comment === -1 ? raw : raw.slice(0, comment)).trim();\n const quote = trimmed[0];\n return (quote === \"'\" || quote === '\"') && trimmed.endsWith(quote) && trimmed.length >= 2 ? trimmed.slice(1, -1) : trimmed;\n}\n\nfunction splitEntry(line: string): [string, string] | null {\n const body = line.trim();\n if (body === '' || body.startsWith('#')) return null;\n const quote = body[0];\n let keyEnd: number;\n if (quote === \"'\" || quote === '\"') {\n keyEnd = body.indexOf(quote, 1);\n if (keyEnd < 0) return null;\n keyEnd += 1;\n } else {\n keyEnd = body.indexOf(':');\n if (keyEnd < 0) return null;\n }\n const colon = body.indexOf(':', keyEnd);\n if (colon === -1) return null;\n return [unquote(body.slice(0, keyEnd)), unquote(body.slice(colon + 1))];\n}\n\n/**\n * The line range `[start, end)` of a top-level section's body (the lines under `name:`), or null.\n */\nfunction sectionRange(lines: readonly string[], name: string): { header: number; start: number; end: number } | null {\n const header = lines.findIndex((line) => line.trimEnd() === `${name}:`);\n if (header === -1) return null;\n let end = header + 1;\n while (end < lines.length && (lines[end] === '' || /^\\s/.test(lines[end] ?? ''))) end += 1;\n // Trailing blank lines belong to the gap between sections, not to the body.\n while (end > header + 1 && lines[end - 1] === '') end -= 1;\n return { header, start: header + 1, end };\n}\n\nfunction entriesOf(lines: readonly string[], name: string): Map<string, string> {\n const range = sectionRange(lines, name);\n const out = new Map<string, string>();\n if (range === null) return out;\n for (const line of lines.slice(range.start, range.end)) {\n const entry = splitEntry(line);\n if (entry !== null) out.set(entry[0], entry[1]);\n }\n return out;\n}\n\nexport function parseWorkspaceYaml(text: string): WorkspaceYaml {\n const lines = text.split('\\n');\n const named = new Map<string, Map<string, string>>();\n const catalogs = sectionRange(lines, 'catalogs');\n if (catalogs !== null) {\n let current: Map<string, string> | null = null;\n for (const line of lines.slice(catalogs.start, catalogs.end)) {\n const indent = /^ */.exec(line)?.[0].length ?? 0;\n const entry = splitEntry(line);\n if (entry === null) continue;\n if (indent <= 2 && entry[1] === '') {\n current = new Map();\n named.set(entry[0], current);\n } else if (current !== null) {\n current.set(entry[0], entry[1]);\n }\n }\n }\n return { text, catalog: entriesOf(lines, 'catalog'), namedCatalogs: named, overrides: entriesOf(lines, 'overrides') };\n}\n\nconst quoteKey = (key: string): string => `'${key}'`;\n\n/**\n * Set entries in the default `catalog:` section: existing keys are rewritten in place, new ones appended,\n * and the section is created at the end of the file when absent.\n */\nexport function setCatalogEntries(text: string, entries: ReadonlyMap<string, string>): string {\n const lines = text.split('\\n');\n const range = sectionRange(lines, 'catalog');\n if (range === null) {\n const body = [...entries].map(([key, version]) => ` ${quoteKey(key)}: ${version}`);\n const base = text.endsWith('\\n') || text === '' ? text : `${text}\\n`;\n return `${base}${base === '' ? '' : '\\n'}catalog:\\n${body.join('\\n')}\\n`;\n }\n const pending = new Map(entries);\n for (let index = range.start; index < range.end; index += 1) {\n const entry = splitEntry(lines[index] ?? '');\n const next = entry === null ? undefined : pending.get(entry[0]);\n if (entry === null || next === undefined) {\n continue;\n }\n\n lines[index] = ` ${quoteKey(entry[0])}: ${next}`;\n pending.delete(entry[0]);\n }\n const added = [...pending].map(([key, version]) => ` ${quoteKey(key)}: ${version}`);\n lines.splice(range.end, 0, ...added);\n return lines.join('\\n');\n}\n\n/**\n * Remove `overrides:` entries whose key matches, dropping the section header when it empties.\n */\nexport function removeOverrides(text: string, matches: (key: string) => boolean): string {\n const lines = text.split('\\n');\n const range = sectionRange(lines, 'overrides');\n if (range === null) return text;\n const kept = lines.filter((line, index) => {\n if (index < range.start || index >= range.end) return true;\n const entry = splitEntry(line);\n return entry === null || !matches(entry[0]);\n });\n const after = sectionRange(kept, 'overrides');\n if (after !== null && kept.slice(after.start, after.end).every((line) => splitEntry(line) === null)) {\n kept.splice(after.header, after.end - after.header);\n }\n return kept.join('\\n');\n}\n"],
5
+ "mappings": "+EAmBA,SAASA,EAAQC,EAAW,CAC1B,MAAMC,EAAUD,EAAI,QAAQ,IAAI,EAC1BE,GAAWD,IAAY,GAAKD,EAAMA,EAAI,MAAM,EAAGC,CAAO,GAAG,KAAI,EAC7DE,EAAQD,EAAQ,CAAC,EACvB,OAAQC,IAAU,KAAOA,IAAU,MAAQD,EAAQ,SAASC,CAAK,GAAKD,EAAQ,QAAU,EAAIA,EAAQ,MAAM,EAAG,EAAE,EAAIA,CACrH,CALSE,EAAAL,EAAA,WAOT,SAASM,EAAWC,EAAY,CAC9B,MAAMC,EAAOD,EAAK,KAAI,EACtB,GAAIC,IAAS,IAAMA,EAAK,WAAW,GAAG,EAAG,OAAO,KAChD,MAAMJ,EAAQI,EAAK,CAAC,EACpB,IAAIC,EACJ,GAAIL,IAAU,KAAOA,IAAU,IAAK,CAElC,GADAK,EAASD,EAAK,QAAQJ,EAAO,CAAC,EAC1BK,EA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,CAAC,EAC1DA,IAAU,MAAQe,IAAS,SAI/BtB,EAAMqB,CAAK,EAAI,KAAKP,EAASP,EAAM,CAAC,CAAC,CAAC,KAAKe,CAAI,GAC/CF,EAAQ,OAAOb,EAAM,CAAC,CAAC,EACzB,CACA,MAAMgB,EAAQ,CAAC,GAAGH,CAAO,EAAE,IAAI,CAAC,CAACL,EAAKG,CAAO,IAAM,KAAKJ,EAASC,CAAG,CAAC,KAAKG,CAAO,EAAE,EACnF,OAAAlB,EAAM,OAAOK,EAAM,IAAK,EAAG,GAAGkB,CAAK,EAC5BvB,EAAM,KAAK;CAAI,CACxB,CAtBgBP,EAAAuB,EAAA,qBA2BV,SAAUQ,EAAgBf,EAAcgB,EAAiC,CAC7E,MAAMzB,EAAQS,EAAK,MAAM;CAAI,EACvBJ,EAAQN,EAAaC,EAAO,WAAW,EAC7C,GAAIK,IAAU,KAAM,OAAOI,EAC3B,MAAMiB,EAAO1B,EAAM,OAAO,CAACL,EAAM0B,IAAS,CACxC,GAAIA,EAAQhB,EAAM,OAASgB,GAAShB,EAAM,IAAK,MAAO,GACtD,MAAME,EAAQb,EAAWC,CAAI,EAC7B,OAAOY,IAAU,MAAQ,CAACkB,EAAQlB,EAAM,CAAC,CAAC,CAC5C,CAAC,EACKoB,EAAQ5B,EAAa2B,EAAM,WAAW,EAC5C,OAAIC,IAAU,MAAQD,EAAK,MAAMC,EAAM,MAAOA,EAAM,GAAG,EAAE,MAAOhC,GAASD,EAAWC,CAAI,IAAM,IAAI,GAChG+B,EAAK,OAAOC,EAAM,OAAQA,EAAM,IAAMA,EAAM,MAAM,EAE7CD,EAAK,KAAK;CAAI,CACvB,CAdgBjC,EAAA+B,EAAA",
6
+ "names": ["unquote", "raw", "comment", "trimmed", "quote", "__name", "splitEntry", "line", "body", "keyEnd", "colon", "sectionRange", "lines", "name", "header", "end", "entriesOf", "range", "out", "entry", "parseWorkspaceYaml", "text", "named", "catalogs", "current", "indent", "quoteKey", "key", "setCatalogEntries", "entries", "version", "base", "pending", "index", "next", "added", "removeOverrides", "matches", "kept", "after"]
7
+ }