Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: giggio/node-chromedriver
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 117.0.1
Choose a base ref
...
head repository: giggio/node-chromedriver
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 117.0.2
Choose a head ref
  • 4 commits
  • 5 files changed
  • 1 contributor

Commits on Sep 19, 2023

  1. Copy the full SHA
    0aaa6c1 View commit details

Commits on Sep 21, 2023

  1. Copy the full SHA
    c697320 View commit details
  2. Bump version to 117.0.2

    giggio committed Sep 21, 2023
    Copy the full SHA
    5bca510 View commit details
  3. Fix typecheck for update.js

    giggio committed Sep 21, 2023
    Copy the full SHA
    48cb215 View commit details
Showing with 66 additions and 21 deletions.
  1. +10 −8 .github/workflows/build.yml
  2. +1 −1 lib/chromedriver.js
  3. +36 −2 package-lock.json
  4. +2 −1 package.json
  5. +17 −9 update.js
18 changes: 10 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -39,11 +39,12 @@ jobs:
node: ["18.x", "20.x"]
runner: ["windows-latest", "ubuntu-latest", "macos-latest"]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
registry-url: "https://registry.npmjs.org"
cache: npm
- run: |
node --version
npm --version
@@ -73,7 +74,7 @@ jobs:
matrix:
node: ["18", "20"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: uraimo/run-on-arch-action@v2.5.1
name: Verify install
id: build
@@ -117,7 +118,7 @@ jobs:
matrix:
node: ["18", "20"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: uraimo/run-on-arch-action@v2.5.1
name: Verify install
id: build
@@ -163,11 +164,12 @@ jobs:
ports:
- 3128:3128
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20.x
registry-url: "https://registry.npmjs.org"
cache: npm
- run: |
node --version
npm --version
@@ -188,8 +190,8 @@ jobs:
needs: [build, build_arm64, build_s390x, build_proxy]
if: success() && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20.x
registry-url: "https://registry.npmjs.org"
2 changes: 1 addition & 1 deletion lib/chromedriver.js
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ function getPortFromArgs(args) {
}
process.env.PATH = path.join(__dirname, 'chromedriver') + path.delimiter + process.env.PATH;
exports.path = process.platform === 'win32' ? path.join(__dirname, 'chromedriver', 'chromedriver.exe') : path.join(__dirname, 'chromedriver', 'chromedriver');
exports.version = '117.0.5938.88';
exports.version = '117.0.5938.92';
exports.start = function (args, returnPromise) {
let command = exports.path;
if (!fs.existsSync(command)) {
38 changes: 36 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chromedriver",
"version": "117.0.1",
"version": "117.0.2",
"keywords": [
"chromedriver",
"selenium"
@@ -38,6 +38,7 @@
},
"devDependencies": {
"eslint": "^8.45.0",
"semver": "^7.5.4",
"typescript": "^5.1.6"
},
"engines": {
26 changes: 17 additions & 9 deletions update.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/usr/bin/env node

const fs = require('fs');
const semver = require('semver');
const execSync = require('child_process').execSync;
const CURRENT_VERSION = require('./lib/chromedriver').version;
const currentChromedriverVersion = require('./lib/chromedriver').version;
// @ts-expect-error
const currentVersionInPackageJson = require('./package.json').version;

// fetch the latest chromedriver version
async function getLatest() {
@@ -23,24 +26,29 @@ async function getLatest() {
- add a git tag using the new node-chromedriver version
- add a git commit, e.g. Bump version to 77.0.0
*/
async function writeUpdate(version) {
async function writeUpdate(newVersion) {
const helper = fs.readFileSync('./lib/chromedriver.js', 'utf8');
const versionExport = 'exports.version';
const regex = new RegExp(`^.*${versionExport}.*$`, 'gm');
const updated = helper.replace(regex, `${versionExport} = '${version}';`);
const updated = helper.replace(regex, `${versionExport} = '${newVersion}';`);
const currentMajor = semver.major(currentVersionInPackageJson);
const newMajor = semver.major(semver.coerce(newVersion));
const version = currentMajor !== newMajor ? `${newMajor}.0.0` : semver.inc(currentVersionInPackageJson, 'patch');
execSync(`npm version ${version} --git-tag-version=false`);
fs.writeFileSync('./lib/chromedriver.js', updated, 'utf8');
const packageVersion = `${version.slice(0, version.indexOf('.'))}.0.0`;
execSync(`npm version ${packageVersion} --git-tag-version=false && git add . && git commit -m "Bump version to ${packageVersion}" && git tag -s ${packageVersion} -m ${packageVersion}`);
execSync('git add :/');
execSync(`git commit -m "Bump version to ${version}"`);
execSync(`git tag -s ${version} -m ${version}`);
}

async function run() {
try {
const version = await getLatest();
if (CURRENT_VERSION === version) {
const latestVersion = await getLatest();
if (currentChromedriverVersion === latestVersion) {
console.log('Chromedriver version is up to date.');
} else {
writeUpdate(version);
console.log(`Chromedriver version updated to ${version}`);
writeUpdate(latestVersion);
console.log(`Chromedriver version updated to ${latestVersion}`);
}
} catch (err) {
console.log(err);