Skip to content

Commit

Permalink
fix: fix ModuleGraph type export (#537)
Browse files Browse the repository at this point in the history
* fix: fix `ModuleGraph` type export

* chore: remove unnecessary directives

* chore: reset formatting
  • Loading branch information
eduardoboucas committed Nov 20, 2023
1 parent 0c0fad6 commit 0138d13
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
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/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'
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/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",
Expand Down

0 comments on commit 0138d13

Please sign in to comment.