@fastly/compute-js-static-publish 8.1.0-beta.3 → 8.1.0-beta.5
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/CHANGELOG.md +602 -0
- package/DOCUMENTATION.md +53 -14
- package/MIGRATING.md +289 -0
- package/build/cli/cli/commands/manage/deploy.d.ts.map +1 -1
- package/build/cli/cli/commands/manage/deploy.js +27 -7
- package/build/cli/cli/commands/manage/index.d.ts +1 -0
- package/build/cli/cli/commands/manage/index.d.ts.map +1 -1
- package/build/cli/cli/commands/manage/index.js +13 -11
- package/build/cli/cli/commands/manage/publish-content.d.ts.map +1 -1
- package/build/cli/cli/commands/manage/publish-content.js +5 -3
- package/build/cli/cli/commands/manage/status.d.ts.map +1 -1
- package/build/cli/cli/commands/manage/status.js +7 -5
- package/build/cli/cli/commands/manage/template/init.js +6 -6
- package/build/cli/cli/commands/scaffold/generate-app.d.ts +2 -0
- package/build/cli/cli/commands/scaffold/generate-app.d.ts.map +1 -1
- package/build/cli/cli/commands/scaffold/generate-app.js +6 -0
- package/build/cli/cli/commands/scaffold/index.d.ts.map +1 -1
- package/build/cli/cli/commands/scaffold/index.js +12 -6
- package/build/cli/cli/index.js +15 -1
- package/build/cli/cli/managed/fastly-service.d.ts +7 -0
- package/build/cli/cli/managed/fastly-service.d.ts.map +1 -1
- package/build/cli/cli/managed/fastly-service.js +31 -1
- package/build/cli/cli/managed/fingerprint.d.ts +12 -0
- package/build/cli/cli/managed/fingerprint.d.ts.map +1 -1
- package/build/cli/cli/managed/fingerprint.js +25 -0
- package/build/cli/cli/managed/project-file.d.ts.map +1 -1
- package/build/cli/cli/managed/project-file.js +9 -1
- package/build/cli/cli/managed/template-init.d.ts.map +1 -1
- package/build/cli/cli/managed/template-init.js +3 -1
- package/build/cli/cli/util/collection-selection-flags.d.ts +1 -1
- package/build/cli/cli/util/collection-selection-flags.d.ts.map +1 -1
- package/build/cli/cli/util/collection-selection-flags.js +31 -5
- package/build/cli/cli/util/config.d.ts +4 -0
- package/build/cli/cli/util/config.d.ts.map +1 -1
- package/build/cli/cli/util/config.js +33 -0
- package/build/cli/cli/util/fastly-options.d.ts +2 -0
- package/build/cli/cli/util/fastly-options.d.ts.map +1 -0
- package/build/cli/cli/util/fastly-options.js +52 -0
- package/build/cli/cli/util/output.js +1 -1
- package/build/cli/cli/util/package.d.ts.map +1 -1
- package/build/cli/cli/util/package.js +10 -4
- package/build/cli/models/config/collection-selection.d.ts +2 -0
- package/build/cli/models/config/collection-selection.d.ts.map +1 -1
- package/build/cli/models/config/collection-selection.js +48 -8
- package/build/cli/models/config/s3-storage-config.d.ts +1 -0
- package/build/cli/models/config/s3-storage-config.d.ts.map +1 -1
- package/build/cli/models/config/s3-storage-config.js +1 -0
- package/build/cli/models/config/static-publish-rc.d.ts +1 -0
- package/build/cli/models/config/static-publish-rc.d.ts.map +1 -1
- package/build/cli/models/config/static-publish-rc.js +3 -1
- package/build/server/hono/extensions.d.ts +3 -1
- package/build/server/hono/extensions.d.ts.map +1 -1
- package/build/server/hono/extensions.js +12 -7
- package/build/server/hono/index.d.ts +6 -1
- package/build/server/hono/index.d.ts.map +1 -1
- package/build/server/hono/index.js +21 -13
- package/build/server/models/config/collection-selection.d.ts +2 -0
- package/build/server/models/config/collection-selection.d.ts.map +1 -1
- package/build/server/models/config/collection-selection.js +48 -8
- package/build/server/models/config/s3-storage-config.d.ts +1 -0
- package/build/server/models/config/s3-storage-config.d.ts.map +1 -1
- package/build/server/models/config/s3-storage-config.js +1 -0
- package/build/server/models/config/static-publish-rc.d.ts +1 -0
- package/build/server/models/config/static-publish-rc.d.ts.map +1 -1
- package/build/server/models/config/static-publish-rc.js +3 -1
- package/build/server/server/collection-selection/index.d.ts.map +1 -1
- package/build/server/server/collection-selection/index.js +16 -6
- package/build/server/server/publisher-server/index.d.ts +2 -0
- package/build/server/server/publisher-server/index.d.ts.map +1 -1
- package/build/server/server/publisher-server/index.js +4 -4
- package/build/server/server/storage/s3-storage-provider.d.ts +2 -1
- package/build/server/server/storage/s3-storage-provider.d.ts.map +1 -1
- package/build/server/server/storage/s3-storage-provider.js +15 -7
- package/package.json +4 -2
- package/resources/app/fastly.toml.njk +8 -8
- package/resources/app/static-publish.project.js.njk +6 -0
- package/resources/app/static-publish.rc.js.njk +6 -0
- package/resources/template-init/hono/gitignore +1 -0
- package/resources/templates/hono/src/index.ts +6 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,602 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
This file does not list v7 releases after 7.0.8, or v6 releases after 6.3.0. For those, see `CHANGELOG.md` in the [v7 branch](https://github.com/fastly/compute-js-static-publish/blob/v7/CHANGELOG.md) and in the [v6 branch](https://github.com/fastly/compute-js-static-publish/blob/v6/CHANGELOG.md).
|
|
9
|
+
|
|
10
|
+
## [unreleased]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `scaffold --template hono` (and `managed.template: 'hono'` in a managed project): a TypeScript Hono app. `src/index.ts` uses `selectCollection()`, `serveStatic()`, and `serveFallback()` of `@fastly/compute-js-static-publish/hono`, and `fire()` of `@fastly/hono-fastly-compute`. The app has `tsconfig.json`, and `typescript` as a dev dependency; the build does not check types (run `npx tsc`). In a managed project, a change of `managed.template` generates the app again with the new template, and changes the fingerprint.
|
|
15
|
+
- Hono extensions for the `hono` template: modules in `hono-extensions/` default-export `defineExtension()` (from `@fastly/compute-js-static-publish/hono`), with a function for each phase that they use: `middleware`, `beforeFiles` (before the published files), and `afterFiles` (for the requests that no published file matches). Each phase function gets the app, the options of the module, and the helpers of the app (`serveStatic()`, `staticResponse()`, `serveFallback()`, and `publisherServer`). `c.env` in a module has the types of its bindings. The build bundles them into the app; the packages that the app provides stay imports. Options come from `templateOptions.hono.extensions` and bindings from `templateOptions.hono.bindings`, and `build.hono.extensionsDir` sets another folder. `template init` makes or updates the folder (with a `.gitignore` for `node_modules/`), and `template init --check` fails with the new error code `template-init-needed` if it is out of date. `dev -- --watch` and `npm run dev:watch` also watch the folder. `status --json` has `template`, with the packages that the template provides.
|
|
16
|
+
- Examples of Hono extensions in `examples/hono/` (in the repository, not in the npm package): `grip` (realtime streams and Server-Sent Events with Fastly Fanout) and `oauth` (a login with GitHub or Google).
|
|
17
|
+
- Hono support: `@fastly/compute-js-static-publish/hono`. `fromStaticPublishRc(rc)` (or `fromPublisherServer(server)`) returns `serveStatic()` (middleware that serves the published files with `serveRequest()`, and calls the next handler if no file matches; the option `onMissing` replaces `collectionSelection.onMissing` for one route), `staticResponse(c)` (the same response for use in a handler, or `null`; never the SPA file or the 404 page), `serveFallback()` (for `app.notFound()`: the SPA file or the 404 page), `selectCollection()` (collection selection for a Hono app; it sets `c.var.staticPublisher`, and `serveStatic()` and `serveFallback()` use the selected collection), and `publisherServer`. The type `StaticPublisherVariables` is for the variables of the app. `hono` v4 is an optional peer dependency. This replaces `@fastly/hono-compute-js-static-publish`, which supports only v6 and v7; `MIGRATING.md` has the steps.
|
|
18
|
+
- `--project-dir`: run a command for the app in another directory, for example from the root of the repo in CI. All relative paths are then relative to that directory.
|
|
19
|
+
- `--version`: print the version of this package. It works in any directory.
|
|
20
|
+
- `--non-interactive`: the CLI never asks a question, and missing input is an error. It is also on when the `CI` environment variable is set (to a value that is not empty, `false`, or `0`).
|
|
21
|
+
- The CLI output never shows the value of `--fastly-api-token`, `--s3-secret-access-key`, `FASTLY_API_TOKEN`, or `S3_SECRET_ACCESS_KEY`: it shows `[REDACTED]` in its place, also in error messages.
|
|
22
|
+
- Template hooks: the `package.json` of a scaffolded app has `prebuild`, `postbuild`, and `postinstall` scripts. Each runs `scripts/template_<name>.js` of the app if that file exists, and otherwise does nothing.
|
|
23
|
+
- `npm run dev:watch` in a scaffolded app: runs `fastly compute serve --watch`. If the app has `scripts/template_watch.js`, it runs that script next to the Fastly CLI, until the Fastly CLI stops.
|
|
24
|
+
- `scaffold` writes `generatedFrom` into `static-publish.rc.js`: the template, the version of this package, and the date.
|
|
25
|
+
- `scaffold --default-collection-name`: the collection to serve when no collection is selected. The default is `live`, as before.
|
|
26
|
+
- `scaffold --template`: the template of the app's code: `plain` (the default) or `hono`.
|
|
27
|
+
- Previews with collection selection: `collectionSelection` in `static-publish.rc.js` chooses the collection of each request (see below). It is off by default. The CLI checks it when it loads `static-publish.rc.js`.
|
|
28
|
+
- `PublisherServer.fromStaticPublishRc()` reads it. `setCollectionSelection()` sets it, and `resolveCollection(request)` uses it.
|
|
29
|
+
- With it, a collection that `serveRequest()` or `serveFallback()` serves through the `collectionName` option, and that is not the default collection: if it is not published or has expired, `onMissing` gives the `404` response that names the collection (`'not-found'`, the default) or serves the default collection (`'default'`). Its responses get `X-Robots-Tag: noindex` (unless `noindex` is `false`), and `Cache-Control: private` unless a `host`, `path`, or `query` source of the request selects the collection (then the URL names the collection, and a shared cache can store the response).
|
|
30
|
+
- `PublisherServer.isCollectionAvailable(request, collectionName)`: `true` if the collection is published, has not expired, and can be served by this version.
|
|
31
|
+
- Scaffolding: the `src/index.js` of the `plain` app calls `resolveCollection()`, and passes the result to `serveRequest()`. Without `collectionSelection`, it serves the default collection, as before.
|
|
32
|
+
- Scaffolding: the flags `--collection-selection`, `--collection-allow`, `--collection-on-missing`, and `--collection-noindex` write `collectionSelection`.
|
|
33
|
+
- Collection selection: `resolveCollection(request, collectionSelection)` chooses the collection for a request from a list of sources (`host`, `path`, `query`, `cookie`, `header`), tried in order. A `host` or `path` source with `value` selects one collection for one hostname or prefix (for example `stag.example.com` → `staging`). `allow` limits the collections that can be selected. A `path` or `query` source with `sticky: 'cookie'` sets the cookie of the `cookie` source and redirects (`308`) to the URL without the selector. The `cookie` source also serves its activate and reset paths; their redirects (also `308`) go only to a path on the same site. `previewUrl(collectionName, baseUrl, collectionSelection)` gives the URL that shows a collection. `validateCollectionSelection()` checks a config.
|
|
34
|
+
- Hidden files: a hidden file is published, but `PublisherServer` does not serve it for a request, also not through `autoExt` or `autoIndex`. Mark files with `hiddenItems` in `publish-content.config.js` (the same format as `server.staticItems`), or return `{ hidden: true }` from `assetInclusionTest`. The SPA file and the 404 page can be hidden, and the server still serves them as the fallback page. Code gets a hidden file with `getMatchingAsset(key, { includeHidden: true })`. Hidden is not access control.
|
|
35
|
+
- In the index, the key of a hidden file is `hidden:` and then the asset key. A collection that has hidden files requires the `hidden` feature, so an app built with 8.0.0 or later (before 8.1) does not serve it. An app built with v7 or with an 8.0 beta does not check `requires`: it serves the collection, but not its hidden files, also when the SPA file or the 404 page is hidden. Build and deploy your app with this version before you publish hidden files.
|
|
36
|
+
- `publish-content` shows the number of hidden files. `collections list` shows the number of files and of hidden files in each collection, from the index metadata (`fileCount`, `hiddenFileCount`, which `publish-content` writes). For a collection published by an older version, it shows "unknown".
|
|
37
|
+
- `getMatchingAsset(key, options)`: the second argument can now be an object, `{ applyAuto, includeHidden }`. A boolean (the value of `applyAuto`) continues to work.
|
|
38
|
+
- `PublisherServer.serveRequest(request, options)`: the options `collectionName` (the collection for this call only), `pathname` (the path to look up, in place of the URL path), `fallback` (`false`: do not serve the SPA file or the 404 page), `healthCheck` (`false`: do not answer `/healthz`), and `onMissing` (with collection selection: `'not-found'` or `'default'` for this call, in place of `collectionSelection.onMissing`). Without options, the behavior does not change.
|
|
39
|
+
- `PublisherServer.serveFallback(request, { collectionName, onMissing })`: serves the SPA file or the 404 page, as `serveRequest()` does when no file matches. Use it after `serveRequest()` with `fallback: false`.
|
|
40
|
+
- Export the types `ServeRequestOptions` and `ServeFallbackOptions`.
|
|
41
|
+
- Managed projects: `scaffold --managed` writes only `static-publish.project.js` in the current directory, and adds `.static-publish/` and the working directory to `.gitignore`. The project file has the fields of `static-publish.rc.js` at the top level, the fields of `publish-content.config.js` in `publishContent`, and the settings of the generated app in `managed`. `publish-content`, `collections`, and `clean` read it. A directory with both `static-publish.project.js` and `static-publish.rc.js` is an error. The type is `StaticPublishProject`.
|
|
42
|
+
- Managed projects: `managed.fastlyToml` adds `local_server` and `setup` sections to the generated `fastly.toml`, for example a local Secret Store for `dev`. A resource with the name of one that the CLI writes is an error. `local_server` does not change the fingerprint.
|
|
43
|
+
- `publish-content` purges the service of `managed.serviceId` in a managed project (after `--fastly-service-id` and `FASTLY_SERVICE_ID`, before `fastly.toml`).
|
|
44
|
+
- Managed projects: the `dev` command generates the app in `.static-publish/app/`, installs it with `npm ci` only when its `package.json` or lockfile changed, and runs `fastly compute serve`. The app uses the lockfile of its template (`resources/templates/<name>/package-lock.json`), and the copy of this package that runs the CLI through a `file:` link.
|
|
45
|
+
- Managed projects: `deploy` deploys the generated app only if its fingerprint changed (`--force` deploys anyway), records the fingerprint in the comment of the service version, and writes the Service ID of the first deploy (a new service) into `managed.serviceId`. A Service ID from `--fastly-service-id` or `FASTLY_SERVICE_ID` does not change the project file. A version cloned by hand (no comment, the same package as the newest earlier version with a fingerprint) counts as that fingerprint. `status` shows if a deploy is necessary, and the preview URLs. `dev` and `deploy` stop if `managed.staticPublishVersion` is not the version that runs; `upgrade` (or `--auto-upgrade` with a newer CLI) moves the project to it. In an ejected app, `deploy` runs `fastly compute publish`, with `--comment`, `--fastly-service-id`, and `--fastly-api-token` (`--force` and `--auto-upgrade` are errors there), and `status` shows the Service ID. Options after `--` go to `fastly compute deploy` (or `fastly compute publish`), for example `-- --status-check-timeout=180`. `deploy` refuses `--comment`, `--service-id`, `--token`, `--package`, `--dir`, and `--env` there.
|
|
46
|
+
- S3 mode: `s3.secretStoreLinkName` in `static-publish.rc.js` (in a managed project, in `static-publish.project.js`) sets the resource link name of the Secret Store with the S3 credentials. The default is `S3_CREDENTIALS`. The generated `fastly.toml` uses it. A call to `setSecretStoreForS3Credentials()` in the code of the app is used in place of it. The generated `fastly.toml` also uses `s3.fastlyBackendName` (the name of the backend, default `s3_storage`), and managed mode keeps both fields in the app.
|
|
47
|
+
- Managed projects: `eject` converts a managed project into an ejected app in `./compute-js` (or `--dir`): the app that `deploy` would deploy, `static-publish.rc.js` (with `generatedFrom`) and `publish-content.config.js` from the project file (the paths point at the same directories), and this package pinned to the version that runs. It needs a published version, and it stops for functions or regular expressions in `publishContent`.
|
|
48
|
+
- Docs: README "Managed and ejected apps", with the API token scopes for CI. `MIGRATING.md`: move an existing app to managed mode.
|
|
49
|
+
- `--json`: `publish-content`, `collections list`, `collections delete`, `collections promote`, `status`, `deploy` (in a managed project), and `--version` write their result as one JSON object to stdout, with `schemaVersion: 1`. The log lines then go to stderr. With another command, `--json` is an error. The `publish-content` result shows the purge result for each environment (`purge.ok` is `false` if a purge failed).
|
|
50
|
+
- Error codes: with `--json`, an error gives `{ "schemaVersion": 1, "error": { "code", "message" } }`. The README lists the codes, for example `collection-name-invalid` and `credentials-missing`.
|
|
51
|
+
- README: "Using the CLI in CI", with the exit codes, the JSON output, and the error codes.
|
|
52
|
+
|
|
53
|
+
### Changed
|
|
54
|
+
|
|
55
|
+
- The npm package includes `CHANGELOG.md` and `MIGRATING.md`.
|
|
56
|
+
- A command for a managed project or an app (for example `status` or `deploy`) in a directory that has no `static-publish.project.js` or `static-publish.rc.js` now stops with an error that names the directories nearby that have one. Before, the CLI started scaffolding, and showed an unclear error for the command.
|
|
57
|
+
- Scaffolding: the `src/index.js` of the `plain` app calls `serveRequest()` with `fallback: false`, then has the place for your own code, and then calls `serveFallback()` for the SPA file or the 404 page. Thus your code runs for each request that no published file matches, also when the collection has a fallback page. Code that must run before the published files goes before `serveRequest()`.
|
|
58
|
+
- Scaffolding: the app has `@fastly/compute-js-static-publish` in `dependencies`. It was in `devDependencies`. The code of the app imports it, and the `postinstall` script of the app runs it, so `npm ci --omit=dev` needs it.
|
|
59
|
+
- `PublisherServer.setResponseCache()`: the default of `maxBodySize` is now 16 MiB. It was 8 MiB.
|
|
60
|
+
- Scaffolder: in the generated `src/index.js`, the place for your own code is before `serveRequest()`. It was after `serveRequest()`, where it did not run for a path that has no file when a 404 page or an SPA file is set.
|
|
61
|
+
- The help and the hints of the CLI show the npx command with the dist-tag of a prerelease, for example `npx @fastly/compute-js-static-publish@beta dev` in 8.1.0-beta.2. Without the dist-tag, npx runs the latest stable version, which does not have the new commands. When the copy that runs is installed in the project or the app (so that a plain `npx` runs it), the command has no dist-tag, because with a dist-tag npx gets the version of that tag from npm. A stable version shows the command as before.
|
|
62
|
+
- `collectionSelector.fromCookie()`: the activate and reset paths now redirect with `308`. Before, they used `302`.
|
|
63
|
+
- Collection names have a rule: a DNS label (lowercase `a-z`, `0-9`, and `-`, from 1 to 63 characters, with no `-` at the start or the end). Thus a name is safe in storage keys, in the surrogate key of the purge, in a cookie, and in a hostname.
|
|
64
|
+
- `publish-content` to a new collection, `collections promote --to` a new collection, and `scaffold --default-collection-name` stop with an error for a name that breaks the rule.
|
|
65
|
+
- A collection that exists continues to work with a name that breaks the rule. `publish-content` and `collections promote --to` show a warning for it.
|
|
66
|
+
- `collectionSelector.fromCookie()`: the activate path returns `400` for a name that breaks the rule, and sets no cookie. Before, it returned `400` only for a name with characters that a cookie value cannot have.
|
|
67
|
+
- `PublisherServer` keeps the state of each request (the settings, the index, and the `Server-Timing` measurements) in a scope for that request and collection. A reused sandbox does not keep this state from one request to the next. A second call for the same request (for example `beginRequest()` and then `serveRequest()`) does not read the index again.
|
|
68
|
+
- README: a GitHub Actions example that publishes a preview for each pull request, and deletes it when the pull request closes. The README and `clean --help` say not to run `clean` while `publish-content` can run for the same storage.
|
|
69
|
+
- Exit codes: `0` success, also when there is nothing to do; `1` the operation failed, and a retry can help; `2` a usage or config error, and a retry cannot help. Before, the CLI used `1` for all errors.
|
|
70
|
+
- `collections promote` from a collection that does not exist stops with the message "Collection '…' does not exist." (exit `2`). Before, it stopped with an uncaught error.
|
|
71
|
+
- `collections delete` of a collection that does not exist says "Nothing to delete." It still succeeds, as before.
|
|
72
|
+
- `staticPublisherWorkingDir` in `static-publish.rc.js` can be a path outside the directory of the file, for example `../static-publisher`. It must start with `./` or `../`, and it must not be the directory of `static-publish.rc.js` or a directory above it (for example `./`, `..`, or `../..`). Before, the value had to start with `./`. A value that breaks the rule stops the command before it writes anything.
|
|
73
|
+
|
|
74
|
+
### Deprecated
|
|
75
|
+
|
|
76
|
+
- `PublisherServer`: the fields `serverTiming`, `settingsCached`, and `assetEntryMapCache`. They are now read-only, and they return the state of the current request. Code that assigns to them gets a TypeScript error. Use `getServerConfig()` and `getAssetEntryMap()`. These fields will be removed in v9.
|
|
77
|
+
|
|
78
|
+
### Fixed
|
|
79
|
+
|
|
80
|
+
- `collections promote` now purges the target collection, as `publish-content` and `collections delete` do. Before, after a promote (for example to `live`), the service could serve the old content of the target from the cache until it expired. The new options `--fastly-service-id` and `--purge-environment` work as in `publish-content`. If a Service ID is found, the command needs an API token, also in S3 mode, and stops before it writes anything if the token is missing.
|
|
81
|
+
- `collections promote --local`: the target collection got the index and settings files of the source collection. Thus a later `publish-content --local` to the source also changed the target, for example `live` after a promote from `staging`. Now the target has its own files. The KV Store and S3 modes were not affected.
|
|
82
|
+
- `scaffold --storage-mode s3` without `--s3-endpoint` (a bucket on AWS): the command stopped with an uncaught `CredentialsProviderError` when the computer had no usable AWS credentials. Now it computes the host name of the bucket (`<bucket>.s3.<region>.amazonaws.com`, the same host name that the server uses), with no credentials and no network. A bucket name with a dot needs `--s3-endpoint`, and the command says so.
|
|
83
|
+
- `PublisherServer` response cache: the request that caches a response now uses memory of about two times the body. Before, it used about four times the body. On a Fastly service, with `maxBodySize` set larger than the default, a response of 32 MiB caused a `500` for that request. With a response of 48 MiB, other requests that waited for the same response also got a `200` with an empty body.
|
|
84
|
+
- `publish-content` (KV Store): a chunk of a file larger than 20 MiB was sometimes uploaded with only part of its bytes, without an error, because the command read the chunk file before it was completely written. The server then could not serve the file, and later publishes did not upload the chunk again, because its key was in storage. Now the command writes each chunk completely before it uploads it. Also, it compares the stored size of each chunk with the correct size, and uploads a chunk with a different size again. To repair a file that has a short chunk, publish again with this version.
|
|
85
|
+
- `publish-content` (KV Store): for a file that is an exact multiple of 20 MiB, the command made the chunk files again at each publish.
|
|
86
|
+
- `PublisherServer`: when no file matches a request, the server serves the SPA file or the 404 page only if the request accepts HTML. Now a request accepts HTML only if its `Accept` header is missing or empty, or has `text/html`, `text/*`, or `*/*` with a q-value that is not 0. The most specific of these media ranges gives the q-value. Before, almost all requests got the HTML page, for example a request with `Accept: application/json`, `Accept: image/*`, or `Accept: text/html;q=0`. Now `serveRequest()` returns `null` for such a request, and your app makes the response.
|
|
87
|
+
- README: the Fastly Object Storage example uses the region `us-east-1` and the endpoint `https://us-east-1.object.fastlystorage.app`. The example used `us-east`, which is a legacy region: you cannot make a new bucket in it in the Fastly control panel. The README also links to the list of regions and endpoints.
|
|
88
|
+
- README: the custom app example handles its route before `serveRequest()`, and the text says when `serveRequest()` returns `null`. Before, the example handled `/api/hello` after `serveRequest()`, so a request for it got the 404 page when a 404 page was set.
|
|
89
|
+
- `scaffold` now escapes the values that it writes into `fastly.toml`. Before, a `"` or a `\` in `--name`, `--description`, or `--author`, or a KV Store name with a character such as `.`, gave a `fastly.toml` that was not valid.
|
|
90
|
+
|
|
91
|
+
## [8.0.1] - 2026-11-04
|
|
92
|
+
|
|
93
|
+
### Changed
|
|
94
|
+
|
|
95
|
+
- `publish-content` now logs a line for each file and each upload only with `--verbose`. Without it, the command logs the progress after each 1,000 files or uploads.
|
|
96
|
+
- The npm package includes the full documentation as `DOCUMENTATION.md`, with the CLI reference for that version. The README on npm stays short, and links to it.
|
|
97
|
+
- The README and the scaffolder's closing message tell you to set `FASTLY_API_TOKEN` for `fastly:publish`, and for `s3:publish` after the deploy. The CLI does not read the token of the Fastly CLI profile.
|
|
98
|
+
- `PublisherServer`: a request for a collection other than the default collection that is not published or that expired gets a plain-text 404 that names the collection. The response cache does not store this response. In 8.0.0, a collection that was not published got a 500 "Settings not found", and an expired collection was passed to the app's own handler (`serveRequest()` returned `null`).
|
|
99
|
+
|
|
100
|
+
### Fixed
|
|
101
|
+
|
|
102
|
+
- Scaffolder: if the file of `--spa` or `--not-found-page` does not exist or is not under `--root-dir`, the scaffolder stops with an error. It no longer shows a warning and makes an app without the page. The examples in `--help` are now paths from the current directory, such as `./public/404.html`.
|
|
103
|
+
- `publish-content` and `collections delete`: a purge of `staging` for a service with no staged version showed "Failed purging (staging)". The API gives `404` in this case, because there is nothing to purge. Now the command shows a message that the service has no staged version or that the service ID is not correct, and no warning. The API gives the same `404` for both causes.
|
|
104
|
+
- A failed purge, and other failed calls to the Fastly API, now show the error that the API gives, for example `404 Record not found: Cannot find service`. Before, the warning of a failed purge did not show the reason.
|
|
105
|
+
- README: the custom app example compares `url.pathname === '/api/hello'`. Before, it used `request.url.endsWith('/api/hello')`, which also matched other URLs, such as `/other/api/hello`, and did not match `/api/hello` with a query string.
|
|
106
|
+
|
|
107
|
+
## [8.0.0] - 2026-10-27
|
|
108
|
+
|
|
109
|
+
### Breaking
|
|
110
|
+
|
|
111
|
+
- Fastly API token
|
|
112
|
+
- The CLI no longer falls back to `fastly profile token`. Pass the token with `--fastly-api-token` or the `FASTLY_API_TOKEN` environment variable.
|
|
113
|
+
- Remove the `@fastly/cli` dependency, which was used only for that fallback. A scaffolded app continues to have `@fastly/cli` as its own dependency.
|
|
114
|
+
|
|
115
|
+
- Imports of files in `build/` are not supported. Import the named exports of `@fastly/compute-js-static-publish`.
|
|
116
|
+
|
|
117
|
+
### Added
|
|
118
|
+
|
|
119
|
+
- S3-compatible storage (BETA)
|
|
120
|
+
- Add support for S3-compatible storage, such as Fastly Object Storage. Items are stored with the same keys as in the KV Store, and the asset metadata is stored in the S3 object metadata.
|
|
121
|
+
- `static-publish.rc.js`: add the `s3` storage mode configuration.
|
|
122
|
+
- The server reads the S3 credentials from the Secret Store that has the resource link name `S3_CREDENTIALS` on the service. The Secret Store can have a different name. To change the resource link name or the key names, call `setSecretStoreForS3Credentials()`, `setSecretStoreKeyForS3AccessKeyId()`, or `setSecretStoreKeyForS3SecretAccessKey()`. To get the credentials in a different way, call `setS3CredentialsBuilder()`.
|
|
123
|
+
- The scaffolder adds the credentials to the `[local_server]` and `[setup]` sections of `fastly.toml`. When the first deploy creates a new service, the Fastly CLI creates the Secret Store, links it to the service, and prompts you for the credentials. The instructions shown at the end of scaffolding also tell you how to set up an existing service.
|
|
124
|
+
- The server signs requests with `@smithy/signature-v4`, and does not use the AWS SDK. The AWS SDK parses XML with `DOMParser`, which Fastly Compute does not have. Without the SDK, the Wasm binary is also much smaller.
|
|
125
|
+
- `--local` is for KV Store mode only. In S3 mode, the commands stop with an error before they connect to storage. There is no local simulation of S3 storage.
|
|
126
|
+
- Storage is factored out to `StorageProvider`, and S3 is implemented with this architecture.
|
|
127
|
+
|
|
128
|
+
- Collections can declare the features that the server must support. A later version adds a feature to the index metadata (`requires`) only if the content that it publishes uses that feature. `PublisherServer` does not serve a collection that requires a feature that it does not support, and it logs the reason. Without this check, an older server would serve such a collection incorrectly. Build and deploy your app again to serve it. `collections list` shows the features that a collection requires. This version does not add features to `requires`.
|
|
129
|
+
- `collections promote` and `collections update-expiration` keep the fields of the index metadata that they do not know.
|
|
130
|
+
|
|
131
|
+
- `publish-content`
|
|
132
|
+
- After publishing, purge the surrogate key `<publishId>-<collectionName>` (a soft purge), in KV Store and S3 modes (not with `--local`). This clears the responses that the response cache keeps (see `setResponseCache()`).
|
|
133
|
+
- Add `--fastly-service-id`. The Service ID to purge comes from `--fastly-service-id`, then the `FASTLY_SERVICE_ID` environment variable, then `service_id` in `fastly.toml`. This is the same order as the Fastly CLI's `--service-id`. If there is no Service ID, the command does not purge.
|
|
134
|
+
- Add `--purge-environment` to purge `production` (the default), `staging`, or both. A staging purge sends the `Fastly-Purge-Environment: staging` header.
|
|
135
|
+
- A failed purge shows a warning on stderr. The command still completes, because the content is already published.
|
|
136
|
+
- Add `--brotli-quality=<0-11>`. It overrides `brotliQuality` in `publish-content.config.js`.
|
|
137
|
+
- Add `--s3-upload-concurrency=<1-256>`: the number of objects to upload to S3-compatible storage at the same time (default: 64).
|
|
138
|
+
|
|
139
|
+
- `collections delete`
|
|
140
|
+
- After the delete, purge the surrogate key of the collection, so that the service stops serving cached responses of the deleted collection. This has the same options and rules as the purge of `publish-content`: `--fastly-service-id`, `--purge-environment`, and the API token.
|
|
141
|
+
|
|
142
|
+
- `publish-content.config.js`
|
|
143
|
+
- Add `brotliQuality` (0 to 11, default 11). A lower value compresses much faster, and gives slightly larger files.
|
|
144
|
+
|
|
145
|
+
- `PublisherServer`
|
|
146
|
+
- Add `setServerTimingRequestHeader()`. When set, a request that has this header gets a `Server-Timing` response header with the time spent reading the settings, the index, and the file. Off by default.
|
|
147
|
+
- Add `beginRequest()`. `serveRequest()` calls it. Call it yourself before `getMatchingAsset()` if you call `getMatchingAsset()` and `serveAsset()` directly.
|
|
148
|
+
- Add `setResponseCache()`. When set, whole responses are cached with the Core Cache API, keyed by publish ID, collection, path, and the client's `Accept-Encoding`. A cache hit does not read the settings, the index, or the file. Paths that are not found are cached, too. A response is read completely, and is cached only if its body has the size in the file's metadata. A response that is larger than `maxBodySize` (default 8 MiB) is served from storage and not cached, so a large file is not held in memory. Entries have the surrogate key `<publishId>-<collectionName>`, which `publish-content` purges. Off by default.
|
|
149
|
+
- Add `serveCached()`, to use the response cache with `getMatchingAsset()` and `serveAsset()`. `serveRequest()` uses it automatically.
|
|
150
|
+
- `Server-Timing` has a `cache` entry when the response cache is on: `hit` (with the age of the cached response), `miss`, or `bypass`.
|
|
151
|
+
|
|
152
|
+
### Changed
|
|
153
|
+
|
|
154
|
+
- `publish-content.config.js`
|
|
155
|
+
- `kvStoreAssetInclusionTest` renamed to `assetInclusionTest`. Previous name deprecated.
|
|
156
|
+
|
|
157
|
+
- `publish-content`
|
|
158
|
+
- Lists the files in storage one time before the scan, in 16 parts at the same time. The KV Store listing uses strong consistency. The command does not compress, hash, or upload a file that is already in storage. Before, it examined each file in storage with a separate request, one file at a time.
|
|
159
|
+
- Uploads a compressed variant only if it is smaller than the original. Before, it uploaded each variant, and only the index left out the variants that were not smaller.
|
|
160
|
+
- Uploads KV Store entries in batches (the KV Store batch API). Entries that are larger than 8 MiB use one request each. If some entries of a batch fail, the command retries these entries. The log shows the keys that failed. Before, it uploaded each entry with a separate request.
|
|
161
|
+
- Scans at most 16 files at the same time. Before, it scanned one file at a time. If a file cannot be processed, the error message shows the file path.
|
|
162
|
+
- Compresses files in parallel on the Node.js thread pool. Before, it compressed one file at a time. The CLI sets `UV_THREADPOOL_SIZE` to the number of CPU cores (4 to 16), if it is not set.
|
|
163
|
+
|
|
164
|
+
### Updated
|
|
165
|
+
|
|
166
|
+
- Scaffolded apps use `@fastly/js-compute` `^4.0.0`.
|
|
167
|
+
- Update `toml` to 5.0.1. This fixes security advisories in `toml` 4.1.2 and earlier ([GHSA-82x6-q7mm-w9cf](https://github.com/advisories/GHSA-82x6-q7mm-w9cf), [GHSA-v5mp-jgw5-2x6j](https://github.com/advisories/GHSA-v5mp-jgw5-2x6j)), and in `toml` 5.0.0 and earlier ([GHSA-4qx8-w7c3-pj3p](https://github.com/advisories/GHSA-4qx8-w7c3-pj3p), [GHSA-9j65-hcg3-gc64](https://github.com/advisories/GHSA-9j65-hcg3-gc64), [GHSA-9qmh-m7c6-f92p](https://github.com/advisories/GHSA-9qmh-m7c6-f92p)). Reading the Service ID also works now with a `fastly.toml` that uses dotted keys, such as `backends.origin.url = "..."`.
|
|
168
|
+
|
|
169
|
+
### Deprecated
|
|
170
|
+
|
|
171
|
+
- Scaffolding: `--public-dir` is deprecated, and a future version will remove it. The scaffolder shows a warning if you use it. This option was added for module assets, which this package no longer supports. If you do not use `--public-dir`, the public directory is the same as `--root-dir`, and nothing changes for you.
|
|
172
|
+
|
|
173
|
+
- `server.publicDirPrefix` in `publish-content.config.js` is deprecated, and a future version will remove it. `publish-content` shows a warning if it is not empty. The scaffolder no longer writes it, unless you use `--public-dir`. The server still uses it for collections that you publish with it. To stop using it, see `MIGRATING.md`.
|
|
174
|
+
|
|
175
|
+
### Fixed
|
|
176
|
+
|
|
177
|
+
- `304 Not Modified` responses now keep the `ETag`, `Vary`, `Cache-Control`, `Content-Location`, and `Expires` headers of the full response. Before, these headers were missing because of a wrong check.
|
|
178
|
+
|
|
179
|
+
- `publish-content` stops with an error if an upload fails. Before, it showed the error and then saved the index. The index then referred to files that were not in storage.
|
|
180
|
+
|
|
181
|
+
- `clean` stops with an error if it cannot read a collection index. Before, it continued and deleted the files of that collection.
|
|
182
|
+
|
|
183
|
+
- `clean` and `collections delete` exit with an error if a delete operation fails. Before, they showed "Completed".
|
|
184
|
+
|
|
185
|
+
- `PublisherServer` in a reused sandbox (if the app turns on sandbox reuse): the settings and the index of a collection stayed in memory for the life of the sandbox. Thus, after a publish, the sandbox served the old content, and it served a collection after it expired. `beginRequest()` (which `serveRequest()` calls) now clears them.
|
|
186
|
+
- `setActiveCollectionName()` accepts `null`, which selects the default collection. In a reused sandbox, the active collection stays set from the previous request, so call it for each request.
|
|
187
|
+
|
|
188
|
+
- Scaffolding: if `--public-dir` was under `--root-dir`, the generated `publish-content.config.js` set `publicDirPrefix` to an empty string. Thus the server did not find the files, and it returned 404 for all requests. `publicDirPrefix` is now the path of the public directory, relative to the root directory (for example `/public`).
|
|
189
|
+
|
|
190
|
+
- `collectionSelector.fromCookie()`: the activate and reset paths now accept only a path on the same site for `redirectTo`. Any other value redirects to `/`. The activate path returns `400` for a `collection` value with characters that a cookie value cannot have, and sets no cookie. (7.0.9 has the same fix.)
|
|
191
|
+
|
|
192
|
+
- `PublisherServer` compares the body of each file with the size in the file's metadata. Storage can return a body that does not have this size for a short time, for example a KV Store entry whose metadata reached the POP before its body. Before, such a body was served as a complete `200` response, and a CDN or a cache in front of the service could keep it. Now an empty body makes `serveRequest()` and `serveAsset()` throw an error before the response starts, and any other mismatch stops the response with a stream error, so that the client sees an incomplete response. The server logs the file, the expected size, and the actual size.
|
|
193
|
+
|
|
194
|
+
## [7.0.8] - 2026-10-14
|
|
195
|
+
|
|
196
|
+
### Added
|
|
197
|
+
|
|
198
|
+
- Add content types for `.avif` and `.jxl` images
|
|
199
|
+
|
|
200
|
+
### Updated
|
|
201
|
+
|
|
202
|
+
- Update to CLI v16
|
|
203
|
+
- Support `@fastly/js-compute` 4. The peer dependency is now `^3.33.2 || ^4.0.0`.
|
|
204
|
+
|
|
205
|
+
### Fixed
|
|
206
|
+
|
|
207
|
+
- `.tif`/`.tiff` files were served as `image/png`, now `image/tiff`
|
|
208
|
+
|
|
209
|
+
## [7.0.7] - 2026-07-16
|
|
210
|
+
|
|
211
|
+
- Update to CLI v15
|
|
212
|
+
|
|
213
|
+
## [7.0.6] - 2026-02-13
|
|
214
|
+
|
|
215
|
+
### Updated
|
|
216
|
+
|
|
217
|
+
- Release to npmjs using updated CI workflow
|
|
218
|
+
|
|
219
|
+
## [7.0.5] - 2026-02-03
|
|
220
|
+
|
|
221
|
+
### Added
|
|
222
|
+
|
|
223
|
+
- Add application/wasm to default content types
|
|
224
|
+
|
|
225
|
+
## [7.0.4] - 2026-01-07
|
|
226
|
+
|
|
227
|
+
### Added
|
|
228
|
+
|
|
229
|
+
- Publish to GitHub packages as well
|
|
230
|
+
- Use NPM trusted publishing for publishing to npmjs.com
|
|
231
|
+
|
|
232
|
+
## [7.0.3] - 2025-09-29
|
|
233
|
+
|
|
234
|
+
### Fixed
|
|
235
|
+
|
|
236
|
+
- Use pathToFileURL so that import() works under ESM across platforms [#38](https://github.com/fastly/compute-js-static-publish/issues/38)
|
|
237
|
+
|
|
238
|
+
## [7.0.2] - 2025-09-16
|
|
239
|
+
|
|
240
|
+
### Fixed
|
|
241
|
+
|
|
242
|
+
- Fix script listed in readme instructions
|
|
243
|
+
- Handle symlinks properly in file enumeration [#41](https://github.com/fastly/compute-js-static-publish/issues/41)
|
|
244
|
+
|
|
245
|
+
## [7.0.1] - 2025-04-24
|
|
246
|
+
|
|
247
|
+
### Fixed
|
|
248
|
+
|
|
249
|
+
- Add `@latest` to examples of calling the app in scaffolding mode.
|
|
250
|
+
|
|
251
|
+
## [7.0.0] - 2025-04-24
|
|
252
|
+
|
|
253
|
+
> [!NOTE]
|
|
254
|
+
> Breaking release. Every project will need a re-scaffold.
|
|
255
|
+
|
|
256
|
+
### Added
|
|
257
|
+
|
|
258
|
+
- Named Collections
|
|
259
|
+
- Support for named collections of assets that are managed together and can be individually previewed.
|
|
260
|
+
- Expiration trio: --expires-in, --expires-at, --expires-never.
|
|
261
|
+
- Collection selector utilities that can be run at the edge code to activate a collection.
|
|
262
|
+
- Default collection never expires.
|
|
263
|
+
|
|
264
|
+
- git-style subcommands
|
|
265
|
+
- Actions separated into subcommands, such as `clean`, `publish-content`, and `collections`.
|
|
266
|
+
- Dry-run mode (--dry-run) for commands that mutates KV or disk.
|
|
267
|
+
|
|
268
|
+
- KV Store
|
|
269
|
+
- Bytes of assets are stored in the Fastly KV Store.
|
|
270
|
+
- Items in the KV Store are keyed by the hash of the file, keeping storage efficient and deduplicated, even across collections.
|
|
271
|
+
- Metadata (file sizes, encodings, compression) for static assets is stored in KV Store Item metadata.
|
|
272
|
+
- Large-object chunking: files > 20 MB are split into segments behind the scenes and reassembled at read time.
|
|
273
|
+
- Upload process has been optimized - files are uploaded in parallel, and are only compressed and uploaded when necessary.
|
|
274
|
+
- Automatic retry with exponential back-off when the Fastly KV API rate-limits a burst of uploads.
|
|
275
|
+
- Fully supported in the local development environment during development.
|
|
276
|
+
- `--local` flag for all management commands. Passing this flag makes the command operate on the local KV Store instead of the Fastly KV Store.
|
|
277
|
+
|
|
278
|
+
### Changed
|
|
279
|
+
|
|
280
|
+
- Separate config files:
|
|
281
|
+
- `static-publisher.rc.js` now owns behavior that is common to the scaffolded Compute app
|
|
282
|
+
- publish-time settings are in `publish-content.config.js`.
|
|
283
|
+
|
|
284
|
+
- Script names in the scaffold are now grouped by environment: `dev:publish`, `dev:start`, `fastly:publish`, `fastly:deploy`.
|
|
285
|
+
|
|
286
|
+
- Asset inclusion test renamed to `kvStoreAssetInclusionTest` and now expects a boolean return value.
|
|
287
|
+
|
|
288
|
+
### Removed / Deprecated
|
|
289
|
+
|
|
290
|
+
- This tool drops `wasm-inline`, and no longer inlines bytes of assets into the Wasm binary.
|
|
291
|
+
|
|
292
|
+
- Static files metadata is no longer stored in the Wasm binary,
|
|
293
|
+
|
|
294
|
+
- This tool drops `moduleAssets`.
|
|
295
|
+
|
|
296
|
+
## [6.3.0] - 2025-03-19
|
|
297
|
+
|
|
298
|
+
### Added
|
|
299
|
+
|
|
300
|
+
- feat: Added content type for WebP images
|
|
301
|
+
- Added example of adding a custom content type to README
|
|
302
|
+
|
|
303
|
+
### Fixed
|
|
304
|
+
|
|
305
|
+
- fix: Content Type test regexes were not checking period correctly
|
|
306
|
+
|
|
307
|
+
### Updated
|
|
308
|
+
|
|
309
|
+
- Uses new webpack recommendations from webpack starter kit
|
|
310
|
+
- Minor updates to migration guide
|
|
311
|
+
|
|
312
|
+
## [6.2.0] - 2024-11-27
|
|
313
|
+
|
|
314
|
+
### Added
|
|
315
|
+
|
|
316
|
+
- Scaffolded application now uses @fastly/cli npm package to access the Fastly CLI
|
|
317
|
+
|
|
318
|
+
### Updated
|
|
319
|
+
|
|
320
|
+
- Improved README to clarify command line args syntax
|
|
321
|
+
- Improved README to clarify KV Store mode usage
|
|
322
|
+
- Improved README to clarify application generation and iteration
|
|
323
|
+
|
|
324
|
+
## [6.1.1] - 2024-10-03
|
|
325
|
+
|
|
326
|
+
### Fixed
|
|
327
|
+
|
|
328
|
+
- fix: Windows compatibility issues (JohanLi)
|
|
329
|
+
- fix: allow for dots in KV Store name (NeilHanlon)
|
|
330
|
+
|
|
331
|
+
## [6.1.0] - 2024-03-22
|
|
332
|
+
|
|
333
|
+
### Added
|
|
334
|
+
|
|
335
|
+
- feat: add getJson() to ContentAsset
|
|
336
|
+
|
|
337
|
+
## [6.0.0] - 2024-01-26
|
|
338
|
+
|
|
339
|
+
### Updated
|
|
340
|
+
|
|
341
|
+
- Add "static content root dir" to cleanly separate generated files
|
|
342
|
+
|
|
343
|
+
## [5.2.1] - 2023-11-14
|
|
344
|
+
|
|
345
|
+
### Updated
|
|
346
|
+
|
|
347
|
+
- Apply "Compute" branding change.
|
|
348
|
+
|
|
349
|
+
## [5.2.0] - 2023-09-19
|
|
350
|
+
|
|
351
|
+
### Changed
|
|
352
|
+
|
|
353
|
+
- Use `@fastly/js-compute@3` for dev
|
|
354
|
+
- Make generated project use `@fastly/js-compute@3`
|
|
355
|
+
|
|
356
|
+
## [5.1.2] - 2023-09-19
|
|
357
|
+
|
|
358
|
+
### Added
|
|
359
|
+
|
|
360
|
+
- Added support for `@fastly/js-compute` 3.0.0
|
|
361
|
+
|
|
362
|
+
## [5.1.1] - 2023-07-06
|
|
363
|
+
|
|
364
|
+
### Fixed
|
|
365
|
+
|
|
366
|
+
- Fix: Specify full path in import directives in generated files to allow use in projects with "type": "module".
|
|
367
|
+
|
|
368
|
+
## [5.1.0] - 2023-06-12
|
|
369
|
+
|
|
370
|
+
### Fixed
|
|
371
|
+
|
|
372
|
+
- Fix: Correct package.json created by init-app to reference fastly/js-compute@2 (#8)
|
|
373
|
+
|
|
374
|
+
## [5.0.2] - 2023-05-25
|
|
375
|
+
|
|
376
|
+
### Updated
|
|
377
|
+
|
|
378
|
+
- README updates
|
|
379
|
+
|
|
380
|
+
## [5.0.1] - 2023-05-19
|
|
381
|
+
|
|
382
|
+
### Fixed
|
|
383
|
+
|
|
384
|
+
- Avoid a crash caused by extra output when `fastly` CLI tool detects a newer available version.
|
|
385
|
+
|
|
386
|
+
## [5.0.0] - 2023-05-19
|
|
387
|
+
|
|
388
|
+
### Changed
|
|
389
|
+
|
|
390
|
+
- Update to js-compute@2.0.0
|
|
391
|
+
- BREAKING: To correspond with Fastly's finalization of the name of KV Store,
|
|
392
|
+
all references have been updated to that naming.
|
|
393
|
+
|
|
394
|
+
## [4.2.1] - 2023-05-06
|
|
395
|
+
|
|
396
|
+
### Fixed
|
|
397
|
+
|
|
398
|
+
- Fix parsing of contentTypes[] in static-publish.rc.js
|
|
399
|
+
|
|
400
|
+
## [4.2.0] - 2023-04-26
|
|
401
|
+
|
|
402
|
+
### Fixed
|
|
403
|
+
|
|
404
|
+
- Avoid a crash when the project doesn't have devDependencies in package.json.
|
|
405
|
+
|
|
406
|
+
## [4.1.0] - 2023-04-05
|
|
407
|
+
|
|
408
|
+
### Added
|
|
409
|
+
|
|
410
|
+
- Added 'bytes' and 'string' content asset types usable during testing.
|
|
411
|
+
- AssetManager: added `getAssetKeys` method
|
|
412
|
+
- ContentAsset: added `isLocal` property
|
|
413
|
+
|
|
414
|
+
### Changed
|
|
415
|
+
|
|
416
|
+
- Modified metadata to use string identifiers such as 'wasm-inline' and 'object-store'
|
|
417
|
+
instead of a single "isInline" boolean value. This allows other stores to be used during
|
|
418
|
+
tests.
|
|
419
|
+
- Compute-Js Content Assets ('wasm-inline' and 'object-store') are only included when
|
|
420
|
+
`@fastly/compute-js-static-publish/build/compute-js` is imported.
|
|
421
|
+
|
|
422
|
+
### Fixed
|
|
423
|
+
|
|
424
|
+
- Fixed type of imported metadata file in clean-object-store program.
|
|
425
|
+
|
|
426
|
+
## [4.0.0] - 2023-03-23
|
|
427
|
+
|
|
428
|
+
### Added
|
|
429
|
+
|
|
430
|
+
- Cleaner separation between Content Assets and Module Assets: applications can define which files
|
|
431
|
+
generate which type of asset.
|
|
432
|
+
- Object Store mode: Content Assets can selectively be uploaded to and served from the Object Store, allowing the Wasm binary to be much smaller.
|
|
433
|
+
- Defined `StoreEntry`, a common interface that can be used to stream data from content assets, regardless of whether that
|
|
434
|
+
data exists inlined into the Wasm artifact or uploaded to Object Store.
|
|
435
|
+
- Added support for Brotli and Gzip compression. These assets are pre-compressed at publish time and uploaded alongside
|
|
436
|
+
their raw counterparts, rather than using runtime compression. This feature is enabled automatically if Object Store mode
|
|
437
|
+
is used, and can be selectively enabled otherwise.
|
|
438
|
+
- Added support for returning `304 Not Modified` status based on `If-None-Match` and `If-Modified-Since` request headers.
|
|
439
|
+
- A `PublisherServer` class that maps incoming requests to asset paths.
|
|
440
|
+
- Content and metadata available to your application.
|
|
441
|
+
- Load JavaScript module assets as code into your Compute JavaScript application.
|
|
442
|
+
- `clean-object-store` mode can be used to remove no-longer-used entries from the Object Store.
|
|
443
|
+
- Moved [Migration Guide](./MIGRATING.md) into its own separate file with even more information.
|
|
444
|
+
- Exported `getObjectStoreKeysFromMetadata()` metadata handling utility from main package.
|
|
445
|
+
- Exported `getDefaultContentTypes()` and other content type utilities from main package.
|
|
446
|
+
- Added preset for Vue (https://vuejs.org/).
|
|
447
|
+
- Added preset for Astro (https://astro.build/).
|
|
448
|
+
|
|
449
|
+
### Changed
|
|
450
|
+
|
|
451
|
+
- Webpack is no longer required as a dependency, and is disabled by default. If you wish to use Webpack, you can enable
|
|
452
|
+
it through the `--webpack` command line option during project scaffolding.
|
|
453
|
+
- No longer uses Expressly to route requests. `index.js` has been simplified using the `PublisherServer` class instead.
|
|
454
|
+
- Separated `--root-dir` and `--public-dir`. The public directory is now a `PublisherServer` configuration that represents
|
|
455
|
+
the subset of the published files that map to the web root. This effectively adds the ability to include files in the
|
|
456
|
+
publishing that aren't accessible from the web (at least through `PublisherServer`).
|
|
457
|
+
- `static-publish.rc.js` cleaned up:
|
|
458
|
+
- Items related to including/excluding files reorganized;
|
|
459
|
+
- `PublisherServer`-specific settings moved to `server` key.
|
|
460
|
+
- Moved default content types into the main package.
|
|
461
|
+
- Updated to TypeScript 5
|
|
462
|
+
|
|
463
|
+
## [3.6.0] - 2023-02-28
|
|
464
|
+
|
|
465
|
+
### Added
|
|
466
|
+
|
|
467
|
+
- Made testing against default content types easier
|
|
468
|
+
- Exported types for default-content-types.cjs
|
|
469
|
+
|
|
470
|
+
It's now possible to do something like this:
|
|
471
|
+
```typescript
|
|
472
|
+
import { defaultContentTypes, testFileContentType } from "@fastly/compute-js-static-publish/resources/default-content-types";
|
|
473
|
+
const testResult = testFileContentType(defaultContentTypes, '/path/to/file.json');
|
|
474
|
+
testResult.binary // false
|
|
475
|
+
testResult.type // application/json
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
## [3.5.0] - 2023-02-24
|
|
479
|
+
|
|
480
|
+
### Fixed
|
|
481
|
+
|
|
482
|
+
- Update generated package.json and fastly.toml to recommended setup
|
|
483
|
+
- Updated documentation on migration
|
|
484
|
+
|
|
485
|
+
## [3.4.0] - 2023-02-16
|
|
486
|
+
|
|
487
|
+
### Fixed
|
|
488
|
+
|
|
489
|
+
- SPA and 404 files were being left out
|
|
490
|
+
- Corrected typing of loadModule function
|
|
491
|
+
|
|
492
|
+
## [3.3.0] - 2023-02-16
|
|
493
|
+
|
|
494
|
+
### Added
|
|
495
|
+
|
|
496
|
+
- Make assets map available on the StaticAssets object.
|
|
497
|
+
- In addition to exporting module assets as [static `import` statements](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import),
|
|
498
|
+
they can alternatively be exported as [`import()` calls](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import).
|
|
499
|
+
At the current time, this feature requires a bundler that supports the `import()` function, such as [Webpack](https://webpack.js.org).
|
|
500
|
+
|
|
501
|
+
## [3.2.1] - 2023-01-30
|
|
502
|
+
|
|
503
|
+
### Added
|
|
504
|
+
|
|
505
|
+
- Export additional TypeScript types: AssetBase, StringAsset, and Binary Asset
|
|
506
|
+
|
|
507
|
+
## [3.2.0] - 2023-01-13
|
|
508
|
+
|
|
509
|
+
### Fixed
|
|
510
|
+
|
|
511
|
+
- Added `type` field that had been missing from asset entry
|
|
512
|
+
- Content for binary files is now typed as `Uint8Array` rather than `ArrayBuffer`
|
|
513
|
+
|
|
514
|
+
## [3.1.0] - 2023-01-11
|
|
515
|
+
|
|
516
|
+
### Added
|
|
517
|
+
|
|
518
|
+
- Generate statics.d.ts alongside static.js helpful for TypeScript
|
|
519
|
+
- Export Config type to describe shape of static-publish.rc.js
|
|
520
|
+
- Generated static files have descriptive notice
|
|
521
|
+
|
|
522
|
+
## [3.0.1] - 2022-12-23
|
|
523
|
+
|
|
524
|
+
### Fixed
|
|
525
|
+
|
|
526
|
+
- Updated generated app to @fastly/compute-js-static-publish@3.0.1
|
|
527
|
+
|
|
528
|
+
## [3.0.0] - 2022-12-23
|
|
529
|
+
|
|
530
|
+
### Changed
|
|
531
|
+
|
|
532
|
+
- Updated to @fastly/js-compute@1.0.1
|
|
533
|
+
- Updated generated app to @fastly/js-compute@1.0.1
|
|
534
|
+
- Updated generated app to @fastly/express@1.0.0-beta.2
|
|
535
|
+
- Improve mechanism of serving static files by copying them into the static content dir and using `includeBytes()`, rather than using asset modules
|
|
536
|
+
|
|
537
|
+
### Fixed
|
|
538
|
+
|
|
539
|
+
- Enable minimize in `webpack.config.js`
|
|
540
|
+
|
|
541
|
+
## [2.4.2] - 2022-12-21
|
|
542
|
+
|
|
543
|
+
### Changed
|
|
544
|
+
|
|
545
|
+
- auto-index now also applies to request paths that do not have a trailing slash
|
|
546
|
+
|
|
547
|
+
## [2.4.1] - 2022-12-02
|
|
548
|
+
|
|
549
|
+
### Fixed
|
|
550
|
+
|
|
551
|
+
- Added missing devDependency to `@fastly/compute-js-static-publish`
|
|
552
|
+
|
|
553
|
+
## [2.4.0] - 2022-12-02
|
|
554
|
+
|
|
555
|
+
### Changed
|
|
556
|
+
|
|
557
|
+
- Updated to js-compute@0.5.12
|
|
558
|
+
- Updated generated app to js-compute@0.5.12
|
|
559
|
+
- Updated generated app's webpack and webpack-cli versions
|
|
560
|
+
- Use atob() and removed dependency on Buffer
|
|
561
|
+
|
|
562
|
+
[unreleased]: https://github.com/fastly/compute-js-static-publish/compare/v8.0.1...HEAD
|
|
563
|
+
[8.0.1]: https://github.com/fastly/compute-js-static-publish/compare/v8.0.0...v8.0.1
|
|
564
|
+
[8.0.0]: https://github.com/fastly/compute-js-static-publish/compare/v7.0.8...v8.0.0
|
|
565
|
+
[7.0.8]: https://github.com/fastly/compute-js-static-publish/compare/v7.0.7...v7.0.8
|
|
566
|
+
[7.0.7]: https://github.com/fastly/compute-js-static-publish/compare/v7.0.6...v7.0.7
|
|
567
|
+
[7.0.6]: https://github.com/fastly/compute-js-static-publish/compare/v7.0.5...v7.0.6
|
|
568
|
+
[7.0.5]: https://github.com/fastly/compute-js-static-publish/compare/v7.0.4...v7.0.5
|
|
569
|
+
[7.0.4]: https://github.com/fastly/compute-js-static-publish/compare/v7.0.3...v7.0.4
|
|
570
|
+
[7.0.3]: https://github.com/fastly/compute-js-static-publish/compare/v7.0.2...v7.0.3
|
|
571
|
+
[7.0.2]: https://github.com/fastly/compute-js-static-publish/compare/v7.0.1...v7.0.2
|
|
572
|
+
[7.0.1]: https://github.com/fastly/compute-js-static-publish/compare/v7.0.0...v7.0.1
|
|
573
|
+
[7.0.0]: https://github.com/fastly/compute-js-static-publish/compare/v6.3.0...v7.0.0
|
|
574
|
+
[6.3.0]: https://github.com/fastly/compute-js-static-publish/compare/v6.2.0...v6.3.0
|
|
575
|
+
[6.2.0]: https://github.com/fastly/compute-js-static-publish/compare/v6.1.1...v6.2.0
|
|
576
|
+
[6.1.1]: https://github.com/fastly/compute-js-static-publish/compare/v6.1.0...v6.1.1
|
|
577
|
+
[6.1.0]: https://github.com/fastly/compute-js-static-publish/compare/v6.0.0...v6.1.0
|
|
578
|
+
[6.0.0]: https://github.com/fastly/compute-js-static-publish/compare/v5.2.1...v6.0.0
|
|
579
|
+
[5.2.1]: https://github.com/fastly/compute-js-static-publish/compare/v5.2.0...v5.2.1
|
|
580
|
+
[5.2.0]: https://github.com/fastly/compute-js-static-publish/compare/v5.1.2...v5.2.0
|
|
581
|
+
[5.1.2]: https://github.com/fastly/compute-js-static-publish/compare/v5.1.1...v5.1.2
|
|
582
|
+
[5.1.1]: https://github.com/fastly/compute-js-static-publish/compare/v5.1.0...v5.1.1
|
|
583
|
+
[5.1.0]: https://github.com/fastly/compute-js-static-publish/compare/v5.0.2...v5.1.0
|
|
584
|
+
[5.0.2]: https://github.com/fastly/compute-js-static-publish/compare/v5.0.1...v5.0.2
|
|
585
|
+
[5.0.1]: https://github.com/fastly/compute-js-static-publish/compare/v5.0.0...v5.0.1
|
|
586
|
+
[5.0.0]: https://github.com/fastly/compute-js-static-publish/compare/v4.2.1...v5.0.0
|
|
587
|
+
[4.2.1]: https://github.com/fastly/compute-js-static-publish/compare/v4.2.0...v4.2.1
|
|
588
|
+
[4.2.0]: https://github.com/fastly/compute-js-static-publish/compare/v4.1.0...v4.2.0
|
|
589
|
+
[4.1.0]: https://github.com/fastly/compute-js-static-publish/compare/v4.0.0...v4.1.0
|
|
590
|
+
[4.0.0]: https://github.com/fastly/compute-js-static-publish/compare/v3.6.0...v4.0.0
|
|
591
|
+
[3.6.0]: https://github.com/fastly/compute-js-static-publish/compare/v3.5.0...v3.6.0
|
|
592
|
+
[3.5.0]: https://github.com/fastly/compute-js-static-publish/compare/v3.4.0...v3.5.0
|
|
593
|
+
[3.4.0]: https://github.com/fastly/compute-js-static-publish/compare/v3.3.0...v3.4.0
|
|
594
|
+
[3.3.0]: https://github.com/fastly/compute-js-static-publish/compare/v3.2.1...v3.3.0
|
|
595
|
+
[3.2.1]: https://github.com/fastly/compute-js-static-publish/compare/v3.2.0...v3.2.1
|
|
596
|
+
[3.2.0]: https://github.com/fastly/compute-js-static-publish/compare/v3.1.0...v3.2.0
|
|
597
|
+
[3.1.0]: https://github.com/fastly/compute-js-static-publish/compare/v3.0.1...v3.1.0
|
|
598
|
+
[3.0.1]: https://github.com/fastly/compute-js-static-publish/compare/v3.0.0...v3.0.1
|
|
599
|
+
[3.0.0]: https://github.com/fastly/compute-js-static-publish/compare/v2.4.2...v3.0.0
|
|
600
|
+
[2.4.2]: https://github.com/fastly/compute-js-static-publish/compare/v2.4.1...v2.4.2
|
|
601
|
+
[2.4.1]: https://github.com/fastly/compute-js-static-publish/compare/v2.4.0...v2.4.1
|
|
602
|
+
[2.4.0]: https://github.com/fastly/compute-js-static-publish/releases/tag/v2.4.0
|