blogwright 0.4.0 → 0.5.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 +4 -1
- package/agent/agent-manifest.json +1 -1
- package/agent/server.js +2610 -616
- package/dist/adapters/process-aws-login.d.ts +19 -0
- package/dist/adapters/process-aws-login.js +28 -0
- package/dist/agent-package.js +2 -3
- package/dist/artifacts.d.ts +73 -0
- package/dist/artifacts.js +218 -0
- package/dist/aws-session.d.ts +118 -0
- package/dist/aws-session.js +360 -0
- package/dist/bin.js +6 -2
- package/dist/cache-control.d.ts +66 -0
- package/dist/cache-control.js +176 -0
- package/dist/cli.d.ts +22 -3
- package/dist/cli.js +122 -31
- package/dist/commands.d.ts +41 -9
- package/dist/commands.js +135 -126
- package/dist/context.d.ts +27 -5
- package/dist/context.js +59 -19
- package/dist/deploy.d.ts +78 -6
- package/dist/deploy.js +136 -52
- package/dist/init.d.ts +14 -2
- package/dist/init.js +145 -4
- package/dist/known-commands.d.ts +11 -9
- package/dist/known-commands.js +15 -9
- package/dist/live-release.d.ts +78 -0
- package/dist/live-release.js +159 -0
- package/dist/lock.d.ts +50 -0
- package/dist/lock.js +120 -0
- package/dist/nodes.d.ts +18 -0
- package/dist/nodes.js +405 -30
- package/dist/plugin-commands.d.ts +21 -0
- package/dist/plugin-commands.js +54 -3
- package/dist/plugins.d.ts +11 -9
- package/dist/plugins.js +29 -16
- package/dist/ports.d.ts +22 -1
- package/dist/releases.d.ts +54 -0
- package/dist/releases.js +527 -0
- package/dist/render.d.ts +18 -1
- package/dist/render.js +38 -6
- package/dist/repo.js +2 -3
- package/dist/rkey.d.ts +4 -3
- package/dist/rkey.js +4 -3
- package/dist/serving.d.ts +28 -0
- package/dist/serving.js +47 -0
- package/dist/verify.d.ts +45 -0
- package/dist/verify.js +183 -0
- package/dist/whoami.d.ts +23 -0
- package/dist/whoami.js +88 -0
- package/package.json +8 -8
package/dist/releases.js
ADDED
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release gating for static sites: `stage` builds once and publishes the
|
|
3
|
+
* output to `releases/<hash>/`, which nothing serves, and records its artifact
|
|
4
|
+
* manifest; `promote` copies those exact bytes into the live `site/` without
|
|
5
|
+
* rebuilding, invalidates what changed, and verifies the result against the
|
|
6
|
+
* manifest. The staged copy stays, so a later promotion of the same hash
|
|
7
|
+
* restores the same bytes - and `rollback <hash>` to a staged hash republishes
|
|
8
|
+
* it through the same checked copy instead of rebuilding.
|
|
9
|
+
*/
|
|
10
|
+
import { AwsError, colors, findRepoRoot, invalidationPaths, mapConcurrently, RepoRootNotFoundError, stagedReleasePrefix, stagedReleaseManifestKey, } from 'blogwright-core';
|
|
11
|
+
import { describeRelease, forgetStagedRelease, readArtifactManifest, newArtifactBuildManifestKey, readBuildArtifact, readStagedReleaseManifest, recordStagedRelease, requireStagedReleaseManifest, } from './artifacts.js';
|
|
12
|
+
import { cacheControlRecordKey, markCacheControlUnconfirmed, readCacheControlRecord, sameCacheControlRules, writeCacheControlRecord, } from './cache-control.js';
|
|
13
|
+
import { changedManifestKey, invalidatePaths, LIVE_SITE_TARGET, readManifest, runBuild, uploadSource, writeManifest, } from './deploy.js';
|
|
14
|
+
import { describeLiveRelease, isSettledLiveRelease, markLiveReleasePublishing, readLiveRelease, readPublications, recordLiveRelease, recordPublication, } from './live-release.js';
|
|
15
|
+
import { withEnvLock } from './lock.js';
|
|
16
|
+
import { RELEASE_STAGING_OUTPUT, reconcileBuilderImage, reconcileResponseHeadersOnDeploy, } from './nodes.js';
|
|
17
|
+
import { describeInvalidation, formatDuration, renderSummary } from './render.js';
|
|
18
|
+
import { resolveSeo } from './seo.js';
|
|
19
|
+
import { assertServingModeMatches, siteBaseUrl } from './serving.js';
|
|
20
|
+
import { LIVE_SITE_PREFIX, ReleaseMismatchError, verifyStoredRelease } from './verify.js';
|
|
21
|
+
/** How many objects a promotion copies at once. */
|
|
22
|
+
const PROMOTE_CONCURRENCY = 8;
|
|
23
|
+
/**
|
|
24
|
+
* How many leading bytes of a staged `sitemap.xml` are read to find its
|
|
25
|
+
* origin: enough for the XML declaration, the `<urlset>` element and the
|
|
26
|
+
* first `<loc>`, without reading a large sitemap whole.
|
|
27
|
+
*/
|
|
28
|
+
const SITEMAP_HEAD_BYTES = 4096;
|
|
29
|
+
/** How a message names the act of publishing for each command. */
|
|
30
|
+
function publishing(command) {
|
|
31
|
+
return command === 'promote' ? 'promoting' : 'republishing';
|
|
32
|
+
}
|
|
33
|
+
/** Stage and promote publish static output; SSR and preview stacks have other paths. */
|
|
34
|
+
function assertStaticEnvironment(ctx, command) {
|
|
35
|
+
if (ctx.preview) {
|
|
36
|
+
throw new Error(`${command} does not apply to the shared preview stack`);
|
|
37
|
+
}
|
|
38
|
+
if (ctx.config.ssr) {
|
|
39
|
+
throw new Error(`${command} publishes static releases, and "${ctx.env}" is an SSR environment: deploy ` +
|
|
40
|
+
'publishes a Web Function revision, and rollback reproduces a recorded one without a rebuild');
|
|
41
|
+
}
|
|
42
|
+
assertServingModeMatches(ctx);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Refuse to stage on a stack whose builder may not write `releases/`: the
|
|
46
|
+
* build would run in full and only then be denied.
|
|
47
|
+
*/
|
|
48
|
+
function assertReleaseStagingGranted(ctx) {
|
|
49
|
+
if (ctx.state.resources['iam-exec-role']?.[RELEASE_STAGING_OUTPUT] === true)
|
|
50
|
+
return;
|
|
51
|
+
throw new Error(`"${ctx.env}" was bootstrapped before release staging existed: run \`blogwright bootstrap ` +
|
|
52
|
+
`${ctx.env}\` once so the builder may write releases/ and build/artifacts/. Nothing was built.`);
|
|
53
|
+
}
|
|
54
|
+
/** The build target a staged release publishes as: its pending-job and Cache-Control record name. */
|
|
55
|
+
function stagedReleaseTarget(hash) {
|
|
56
|
+
return `release-${hash}`;
|
|
57
|
+
}
|
|
58
|
+
/** Build the working copy and publish it to `releases/<hash>/` for a later `promote`. */
|
|
59
|
+
export async function stage(ctx, opts = {}) {
|
|
60
|
+
const startedAt = Date.now();
|
|
61
|
+
assertStaticEnvironment(ctx, 'stage');
|
|
62
|
+
assertReleaseStagingGranted(ctx);
|
|
63
|
+
const cwd = await findRepoRoot(ctx.ports.fs);
|
|
64
|
+
const hash = await ctx.ports.vcs.revisionHash(cwd);
|
|
65
|
+
const prefix = stagedReleasePrefix(hash);
|
|
66
|
+
ctx.logger.info(colors.bold(`Staging ${hash} for "${ctx.env}" at ${prefix}`));
|
|
67
|
+
// Staging writes no site/, but it shares the bucket's build records and
|
|
68
|
+
// replaces a release a promotion may be copying, so it holds the lock too.
|
|
69
|
+
await withEnvLock(ctx, 'stage', hash, opts, () => stageLocked(ctx, { cwd, hash, prefix, startedAt, refresh: opts.refresh }));
|
|
70
|
+
}
|
|
71
|
+
async function stageLocked(ctx, run) {
|
|
72
|
+
const { cwd, hash, prefix, startedAt } = run;
|
|
73
|
+
// The staged bytes are about to be replaced, so the record binding them to
|
|
74
|
+
// a manifest goes first: a stage that stops partway leaves nothing promotable.
|
|
75
|
+
await forgetStagedRelease(ctx, hash);
|
|
76
|
+
const source = await uploadSource(ctx, cwd, hash);
|
|
77
|
+
await reconcileBuilderImage(ctx);
|
|
78
|
+
const buildManifestKey = newArtifactBuildManifestKey(hash);
|
|
79
|
+
const build = await runBuild(ctx, {
|
|
80
|
+
hash,
|
|
81
|
+
sourceKey: source.sourceKey,
|
|
82
|
+
sitePrefix: prefix,
|
|
83
|
+
// Each staged release is its own target, so its Cache-Control record
|
|
84
|
+
// says which rules the files under its prefix were written with - what
|
|
85
|
+
// a promotion carries into site/.
|
|
86
|
+
target: stagedReleaseTarget(hash),
|
|
87
|
+
// robots.txt and sitemap.xml are written for the environment the release
|
|
88
|
+
// will be promoted into, so the staged bytes are exactly the live bytes.
|
|
89
|
+
baseUrl: siteBaseUrl(ctx),
|
|
90
|
+
artifactManifestKey: buildManifestKey,
|
|
91
|
+
kind: 'staged',
|
|
92
|
+
...(run.refresh ? { refresh: true } : {}),
|
|
93
|
+
});
|
|
94
|
+
// The builder records changed paths for every build; a staged one serves
|
|
95
|
+
// nothing, so there is nothing to invalidate.
|
|
96
|
+
await ctx.clients.s3.deleteObject(ctx.names.bucket, changedManifestKey(stagedReleaseTarget(hash), hash));
|
|
97
|
+
const recorded = await readBuildArtifact(ctx, hash, buildManifestKey);
|
|
98
|
+
if (!recorded) {
|
|
99
|
+
throw new Error(`the staged build of ${hash} recorded no artifact manifest, so there is nothing to check ` +
|
|
100
|
+
'its bytes against - nothing was staged');
|
|
101
|
+
}
|
|
102
|
+
const manifest = await verifyStoredRelease(ctx, recorded, prefix);
|
|
103
|
+
await recordStagedRelease(ctx, manifest);
|
|
104
|
+
const rows = [
|
|
105
|
+
{ label: 'revision', value: hash },
|
|
106
|
+
{ label: 'environment', value: ctx.env },
|
|
107
|
+
{ label: 'release', value: describeRelease(manifest) },
|
|
108
|
+
{ label: 'staged at', value: `s3://${ctx.names.bucket}/${prefix}` },
|
|
109
|
+
{ label: 'build', value: formatDuration(build.durationMs) },
|
|
110
|
+
];
|
|
111
|
+
for (const line of renderSummary('stage summary', rows, ctx.ports.terminal.isInteractive)) {
|
|
112
|
+
ctx.logger.info(line);
|
|
113
|
+
}
|
|
114
|
+
ctx.logger.ok(`staged ${hash} in ${formatDuration(Date.now() - startedAt)}`);
|
|
115
|
+
ctx.logger.info(` promote it with: blogwright promote ${hash} ${ctx.env}`);
|
|
116
|
+
}
|
|
117
|
+
/** S3's denial code - not any 403: a bad signature or a skewed clock is no tagging question. */
|
|
118
|
+
function isAccessDenied(err) {
|
|
119
|
+
return err instanceof AwsError && err.code === 'AccessDenied';
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Copy staged objects into `site/`, carrying their tags - or, once the caller
|
|
123
|
+
* turns out not to hold the tagging permissions (a deploy role bootstrapped
|
|
124
|
+
* before promotion existed), without them for the rest of the run. Tags are
|
|
125
|
+
* cost metadata, never content, so they do not fail a promotion.
|
|
126
|
+
*
|
|
127
|
+
* S3 answers a missing tagging grant with the same `AccessDenied` as any
|
|
128
|
+
* other denial, so a denied tag-copying copy is retried without tags: only
|
|
129
|
+
* when that succeeds was the denial about tags. A denial the untagged copy
|
|
130
|
+
* gets too - no s3:PutObject, a bucket policy - fails the promotion with no
|
|
131
|
+
* word about tags.
|
|
132
|
+
*/
|
|
133
|
+
function createReleaseCopier(ctx, hash, command) {
|
|
134
|
+
let tags = 'copy';
|
|
135
|
+
const copyUntagged = (sourceKey, destinationKey) => ctx.clients.s3.copyObject(ctx.names.bucket, sourceKey, destinationKey, { tags: 'drop' });
|
|
136
|
+
return async function copy(sourceKey, destinationKey) {
|
|
137
|
+
if (tags === 'drop')
|
|
138
|
+
return copyUntagged(sourceKey, destinationKey);
|
|
139
|
+
try {
|
|
140
|
+
await ctx.clients.s3.copyObject(ctx.names.bucket, sourceKey, destinationKey, {
|
|
141
|
+
tags: 'copy',
|
|
142
|
+
});
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
catch (err) {
|
|
146
|
+
if (!isAccessDenied(err))
|
|
147
|
+
throw err;
|
|
148
|
+
}
|
|
149
|
+
await copyUntagged(sourceKey, destinationKey);
|
|
150
|
+
if (tags === 'copy') {
|
|
151
|
+
tags = 'drop';
|
|
152
|
+
ctx.logger.warn('this role cannot copy object tags (s3:GetObjectTagging/s3:PutObjectTagging denied) - ' +
|
|
153
|
+
`${publishing(command)} untagged. Run \`blogwright bootstrap ${ctx.env}\` to grant them, ` +
|
|
154
|
+
`then \`blogwright ${command} ${hash} ${ctx.env} --refresh\` to copy the tags onto every file.`);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Read both records and decide. No record for site/ means its files were
|
|
160
|
+
* written before `cacheControl` existed, with no header - the same as empty
|
|
161
|
+
* rules. A staged release always records its rules, so a missing record there
|
|
162
|
+
* proves nothing and counts as unconfirmed.
|
|
163
|
+
*/
|
|
164
|
+
async function planCacheControl(ctx, hash, command) {
|
|
165
|
+
const staged = (await readCacheControlRecord(ctx, stagedReleaseTarget(hash))) ?? {
|
|
166
|
+
status: 'unconfirmed',
|
|
167
|
+
};
|
|
168
|
+
const live = (await readCacheControlRecord(ctx, LIVE_SITE_TARGET)) ?? {
|
|
169
|
+
status: 'applied',
|
|
170
|
+
rules: [],
|
|
171
|
+
};
|
|
172
|
+
if (staged.status === 'applied' &&
|
|
173
|
+
!sameCacheControlRules(staged.rules, ctx.config.cacheControl)) {
|
|
174
|
+
ctx.logger.warn(`${hash} was staged with cacheControl rules that differ from the current config - ` +
|
|
175
|
+
`${publishing(command)} the Cache-Control it was staged with. Stage it again to apply the ` +
|
|
176
|
+
'current rules.');
|
|
177
|
+
}
|
|
178
|
+
const copyEveryFile = !(staged.status === 'applied' &&
|
|
179
|
+
live.status === 'applied' &&
|
|
180
|
+
sameCacheControlRules(staged.rules, live.rules));
|
|
181
|
+
if (copyEveryFile) {
|
|
182
|
+
ctx.logger.step("the staged release's Cache-Control may differ from what site/ was written with - copying " +
|
|
183
|
+
'every file, so unchanged ones carry the staged headers too');
|
|
184
|
+
await markCacheControlUnconfirmed(ctx, LIVE_SITE_TARGET);
|
|
185
|
+
}
|
|
186
|
+
return { staged, copyEveryFile };
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* site/ now carries the staged release's headers, so it takes the staged
|
|
190
|
+
* record. Non-fatal like a build's own record: the release is published, and
|
|
191
|
+
* a record left unconfirmed only makes the next build re-apply the rules.
|
|
192
|
+
*/
|
|
193
|
+
async function recordPromotedCacheControl(ctx, staged) {
|
|
194
|
+
try {
|
|
195
|
+
await writeCacheControlRecord(ctx, LIVE_SITE_TARGET, staged);
|
|
196
|
+
}
|
|
197
|
+
catch (err) {
|
|
198
|
+
ctx.logger.warn(`could not record the promoted Cache-Control in ${cacheControlRecordKey(LIVE_SITE_TARGET)} ` +
|
|
199
|
+
`(${err instanceof Error ? err.message : String(err)}); the next build to site/ re-uploads every file`);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Make `site/` hold exactly the staged release: server-side copy every file
|
|
204
|
+
* whose live ETag differs from the staged one (every file with `refresh`, or
|
|
205
|
+
* when the Cache-Control rules may differ), then delete live objects the
|
|
206
|
+
* release does not contain, then invalidate the changed paths.
|
|
207
|
+
*
|
|
208
|
+
* The copies run in parallel, in no page-before-asset order, so while they
|
|
209
|
+
* run a visitor can get a new page whose new assets are not copied yet, or
|
|
210
|
+
* an old page beside a new asset - as during a deploy's upload. Deleting only
|
|
211
|
+
* after every copy succeeded means no page that is still live ever loses an
|
|
212
|
+
* asset it references. A copy moves the staged object's bytes, content type,
|
|
213
|
+
* Cache-Control and tags as they are; a file whose content is unchanged is
|
|
214
|
+
* not copied, so it keeps its live content type and tags (`--refresh` copies
|
|
215
|
+
* those too).
|
|
216
|
+
*/
|
|
217
|
+
async function publishStagedRelease(ctx, manifest, opts) {
|
|
218
|
+
const prefix = stagedReleasePrefix(manifest.hash);
|
|
219
|
+
const etags = async (listPrefix) => new Map((await ctx.clients.s3.listObjects(ctx.names.bucket, listPrefix)).map((object) => [
|
|
220
|
+
object.key.slice(listPrefix.length),
|
|
221
|
+
object.etag,
|
|
222
|
+
]));
|
|
223
|
+
const staged = await etags(prefix);
|
|
224
|
+
const live = await etags(LIVE_SITE_PREFIX);
|
|
225
|
+
const headers = await planCacheControl(ctx, manifest.hash, opts.via);
|
|
226
|
+
// From here site/ changes: until the promotion finishes, the live-release
|
|
227
|
+
// record must not keep naming the release it replaces.
|
|
228
|
+
await markLiveReleasePublishing(ctx, manifest.hash, opts.via);
|
|
229
|
+
const copyAll = opts.refresh === true || headers.copyEveryFile;
|
|
230
|
+
const toCopy = manifest.files
|
|
231
|
+
.map((file) => file.path)
|
|
232
|
+
.filter((path) => copyAll || live.get(path) !== staged.get(path));
|
|
233
|
+
const releasePaths = new Set(manifest.files.map((file) => file.path));
|
|
234
|
+
const toDelete = [...live.keys()].filter((path) => !releasePaths.has(path));
|
|
235
|
+
ctx.logger.step(`copying ${toCopy.length} of ${manifest.fileCount} files from ${prefix} to ${LIVE_SITE_PREFIX}`);
|
|
236
|
+
const copy = createReleaseCopier(ctx, manifest.hash, opts.via);
|
|
237
|
+
await mapConcurrently(toCopy, PROMOTE_CONCURRENCY, (path) => copy(`${prefix}${path}`, `${LIVE_SITE_PREFIX}${path}`));
|
|
238
|
+
for (const path of toDelete) {
|
|
239
|
+
await ctx.clients.s3.deleteObject(ctx.names.bucket, `${LIVE_SITE_PREFIX}${path}`);
|
|
240
|
+
}
|
|
241
|
+
if (toDelete.length > 0)
|
|
242
|
+
ctx.logger.step(`deleted ${toDelete.length} stale object(s)`);
|
|
243
|
+
await recordPromotedCacheControl(ctx, headers.staged);
|
|
244
|
+
const changedKeys = [...toCopy, ...toDelete].map((path) => `${LIVE_SITE_PREFIX}${path}`);
|
|
245
|
+
const paths = [
|
|
246
|
+
...new Set(changedKeys.flatMap((key) => invalidationPaths(key, LIVE_SITE_PREFIX))),
|
|
247
|
+
];
|
|
248
|
+
const invalidation = await invalidatePaths(ctx, paths);
|
|
249
|
+
return { copied: toCopy.length, deleted: toDelete.length, invalidation };
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* `verify <hash>` checks site/ against the revision's original manifest. When
|
|
253
|
+
* the promoted release is another build of the revision, say so: the
|
|
254
|
+
* promotion was checked against the staged release, and `verify` will differ.
|
|
255
|
+
*/
|
|
256
|
+
async function warnIfOriginalDiffers(ctx, promoted, command) {
|
|
257
|
+
let original;
|
|
258
|
+
try {
|
|
259
|
+
original = await readArtifactManifest(ctx, promoted.hash);
|
|
260
|
+
}
|
|
261
|
+
catch (err) {
|
|
262
|
+
ctx.logger.warn(`could not read the original artifact manifest of ${promoted.hash}: ${err.message}`);
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
if (!original || original.releaseHash === promoted.releaseHash)
|
|
266
|
+
return;
|
|
267
|
+
const published = command === 'promote' ? 'promoted' : 'restored';
|
|
268
|
+
ctx.logger.warn(`the ${published} release is not byte-identical to ${promoted.hash}'s original release ` +
|
|
269
|
+
`${original.release} (sha256 ${original.releaseHash}): \`blogwright verify ${promoted.hash}\` ` +
|
|
270
|
+
`checks the original and will report the differences; this ${command} was checked against ` +
|
|
271
|
+
'the staged release');
|
|
272
|
+
}
|
|
273
|
+
/** Stamp the promotion on the hash's staged build record, so `history` shows it live. */
|
|
274
|
+
async function recordPromotion(ctx, hash) {
|
|
275
|
+
const manifest = await readManifest(ctx, hash, 'staged');
|
|
276
|
+
if (!manifest)
|
|
277
|
+
return;
|
|
278
|
+
await writeManifest(ctx, { ...manifest, promotedAt: new Date().toISOString() });
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Run the post-deploy plugin steps after a `promote` or a `rollback` only when
|
|
282
|
+
* the working copy is the revision now live: they publish the working copy's
|
|
283
|
+
* content (the standard.site sync, for one), which matches the live site then
|
|
284
|
+
* and would not match a release built from another revision. Otherwise warn
|
|
285
|
+
* and skip them - whichever plugins are installed.
|
|
286
|
+
*/
|
|
287
|
+
export async function runAfterPublish(ctx, hash, afterDeploy) {
|
|
288
|
+
let checkedOut;
|
|
289
|
+
try {
|
|
290
|
+
checkedOut = await ctx.ports.vcs.revisionHash(await findRepoRoot(ctx.ports.fs));
|
|
291
|
+
}
|
|
292
|
+
catch (err) {
|
|
293
|
+
if (!(err instanceof RepoRootNotFoundError))
|
|
294
|
+
throw err;
|
|
295
|
+
}
|
|
296
|
+
if (checkedOut === hash) {
|
|
297
|
+
await afterDeploy(ctx);
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
ctx.logger.warn(`skipping the post-deploy plugin steps: they publish the working copy's content, and the ` +
|
|
301
|
+
`working copy is ${checkedOut ?? 'not a repository'}, not ${hash}. Check out ${hash} and ` +
|
|
302
|
+
'run them yourself (for example `blogwright pds sync`) if needed.');
|
|
303
|
+
}
|
|
304
|
+
/** What a staged copy that no longer matches its record most likely went through. */
|
|
305
|
+
function describeStagedDamage(comparison) {
|
|
306
|
+
const onlyMissing = comparison.changed.length === 0 && comparison.unexpected.length === 0;
|
|
307
|
+
if (onlyMissing) {
|
|
308
|
+
return ('objects are missing from the staged copy - an S3 lifecycle rule expiring releases/ ' +
|
|
309
|
+
'objects, or a delete, removes them');
|
|
310
|
+
}
|
|
311
|
+
return 'the staged copy was modified after it was staged and checked';
|
|
312
|
+
}
|
|
313
|
+
/** How to recover from a staged release that cannot be published, per command. */
|
|
314
|
+
function stagedRecoveryHint(ctx, hash, command) {
|
|
315
|
+
const restage = `\`blogwright stage ${ctx.env}\` from a checkout of ${hash}`;
|
|
316
|
+
if (command === 'promote')
|
|
317
|
+
return `Stage it again with ${restage}, then promote it.`;
|
|
318
|
+
return (`To recover, stage it again with ${restage} and roll back again, or rebuild it from its ` +
|
|
319
|
+
`archived source with \`blogwright rollback ${hash} ${ctx.env} --rebuild\` - the rebuild is ` +
|
|
320
|
+
'compared with the original release, but no review covered its bytes.');
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* The staged copy must still be exactly the reviewed bytes before any is
|
|
324
|
+
* published. When it is not, refuse - nothing has been written - naming the
|
|
325
|
+
* counts, the likely cause and the way out.
|
|
326
|
+
*/
|
|
327
|
+
async function verifyStagedCopy(ctx, staged, command) {
|
|
328
|
+
try {
|
|
329
|
+
return await verifyStoredRelease(ctx, staged, stagedReleasePrefix(staged.hash));
|
|
330
|
+
}
|
|
331
|
+
catch (err) {
|
|
332
|
+
if (!(err instanceof ReleaseMismatchError))
|
|
333
|
+
throw err;
|
|
334
|
+
throw new Error(`cannot ${command === 'promote' ? 'promote' : 'republish'} ${staged.hash}: ${err.message} ` +
|
|
335
|
+
`(${describeStagedDamage(err.comparison)}). Nothing was published. ` +
|
|
336
|
+
stagedRecoveryHint(ctx, staged.hash, command), { cause: err });
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* A revision staged again since it was last published may now hold other
|
|
341
|
+
* bytes than the ones that were live then: say which release this publishes
|
|
342
|
+
* and which one was published before. Both were verified when staged.
|
|
343
|
+
*/
|
|
344
|
+
async function warnIfRestaged(ctx, staged, command) {
|
|
345
|
+
const last = (await readPublications(ctx, staged.hash)).at(-1);
|
|
346
|
+
if (!last || last.releaseHash === staged.releaseHash)
|
|
347
|
+
return;
|
|
348
|
+
ctx.logger.warn(`${staged.hash} was staged again since its last ${last.via} on ${last.publishedAt}, which ` +
|
|
349
|
+
`published ${last.release} (sha256 ${last.releaseHash}); this ${command} publishes the ` +
|
|
350
|
+
`release staged now, ${staged.release} (sha256 ${staged.releaseHash}) - checked when it was ` +
|
|
351
|
+
'staged, but not the bytes that were live then');
|
|
352
|
+
}
|
|
353
|
+
/** The first `<loc>` URL's origin in the head of a sitemap, if there is one. */
|
|
354
|
+
function sitemapOrigin(head) {
|
|
355
|
+
const loc = /<loc>\s*([^<\s]+)\s*<\/loc>/.exec(head)?.[1];
|
|
356
|
+
if (!loc)
|
|
357
|
+
return undefined;
|
|
358
|
+
try {
|
|
359
|
+
return new URL(loc).origin;
|
|
360
|
+
}
|
|
361
|
+
catch {
|
|
362
|
+
return undefined;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* `robots.txt` and `sitemap.xml` are written for the origin the environment
|
|
367
|
+
* had when the release was staged. A release staged before a domain change
|
|
368
|
+
* would publish the old origin's: compare what was staged with what the
|
|
369
|
+
* current config and domain produce - the robots.txt the CLI generates, and
|
|
370
|
+
* the origin of the sitemap's first URL - reading only small objects and the
|
|
371
|
+
* head of the sitemap. Files the app owns (a robots.txt left to the build)
|
|
372
|
+
* are not compared.
|
|
373
|
+
*/
|
|
374
|
+
async function warnIfStagedForAnotherOrigin(ctx, staged, command) {
|
|
375
|
+
const seo = resolveSeo(ctx, siteBaseUrl(ctx));
|
|
376
|
+
const prefix = stagedReleasePrefix(staged.hash);
|
|
377
|
+
const sizes = new Map(staged.files.map((file) => [file.path, file.bytes]));
|
|
378
|
+
const paths = new Set(sizes.keys());
|
|
379
|
+
const differs = [];
|
|
380
|
+
if (seo.robots !== undefined && paths.has('robots.txt')) {
|
|
381
|
+
const robots = await ctx.clients.s3.getObjectText(ctx.names.bucket, `${prefix}robots.txt`);
|
|
382
|
+
if (robots !== undefined && robots !== seo.robots)
|
|
383
|
+
differs.push('robots.txt');
|
|
384
|
+
}
|
|
385
|
+
const sitemapBytes = sizes.get('sitemap.xml') ?? 0;
|
|
386
|
+
if (seo.sitemapBaseUrl !== undefined && sitemapBytes > 0) {
|
|
387
|
+
const head = await ctx.clients.s3.getObject(ctx.names.bucket, `${prefix}sitemap.xml`, {
|
|
388
|
+
range: { start: 0, end: Math.min(sitemapBytes, SITEMAP_HEAD_BYTES) - 1 },
|
|
389
|
+
});
|
|
390
|
+
const origin = sitemapOrigin(new TextDecoder().decode(head));
|
|
391
|
+
if (origin !== undefined && origin !== new URL(seo.sitemapBaseUrl).origin) {
|
|
392
|
+
differs.push(`sitemap.xml (its URLs are on ${origin})`);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
if (differs.length === 0)
|
|
396
|
+
return;
|
|
397
|
+
const published = command === 'promote' ? 'promoted' : 'restored';
|
|
398
|
+
ctx.logger.warn(`${staged.hash} was staged for another origin or seo config than "${ctx.env}" has now - ` +
|
|
399
|
+
`${differs.join(' and ')} ${differs.length === 1 ? 'differs' : 'differ'} from what a build ` +
|
|
400
|
+
`for ${siteBaseUrl(ctx) ?? 'this environment'} would publish today. The staged bytes are ` +
|
|
401
|
+
`${published} as they are; stage it again to publish them for the current origin.`);
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Publish a staged release to `site/` with byte-for-byte checks on both
|
|
405
|
+
* sides, against the one staged release record: the staged objects must still
|
|
406
|
+
* match it before anything is copied, and the live objects must match it
|
|
407
|
+
* afterwards. Shared by `promote` and a republishing `rollback`, so both run
|
|
408
|
+
* the same checks, copy, delete, invalidation and records.
|
|
409
|
+
*/
|
|
410
|
+
async function republishStagedRelease(ctx, staged, opts) {
|
|
411
|
+
const before = await readLiveRelease(ctx);
|
|
412
|
+
const alreadyLive = isSettledLiveRelease(before) &&
|
|
413
|
+
before.hash === staged.hash &&
|
|
414
|
+
before.releaseHash === staged.releaseHash;
|
|
415
|
+
if (alreadyLive) {
|
|
416
|
+
ctx.logger.step(`${staged.release} is already the live release - this ${opts.via} only checks site/ ` +
|
|
417
|
+
'against it and repairs any difference');
|
|
418
|
+
}
|
|
419
|
+
const manifest = await verifyStagedCopy(ctx, staged, opts.via);
|
|
420
|
+
await warnIfRestaged(ctx, manifest, opts.via);
|
|
421
|
+
await warnIfStagedForAnotherOrigin(ctx, manifest, opts.via).catch((err) => {
|
|
422
|
+
// Only a warning hangs on it, so a failed read must not stop the publish.
|
|
423
|
+
ctx.logger.warn(`could not compare the staged robots.txt and sitemap.xml with the current origin: ` +
|
|
424
|
+
`${err.message}`);
|
|
425
|
+
});
|
|
426
|
+
// Converge the response headers as a deploy does, before anything is
|
|
427
|
+
// published, so a policy CloudFront rejects stops the publish untouched.
|
|
428
|
+
await reconcileResponseHeadersOnDeploy(ctx);
|
|
429
|
+
const published = await publishStagedRelease(ctx, manifest, opts);
|
|
430
|
+
// And the live bytes must now be exactly those - promotion's guarantee.
|
|
431
|
+
await verifyStoredRelease(ctx, manifest, LIVE_SITE_PREFIX);
|
|
432
|
+
await recordLiveRelease(ctx, manifest, opts.via);
|
|
433
|
+
await recordPublicationOrWarn(ctx, manifest, opts.via);
|
|
434
|
+
await recordPromotion(ctx, manifest.hash);
|
|
435
|
+
await warnIfOriginalDiffers(ctx, manifest, opts.via);
|
|
436
|
+
if (published.copied === 0 && published.deleted === 0) {
|
|
437
|
+
ctx.logger.ok(`site/ already held ${manifest.release}: nothing was copied, deleted or invalidated`);
|
|
438
|
+
}
|
|
439
|
+
return { before, manifest, published };
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Keep the publication in the revision's record. The release is already live
|
|
443
|
+
* and verified, so a failed write only loses the re-stage warning: warn.
|
|
444
|
+
*/
|
|
445
|
+
async function recordPublicationOrWarn(ctx, manifest, command) {
|
|
446
|
+
try {
|
|
447
|
+
await recordPublication(ctx, manifest, command);
|
|
448
|
+
}
|
|
449
|
+
catch (err) {
|
|
450
|
+
ctx.logger.warn(`could not record this ${command} of ${manifest.release}: ${err.message}`);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Point production at a staged release without rebuilding: check the staged
|
|
455
|
+
* objects still match the recorded manifest, copy them into `site/`,
|
|
456
|
+
* invalidate the changed paths, and verify the live objects match too.
|
|
457
|
+
*/
|
|
458
|
+
export async function promote(ctx, hash, opts) {
|
|
459
|
+
assertStaticEnvironment(ctx, 'promote');
|
|
460
|
+
await withEnvLock(ctx, 'promote', hash, opts, () => promoteLocked(ctx, hash, opts));
|
|
461
|
+
}
|
|
462
|
+
async function promoteLocked(ctx, hash, opts) {
|
|
463
|
+
const startedAt = Date.now();
|
|
464
|
+
// The release is bound to the manifest it was staged with, read once: both
|
|
465
|
+
// checks below compare against this same record.
|
|
466
|
+
const staged = await requireStagedReleaseManifest(ctx, hash);
|
|
467
|
+
ctx.logger.info(colors.bold(`Promoting ${hash} to "${ctx.env}"`));
|
|
468
|
+
const { before, manifest, published } = await republishStagedRelease(ctx, staged, {
|
|
469
|
+
refresh: opts.refresh,
|
|
470
|
+
via: 'promote',
|
|
471
|
+
});
|
|
472
|
+
await runAfterPublish(ctx, hash, opts.afterDeploy);
|
|
473
|
+
const url = siteBaseUrl(ctx);
|
|
474
|
+
const rows = [
|
|
475
|
+
{ label: 'environment', value: ctx.env },
|
|
476
|
+
{ label: 'previous', value: describeLiveRelease(before) },
|
|
477
|
+
{ label: 'release', value: describeRelease(manifest) },
|
|
478
|
+
{ label: 'copied', value: `${published.copied} of ${manifest.fileCount} files` },
|
|
479
|
+
{ label: 'deleted', value: `${published.deleted} stale object(s)` },
|
|
480
|
+
{ label: 'invalidated', value: describeInvalidation(published.invalidation) },
|
|
481
|
+
...(url ? [{ label: 'site', value: colors.cyan(url) }] : []),
|
|
482
|
+
];
|
|
483
|
+
for (const line of renderSummary('promote summary', rows, ctx.ports.terminal.isInteractive)) {
|
|
484
|
+
ctx.logger.info(line);
|
|
485
|
+
}
|
|
486
|
+
ctx.logger.ok(`promoted ${hash} in ${formatDuration(Date.now() - startedAt)}`);
|
|
487
|
+
}
|
|
488
|
+
async function lookUpStagedRelease(ctx, hash) {
|
|
489
|
+
try {
|
|
490
|
+
const manifest = await readStagedReleaseManifest(ctx, hash);
|
|
491
|
+
return manifest ? { status: 'staged', manifest } : { status: 'none' };
|
|
492
|
+
}
|
|
493
|
+
catch (err) {
|
|
494
|
+
return { status: 'unreadable', error: err };
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* `rollback <hash>`'s first choice in a static environment, run holding the
|
|
499
|
+
* environment lock: a hash with a staged release record is republished from
|
|
500
|
+
* its stored bytes, through the same checked copy `promote` makes, and the
|
|
501
|
+
* release that was live is printed beside the one restored. A record that
|
|
502
|
+
* cannot be read, or a staged copy that no longer matches it, refuses with
|
|
503
|
+
* nothing published - a quiet rebuild would publish bytes no review covered.
|
|
504
|
+
* Resolves `not-staged` when the hash has no staged release, for the caller
|
|
505
|
+
* to rebuild.
|
|
506
|
+
*/
|
|
507
|
+
export async function rollbackToStagedRelease(ctx, hash, opts = {}) {
|
|
508
|
+
const lookup = await lookUpStagedRelease(ctx, hash);
|
|
509
|
+
if (lookup.status === 'none')
|
|
510
|
+
return 'not-staged';
|
|
511
|
+
if (lookup.status === 'unreadable') {
|
|
512
|
+
throw new Error(`cannot republish ${hash}: its staged release record at s3://${ctx.names.bucket}/` +
|
|
513
|
+
`${stagedReleaseManifestKey(hash)} is unreadable (${lookup.error.message}), so its ` +
|
|
514
|
+
`staged bytes cannot be checked. Nothing was published. ` +
|
|
515
|
+
stagedRecoveryHint(ctx, hash, 'rollback'), { cause: lookup.error });
|
|
516
|
+
}
|
|
517
|
+
ctx.logger.step(`republishing the release staged at ${stagedReleasePrefix(hash)} (no rebuild)`);
|
|
518
|
+
const { before, manifest, published } = await republishStagedRelease(ctx, lookup.manifest, {
|
|
519
|
+
refresh: opts.refresh,
|
|
520
|
+
via: 'rollback',
|
|
521
|
+
});
|
|
522
|
+
ctx.logger.info(` previous release ${describeLiveRelease(before)}`);
|
|
523
|
+
ctx.logger.info(` restored release ${manifest.release} (sha256 ${manifest.releaseHash})`);
|
|
524
|
+
ctx.logger.info(` copied ${published.copied} of ${manifest.fileCount} files, deleted ${published.deleted}, ` +
|
|
525
|
+
`invalidated ${describeInvalidation(published.invalidation)}`);
|
|
526
|
+
return 'republished';
|
|
527
|
+
}
|
package/dist/render.d.ts
CHANGED
|
@@ -49,7 +49,17 @@ export interface HistoryEntry {
|
|
|
49
49
|
webFunction?: {
|
|
50
50
|
revisionId: string;
|
|
51
51
|
} | undefined;
|
|
52
|
+
/** `staged` for a build published to `releases/<hash>/` rather than `site/`. */
|
|
53
|
+
kind?: 'staged' | undefined;
|
|
54
|
+
/** When the hash's staged release was last promoted to `site/`. */
|
|
55
|
+
promotedAt?: string | undefined;
|
|
52
56
|
}
|
|
57
|
+
/** What `history` reports a hash as. */
|
|
58
|
+
export type HistoryStatus = 'succeeded' | 'failed' | 'staged' | 'promoted';
|
|
59
|
+
/** A staged build is only live once promoted; every other build reports its outcome. */
|
|
60
|
+
export declare function historyStatus(entry: HistoryEntry): HistoryStatus;
|
|
61
|
+
/** When an entry last changed the site: its promotion, else its build finishing. */
|
|
62
|
+
export declare function historyTime(entry: HistoryEntry): string;
|
|
53
63
|
/**
|
|
54
64
|
* Printed in the revision column for a hash with no recorded revision - never
|
|
55
65
|
* a blank cell, so plain output stays whitespace-separated column-per-field.
|
|
@@ -59,7 +69,9 @@ export declare const NO_REVISION = "-";
|
|
|
59
69
|
export declare function historyHasRevisions(entries: readonly HistoryEntry[]): boolean;
|
|
60
70
|
/**
|
|
61
71
|
* The pretty deployment table for `history`: relative times, a live marker on
|
|
62
|
-
* the newest
|
|
72
|
+
* the newest build that reached `site/` (a deploy, or a promoted stage), a
|
|
73
|
+
* `◇` for a staged build not yet promoted, and - in SSR mode - the revision
|
|
74
|
+
* each hash recorded.
|
|
63
75
|
* Entries arrive newest-first (the caller sorts).
|
|
64
76
|
*/
|
|
65
77
|
export declare function renderHistoryTable(entries: HistoryEntry[], now: number): string[];
|
|
@@ -97,4 +109,9 @@ export interface PluginListing {
|
|
|
97
109
|
* an empty table.
|
|
98
110
|
*/
|
|
99
111
|
export declare function renderPluginList(listing: PluginListing, pretty: boolean): string[];
|
|
112
|
+
/** One line per invalidation outcome, shared by the summary card and logs. */
|
|
113
|
+
export declare function describeInvalidation(inv: {
|
|
114
|
+
mode: 'none' | 'paths' | 'all';
|
|
115
|
+
count: number;
|
|
116
|
+
}): string;
|
|
100
117
|
export {};
|
package/dist/render.js
CHANGED
|
@@ -85,6 +85,29 @@ export function logStatusEntries(entries, pretty, logger) {
|
|
|
85
85
|
logger.info(` ${mark} ${entry.title} ${entry.detail ? colors.dim(entry.detail) : ''}`);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
+
/** A staged build is only live once promoted; every other build reports its outcome. */
|
|
89
|
+
export function historyStatus(entry) {
|
|
90
|
+
if (entry.status === 'failed')
|
|
91
|
+
return 'failed';
|
|
92
|
+
if (entry.kind !== 'staged')
|
|
93
|
+
return 'succeeded';
|
|
94
|
+
return entry.promotedAt ? 'promoted' : 'staged';
|
|
95
|
+
}
|
|
96
|
+
/** When an entry last changed the site: its promotion, else its build finishing. */
|
|
97
|
+
export function historyTime(entry) {
|
|
98
|
+
return entry.promotedAt ?? entry.finishedAt;
|
|
99
|
+
}
|
|
100
|
+
/** Whether an entry's content was published to the live site. */
|
|
101
|
+
function servedLive(entry) {
|
|
102
|
+
const status = historyStatus(entry);
|
|
103
|
+
return status === 'succeeded' || status === 'promoted';
|
|
104
|
+
}
|
|
105
|
+
const HISTORY_MARKS = {
|
|
106
|
+
succeeded: colors.green('✓'),
|
|
107
|
+
promoted: colors.green('✓'),
|
|
108
|
+
staged: colors.yellow('◇'),
|
|
109
|
+
failed: colors.red('✗'),
|
|
110
|
+
};
|
|
88
111
|
/**
|
|
89
112
|
* Printed in the revision column for a hash with no recorded revision - never
|
|
90
113
|
* a blank cell, so plain output stays whitespace-separated column-per-field.
|
|
@@ -96,24 +119,25 @@ export function historyHasRevisions(entries) {
|
|
|
96
119
|
}
|
|
97
120
|
/**
|
|
98
121
|
* The pretty deployment table for `history`: relative times, a live marker on
|
|
99
|
-
* the newest
|
|
122
|
+
* the newest build that reached `site/` (a deploy, or a promoted stage), a
|
|
123
|
+
* `◇` for a staged build not yet promoted, and - in SSR mode - the revision
|
|
124
|
+
* each hash recorded.
|
|
100
125
|
* Entries arrive newest-first (the caller sorts).
|
|
101
126
|
*/
|
|
102
127
|
export function renderHistoryTable(entries, now) {
|
|
103
128
|
const revisions = historyHasRevisions(entries);
|
|
104
|
-
const liveIndex = entries.findIndex(
|
|
129
|
+
const liveIndex = entries.findIndex(servedLive);
|
|
105
130
|
const rows = entries.map((e, i) => {
|
|
106
|
-
const mark = e.status === 'succeeded' ? colors.green('✓') : colors.red('✗');
|
|
107
131
|
const cells = [
|
|
108
132
|
e.hash.padEnd(13),
|
|
109
|
-
|
|
110
|
-
formatAgo(now - Date.parse(e
|
|
133
|
+
HISTORY_MARKS[historyStatus(e)],
|
|
134
|
+
formatAgo(now - Date.parse(historyTime(e))).padEnd(9),
|
|
111
135
|
formatDuration(e.durationMs).padEnd(revisions ? 8 : 7),
|
|
112
136
|
...(revisions ? [e.webFunction?.revisionId ?? NO_REVISION] : []),
|
|
113
137
|
].join(' ');
|
|
114
138
|
return i === liveIndex ? `${cells} ${colors.cyan('← live')}` : cells;
|
|
115
139
|
});
|
|
116
|
-
const header = `${'hash'.padEnd(13)} ${' '} ${'
|
|
140
|
+
const header = `${'hash'.padEnd(13)} ${' '} ${'time'.padEnd(9)} duration${revisions ? ' revision' : ''}`;
|
|
117
141
|
return [colors.bold(header), ...rows];
|
|
118
142
|
}
|
|
119
143
|
/**
|
|
@@ -179,3 +203,11 @@ export function renderPluginList(listing, pretty) {
|
|
|
179
203
|
}
|
|
180
204
|
return lines;
|
|
181
205
|
}
|
|
206
|
+
/** One line per invalidation outcome, shared by the summary card and logs. */
|
|
207
|
+
export function describeInvalidation(inv) {
|
|
208
|
+
if (inv.mode === 'none')
|
|
209
|
+
return 'nothing changed - skipped';
|
|
210
|
+
if (inv.mode === 'paths')
|
|
211
|
+
return `${inv.count} changed path${inv.count === 1 ? '' : 's'}`;
|
|
212
|
+
return inv.count > 0 ? `everything (/*) - ${inv.count} paths over cap` : 'everything (/*)';
|
|
213
|
+
}
|
package/dist/repo.js
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
* deterministic zip of them. Pure domain - the VCS listing and file contents
|
|
4
4
|
* arrive through ports (see ports.ts; the process adapter owns jj/git).
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import { FileNotFoundError, REPRODUCIBLE_ZIP_MTIME } from 'blogwright-core';
|
|
6
|
+
import { createZip, FileNotFoundError, REPRODUCIBLE_ZIP_MTIME, } from 'blogwright-core';
|
|
8
7
|
/** Fixed timestamp for reproducible zips. See {@link REPRODUCIBLE_ZIP_MTIME} for why it is not UTC-constructed. */
|
|
9
8
|
const ZIP_MTIME = REPRODUCIBLE_ZIP_MTIME;
|
|
10
9
|
/**
|
|
@@ -70,5 +69,5 @@ export async function buildRepoZip(fs, cwd, files, extra = {}) {
|
|
|
70
69
|
for (const [path, content] of Object.entries(extra)) {
|
|
71
70
|
entries[path] = new TextEncoder().encode(content);
|
|
72
71
|
}
|
|
73
|
-
return
|
|
72
|
+
return createZip(entries, { mtime: ZIP_MTIME });
|
|
74
73
|
}
|
package/dist/rkey.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The `blogwright/rkey` subpath export, kept stable for consuming sites: the
|
|
3
|
-
* implementation lives in blogwright-
|
|
4
|
-
* this re-export preserves the CLI's published contract
|
|
3
|
+
* implementation lives in blogwright-core (see packages/core/src/rkey.ts), and
|
|
4
|
+
* this re-export preserves the CLI's published contract without installing the
|
|
5
|
+
* pds plugin.
|
|
5
6
|
*/
|
|
6
|
-
export * from 'blogwright-
|
|
7
|
+
export * from 'blogwright-core/rkey';
|