@netlify/edge-bundler
Advanced tools
Comparing version 1.5.0 to 1.6.0
@@ -1,6 +0,6 @@ | ||
import { writeStage2 } from 'https://62bae4994570970008142f1e--edge-bootstrap.netlify.app/bundler/mod.ts' | ||
import { writeStage2 } from 'https://62d144a15553b50009af7ac6--edge.netlify.com/bundler/mod.ts' | ||
const [payload] = Deno.args | ||
const { basePath, destPath, functions } = JSON.parse(payload) | ||
const { basePath, destPath, functions, imports } = JSON.parse(payload) | ||
await writeStage2({ basePath, functions, destPath }) | ||
await writeStage2({ basePath, destPath, functions, imports }) |
@@ -34,2 +34,3 @@ import { ExecaChildProcess } from 'execa'; | ||
private writeVersionFile; | ||
ensureCacheDirectory(): Promise<void>; | ||
getBinaryPath(): Promise<{ | ||
@@ -36,0 +37,0 @@ global: boolean; |
@@ -24,3 +24,3 @@ import { promises as fs } from 'fs'; | ||
await ((_a = this.onBeforeDownload) === null || _a === void 0 ? void 0 : _a.call(this)); | ||
await fs.mkdir(this.cacheDirectory, { recursive: true }); | ||
await this.ensureCacheDirectory(); | ||
this.log(`Downloading Deno CLI to ${this.cacheDirectory}...`); | ||
@@ -96,5 +96,9 @@ const binaryPath = await download(this.cacheDirectory, this.versionRange); | ||
async writeVersionFile(version) { | ||
await this.ensureCacheDirectory(); | ||
const versionFilePath = path.join(this.cacheDirectory, DENO_VERSION_FILE); | ||
await fs.writeFile(versionFilePath, version); | ||
} | ||
async ensureCacheDirectory() { | ||
await fs.mkdir(this.cacheDirectory, { recursive: true }); | ||
} | ||
async getBinaryPath() { | ||
@@ -101,0 +105,0 @@ const globalPath = await this.getGlobalBinary(); |
@@ -23,2 +23,3 @@ import { promises as fs } from 'fs'; | ||
functions, | ||
importMap, | ||
})); | ||
@@ -25,0 +26,0 @@ } |
import { DenoBridge } from '../bridge.js'; | ||
import type { Bundle } from '../bundle.js'; | ||
import { EdgeFunction } from '../edge_function.js'; | ||
import { ImportMap } from '../import_map.js'; | ||
interface BundleESZIPOptions { | ||
@@ -11,4 +12,5 @@ basePath: string; | ||
functions: EdgeFunction[]; | ||
importMap: ImportMap; | ||
} | ||
declare const bundleESZIP: ({ basePath, buildID, debug, deno, distDirectory, functions, }: BundleESZIPOptions) => Promise<Bundle>; | ||
declare const bundleESZIP: ({ basePath, buildID, debug, deno, distDirectory, functions, importMap, }: BundleESZIPOptions) => Promise<Bundle>; | ||
export { bundleESZIP as bundle }; |
@@ -5,3 +5,3 @@ import { join, resolve } from 'path'; | ||
import { getFileHash } from '../utils/sha256.js'; | ||
const bundleESZIP = async ({ basePath, buildID, debug, deno, distDirectory, functions, }) => { | ||
const bundleESZIP = async ({ basePath, buildID, debug, deno, distDirectory, functions, importMap, }) => { | ||
const extension = '.eszip'; | ||
@@ -14,2 +14,3 @@ const destPath = join(distDirectory, `${buildID}${extension}`); | ||
functions, | ||
imports: importMap.imports, | ||
}; | ||
@@ -16,0 +17,0 @@ const flags = ['--allow-all']; |
@@ -8,3 +8,3 @@ import { promises as fs } from 'fs'; | ||
import { getFileHash } from '../utils/sha256.js'; | ||
const BOOTSTRAP_LATEST = 'https://62bae4994570970008142f1e--edge-bootstrap.netlify.app/bootstrap/index-combined.ts'; | ||
const BOOTSTRAP_LATEST = 'https://62d144a15553b50009af7ac6--edge.netlify.com/bootstrap/index-combined.ts'; | ||
const bundleJS = async ({ buildID, debug, deno, distDirectory, functions, importMap, }) => { | ||
@@ -11,0 +11,0 @@ const stage2Path = await generateStage2({ distDirectory, functions, fileName: `${buildID}-pre.js` }); |
@@ -5,3 +5,3 @@ import { Buffer } from 'buffer'; | ||
const INTERNAL_IMPORTS = { | ||
'netlify:edge': 'https://edge-bootstrap.netlify.app/v1/index.ts', | ||
'netlify:edge': 'https://edge.netlify.com/v1/index.ts', | ||
}; | ||
@@ -8,0 +8,0 @@ class ImportMap { |
@@ -54,2 +54,3 @@ import { promises as fs } from 'fs'; | ||
const writeVersionFile = async (deno, version) => { | ||
await deno.ensureCacheDirectory(); | ||
const versionFilePath = join(deno.cacheDirectory, 'types-version.txt'); | ||
@@ -56,0 +57,0 @@ await fs.writeFile(versionFilePath, version); |
{ | ||
"name": "@netlify/edge-bundler", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"description": "Intelligently prepare Netlify Edge Functions for deployment", | ||
@@ -5,0 +5,0 @@ "type": "module", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47168
1089