@warpgogol/repo-extract 1.2.8 → 1.2.9

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.
package/README.md CHANGED
@@ -4,6 +4,10 @@
4
4
 
5
5
  Extract apps and packages from a TurboRepo monorepo into standalone public repositories.
6
6
 
7
+ > Engineered at [Warpgogol](https://warpgogol.com) · Released as open source.
8
+
9
+ ---
10
+
7
11
  ## Features
8
12
 
9
13
  - Extracts one or more workspace projects from a Turborepo monorepo
@@ -139,12 +143,21 @@ await extractProject(config, { dest: "../my-package" });
139
143
  | ------------------------------------------ | -------------------------------------------- |
140
144
  | `extractProject(config, options)` | Run the full extraction pipeline |
141
145
  | `loadConfig(path)` | Load and validate an `extract.config.yaml` |
146
+ | `ExtractConfigSchema` | Zod schema for extract config validation |
147
+ | `detectPackageManager(root)` | Detect package manager from lockfiles |
142
148
  | `scanForSecrets(dir)` | Scan a directory for secret patterns |
143
149
  | `transferGitHistory(root, dest, prefixes)` | Transfer filtered git history |
144
150
  | `commitExport(dest, message, gitConfig)` | Commit and optionally push |
145
- | `generateCiWorkflow()` | Generate a GitHub Actions CI workflow string |
151
+ | `diffSummary(...)` | Generate diff summary for changes |
152
+ | `generateCiWorkflow(pm, ci?)` | Generate a GitHub Actions CI workflow string |
146
153
  | `fixStandalonePackageJson(dest)` | Fix package.json for standalone export |
147
154
  | `fixStandaloneVitestConfig(dest)` | Fix vitest.config.ts for standalone export |
155
+ | `buildGitignore(extra, config)` | Build .gitignore content |
156
+ | `buildRootPackageJson(config)` | Build root package.json for monorepo export |
157
+ | `isIgnored(path, patterns)` | Check if path matches ignore patterns |
158
+ | `SecretScanError` | Error thrown when secrets are found |
159
+ | `GitOperationError` | Error thrown on git operation failure |
160
+ | `PackageManagerError` | Error thrown on package manager failure |
148
161
 
149
162
  ## Changelog
150
163
 
@@ -159,3 +172,11 @@ await extractProject(config, { dest: "../my-package" });
159
172
  ## License
160
173
 
161
174
  Apache-2.0 — see [LICENSE](LICENSE)
175
+
176
+ ## Open Engineering
177
+
178
+ This package originated from production engineering work at [Warpgogol](https://warpgogol.com), an engineering studio in Germany.
179
+
180
+ We publish reusable parts of our infrastructure when they can be useful beyond our own projects. It is published independently of any Warpgogol commercial service. Using this package does not create any dependency on Warpgogol.
181
+
182
+ Built for real systems. Shared openly.
@@ -1 +1 @@
1
- {"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../src/changelog.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,eAAe,CAAC,CAyB1B"}
1
+ {"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../src/changelog.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAiBvC,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,eAAe,CAAC,CA2B1B"}
package/dist/changelog.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  <MODULE_CONTRACT>
3
- <purpose>Optional changelog-live integration via dynamic import.</purpose>
3
+ <purpose>Optional changelog-live integration via dynamic import. for reliable use by its direct callers and maintainers.</purpose>
4
4
  <non-goals>
5
5
  <item>Does not hard-depend on @warpgogol/changelog-live — it is an optional peer dependency.</item>
6
6
  </non-goals>
@@ -13,19 +13,36 @@
13
13
  */
14
14
  import { existsSync } from "node:fs";
15
15
  import * as path from "node:path";
16
+ import { execFileSync } from "node:child_process";
17
+ function loadEnvForChangelog(projectDir) {
18
+ try {
19
+ const repoRoot = execFileSync("git", ["rev-parse", "--show-toplevel"], {
20
+ cwd: projectDir,
21
+ encoding: "utf-8",
22
+ }).trim();
23
+ const envPath = path.join(repoRoot, ".env");
24
+ if (existsSync(envPath)) {
25
+ process.loadEnvFile(envPath);
26
+ }
27
+ }
28
+ catch {
29
+ // Not in a git repo or no .env — rely on existing process.env
30
+ }
31
+ }
16
32
  export async function tryGenerateChangelog(projectDir, logger) {
17
33
  const log = logger?.log ?? console.log;
18
34
  const changelogConfigPath = path.join(projectDir, "changelog.config.yaml");
19
35
  if (!existsSync(changelogConfigPath)) {
20
36
  return { skipped: true, sectionsGenerated: 0, filesWritten: [] };
21
37
  }
38
+ loadEnvForChangelog(projectDir);
22
39
  try {
23
40
  const mod = await import("@warpgogol/changelog-live");
24
41
  const { loadConfig, generateChangelog } = mod;
25
42
  const config = await loadConfig(changelogConfigPath);
26
43
  config.git.repoRoot = path.resolve(projectDir, config.git.repoRoot);
27
44
  config.output.dir = path.resolve(projectDir, config.output.dir);
28
- const result = await generateChangelog(config);
45
+ const result = await generateChangelog(config, { includeInProgress: true });
29
46
  return {
30
47
  skipped: result.skipped,
31
48
  commitMessage: result.commitMessage,
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  /*
3
3
  <MODULE_CONTRACT>
4
- <purpose>CLI entrypoint for @warpgogol/repo-extract.</purpose>
4
+ <purpose>CLI entrypoint for @warpgogol/repo-extract. for reliable use by its direct callers and maintainers.</purpose>
5
5
  <non-goals>
6
6
  <item>Does not implement extraction logic (see extract.ts).</item>
7
7
  </non-goals>
package/dist/config.d.ts CHANGED
@@ -48,7 +48,16 @@ declare const ExtractConfigSchema: z.ZodObject<{
48
48
  }>>;
49
49
  publish: z.ZodDefault<z.ZodBoolean>;
50
50
  nodeVersion: z.ZodDefault<z.ZodNumber>;
51
- provenance: z.ZodDefault<z.ZodBoolean>;
51
+ deploy: z.ZodOptional<z.ZodObject<{
52
+ provider: z.ZodLiteral<"cloudflare-pages">;
53
+ projectName: z.ZodString;
54
+ buildCommand: z.ZodString;
55
+ outputDir: z.ZodString;
56
+ apiTokenSecret: z.ZodDefault<z.ZodString>;
57
+ accountIdSecret: z.ZodOptional<z.ZodString>;
58
+ }, z.core.$strip>>;
59
+ workspaceFilter: z.ZodOptional<z.ZodString>;
60
+ skipBuild: z.ZodOptional<z.ZodBoolean>;
52
61
  }, z.core.$strip>>;
53
62
  gitignoreMode: z.ZodDefault<z.ZodEnum<{
54
63
  minimal: "minimal";
@@ -69,7 +78,6 @@ declare const ExtractConfigSchema: z.ZodObject<{
69
78
  minor: "minor";
70
79
  major: "major";
71
80
  }>>;
72
- stubPackages: z.ZodDefault<z.ZodArray<z.ZodString>>;
73
81
  }, z.core.$strip>;
74
82
  export declare function loadConfig(configPath: string): Promise<ExtractConfig>;
75
83
  export { ExtractConfigSchema };
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAkDhD,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8BvB,CAAC;AAEH,wBAAsB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAQ3E;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAwDhD,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6BvB,CAAC;AAEH,wBAAsB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAQ3E;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
package/dist/config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  <MODULE_CONTRACT>
3
- <purpose>Zod schema and loader for extract.config.yaml files.</purpose>
3
+ <purpose>Zod schema and loader for extract.config.yaml files. for reliable use by its direct callers and maintainers.</purpose>
4
4
  <non-goals>
5
5
  <item>Does not implement extraction logic (see extract.ts).</item>
6
6
  </non-goals>
@@ -33,10 +33,7 @@ const PatchRuleSchema = z
33
33
  replace: z.string().optional(),
34
34
  removeLinesMatching: z.string().optional(),
35
35
  })
36
- .refine((v) => v.removeLinesMatching !== undefined ||
37
- (v.find !== undefined && v.replace !== undefined), {
38
- message: "patch rule must have either (find + replace) or removeLinesMatching",
39
- });
36
+ .refine((v) => v.removeLinesMatching !== undefined || (v.find !== undefined && v.replace !== undefined), { message: "patch rule must have either (find + replace) or removeLinesMatching" });
40
37
  const DeleteRuleSchema = z.object({
41
38
  action: z.literal("delete"),
42
39
  path: z.string(),
@@ -46,12 +43,22 @@ const PostProcessRuleSchema = z.discriminatedUnion("action", [
46
43
  PatchRuleSchema,
47
44
  DeleteRuleSchema,
48
45
  ]);
46
+ const CloudflarePagesDeploySchema = z.object({
47
+ provider: z.literal("cloudflare-pages"),
48
+ projectName: z.string().min(1),
49
+ buildCommand: z.string().min(1),
50
+ outputDir: z.string().min(1),
51
+ apiTokenSecret: z.string().default("CLOUDFLARE_API_TOKEN"),
52
+ accountIdSecret: z.string().optional(),
53
+ });
49
54
  const CiConfigSchema = z.object({
50
55
  provider: z.enum(["github-actions", "none"]).default("github-actions"),
51
56
  packageManager: z.enum(["pnpm", "npm", "yarn"]).optional(),
52
57
  publish: z.boolean().default(true),
53
58
  nodeVersion: z.number().default(22),
54
- provenance: z.boolean().default(false),
59
+ deploy: CloudflarePagesDeploySchema.optional(),
60
+ workspaceFilter: z.string().optional(),
61
+ skipBuild: z.boolean().optional(),
55
62
  });
56
63
  const ExtractConfigSchema = z.object({
57
64
  projectDir: z.string().min(1),
@@ -82,7 +89,6 @@ const ExtractConfigSchema = z.object({
82
89
  excludeExtensions: z.array(z.string()).optional(),
83
90
  skipSecretScan: z.boolean().optional(),
84
91
  versionBump: z.enum(["patch", "minor", "major"]).optional(),
85
- stubPackages: z.array(z.string()).default([]),
86
92
  });
87
93
  export async function loadConfig(configPath) {
88
94
  const raw = await readFile(configPath, "utf-8");
@@ -1 +1 @@
1
- {"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../src/extract.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EACV,aAAa,EAEb,cAAc,EACd,aAAa,EAGd,MAAM,YAAY,CAAC;AAqCpB,wBAAsB,cAAc,CAClC,MAAM,EAAE,aAAa,EACrB,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,aAAa,CAAC,CAgExB"}
1
+ {"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../src/extract.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EACV,aAAa,EAEb,cAAc,EACd,aAAa,EAGd,MAAM,YAAY,CAAC;AAqCpB,wBAAsB,cAAc,CAClC,MAAM,EAAE,aAAa,EACrB,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,aAAa,CAAC,CAwDxB"}
package/dist/extract.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  <MODULE_CONTRACT>
3
- <purpose>Core extraction orchestrator — monorepo and standalone modes.</purpose>
3
+ <purpose>Core extraction orchestrator — monorepo and standalone modes. for reliable use by its direct callers and maintainers.</purpose>
4
4
  <non-goals>
5
5
  <item>Does not parse CLI args (see cli.ts).</item>
6
6
  </non-goals>
@@ -15,8 +15,8 @@
15
15
  <item>Fix: Added lockfile generation to exportStandalonePackage — standalone packages need lockfiles for --frozen-lockfile in CI.</item>
16
16
  </CHANGE_SUMMARY>
17
17
  */
18
- import { stat, cp, mkdir, writeFile, readFile, readdir, } from "node:fs/promises";
19
- import { readFileSync, existsSync } from "node:fs";
18
+ import { stat, cp, mkdir, writeFile, readFile } from "node:fs/promises";
19
+ import { readFileSync } from "node:fs";
20
20
  import { execFileSync } from "node:child_process";
21
21
  import * as path from "node:path";
22
22
  import { SecretScanError, PackageManagerError } from "./errors.js";
@@ -32,8 +32,7 @@ import { detectPackageManager } from "./package-manager.js";
32
32
  const HTML_LIMIT = 5;
33
33
  export async function extractProject(config, options = {}) {
34
34
  const root = process.cwd();
35
- const destBase = config.destBase ??
36
- (config.projectDir.startsWith("packages/") ? "packages" : "exports");
35
+ const destBase = config.destBase ?? (config.projectDir.startsWith("packages/") ? "packages" : "exports");
37
36
  const dest = options.dest ?? path.resolve(root, "..", destBase, config.destName);
38
37
  const logger = createLogger(options.verbose);
39
38
  const onProgress = options.onProgress;
@@ -54,7 +53,6 @@ export async function extractProject(config, options = {}) {
54
53
  logger.log(` projectDir: ${config.projectDir}`);
55
54
  logger.log(` destName: ${config.destName}`);
56
55
  logger.log(` standalone: ${config.standalone}`);
57
- logger.log(` stubPackages: ${config.stubPackages?.join(", ") || "(none)"}`);
58
56
  logger.log(` appDirs: ${config.appDirs.join(", ") || "(none)"}`);
59
57
  if (config.postProcess) {
60
58
  logger.log(` postProcess rules: ${config.postProcess.length}`);
@@ -82,10 +80,7 @@ export async function extractProject(config, options = {}) {
82
80
  }
83
81
  }
84
82
  catch (err) {
85
- emit({
86
- phase: "error",
87
- error: err instanceof Error ? err : new Error(String(err)),
88
- });
83
+ emit({ phase: "error", error: err instanceof Error ? err : new Error(String(err)) });
89
84
  throw err;
90
85
  }
91
86
  }
@@ -101,7 +96,9 @@ async function exportMonorepo(root, dest, config, logger, emit) {
101
96
  let changelogCommitMessage = `chore(${config.destName}): export ${new Date().toISOString().slice(0, 10)}`;
102
97
  const changelogResult = await tryGenerateChangelog(projectDir, logger);
103
98
  let changelogGenerated = false;
104
- if (!changelogResult.skipped && changelogResult.commitMessage) {
99
+ if (!changelogResult.skipped &&
100
+ changelogResult.commitMessage &&
101
+ changelogResult.commitMessage !== "no changes") {
105
102
  changelogCommitMessage = `chore(${config.destName}): export ${new Date().toISOString().slice(0, 10)} — ${changelogResult.commitMessage}`;
106
103
  changelogGenerated = true;
107
104
  }
@@ -248,9 +245,7 @@ async function exportMonorepo(root, dest, config, logger, emit) {
248
245
  // 13. Generate lockfile
249
246
  logger.log(`Generating ${pm} lockfile...`);
250
247
  const installBin = pm === "pnpm" ? "pnpm" : pm === "yarn" ? "yarn" : "npm";
251
- const installArgs = pm === "pnpm"
252
- ? ["install", "--config.dangerouslyAllowAllBuilds=true", "--config.minimumReleaseAge=0"]
253
- : ["install"];
248
+ const installArgs = pm === "pnpm" ? ["install", "--config.dangerouslyAllowAllBuilds=true"] : ["install"];
254
249
  try {
255
250
  execFileSync(installBin, installArgs, { cwd: dest, stdio: "pipe" });
256
251
  logger.log(` generated ${pm} lockfile`);
@@ -294,11 +289,11 @@ async function exportMonorepo(root, dest, config, logger, emit) {
294
289
  }
295
290
  logger.log(" no secrets found");
296
291
  }
297
- // 16. Transfer git history (by path prefix)
298
- const historyPrefixes = [config.projectDir, ...packageDirs];
299
- emit({ phase: "gitHistory", prefixes: historyPrefixes });
300
- await transferGitHistory(root, dest, historyPrefixes, logger);
301
- // 17. Git commit + push
292
+ // 15c. Transfer git history
293
+ const pathPrefixes = [config.projectDir, ...config.appDirs];
294
+ emit({ phase: "gitHistory", pathPrefixes });
295
+ await transferGitHistory(root, dest, pathPrefixes, logger);
296
+ // 16. Git commit + push
302
297
  emit({ phase: "gitCommit", message: changelogCommitMessage });
303
298
  const gitResult = await commitExport(dest, changelogCommitMessage, config.git, logger);
304
299
  if (gitResult.pushed) {
@@ -371,17 +366,10 @@ async function exportStandalonePackage(root, dest, config, logger, emit) {
371
366
  // 4c. Fix vitest.config.ts (relative test paths)
372
367
  logger.log("Fixing vitest.config.ts...");
373
368
  await fixStandaloneVitestConfig(dest, logger);
374
- // 4c-b. Generate stub shims for unresolvable workspace packages
375
- if (config.stubPackages && config.stubPackages.length > 0) {
376
- logger.log("Generating stub shims...");
377
- await generateStubShims(root, dest, config, logger);
378
- }
379
369
  // 4d. Generate lockfile
380
370
  logger.log(`Generating ${pm} lockfile...`);
381
371
  const installBin = pm === "pnpm" ? "pnpm" : pm === "yarn" ? "yarn" : "npm";
382
- const installArgs = pm === "pnpm"
383
- ? ["install", "--config.dangerouslyAllowAllBuilds=true", "--config.minimumReleaseAge=0"]
384
- : ["install"];
372
+ const installArgs = pm === "pnpm" ? ["install", "--config.dangerouslyAllowAllBuilds=true"] : ["install"];
385
373
  try {
386
374
  execFileSync(installBin, installArgs, { cwd: dest, stdio: "pipe" });
387
375
  logger.log(` generated ${pm} lockfile`);
@@ -397,30 +385,12 @@ async function exportStandalonePackage(root, dest, config, logger, emit) {
397
385
  const wsPath = path.join(dest, "pnpm-workspace.yaml");
398
386
  try {
399
387
  const wsContent = await readFile(wsPath, "utf-8");
400
- let cleaned = wsContent.replace(/set this to true or false/g, "true");
401
- if (!cleaned.includes("minimumReleaseAge:")) {
402
- cleaned = "minimumReleaseAge: 0\n" + cleaned;
403
- }
388
+ const cleaned = wsContent.replace(/set this to true or false/g, "true");
404
389
  await writeFile(wsPath, cleaned);
405
- logger.log(" cleaned pnpm-workspace.yaml (resolved allowBuilds prompts, minimumReleaseAge: 0)");
406
- }
407
- catch {
408
- /* no pnpm-workspace.yaml — create one with minimumReleaseAge: 0 */
409
- await writeFile(wsPath, "minimumReleaseAge: 0\npackages: []\n");
410
- logger.log(" created pnpm-workspace.yaml with minimumReleaseAge: 0");
411
- }
412
- // 4e2. Write .npmrc with minimum-release-age=0 so all pnpm invocations respect it
413
- const npmrcPath = path.join(dest, ".npmrc");
414
- try {
415
- const existing = await readFile(npmrcPath, "utf-8");
416
- if (!existing.includes("minimum-release-age")) {
417
- await writeFile(npmrcPath, existing.trimEnd() + "\nminimum-release-age=0\n");
418
- logger.log(" added minimum-release-age=0 to .npmrc");
419
- }
390
+ logger.log(" cleaned pnpm-workspace.yaml (resolved allowBuilds prompts)");
420
391
  }
421
392
  catch {
422
- await writeFile(npmrcPath, "minimum-release-age=0\n");
423
- logger.log(" wrote .npmrc with minimum-release-age=0");
393
+ /* no pnpm-workspace.yaml, no-op */
424
394
  }
425
395
  }
426
396
  // 5. Clean stray artifacts
@@ -454,10 +424,11 @@ async function exportStandalonePackage(root, dest, config, logger, emit) {
454
424
  }
455
425
  logger.log(" no secrets found");
456
426
  }
457
- // 7. Transfer git history (by path prefix)
458
- emit({ phase: "gitHistory", prefixes: [config.projectDir] });
459
- await transferGitHistory(root, dest, [config.projectDir], logger);
460
- // 8. Git commit + push
427
+ // 6c. Transfer git history
428
+ const pathPrefixes = [config.projectDir];
429
+ emit({ phase: "gitHistory", pathPrefixes });
430
+ await transferGitHistory(root, dest, pathPrefixes, logger);
431
+ // 7. Git commit + push
461
432
  emit({ phase: "gitCommit", message: changelogCommitMessage });
462
433
  const gitResult = await commitExport(dest, changelogCommitMessage, config.git, logger);
463
434
  if (gitResult.pushed) {
@@ -476,283 +447,3 @@ async function exportStandalonePackage(root, dest, config, logger, emit) {
476
447
  emit({ phase: "complete", result });
477
448
  return result;
478
449
  }
479
- async function generateStubShims(root, dest, config, logger) {
480
- if (!config.stubPackages || config.stubPackages.length === 0)
481
- return;
482
- const shimDir = path.join(dest, "src", "types");
483
- await mkdir(shimDir, { recursive: true });
484
- for (const pkgName of config.stubPackages) {
485
- const pkgDir = await findPackageDir(root, pkgName);
486
- if (!pkgDir) {
487
- logger.log(` skipped ${pkgName} (not found in monorepo)`);
488
- continue;
489
- }
490
- const pkgJsonPath = path.join(pkgDir, "package.json");
491
- const pkgJson = JSON.parse(readFileSync(pkgJsonPath, "utf-8"));
492
- const exports = pkgJson.exports ?? {};
493
- const shortName = pkgName.split("/").pop() ?? pkgName;
494
- const shimFileName = `${shortName}-shims.d.ts`;
495
- const shimPath = path.join(shimDir, shimFileName);
496
- const lines = [
497
- `// Auto-generated type shims for ${pkgName}.`,
498
- `// Generated by repo-extract from source exports. Do not edit manually.`,
499
- ``,
500
- ];
501
- const seenModules = new Set();
502
- for (const [exportKey, exportValue] of Object.entries(exports)) {
503
- if (exportKey === "./package.json")
504
- continue;
505
- const modulePath = exportKey === "." ? pkgName : `${pkgName}${exportKey.slice(1)}`;
506
- if (seenModules.has(modulePath))
507
- continue;
508
- seenModules.add(modulePath);
509
- const sourceFile = resolveSourceFile(pkgDir, exportValue);
510
- const namedExports = sourceFile
511
- ? parseNamedExportsRecursive(sourceFile, 0)
512
- : [];
513
- lines.push(`declare module "${modulePath}" {`);
514
- if (namedExports.length === 0) {
515
- lines.push(` const _: any;`);
516
- lines.push(` export = _;`);
517
- }
518
- else {
519
- const seen = new Set();
520
- for (const exp of namedExports) {
521
- if (seen.has(exp.name))
522
- continue;
523
- seen.add(exp.name);
524
- const isReserved = [
525
- "default",
526
- "break",
527
- "case",
528
- "catch",
529
- "class",
530
- "const",
531
- "continue",
532
- "debugger",
533
- "delete",
534
- "do",
535
- "else",
536
- "enum",
537
- "export",
538
- "extends",
539
- "false",
540
- "finally",
541
- "for",
542
- "function",
543
- "if",
544
- "import",
545
- "in",
546
- "instanceof",
547
- "new",
548
- "null",
549
- "return",
550
- "super",
551
- "switch",
552
- "this",
553
- "throw",
554
- "true",
555
- "try",
556
- "typeof",
557
- "var",
558
- "void",
559
- "while",
560
- "with",
561
- ].includes(exp.name);
562
- const isValidIdent = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(exp.name);
563
- if (!isValidIdent && !isReserved) {
564
- continue;
565
- }
566
- if (exp.name === "default") {
567
- lines.push(` export default any;`);
568
- continue;
569
- }
570
- const safeName = isReserved ? `"${exp.name}"` : exp.name;
571
- if (exp.kind === "function") {
572
- lines.push(` export function ${safeName}(...args: any[]): any;`);
573
- }
574
- else if (exp.kind === "const") {
575
- lines.push(` export const ${safeName}: any;`);
576
- }
577
- else if (exp.kind === "class") {
578
- lines.push(` export class ${safeName} { constructor(...args: any[]); }`);
579
- }
580
- else if (exp.kind === "interface") {
581
- lines.push(` export interface ${safeName} {}`);
582
- }
583
- else if (exp.kind === "type") {
584
- lines.push(` export type ${safeName} = any;`);
585
- }
586
- else if (exp.kind === "enum") {
587
- lines.push(` export enum ${safeName} {}`);
588
- }
589
- }
590
- }
591
- lines.push(`}`);
592
- lines.push(``);
593
- }
594
- await writeFile(shimPath, lines.join("\n"));
595
- logger.log(` generated ${shimFileName} (${seenModules.size} modules)`);
596
- }
597
- }
598
- async function findPackageDir(root, pkgName) {
599
- const packagesDir = path.join(root, "packages");
600
- try {
601
- const entries = await readdir(packagesDir);
602
- for (const entry of entries) {
603
- const pkgJsonPath = path.join(packagesDir, entry, "package.json");
604
- try {
605
- const pkgJson = JSON.parse(readFileSync(pkgJsonPath, "utf-8"));
606
- if (pkgJson.name === pkgName) {
607
- return path.join(packagesDir, entry);
608
- }
609
- }
610
- catch {
611
- // not a package, skip
612
- }
613
- }
614
- }
615
- catch {
616
- // no packages dir, skip
617
- }
618
- return null;
619
- }
620
- function resolveSourceFile(pkgDir, exportValue) {
621
- let resolvedPath;
622
- if (typeof exportValue === "string") {
623
- resolvedPath = exportValue;
624
- }
625
- else if (typeof exportValue === "object" && exportValue !== null) {
626
- const obj = exportValue;
627
- if (typeof obj.types === "string") {
628
- resolvedPath = obj.types;
629
- }
630
- else if (typeof obj.default === "string") {
631
- resolvedPath = obj.default;
632
- }
633
- else {
634
- for (const v of Object.values(obj)) {
635
- if (typeof v === "string") {
636
- resolvedPath = v;
637
- break;
638
- }
639
- else if (typeof v === "object" && v !== null) {
640
- const inner = v;
641
- if (typeof inner.types === "string") {
642
- resolvedPath = inner.types;
643
- break;
644
- }
645
- else if (typeof inner.default === "string") {
646
- resolvedPath = inner.default;
647
- break;
648
- }
649
- }
650
- }
651
- }
652
- }
653
- if (!resolvedPath)
654
- return null;
655
- const fullPath = path.resolve(pkgDir, resolvedPath);
656
- if (existsSync(fullPath) && fullPath.endsWith(".ts")) {
657
- return fullPath;
658
- }
659
- return null;
660
- }
661
- function parseNamedExportsRecursive(filePath, depth) {
662
- if (depth > 2)
663
- return [];
664
- let content;
665
- try {
666
- content = readFileSync(filePath, "utf-8");
667
- }
668
- catch {
669
- return [];
670
- }
671
- let exports = parseNamedExports(content);
672
- const wildcardRegex = /export\s+\*\s+from\s+["']([^"']+)["']/g;
673
- let match;
674
- while ((match = wildcardRegex.exec(content)) !== null) {
675
- const targetPath = resolveImportPath(filePath, match[1]);
676
- if (targetPath) {
677
- exports = exports.concat(parseNamedExportsRecursive(targetPath, depth + 1));
678
- }
679
- }
680
- const reExportRegex = /export\s+\{([^}]+)\}\s+from\s+["']([^"']+)["']/g;
681
- while ((match = reExportRegex.exec(content)) !== null) {
682
- const names = match[1]
683
- .split(",")
684
- .map((s) => s
685
- .trim()
686
- .split(/\s+as\s+/)[0]
687
- .trim()
688
- .replace(/^type\s+/, ""))
689
- .filter(Boolean);
690
- for (const name of names) {
691
- exports.push({ kind: "const", name });
692
- }
693
- }
694
- return exports;
695
- }
696
- function parseNamedExports(content) {
697
- const exports = [];
698
- let match;
699
- const funcRegex = /export\s+(?:async\s+)?function\s+(\w+)/g;
700
- while ((match = funcRegex.exec(content)) !== null) {
701
- exports.push({ kind: "function", name: match[1] });
702
- }
703
- const constRegex = /export\s+const\s+(\w+)/g;
704
- while ((match = constRegex.exec(content)) !== null) {
705
- exports.push({ kind: "const", name: match[1] });
706
- }
707
- const letRegex = /export\s+let\s+(\w+)/g;
708
- while ((match = letRegex.exec(content)) !== null) {
709
- exports.push({ kind: "const", name: match[1] });
710
- }
711
- const classRegex = /export\s+class\s+(\w+)/g;
712
- while ((match = classRegex.exec(content)) !== null) {
713
- exports.push({ kind: "class", name: match[1] });
714
- }
715
- const interfaceRegex = /export\s+interface\s+(\w+)/g;
716
- while ((match = interfaceRegex.exec(content)) !== null) {
717
- exports.push({ kind: "interface", name: match[1] });
718
- }
719
- const typeRegex = /export\s+type\s+(\w+)/g;
720
- while ((match = typeRegex.exec(content)) !== null) {
721
- exports.push({ kind: "type", name: match[1] });
722
- }
723
- const enumRegex = /export\s+enum\s+(\w+)/g;
724
- while ((match = enumRegex.exec(content)) !== null) {
725
- exports.push({ kind: "enum", name: match[1] });
726
- }
727
- const namedRegex = /export\s*\{([^}]+)\}(?!\s*from)/g;
728
- while ((match = namedRegex.exec(content)) !== null) {
729
- const names = match[1]
730
- .split(",")
731
- .map((s) => s
732
- .trim()
733
- .split(/\s+as\s+/)[0]
734
- .trim()
735
- .replace(/^type\s+/, ""))
736
- .filter(Boolean);
737
- for (const name of names) {
738
- exports.push({ kind: "const", name });
739
- }
740
- }
741
- return exports;
742
- }
743
- function resolveImportPath(fromFile, importPath) {
744
- if (!importPath.startsWith("."))
745
- return null;
746
- const dir = path.dirname(fromFile);
747
- const candidates = [
748
- path.resolve(dir, importPath),
749
- path.resolve(dir, importPath + ".ts"),
750
- path.resolve(dir, importPath + "/index.ts"),
751
- ];
752
- for (const candidate of candidates) {
753
- if (existsSync(candidate)) {
754
- return candidate;
755
- }
756
- }
757
- return null;
758
- }
package/dist/fs/copy.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  <MODULE_CONTRACT>
3
- <purpose>Filtered filesystem copy utilities for monorepo export.</purpose>
3
+ <purpose>Filtered filesystem copy utilities for monorepo export. for reliable use by its direct callers and maintainers.</purpose>
4
4
  <non-goals>
5
5
  <item>Does not transform package.json (see transform.ts).</item>
6
6
  <item>Does not discover dependencies (see discover.ts).</item>
@@ -1 +1 @@
1
- {"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../src/fs/discover.ts"],"names":[],"mappings":"AAkBA,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EAAE,EACjB,iBAAiB,GAAE,MAAM,EAAO,GAC/B,OAAO,CAAC,MAAM,EAAE,CAAC,CAyCnB"}
1
+ {"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../src/fs/discover.ts"],"names":[],"mappings":"AAiBA,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EAAE,EACjB,iBAAiB,GAAE,MAAM,EAAO,GAC/B,OAAO,CAAC,MAAM,EAAE,CAAC,CAyCnB"}
@@ -1,13 +1,12 @@
1
1
  /*
2
2
  <MODULE_CONTRACT>
3
- <purpose>Auto-discovery of transitive workspace package dependencies.</purpose>
3
+ <purpose>Auto-discovery of transitive workspace package dependencies. for reliable use by its direct callers and maintainers.</purpose>
4
4
  <non-goals>
5
5
  <item>Does not copy or transform files (see copy.ts, transform.ts).</item>
6
6
  </non-goals>
7
7
  </MODULE_CONTRACT>
8
8
  <CHANGE_SUMMARY>
9
9
  <item>Ported discoverPackageDeps from scripts/export-clients-helpers.ts for RFC-0070. Supports both @syrokomskyi/ and @warpgogol/ prefixes.</item>
10
- <item>RFC-0071: Default workspacePrefixes changed from ["@syrokomskyi/", "@warpgogol/"] to [] (empty). Callers must pass explicit prefixes.
11
10
  </CHANGE_SUMMARY>
12
11
  */
13
12
  import { readFile, readdir } from "node:fs/promises";
@@ -1 +1 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/fs/git.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGxC,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EACrB,SAAS,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6 @@
1
1
  /*
2
2
  <MODULE_CONTRACT>
3
- <purpose>Git init, commit, and push helpers for exported repos.</purpose>
3
+ <purpose>Git init, commit, and push helpers for exported repos. for reliable use by its direct callers and maintainers.</purpose>
4
4
  <non-goals>
5
5
  <item>Does not implement AI commit message generation (see changelog.ts).</item>
6
6
  </non-goals>
@@ -99,14 +99,10 @@ export async function commitExport(dest, commitMessage, gitConfig, logger) {
99
99
  log(` pushed to origin/${branch}`);
100
100
  pushed = true;
101
101
  }
102
- catch {
103
- log(" regular push rejected, retrying with --force...");
104
- execFileSync("git", ["push", "-u", "--force", "origin", branch], {
105
- cwd: dest,
106
- stdio: "inherit",
107
- });
108
- log(` force-pushed to origin/${branch}`);
109
- pushed = true;
102
+ catch (pushErr) {
103
+ error(` push rejected: ${pushErr instanceof Error ? pushErr.message : pushErr}`);
104
+ error(" remote has diverged — commit is saved locally.");
105
+ error(" resolve manually: pull remote changes, merge, then push.");
110
106
  }
111
107
  }
112
108
  catch (pushErr) {
@@ -1 +1 @@
1
- {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/fs/transform.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGxC,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,aAAa,EACrB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CAkEf;AAED,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC,IAAI,CAAC,CA0Df;AAED,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,gBAAgB,EAAE,MAAM,EAAE,GACzB,OAAO,CAAC,IAAI,CAAC,CAYf;AAED,w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pose>
3
+ <purpose>Package.json and tsconfig transformation utilities for exported repos. for reliable use by its direct callers and maintainers.</purpose>
4
4
  <non-goals>
5
5
  <item>Does not copy files (see copy.ts).</item>
6
6
  </non-goals>
@@ -52,11 +52,7 @@ export async function transformPackageJson(dest, relPath, config, logger) {
52
52
  }
53
53
  }
54
54
  }
55
- for (const depField of [
56
- "dependencies",
57
- "devDependencies",
58
- "peerDependencies",
59
- ]) {
55
+ for (const depField of ["dependencies", "devDependencies", "peerDependencies"]) {
60
56
  if (pkg[depField]) {
61
57
  for (const key of Object.keys(pkg[depField])) {
62
58
  const shouldStrip = stripScopes.some((scope) => key.startsWith(scope));
@@ -244,7 +240,7 @@ export function buildGitignore(extraLines = [], config) {
244
240
  const extra = extraLines.length > 0 ? ["", ...extraLines] : [];
245
241
  return [...base, ...extra].join("\n");
246
242
  }
247
- function rootScripts(pm) {
243
+ function rootScripts(pm, workspaceFilter) {
248
244
  if (pm === "npm") {
249
245
  return {
250
246
  build: "npm run build --workspaces --if-present",
@@ -261,11 +257,20 @@ function rootScripts(pm) {
261
257
  test: "yarn workspaces foreach run test",
262
258
  };
263
259
  }
260
+ if (workspaceFilter) {
261
+ const f = `pnpm --filter ${workspaceFilter}... run --if-present`;
262
+ return {
263
+ build: `${f} build`,
264
+ typecheck: `${f} typecheck`,
265
+ lint: `${f} lint`,
266
+ test: `${f} test`,
267
+ };
268
+ }
264
269
  return {
265
- build: 'pnpm --recursive --filter "./apps/**" exec pnpm run build',
266
- typecheck: 'pnpm --recursive --filter "./apps/**" exec pnpm run typecheck',
267
- lint: 'pnpm --recursive --filter "./apps/**" exec pnpm run lint',
268
- test: 'pnpm --recursive --filter "./apps/**" exec pnpm run --if-present test',
270
+ build: "pnpm -r run --if-present build",
271
+ typecheck: "pnpm -r run --if-present typecheck",
272
+ lint: "pnpm -r run --if-present lint",
273
+ test: "pnpm -r run --if-present test",
269
274
  };
270
275
  }
271
276
  function detectSourcePackageManagerVersion(root) {
@@ -281,7 +286,7 @@ export function buildRootPackageJson(destName, config, pm, root) {
281
286
  const pkg = {
282
287
  name: config.rootPackageName ?? `exported-${destName}`,
283
288
  private: true,
284
- scripts: rootScripts(pm),
289
+ scripts: rootScripts(pm, config.ci?.workspaceFilter),
285
290
  devDependencies: {
286
291
  "@eslint/js": "^10.0.1",
287
292
  "@types/node": "^22.10.0",
@@ -326,8 +331,7 @@ export async function generateRootFiles(dest, root, config, packageDirs, appDirs
326
331
  .map((e) => ` - ${e}`),
327
332
  "",
328
333
  ];
329
- if (config.onlyBuiltDependencies &&
330
- config.onlyBuiltDependencies.length > 0) {
334
+ if (config.onlyBuiltDependencies && config.onlyBuiltDependencies.length > 0) {
331
335
  workspaceYamlLines.push("onlyBuiltDependencies:");
332
336
  for (const dep of config.onlyBuiltDependencies) {
333
337
  workspaceYamlLines.push(` - '${dep}'`);
@@ -366,10 +370,7 @@ export async function generateRootFiles(dest, root, config, packageDirs, appDirs
366
370
  /* no tsconfig.json at this level — skip */
367
371
  }
368
372
  }
369
- const references = [
370
- ...packageDirs.map((d) => ({ path: `./${d}` })),
371
- ...appRefs,
372
- ];
373
+ const references = [...packageDirs.map((d) => ({ path: `./${d}` })), ...appRefs];
373
374
  const tsconfig = {
374
375
  extends: "./tsconfig.base.json",
375
376
  compileOnSave: false,
@@ -419,21 +420,29 @@ export function generateCiWorkflow(pm, ci) {
419
420
  return null;
420
421
  const nodeVersion = ci?.nodeVersion ?? 22;
421
422
  const publish = ci?.publish ?? true;
422
- const provenance = ci?.provenance ?? false;
423
423
  const installCmd = pm === "pnpm"
424
- ? "pnpm install --no-frozen-lockfile --config.dangerouslyAllowAllBuilds=true --config.minimumReleaseAge=0"
424
+ ? "pnpm install --frozen-lockfile --config.dangerouslyAllowAllBuilds=true"
425
425
  : pm === "yarn"
426
426
  ? "yarn install --frozen-lockfile"
427
- : "npm install";
427
+ : "npm ci";
428
428
  const runPrefix = pm === "pnpm" ? "pnpm run" : pm === "yarn" ? "yarn" : "npm run";
429
429
  const testCmd = pm === "pnpm" ? "pnpm test" : pm === "yarn" ? "yarn test" : "npm test";
430
- const pnpmSetup = pm === "pnpm" ? [" - run: corepack enable"] : [];
431
- const permissions = provenance
432
- ? ["permissions:", " contents: read", " id-token: write"]
433
- : ["permissions:", " contents: read"];
434
- const publishFlags = ["--access", "public", "--ignore-scripts"];
435
- if (provenance)
436
- publishFlags.push("--provenance");
430
+ const cacheKey = pm === "pnpm" ? "pnpm" : pm === "yarn" ? "yarn" : "npm";
431
+ const pnpmSetup = pm === "pnpm" ? [" - uses: pnpm/action-setup@v6"] : [];
432
+ const ciSetupSteps = [
433
+ " - uses: actions/checkout@v5",
434
+ ...pnpmSetup,
435
+ " - uses: actions/setup-node@v5",
436
+ " with:",
437
+ ` node-version: ${nodeVersion}`,
438
+ ` cache: ${cacheKey}`,
439
+ ` - run: ${installCmd}`,
440
+ ];
441
+ const buildSteps = [];
442
+ if (!ci?.skipBuild) {
443
+ buildSteps.push(` - run: ${runPrefix} build`);
444
+ }
445
+ buildSteps.push(` - run: ${runPrefix} lint`, ` - run: ${runPrefix} typecheck`, ` - run: ${testCmd}`);
437
446
  const lines = [
438
447
  "name: CI",
439
448
  "",
@@ -441,26 +450,31 @@ export function generateCiWorkflow(pm, ci) {
441
450
  " push:",
442
451
  " branches: [main]",
443
452
  " pull_request:",
444
- " branches: [main]",
445
453
  "",
446
- ...permissions,
454
+ "permissions:",
455
+ " contents: read",
456
+ " id-token: write",
447
457
  "",
448
458
  "jobs:",
449
459
  " ci:",
450
460
  " runs-on: ubuntu-latest",
461
+ " timeout-minutes: 15",
451
462
  " steps:",
452
- " - uses: actions/checkout@v4",
453
- ...pnpmSetup,
454
- " - uses: actions/setup-node@v5",
455
- " with:",
456
- ` node-version: "${nodeVersion}"`,
457
- " registry-url: https://registry.npmjs.org",
458
- ` - run: ${installCmd}`,
459
- ` - run: ${runPrefix} build:check || true`,
460
- ` - run: ${testCmd} || true`,
463
+ ...ciSetupSteps,
464
+ ...buildSteps,
461
465
  ];
462
466
  if (publish) {
463
- lines.push("", " - name: Build", " if: github.ref == 'refs/heads/main' && github.event_name == 'push'", ` run: ${runPrefix} build`, "", " - name: Publish", " if: github.ref == 'refs/heads/main' && github.event_name == 'push'", " run: |", " PKG_NAME=$(node -p \"require('./package.json').name\")", " PKG_VERSION=$(node -p \"require('./package.json').version\")", ' if npm view "${PKG_NAME}@${PKG_VERSION}" version 2>/dev/null | grep -q "${PKG_VERSION}"; then', ' echo "Version ${PKG_VERSION} already published, skipping"', " else", ` npm publish ${publishFlags.join(" ")}`, " fi", " env:", " NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}");
467
+ lines.push("", " publish:", " needs: ci", " if: github.event_name == 'push'", " runs-on: ubuntu-latest", " timeout-minutes: 10", " permissions:", " contents: read", " id-token: write", " steps:", " - uses: actions/checkout@v5", ...pnpmSetup, " - uses: actions/setup-node@v5", " with:", ` node-version: ${nodeVersion}`, ` cache: ${cacheKey}`, " registry-url: https://registry.npmjs.org", ` - run: ${installCmd}`, ` - run: ${runPrefix} build`, " - run: npm publish --provenance --access public", " env:", " NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}");
468
+ }
469
+ if (ci?.deploy?.provider === "cloudflare-pages") {
470
+ const d = ci.deploy;
471
+ const envLines = [
472
+ " " + d.apiTokenSecret + ": ${{ secrets." + d.apiTokenSecret + " }}",
473
+ ];
474
+ if (d.accountIdSecret) {
475
+ envLines.push(" " + d.accountIdSecret + ": ${{ secrets." + d.accountIdSecret + " }}");
476
+ }
477
+ lines.push("", " deploy:", " needs: ci", " if: github.event_name == 'push'", " runs-on: ubuntu-latest", " timeout-minutes: 15", " permissions:", " contents: read", " steps:", " - uses: actions/checkout@v5", ...pnpmSetup, " - uses: actions/setup-node@v5", " with:", ` node-version: ${nodeVersion}`, ` cache: ${cacheKey}`, ` - run: ${installCmd}`, ` - run: ${d.buildCommand}`, ` - run: npx wrangler deploy`, " working-directory: " + d.outputDir, " env:", ...envLines);
464
478
  }
465
479
  lines.push("");
466
480
  return lines.join("\n");
@@ -520,11 +534,7 @@ export async function fixStandalonePackageJson(dest, config, pm, root, logger) {
520
534
  changed = true;
521
535
  }
522
536
  }
523
- for (const depField of [
524
- "dependencies",
525
- "devDependencies",
526
- "peerDependencies",
527
- ]) {
537
+ for (const depField of ["dependencies", "devDependencies", "peerDependencies"]) {
528
538
  if (pkg[depField]) {
529
539
  for (const key of Object.keys(pkg[depField])) {
530
540
  if (depField === "peerDependencies") {
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  <MODULE_CONTRACT>
3
- <purpose>Public API exports for @warpgogol/repo-extract.</purpose>
3
+ <purpose>Public API exports for @warpgogol/repo-extract. for reliable use by its direct callers and maintainers.</purpose>
4
4
  <non-goals>
5
5
  <item>Does not implement CLI parsing (see cli.ts).</item>
6
6
  <item>Does not implement config loading (see config.ts).</item>
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  <MODULE_CONTRACT>
3
- <purpose>Detect package manager from lockfile presence in source root.</purpose>
3
+ <purpose>Detect package manager from lockfile presence in source root. for reliable use by its direct callers and maintainers.</purpose>
4
4
  <non-goals>
5
5
  <item>Does not install packages or generate lockfiles (see extract.ts).</item>
6
6
  </non-goals>
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  <MODULE_CONTRACT>
3
- <purpose>Declarative post-process rule executor (copy, patch, delete).</purpose>
3
+ <purpose>Declarative post-process rule executor (copy, patch, delete). for reliable use by its direct callers and maintainers.</purpose>
4
4
  <non-goals>
5
5
  <item>Does not support variable interpolation or JS hooks.</item>
6
6
  </non-goals>
package/dist/types.d.ts CHANGED
@@ -1,11 +1,22 @@
1
1
  export type PackageManager = "pnpm" | "npm" | "yarn";
2
2
  export type VersionBump = "patch" | "minor" | "major";
3
+ export interface CloudflarePagesDeploy {
4
+ provider: "cloudflare-pages";
5
+ projectName: string;
6
+ buildCommand: string;
7
+ outputDir: string;
8
+ apiTokenSecret: string;
9
+ accountIdSecret?: string;
10
+ }
11
+ export type DeployConfig = CloudflarePagesDeploy;
3
12
  export interface CiConfig {
4
13
  provider: "github-actions" | "none";
5
14
  packageManager?: PackageManager;
6
15
  publish: boolean;
7
16
  nodeVersion: number;
8
- provenance?: boolean;
17
+ deploy?: DeployConfig;
18
+ workspaceFilter?: string;
19
+ skipBuild?: boolean;
9
20
  }
10
21
  export type PostProcessAction = "copy" | "patch" | "delete";
11
22
  export interface CopyRule {
@@ -58,7 +69,6 @@ export interface ExtractConfig {
58
69
  excludeExtensions?: string[];
59
70
  skipSecretScan?: boolean;
60
71
  versionBump?: VersionBump;
61
- stubPackages?: string[];
62
72
  }
63
73
  export interface ExtractContext {
64
74
  root: string;
@@ -110,7 +120,7 @@ export type ExtractProgressEvent = {
110
120
  dest: string;
111
121
  } | {
112
122
  phase: "gitHistory";
113
- prefixes: string[];
123
+ pathPrefixes: string[];
114
124
  } | {
115
125
  phase: "gitCommit";
116
126
  message: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAiBA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAEtD,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CAAC;IACpC,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE5D,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAA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AE,KAAK,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,GAC5C;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC;AAErC,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC"}
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  <MODULE_CONTRACT>
3
- <purpose>Shared types for @warpgogol/repo-extract.</purpose>
3
+ <purpose>Shared types for @warpgogol/repo-extract. for reliable use by its direct callers and maintainers.</purpose>
4
4
  <non-goals>
5
5
  <item>Does not define Zod schemas (see config.ts).</item>
6
6
  <item>Does not implement logic (see extract.ts, fs/*.ts).</item>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warpgogol/repo-extract",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
4
4
  "description": "Extract apps and packages from a TurboRepo monorepo into standalone public repositories",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Andrii Syrokomskyi <andrii@syrokomskyi.com> (https://syrokomskyi.com)",
@@ -63,7 +63,7 @@
63
63
  "zod": "^4.4.3"
64
64
  },
65
65
  "peerDependencies": {
66
- "@warpgogol/changelog-live": "0.2.3"
66
+ "@warpgogol/changelog-live": "*"
67
67
  },
68
68
  "peerDependenciesMeta": {
69
69
  "@warpgogol/changelog-live": {
@@ -72,11 +72,11 @@
72
72
  },
73
73
  "devDependencies": {
74
74
  "@eslint/js": "^10.0.1",
75
- "@types/node": "^26.1.2",
76
- "eslint": "~10.8.0",
75
+ "@types/node": "^26.2.0",
76
+ "eslint": "~10.9.0",
77
77
  "tsx": "^4.23.5",
78
78
  "typescript": "6.0.3",
79
- "typescript-eslint": "^8.66.0",
79
+ "typescript-eslint": "^8.67.0",
80
80
  "vitest": "4.1.10"
81
81
  },
82
82
  "packageManager": "pnpm@11.20.0"