mirror of
https://github.com/microsoft/playwright.git
synced 2024-09-11 20:37:54 +03:00
chore: do not bundle api.json and protocol.yml (#6841)
These are only needed for the driver, so bundle them in the driver explicitly.
This commit is contained in:
parent
254ec155eb
commit
33c2f6c31e
1
.gitignore
vendored
1
.gitignore
vendored
@ -14,5 +14,4 @@ drivers/
|
||||
.android-sdk/
|
||||
.gradle/
|
||||
nohup.out
|
||||
api.json
|
||||
.trace
|
||||
|
@ -113,9 +113,6 @@ if (!args.some(arg => arg === '--no-cleanup')) {
|
||||
for (const file of package.files)
|
||||
await copyToPackage(path.join(ROOT_PATH, file), path.join(packagePath, file));
|
||||
|
||||
await copyToPackage(path.join(ROOT_PATH, 'api.json'), path.join(packagePath, 'api.json'));
|
||||
await copyToPackage(path.join(ROOT_PATH, 'src/protocol/protocol.yml'), path.join(packagePath, 'protocol.yml'));
|
||||
|
||||
// 4. Generate package.json
|
||||
const pwInternalJSON = require(path.join(ROOT_PATH, 'package.json'));
|
||||
await writeToPackage('package.json', JSON.stringify({
|
||||
|
@ -32,9 +32,6 @@ lib/**/injected/
|
||||
!README.md
|
||||
!LICENSE
|
||||
!NOTICE
|
||||
# Include protocol and api docs, so that dependent packages can consume them.
|
||||
!api.json
|
||||
!protocol.yml
|
||||
# Include browser descriptors.
|
||||
!browsers.json
|
||||
# Include commit info
|
||||
|
@ -17,7 +17,6 @@
|
||||
/* eslint-disable no-console */
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import * as playwright from '../..';
|
||||
import { BrowserType } from '../client/browserType';
|
||||
import { LaunchServerOptions } from '../client/types';
|
||||
@ -31,13 +30,10 @@ import { gracefullyCloseAll } from '../server/processLauncher';
|
||||
import { BrowserName } from '../utils/registry';
|
||||
|
||||
export function printApiJson() {
|
||||
// Note: this file is generated by build-playwright-driver.sh
|
||||
console.log(JSON.stringify(require('../../api.json')));
|
||||
}
|
||||
|
||||
export function printProtocol() {
|
||||
console.log(fs.readFileSync(path.join(__dirname, '..', '..', 'protocol.yml'), 'utf8'));
|
||||
}
|
||||
|
||||
export function runDriver() {
|
||||
const dispatcherConnection = new DispatcherConnection();
|
||||
const transport = new Transport(process.stdout, process.stdin);
|
||||
|
@ -13,6 +13,10 @@ mkdir -p ./output
|
||||
echo "Building playwright package"
|
||||
../../packages/build_package.js playwright ./output/playwright.tgz
|
||||
|
||||
echo "Building api.json and protocol.yml"
|
||||
node ../../utils/doclint/generateApiJson.js > ./output/api.json
|
||||
cp ../../src/protocol/protocol.yml ./output/
|
||||
|
||||
function build {
|
||||
NODE_DIR=$1
|
||||
SUFFIX=$2
|
||||
@ -45,6 +49,8 @@ function build {
|
||||
fi
|
||||
|
||||
cp ./output/${NODE_DIR}/LICENSE ./output/playwright-${SUFFIX}/
|
||||
cp ./output/api.json ./output/playwright-${SUFFIX}/package/
|
||||
cp ./output/protocol.yml ./output/playwright-${SUFFIX}/package/
|
||||
cd ./output/playwright-${SUFFIX}/package
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 node "../../${NODE_DIR}/${NPM_PATH}" install --production
|
||||
rm package-lock.json
|
||||
|
@ -91,15 +91,6 @@ steps.push({
|
||||
shell: true,
|
||||
});
|
||||
|
||||
// Generate api.json.
|
||||
onChanges.push({
|
||||
committed: false,
|
||||
inputs: [
|
||||
'docs/src/api/',
|
||||
],
|
||||
script: 'utils/doclint/generateApiJson.js',
|
||||
});
|
||||
|
||||
// Generate channels.
|
||||
onChanges.push({
|
||||
committed: false,
|
||||
|
@ -35,7 +35,7 @@ const PROJECT_DIR = path.join(__dirname, '..', '..');
|
||||
});
|
||||
documentation.generateSourceCodeComments();
|
||||
const result = serialize(documentation);
|
||||
fs.writeFileSync(path.join(PROJECT_DIR, 'api.json'), JSON.stringify(result));
|
||||
console.log(JSON.stringify(result));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user