@fastly/compute-js-static-publish 5.0.0 → 5.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/README.md +14 -15
- package/build/cli/util/fastly-api.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,21 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Using a static site generator to build your website? Do you simply need to serve some static files? With `compute-js-static-publish`, now you can deploy and serve everything from Fastly's blazing-fast [Compute@Edge](https://developer.fastly.com/learning/compute/).
|
|
4
4
|
|
|
5
|
-
## New! Version 4
|
|
6
|
-
|
|
7
|
-
Version 4 of this tool has some awesome new features:
|
|
8
|
-
- Support for serving files from Fastly's [KV Store](#kv-store) instead of/alongside bundling them into the Wasm module.
|
|
9
|
-
- Scaffolded applications no longer use a bundler by default (Webpack is optional).
|
|
10
|
-
- Brotli and Gzip compression.
|
|
11
|
-
- Support for returning `304 Not Modified` status based on `If-None-Match` and `If-Modified-Since` request headers.
|
|
12
|
-
- [`PublisherServer`](#publisherserver) class to map incoming requests to asset paths.
|
|
13
|
-
- Support for publishing files that won't necessarily be served by `PublisherServer`. File contents are made available to your application–useful, e.g., for reading data written by third-party tools, etc.
|
|
14
|
-
- Makes content and metadata available to your application, via pre-package path/file.
|
|
15
|
-
- Support for loading JavaScript files as code into your Compute@Edge application.
|
|
16
|
-
- Added presets for [Vue](https://vuejs.org/) and [Astro](https://astro.build/).
|
|
17
|
-
|
|
18
|
-
If you wish to update to this version, you may need to re-scaffold your application, or follow the steps outlined in [MIGRATING.md](./MIGRATING.md).
|
|
19
|
-
|
|
20
5
|
## Prerequisites
|
|
21
6
|
|
|
22
7
|
Node 18 or newer is required during the build step, as we now rely on its `experimental-fetch` feature.
|
|
@@ -57,6 +42,20 @@ However, you can modify `/src/index.js` to add your own processing as you need.
|
|
|
57
42
|
fastly compute publish
|
|
58
43
|
```
|
|
59
44
|
|
|
45
|
+
## Features
|
|
46
|
+
|
|
47
|
+
- Simple to set up, with a built-in server module.
|
|
48
|
+
- Or, make file contents directly available to your application, so you can write your own server.
|
|
49
|
+
- Content and metadata are available to your application, accessible by files' pre-package file paths.
|
|
50
|
+
- Brotli and Gzip compression.
|
|
51
|
+
- Support for `If-None-Match` and `If-Modified-Since` request headers.
|
|
52
|
+
- Optionally use Webpack as a module bundler.
|
|
53
|
+
- Selectively serve files from Fastly's [KV Store](#kv-store), or embedded into your Wasm module.
|
|
54
|
+
- Supports loading JavaScript files as code into your Compute@Edge application.
|
|
55
|
+
- Presets for several static site generators.
|
|
56
|
+
|
|
57
|
+
Some of these features are new! If you wish to update to this version, you may need to re-scaffold your application, or follow the steps outlined in [MIGRATING.md](./MIGRATING.md).
|
|
58
|
+
|
|
60
59
|
## How does it work? Where are the files?
|
|
61
60
|
|
|
62
61
|
Once your application is scaffolded, `@fastly/compute-js-static-publish` integrates into your development process by
|
|
@@ -11,7 +11,7 @@ export function loadApiKey() {
|
|
|
11
11
|
if (apiToken == null) {
|
|
12
12
|
// Try to get API key from fastly cli
|
|
13
13
|
try {
|
|
14
|
-
apiToken = execSync('fastly profile token', {
|
|
14
|
+
apiToken = execSync('fastly profile token --quiet', {
|
|
15
15
|
encoding: 'utf-8',
|
|
16
16
|
})?.trim() || null;
|
|
17
17
|
}
|
package/package.json
CHANGED