Skip to content

Commit

Permalink
fix(types): publish protocol types to npm (#5174)
Browse files Browse the repository at this point in the history
Co-Authored-By: Mathias Bynens <mathias@qiwi.be>
  • Loading branch information
connorjclark and mathiasbynens committed Nov 16, 2019
1 parent fd43f9c commit d17708b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
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

0 comments on commit d17708b

Please sign in to comment.