@kungfu-tech/buildchain 2.14.0 → 2.14.1-alpha.1
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/bin/buildchain.mjs +54 -0
- package/dist/site/buildchain-contract.json +5 -5
- package/dist/site/buildchain-site.json +13 -13
- package/dist/site/capability-registry.json +2 -2
- package/dist/site/cli-registry.json +12 -0
- package/dist/site/kfd-claims.json +37 -10
- package/dist/site/kfd-upstream-aggregate.json +1 -1
- package/dist/site/manual-registry.json +3 -3
- package/dist/site/node-api-registry.json +16 -3
- package/dist/site/page-registry.json +6 -6
- package/dist/site/public-surface-audit.json +34 -9
- package/dist/site/publication-registry.json +4 -4
- package/dist/site/release-provenance.json +1 -0
- package/dist/site/site-manifest.json +7 -7
- package/dist/site/workflow-registry.json +9 -4
- package/docs/MAP.md +1 -0
- package/docs/cli.md +37 -0
- package/docs/release-governance.md +16 -3
- package/package.json +2 -1
- package/packages/core/index.js +6 -0
- package/packages/core/portable-dev-cache.js +288 -0
- package/scripts/buildchain-patrol.mjs +3 -1
- package/scripts/dev-pr-auto-merge.mjs +361 -20
- package/scripts/generate-site-bundle.mjs +4 -0
package/bin/buildchain.mjs
CHANGED
|
@@ -96,6 +96,7 @@ import {
|
|
|
96
96
|
registerKfd3Surfaces,
|
|
97
97
|
} from "../packages/core/kfd3-surface-register.js";
|
|
98
98
|
import { createBuildchainLayoutDiscovery } from "../packages/core/buildchain-layout.js";
|
|
99
|
+
import { createPortableDevCachePlan, createPortableDevCacheReceipt } from "../packages/core/portable-dev-cache.js";
|
|
99
100
|
|
|
100
101
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
101
102
|
const embeddedPackageVersion = process.env.BUILDCHAIN_EMBEDDED_PACKAGE_VERSION || "";
|
|
@@ -105,6 +106,14 @@ function usage() {
|
|
|
105
106
|
buildchain --help
|
|
106
107
|
buildchain version
|
|
107
108
|
buildchain layout [--cwd <dir>] [--json]
|
|
109
|
+
buildchain portable-cache plan --manifest <file-or-json> [--output <file>]
|
|
110
|
+
[--github-output <file>] [--json]
|
|
111
|
+
buildchain portable-cache receipt --plan <file-or-json> [--matched-key <key>]
|
|
112
|
+
[--cache-hit true|false]
|
|
113
|
+
[--validation-status pass|fail]
|
|
114
|
+
[--validation-reason <text>]
|
|
115
|
+
[--cold-fallback-status not-run|passed|failed]
|
|
116
|
+
[--output <file>] [--json]
|
|
108
117
|
buildchain init [--cwd <dir>] [--type package|native|web-surface|infra-contract|publication-artifact|anchored-package] [--force]
|
|
109
118
|
[--package-manager pnpm|npm|yarn] [--runner-preset <preset>]
|
|
110
119
|
[--artifact-name <template>]
|
|
@@ -1348,6 +1357,51 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
1348
1357
|
return;
|
|
1349
1358
|
}
|
|
1350
1359
|
|
|
1360
|
+
if (command === "portable-cache") {
|
|
1361
|
+
const [subcommand = "", ...cacheArgs] = args;
|
|
1362
|
+
if (subcommand === "plan") {
|
|
1363
|
+
const manifestValue = readFlag(cacheArgs, "manifest", "");
|
|
1364
|
+
if (!manifestValue) throw new Error("usage: buildchain portable-cache plan --manifest <file-or-json>");
|
|
1365
|
+
const value = createPortableDevCachePlan(readJsonInput(manifestValue, { label: "portable cache manifest" }));
|
|
1366
|
+
const output = readFlag(cacheArgs, "output", "");
|
|
1367
|
+
if (output) writeJsonFile(path.resolve(output), value);
|
|
1368
|
+
const githubOutput = readFlag(cacheArgs, "github-output", "");
|
|
1369
|
+
if (githubOutput) {
|
|
1370
|
+
const delimiter = `BUILDCHAIN_PORTABLE_CACHE_${crypto.randomBytes(8).toString("hex")}`;
|
|
1371
|
+
const fields = {
|
|
1372
|
+
"cache-key": value.key,
|
|
1373
|
+
"restore-keys": value.restoreKeys.join("\n"),
|
|
1374
|
+
"cache-paths": value.paths.join("\n"),
|
|
1375
|
+
"plan-digest": value.planDigest,
|
|
1376
|
+
"plan-json": JSON.stringify(value),
|
|
1377
|
+
};
|
|
1378
|
+
const lines = Object.entries(fields).flatMap(([name, field]) => [`${name}<<${delimiter}`, field, delimiter]);
|
|
1379
|
+
fs.appendFileSync(path.resolve(githubOutput), `${lines.join("\n")}\n`);
|
|
1380
|
+
}
|
|
1381
|
+
if (!output || readBooleanFlag(cacheArgs, "json")) printJson(value);
|
|
1382
|
+
else process.stdout.write(`portable cache plan: ${output}\n`);
|
|
1383
|
+
return;
|
|
1384
|
+
}
|
|
1385
|
+
if (subcommand === "receipt") {
|
|
1386
|
+
const planValue = readFlag(cacheArgs, "plan", "");
|
|
1387
|
+
if (!planValue) throw new Error("usage: buildchain portable-cache receipt --plan <file-or-json>");
|
|
1388
|
+
const value = createPortableDevCacheReceipt({
|
|
1389
|
+
plan: readJsonInput(planValue, { label: "portable cache plan" }),
|
|
1390
|
+
matchedKey: readFlag(cacheArgs, "matched-key", ""),
|
|
1391
|
+
cacheHit: readFlag(cacheArgs, "cache-hit", ""),
|
|
1392
|
+
validationStatus: readFlag(cacheArgs, "validation-status", "pass"),
|
|
1393
|
+
validationReason: readFlag(cacheArgs, "validation-reason", ""),
|
|
1394
|
+
coldFallbackStatus: readFlag(cacheArgs, "cold-fallback-status", "not-run"),
|
|
1395
|
+
});
|
|
1396
|
+
const output = readFlag(cacheArgs, "output", "");
|
|
1397
|
+
if (output) writeJsonFile(path.resolve(output), value);
|
|
1398
|
+
if (!output || readBooleanFlag(cacheArgs, "json")) printJson(value);
|
|
1399
|
+
else process.stdout.write(`portable cache receipt: ${output}\n`);
|
|
1400
|
+
return;
|
|
1401
|
+
}
|
|
1402
|
+
throw new Error("usage: buildchain portable-cache <plan|receipt> ...");
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1351
1405
|
if (command === "init") {
|
|
1352
1406
|
const result = initBuildchainRepo({
|
|
1353
1407
|
cwd: readFlag(args, "cwd", process.cwd()),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"product": {
|
|
5
5
|
"name": "Buildchain",
|
|
6
6
|
"package": "@kungfu-tech/buildchain",
|
|
7
|
-
"version": "2.14.
|
|
7
|
+
"version": "2.14.1-alpha.1",
|
|
8
8
|
"repository": "https://github.com/kungfu-systems/buildchain"
|
|
9
9
|
},
|
|
10
10
|
"majorLine": "v2",
|
|
@@ -437,7 +437,7 @@
|
|
|
437
437
|
"README badge block checks and writes are generated from machine-readable repository facts"
|
|
438
438
|
],
|
|
439
439
|
"breakingDigest": "sha256:90a73892b2d6c214048448d5f45df75639bdf7b7e8fefd9c596e04b087407bcc",
|
|
440
|
-
"auditDigest": "sha256:
|
|
440
|
+
"auditDigest": "sha256:3f232f89616d18e9b6fdd9470a33961cd25e3401d204905707cbe18fdecf5d2c"
|
|
441
441
|
},
|
|
442
442
|
{
|
|
443
443
|
"contractVersion": 1,
|
|
@@ -527,7 +527,7 @@
|
|
|
527
527
|
"manual entries carry source file digests so downstream sites and agents can detect stale hand-written documentation"
|
|
528
528
|
],
|
|
529
529
|
"breakingDigest": "sha256:7d0d2819e3a3e72989d9c57b5efe9d0bc0a79bc0f2c82a0c7b9d6c5a211a91f2",
|
|
530
|
-
"auditDigest": "sha256:
|
|
530
|
+
"auditDigest": "sha256:42bcce2ffadc96b22976ffbcd0d7e71dcdc7aae0706013deac9fe9f663423e62"
|
|
531
531
|
},
|
|
532
532
|
{
|
|
533
533
|
"contractVersion": 1,
|
|
@@ -549,7 +549,7 @@
|
|
|
549
549
|
"agents can discover supported Node APIs without importing internal file paths"
|
|
550
550
|
],
|
|
551
551
|
"breakingDigest": "sha256:48f925608d3e2131d90936b07dc2a30341204cae3e6e785c0f77d61ad755c945",
|
|
552
|
-
"auditDigest": "sha256:
|
|
552
|
+
"auditDigest": "sha256:9f0cf71c3fd2cdafee57c242afc3b02f3146f61d0d4c4e6db402a0fdbe02f5cd"
|
|
553
553
|
},
|
|
554
554
|
{
|
|
555
555
|
"contractVersion": 1,
|
|
@@ -2709,5 +2709,5 @@
|
|
|
2709
2709
|
}
|
|
2710
2710
|
],
|
|
2711
2711
|
"compatibilityDigest": "sha256:af162b86ab4506e9b5f1d3c59b41f3fd57fbad79ff4d749a7f12ff16460517f8",
|
|
2712
|
-
"contractDigest": "sha256:
|
|
2712
|
+
"contractDigest": "sha256:d27a2b7cfccc916749f1565958fd4124a014ddeb35b5c954bf367802665a9dc7"
|
|
2713
2713
|
}
|