Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .CHANGELOG.md.swp
Binary file not shown.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ package.tgz
.VSCodeCounter
.env
.vscode

# Editor swap files
*.swp
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ This repository contains several packages:

## CDN bundle

https://static.flashcat.cloud/browser-sdk/v0/flashcat-rum.js
```
https://static.flashcat.cloud/browser-sdk/<version>/flashcat-rum.js
```

`<version>` is the release tag, `v` prefix included. The [SDK versions page][versions] is where to
look the current one up. Each release gets its own directory and earlier ones are never rewritten,
so a url serves the version it names.

The earlier `/browser-sdk/v0/` path, named for the major version rather than the release, is no
longer updated. It still resolves, but stays at the release it last held.

## License Information

Expand All @@ -31,6 +40,7 @@ This project is modified and distributed by flashcat under the Apache License 2.

For complete license information, please refer to the [LICENSE](./LICENSE) file.

[versions]: https://docs.flashcat.cloud/en/rum/sdk/versions
[18]: https://docs.flashcat.cloud/zh/flashduty/rum/introduction
[01]: https://badge.fury.io/js/%40flashcatcloud%2Fbrowser-logs.svg
[02]: https://badge.fury.io/js/%40flashcatcloud%2Fbrowser-logs
Expand Down
20 changes: 15 additions & 5 deletions packages/rum-legacy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ 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/<version>/fc-rum-legacy.js
https://static.flashcat.cloud/browser-sdk/<version>/flashcat-rum.js
```

`<version>` is the release tag, `v` prefix included. The [SDK versions page](https://docs.flashcat.cloud/en/rum/sdk/versions) is where to
look the current one up. 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.
Expand All @@ -59,11 +63,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 `<static host>` 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 `<static host>` in the snippet
below.

## Setup

Expand Down
2 changes: 1 addition & 1 deletion scripts/deploy/sync-bundles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading