Skip to content

Commit

Permalink
build: enable verbatimModuleSyntax
Browse files Browse the repository at this point in the history
  • Loading branch information
PaperStrike committed Nov 2, 2023
1 parent f1e379c commit 0659857
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 21 deletions.
10 changes: 8 additions & 2 deletions src/cli/api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { createRequire } from 'node:module';
import { Command, Option } from '@commander-js/extra-typings';
import Runner, { BrowserServerOptions, RunnerOptions } from '../server/Runner.js';
import { ConfigOptions } from '../server/api.js';

import {
Runner,
type BrowserServerOptions,
type RunnerOptions,
type ConfigOptions,
} from '../server/api.js';

import configSearcher from './configSearcher.js';

const require = createRequire(import.meta.url);
Expand Down
2 changes: 1 addition & 1 deletion src/client/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
RouteOptions,
} from './ws/route/RouteHandler.js';

export {
export type {
Route,
RouteRequest,
RouteHandler,
Expand Down
4 changes: 2 additions & 2 deletions src/client/ws/WSClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import type playwright from 'playwright';
import {
createRouteMeta,
parseServerMeta,
RouteServerMeta,
type RouteServerMeta,
} from '../../common/ws/message.js';
import RouteHandler, { RouteHandlerCallback, RouteMatcher, RouteOptions } from './route/RouteHandler.js';
import RouteHandler, { type RouteHandlerCallback, type RouteMatcher, type RouteOptions } from './route/RouteHandler.js';
import RouteRequest from './route/RouteRequest.js';
import Route from './route/Route.js';
import HostHandle from './handle/HostHandle.js';
Expand Down
4 changes: 2 additions & 2 deletions src/client/ws/handle/HostHandle.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
createHandleMeta,
parseServerMeta,
HandleMetaBase,
HandleClientMeta,
type HandleMetaBase,
type HandleClientMeta,
} from '../../../common/ws/message.js';
import * as Serializer from '../../../common/serializer/index.js';

Expand Down
4 changes: 2 additions & 2 deletions src/client/ws/route/RouteRequest.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type playwright from 'playwright';
import HostHandle from '../handle/HostHandle.js';
import { RouteRequestMeta } from '../../../common/ws/message.js';
import { FallbackOverrides } from './Route.js';
import type { RouteRequestMeta } from '../../../common/ws/message.js';
import type { FallbackOverrides } from './Route.js';

export default class RouteRequest {
constructor(
Expand Down
2 changes: 1 addition & 1 deletion src/common/serializer/parseSerializedValue.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SerializedValue } from './Serializable.js';
import type { SerializedValue } from './Serializable.js';

const innerParseSerializedValue = (
value: SerializedValue,
Expand Down
2 changes: 1 addition & 1 deletion src/common/serializer/serializeValue.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Handle from './Handle.js';
import { SerializableValue, SerializedValue } from './Serializable.js';
import type { SerializableValue, SerializedValue } from './Serializable.js';

function isURL(obj: unknown, objStr: string): obj is URL {
return obj instanceof URL || objStr === '[object URL]';
Expand Down
2 changes: 1 addition & 1 deletion src/server/BrowserLogger.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import util from 'util';
import { SourceMap, SourceMapPayload } from 'module';
import { SourceMap, type SourceMapPayload } from 'module';

import chalk from 'chalk';
import type { BrowserContext, ConsoleMessage, WebError } from 'playwright';
Expand Down
2 changes: 1 addition & 1 deletion src/server/TestServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import http from 'node:http';
import path from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
import type { AddressInfo } from 'node:net';
import { SourceMapPayload } from 'node:module';
import type { SourceMapPayload } from 'node:module';

import { lookup as mimeLookup } from 'mrmime';
import getPort, { portNumbers } from 'get-port';
Expand Down
2 changes: 1 addition & 1 deletion src/server/api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RunnerOptions } from './Runner.js';
import type { RunnerOptions } from './Runner.js';

export * from './BrowserLogger.js';
export { default as BrowserLogger } from './BrowserLogger.js';
Expand Down
7 changes: 4 additions & 3 deletions src/server/ws/WSServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import type playwright from 'playwright';
import '../../common/utils/patchDisposable.js';
import * as Serializer from '../../common/serializer/index.js';
import {
RouteClientMeta,
HandleClientMeta,
type RouteClientMeta,
type HandleClientMeta,
parseClientMeta,
createRouteMeta, createHandleMeta,
createRouteMeta,
createHandleMeta,
} from '../../common/ws/message.js';

/**
Expand Down
2 changes: 1 addition & 1 deletion test/route/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
contextRoute,
contextUnroute,
bypassFetch,
Route,
type Route,
} from '../../src/client/api.js';

describe('basic routing', () => {
Expand Down
4 changes: 2 additions & 2 deletions test/serializer/basic.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, expect, it } from '../default.setup.js';
import Handle from '../../src/common/serializer/Handle.js';
import {
SerializableValue,
SerializedValue,
type SerializableValue,
type SerializedValue,
serializeValue,
noFallback,
parseSerializedValue,
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"stripInternal": true,
"target": "ES2022",
"types": [],
"useDefineForClassFields": true
"useDefineForClassFields": true,
"verbatimModuleSyntax": true
},
"include": [],
"ts-node": {
Expand Down

0 comments on commit 0659857

Please sign in to comment.