@netlify/edge-bundler
Advanced tools
Comparing version 4.3.2 to 4.4.0
@@ -5,4 +5,4 @@ /// <reference types="node" /> | ||
declare const DENO_VERSION_RANGE = "^1.22.0"; | ||
declare type OnBeforeDownloadHook = () => void | Promise<void>; | ||
declare type OnAfterDownloadHook = (error?: Error) => void | Promise<void>; | ||
type OnBeforeDownloadHook = () => void | Promise<void>; | ||
type OnAfterDownloadHook = (error?: Error) => void | Promise<void>; | ||
interface DenoOptions { | ||
@@ -9,0 +9,0 @@ cacheDirectory?: string; |
@@ -1,6 +0,9 @@ | ||
interface Bundle { | ||
export declare enum BundleFormat { | ||
ESZIP2 = "eszip2", | ||
JS = "js" | ||
} | ||
export interface Bundle { | ||
extension: string; | ||
format: string; | ||
format: BundleFormat; | ||
hash: string; | ||
} | ||
export type { Bundle }; |
@@ -1,1 +0,5 @@ | ||
export {}; | ||
export var BundleFormat; | ||
(function (BundleFormat) { | ||
BundleFormat["ESZIP2"] = "eszip2"; | ||
BundleFormat["JS"] = "js"; | ||
})(BundleFormat || (BundleFormat = {})); |
@@ -7,10 +7,10 @@ import { FunctionConfig } from './config.js'; | ||
} | ||
declare type DeclarationWithPath = BaseDeclaration & { | ||
type DeclarationWithPath = BaseDeclaration & { | ||
path: string; | ||
}; | ||
declare type DeclarationWithPattern = BaseDeclaration & { | ||
type DeclarationWithPattern = BaseDeclaration & { | ||
pattern: string; | ||
}; | ||
declare type Declaration = DeclarationWithPath | DeclarationWithPattern; | ||
type Declaration = DeclarationWithPath | DeclarationWithPattern; | ||
export declare const getDeclarationsFromConfig: (tomlDeclarations: Declaration[], functionsConfig: Record<string, FunctionConfig>) => Declaration[]; | ||
export { Declaration, DeclarationWithPath, DeclarationWithPattern }; |
declare const defaultFlags: Record<string, boolean>; | ||
declare type FeatureFlag = keyof typeof defaultFlags; | ||
declare type FeatureFlags = Record<FeatureFlag, boolean>; | ||
type FeatureFlag = keyof typeof defaultFlags; | ||
type FeatureFlags = Record<FeatureFlag, boolean>; | ||
declare const getFlags: (input?: Record<string, boolean>, flags?: Record<string, boolean>) => FeatureFlags; | ||
export { defaultFlags, getFlags }; | ||
export type { FeatureFlag, FeatureFlags }; |
import { DenoBridge } from '../bridge.js'; | ||
import type { Bundle } from '../bundle.js'; | ||
import { Bundle } from '../bundle.js'; | ||
import { EdgeFunction } from '../edge_function.js'; | ||
@@ -4,0 +4,0 @@ import { FeatureFlags } from '../feature_flags.js'; |
import { join } from 'path'; | ||
import { BundleFormat } from '../bundle.js'; | ||
import { wrapBundleError } from '../bundle_error.js'; | ||
@@ -30,3 +31,3 @@ import { wrapNpmImportError } from '../npm_import_error.js'; | ||
const hash = await getFileHash(destPath); | ||
return { extension, format: 'eszip2', hash }; | ||
return { extension, format: BundleFormat.ESZIP2, hash }; | ||
}; | ||
@@ -33,0 +34,0 @@ const getESZIPPaths = () => { |
import { DenoBridge } from '../bridge.js'; | ||
import type { Bundle } from '../bundle.js'; | ||
import { Bundle } from '../bundle.js'; | ||
import { EdgeFunction } from '../edge_function.js'; | ||
@@ -4,0 +4,0 @@ import { ImportMap } from '../import_map.js'; |
@@ -6,2 +6,3 @@ import { promises as fs } from 'fs'; | ||
import { deleteAsync } from 'del'; | ||
import { BundleFormat } from '../bundle.js'; | ||
import { wrapBundleError } from '../bundle_error.js'; | ||
@@ -27,3 +28,3 @@ import { wrapNpmImportError } from '../npm_import_error.js'; | ||
const hash = await getFileHash(jsBundlePath); | ||
return { extension, format: 'js', hash }; | ||
return { extension, format: BundleFormat.JS, hash }; | ||
}; | ||
@@ -30,0 +31,0 @@ const defaultFormatExportTypeError = (name) => `The Edge Function "${name}" has failed to load. Does it have a function as the default export?`; |
@@ -6,1 +6,2 @@ export { bundle } from './bundler.js'; | ||
export { serve } from './server/server.js'; | ||
export { validateManifest, ManifestValidationError } from './validation/manifest/index.js'; |
@@ -6,1 +6,2 @@ export { bundle } from './bundler.js'; | ||
export { serve } from './server/server.js'; | ||
export { validateManifest, ManifestValidationError } from './validation/manifest/index.js'; |
@@ -1,2 +0,2 @@ | ||
declare type LogFunction = (...args: unknown[]) => void; | ||
type LogFunction = (...args: unknown[]) => void; | ||
interface Logger { | ||
@@ -3,0 +3,0 @@ system: LogFunction; |
import { env } from 'process'; | ||
import { test, expect } from 'vitest'; | ||
import { BundleFormat } from './bundle.js'; | ||
import { generateManifest } from './manifest.js'; | ||
@@ -7,3 +8,3 @@ test('Generates a manifest with different bundles', () => { | ||
extension: '.ext1', | ||
format: 'format1', | ||
format: BundleFormat.ESZIP2, | ||
hash: '123456', | ||
@@ -13,3 +14,3 @@ }; | ||
extension: '.ext2', | ||
format: 'format2', | ||
format: BundleFormat.ESZIP2, | ||
hash: '654321', | ||
@@ -49,3 +50,3 @@ }; | ||
extension: '.ext2', | ||
format: 'format1', | ||
format: BundleFormat.ESZIP2, | ||
hash: '123456', | ||
@@ -65,3 +66,3 @@ }; | ||
extension: '.ext2', | ||
format: 'format1', | ||
format: BundleFormat.ESZIP2, | ||
hash: '123456', | ||
@@ -90,3 +91,3 @@ }; | ||
extension: '.ext1', | ||
format: 'format1', | ||
format: BundleFormat.ESZIP2, | ||
hash: '123456', | ||
@@ -96,3 +97,3 @@ }; | ||
extension: '.ext2', | ||
format: 'format2', | ||
format: BundleFormat.ESZIP2, | ||
hash: '654321', | ||
@@ -99,0 +100,0 @@ }; |
@@ -11,3 +11,3 @@ /// <reference types="node" /> | ||
import { LogFunction } from '../logger.js'; | ||
declare type FormatFunction = (name: string) => string; | ||
type FormatFunction = (name: string) => string; | ||
interface StartServerOptions { | ||
@@ -14,0 +14,0 @@ getFunctionsConfig?: boolean; |
{ | ||
"name": "@netlify/edge-bundler", | ||
"version": "4.3.2", | ||
"version": "4.4.0", | ||
"description": "Intelligently prepare Netlify Edge Functions for deployment", | ||
@@ -31,5 +31,5 @@ "type": "module", | ||
"test:ci": "run-s test:ci:*", | ||
"test:dev:vitest": "vitest run", | ||
"test:dev:vitest": "cross-env FORCE_COLOR=0 vitest run", | ||
"test:dev:deno": "deno test --allow-all deno", | ||
"test:ci:vitest": "vitest run", | ||
"test:ci:vitest": "cross-env FORCE_COLOR=0 vitest run", | ||
"test:ci:deno": "deno test --allow-all deno", | ||
@@ -63,2 +63,3 @@ "test:integration": "node --experimental-modules test/integration/test.js" | ||
"archiver": "^5.3.1", | ||
"cross-env": "^7.0.3", | ||
"husky": "^8.0.0", | ||
@@ -76,2 +77,5 @@ "nock": "^13.2.4", | ||
"@import-maps/resolve": "^1.0.1", | ||
"ajv": "^8.11.2", | ||
"ajv-errors": "^3.0.0", | ||
"better-ajv-errors": "^1.2.0", | ||
"common-path-prefix": "^3.0.0", | ||
@@ -78,0 +82,0 @@ "del": "^7.0.0", |
3014863
141
6679
19
17
+ Addedajv@^8.11.2
+ Addedajv-errors@^3.0.0
+ Addedbetter-ajv-errors@^1.2.0
+ Added@babel/code-frame@7.26.2(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@humanwhocodes/momoa@2.0.4(transitive)
+ Addedajv@8.17.1(transitive)
+ Addedajv-errors@3.0.0(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedbetter-ajv-errors@1.2.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-uri@3.0.6(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedjson-schema-traverse@1.0.0(transitive)
+ Addedjsonpointer@5.0.1(transitive)
+ Addedleven@3.1.0(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedrequire-from-string@2.0.2(transitive)
+ Addedsupports-color@7.2.0(transitive)