diff --git a/.eslintrc.cjs b/.eslintrc.cjs index be638ea3..6a880679 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -4,7 +4,7 @@ const { overrides } = require('@netlify/eslint-config-node') module.exports = { extends: '@netlify/eslint-config-node', - ignorePatterns: ['deno/**/*', 'test/deno/**/*', 'test/fixtures/**/*'], + ignorePatterns: ['deno/**/*', 'node/vendor/**', 'test/deno/**/*', 'test/fixtures/**/*'], parserOptions: { sourceType: 'module', }, diff --git a/node/index.ts b/node/index.ts index 8dfdc373..88babb3c 100644 --- a/node/index.ts +++ b/node/index.ts @@ -6,5 +6,6 @@ export type { EdgeFunction } from './edge_function.js' export { findFunctions as find } from './finder.js' export { generateManifest } from './manifest.js' export type { EdgeFunctionConfig, Manifest } from './manifest.js' -export { ModuleGraph, serve } from './server/server.js' +export type { ModuleGraphJson as ModuleGraph } from './vendor/module_graph/module_graph.js' +export { serve } from './server/server.js' export { validateManifest, ManifestValidationError } from './validation/manifest/index.js' diff --git a/node/server/server.ts b/node/server/server.ts index 6998a625..090cc013 100644 --- a/node/server/server.ts +++ b/node/server/server.ts @@ -1,7 +1,6 @@ import { readdir, unlink } from 'fs/promises' import { join } from 'path' -import type { ModuleGraphJson } from '../../deno/vendor/deno.land/x/deno_graph@0.59.2/types.d.js' import { DenoBridge, OnAfterDownloadHook, OnBeforeDownloadHook, ProcessRef } from '../bridge.js' import { getFunctionConfig, FunctionConfig } from '../config.js' import type { EdgeFunction } from '../edge_function.js' @@ -11,11 +10,11 @@ import { ImportMap } from '../import_map.js' import { getLogger, LogFunction, Logger } from '../logger.js' import { vendorNPMSpecifiers } from '../npm_dependencies.js' import { ensureLatestTypes } from '../types.js' +import type { ModuleGraphJson } from '../vendor/module_graph/module_graph.js' import { killProcess, waitForServer } from './util.js' export type FormatFunction = (name: string) => string -export type ModuleGraph = ModuleGraphJson interface PrepareServerOptions { basePath: string @@ -73,7 +72,7 @@ const prepareServer = ({ await killProcess(processRef.ps) } - let graph: ModuleGraph = { + let graph: ModuleGraphJson = { roots: [], modules: [], redirects: {}, diff --git a/deno/vendor/deno.land/x/deno_graph@0.59.2/media_type.ts b/node/vendor/module_graph/media_type.ts similarity index 99% rename from deno/vendor/deno.land/x/deno_graph@0.59.2/media_type.ts rename to node/vendor/module_graph/media_type.ts index 2789280d..d0b48279 100644 --- a/deno/vendor/deno.land/x/deno_graph@0.59.2/media_type.ts +++ b/node/vendor/module_graph/media_type.ts @@ -17,4 +17,4 @@ export enum MediaType { TsBuildInfo = "TsBuildInfo", SourceMap = "SourceMap", Unknown = "Unknown", -} +} \ No newline at end of file diff --git a/deno/vendor/deno.land/x/deno_graph@0.59.2/types.d.ts b/node/vendor/module_graph/module_graph.ts similarity index 99% rename from deno/vendor/deno.land/x/deno_graph@0.59.2/types.d.ts rename to node/vendor/module_graph/module_graph.ts index ab62ac52..27b531c2 100644 --- a/deno/vendor/deno.land/x/deno_graph@0.59.2/types.d.ts +++ b/node/vendor/module_graph/module_graph.ts @@ -179,4 +179,4 @@ export interface Dependency { /** A flag indicating if the dependency was dynamic. (e.g. * `await import("mod.ts")`) */ isDynamic?: true; -} +} \ No newline at end of file diff --git a/package.json b/package.json index e8b97c53..41d450bd 100644 --- a/package.json +++ b/package.json @@ -35,11 +35,11 @@ "test:ci:vitest": "vitest run --coverage", "test:ci:deno": "deno test --allow-all deno", "test:integration": "node --experimental-modules test/integration/test.js", - "vendor": "deno vendor --force --output deno/vendor https://deno.land/x/deno_graph@0.59.2/types.d.ts https://deno.land/x/eszip@v0.55.2/mod.ts https://deno.land/x/retry@v2.0.0/mod.ts https://deno.land/x/std@0.177.0/path/mod.ts" + "vendor": "deno vendor --force --output deno/vendor https://deno.land/x/eszip@v0.55.2/mod.ts https://deno.land/x/retry@v2.0.0/mod.ts https://deno.land/x/std@0.177.0/path/mod.ts" }, "config": { "eslint": "--ignore-path .gitignore --cache --format=codeframe --max-warnings=0 \"{node,scripts,.github}/**/*.{js,ts,md,html}\" \"*.{js,ts,md,html}\"", - "prettier": "--ignore-path .gitignore --loglevel=warn \"{node,scripts,.github}/**/*.{js,ts,md,yml,json,html}\" \"*.{js,ts,yml,json,html}\" \".*.{js,ts,yml,json,html}\" \"!**/package-lock.json\" \"!package-lock.json\"" + "prettier": "--ignore-path .gitignore --loglevel=warn \"{node,scripts,.github}/**/*.{js,ts,md,yml,json,html}\" \"*.{js,ts,yml,json,html}\" \".*.{js,ts,yml,json,html}\" \"!**/package-lock.json\" \"!package-lock.json\" \"!node/vendor/**\"" }, "keywords": [], "license": "MIT",