@netlify/edge-bundler 14.5.3 → 14.5.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/deno/config.ts +16 -2
- package/dist/node/formats/tarball.js +10 -4
- package/package.json +2 -2
package/deno/config.ts
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
import { Netlify } from "https://64e8753eae24930008fac6d9--edge.netlify.app/bootstrap/index-combined.ts"
|
|
1
|
+
import { type NetlifyGlobal } from 'https://edge.netlify.com/bootstrap/globals/types.ts'
|
|
3
2
|
|
|
4
3
|
const [functionURL, collectorURL, rawExitCodes] = Deno.args
|
|
5
4
|
const exitCodes = JSON.parse(rawExitCodes)
|
|
6
5
|
|
|
6
|
+
const env = {
|
|
7
|
+
delete: Deno.env.delete,
|
|
8
|
+
get: Deno.env.get,
|
|
9
|
+
has: Deno.env.has,
|
|
10
|
+
set: Deno.env.set,
|
|
11
|
+
toObject: Deno.env.toObject,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const Netlify: NetlifyGlobal = {
|
|
15
|
+
get context() {
|
|
16
|
+
return null;
|
|
17
|
+
},
|
|
18
|
+
env,
|
|
19
|
+
};
|
|
20
|
+
|
|
7
21
|
globalThis.Netlify = Netlify
|
|
8
22
|
|
|
9
23
|
let func
|
|
@@ -57,17 +57,23 @@ export const bundle = async ({ basePath, buildID, deno, distDirectory, functions
|
|
|
57
57
|
await fs.writeFile(denoConfigPath, denoConfigContents);
|
|
58
58
|
const tarballPath = path.join(distDirectory, buildID + TARBALL_EXTENSION);
|
|
59
59
|
await fs.mkdir(path.dirname(tarballPath), { recursive: true });
|
|
60
|
+
// List files to include in the tarball as paths relative to the bundle dir.
|
|
61
|
+
// Using absolute paths here leads to platform-specific quirks (notably on Windows),
|
|
62
|
+
// where entries can include drive letters and break extraction/imports.
|
|
63
|
+
const files = (await listRecursively(bundleDir.path))
|
|
64
|
+
.map((p) => path.relative(bundleDir.path, p))
|
|
65
|
+
.map((p) => getUnixPath(p))
|
|
66
|
+
.sort();
|
|
60
67
|
await tar.create({
|
|
61
68
|
cwd: bundleDir.path,
|
|
62
69
|
file: tarballPath,
|
|
63
70
|
gzip: true,
|
|
64
71
|
noDirRecurse: true,
|
|
72
|
+
// Ensure forward slashes inside the tarball for cross-platform consistency.
|
|
65
73
|
onWriteEntry(entry) {
|
|
66
|
-
|
|
67
|
-
const normalizedPath = getUnixPath(relativePath);
|
|
68
|
-
entry.path = normalizedPath;
|
|
74
|
+
entry.path = getUnixPath(entry.path);
|
|
69
75
|
},
|
|
70
|
-
},
|
|
76
|
+
}, files);
|
|
71
77
|
const hash = await getFileHash(tarballPath);
|
|
72
78
|
await Promise.allSettled(cleanup);
|
|
73
79
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/edge-bundler",
|
|
3
|
-
"version": "14.5.
|
|
3
|
+
"version": "14.5.4",
|
|
4
4
|
"description": "Intelligently prepare Netlify Edge Functions for deployment",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/node/index.js",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"urlpattern-polyfill": "8.0.2",
|
|
81
81
|
"uuid": "^11.0.0"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "d86f532b5b54d0f622c2010d1e314dc4da8a735d"
|
|
84
84
|
}
|