Skip to content

Commit

Permalink
feat: prepare for publishing puppeteer-core (#3047)
Browse files Browse the repository at this point in the history
  • Loading branch information
aslushnikov committed Aug 8, 2018
1 parent d822401 commit 81d42c4
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CONTRIBUTING.md
Expand Up @@ -215,13 +215,17 @@ Releasing to NPM consists of 3 phases:
3. Merge the PR.
4. Once merged, publish release notes using the "create new tag" option.
- **NOTE**: tag names are prefixed with `'v'`, e.g. for version `1.4.0` tag is `v1.4.0`.
2. Publish to NPM.
2. Publish `puppeteer` to NPM.
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 bundling unnecessary files to NPM package
3. Run [`pkgfiles`](https://www.npmjs.com/package/pkgfiles) to make sure you don't publish anything unnecessary.
4. Run `npm publish`.
3. Source Code: mark post-release.
4. Run `npm publish`. This will publish `puppeteer` package.
3. Publish `puppeteer-core` to NPM.
1. Run `./utils/prepare_puppeteer_core.js`. The script will change the name inside `package.json` to `puppeteer-core`.
2. Run `npm publish`. This will publish `puppeteer-core` package.
3. Run `git reset --hard` to reset the changes to `package.json`.
4. Source Code: mark post-release.
1. Bump `package.json` version to `-post` version and send a PR titled `'chore: bump version to vXXX.YYY.ZZZ-post'` ([example](https://github.com/GoogleChrome/puppeteer/commit/d02440d1eac98028e29f4e1cf55413062a259156))
- **NOTE**: make sure to update the "released APIs" section in the top of `docs/api.md`.
- **NOTE**: no other commits should be landed in-between release commit and bump commit.
Expand Down
4 changes: 4 additions & 0 deletions install.js
Expand Up @@ -14,6 +14,10 @@
* limitations under the License.
*/

// puppeteer-core should not install anything.
if (require('./package.json').name === 'puppeteer-core')
return;

buildNode6IfNecessary();

if (process.env.PUPPETEER_SKIP_CHROMIUM_DOWNLOAD) {
Expand Down
25 changes: 25 additions & 0 deletions utils/prepare_puppeteer_core.js
@@ -0,0 +1,25 @@
#!/usr/bin/env node
/**
* Copyright 2018 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

const fs = require('fs');
const path = require('path');

const packagePath = path.join(__dirname, '..', 'package.json');
const json = require(packagePath);

json.name = 'puppeteer-core';
fs.writeFileSync(packagePath, JSON.stringify(json, null, ' '));

0 comments on commit 81d42c4

Please sign in to comment.