Skip to content
Open
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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
]
},
"scripts": {
"build": "yarn workspaces foreach run build",
"build": "yarn workspaces foreach --all run build",
"deploy": "monodeploy --config-file monodeploy.config.js",
"format": "prettier --write .",
"lint": "eslint \"**/{src,tests}/**/*\"",
Expand Down
9 changes: 7 additions & 2 deletions packages/playwright-msw/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
"name": "playwright-msw",
"version": "3.0.1",
"description": "A Mock Service Worker API for Playwright.",
"main": "lib/index.js",
"main": "lib/cjs/index.js",
"type": "module",
"exports": {
"require": "./lib/cjs/index.js",
"import": "./lib/esm/index.js"
},
"files": [
"lib"
],
Expand All @@ -21,7 +26,7 @@
},
"license": "MIT",
"scripts": {
"build": "tsc",
"build": "tsc --project ./tsconfig.json && tsc --project ./tsconfig.esm.json",
"clean": "rimraf lib",
"prepack": "yarn clean && yarn build",
"test": "jest",
Expand Down
4 changes: 2 additions & 2 deletions packages/playwright-msw/src/fixture.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { PlaywrightTestArgs, TestFixture } from '@playwright/test';
import { RequestHandler } from 'msw';
import { Config } from './config';
import { createWorker, MockServiceWorker } from './worker';
import { Config } from './config.js';
import { createWorker, MockServiceWorker } from './worker.js';

export const createWorkerFixture = (
handlers: RequestHandler[] = [],
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-msw/src/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { randomUUID } from 'crypto';
import type { RequestHandler, LifeCycleEventsMap } from 'msw';
import { handleRequest } from 'msw';
import { Emitter } from 'strict-event-emitter';
import { objectifyHeaders, readableStreamToBuffer } from './utils';
import { objectifyHeaders, readableStreamToBuffer } from './utils.js';

const emitter = new Emitter<LifeCycleEventsMap>();

Expand Down
6 changes: 3 additions & 3 deletions packages/playwright-msw/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { Config } from './config';
export { createWorkerFixture } from './fixture';
export { MockServiceWorker, createWorker } from './worker';
export { Config } from './config.js';
export { createWorkerFixture } from './fixture.js';
export { MockServiceWorker, createWorker } from './worker.js';
6 changes: 3 additions & 3 deletions packages/playwright-msw/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {
deserializePath,
SerializedPath,
convertMswPathToPlaywrightUrl,
} from './utils';
import { Config, DEFAULT_CONFIG } from './config';
import { handleRoute } from './handler';
} from './utils.js';
import { Config, DEFAULT_CONFIG } from './config.js';
import { handleRoute } from './handler.js';

export type RouteUrl = string | RegExp;

Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-msw/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Path, RequestHandler } from 'msw';
import { Config } from './config';
import { Config } from './config.js';

export type SerializedPathType = 'regexp' | 'string';
export type SerializedPath = `${SerializedPathType}:${string}`;
Expand Down
4 changes: 2 additions & 2 deletions packages/playwright-msw/src/worker.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Page } from '@playwright/test';
import { store } from '@mswjs/cookies';
import type { RequestHandler } from 'msw';
import { Router } from './router';
import { Config } from './config';
import { Router } from './router.js';
import { Config } from './config.js';

export type MockServiceWorker = {
/**
Expand Down
7 changes: 7 additions & 0 deletions packages/playwright-msw/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "esnext",
"outDir": "./lib/esm"
}
}
2 changes: 1 addition & 1 deletion packages/playwright-msw/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"declaration": true,
"outDir": "./lib",
"outDir": "./lib/cjs",
"removeComments": true
},
"include": ["src/**/*"],
Expand Down