@kungfu-tech/buildchain 2.8.17 → 2.9.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 +2 -0
- package/bin/buildchain.mjs +119 -8
- package/dist/site/buildchain-contract.json +8 -8
- package/dist/site/buildchain-site.json +77 -28
- package/dist/site/cli-registry.json +5 -0
- package/dist/site/kfd-claims.json +37 -1
- package/dist/site/manual-registry.json +14 -6
- package/dist/site/node-api-registry.json +24 -7
- package/dist/site/page-registry.json +58 -17
- package/dist/site/release-provenance.json +2 -0
- package/dist/site/site-manifest.json +18 -10
- package/docs/MAP.md +7 -3
- package/docs/build-facts.md +164 -0
- package/docs/cli.md +34 -2
- package/docs/readme-badges.md +40 -3
- package/docs/release-passport.md +11 -1
- package/docs/versioning.md +1 -0
- package/docs/web-surface-deployments.md +19 -7
- package/package.json +3 -1
- package/packages/core/README.md +23 -7
- package/packages/core/badges.js +18 -0
- package/packages/core/build-facts.js +567 -0
- package/packages/core/buildchain-config.js +115 -0
- package/packages/core/buildchain-kfd-claims.js +2 -0
- package/packages/core/index.js +24 -0
- package/packages/core/readme-badges.js +166 -2
- package/packages/core/release-passport.js +21 -0
- package/scripts/check-inventory.mjs +37 -6
- package/scripts/generate-site-bundle.mjs +3 -0
- package/scripts/web-surface-core.mjs +48 -0
|
@@ -277,6 +277,53 @@ function syncStaticArtifactArgs({ artifactRoot, bucket, objectPrefix }) {
|
|
|
277
277
|
return args;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
+
function directoryIndexAliasKeys({ objectPrefix, relativeIndexPath }) {
|
|
281
|
+
const normalizedPrefix = normalizeS3Key(objectPrefix);
|
|
282
|
+
if (!normalizedPrefix) {
|
|
283
|
+
return [];
|
|
284
|
+
}
|
|
285
|
+
const normalizedIndexPath = normalizeS3Key(relativeIndexPath);
|
|
286
|
+
if (!normalizedIndexPath.endsWith("index.html")) {
|
|
287
|
+
return [];
|
|
288
|
+
}
|
|
289
|
+
const directory = normalizeS3Key(normalizedIndexPath.slice(0, -"index.html".length));
|
|
290
|
+
const aliasBase = joinS3Key(normalizedPrefix, directory);
|
|
291
|
+
return [...new Set([aliasBase, `${aliasBase}/`].filter(Boolean))];
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function directoryIndexAliasOperations({ surfaceArtifactRoot, bucket, binding }) {
|
|
295
|
+
if (binding.directoryIndexResolution === false || !bucket || !binding.objectPrefix || !fs.existsSync(surfaceArtifactRoot)) {
|
|
296
|
+
return [];
|
|
297
|
+
}
|
|
298
|
+
return listFiles(surfaceArtifactRoot, ".")
|
|
299
|
+
.filter((filePath) => path.basename(filePath) === (binding.directoryIndex || "index.html"))
|
|
300
|
+
.flatMap((filePath) => {
|
|
301
|
+
const relativeIndexPath = toPosix(path.relative(surfaceArtifactRoot, filePath));
|
|
302
|
+
return directoryIndexAliasKeys({ objectPrefix: binding.objectPrefix, relativeIndexPath }).map((key) => ({
|
|
303
|
+
action: "write-directory-index-alias",
|
|
304
|
+
surface: binding.surface,
|
|
305
|
+
command: "aws",
|
|
306
|
+
args: [
|
|
307
|
+
"s3api",
|
|
308
|
+
"put-object",
|
|
309
|
+
"--bucket",
|
|
310
|
+
bucket,
|
|
311
|
+
"--key",
|
|
312
|
+
key,
|
|
313
|
+
"--body",
|
|
314
|
+
filePath,
|
|
315
|
+
"--content-type",
|
|
316
|
+
"text/html",
|
|
317
|
+
],
|
|
318
|
+
routing: {
|
|
319
|
+
...(binding.routing || {}),
|
|
320
|
+
directoryIndexAlias: key,
|
|
321
|
+
directoryIndexSource: relativeIndexPath,
|
|
322
|
+
},
|
|
323
|
+
}));
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
|
|
280
327
|
function defaultCommandRunner({ command, args, stdin = "" }) {
|
|
281
328
|
const result = spawnSync(command, args, {
|
|
282
329
|
encoding: "utf8",
|
|
@@ -1345,6 +1392,7 @@ function deployBindingOperations({ artifactRoot, deployConfig, manifest, binding
|
|
|
1345
1392
|
args: syncStaticArtifactArgs({ artifactRoot: surfaceArtifactRoot, bucket, objectPrefix: binding.objectPrefix }),
|
|
1346
1393
|
routing: binding.routing,
|
|
1347
1394
|
},
|
|
1395
|
+
...directoryIndexAliasOperations({ surfaceArtifactRoot, bucket, binding }),
|
|
1348
1396
|
{
|
|
1349
1397
|
action: "write-deployment-manifest",
|
|
1350
1398
|
surface: binding.surface,
|