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

Co-Authored-By: Mathias Bynens <mathias@qiwi.be>
This commit is contained in:
Connor Clark 2019-11-15 20:19:08 -08:00 committed by Mathias Bynens
parent fd43f9c23a
commit d17708ba1f
3 changed files with 7 additions and 6 deletions

View File

@ -8,8 +8,8 @@ node6
test test
utils/node6-transform utils/node6-transform
# exclude internal type definition files # exclude internal type definitions
/lib/*.d.ts /lib/externs.d.ts
# repeats from .gitignore # repeats from .gitignore
node_modules node_modules

View File

@ -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. 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. 2. Run `git status` and make sure there are no untracked files.
- **WHY**: this is to avoid adding unnecessary files to the npm package. - **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. 3. Run `npm install` to make sure the latest `lib/protocol.d.ts` is generated.
4. Run `npm publish`. This publishes the `puppeteer` package. 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. 3. Publish `puppeteer-core` to npm.
1. Run `./utils/prepare_puppeteer_core.js`. The script changes the name inside `package.json` to `puppeteer-core`. 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. 2. Run `npm publish`. This publishes the `puppeteer-core` package.

View File

@ -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'); const outputPath = path.join(__dirname, '..', '..', 'lib', 'protocol.d.ts');
require('fs').writeFileSync(outputPath, output); require('fs').writeFileSync(outputPath, output);