@warpgogol/repo-extract 1.5.0 → 1.6.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.
- package/README.md +12 -0
- package/dist/changelog.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +6 -3
- package/dist/extract.d.ts.map +1 -1
- package/dist/extract.js +32 -7
- package/dist/fs/copy.js +1 -1
- package/dist/fs/discover.js +1 -1
- package/dist/fs/git.js +2 -2
- package/dist/fs/transform.d.ts.map +1 -1
- package/dist/fs/transform.js +15 -6
- package/dist/index.js +2 -2
- package/dist/log.d.ts.map +1 -1
- package/dist/log.js +2 -1
- package/dist/postprocess/index.js +1 -1
- package/dist/scan.js +1 -1
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -198,3 +198,15 @@ This package originated from production engineering work at [Warpgogol](https://
|
|
|
198
198
|
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.
|
|
199
199
|
|
|
200
200
|
Built for real systems. Shared openly.
|
|
201
|
+
|
|
202
|
+
### Locked export placement
|
|
203
|
+
|
|
204
|
+
Set `lockDestination: true` with `destBase: packages` to require exports at `../packages/<destName>` relative to the source repository cwd. Both names must be single directory names. The exporter rejects a different CLI/API destination, symlink/file destinations or containers, and a leftover `../<destName>` copy. These checks run before any writes, including during `--dry-run`. Existing consumers without this option retain their destination override behavior.
|
|
205
|
+
|
|
206
|
+
The four pipeline SDK export configs enable this check. Run from the `pipelines` repository root (or its sibling session worktree), for example:
|
|
207
|
+
|
|
208
|
+
```sh
|
|
209
|
+
pnpm exec node --import tsx packages/repo-extract/src/cli.ts --config packages/pipeline/pipeline-core/extract.config.yaml --from-head --no-push --dry-run
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Omit `--dry-run` for an authorized local export. Publishing is a separate step; keep `--no-push` for local work. No superfolder launcher is required.
|
package/dist/changelog.js
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
</non-goals>
|
|
7
7
|
</MODULE_CONTRACT>
|
|
8
8
|
<CHANGE_SUMMARY>
|
|
9
|
-
<item>Initial changelog integration for RFC-0070. Uses dynamic import to gracefully handle missing peer dep.</item>
|
|
10
9
|
<item>RFC-0073: consolidated getLastExportDate — removed local duplicate, imports from fs/git.js.</item>
|
|
11
10
|
<item>RFC-0075: removed dead tryAiCommitMessage() function and unused getLastExportDate import.</item>
|
|
11
|
+
<item>ADR-0034: compass v2 baseline repair — CHANGE_SUMMARY trim and/or purpose token rewrite</item>
|
|
12
12
|
</CHANGE_SUMMARY>
|
|
13
13
|
*/
|
|
14
14
|
import { existsSync } from "node:fs";
|
package/dist/cli.js
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
</non-goals>
|
|
8
8
|
</MODULE_CONTRACT>
|
|
9
9
|
<CHANGE_SUMMARY>
|
|
10
|
-
<item>Initial CLI for RFC-0070. Supports --config, --dest, --dry-run, --verbose flags.</item>
|
|
11
10
|
<item>RFC-0074: Catch SecretScanError, GitOperationError, PackageManagerError and exit with code 1. Pass verbose: true.</item>
|
|
12
11
|
<item>RFC-0131: Added --from-head, --ref, --allow-dirty, --no-push flags.</item>
|
|
12
|
+
<item>ADR-0034: compass v2 baseline repair — CHANGE_SUMMARY trim and/or purpose token rewrite</item>
|
|
13
13
|
</CHANGE_SUMMARY>
|
|
14
14
|
*/
|
|
15
15
|
import { Command } from "commander";
|
package/dist/config.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ declare const ExtractConfigSchema: z.ZodObject<{
|
|
|
31
31
|
monorepoConfigFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
32
32
|
onlyBuiltDependencies: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
33
33
|
destBase: z.ZodOptional<z.ZodString>;
|
|
34
|
+
lockDestination: z.ZodOptional<z.ZodBoolean>;
|
|
34
35
|
packageManager: z.ZodOptional<z.ZodEnum<{
|
|
35
36
|
pnpm: "pnpm";
|
|
36
37
|
npm: "npm";
|
|
@@ -58,6 +59,7 @@ declare const ExtractConfigSchema: z.ZodObject<{
|
|
|
58
59
|
}, z.core.$strip>>;
|
|
59
60
|
workspaceFilter: z.ZodOptional<z.ZodString>;
|
|
60
61
|
skipBuild: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
+
skipTests: z.ZodOptional<z.ZodBoolean>;
|
|
61
63
|
}, z.core.$strip>>;
|
|
62
64
|
gitignoreMode: z.ZodDefault<z.ZodEnum<{
|
|
63
65
|
minimal: "minimal";
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA6DhD,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmCvB,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
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
</non-goals>
|
|
7
7
|
</MODULE_CONTRACT>
|
|
8
8
|
<CHANGE_SUMMARY>
|
|
9
|
-
<item>Initial config schema and loader for RFC-0070.</item>
|
|
10
|
-
<item>RFC-0071: Added stripScopes, preservePackages, rootPackageName, customConditions, aiEcosystemFiles, monorepoConfigFiles, onlyBuiltDependencies, destBase, packageManager, gitignoreMode. Changed workspacePrefixes default to [] and copyDirs default to [].</item>
|
|
11
9
|
<item>RFC-0072: Changed packageManager from string to enum. Added CiConfigSchema and ci field.</item>
|
|
12
10
|
<item>RFC-0075: Added excludePathSegments and excludeExtensions fields.</item>
|
|
13
|
-
<item>ADR-0016: Config schema is the single source of truth — all org-specific values are config fields with org-neutral defaults, no behavioral assumptions baked into source code.</item>
|
|
11
|
+
<item>ADR-0016: Config schema is the single source of truth — all org-specific values are config fields with org-neutral defaults, no behavioral assumptions baked into source code; opt-in lockDestination placement policy.</item>
|
|
14
12
|
<item>RFC-0131: Added git.autoReconcile, source, allowDirty fields.</item>
|
|
13
|
+
<item>RFC-0175: Added ci.skipTests field.</item>
|
|
14
|
+
<item>ADR-0034: compass v2 baseline repair — CHANGE_SUMMARY trim and/or purpose token rewrite</item>
|
|
15
|
+
<history>RFC-0071</history>
|
|
15
16
|
</CHANGE_SUMMARY>
|
|
16
17
|
*/
|
|
17
18
|
import { readFile } from "node:fs/promises";
|
|
@@ -64,6 +65,7 @@ const CiConfigSchema = z.object({
|
|
|
64
65
|
deploy: CloudflarePagesDeploySchema.optional(),
|
|
65
66
|
workspaceFilter: z.string().optional(),
|
|
66
67
|
skipBuild: z.boolean().optional(),
|
|
68
|
+
skipTests: z.boolean().optional(),
|
|
67
69
|
});
|
|
68
70
|
const ExtractConfigSchema = z.object({
|
|
69
71
|
projectDir: z.string().min(1),
|
|
@@ -83,6 +85,7 @@ const ExtractConfigSchema = z.object({
|
|
|
83
85
|
monorepoConfigFiles: z.array(z.string()).optional(),
|
|
84
86
|
onlyBuiltDependencies: z.array(z.string()).default([]),
|
|
85
87
|
destBase: z.string().optional(),
|
|
88
|
+
lockDestination: z.boolean().optional(),
|
|
86
89
|
packageManager: z.enum(["pnpm", "npm", "yarn"]).optional(),
|
|
87
90
|
ci: CiConfigSchema.optional(),
|
|
88
91
|
gitignoreMode: z.enum(["minimal", "extended"]).default("extended"),
|
package/dist/extract.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../src/extract.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../src/extract.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACV,aAAa,EAEb,cAAc,EACd,aAAa,EAGd,MAAM,YAAY,CAAC;AA2CpB,wBAAsB,cAAc,CAClC,MAAM,EAAE,aAAa,EACrB,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,aAAa,CAAC,CAmMxB"}
|
package/dist/extract.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
/*
|
|
2
2
|
<MODULE_CONTRACT>
|
|
3
|
-
<purpose>
|
|
3
|
+
<purpose>extract — 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>
|
|
7
7
|
</MODULE_CONTRACT>
|
|
8
8
|
<CHANGE_SUMMARY>
|
|
9
|
-
<item>Initial extractProject orchestrator for RFC-0070. Ports main() and exportStandalonePackage() from scripts/export-clients.ts.</item>
|
|
10
|
-
<item>RFC-0071: Replaced hardcoded destBase, AI files, copyDirs defaults with config-driven options. Pass config to transform functions.</item>
|
|
11
|
-
<item>RFC-0072: Added detectPackageManager, parameterized install command, CI workflow, and all transform functions for pnpm/npm/yarn.</item>
|
|
12
9
|
<item>RFC-0073: replaced execSync with execFileSync (argument arrays) to eliminate shell injection.</item>
|
|
13
10
|
<item>RFC-0074: Replaced process.exit(1) with SecretScanError. Changed return type to Promise<ExtractResult>. Added progress events, logger, PackageManagerError wrapping.</item>
|
|
14
11
|
<item>RFC-0075: Consolidated all inline await import("node:fs*") to top-level static imports.</item>
|
|
15
|
-
<item>
|
|
16
|
-
<item>
|
|
12
|
+
<item>RFC-0131: Clean-source extraction — dirty preflight via assertCleanSource, --from-head/--ref via materializeHeadWorktree, versionBump×head conflict rejection, --no-push autoPush override; opt-in locked destination preflight.</item>
|
|
13
|
+
<item>ADR-0034: compass v2 baseline repair — CHANGE_SUMMARY trim and/or purpose token rewrite</item>
|
|
14
|
+
<history>RFC-0071, RFC-0072</history>
|
|
17
15
|
</CHANGE_SUMMARY>
|
|
18
16
|
*/
|
|
19
17
|
import { stat, cp, mkdir, writeFile, readFile } from "node:fs/promises";
|
|
20
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
18
|
+
import { existsSync, readFileSync, lstatSync } from "node:fs";
|
|
21
19
|
import { execFileSync } from "node:child_process";
|
|
22
20
|
import * as path from "node:path";
|
|
23
21
|
import { SecretScanError, PackageManagerError, GitOperationError } from "./errors.js";
|
|
@@ -60,6 +58,33 @@ export async function extractProject(config, options = {}) {
|
|
|
60
58
|
}
|
|
61
59
|
const destBase = config.destBase ?? (config.projectDir.startsWith("packages/") ? "packages" : "exports");
|
|
62
60
|
const dest = options.dest ?? path.resolve(realRoot, "..", destBase, config.destName);
|
|
61
|
+
// Validate before dry-run, source materialization, or destination cleanup.
|
|
62
|
+
// Opt-in keeps other consumers' explicit destination workflows unchanged.
|
|
63
|
+
if (config.lockDestination) {
|
|
64
|
+
const segment = (value) => value.length > 0 &&
|
|
65
|
+
value !== "." &&
|
|
66
|
+
value !== ".." &&
|
|
67
|
+
!/[\\/]/.test(value) &&
|
|
68
|
+
!path.isAbsolute(value);
|
|
69
|
+
if (!segment(destBase) || !segment(config.destName)) {
|
|
70
|
+
fail(new GitOperationError("preflight", "Locked destination requires single directory names for destBase and destName"));
|
|
71
|
+
}
|
|
72
|
+
const container = path.resolve(realRoot, "..", destBase);
|
|
73
|
+
const expected = path.join(container, config.destName);
|
|
74
|
+
if (path.resolve(dest) !== expected) {
|
|
75
|
+
fail(new GitOperationError("preflight", `Destination is locked to ${expected}; remove the destination override`));
|
|
76
|
+
}
|
|
77
|
+
const legacy = path.resolve(realRoot, "..", config.destName);
|
|
78
|
+
if (lstatSync(legacy, { throwIfNoEntry: false })) {
|
|
79
|
+
fail(new GitOperationError("preflight", `Misplaced export exists at ${legacy}; relocate it to ${expected} before exporting`));
|
|
80
|
+
}
|
|
81
|
+
for (const candidate of [container, expected]) {
|
|
82
|
+
const entry = lstatSync(candidate, { throwIfNoEntry: false });
|
|
83
|
+
if (entry && (!entry.isDirectory() || entry.isSymbolicLink())) {
|
|
84
|
+
fail(new GitOperationError("preflight", `Export destination must be a real directory, not a symlink or file: ${candidate}`));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
63
88
|
// RFC-0131: the export reads more than projectDir — declared copy/app/package
|
|
64
89
|
// dirs, root-level config/ecosystem files (explicit or the pm-derived
|
|
65
90
|
// defaults), batch data, postProcess copy sources, and implicit root inputs
|
package/dist/fs/copy.js
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
</non-goals>
|
|
8
8
|
</MODULE_CONTRACT>
|
|
9
9
|
<CHANGE_SUMMARY>
|
|
10
|
-
<item>Ported copyFiltered, copyStandalonePackage, removeDest from scripts/export-clients-helpers.ts for RFC-0070.</item>
|
|
11
10
|
<item>RFC-0071: Split IGNORE_DIRS into BASE_IGNORE_DIRS (org-neutral) and config-driven ignoreDirs. MONOREPO_CONFIG_FILES kept as auto-detect candidate list.</item>
|
|
12
11
|
<item>RFC-0072: Extended IGNORE_FILES with package-lock.json and yarn.lock. Added getMonorepoConfigFiles(pm) to filter pnpm-workspace.yaml for npm/yarn.</item>
|
|
13
12
|
<item>RFC-0075: Consolidated inline import in truncateCsv to top-level. Made isKeyMaterial/isDbFile configurable via excludePathSegments/excludeExtensions.</item>
|
|
13
|
+
<item>ADR-0034: compass v2 baseline repair — CHANGE_SUMMARY trim and/or purpose token rewrite</item>
|
|
14
14
|
</CHANGE_SUMMARY>
|
|
15
15
|
*/
|
|
16
16
|
import { cp, mkdir, readdir, rm, readFile, writeFile } from "node:fs/promises";
|
package/dist/fs/discover.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
</non-goals>
|
|
7
7
|
</MODULE_CONTRACT>
|
|
8
8
|
<CHANGE_SUMMARY>
|
|
9
|
-
<item>Ported discoverPackageDeps from scripts/export-clients-helpers.ts for RFC-0070. Supports both @syrokomskyi/ and @warpgogol/ prefixes.</item>
|
|
10
9
|
<item>ADR-0082: added resolveSourceVersion — reads a workspace package's version from the source monorepo so preserved deps can be pinned to ^<sourceVersion>.</item>
|
|
10
|
+
<item>ADR-0034: compass v2 baseline repair — CHANGE_SUMMARY trim and/or purpose token rewrite</item>
|
|
11
11
|
</CHANGE_SUMMARY>
|
|
12
12
|
*/
|
|
13
13
|
import { readFile, readdir } from "node:fs/promises";
|
package/dist/fs/git.js
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
</non-goals>
|
|
7
7
|
</MODULE_CONTRACT>
|
|
8
8
|
<CHANGE_SUMMARY>
|
|
9
|
-
<item>Initial git helpers for RFC-0070. Ported commitExport from scripts/export-clients.ts.</item>
|
|
10
|
-
<item>RFC-0073: replaced all execSync with execFileSync (argument arrays) to eliminate shell injection.</item>
|
|
11
9
|
<item>RFC-0074: Wrapped execFileSync calls with GitOperationError. Changed commitExport return to { committed, pushed }.</item>
|
|
12
10
|
<item>RFC-0075: Added Windows multi-prefix guard in transferGitHistory().</item>
|
|
13
11
|
<item>RFC-0131: Added assertCleanSource (dirty preflight), materializeHeadWorktree (--from-head), and git.autoReconcile ours-merge retry in commitExport.</item>
|
|
14
12
|
<item>RFC-0132: Added ensureNpmTokenSecret — best-effort NPM_TOKEN bootstrap on the extract repo before first push, sourced from ~/.npmrc.</item>
|
|
13
|
+
<item>ADR-0034: compass v2 baseline repair — CHANGE_SUMMARY trim and/or purpose token rewrite</item>
|
|
14
|
+
<history>RFC-0073</history>
|
|
15
15
|
</CHANGE_SUMMARY>
|
|
16
16
|
*/
|
|
17
17
|
import { existsSync, rmSync, readFileSync } from "node:fs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/fs/transform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/fs/transform.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAIxC,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,aAAa,EACrB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CA2Df;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA0D5F;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAY7F;AAED,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,aAAa,EACrB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CA8Bf;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAOzF;AAmBD,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAO1F;AAmBD,wBAAgB,cAAc,CAAC,UAAU,GAAE,MAAM,EAAO,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,MAAM,CA4BxF;AA6CD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AAA;CAAE,EAC7B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAUT;AAID;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAiBpD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,EACzC,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAST;AAmBD,wBAAsB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAe5F"}
|
package/dist/fs/transform.js
CHANGED
|
@@ -6,14 +6,13 @@
|
|
|
6
6
|
</non-goals>
|
|
7
7
|
</MODULE_CONTRACT>
|
|
8
8
|
<CHANGE_SUMMARY>
|
|
9
|
-
<item>Ported transformPackageJson, fixPackageTsconfigs, fixAppTsconfigs, regenerateTsconfigBase, generateRootFiles from scripts/export-clients-helpers.ts for RFC-0070.</item>
|
|
10
|
-
<item>ADR-0010: added lint step, npm publish --provenance, and id-token: write to generateCiWorkflow()</item>
|
|
11
|
-
<item>RFC-0071: Replaced hardcoded org-specific values with config-driven options (stripScopes, preservePackages, rootPackageName, customConditions, onlyBuiltDependencies, packageManager, gitignoreMode).</item>
|
|
12
9
|
<item>RFC-0072: Parameterized buildRootPackageJson, generateRootFiles, generateCiWorkflow, fixStandalonePackageJson for pnpm/npm/yarn support.</item>
|
|
13
|
-
<item>Fix: Split generateCiWorkflow into ci + publish jobs — publish only on push to main, with registry-url for NODE_AUTH_TOKEN.</item>
|
|
14
10
|
<item>ADR-0082: preservePackages workspace:* deps now pin to ^<sourceVersion> instead of * — extracted lockfiles resolve the just-published sibling under pnpm minimumReleaseAge.</item>
|
|
15
11
|
<item>RFC-1081: Added gh release create step after npm publish with --generate-notes and || true for tag collision. Updated publish job permissions to contents: write. (Ported back from standalone repo — was committed there directly on 2026-09-13.)</item>
|
|
16
12
|
<item>RFC-0132: standalone manifest self-healing — ensureTypecheckScript (build+--noEmit), ensureRepositoryField (from git.remote), ensureTestScriptTolerant (--passWithNoTests when no test files ship).</item>
|
|
13
|
+
<item>RFC-0175: generateCiWorkflow honors ci.skipTests — no test step, no ~/.ssh provision.</item>
|
|
14
|
+
<item>ADR-0034: compass v2 baseline repair — CHANGE_SUMMARY trim and/or purpose token rewrite</item>
|
|
15
|
+
<history>ADR-0010, RFC-0071</history>
|
|
17
16
|
</CHANGE_SUMMARY>
|
|
18
17
|
*/
|
|
19
18
|
import { readFile, writeFile, rm, access, readdir } from "node:fs/promises";
|
|
@@ -453,6 +452,9 @@ export function generateCiWorkflow(pm, ci, opts) {
|
|
|
453
452
|
: [];
|
|
454
453
|
const ciSetupSteps = [
|
|
455
454
|
" - uses: actions/checkout@v5",
|
|
455
|
+
" with:",
|
|
456
|
+
// Full history: exported packages' tests may clone the repo (shallow fails).
|
|
457
|
+
" fetch-depth: 0",
|
|
456
458
|
...pnpmSetup,
|
|
457
459
|
" - uses: actions/setup-node@v5",
|
|
458
460
|
" with:",
|
|
@@ -464,7 +466,14 @@ export function generateCiWorkflow(pm, ci, opts) {
|
|
|
464
466
|
if (!ci?.skipBuild) {
|
|
465
467
|
buildSteps.push(` - run: ${runPrefix} build`);
|
|
466
468
|
}
|
|
467
|
-
buildSteps.push(` - run: ${runPrefix} lint`, ` - run: ${runPrefix} typecheck
|
|
469
|
+
buildSteps.push(` - run: ${runPrefix} lint`, ` - run: ${runPrefix} typecheck`);
|
|
470
|
+
// RFC-0175: ci.skipTests omits the export-side test re-run (and its ~/.ssh
|
|
471
|
+
// provision) — heavyweight suites re-verify what monorepo gates already ran.
|
|
472
|
+
if (!ci?.skipTests) {
|
|
473
|
+
buildSteps.push(
|
|
474
|
+
// Exported tests may probe ~/.ssh/config; runners ship no ~/.ssh dir.
|
|
475
|
+
" - run: mkdir -p ~/.ssh", ` - run: ${testCmd}`);
|
|
476
|
+
}
|
|
468
477
|
const lines = [
|
|
469
478
|
"name: CI",
|
|
470
479
|
"",
|
|
@@ -480,7 +489,7 @@ export function generateCiWorkflow(pm, ci, opts) {
|
|
|
480
489
|
"jobs:",
|
|
481
490
|
" ci:",
|
|
482
491
|
" runs-on: ubuntu-latest",
|
|
483
|
-
" timeout-minutes:
|
|
492
|
+
" timeout-minutes: 30",
|
|
484
493
|
" steps:",
|
|
485
494
|
...ciSetupSteps,
|
|
486
495
|
...buildSteps,
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/*
|
|
2
2
|
<MODULE_CONTRACT>
|
|
3
|
-
<purpose>
|
|
3
|
+
<purpose>index — 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>
|
|
7
7
|
</non-goals>
|
|
8
8
|
</MODULE_CONTRACT>
|
|
9
9
|
<CHANGE_SUMMARY>
|
|
10
|
-
<item>Initial scaffold for RFC-0070.</item>
|
|
11
10
|
<item>RFC-0074: Added diffSummary, buildGitignore, buildRootPackageJson, isIgnored, ExtractResult, ExtractProgressEvent, ProgressCallback, error class exports.</item>
|
|
12
11
|
<item>RFC-0131: Added assertCleanSource and materializeHeadWorktree exports.</item>
|
|
12
|
+
<item>ADR-0034: compass v2 baseline repair — CHANGE_SUMMARY trim and/or purpose token rewrite</item>
|
|
13
13
|
</CHANGE_SUMMARY>
|
|
14
14
|
*/
|
|
15
15
|
export { loadConfig, ExtractConfigSchema } from "./config.js";
|
package/dist/log.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,MAAM;IACrB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAStD"}
|
package/dist/log.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
<MODULE_CONTRACT>
|
|
3
|
-
<purpose>
|
|
3
|
+
<purpose>log — minimal logging abstraction — gates console output on verbose flag for library-grade use.</purpose>
|
|
4
4
|
<non-goals>
|
|
5
5
|
<item>Does not implement structured logging or log levels beyond log/error.</item>
|
|
6
6
|
<item>Does not depend on external logging libraries.</item>
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
</MODULE_CONTRACT>
|
|
9
9
|
<CHANGE_SUMMARY>
|
|
10
10
|
<item>RFC-0074: Initial logger — Logger interface and createLogger factory.</item>
|
|
11
|
+
<item>ADR-0034: compass v2 baseline repair — CHANGE_SUMMARY trim and/or purpose token rewrite</item>
|
|
11
12
|
</CHANGE_SUMMARY>
|
|
12
13
|
*/
|
|
13
14
|
export function createLogger(verbose) {
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
</non-goals>
|
|
7
7
|
</MODULE_CONTRACT>
|
|
8
8
|
<CHANGE_SUMMARY>
|
|
9
|
-
<item>Initial post-process rule runner for RFC-0070.</item>
|
|
10
9
|
<item>RFC-0074: Added optional onProgress callback for per-rule progress events.</item>
|
|
10
|
+
<item>ADR-0034: compass v2 baseline repair — CHANGE_SUMMARY trim and/or purpose token rewrite</item>
|
|
11
11
|
</CHANGE_SUMMARY>
|
|
12
12
|
*/
|
|
13
13
|
import { readFile, writeFile, rm, cp, mkdir } from "node:fs/promises";
|
package/dist/scan.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
</non-goals>
|
|
7
7
|
</MODULE_CONTRACT>
|
|
8
8
|
<CHANGE_SUMMARY>
|
|
9
|
-
<item>Initial secret scanner: AWS keys, private keys, generic tokens, pre-signed S3 URLs.</item>
|
|
10
9
|
<item>RFC-0075: removed duplicate SecretFinding interface (import from types.ts). Consolidated inline import to top-level.</item>
|
|
10
|
+
<item>ADR-0034: compass v2 baseline repair — CHANGE_SUMMARY trim and/or purpose token rewrite</item>
|
|
11
11
|
</CHANGE_SUMMARY>
|
|
12
12
|
*/
|
|
13
13
|
import { readdir, readFile, stat } from "node:fs/promises";
|
package/dist/types.d.ts
CHANGED
|
@@ -17,6 +17,13 @@ export interface CiConfig {
|
|
|
17
17
|
deploy?: DeployConfig;
|
|
18
18
|
workspaceFilter?: string;
|
|
19
19
|
skipBuild?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* RFC-0175: omit the test step (and its ~/.ssh provision) from the generated
|
|
22
|
+
* CI workflow. For heavyweight suites the export-side re-run re-verifies a
|
|
23
|
+
* tree the monorepo gates already tested pre-export — install/build/lint/
|
|
24
|
+
* typecheck stay as the extraction-fidelity gate. Default: off.
|
|
25
|
+
*/
|
|
26
|
+
skipTests?: boolean;
|
|
20
27
|
}
|
|
21
28
|
export type PostProcessAction = "copy" | "patch" | "delete";
|
|
22
29
|
export interface CopyRule {
|
|
@@ -71,6 +78,8 @@ export interface ExtractConfig {
|
|
|
71
78
|
monorepoConfigFiles?: string[];
|
|
72
79
|
onlyBuiltDependencies?: string[];
|
|
73
80
|
destBase?: string;
|
|
81
|
+
/** Require the configured sibling destination; reject overrides, symlinks and root duplicates. */
|
|
82
|
+
lockDestination?: boolean;
|
|
74
83
|
packageManager?: PackageManager;
|
|
75
84
|
ci?: CiConfig;
|
|
76
85
|
gitignoreMode?: "minimal" | "extended";
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"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|
<CHANGE_SUMMARY>
|
|
10
|
-
<item>Initial types for RFC-0070: ExtractConfig, ExtractContext, PostProcessRule.</item>
|
|
11
|
-
<item>RFC-0071: Added stripScopes, preservePackages, rootPackageName, customConditions, aiEcosystemFiles, monorepoConfigFiles, onlyBuiltDependencies, destBase, packageManager, gitignoreMode fields.</item>
|
|
12
10
|
<item>RFC-0072: Changed packageManager from string to PackageManager enum. Added CiConfig interface and ci field.</item>
|
|
13
11
|
<item>RFC-0074: Added ExtractResult, ExtractProgressEvent, ProgressCallback types. Added onProgress to ExtractOptions.</item>
|
|
14
|
-
<item>RFC-0075: Added excludePathSegments and excludeExtensions fields for config-driven file exclusion.</item>
|
|
12
|
+
<item>RFC-0075: Added excludePathSegments and excludeExtensions fields for config-driven file exclusion; optional lockDestination for export placement.</item>
|
|
15
13
|
<item>RFC-0131: Added source/allowDirty config fields, git.autoReconcile, and ExtractOptions fromHead/ref/allowDirty/noPush for clean-source extraction and push reconciliation.</item>
|
|
14
|
+
<item>RFC-0175: Added ci.skipTests — omit the export-side test re-run for trees the monorepo gates already verified.</item>
|
|
15
|
+
<item>ADR-0034: compass v2 baseline repair — CHANGE_SUMMARY trim and/or purpose token rewrite</item>
|
|
16
|
+
<history>RFC-0071</history>
|
|
16
17
|
</CHANGE_SUMMARY>
|
|
17
18
|
*/
|
|
18
19
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warpgogol/repo-extract",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
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)",
|