Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix ModuleGraph type export #537

Merged
merged 4 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down
3 changes: 2 additions & 1 deletion node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
5 changes: 2 additions & 3 deletions node/server/server.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { readdir, unlink } from 'fs/promises'
import { join } from 'path'

import type { ModuleGraphJson } from '../../deno/vendor/deno.land/x/[email protected]/types.d.js'
import { DenoBridge, OnAfterDownloadHook, OnBeforeDownloadHook, ProcessRef } from '../bridge.js'
import { getFunctionConfig, FunctionConfig } from '../config.js'
import type { EdgeFunction } from '../edge_function.js'
Expand All @@ -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
Expand Down Expand Up @@ -73,7 +72,7 @@ const prepareServer = ({
await killProcess(processRef.ps)
}

let graph: ModuleGraph = {
let graph: ModuleGraphJson = {
roots: [],
modules: [],
redirects: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ export enum MediaType {
TsBuildInfo = "TsBuildInfo",
SourceMap = "SourceMap",
Unknown = "Unknown",
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,4 @@ export interface Dependency {
/** A flag indicating if the dependency was dynamic. (e.g.
* `await import("mod.ts")`) */
isDynamic?: true;
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]/types.d.ts https://deno.land/x/[email protected]/mod.ts https://deno.land/x/[email protected]/mod.ts https://deno.land/x/[email protected]/path/mod.ts"
"vendor": "deno vendor --force --output deno/vendor https://deno.land/x/[email protected]/mod.ts https://deno.land/x/[email protected]/mod.ts https://deno.land/x/[email protected]/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",
Expand Down