Skip to content

Commit 6a6dbe1

Browse files
authored
fix(tools): use commonjs in bump-package-version.js (#3699)
* fix(tools): use commonjs in bump-package-version.js 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. * fix(tools): remove unsued @babel/node
1 parent b3bf8ac commit 6a6dbe1

File tree

5 files changed

+9
-82
lines changed

5 files changed

+9
-82
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
"devDependencies": {
6262
"@babel/cli": "7.4.3",
6363
"@babel/core": "7.4.3",
64-
"@babel/node": "7.2.2",
6564
"@babel/plugin-proposal-class-properties": "7.4.0",
6665
"@babel/plugin-transform-react-constant-elements": "7.2.0",
6766
"@babel/preset-env": "7.4.3",

scripts/release/bump-package-version.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/* eslint-disable no-console */
1+
/* eslint-disable no-console, import/no-commonjs */
22

3-
import fs from 'fs';
4-
import path from 'path';
5-
import mversion from 'mversion';
6-
import semver from 'semver';
7-
import { version as currentVersion } from '../../package.json';
3+
const fs = require('fs');
4+
const path = require('path');
5+
const mversion = require('mversion');
6+
const semver = require('semver');
7+
const { version: currentVersion } = require('../../package.json');
88

99
if (!process.env.VERSION) {
1010
throw new Error(

scripts/release/publish-maintenance.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ conventional-changelog --preset angular --output-unreleased | less
4040
# printf "\n\nRelease: Please enter the new chosen version > "
4141
printf "\n=> Release: please type the new chosen version > "
4242
read -e newVersion
43-
VERSION=$newVersion babel-node ./scripts/release/bump-package-version.js
43+
VERSION=$newVersion node ./scripts/release/bump-package-version.js
4444

4545
# build new version
4646
NODE_ENV=production VERSION=$newVersion npm run build

scripts/release/publish.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ inquirer
157157
// bump new version
158158
shell.echo(colors.blue(`Bump version to "${newVersion}"`));
159159
shell.exec(
160-
`VERSION=${newVersion} babel-node ./scripts/release/bump-package-version.js`
160+
`VERSION=${newVersion} node ./scripts/release/bump-package-version.js`
161161
);
162162

163163
// build library new version

yarn.lock

Lines changed: 1 addition & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -359,17 +359,6 @@
359359
esutils "^2.0.2"
360360
js-tokens "^4.0.0"
361361

362-
"@babel/node@7.2.2":
363-
version "7.2.2"
364-
resolved "https://registry.yarnpkg.com/@babel/node/-/node-7.2.2.tgz#1557dd23545b38d7b1d030a9c0e8fb225dbf70ab"
365-
integrity sha512-jPqgTycE26uFsuWpLika9Ohz9dmLQHWjOnMNxBOjYb1HXO+eLKxEr5FfKSXH/tBvFwwaw+pzke3gagnurGOfCA==
366-
dependencies:
367-
"@babel/polyfill" "^7.0.0"
368-
"@babel/register" "^7.0.0"
369-
commander "^2.8.1"
370-
lodash "^4.17.10"
371-
v8flags "^3.1.1"
372-
373362
"@babel/parser@^7.0.0", "@babel/parser@^7.2.2", "@babel/parser@^7.2.3":
374363
version "7.3.2"
375364
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.3.2.tgz#95cdeddfc3992a6ca2a1315191c1679ca32c55cd"
@@ -796,14 +785,6 @@
796785
"@babel/helper-regex" "^7.4.3"
797786
regexpu-core "^4.5.4"
798787

799-
"@babel/polyfill@^7.0.0":
800-
version "7.2.5"
801-
resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.2.5.tgz#6c54b964f71ad27edddc567d065e57e87ed7fa7d"
802-
integrity sha512-8Y/t3MWThtMLYr0YNC/Q76tqN1w30+b0uQMeFUYauG2UGTR19zyUtFrAzT23zNtBxPp+LbE5E/nwV/q/r3y6ug==
803-
dependencies:
804-
core-js "^2.5.7"
805-
regenerator-runtime "^0.12.0"
806-
807788
"@babel/preset-env@7.4.3", "@babel/preset-env@^7.4.1":
808789
version "7.4.3"
809790
resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.4.3.tgz#e71e16e123dc0fbf65a52cbcbcefd072fbd02880"
@@ -877,19 +858,6 @@
877858
"@babel/helper-plugin-utils" "^7.0.0"
878859
"@babel/plugin-transform-typescript" "^7.3.2"
879860

880-
"@babel/register@^7.0.0":
881-
version "7.0.0"
882-
resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.0.0.tgz#fa634bae1bfa429f60615b754fc1f1d745edd827"
883-
integrity sha512-f/+CRmaCe7rVEvcvPvxeA8j5aJhHC3aJie7YuqcMDhUOuyWLA7J/aNrTaHIzoWPEhpHA54mec4Mm8fv8KBlv3g==
884-
dependencies:
885-
core-js "^2.5.7"
886-
find-cache-dir "^1.0.0"
887-
home-or-tmp "^3.0.0"
888-
lodash "^4.17.10"
889-
mkdirp "^0.5.1"
890-
pirates "^4.0.0"
891-
source-map-support "^0.5.9"
892-
893861
"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2":
894862
version "7.3.1"
895863
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.3.1.tgz#574b03e8e8a9898eaf4a872a92ea20b7846f6f2a"
@@ -5492,15 +5460,6 @@ find-babel-config@^1.1.0:
54925460
json5 "^0.5.1"
54935461
path-exists "^3.0.0"
54945462

5495-
find-cache-dir@^1.0.0:
5496-
version "1.0.0"
5497-
resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-1.0.0.tgz#9288e3e9e3cc3748717d39eade17cf71fc30ee6f"
5498-
integrity sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=
5499-
dependencies:
5500-
commondir "^1.0.1"
5501-
make-dir "^1.0.0"
5502-
pkg-dir "^2.0.0"
5503-
55045463
find-cache-dir@^2.0.0:
55055464
version "2.0.0"
55065465
resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.0.0.tgz#4c1faed59f45184530fb9d7fa123a4d04a98472d"
@@ -6174,18 +6133,6 @@ hoist-non-react-statics@^2.3.1:
61746133
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47"
61756134
integrity sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw==
61766135

6177-
home-or-tmp@^3.0.0:
6178-
version "3.0.0"
6179-
resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-3.0.0.tgz#57a8fe24cf33cdd524860a15821ddc25c86671fb"
6180-
integrity sha1-V6j+JM8zzdUkhgoVgh3cJchmcfs=
6181-
6182-
homedir-polyfill@^1.0.1:
6183-
version "1.0.1"
6184-
resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc"
6185-
integrity sha1-TCu8inWJmP7r9e1oWA921GdotLw=
6186-
dependencies:
6187-
parse-passwd "^1.0.0"
6188-
61896136
hosted-git-info@^2.1.4:
61906137
version "2.7.1"
61916138
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047"
@@ -9146,11 +9093,6 @@ parse-json@^4.0.0:
91469093
error-ex "^1.3.1"
91479094
json-parse-better-errors "^1.0.1"
91489095

9149-
parse-passwd@^1.0.0:
9150-
version "1.0.0"
9151-
resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6"
9152-
integrity sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=
9153-
91549096
parse5@4.0.0:
91559097
version "4.0.0"
91569098
resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608"
@@ -9281,13 +9223,6 @@ pinkie@^2.0.0:
92819223
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
92829224
integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA=
92839225

9284-
pirates@^4.0.0:
9285-
version "4.0.0"
9286-
resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.0.tgz#850b18781b4ac6ec58a43c9ed9ec5fe6796addbd"
9287-
integrity sha512-8t5BsXy1LUIjn3WWOlOuFDuKswhQb/tkak641lvBgmPOBUQHXveORtlMCp6OdPV1dtuTaEahKA8VNz6uLfKBtA==
9288-
dependencies:
9289-
node-modules-regexp "^1.0.0"
9290-
92919226
pirates@^4.0.1:
92929227
version "4.0.1"
92939228
resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87"
@@ -11096,7 +11031,7 @@ source-map-resolve@^0.5.0:
1109611031
source-map-url "^0.4.0"
1109711032
urix "^0.1.0"
1109811033

11099-
source-map-support@^0.5.6, source-map-support@^0.5.9, source-map-support@~0.5.9:
11034+
source-map-support@^0.5.6, source-map-support@~0.5.9:
1110011035
version "0.5.10"
1110111036
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.10.tgz#2214080bc9d51832511ee2bab96e3c2f9353120c"
1110211037
integrity sha512-YfQ3tQFTK/yzlGJuX8pTwa4tifQj4QS2Mj7UegOu8jAz59MqIiMGPXxQhVQiIMNzayuUSF/jEuVnfFF5JqybmQ==
@@ -12269,13 +12204,6 @@ uuid@^3.3.2:
1226912204
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
1227012205
integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==
1227112206

12272-
v8flags@^3.1.1:
12273-
version "3.1.2"
12274-
resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.1.2.tgz#fc5cd0c227428181e6c29b2992e4f8f1da5e0c9f"
12275-
integrity sha512-MtivA7GF24yMPte9Rp/BWGCYQNaUj86zeYxV/x2RRJMKagImbbv3u8iJC57lNhWLPcGLJmHcHmFWkNsplbbLWw==
12276-
dependencies:
12277-
homedir-polyfill "^1.0.1"
12278-
1227912207
validate-npm-package-license@^3.0.1:
1228012208
version "3.0.4"
1228112209
resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"

0 commit comments

Comments
 (0)