@fastly/compute-js-static-publish 2.0.0 → 2.1.0
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 +13 -0
- package/build/init-app.js +6 -5
- package/package.json +1 -1
- package/src/init-app.ts +6 -5
package/README.md
CHANGED
|
@@ -94,6 +94,19 @@ You may still override any of these options individually.
|
|
|
94
94
|
*1 - For Next.js, consider using `@fastly/next-compute-js`, a Node.js server implementation that allows you to run
|
|
95
95
|
your Next.js application on Compute@Edge.
|
|
96
96
|
|
|
97
|
+
## Troubleshooting
|
|
98
|
+
|
|
99
|
+
If you're using Fastly CLI 4.0.0 or newer, and your project was scaffolded using a version
|
|
100
|
+
of this tool older than 2.1.0, then you'll need to add the following to the
|
|
101
|
+
`fastly.toml` file that is in your `compute-js` directory.
|
|
102
|
+
|
|
103
|
+
```toml
|
|
104
|
+
[scripts]
|
|
105
|
+
build = "npx @fastly/compute-js-static-publish --build-static && $(npm bin)/webpack && $(npm bin)/js-compute-runtime ./bin/index.js ./bin/main.wasm"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
If Fastly CLI has already added `build = "$(npm bin)/webpack && $(npm bin)/js-compute-runtime ./bin/index.js ./bin/main.wasm"`, then replace it with the above.
|
|
109
|
+
|
|
97
110
|
## Issues
|
|
98
111
|
|
|
99
112
|
If you encounter any non-security-related bug or unexpected behavior, please [file an issue][bug].
|
package/build/init-app.js
CHANGED
|
@@ -173,22 +173,20 @@ export function initApp(commandLineValues) {
|
|
|
173
173
|
"author": ${JSON.stringify(author)},
|
|
174
174
|
"devDependencies": {
|
|
175
175
|
"@fastly/expressly": "^1.0.0-alpha.7",
|
|
176
|
-
"@fastly/js-compute": "^0.3
|
|
176
|
+
"@fastly/js-compute": "^0.5.3",
|
|
177
177
|
"buffer": "^6.0.3",
|
|
178
178
|
"core-js": "^3.19.1",
|
|
179
179
|
"webpack": "^5.64.0",
|
|
180
180
|
"webpack-cli": "^4.9.1"
|
|
181
181
|
},
|
|
182
182
|
"engines": {
|
|
183
|
-
"node": "
|
|
183
|
+
"node": ">=16.0.0"
|
|
184
184
|
},
|
|
185
185
|
"license": "MIT",
|
|
186
186
|
"private": true,
|
|
187
187
|
"main": "src/index.js",
|
|
188
188
|
"scripts": {
|
|
189
|
-
"
|
|
190
|
-
"deploy": "npm run build && fastly compute deploy",
|
|
191
|
-
"prebuild": "npx @fastly/compute-js-static-publish --build-static && webpack"
|
|
189
|
+
"deploy": "fastly compute deploy"
|
|
192
190
|
},
|
|
193
191
|
"version": "0.2.1"
|
|
194
192
|
}
|
|
@@ -207,6 +205,9 @@ language = "javascript"
|
|
|
207
205
|
manifest_version = 2
|
|
208
206
|
name = "${name}"
|
|
209
207
|
service_id = "${fastlyServiceId}"
|
|
208
|
+
|
|
209
|
+
[scripts]
|
|
210
|
+
build = "npx @fastly/compute-js-static-publish --build-static && $(npm bin)/webpack && $(npm bin)/js-compute-runtime ./bin/index.js ./bin/main.wasm"
|
|
210
211
|
`;
|
|
211
212
|
const fastlyTomlPath = path.resolve(computeJsDir, 'fastly.toml');
|
|
212
213
|
fs.writeFileSync(fastlyTomlPath, fastlyTomlContent, "utf-8");
|
package/package.json
CHANGED
package/src/init-app.ts
CHANGED
|
@@ -209,22 +209,20 @@ export function initApp(commandLineValues: CommandLineOptions) {
|
|
|
209
209
|
"author": ${JSON.stringify(author)},
|
|
210
210
|
"devDependencies": {
|
|
211
211
|
"@fastly/expressly": "^1.0.0-alpha.7",
|
|
212
|
-
"@fastly/js-compute": "^0.3
|
|
212
|
+
"@fastly/js-compute": "^0.5.3",
|
|
213
213
|
"buffer": "^6.0.3",
|
|
214
214
|
"core-js": "^3.19.1",
|
|
215
215
|
"webpack": "^5.64.0",
|
|
216
216
|
"webpack-cli": "^4.9.1"
|
|
217
217
|
},
|
|
218
218
|
"engines": {
|
|
219
|
-
"node": "
|
|
219
|
+
"node": ">=16.0.0"
|
|
220
220
|
},
|
|
221
221
|
"license": "MIT",
|
|
222
222
|
"private": true,
|
|
223
223
|
"main": "src/index.js",
|
|
224
224
|
"scripts": {
|
|
225
|
-
"
|
|
226
|
-
"deploy": "npm run build && fastly compute deploy",
|
|
227
|
-
"prebuild": "npx @fastly/compute-js-static-publish --build-static && webpack"
|
|
225
|
+
"deploy": "fastly compute deploy"
|
|
228
226
|
},
|
|
229
227
|
"version": "0.2.1"
|
|
230
228
|
}
|
|
@@ -246,6 +244,9 @@ language = "javascript"
|
|
|
246
244
|
manifest_version = 2
|
|
247
245
|
name = "${name}"
|
|
248
246
|
service_id = "${fastlyServiceId}"
|
|
247
|
+
|
|
248
|
+
[scripts]
|
|
249
|
+
build = "npx @fastly/compute-js-static-publish --build-static && $(npm bin)/webpack && $(npm bin)/js-compute-runtime ./bin/index.js ./bin/main.wasm"
|
|
249
250
|
`;
|
|
250
251
|
|
|
251
252
|
const fastlyTomlPath = path.resolve(computeJsDir, 'fastly.toml');
|