Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node v20 build functional #1151

Merged
merged 8 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .babelrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ const jsConfig = require('./jsconfig.json');
module.exports = {
include: [/src/, /node_modules/],
presets: ['@babel/preset-env'],
targets: {
node: "20.16"
},
plugins: [
[
'@babel/plugin-syntax-import-attributes',
['@babel/plugin-syntax-import-attributes',
{
deprecatedAssertSyntax: true,
},
Expand All @@ -16,6 +18,6 @@ module.exports = {
{
root: [path.resolve(jsConfig.compilerOptions.baseUrl)],
},
],
]
],
};
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v3

- name: Setup Node 18.x
- name: Setup Node 20.x
uses: actions/setup-node@v3
with:
node-version: '18.16'
node-version: '20.16'

- name: Install Husky
run: npm install --save-dev husky
Expand Down Expand Up @@ -180,7 +180,7 @@ jobs:
- name: Build arm 64 dist
run: |
mkdir pkgcache
docker run --rm --platform linux/arm64 -v $(pwd):/app -w /app -e PKG_CACHE_PATH=pkgcache node:18.16 /bin/bash -c "npm pkg delete scripts.prepare && npm install && npm i -g @babel/cli @babel/preset-env pkg && npm run create-linux-arm64-dist"
docker run --rm --platform linux/arm64 -v $(pwd):/app -w /app -e PKG_CACHE_PATH=pkgcache node:20.16 /bin/bash -c "npm pkg delete scripts.prepare && npm install && npm i -g @babel/cli @babel/preset-env pkg && npm run create-linux-arm64-dist"

- name: Copy sqlite3
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: NPM Tests
runs-on: ubuntu-latest
container:
image: node:18.16
image: node:20.16

steps:
- uses: Chia-Network/actions/clean-workspace@main
Expand Down
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx commitlint --edit $1
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.16
20.16
15 changes: 0 additions & 15 deletions babel.config.json

This file was deleted.

23 changes: 23 additions & 0 deletions change-build-package-type-commonjs.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const fs = require('fs');
const path = require('path');

const packageJsonPath = path.resolve(__dirname, './build/package.json');

fs.readFile(packageJsonPath, 'utf8', (err, data) => {
if (err) {
console.error('Error reading package.json:', err);
process.exit(1);
}

const packageJson = JSON.parse(data);
packageJson.type = 'commonjs';

fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8', (err) => {
if (err) {
console.error('Error writing package.json:', err);
process.exit(1);
}

console.log('build package.json type updated to commonjs');
});
});
Loading
Loading