mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
Merge pull request #2336 from logto-io/gao-enable-node-18
chore: enable Node 18
This commit is contained in:
commit
de21777208
15 changed files with 65 additions and 29 deletions
22
.github/workflows/integration-test.yml
vendored
22
.github/workflows/integration-test.yml
vendored
|
@ -18,13 +18,6 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Cache Puppeteer
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# https://pptr.dev/guides/configuration/#changing-the-default-cache-directory
|
||||
path: ~/.cache/puppeteer
|
||||
key: ${{ runner.os }}-pptr-${{ hashFiles('packages/integration-tests/package.json') }}
|
||||
|
||||
- name: Setup Node and pnpm
|
||||
uses: silverhand-io/actions-node-pnpm-run-steps@v2
|
||||
|
||||
|
@ -45,22 +38,15 @@ jobs:
|
|||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node_version: [16, 18]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
path: tests
|
||||
|
||||
- name: Cache Puppeteer
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# https://pptr.dev/guides/configuration/#changing-the-default-cache-directory
|
||||
path: ~/.cache/puppeteer
|
||||
key: ${{ runner.os }}-pptr-${{ hashFiles('tests/packages/integration-tests/package.json') }}
|
||||
|
||||
- name: Copy lockfile
|
||||
run: |
|
||||
cp tests/pnpm-lock.yaml ./
|
||||
|
@ -69,6 +55,7 @@ jobs:
|
|||
- name: Setup Node and pnpm
|
||||
uses: silverhand-io/actions-node-pnpm-run-steps@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
run-install: false
|
||||
|
||||
# Setup integration test
|
||||
|
@ -77,6 +64,9 @@ jobs:
|
|||
cd tests
|
||||
pnpm i
|
||||
pnpm prepack
|
||||
# Install Chromium
|
||||
cd packages/integration-tests/node_modules/puppeteer
|
||||
pnpm postinstall
|
||||
|
||||
# Setup environment
|
||||
- name: Setup Postgres
|
||||
|
|
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
|
@ -47,11 +47,17 @@ jobs:
|
|||
main-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node_version: [16, 18]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node and pnpm
|
||||
uses: silverhand-io/actions-node-pnpm-run-steps@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
|
||||
- name: Prepack
|
||||
run: pnpm prepack
|
||||
|
|
|
@ -33,8 +33,8 @@
|
|||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.15.0",
|
||||
"pnpm": ">=6"
|
||||
"node": "^16.13.0 || ^18.12.0",
|
||||
"pnpm": "^7.14.0"
|
||||
},
|
||||
"alias": {
|
||||
"html-parse-stringify": "html-parse-stringify/dist/html-parse-stringify.module.js",
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
"prepack": "pnpm build"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.0.0"
|
||||
"node": "^16.13.0 || ^18.12.0"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/logto-io/logto/issues"
|
||||
|
|
|
@ -27,16 +27,17 @@ export const defaultPath = path.join(os.homedir(), 'logto');
|
|||
const pgRequired = new semver.SemVer('14.0.0');
|
||||
|
||||
export const validateNodeVersion = () => {
|
||||
const required = new semver.SemVer('16.0.0');
|
||||
const required = [new semver.SemVer('16.13.0'), new semver.SemVer('18.12.0')];
|
||||
const requiredVersionString = required.map((version) => '^' + version.version).join(' || ');
|
||||
const current = new semver.SemVer(execSync('node -v', { encoding: 'utf8', stdio: 'pipe' }));
|
||||
|
||||
if (required.compare(current) > 0) {
|
||||
log.error(`Logto requires NodeJS >=${required.version}, but ${current.version} found.`);
|
||||
if (required.every((version) => version.major !== current.major)) {
|
||||
log.error(`Logto requires NodeJS ${requiredVersionString}, but ${current.version} found.`);
|
||||
}
|
||||
|
||||
if (current.major > required.major) {
|
||||
if (required.some((version) => version.major === current.major && version.compare(current) > 0)) {
|
||||
log.warn(
|
||||
`Logto is tested under NodeJS ^${required.version}, but version ${current.version} found.`
|
||||
`Logto is tested under NodeJS ${requiredVersionString}, but version ${current.version} found.`
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -84,6 +84,17 @@
|
|||
"typescript": "^4.7.4",
|
||||
"zod": "^3.19.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.13.0 || ^18.12.0"
|
||||
},
|
||||
"//": "https://github.com/parcel-bundler/parcel/issues/7636",
|
||||
"targets": {
|
||||
"default": {
|
||||
"engines": {
|
||||
"browsers": "defaults"
|
||||
}
|
||||
}
|
||||
},
|
||||
"alias": {
|
||||
"@/*": "./src/$1",
|
||||
"@mdx/components/*": "./src/mdx-components/$1"
|
||||
|
|
|
@ -100,7 +100,7 @@
|
|||
"typescript": "^4.7.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.0.0"
|
||||
"node": "^16.13.0 || ^18.12.0"
|
||||
},
|
||||
"_moduleAliases": {
|
||||
"@": "./build"
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
},
|
||||
"scripts": {},
|
||||
"engines": {
|
||||
"node": "^16.0.0"
|
||||
"node": "^16.13.0 || ^18.12.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@logto/cli": "workspace:^"
|
||||
|
|
|
@ -44,6 +44,17 @@
|
|||
"stylelint": "^14.9.1",
|
||||
"typescript": "^4.7.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.13.0 || ^18.12.0"
|
||||
},
|
||||
"//": "https://github.com/parcel-bundler/parcel/issues/7636",
|
||||
"targets": {
|
||||
"default": {
|
||||
"engines": {
|
||||
"browsers": "defaults"
|
||||
}
|
||||
}
|
||||
},
|
||||
"alias": {
|
||||
"@/*": "./src/$1"
|
||||
},
|
||||
|
|
|
@ -39,6 +39,9 @@
|
|||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.7.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.13.0 || ^18.12.0"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "@silverhand"
|
||||
},
|
||||
|
|
|
@ -44,6 +44,9 @@
|
|||
"prettier": "^2.7.1",
|
||||
"typescript": "^4.7.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.13.0 || ^18.12.0"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "@silverhand"
|
||||
},
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
"prepack": "pnpm build"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.0.0"
|
||||
"node": "^16.13.0 || ^18.12.0"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/logto-io/logto/issues"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
"test:ci": "jest"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.0.0"
|
||||
"node": "^16.13.0 || ^18.12.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@silverhand/eslint-config": "1.3.0",
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
"typescript": "^4.7.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.0.0"
|
||||
"node": "^16.13.0 || ^18.12.0"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "@silverhand",
|
||||
|
|
|
@ -71,6 +71,17 @@
|
|||
"typescript": "^4.7.4",
|
||||
"use-debounced-loader": "^0.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.13.0 || ^18.12.0"
|
||||
},
|
||||
"//": "https://github.com/parcel-bundler/parcel/issues/7636",
|
||||
"targets": {
|
||||
"default": {
|
||||
"engines": {
|
||||
"browsers": "defaults"
|
||||
}
|
||||
}
|
||||
},
|
||||
"alias": {
|
||||
"@/*": "./src/$1"
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue