fix: protocol generation in monorepo (#9513)

This commit is contained in:
Andrey Lushnikov 2021-10-14 11:14:50 -07:00 committed by GitHub
parent 9dd17773e6
commit cd92451b9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,7 +27,7 @@ async function generateChromiumProtocol(executablePath) {
}
async function generateWebKitProtocol(folderPath) {
const outputPath = path.join(__dirname, '../../src/server/webkit/protocol.d.ts');
const outputPath = path.join(__dirname, '../../packages/playwright-core/src/server/webkit/protocol.d.ts');
const json = JSON.parse(await fs.promises.readFile(path.join(folderPath, '../protocol.json'), 'utf8'));
await fs.promises.writeFile(outputPath, jsonToTS({domains: json}));
console.log(`Wrote protocol.d.ts for WebKit to ${path.relative(process.cwd(), outputPath)}`);
@ -124,7 +124,7 @@ function typeOfProperty(property, domain) {
}
async function generateFirefoxProtocol(executablePath) {
const outputPath = path.join(__dirname, '../../src/server/firefox/protocol.d.ts');
const outputPath = path.join(__dirname, '../../packages/playwright-core/src/server/firefox/protocol.d.ts');
const omnija = os.platform() === 'darwin' ?
path.join(executablePath, '../../Resources/omni.ja') :
path.join(executablePath, '../omni.ja');