From ef874ba4bc65b15db046d9cf0ca537707d615725 Mon Sep 17 00:00:00 2001 From: Fiona Date: Mon, 31 Aug 2026 20:25:16 -0700 Subject: [PATCH] docs(rum-legacy): point the CDN examples at paths that exist The bundle urls named v0.0.8, a version that was never released. This build first shipped in v0.1.0, so both of those urls 404 and a reader copying them gets nothing. Use a placeholder rather than a literal that goes stale on the next release, and say which release the legacy bundle starts at, since the directories of earlier ones exist but hold no fc-rum-legacy.js. The sync-bundles example passed `v0`, a directory the release tooling never writes: deploy-oss.js uploads under the full version, and what sits at v0 predates the legacy build entirely. The command therefore fails on fc-rum-legacy.js. Drop the arguments so the script takes the version from lerna.json and stays correct release to release, and note that its arguments are positional, so an output directory cannot be given without naming a version first. --- packages/rum-legacy/README.md | 19 ++++++++++++++----- scripts/deploy/sync-bundles.js | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/rum-legacy/README.md b/packages/rum-legacy/README.md index c175e2fca1..6c06a134eb 100644 --- a/packages/rum-legacy/README.md +++ b/packages/rum-legacy/README.md @@ -45,10 +45,13 @@ names, which those engines cannot even parse and no runtime guard could catch. Released bundles are served from the CDN under the directory of the release they belong to: ``` -https://static.flashcat.cloud/browser-sdk/v0.0.8/fc-rum-legacy.js -https://static.flashcat.cloud/browser-sdk/v0.0.8/flashcat-rum.js +https://static.flashcat.cloud/browser-sdk//fc-rum-legacy.js +https://static.flashcat.cloud/browser-sdk//flashcat-rum.js ``` +`` is the release tag, `v` prefix included. This build ships from `v0.1.0` onwards; the +directories of earlier releases exist but hold no `fc-rum-legacy.js`. + Each release gets its own directory and earlier ones are left as they were, so a url pins the version it names. Updating a self-hosted copy means pointing at the next release, not re-downloading the same url. @@ -59,11 +62,17 @@ chunk files that must match it exactly. `scripts/deploy/sync-bundles.js` downloa coherent set instead: ```bash -node scripts/deploy/sync-bundles.js prod v0 ./cdn-bundles +node scripts/deploy/sync-bundles.js ``` -It needs no credentials, fails loudly if any file is missing, and the resulting directory is served -as-is from the hosting origin — the `` in the snippet below. +Run from the checkout of the release being deployed: with no arguments it takes the version from +`lerna.json`, so the set it downloads matches the source it was run from and no version has to be +typed out. Its arguments are positional — `[env] [version] [outputDir]` — and naming an output +directory means naming the version before it. + +It needs no credentials, fails loudly if any file is missing, and the resulting directory +(`./cdn-bundles`) is served as-is from the hosting origin — the `` in the snippet +below. ## Setup diff --git a/scripts/deploy/sync-bundles.js b/scripts/deploy/sync-bundles.js index de254bfd1a..6446907da2 100644 --- a/scripts/deploy/sync-bundles.js +++ b/scripts/deploy/sync-bundles.js @@ -29,7 +29,7 @@ const ENTRY_BUNDLES = ['flashcat-logs.js', 'flashcat-rum.js', 'flashcat-rum-slim * Usage: * node sync-bundles.js [env] [version] [outputDir] * env = prod|staging, defaults to prod - * version = the release directory, ex: v0.0.8. Defaults to the version in lerna.json + * version = the release directory, ex: v0.1.0. Defaults to the version in lerna.json * outputDir = defaults to ./cdn-bundles * * The script needs no credentials: it downloads over plain HTTPS from the same URLs a page would