diff --git a/.github/workflows/zig.yaml b/.github/workflows/zig.yaml index ae60659286..be1bee5ce5 100644 --- a/.github/workflows/zig.yaml +++ b/.github/workflows/zig.yaml @@ -29,7 +29,8 @@ jobs: - name: Setup node uses: actions/setup-node@v2 with: - node-version: 16 + # Testing for compatibility with node v12.x + node-version: 12 check-latest: true cache: 'yarn' - name: Install diff --git a/cli/package.json b/cli/package.json index a289226bbc..329a95040c 100644 --- a/cli/package.json +++ b/cli/package.json @@ -46,6 +46,7 @@ "@types/lodash-es": "^4.17.5", "clipanion": "^3.1.0", "colorette": "^2.0.16", + "core-js": "^3.21.0", "debug": "^4.3.3", "env-paths": "^3.0.0", "fdir": "^5.2.0", diff --git a/cli/src/index.ts b/cli/src/index.ts index 9b6aba353a..f810745a4d 100644 --- a/cli/src/index.ts +++ b/cli/src/index.ts @@ -1,3 +1,5 @@ +import 'core-js/es/string/replace-all' + import { Cli } from 'clipanion' import { version } from '../package.json' diff --git a/rollup.config.js b/rollup.config.js index b067fd4b78..51bcee38a1 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -49,6 +49,9 @@ export default { NAPI_VERSION, NAPI_DERIVE_VERSION, NAPI_BUILD_VERSION, + 'node:path': 'path', + 'node:os': 'os', + 'node:process': 'process', preventAssignment: true, }), alias({ diff --git a/yarn.lock b/yarn.lock index 8218015a0f..d032a0fde5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -954,6 +954,7 @@ __metadata: "@types/lodash-es": ^4.17.5 clipanion: ^3.1.0 colorette: ^2.0.16 + core-js: ^3.21.0 debug: ^4.3.3 env-paths: ^3.0.0 fdir: ^5.2.0 @@ -2899,6 +2900,13 @@ __metadata: languageName: node 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": version: 1.0.2 resolution: "core-util-is@npm:1.0.2"