@netlify/edge-bundler 1.4.1 → 1.4.2
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/deno/bundle.ts +1 -1
- package/dist/bridge.js +3 -3
- package/dist/formats/javascript.js +1 -1
- package/dist/import_map.js +4 -4
- package/package.json +1 -1
package/deno/bundle.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { writeStage2 } from 'https://
|
|
1
|
+
import { writeStage2 } from 'https://62bae4994570970008142f1e--edge-bootstrap.netlify.app/bundler/mod.ts'
|
|
2
2
|
|
|
3
3
|
const [payload] = Deno.args
|
|
4
4
|
const { basePath, destPath, functions } = JSON.parse(payload)
|
package/dist/bridge.js
CHANGED
|
@@ -20,7 +20,7 @@ class DenoBridge {
|
|
|
20
20
|
}
|
|
21
21
|
async downloadBinary() {
|
|
22
22
|
var _a, _b, _c;
|
|
23
|
-
(_a = this.onBeforeDownload) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
23
|
+
await ((_a = this.onBeforeDownload) === null || _a === void 0 ? void 0 : _a.call(this));
|
|
24
24
|
await fs.mkdir(this.cacheDirectory, { recursive: true });
|
|
25
25
|
this.log(`Downloading Deno CLI to ${this.cacheDirectory}...`);
|
|
26
26
|
const binaryPath = await download(this.cacheDirectory, this.versionRange);
|
|
@@ -30,11 +30,11 @@ class DenoBridge {
|
|
|
30
30
|
// that the tests catch it.
|
|
31
31
|
if (downloadedVersion === undefined) {
|
|
32
32
|
const error = new Error('There was a problem setting up the Edge Functions environment. To try a manual installation, visit https://ntl.fyi/install-deno.');
|
|
33
|
-
(_b = this.onAfterDownload) === null || _b === void 0 ? void 0 : _b.call(this, error);
|
|
33
|
+
await ((_b = this.onAfterDownload) === null || _b === void 0 ? void 0 : _b.call(this, error));
|
|
34
34
|
throw error;
|
|
35
35
|
}
|
|
36
36
|
await this.writeVersionFile(downloadedVersion);
|
|
37
|
-
(_c = this.onAfterDownload) === null || _c === void 0 ? void 0 : _c.call(this);
|
|
37
|
+
await ((_c = this.onAfterDownload) === null || _c === void 0 ? void 0 : _c.call(this));
|
|
38
38
|
return binaryPath;
|
|
39
39
|
}
|
|
40
40
|
static async getBinaryVersion(binaryPath) {
|
|
@@ -5,7 +5,7 @@ import { pathToFileURL } from 'url';
|
|
|
5
5
|
import del from 'del';
|
|
6
6
|
import { wrapBundleError } from '../bundle_error.js';
|
|
7
7
|
import { getFileHash } from '../utils/sha256.js';
|
|
8
|
-
const BOOTSTRAP_LATEST = 'https://
|
|
8
|
+
const BOOTSTRAP_LATEST = 'https://62bae4994570970008142f1e--edge-bootstrap.netlify.app/bootstrap/index-combined.ts';
|
|
9
9
|
const bundle = async (options) => {
|
|
10
10
|
try {
|
|
11
11
|
return await bundleJS(options);
|
package/dist/import_map.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Buffer } from 'buffer';
|
|
2
2
|
import { promises as fs } from 'fs';
|
|
3
3
|
import { dirname } from 'path';
|
|
4
|
-
const
|
|
4
|
+
const INTERNAL_IMPORTS = {
|
|
5
5
|
'netlify:edge': 'https://edge-bootstrap.netlify.app/v1/index.ts',
|
|
6
6
|
};
|
|
7
7
|
class ImportMap {
|
|
8
8
|
constructor(input = []) {
|
|
9
9
|
const inputImports = input.reduce((acc, { imports }) => ({ ...acc, ...imports }), {});
|
|
10
|
-
// `
|
|
11
|
-
//
|
|
12
|
-
this.imports = { ...inputImports, ...
|
|
10
|
+
// `INTERNAL_IMPORTS` must come last,
|
|
11
|
+
// because we need to guarantee `netlify:edge` isn't user-defined.
|
|
12
|
+
this.imports = { ...inputImports, ...INTERNAL_IMPORTS };
|
|
13
13
|
}
|
|
14
14
|
getContents() {
|
|
15
15
|
const contents = {
|