Skip to content

Commit

Permalink
fix(monorepo): export package.json from every package (#9803) (#9805)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelEinbinder committed Oct 27, 2021
1 parent 2b59574 commit 3f94fbb
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 6 deletions.
6 changes: 6 additions & 0 deletions installation-tests/sanity.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ else if (process.argv[3])

const playwright = require(requireName);

const packageJSON = require(requireName + '/package.json');
if (!packageJSON || !packageJSON.version) {
console.error('Should be able to require the package.json and get the version.')
process.exit(1);
}

(async () => {
for (const browserType of success) {
try {
Expand Down
3 changes: 2 additions & 1 deletion packages/playwright-chromium/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"import": "./index.mjs",
"require": "./index.js"
},
"./": "./"
"./cli": "./cli.js",
"./package.json": "./package.json"
},
"bin": {
"playwright": "./cli.js"
Expand Down
1 change: 1 addition & 0 deletions packages/playwright-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"require": "./index.js"
},
"./cli": "./cli.js",
"./package.json": "./package.json",
"./lib/grid/gridServer": "./lib/grid/gridServer.js",
"./lib/grid/gridClient": "./lib/grid/gridClient.js",
"./lib/grid/dockerGridFactory": "./lib/grid/dockerGridFactory.js",
Expand Down
3 changes: 2 additions & 1 deletion packages/playwright-firefox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"import": "./index.mjs",
"require": "./index.js"
},
"./": "./"
"./cli": "./cli.js",
"./package.json": "./package.json"
},
"bin": {
"playwright": "./cli.js"
Expand Down
6 changes: 4 additions & 2 deletions packages/playwright-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
"import": "./index.mjs",
"require": "./index.js"
},
"./src/*": "./lib/*.js",
"./*": "./*.js"
"./cli": "./cli.js",
"./package.json": "./package.json",
"./lib/cli": "./lib/cli.js",
"./reporter": "./reporter.js"
},
"bin": {
"playwright": "./cli.js"
Expand Down
4 changes: 3 additions & 1 deletion packages/playwright/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
".": {
"import": "./index.mjs",
"require": "./index.js"
}
},
"./cli": "./cli.js",
"./package.json": "./package.json"
},
"bin": {
"playwright": "./cli.js"
Expand Down
2 changes: 1 addition & 1 deletion tests/config/browserTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import type { Fixtures } from '@playwright/test';
import type { Browser, BrowserContext, BrowserContextOptions, BrowserType, LaunchOptions, Page } from 'playwright-core';
import { removeFolders } from 'playwright-core/lib/utils/utils';
import { ReuseBrowserContextStorage } from '@playwright/test/src/index';
import { ReuseBrowserContextStorage } from '../../packages/playwright-test/lib/index';
import * as path from 'path';
import * as fs from 'fs';
import * as os from 'os';
Expand Down

0 comments on commit 3f94fbb

Please sign in to comment.