fix(cli): compatible for Node.js 10x

This commit is contained in:
LongYinan 2022-02-08 09:57:22 +08:00
parent 2e68612830
commit 5f359dfaae
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7
5 changed files with 16 additions and 1 deletions

View file

@ -29,7 +29,8 @@ jobs:
- name: Setup node - name: Setup node
uses: actions/setup-node@v2 uses: actions/setup-node@v2
with: with:
node-version: 16 # Testing for compatibility with node v12.x
node-version: 12
check-latest: true check-latest: true
cache: 'yarn' cache: 'yarn'
- name: Install - name: Install

View file

@ -46,6 +46,7 @@
"@types/lodash-es": "^4.17.5", "@types/lodash-es": "^4.17.5",
"clipanion": "^3.1.0", "clipanion": "^3.1.0",
"colorette": "^2.0.16", "colorette": "^2.0.16",
"core-js": "^3.21.0",
"debug": "^4.3.3", "debug": "^4.3.3",
"env-paths": "^3.0.0", "env-paths": "^3.0.0",
"fdir": "^5.2.0", "fdir": "^5.2.0",

View file

@ -1,3 +1,5 @@
import 'core-js/es/string/replace-all'
import { Cli } from 'clipanion' import { Cli } from 'clipanion'
import { version } from '../package.json' import { version } from '../package.json'

View file

@ -49,6 +49,9 @@ export default {
NAPI_VERSION, NAPI_VERSION,
NAPI_DERIVE_VERSION, NAPI_DERIVE_VERSION,
NAPI_BUILD_VERSION, NAPI_BUILD_VERSION,
'node:path': 'path',
'node:os': 'os',
'node:process': 'process',
preventAssignment: true, preventAssignment: true,
}), }),
alias({ alias({

View file

@ -954,6 +954,7 @@ __metadata:
"@types/lodash-es": ^4.17.5 "@types/lodash-es": ^4.17.5
clipanion: ^3.1.0 clipanion: ^3.1.0
colorette: ^2.0.16 colorette: ^2.0.16
core-js: ^3.21.0
debug: ^4.3.3 debug: ^4.3.3
env-paths: ^3.0.0 env-paths: ^3.0.0
fdir: ^5.2.0 fdir: ^5.2.0
@ -2899,6 +2900,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"core-js@npm:^3.21.0":
version: 3.21.0
resolution: "core-js@npm:3.21.0"
checksum: 87df49aa2c5d0a521c52102b6669842dd30b334742e86dd4e0173c51230bc48d610060ab6de0f149766d188325b8c1b84598f901cf455674fe6c03ccc5c8026f
languageName: node
linkType: hard
"core-util-is@npm:1.0.2": "core-util-is@npm:1.0.2":
version: 1.0.2 version: 1.0.2
resolution: "core-util-is@npm:1.0.2" resolution: "core-util-is@npm:1.0.2"