Skip to content

Commit

Permalink
devops: include protocol and api.md in NPM package (#3195)
Browse files Browse the repository at this point in the history
The reason for this change is that in Playwright Python we would need the related `protocol.yml` and `api.md` for the installed NPM package. For that we could either add the Git hash to the released package e.g. as a file (and go over the GitHub repo to get the file content) but Pavel proposed that it might be better to include the two files in the NPM package.

Tested locally by adding to the `utils/publish_all_packages.sh` script `--dry` to the NPM publish commands.

cc @aslushnikov @pavelfeldman 

Related issues: microsoft/playwright-python#101 and microsoft/playwright-python#96
  • Loading branch information
mxschmitt authored Jul 28, 2020
1 parent 14c6881 commit d27f97e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ lib/injected/
!README.md
!LICENSE
!NOTICE
!api.md
!protocol.yml

# browser descriptor
!browsers.json
3 changes: 3 additions & 0 deletions packages/build_package.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ 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, 'docs/api.md'), path.join(packagePath, 'api.md'));
await copyToPackage(path.join(ROOT_PATH, 'src/rpc/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({
Expand Down

0 comments on commit d27f97e

Please sign in to comment.