@fastly/compute-js-static-publish 7.0.2 → 7.0.4
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 +8 -0
- package/README.short.md +8 -0
- package/build/cli/util/config.d.ts.map +1 -1
- package/build/cli/util/config.js +19 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -59,3 +59,11 @@ npm run fastly:publish # upload your static files
|
|
|
59
59
|
|
|
60
60
|
📘 Full documentation available on GitHub:
|
|
61
61
|
[https://github.com/fastly/compute-js-static-publish](https://github.com/fastly/compute-js-static-publish)
|
|
62
|
+
|
|
63
|
+
### Security issues
|
|
64
|
+
|
|
65
|
+
Please see our [SECURITY.md](SECURITY.md) for guidance on reporting security-related issues.
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
[MIT](./LICENSE).
|
package/README.short.md
CHANGED
|
@@ -59,3 +59,11 @@ npm run fastly:publish # upload your static files
|
|
|
59
59
|
|
|
60
60
|
📘 Full documentation available on GitHub:
|
|
61
61
|
[https://github.com/fastly/compute-js-static-publish](https://github.com/fastly/compute-js-static-publish)
|
|
62
|
+
|
|
63
|
+
### Security issues
|
|
64
|
+
|
|
65
|
+
Please see our [SECURITY.md](SECURITY.md) for guidance on reporting security-related issues.
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
[MIT](./LICENSE).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/cli/util/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/cli/util/config.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,8BAA8B,EAEpC,MAAM,+CAA+C,CAAC;AAOvD,OAAO,EAAE,KAAK,+BAA+B,EAAE,MAAM,gDAAgD,CAAC;AACtG,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAEhF,qBAAa,eAAgB,SAAQ,KAAK;IACxC,MAAM,EAAE,MAAM,EAAE,CAAC;gBAEL,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;CAIrD;AAED,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,eAAe,CAAC,CA+B1E;AAGD,eAAO,MAAM,0BAA0B,6DA+DrC,CAAC;AAEH,wBAAsB,4BAA4B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,8BAA8B,CAAC,CA6B9G;AA4CD,eAAO,MAAM,6BAA6B,4EAmJxC,CAAC;AAEH,eAAO,MAAM,8BAA8B,6EAkIzC,CAAC"}
|
package/build/cli/util/config.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT license. See LICENSE file for details.
|
|
4
4
|
*/
|
|
5
5
|
import path from 'node:path';
|
|
6
|
+
import { pathToFileURL } from 'node:url';
|
|
6
7
|
import globToRegExp from 'glob-to-regexp';
|
|
7
8
|
import { buildNormalizeFunctionForArray, buildNormalizeFunctionForObject, isSpecified, isStringAndNotEmpty, } from './data.js';
|
|
8
9
|
export class LoadConfigError extends Error {
|
|
@@ -14,16 +15,20 @@ export class LoadConfigError extends Error {
|
|
|
14
15
|
export async function loadStaticPublisherRcFile() {
|
|
15
16
|
let configRaw;
|
|
16
17
|
const configFile = './static-publish.rc.js';
|
|
18
|
+
const configFilePath = path.resolve(configFile);
|
|
17
19
|
try {
|
|
18
|
-
|
|
19
|
-
configRaw = (await import(filePath)).default;
|
|
20
|
+
configRaw = (await import(pathToFileURL(configFilePath).href)).default;
|
|
20
21
|
}
|
|
21
|
-
catch {
|
|
22
|
-
|
|
22
|
+
catch (ex) {
|
|
23
|
+
throw new LoadConfigError(configFile, [
|
|
24
|
+
`Unable to load ${configFilePath}`,
|
|
25
|
+
String(ex),
|
|
26
|
+
]);
|
|
23
27
|
}
|
|
24
28
|
if (configRaw == null) {
|
|
25
29
|
throw new LoadConfigError(configFile, [
|
|
26
|
-
|
|
30
|
+
`Unable to load ${configFilePath}`,
|
|
31
|
+
`default export does not exist or is null.`
|
|
27
32
|
]);
|
|
28
33
|
}
|
|
29
34
|
const errors = [];
|
|
@@ -93,16 +98,20 @@ export const normalizeStaticPublisherRc = buildNormalizeFunctionForObject((confi
|
|
|
93
98
|
});
|
|
94
99
|
export async function loadPublishContentConfigFile(configFile) {
|
|
95
100
|
let configRaw;
|
|
101
|
+
const configFilePath = path.resolve(configFile);
|
|
96
102
|
try {
|
|
97
|
-
|
|
98
|
-
configRaw = (await import(filePath)).default;
|
|
103
|
+
configRaw = (await import(pathToFileURL(configFilePath).href)).default;
|
|
99
104
|
}
|
|
100
|
-
catch {
|
|
101
|
-
|
|
105
|
+
catch (ex) {
|
|
106
|
+
throw new LoadConfigError(configFile, [
|
|
107
|
+
`Unable to load ${configFilePath}`,
|
|
108
|
+
String(ex),
|
|
109
|
+
]);
|
|
102
110
|
}
|
|
103
111
|
if (configRaw == null) {
|
|
104
112
|
throw new LoadConfigError(configFile, [
|
|
105
|
-
|
|
113
|
+
`Unable to load ${configFilePath}`,
|
|
114
|
+
`default export does not exist or is null.`
|
|
106
115
|
]);
|
|
107
116
|
}
|
|
108
117
|
const errors = [];
|