@fastly/compute-js-static-publish 6.1.0 → 6.1.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-static.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/build-static.ts"],"names":[],"mappings":"AA+DA,OAAO,eAAe,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"build-static.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/build-static.ts"],"names":[],"mappings":"AA+DA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAgJhD,wBAAsB,iBAAiB,CAAC,iBAAiB,EAAE,eAAe,CAAC,kBAAkB,iBA2e5F"}
|
|
@@ -86,13 +86,15 @@ function writeKVStoreEntriesToFastlyToml(kvStoreName, kvStoreItems) {
|
|
|
86
86
|
let fastlyToml = fs.readFileSync('./fastly.toml', 'utf-8');
|
|
87
87
|
let before = '';
|
|
88
88
|
let after = '';
|
|
89
|
+
kvStoreName = kvStoreName.includes(".") ? `"${kvStoreName}"` : kvStoreName;
|
|
89
90
|
const tableMarker = `[[local_server.kv_stores.${kvStoreName}]]`;
|
|
90
91
|
const startPos = fastlyToml.indexOf(tableMarker);
|
|
91
92
|
if (startPos === -1) {
|
|
92
93
|
// KV Store decl not in fastly.toml yet
|
|
93
94
|
if (fastlyToml.indexOf(kvStoreName) !== -1) {
|
|
94
95
|
// don't do this!
|
|
95
|
-
console.error("
|
|
96
|
+
console.error("improperly configured entry for '${kvStoreName}' in fastly.toml");
|
|
97
|
+
// TODO: handle thrown exception from callers
|
|
96
98
|
throw "No";
|
|
97
99
|
}
|
|
98
100
|
let newLines;
|
|
@@ -202,7 +204,9 @@ export async function buildStaticLoader(commandLineValues) {
|
|
|
202
204
|
}
|
|
203
205
|
// And then we apply assetInclusionTest.
|
|
204
206
|
const assetInfos = files.map(file => {
|
|
205
|
-
const assetKey = file.slice(publicDirRoot.length)
|
|
207
|
+
const assetKey = file.slice(publicDirRoot.length)
|
|
208
|
+
// in Windows, assetKey will otherwise end up as \path\file.html
|
|
209
|
+
.replace(/\\/g, '/');
|
|
206
210
|
let contentTypeTestResult = testFileContentType(finalContentTypes, assetKey);
|
|
207
211
|
if (contentTypeTestResult == null) {
|
|
208
212
|
contentTypeTestResult = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-config.d.ts","sourceRoot":"","sources":["../../src/cli/load-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"load-config.d.ts","sourceRoot":"","sources":["../../src/cli/load-config.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,+BAA+B,EAEhC,MAAM,+BAA+B,CAAC;AA6WvC,wBAAsB,cAAc,CAAC,MAAM,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC;IAAC,UAAU,EAAE,+BAA+B,GAAG,IAAI,CAAC;IAAC,GAAG,EAAE,GAAG,CAAA;CAAC,CAAC,CAkBnI"}
|
package/build/cli/load-config.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import url from "url";
|
|
1
2
|
import path from "path";
|
|
2
3
|
import globToRegExp from 'glob-to-regexp';
|
|
3
4
|
import { buildNormalizeFunctionForArray, buildNormalizeFunctionForObject, isSpecified, isStringAndNotEmpty, } from "./util/data.js";
|
|
@@ -366,11 +367,12 @@ const normalizeConfig = buildNormalizeFunctionForObject((config, errors) => {
|
|
|
366
367
|
export async function loadConfigFile(errors = []) {
|
|
367
368
|
let raw = undefined;
|
|
368
369
|
const staticPublishRcPath = path.resolve('./static-publish.rc.js');
|
|
370
|
+
const staticPublishRcFileURL = String(url.pathToFileURL(staticPublishRcPath));
|
|
369
371
|
try {
|
|
370
|
-
raw = (await import(
|
|
372
|
+
raw = (await import(staticPublishRcFileURL)).default;
|
|
371
373
|
}
|
|
372
374
|
catch {
|
|
373
|
-
errors.push('Unable to load ' +
|
|
375
|
+
errors.push('Unable to load ' + staticPublishRcFileURL);
|
|
374
376
|
}
|
|
375
377
|
let normalized = undefined;
|
|
376
378
|
if (raw != null) {
|
package/package.json
CHANGED