Skip to content

Commit

Permalink
feat: update dependencies (#239)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Drop Node 14 support. You should hopefully not have to do anything to address this change. If you do it'll be very little.
  • Loading branch information
mochaaP authored Jan 16, 2024
1 parent f386c5b commit 74820e3
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 20 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node: [14.17.0, 14, 16.10.0, 16, 18]
node: [lts/-1, lts/*, latest]
runs-on: ${{ matrix.os }}
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: ⎔ Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

Expand All @@ -42,7 +42,7 @@ jobs:
run: npm run validate

- name: ⬆️ Upload coverage report
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3

release:
needs: main
Expand All @@ -53,12 +53,12 @@ jobs:
github.ref) && github.event_name == 'push' }}
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: ⎔ Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: lts/*

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
Expand All @@ -69,9 +69,8 @@ jobs:
run: npm run build

- name: 🚀 Release
uses: cycjimmy/semantic-release-action@v2
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 18
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"dependencies": {
"@babel/cli": "^7.18.10",
"@babel/core": "^7.18.13",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-transform-class-properties": "^7.18.6",
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
"@babel/plugin-transform-runtime": "^7.18.10",
"@babel/preset-env": "^7.18.10",
Expand All @@ -70,20 +70,21 @@
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.3.0",
"@rollup/plugin-replace": "^4.0.0",
"@rollup/plugin-terser": "^0.4.4",
"@types/jest": "^29.4.0",
"arrify": "^2.0.1",
"babel-jest": "^29.4.1",
"babel-plugin-macros": "^3.1.0",
"babel-plugin-minify-dead-code-elimination": "^0.5.2",
"babel-plugin-module-resolver": "^4.1.0",
"babel-plugin-module-resolver": "^5.0.0",
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"browserslist": "4.21.3",
"builtin-modules": "^3.3.0",
"chalk": "^4.1.2",
"concurrently": "^7.3.0",
"cosmiconfig": "^7.0.1",
"cpy": "^8.1.2",
"cpy": "npm:@brickdoc/cpy@8.1.2-patch.1",
"cross-env": "^7.0.3",
"cross-spawn": "^7.0.3",
"doctoc": "^2.2.0",
Expand All @@ -102,13 +103,12 @@
"lodash.has": "^4.5.2",
"lodash.omit": "^4.5.0",
"mkdirp": "^1.0.4",
"prettier": "2.7.1",
"prettier": "^3",
"read-pkg-up": "^7.0.1",
"resolve": "^1.22.1",
"rimraf": "^3.0.2",
"rollup": "^2.78.1",
"rollup-plugin-polyfill-node": "^0.10.2",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-polyfill-node": "^0.13.0",
"semver": "^7.3.7",
"which": "^2.0.2",
"yargs-parser": "^21.1.1"
Expand All @@ -121,7 +121,7 @@
"caniuse-lite": "1.0.30001553"
},
"engines": {
"node": "^14.17.0 || ^16.10.0 || >=17.0.0",
"node": "^16.10.0 || >=17.0.0",
"npm": ">=6"
}
}
9 changes: 6 additions & 3 deletions src/config/babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ const browsersConfig = browserslist.loadConfig({path: appDirectory}) || [
const envTargets = isTest
? {node: 'current'}
: isWebpack || isRollup
? {browsers: browsersConfig}
: {node: getNodeVersion(pkg)}
? {browsers: browsersConfig}
: {node: getNodeVersion(pkg)}
const envOptions = {modules: false, loose: true, targets: envTargets}

module.exports = () => ({
Expand Down Expand Up @@ -86,7 +86,10 @@ module.exports = () => ({
isUMD
? require.resolve('babel-plugin-transform-inline-environment-variables')
: null,
[require.resolve('@babel/plugin-proposal-class-properties'), {loose: true}],
[
require.resolve('@babel/plugin-transform-class-properties'),
{loose: true},
],
isMinify
? require.resolve('babel-plugin-minify-dead-code-elimination')
: null,
Expand Down
2 changes: 1 addition & 1 deletion src/config/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const replace = require('@rollup/plugin-replace')
const camelcase = require('lodash.camelcase')
const omit = require('lodash.omit')
const nodePolyfills = require('rollup-plugin-polyfill-node')
const {terser} = require('rollup-plugin-terser')
const terser = require('@rollup/plugin-terser')
const {
pkg,
hasFile,
Expand Down
7 changes: 7 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ function resolveBin(modName, {executable = modName, cwd = process.cwd()} = {}) {
// ignore _error
}
try {
if (modName === 'rollup') {
// Rollup uses subpath exports without exporting package.json which is problematic
// Convert to absolute path first
const modPkgPathDist = require.resolve('rollup/dist/rollup.js')
const modPkgDirDist = path.dirname(modPkgPathDist)
modName = path.join(modPkgDirDist, '..')
}
const modPkgPath = require.resolve(`${modName}/package.json`)
const modPkgDir = path.dirname(modPkgPath)
const {bin} = require(modPkgPath)
Expand Down

0 comments on commit 74820e3

Please sign in to comment.