Skip to content

Commit

Permalink
feat(node-versions)!: raise minimum node version from v10 to v20 (#73)
Browse files Browse the repository at this point in the history
Also test the library on different versions of Node.

BREAKING CHANGE: support for node v10 has been dropped and the minimum is now v20.
  • Loading branch information
danguilherme authored Apr 30, 2024
1 parent 57c174d commit e00afd6
Show file tree
Hide file tree
Showing 6 changed files with 2,836 additions and 4,476 deletions.
1 change: 0 additions & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ last 5 Chrome major versions
last 5 Firefox major versions
last 5 Edge major versions
last 3 Safari major versions
maintained node versions
75 changes: 66 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ on:
permissions:
contents: write
jobs:
release:
name: 'Test, Lint, Build and Release'
test:
name: 'Test & Lint'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['20.x', '22.x', 'lts/*']
concurrency:
group: test:${{ github.event_name }}:${{ github.ref }}
group: test:${{ github.event_name }}:${{ github.ref }}:node-${{ matrix.node-version }}
cancel-in-progress: true
steps:
- name: Checkout
Expand All @@ -21,10 +24,10 @@ jobs:
fetch-depth: 0
- name: Enable Corepack
run: corepack enable
- name: Setup Node.js
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
Expand All @@ -34,10 +37,64 @@ jobs:
# Lint
- name: 📐 Lint
run: yarn lint
# Build
build:
name: 'Build'
runs-on: ubuntu-latest
concurrency:
group: build:${{ github.event_name }}:${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: 📦 Build
run: yarn build
# Release
- name: ⬆️ Upload built library
uses: actions/upload-artifact@v4 # upload built files to be used in release job
with:
name: dist
path: dist
retention-days: 1
release:
name: 'Release'
needs: [test, build]
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
packages: write
concurrency:
group: release:${{ github.event_name }}:${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Enable Corepack
run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: ⬇️ Download built library
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: 🚀 Semantic Release
id: release
uses: cycjimmy/semantic-release-action@v4
Expand All @@ -46,15 +103,15 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG == 'true' && 'semantic-release:*' || '' }}
with:
semantic_version: 22.0.12 # semantic-release version, same as in package.json
semantic_version: 23.0.8 # semantic-release version, same as in package.json
- name: 📝 Add release notes to build summary
if: steps.release.outputs.new_release_published == 'true'
run: |
NEW_RELEASE_VERSION=${{ steps.release.outputs.new_release_version }}
echo "# New package version published: \`v$NEW_RELEASE_VERSION\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "yarn add uno-engine@$NEW_RELEASE_VERSION" >> $GITHUB_STEP_SUMMARY
echo "yarn add uno@$NEW_RELEASE_VERSION" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
yarn exec ts-node build/append-to-file.ts $GITHUB_STEP_SUMMARY <<"END_OF_CONTENT"
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.18.2
v20.10.0
24 changes: 14 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build": "yarn run build:types && yarn run build:javascript",
"build:javascript": "webpack",
"build:types": "tsc --emitDeclarationOnly",
"docs": "typedoc --mode file --out docs/api/ src/",
"docs": "typedoc --out docs/api/ src/**/*",
"lint": "tslint -c tslint.json -p tsconfig.json",
"test": "jest",
"test:report": "yarn test --coverage --verbose",
Expand All @@ -35,6 +35,9 @@
"url": "https://github.com/danguilherme/uno/issues"
},
"license": "MIT",
"files": [
"dist"
],
"dependencies": {
"events": "^3.1.0",
"shuffle": "^0.2.2"
Expand All @@ -52,24 +55,25 @@
"@babel/preset-env": "^7.8.6",
"@babel/preset-modules": "^0.1.3",
"@babel/preset-typescript": "^7.8.3",
"@commitlint/cli": "^17.8.1",
"@commitlint/config-conventional": "^17.8.1",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.1",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/events": "^3.0.0",
"@types/jest": "^24.9.1",
"babel-loader": "^8.0.6",
"chai": "^4.2.0",
"jest": "^29.7.0",
"semantic-release": "^17.0.0",
"node-polyfill-webpack-plugin": "^3.0.0",
"semantic-release": "^23.0.8",
"ts-jest": "^29.1.2",
"tslint": "^6.1.3",
"typedoc": "^0.25.13",
"typescript": "^5.4.5",
"webpack": "^4.42.1",
"webpack-cli": "^3.3.11",
"webpack-merge": "^4.2.2",
"webpack-node-externals": "^1.7.2"
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4",
"webpack-merge": "^5.10.0",
"webpack-node-externals": "^3.0.0"
},
"commitlint": {
"extends": [
Expand Down
4 changes: 3 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

const path = require('path');
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const { merge: webpackMerge } = require('webpack-merge');
const nodeExternals = require('webpack-node-externals');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');

const baseConfig = {
devtool: 'source-map',
Expand Down Expand Up @@ -42,6 +43,7 @@ const nodeTarget = {
new webpack.DefinePlugin({
'process.env.PLATFORM': JSON.stringify('node'),
}),
new NodePolyfillPlugin(),
],
};
const webTarget = {
Expand Down
Loading

0 comments on commit e00afd6

Please sign in to comment.