@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 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":"AASA,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,CA2B1E;AAGD,eAAO,MAAM,0BAA0B,6DA+DrC,CAAC;AAEH,wBAAsB,4BAA4B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAyB9G;AA4CD,eAAO,MAAM,6BAA6B,4EAmJxC,CAAC;AAEH,eAAO,MAAM,8BAA8B,6EAkIzC,CAAC"}
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"}
@@ -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
- const filePath = path.resolve(configFile);
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
- 'Unable to load ' + configFile,
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
- const filePath = path.resolve(configFile);
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
- 'Unable to load ' + configFile,
113
+ `Unable to load ${configFilePath}`,
114
+ `default export does not exist or is null.`
106
115
  ]);
107
116
  }
108
117
  const errors = [];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fastly/compute-js-static-publish",
3
3
  "type": "module",
4
- "version": "7.0.2",
4
+ "version": "7.0.4",
5
5
  "description": "Static Publisher for Fastly Compute JavaScript",
6
6
  "main": "build/index.js",
7
7
  "exports": {