@fastly/compute-js-static-publish 6.0.0-beta.0 → 6.0.0-beta.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":"init-app.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAiQvD,wBAAgB,OAAO,CAAC,iBAAiB,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"init-app.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAiQvD,wBAAgB,OAAO,CAAC,iBAAiB,EAAE,kBAAkB,QA0c5D"}
|
|
@@ -330,19 +330,16 @@ export function initApp(commandLineValues) {
|
|
|
330
330
|
// Static Content Root Dir must be under the current dir
|
|
331
331
|
let staticContentRootDir = options.staticContentRootDir;
|
|
332
332
|
if (staticContentRootDir == null) {
|
|
333
|
-
staticContentRootDir = path.resolve('./static-publisher');
|
|
333
|
+
staticContentRootDir = path.resolve(computeJsDir, './static-publisher');
|
|
334
334
|
}
|
|
335
335
|
if (staticContentRootDir.includes('//') ||
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
console.error(
|
|
336
|
+
staticContentRootDir === computeJsDir ||
|
|
337
|
+
!staticContentRootDir.startsWith(computeJsDir)) {
|
|
338
|
+
console.error(`❌ Specified static content root directory '${staticContentRootDir}' must be under ${computeJsDir}`);
|
|
339
339
|
process.exitCode = 1;
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
|
-
|
|
343
|
-
staticContentRootDir = staticContentRootDir.slice(0, -1);
|
|
344
|
-
}
|
|
345
|
-
staticContentRootDir = path.relative(process.cwd(), staticContentRootDir);
|
|
342
|
+
staticContentRootDir = './' + path.relative(computeJsDir, staticContentRootDir);
|
|
346
343
|
// SPA and Not Found are relative to the asset root dir.
|
|
347
344
|
const SPA = options.spa;
|
|
348
345
|
let spaFilename;
|
package/build/cli/index.js
CHANGED
|
@@ -25,13 +25,13 @@ const optionDefinitions = [
|
|
|
25
25
|
// then the value of 'public-dir' is used.
|
|
26
26
|
{ name: 'root-dir', type: String, },
|
|
27
27
|
// The 'public' directory. The Publisher Server will
|
|
28
|
-
// resolve requests relative to this directory.
|
|
29
|
-
//
|
|
28
|
+
// resolve requests relative to this directory. If not specified,
|
|
29
|
+
// defaults to the same value as 'root-dir'. See README for
|
|
30
|
+
// details.
|
|
30
31
|
{ name: 'public-dir', type: String, },
|
|
31
32
|
// Directories to specify as containing 'static' files. The
|
|
32
33
|
// Publisher Server will serve files from these directories
|
|
33
|
-
// with a long TTL.
|
|
34
|
-
// from 'public-dir'.
|
|
34
|
+
// with a long TTL.
|
|
35
35
|
{ name: 'static-dir', type: String, multiple: true, },
|
|
36
36
|
// The 'static content root directory' where the Static Publisher
|
|
37
37
|
// outputs its metadata files and loaders.
|
|
@@ -39,16 +39,14 @@ const optionDefinitions = [
|
|
|
39
39
|
// Path to a file to be used to serve in a SPA application.
|
|
40
40
|
// The Publisher Server will serve this file with a 200 status code
|
|
41
41
|
// when the request doesn't match a known file, and the accept
|
|
42
|
-
// header includes text/html.
|
|
43
|
-
//
|
|
44
|
-
// to specify this as a relative path from the 'public-dir'.
|
|
42
|
+
// header includes text/html. You may use the '[public-dir]' token
|
|
43
|
+
// if you wish to specify this as a relative path from the 'public-dir'.
|
|
45
44
|
{ name: 'spa', type: String, },
|
|
46
45
|
// Path to a file to be used to serve as a 404 not found page.
|
|
47
46
|
// The Publisher Server will serve this file with a 404 status code
|
|
48
47
|
// when the request doesn't match a known file, and the accept
|
|
49
|
-
// header includes text/html.
|
|
50
|
-
//
|
|
51
|
-
// to specify this as a relative path from the 'public-dir'.
|
|
48
|
+
// header includes text/html. You may use the '[public-dir]' token
|
|
49
|
+
// if you wish to specify this as a relative path from the 'public-dir'.
|
|
52
50
|
{ name: 'not-found-page', type: String, },
|
|
53
51
|
// List of files to automatically use as index, for example, index.html,index.htm
|
|
54
52
|
// If a request comes in but the route does not exist, we check the route
|
package/package.json
CHANGED