Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types): publish protocol types to npm #5174

Merged
merged 2 commits into from Nov 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .npmignore
Expand Up @@ -8,8 +8,8 @@ node6
test
utils/node6-transform

# exclude internal type definition files
/lib/*.d.ts
# exclude internal type definitions
/lib/externs.d.ts

# repeats from .gitignore
node_modules
Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -252,8 +252,9 @@ Releasing to npm consists of the following phases:
1. On your local machine, pull from [upstream](https://github.com/GoogleChrome/puppeteer) and make sure the last commit is the one just merged.
2. Run `git status` and make sure there are no untracked files.
- **WHY**: this is to avoid adding unnecessary files to the npm package.
3. Run [`npx pkgfiles`](https://www.npmjs.com/package/pkgfiles) to make sure you don't publish anything unnecessary.
4. Run `npm publish`. This publishes the `puppeteer` package.
3. Run `npm install` to make sure the latest `lib/protocol.d.ts` is generated.
4. Run [`npx pkgfiles`](https://www.npmjs.com/package/pkgfiles) to make sure you don't publish anything unnecessary.
5. Run `npm publish`. This publishes the `puppeteer` package.
3. Publish `puppeteer-core` to npm.
1. Run `./utils/prepare_puppeteer_core.js`. The script changes the name inside `package.json` to `puppeteer-core`.
2. Run `npm publish`. This publishes the `puppeteer-core` package.
Expand Down
4 changes: 2 additions & 2 deletions utils/protocol-types-generator/index.js
Expand Up @@ -69,8 +69,8 @@ declare global {
}
}
}
// empty export to keep file a module
export {}

export default Protocol;
`;
const outputPath = path.join(__dirname, '..', '..', 'lib', 'protocol.d.ts');
require('fs').writeFileSync(outputPath, output);
Expand Down