@fastly/compute-js-static-publish 8.0.1 → 8.0.2
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 +544 -0
- package/DOCUMENTATION.md +31 -15
- package/MIGRATING.md +128 -0
- package/build/cli/cli/commands/manage/collections/promote.d.ts.map +1 -1
- package/build/cli/cli/commands/manage/collections/promote.js +43 -4
- package/build/cli/cli/commands/manage/publish-content.d.ts.map +1 -1
- package/build/cli/cli/commands/manage/publish-content.js +5 -13
- package/build/cli/cli/commands/scaffold/index.js +12 -13
- package/build/cli/cli/storage/kv-store-local-provider.d.ts +1 -0
- package/build/cli/cli/storage/kv-store-local-provider.d.ts.map +1 -1
- package/build/cli/cli/storage/kv-store-local-provider.js +4 -1
- package/build/cli/cli/storage/kv-store-provider.d.ts +1 -0
- package/build/cli/cli/storage/kv-store-provider.d.ts.map +1 -1
- package/build/cli/cli/storage/kv-store-provider.js +9 -1
- package/build/cli/cli/storage/s3-storage-provider.d.ts +1 -0
- package/build/cli/cli/storage/s3-storage-provider.d.ts.map +1 -1
- package/build/cli/cli/storage/s3-storage-provider.js +4 -0
- package/build/cli/cli/storage/storage-provider.d.ts +3 -0
- package/build/cli/cli/storage/storage-provider.d.ts.map +1 -1
- package/build/cli/cli/storage/storage-provider.js +32 -0
- package/build/cli/cli/util/kv-store-items.d.ts +1 -0
- package/build/cli/cli/util/kv-store-items.d.ts.map +1 -1
- package/build/cli/cli/util/kv-store-items.js +16 -40
- package/build/cli/cli/util/s3.d.ts +10 -4
- package/build/cli/cli/util/s3.d.ts.map +1 -1
- package/build/cli/cli/util/s3.js +13 -35
- package/build/server/server/publisher-server/accept-html.d.ts +2 -0
- package/build/server/server/publisher-server/accept-html.d.ts.map +1 -0
- package/build/server/server/publisher-server/accept-html.js +50 -0
- package/build/server/server/publisher-server/index.d.ts.map +1 -1
- package/build/server/server/publisher-server/index.js +8 -12
- package/build/server/server/publisher-server/response-cache.d.ts +3 -0
- package/build/server/server/publisher-server/response-cache.d.ts.map +1 -1
- package/build/server/server/publisher-server/response-cache.js +24 -1
- package/package.json +4 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,544 @@
|
|
|
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
|
+
## [8.0.2] - 2026-11-16
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- The npm package includes `CHANGELOG.md` and `MIGRATING.md`.
|
|
17
|
+
- `PublisherServer.setResponseCache()`: the default of `maxBodySize` is now 16 MiB. It was 8 MiB.
|
|
18
|
+
- 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.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- `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. Thus in S3 mode, if your pipeline has a Service ID, set `FASTLY_API_TOKEN` for `collections promote` too.
|
|
23
|
+
- `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.
|
|
24
|
+
- `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.
|
|
25
|
+
- `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.
|
|
26
|
+
- `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.
|
|
27
|
+
- `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.
|
|
28
|
+
- `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.
|
|
29
|
+
- 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.
|
|
30
|
+
- 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.
|
|
31
|
+
|
|
32
|
+
## [8.0.1] - 2026-11-04
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
|
|
36
|
+
- `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.
|
|
37
|
+
- 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.
|
|
38
|
+
- 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.
|
|
39
|
+
- `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`).
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
|
|
43
|
+
- 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`.
|
|
44
|
+
- `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.
|
|
45
|
+
- 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.
|
|
46
|
+
- 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.
|
|
47
|
+
|
|
48
|
+
## [8.0.0] - 2026-10-27
|
|
49
|
+
|
|
50
|
+
### Breaking
|
|
51
|
+
|
|
52
|
+
- Fastly API token
|
|
53
|
+
- The CLI no longer falls back to `fastly profile token`. Pass the token with `--fastly-api-token` or the `FASTLY_API_TOKEN` environment variable.
|
|
54
|
+
- Remove the `@fastly/cli` dependency, which was used only for that fallback. A scaffolded app continues to have `@fastly/cli` as its own dependency.
|
|
55
|
+
|
|
56
|
+
- Imports of files in `build/` are not supported. Import the named exports of `@fastly/compute-js-static-publish`.
|
|
57
|
+
|
|
58
|
+
### Added
|
|
59
|
+
|
|
60
|
+
- S3-compatible storage (BETA)
|
|
61
|
+
- 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.
|
|
62
|
+
- `static-publish.rc.js`: add the `s3` storage mode configuration.
|
|
63
|
+
- 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()`.
|
|
64
|
+
- 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.
|
|
65
|
+
- 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.
|
|
66
|
+
- `--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.
|
|
67
|
+
- Storage is factored out to `StorageProvider`, and S3 is implemented with this architecture.
|
|
68
|
+
|
|
69
|
+
- 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`.
|
|
70
|
+
- `collections promote` and `collections update-expiration` keep the fields of the index metadata that they do not know.
|
|
71
|
+
|
|
72
|
+
- `publish-content`
|
|
73
|
+
- 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()`).
|
|
74
|
+
- 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.
|
|
75
|
+
- Add `--purge-environment` to purge `production` (the default), `staging`, or both. A staging purge sends the `Fastly-Purge-Environment: staging` header.
|
|
76
|
+
- A failed purge shows a warning on stderr. The command still completes, because the content is already published.
|
|
77
|
+
- Add `--brotli-quality=<0-11>`. It overrides `brotliQuality` in `publish-content.config.js`.
|
|
78
|
+
- Add `--s3-upload-concurrency=<1-256>`: the number of objects to upload to S3-compatible storage at the same time (default: 64).
|
|
79
|
+
|
|
80
|
+
- `collections delete`
|
|
81
|
+
- 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.
|
|
82
|
+
|
|
83
|
+
- `publish-content.config.js`
|
|
84
|
+
- Add `brotliQuality` (0 to 11, default 11). A lower value compresses much faster, and gives slightly larger files.
|
|
85
|
+
|
|
86
|
+
- `PublisherServer`
|
|
87
|
+
- 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.
|
|
88
|
+
- Add `beginRequest()`. `serveRequest()` calls it. Call it yourself before `getMatchingAsset()` if you call `getMatchingAsset()` and `serveAsset()` directly.
|
|
89
|
+
- 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.
|
|
90
|
+
- Add `serveCached()`, to use the response cache with `getMatchingAsset()` and `serveAsset()`. `serveRequest()` uses it automatically.
|
|
91
|
+
- `Server-Timing` has a `cache` entry when the response cache is on: `hit` (with the age of the cached response), `miss`, or `bypass`.
|
|
92
|
+
|
|
93
|
+
### Changed
|
|
94
|
+
|
|
95
|
+
- `publish-content.config.js`
|
|
96
|
+
- `kvStoreAssetInclusionTest` renamed to `assetInclusionTest`. Previous name deprecated.
|
|
97
|
+
|
|
98
|
+
- `publish-content`
|
|
99
|
+
- 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.
|
|
100
|
+
- 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.
|
|
101
|
+
- 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.
|
|
102
|
+
- 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.
|
|
103
|
+
- 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.
|
|
104
|
+
|
|
105
|
+
### Updated
|
|
106
|
+
|
|
107
|
+
- Scaffolded apps use `@fastly/js-compute` `^4.0.0`.
|
|
108
|
+
- 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 = "..."`.
|
|
109
|
+
|
|
110
|
+
### Deprecated
|
|
111
|
+
|
|
112
|
+
- 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.
|
|
113
|
+
|
|
114
|
+
- `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`.
|
|
115
|
+
|
|
116
|
+
### Fixed
|
|
117
|
+
|
|
118
|
+
- `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.
|
|
119
|
+
|
|
120
|
+
- `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.
|
|
121
|
+
|
|
122
|
+
- `clean` stops with an error if it cannot read a collection index. Before, it continued and deleted the files of that collection.
|
|
123
|
+
|
|
124
|
+
- `clean` and `collections delete` exit with an error if a delete operation fails. Before, they showed "Completed".
|
|
125
|
+
|
|
126
|
+
- `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.
|
|
127
|
+
- `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.
|
|
128
|
+
|
|
129
|
+
- 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`).
|
|
130
|
+
|
|
131
|
+
- `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.)
|
|
132
|
+
|
|
133
|
+
- `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.
|
|
134
|
+
|
|
135
|
+
## [7.0.8] - 2026-10-14
|
|
136
|
+
|
|
137
|
+
### Added
|
|
138
|
+
|
|
139
|
+
- Add content types for `.avif` and `.jxl` images
|
|
140
|
+
|
|
141
|
+
### Updated
|
|
142
|
+
|
|
143
|
+
- Update to CLI v16
|
|
144
|
+
- Support `@fastly/js-compute` 4. The peer dependency is now `^3.33.2 || ^4.0.0`.
|
|
145
|
+
|
|
146
|
+
### Fixed
|
|
147
|
+
|
|
148
|
+
- `.tif`/`.tiff` files were served as `image/png`, now `image/tiff`
|
|
149
|
+
|
|
150
|
+
## [7.0.7] - 2026-07-16
|
|
151
|
+
|
|
152
|
+
- Update to CLI v15
|
|
153
|
+
|
|
154
|
+
## [7.0.6] - 2026-02-13
|
|
155
|
+
|
|
156
|
+
### Updated
|
|
157
|
+
|
|
158
|
+
- Release to npmjs using updated CI workflow
|
|
159
|
+
|
|
160
|
+
## [7.0.5] - 2026-02-03
|
|
161
|
+
|
|
162
|
+
### Added
|
|
163
|
+
|
|
164
|
+
- Add application/wasm to default content types
|
|
165
|
+
|
|
166
|
+
## [7.0.4] - 2026-01-07
|
|
167
|
+
|
|
168
|
+
### Added
|
|
169
|
+
|
|
170
|
+
- Publish to GitHub packages as well
|
|
171
|
+
- Use NPM trusted publishing for publishing to npmjs.com
|
|
172
|
+
|
|
173
|
+
## [7.0.3] - 2025-09-29
|
|
174
|
+
|
|
175
|
+
### Fixed
|
|
176
|
+
|
|
177
|
+
- Use pathToFileURL so that import() works under ESM across platforms [#38](https://github.com/fastly/compute-js-static-publish/issues/38)
|
|
178
|
+
|
|
179
|
+
## [7.0.2] - 2025-09-16
|
|
180
|
+
|
|
181
|
+
### Fixed
|
|
182
|
+
|
|
183
|
+
- Fix script listed in readme instructions
|
|
184
|
+
- Handle symlinks properly in file enumeration [#41](https://github.com/fastly/compute-js-static-publish/issues/41)
|
|
185
|
+
|
|
186
|
+
## [7.0.1] - 2025-04-24
|
|
187
|
+
|
|
188
|
+
### Fixed
|
|
189
|
+
|
|
190
|
+
- Add `@latest` to examples of calling the app in scaffolding mode.
|
|
191
|
+
|
|
192
|
+
## [7.0.0] - 2025-04-24
|
|
193
|
+
|
|
194
|
+
> [!NOTE]
|
|
195
|
+
> Breaking release. Every project will need a re-scaffold.
|
|
196
|
+
|
|
197
|
+
### Added
|
|
198
|
+
|
|
199
|
+
- Named Collections
|
|
200
|
+
- Support for named collections of assets that are managed together and can be individually previewed.
|
|
201
|
+
- Expiration trio: --expires-in, --expires-at, --expires-never.
|
|
202
|
+
- Collection selector utilities that can be run at the edge code to activate a collection.
|
|
203
|
+
- Default collection never expires.
|
|
204
|
+
|
|
205
|
+
- git-style subcommands
|
|
206
|
+
- Actions separated into subcommands, such as `clean`, `publish-content`, and `collections`.
|
|
207
|
+
- Dry-run mode (--dry-run) for commands that mutates KV or disk.
|
|
208
|
+
|
|
209
|
+
- KV Store
|
|
210
|
+
- Bytes of assets are stored in the Fastly KV Store.
|
|
211
|
+
- Items in the KV Store are keyed by the hash of the file, keeping storage efficient and deduplicated, even across collections.
|
|
212
|
+
- Metadata (file sizes, encodings, compression) for static assets is stored in KV Store Item metadata.
|
|
213
|
+
- Large-object chunking: files > 20 MB are split into segments behind the scenes and reassembled at read time.
|
|
214
|
+
- Upload process has been optimized - files are uploaded in parallel, and are only compressed and uploaded when necessary.
|
|
215
|
+
- Automatic retry with exponential back-off when the Fastly KV API rate-limits a burst of uploads.
|
|
216
|
+
- Fully supported in the local development environment during development.
|
|
217
|
+
- `--local` flag for all management commands. Passing this flag makes the command operate on the local KV Store instead of the Fastly KV Store.
|
|
218
|
+
|
|
219
|
+
### Changed
|
|
220
|
+
|
|
221
|
+
- Separate config files:
|
|
222
|
+
- `static-publisher.rc.js` now owns behavior that is common to the scaffolded Compute app
|
|
223
|
+
- publish-time settings are in `publish-content.config.js`.
|
|
224
|
+
|
|
225
|
+
- Script names in the scaffold are now grouped by environment: `dev:publish`, `dev:start`, `fastly:publish`, `fastly:deploy`.
|
|
226
|
+
|
|
227
|
+
- Asset inclusion test renamed to `kvStoreAssetInclusionTest` and now expects a boolean return value.
|
|
228
|
+
|
|
229
|
+
### Removed / Deprecated
|
|
230
|
+
|
|
231
|
+
- This tool drops `wasm-inline`, and no longer inlines bytes of assets into the Wasm binary.
|
|
232
|
+
|
|
233
|
+
- Static files metadata is no longer stored in the Wasm binary,
|
|
234
|
+
|
|
235
|
+
- This tool drops `moduleAssets`.
|
|
236
|
+
|
|
237
|
+
## [6.3.0] - 2025-03-19
|
|
238
|
+
|
|
239
|
+
### Added
|
|
240
|
+
|
|
241
|
+
- feat: Added content type for WebP images
|
|
242
|
+
- Added example of adding a custom content type to README
|
|
243
|
+
|
|
244
|
+
### Fixed
|
|
245
|
+
|
|
246
|
+
- fix: Content Type test regexes were not checking period correctly
|
|
247
|
+
|
|
248
|
+
### Updated
|
|
249
|
+
|
|
250
|
+
- Uses new webpack recommendations from webpack starter kit
|
|
251
|
+
- Minor updates to migration guide
|
|
252
|
+
|
|
253
|
+
## [6.2.0] - 2024-11-27
|
|
254
|
+
|
|
255
|
+
### Added
|
|
256
|
+
|
|
257
|
+
- Scaffolded application now uses @fastly/cli npm package to access the Fastly CLI
|
|
258
|
+
|
|
259
|
+
### Updated
|
|
260
|
+
|
|
261
|
+
- Improved README to clarify command line args syntax
|
|
262
|
+
- Improved README to clarify KV Store mode usage
|
|
263
|
+
- Improved README to clarify application generation and iteration
|
|
264
|
+
|
|
265
|
+
## [6.1.1] - 2024-10-03
|
|
266
|
+
|
|
267
|
+
### Fixed
|
|
268
|
+
|
|
269
|
+
- fix: Windows compatibility issues (JohanLi)
|
|
270
|
+
- fix: allow for dots in KV Store name (NeilHanlon)
|
|
271
|
+
|
|
272
|
+
## [6.1.0] - 2024-03-22
|
|
273
|
+
|
|
274
|
+
### Added
|
|
275
|
+
|
|
276
|
+
- feat: add getJson() to ContentAsset
|
|
277
|
+
|
|
278
|
+
## [6.0.0] - 2024-01-26
|
|
279
|
+
|
|
280
|
+
### Updated
|
|
281
|
+
|
|
282
|
+
- Add "static content root dir" to cleanly separate generated files
|
|
283
|
+
|
|
284
|
+
## [5.2.1] - 2023-11-14
|
|
285
|
+
|
|
286
|
+
### Updated
|
|
287
|
+
|
|
288
|
+
- Apply "Compute" branding change.
|
|
289
|
+
|
|
290
|
+
## [5.2.0] - 2023-09-19
|
|
291
|
+
|
|
292
|
+
### Changed
|
|
293
|
+
|
|
294
|
+
- Use `@fastly/js-compute@3` for dev
|
|
295
|
+
- Make generated project use `@fastly/js-compute@3`
|
|
296
|
+
|
|
297
|
+
## [5.1.2] - 2023-09-19
|
|
298
|
+
|
|
299
|
+
### Added
|
|
300
|
+
|
|
301
|
+
- Added support for `@fastly/js-compute` 3.0.0
|
|
302
|
+
|
|
303
|
+
## [5.1.1] - 2023-07-06
|
|
304
|
+
|
|
305
|
+
### Fixed
|
|
306
|
+
|
|
307
|
+
- Fix: Specify full path in import directives in generated files to allow use in projects with "type": "module".
|
|
308
|
+
|
|
309
|
+
## [5.1.0] - 2023-06-12
|
|
310
|
+
|
|
311
|
+
### Fixed
|
|
312
|
+
|
|
313
|
+
- Fix: Correct package.json created by init-app to reference fastly/js-compute@2 (#8)
|
|
314
|
+
|
|
315
|
+
## [5.0.2] - 2023-05-25
|
|
316
|
+
|
|
317
|
+
### Updated
|
|
318
|
+
|
|
319
|
+
- README updates
|
|
320
|
+
|
|
321
|
+
## [5.0.1] - 2023-05-19
|
|
322
|
+
|
|
323
|
+
### Fixed
|
|
324
|
+
|
|
325
|
+
- Avoid a crash caused by extra output when `fastly` CLI tool detects a newer available version.
|
|
326
|
+
|
|
327
|
+
## [5.0.0] - 2023-05-19
|
|
328
|
+
|
|
329
|
+
### Changed
|
|
330
|
+
|
|
331
|
+
- Update to js-compute@2.0.0
|
|
332
|
+
- BREAKING: To correspond with Fastly's finalization of the name of KV Store,
|
|
333
|
+
all references have been updated to that naming.
|
|
334
|
+
|
|
335
|
+
## [4.2.1] - 2023-05-06
|
|
336
|
+
|
|
337
|
+
### Fixed
|
|
338
|
+
|
|
339
|
+
- Fix parsing of contentTypes[] in static-publish.rc.js
|
|
340
|
+
|
|
341
|
+
## [4.2.0] - 2023-04-26
|
|
342
|
+
|
|
343
|
+
### Fixed
|
|
344
|
+
|
|
345
|
+
- Avoid a crash when the project doesn't have devDependencies in package.json.
|
|
346
|
+
|
|
347
|
+
## [4.1.0] - 2023-04-05
|
|
348
|
+
|
|
349
|
+
### Added
|
|
350
|
+
|
|
351
|
+
- Added 'bytes' and 'string' content asset types usable during testing.
|
|
352
|
+
- AssetManager: added `getAssetKeys` method
|
|
353
|
+
- ContentAsset: added `isLocal` property
|
|
354
|
+
|
|
355
|
+
### Changed
|
|
356
|
+
|
|
357
|
+
- Modified metadata to use string identifiers such as 'wasm-inline' and 'object-store'
|
|
358
|
+
instead of a single "isInline" boolean value. This allows other stores to be used during
|
|
359
|
+
tests.
|
|
360
|
+
- Compute-Js Content Assets ('wasm-inline' and 'object-store') are only included when
|
|
361
|
+
`@fastly/compute-js-static-publish/build/compute-js` is imported.
|
|
362
|
+
|
|
363
|
+
### Fixed
|
|
364
|
+
|
|
365
|
+
- Fixed type of imported metadata file in clean-object-store program.
|
|
366
|
+
|
|
367
|
+
## [4.0.0] - 2023-03-23
|
|
368
|
+
|
|
369
|
+
### Added
|
|
370
|
+
|
|
371
|
+
- Cleaner separation between Content Assets and Module Assets: applications can define which files
|
|
372
|
+
generate which type of asset.
|
|
373
|
+
- Object Store mode: Content Assets can selectively be uploaded to and served from the Object Store, allowing the Wasm binary to be much smaller.
|
|
374
|
+
- Defined `StoreEntry`, a common interface that can be used to stream data from content assets, regardless of whether that
|
|
375
|
+
data exists inlined into the Wasm artifact or uploaded to Object Store.
|
|
376
|
+
- Added support for Brotli and Gzip compression. These assets are pre-compressed at publish time and uploaded alongside
|
|
377
|
+
their raw counterparts, rather than using runtime compression. This feature is enabled automatically if Object Store mode
|
|
378
|
+
is used, and can be selectively enabled otherwise.
|
|
379
|
+
- Added support for returning `304 Not Modified` status based on `If-None-Match` and `If-Modified-Since` request headers.
|
|
380
|
+
- A `PublisherServer` class that maps incoming requests to asset paths.
|
|
381
|
+
- Content and metadata available to your application.
|
|
382
|
+
- Load JavaScript module assets as code into your Compute JavaScript application.
|
|
383
|
+
- `clean-object-store` mode can be used to remove no-longer-used entries from the Object Store.
|
|
384
|
+
- Moved [Migration Guide](./MIGRATING.md) into its own separate file with even more information.
|
|
385
|
+
- Exported `getObjectStoreKeysFromMetadata()` metadata handling utility from main package.
|
|
386
|
+
- Exported `getDefaultContentTypes()` and other content type utilities from main package.
|
|
387
|
+
- Added preset for Vue (https://vuejs.org/).
|
|
388
|
+
- Added preset for Astro (https://astro.build/).
|
|
389
|
+
|
|
390
|
+
### Changed
|
|
391
|
+
|
|
392
|
+
- Webpack is no longer required as a dependency, and is disabled by default. If you wish to use Webpack, you can enable
|
|
393
|
+
it through the `--webpack` command line option during project scaffolding.
|
|
394
|
+
- No longer uses Expressly to route requests. `index.js` has been simplified using the `PublisherServer` class instead.
|
|
395
|
+
- Separated `--root-dir` and `--public-dir`. The public directory is now a `PublisherServer` configuration that represents
|
|
396
|
+
the subset of the published files that map to the web root. This effectively adds the ability to include files in the
|
|
397
|
+
publishing that aren't accessible from the web (at least through `PublisherServer`).
|
|
398
|
+
- `static-publish.rc.js` cleaned up:
|
|
399
|
+
- Items related to including/excluding files reorganized;
|
|
400
|
+
- `PublisherServer`-specific settings moved to `server` key.
|
|
401
|
+
- Moved default content types into the main package.
|
|
402
|
+
- Updated to TypeScript 5
|
|
403
|
+
|
|
404
|
+
## [3.6.0] - 2023-02-28
|
|
405
|
+
|
|
406
|
+
### Added
|
|
407
|
+
|
|
408
|
+
- Made testing against default content types easier
|
|
409
|
+
- Exported types for default-content-types.cjs
|
|
410
|
+
|
|
411
|
+
It's now possible to do something like this:
|
|
412
|
+
```typescript
|
|
413
|
+
import { defaultContentTypes, testFileContentType } from "@fastly/compute-js-static-publish/resources/default-content-types";
|
|
414
|
+
const testResult = testFileContentType(defaultContentTypes, '/path/to/file.json');
|
|
415
|
+
testResult.binary // false
|
|
416
|
+
testResult.type // application/json
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
## [3.5.0] - 2023-02-24
|
|
420
|
+
|
|
421
|
+
### Fixed
|
|
422
|
+
|
|
423
|
+
- Update generated package.json and fastly.toml to recommended setup
|
|
424
|
+
- Updated documentation on migration
|
|
425
|
+
|
|
426
|
+
## [3.4.0] - 2023-02-16
|
|
427
|
+
|
|
428
|
+
### Fixed
|
|
429
|
+
|
|
430
|
+
- SPA and 404 files were being left out
|
|
431
|
+
- Corrected typing of loadModule function
|
|
432
|
+
|
|
433
|
+
## [3.3.0] - 2023-02-16
|
|
434
|
+
|
|
435
|
+
### Added
|
|
436
|
+
|
|
437
|
+
- Make assets map available on the StaticAssets object.
|
|
438
|
+
- In addition to exporting module assets as [static `import` statements](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import),
|
|
439
|
+
they can alternatively be exported as [`import()` calls](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import).
|
|
440
|
+
At the current time, this feature requires a bundler that supports the `import()` function, such as [Webpack](https://webpack.js.org).
|
|
441
|
+
|
|
442
|
+
## [3.2.1] - 2023-01-30
|
|
443
|
+
|
|
444
|
+
### Added
|
|
445
|
+
|
|
446
|
+
- Export additional TypeScript types: AssetBase, StringAsset, and Binary Asset
|
|
447
|
+
|
|
448
|
+
## [3.2.0] - 2023-01-13
|
|
449
|
+
|
|
450
|
+
### Fixed
|
|
451
|
+
|
|
452
|
+
- Added `type` field that had been missing from asset entry
|
|
453
|
+
- Content for binary files is now typed as `Uint8Array` rather than `ArrayBuffer`
|
|
454
|
+
|
|
455
|
+
## [3.1.0] - 2023-01-11
|
|
456
|
+
|
|
457
|
+
### Added
|
|
458
|
+
|
|
459
|
+
- Generate statics.d.ts alongside static.js helpful for TypeScript
|
|
460
|
+
- Export Config type to describe shape of static-publish.rc.js
|
|
461
|
+
- Generated static files have descriptive notice
|
|
462
|
+
|
|
463
|
+
## [3.0.1] - 2022-12-23
|
|
464
|
+
|
|
465
|
+
### Fixed
|
|
466
|
+
|
|
467
|
+
- Updated generated app to @fastly/compute-js-static-publish@3.0.1
|
|
468
|
+
|
|
469
|
+
## [3.0.0] - 2022-12-23
|
|
470
|
+
|
|
471
|
+
### Changed
|
|
472
|
+
|
|
473
|
+
- Updated to @fastly/js-compute@1.0.1
|
|
474
|
+
- Updated generated app to @fastly/js-compute@1.0.1
|
|
475
|
+
- Updated generated app to @fastly/express@1.0.0-beta.2
|
|
476
|
+
- Improve mechanism of serving static files by copying them into the static content dir and using `includeBytes()`, rather than using asset modules
|
|
477
|
+
|
|
478
|
+
### Fixed
|
|
479
|
+
|
|
480
|
+
- Enable minimize in `webpack.config.js`
|
|
481
|
+
|
|
482
|
+
## [2.4.2] - 2022-12-21
|
|
483
|
+
|
|
484
|
+
### Changed
|
|
485
|
+
|
|
486
|
+
- auto-index now also applies to request paths that do not have a trailing slash
|
|
487
|
+
|
|
488
|
+
## [2.4.1] - 2022-12-02
|
|
489
|
+
|
|
490
|
+
### Fixed
|
|
491
|
+
|
|
492
|
+
- Added missing devDependency to `@fastly/compute-js-static-publish`
|
|
493
|
+
|
|
494
|
+
## [2.4.0] - 2022-12-02
|
|
495
|
+
|
|
496
|
+
### Changed
|
|
497
|
+
|
|
498
|
+
- Updated to js-compute@0.5.12
|
|
499
|
+
- Updated generated app to js-compute@0.5.12
|
|
500
|
+
- Updated generated app's webpack and webpack-cli versions
|
|
501
|
+
- Use atob() and removed dependency on Buffer
|
|
502
|
+
|
|
503
|
+
[unreleased]: https://github.com/fastly/compute-js-static-publish/compare/v8.0.2...HEAD
|
|
504
|
+
[8.0.2]: https://github.com/fastly/compute-js-static-publish/compare/v8.0.1...v8.0.2
|
|
505
|
+
[8.0.1]: https://github.com/fastly/compute-js-static-publish/compare/v8.0.0...v8.0.1
|
|
506
|
+
[8.0.0]: https://github.com/fastly/compute-js-static-publish/compare/v7.0.8...v8.0.0
|
|
507
|
+
[7.0.8]: https://github.com/fastly/compute-js-static-publish/compare/v7.0.7...v7.0.8
|
|
508
|
+
[7.0.7]: https://github.com/fastly/compute-js-static-publish/compare/v7.0.6...v7.0.7
|
|
509
|
+
[7.0.6]: https://github.com/fastly/compute-js-static-publish/compare/v7.0.5...v7.0.6
|
|
510
|
+
[7.0.5]: https://github.com/fastly/compute-js-static-publish/compare/v7.0.4...v7.0.5
|
|
511
|
+
[7.0.4]: https://github.com/fastly/compute-js-static-publish/compare/v7.0.3...v7.0.4
|
|
512
|
+
[7.0.3]: https://github.com/fastly/compute-js-static-publish/compare/v7.0.2...v7.0.3
|
|
513
|
+
[7.0.2]: https://github.com/fastly/compute-js-static-publish/compare/v7.0.1...v7.0.2
|
|
514
|
+
[7.0.1]: https://github.com/fastly/compute-js-static-publish/compare/v7.0.0...v7.0.1
|
|
515
|
+
[7.0.0]: https://github.com/fastly/compute-js-static-publish/compare/v6.3.0...v7.0.0
|
|
516
|
+
[6.3.0]: https://github.com/fastly/compute-js-static-publish/compare/v6.2.0...v6.3.0
|
|
517
|
+
[6.2.0]: https://github.com/fastly/compute-js-static-publish/compare/v6.1.1...v6.2.0
|
|
518
|
+
[6.1.1]: https://github.com/fastly/compute-js-static-publish/compare/v6.1.0...v6.1.1
|
|
519
|
+
[6.1.0]: https://github.com/fastly/compute-js-static-publish/compare/v6.0.0...v6.1.0
|
|
520
|
+
[6.0.0]: https://github.com/fastly/compute-js-static-publish/compare/v5.2.1...v6.0.0
|
|
521
|
+
[5.2.1]: https://github.com/fastly/compute-js-static-publish/compare/v5.2.0...v5.2.1
|
|
522
|
+
[5.2.0]: https://github.com/fastly/compute-js-static-publish/compare/v5.1.2...v5.2.0
|
|
523
|
+
[5.1.2]: https://github.com/fastly/compute-js-static-publish/compare/v5.1.1...v5.1.2
|
|
524
|
+
[5.1.1]: https://github.com/fastly/compute-js-static-publish/compare/v5.1.0...v5.1.1
|
|
525
|
+
[5.1.0]: https://github.com/fastly/compute-js-static-publish/compare/v5.0.2...v5.1.0
|
|
526
|
+
[5.0.2]: https://github.com/fastly/compute-js-static-publish/compare/v5.0.1...v5.0.2
|
|
527
|
+
[5.0.1]: https://github.com/fastly/compute-js-static-publish/compare/v5.0.0...v5.0.1
|
|
528
|
+
[5.0.0]: https://github.com/fastly/compute-js-static-publish/compare/v4.2.1...v5.0.0
|
|
529
|
+
[4.2.1]: https://github.com/fastly/compute-js-static-publish/compare/v4.2.0...v4.2.1
|
|
530
|
+
[4.2.0]: https://github.com/fastly/compute-js-static-publish/compare/v4.1.0...v4.2.0
|
|
531
|
+
[4.1.0]: https://github.com/fastly/compute-js-static-publish/compare/v4.0.0...v4.1.0
|
|
532
|
+
[4.0.0]: https://github.com/fastly/compute-js-static-publish/compare/v3.6.0...v4.0.0
|
|
533
|
+
[3.6.0]: https://github.com/fastly/compute-js-static-publish/compare/v3.5.0...v3.6.0
|
|
534
|
+
[3.5.0]: https://github.com/fastly/compute-js-static-publish/compare/v3.4.0...v3.5.0
|
|
535
|
+
[3.4.0]: https://github.com/fastly/compute-js-static-publish/compare/v3.3.0...v3.4.0
|
|
536
|
+
[3.3.0]: https://github.com/fastly/compute-js-static-publish/compare/v3.2.1...v3.3.0
|
|
537
|
+
[3.2.1]: https://github.com/fastly/compute-js-static-publish/compare/v3.2.0...v3.2.1
|
|
538
|
+
[3.2.0]: https://github.com/fastly/compute-js-static-publish/compare/v3.1.0...v3.2.0
|
|
539
|
+
[3.1.0]: https://github.com/fastly/compute-js-static-publish/compare/v3.0.1...v3.1.0
|
|
540
|
+
[3.0.1]: https://github.com/fastly/compute-js-static-publish/compare/v3.0.0...v3.0.1
|
|
541
|
+
[3.0.0]: https://github.com/fastly/compute-js-static-publish/compare/v2.4.2...v3.0.0
|
|
542
|
+
[2.4.2]: https://github.com/fastly/compute-js-static-publish/compare/v2.4.1...v2.4.2
|
|
543
|
+
[2.4.1]: https://github.com/fastly/compute-js-static-publish/compare/v2.4.0...v2.4.1
|
|
544
|
+
[2.4.0]: https://github.com/fastly/compute-js-static-publish/releases/tag/v2.4.0
|