diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index ffb978282..a26677aa1 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -61,10 +61,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Use Node.js 12.4.x + - name: Use Node.js 12.20.0 uses: actions/setup-node@v2 with: - node-version: 12.4.x + node-version: 12.20.0 registry-url: https://npm.pkg.github.com/ scope: "@swagger-api" - name: Cache Node Modules @@ -84,7 +84,7 @@ jobs: with: name: commonjs - - name: Run commonjs build artifacts on Node.js 12.4.x + - name: Run commonjs build artifacts on Node.js 12.20.0 run: node -p "require('./commonjs')" - name: Use Node 14.x diff --git a/README.md b/README.md index 47bbfacc2..050910725 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Swagger Client Version | Release Date | OpenAPI Spec compatibility | Notes ### Runtime -- Node.js `>=` 12.4.x +- Node.js `>=`12.20.0 - `swagger-client` works in the latest versions of Chrome, Safari, Firefox, and Edge. ## Security contact diff --git a/babel.config.js b/babel.config.js index 2ed131c7c..82ce08a8a 100644 --- a/babel.config.js +++ b/babel.config.js @@ -10,7 +10,7 @@ module.exports = { corejs: { version: 3 }, useBuiltIns: false, targets: { - node: '12.4', + node: '12.20.0', }, forceAllTransforms: false, ignoreBrowserslistConfig: true, diff --git a/config/jest/jest.artifact-commonjs.config.js b/config/jest/jest.artifact-commonjs.config.js index 67cd55365..328b76f17 100644 --- a/config/jest/jest.artifact-commonjs.config.js +++ b/config/jest/jest.artifact-commonjs.config.js @@ -4,4 +4,20 @@ module.exports = { rootDir: path.join(__dirname, '..', '..'), testEnvironment: 'node', testMatch: ['**/test/build-artifacts/commonjs.js'], + moduleNameMapper: { + /** + * This is here only until next version of Jest is released - 29.4.x. + * Jest doesn't support package.json imports fields now, so we have + * to provide this workaround. + * + * More information in https://github.com/facebook/jest/issues/12270. + * + */ + '#buffer': + '/node_modules/@swagger-api/apidom-reference/cjs/util/polyfills/buffer/protocol-import.cjs', + '#fs': + '/node_modules/@swagger-api/apidom-reference/cjs/util/polyfills/fs/protocol-import.cjs', + '#util': + '/node_modules/@swagger-api/apidom-reference/cjs/util/polyfills/util/protocol-import.cjs', + }, }; diff --git a/config/jest/jest.artifact-es.config.js b/config/jest/jest.artifact-es.config.js index 275134a0f..1a6d60d05 100644 --- a/config/jest/jest.artifact-es.config.js +++ b/config/jest/jest.artifact-es.config.js @@ -4,4 +4,20 @@ module.exports = { rootDir: path.join(__dirname, '..', '..'), testEnvironment: 'node', testMatch: ['**/test/build-artifacts/es.js'], + moduleNameMapper: { + /** + * This is here only until next version of Jest is released - 29.4.x. + * Jest doesn't support package.json imports fields now, so we have + * to provide this workaround. + * + * More information in https://github.com/facebook/jest/issues/12270. + * + */ + '#buffer': + '/node_modules/@swagger-api/apidom-reference/cjs/util/polyfills/buffer/protocol-import.cjs', + '#fs': + '/node_modules/@swagger-api/apidom-reference/cjs/util/polyfills/fs/protocol-import.cjs', + '#util': + '/node_modules/@swagger-api/apidom-reference/cjs/util/polyfills/util/protocol-import.cjs', + }, }; diff --git a/config/jest/jest.unit.config.js b/config/jest/jest.unit.config.js index 1ddaf7e16..0dc451b80 100644 --- a/config/jest/jest.unit.config.js +++ b/config/jest/jest.unit.config.js @@ -8,6 +8,20 @@ module.exports = { moduleNameMapper: { 'formdata-node/lib/cjs/fileFromPath.js': '/node_modules/formdata-node/lib/cjs/fileFromPath.js', + /** + * This is here only until next version of Jest is released - 29.4.x. + * Jest doesn't support package.json imports fields now, so we have + * to provide this workaround. + * + * More information in https://github.com/facebook/jest/issues/12270. + * + */ + '#buffer': + '/node_modules/@swagger-api/apidom-reference/cjs/util/polyfills/buffer/protocol-import.cjs', + '#fs': + '/node_modules/@swagger-api/apidom-reference/cjs/util/polyfills/fs/protocol-import.cjs', + '#util': + '/node_modules/@swagger-api/apidom-reference/cjs/util/polyfills/util/protocol-import.cjs', }, testPathIgnorePatterns: [ '/node_modules/', diff --git a/docs/development/setting-up.md b/docs/development/setting-up.md index 675e74a40..1ba223f1a 100644 --- a/docs/development/setting-up.md +++ b/docs/development/setting-up.md @@ -3,22 +3,11 @@ ### Prerequisites - git, any version -- NPM >=6.12.x +- Node.js >=16.16 +- NPM >=8.11.0 Generally, we recommend following guidelines from [Node.js Releases](https://nodejs.org/en/about/releases/) to only use `Current`, `Active LTS` or `Maintenance LTS` releases. -Current Node.js: -- Node.js 16.x -- NPM >=7.10.x - -Current Node.js Active LTS: -- Node.js >=14.x -- NPM >=6.14.x - -Current Node.js Maintenance LTS: -- Node.js >12.4 -- NPM >=6.12.x - ### Steps 1. `git clone https://github.com/swagger-api/swagger-js.git` diff --git a/package.json b/package.json index 11f550360..e2909bb40 100644 --- a/package.json +++ b/package.json @@ -111,10 +111,10 @@ }, "dependencies": { "@babel/runtime-corejs3": "^7.11.2", - "@swagger-api/apidom-core": "^0.62.1", - "@swagger-api/apidom-reference": "^0.62.1", - "@swagger-api/apidom-ns-openapi-3-1": "^0.62.1", - "@swagger-api/apidom-json-pointer": "^0.62.1", + "@swagger-api/apidom-core": "^0.63.0", + "@swagger-api/apidom-reference": "^0.63.0", + "@swagger-api/apidom-ns-openapi-3-1": "^0.63.0", + "@swagger-api/apidom-json-pointer": "^0.63.0", "cookie": "~0.5.0", "cross-fetch": "^3.1.5", "deepmerge": "~4.2.2",