Skip to content

Commit

Permalink
fix(tools): use commonjs in bump-package-version.js
Browse files Browse the repository at this point in the history
It seems before 9296639 the script was
run in developement env with no modules setting, which mean it defaulted
to the poorly documented `auto`.
Looking at their codebase it seems `auto` is simply `commonjs`.  This
explains why it worked before.

We could have used BABEL_ENV=cjs in front of the babel-node command but
I've moved this file to cjs as it's more simple and is consistent with
other release scripts.
  • Loading branch information
tkrugg committed Apr 16, 2019
1 parent b3bf8ac commit 77ecc56
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions scripts/release/bump-package-version.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-disable no-console */

import fs from 'fs';
import path from 'path';
import mversion from 'mversion';
import semver from 'semver';
import { version as currentVersion } from '../../package.json';
const fs = require('fs');
const path = require('path');
const mversion = require('mversion');
const semver = require('semver');
const { version: currentVersion } = require('../../package.json');

if (!process.env.VERSION) {
throw new Error(
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/publish-maintenance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ conventional-changelog --preset angular --output-unreleased | less
# printf "\n\nRelease: Please enter the new chosen version > "
printf "\n=> Release: please type the new chosen version > "
read -e newVersion
VERSION=$newVersion babel-node ./scripts/release/bump-package-version.js
VERSION=$newVersion node ./scripts/release/bump-package-version.js

# build new version
NODE_ENV=production VERSION=$newVersion npm run build
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ inquirer
// bump new version
shell.echo(colors.blue(`Bump version to "${newVersion}"`));
shell.exec(
`VERSION=${newVersion} babel-node ./scripts/release/bump-package-version.js`
`VERSION=${newVersion} node ./scripts/release/bump-package-version.js`
);

// build library new version
Expand Down

0 comments on commit 77ecc56

Please sign in to comment.