From a5009029e5f2928f6253eb813ca507664e51b828 Mon Sep 17 00:00:00 2001 From: Andrew Tatomyr Date: Mon, 10 Jul 2023 13:06:21 +0300 Subject: [PATCH] fix: failing in node 14- and yarn due to unresolved peed dependencies (#1166) * chore: set up smoke tests --- .github/workflows/smoke.yaml | 201 ++++++++++++++++++++++++++++ __tests__/smoke/message-schema.yaml | 4 + __tests__/smoke/openapi.yaml | 19 +++ __tests__/smoke/package.json | 14 ++ __tests__/smoke/run-smoke.sh | 31 +++++ package-lock.json | 133 +++++++++--------- packages/cli/package.json | 11 +- scripts/prepare-smoke.sh | 22 +++ 8 files changed, 368 insertions(+), 67 deletions(-) create mode 100644 .github/workflows/smoke.yaml create mode 100644 __tests__/smoke/message-schema.yaml create mode 100644 __tests__/smoke/openapi.yaml create mode 100644 __tests__/smoke/package.json create mode 100644 __tests__/smoke/run-smoke.sh create mode 100644 scripts/prepare-smoke.sh diff --git a/.github/workflows/smoke.yaml b/.github/workflows/smoke.yaml new file mode 100644 index 00000000..4b77b960 --- /dev/null +++ b/.github/workflows/smoke.yaml @@ -0,0 +1,201 @@ +name: Smoke tests + +on: + pull_request: + types: [opened, synchronize, reopened] + push: + branches: + - main + +env: + CI: true + REDOCLY_TELEMETRY: off + +jobs: + prepare-smoke: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'npm' + - name: Install dependencies + run: npm ci + + - name: Prepare Smoke + run: bash ./scripts/prepare-smoke.sh + + - uses: actions/cache@v3 + with: + path: __tests__/smoke/ + key: cache-${{ github.run_id }}-${{ github.run_attempt }} + + run-smoke--npm--node-18: + needs: prepare-smoke + runs-on: ubuntu-latest + steps: + - uses: actions/cache@v3 + with: + path: __tests__/smoke/ + key: cache-${{ github.run_id }}-${{ github.run_attempt }} + + - uses: actions/setup-node@v3 + with: + node-version: 18 + + - run: bash ./__tests__/smoke/run-smoke.sh "npm i redocly-cli.tgz" "npm run" + + run-smoke--npm--node-18--redoc: + needs: prepare-smoke + runs-on: ubuntu-latest + steps: + - uses: actions/cache@v3 + with: + path: __tests__/smoke/ + key: cache-${{ github.run_id }}-${{ github.run_attempt }} + + - uses: actions/setup-node@v3 + with: + node-version: 18 + + - run: bash ./__tests__/smoke/run-smoke.sh "npm i redoc redocly-cli.tgz" "npm run" + + run-smoke--npm--node-16: + needs: prepare-smoke + runs-on: ubuntu-latest + steps: + - uses: actions/cache@v3 + with: + path: __tests__/smoke/ + key: cache-${{ github.run_id }}-${{ github.run_attempt }} + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - run: bash ./__tests__/smoke/run-smoke.sh "npm i redocly-cli.tgz" "npm run" + + run-smoke--npm--node-16--redoc: + needs: prepare-smoke + runs-on: ubuntu-latest + steps: + - uses: actions/cache@v3 + with: + path: __tests__/smoke/ + key: cache-${{ github.run_id }}-${{ github.run_attempt }} + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - run: bash ./__tests__/smoke/run-smoke.sh "npm i redoc redocly-cli.tgz" "npm run" + + run-smoke--npm--node-14: + needs: prepare-smoke + runs-on: ubuntu-latest + steps: + - uses: actions/cache@v3 + with: + path: __tests__/smoke/ + key: cache-${{ github.run_id }}-${{ github.run_attempt }} + + - uses: actions/setup-node@v3 + with: + node-version: 14 + + - run: bash ./__tests__/smoke/run-smoke.sh "npm i redocly-cli.tgz" "npm run" + + run-smoke--npm--node-14--redoc: + needs: prepare-smoke + runs-on: ubuntu-latest + steps: + - uses: actions/cache@v3 + with: + path: __tests__/smoke/ + key: cache-${{ github.run_id }}-${{ github.run_attempt }} + + - uses: actions/setup-node@v3 + with: + node-version: 14 + + - run: bash ./__tests__/smoke/run-smoke.sh "npm i redoc redocly-cli.tgz" "npm run" + + run-smoke--npm--node-12: + needs: prepare-smoke + runs-on: ubuntu-latest + steps: + - uses: actions/cache@v3 + with: + path: __tests__/smoke/ + key: cache-${{ github.run_id }}-${{ github.run_attempt }} + + - uses: actions/setup-node@v3 + with: + node-version: 12 + + - run: bash ./__tests__/smoke/run-smoke.sh "npm i redocly-cli.tgz" "npm run" + + run-smoke--npm--node-12--redoc: + needs: prepare-smoke + runs-on: ubuntu-latest + steps: + - uses: actions/cache@v3 + with: + path: __tests__/smoke/ + key: cache-${{ github.run_id }}-${{ github.run_attempt }} + + - uses: actions/setup-node@v3 + with: + node-version: 12 + + - run: bash ./__tests__/smoke/run-smoke.sh "npm i redoc redocly-cli.tgz" "npm run" + + run-smoke--yarn--node-18: + needs: prepare-smoke + runs-on: ubuntu-latest + steps: + - uses: actions/cache@v3 + with: + path: __tests__/smoke/ + key: cache-${{ github.run_id }}-${{ github.run_attempt }} + + - uses: actions/setup-node@v3 + with: + node-version: 18 + + - run: bash ./__tests__/smoke/run-smoke.sh "yarn add ./redocly-cli-clean.tgz" "yarn" # FIXME: Use actual openapi-core + + run-smoke--yarn--node-18--redoc: + needs: prepare-smoke + runs-on: ubuntu-latest + steps: + - uses: actions/cache@v3 + with: + path: __tests__/smoke/ + key: cache-${{ github.run_id }}-${{ github.run_attempt }} + + - uses: actions/setup-node@v3 + with: + node-version: 18 + + - run: bash ./__tests__/smoke/run-smoke.sh "yarn add redoc ./redocly-cli-clean.tgz" "yarn" # FIXME: Use actual openapi-core + + run-smoke--webpack--node-14: + needs: prepare-smoke + runs-on: ubuntu-latest + steps: + - uses: actions/cache@v3 + with: + path: __tests__/smoke/ + key: cache-${{ github.run_id }}-${{ github.run_attempt }} + + - uses: actions/setup-node@v3 + with: + node-version: 14 + + - run: | + cd __tests__/smoke/ + node bundle.js --version + node bundle.js lint openapi.yaml --extends minimal + node bundle.js bundle openapi.yaml diff --git a/__tests__/smoke/message-schema.yaml b/__tests__/smoke/message-schema.yaml new file mode 100644 index 00000000..6acdcbdd --- /dev/null +++ b/__tests__/smoke/message-schema.yaml @@ -0,0 +1,4 @@ +type: object +properties: + message: + type: string diff --git a/__tests__/smoke/openapi.yaml b/__tests__/smoke/openapi.yaml new file mode 100644 index 00000000..aa98c7e1 --- /dev/null +++ b/__tests__/smoke/openapi.yaml @@ -0,0 +1,19 @@ +openapi: 3.1.0 +servers: + - url: http://localhost +info: + title: Sample API + version: 1.0.0 +paths: + /hello: + get: + operationId: getMessage + security: [] + summary: Get a greeting message + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: ./message-schema.yaml diff --git a/__tests__/smoke/package.json b/__tests__/smoke/package.json new file mode 100644 index 00000000..df06931a --- /dev/null +++ b/__tests__/smoke/package.json @@ -0,0 +1,14 @@ +{ + "name": "test-project", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "redocly-version": "redocly --version", + "redocly-lint": "redocly lint openapi.yaml", + "redocly-bundle": "redocly bundle openapi.yaml --ext json", + "redocly-build-docs": "redocly build-docs openapi.yaml" + }, + "author": "redocly", + "license": "ISC" +} diff --git a/__tests__/smoke/run-smoke.sh b/__tests__/smoke/run-smoke.sh new file mode 100644 index 00000000..a1965860 --- /dev/null +++ b/__tests__/smoke/run-smoke.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +echo +echo "Running smoke test for command: $1 -> $2" +echo "NPM version: $(npm -v)" +echo "Yarn version: $(yarn --version)" +echo + +set -eo pipefail # Fail on script errors + +cd __tests__/smoke + +echo "Directory content:" +ls -a +echo + +# Executing the command provided as the first argument +$1 + +# Actual smoke test - executing the command provided as the second argument +$2 redocly-version +$2 redocly-lint +$2 redocly-bundle +$2 redocly-build-docs +# Check for broken styles (related issue: https://github.com/Redocly/redocly-cli/issues/1073) +if [[ "$(wc -l redoc-static.html)" == "317 redoc-static.html" ]]; then + echo "Docs built correctly." +else + echo "Docs built incorrectly. Received lines: $(wc -l redoc-static.html) (expected 317 lines in redoc-static.html)." + exit 1 +fi diff --git a/package-lock.json b/package-lock.json index 5f1d9fec..bc455c84 100644 --- a/package-lock.json +++ b/package-lock.json @@ -137,7 +137,6 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz", "integrity": "sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==", - "peer": true, "dependencies": { "@babel/types": "^7.18.6" }, @@ -639,7 +638,6 @@ "version": "0.8.8", "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz", "integrity": "sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==", - "peer": true, "dependencies": { "@emotion/memoize": "0.7.4" } @@ -647,20 +645,17 @@ "node_modules/@emotion/memoize": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz", - "integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==", - "peer": true + "integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==" }, "node_modules/@emotion/stylis": { "version": "0.8.5", "resolved": "https://registry.npmjs.org/@emotion/stylis/-/stylis-0.8.5.tgz", - "integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==", - "peer": true + "integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==" }, "node_modules/@emotion/unitless": { "version": "0.7.5", "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", - "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==", - "peer": true + "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" }, "node_modules/@eslint/eslintrc": { "version": "1.3.0", @@ -2277,7 +2272,6 @@ "version": "2.0.7", "resolved": "https://registry.npmjs.org/babel-plugin-styled-components/-/babel-plugin-styled-components-2.0.7.tgz", "integrity": "sha512-i7YhvPgVqRKfoQ66toiZ06jPNA3p6ierpfUuEWxNF+fV27Uv5gxBkf8KZLHUCc1nFA9j6+80pYoIpqCeyW3/bA==", - "peer": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.16.0", "@babel/helper-module-imports": "^7.16.0", @@ -2292,8 +2286,7 @@ "node_modules/babel-plugin-syntax-jsx": { "version": "6.18.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", - "integrity": "sha512-qrPaCSo9c8RHNRHIotaufGbuOBN8rtdC4QrrFFc43vyWCCz7Kl7GL1PGaXtMGQZUXrkCjNEgxDfmAuAabr/rlw==", - "peer": true + "integrity": "sha512-qrPaCSo9c8RHNRHIotaufGbuOBN8rtdC4QrrFFc43vyWCCz7Kl7GL1PGaXtMGQZUXrkCjNEgxDfmAuAabr/rlw==" }, "node_modules/babel-preset-current-node-syntax": { "version": "1.0.1", @@ -2510,8 +2503,7 @@ "node_modules/camelize": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz", - "integrity": "sha512-W2lPwkBkMZwFlPCXhIlYgxu+7gC/NUlCtdK652DAJ1JdgV0sTrvuPFshNPrFa1TY2JOkLhgdeEBplB4ezEa+xg==", - "peer": true + "integrity": "sha512-W2lPwkBkMZwFlPCXhIlYgxu+7gC/NUlCtdK652DAJ1JdgV0sTrvuPFshNPrFa1TY2JOkLhgdeEBplB4ezEa+xg==" }, "node_modules/caniuse-lite": { "version": "1.0.30001381", @@ -2894,7 +2886,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", "integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==", - "peer": true, "engines": { "node": ">=4" } @@ -2903,7 +2894,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.0.0.tgz", "integrity": "sha512-Ro1yETZA813eoyUp2GDBhG2j+YggidUmzO1/v9eYBKR2EHVEniE2MI/NqpTQ954BMpTPZFsGNPm46qFB9dpaPQ==", - "peer": true, "dependencies": { "camelize": "^1.0.0", "css-color-keywords": "^1.0.0", @@ -6081,7 +6071,6 @@ "version": "6.6.2", "resolved": "https://registry.npmjs.org/mobx/-/mobx-6.6.2.tgz", "integrity": "sha512-IOpS0bf3+hXIhDIy+CmlNMBfFpAbHS0aVHcNC+xH/TFYEKIIVDKNYRh9eKlXuVfJ1iRKAp0cRVmO145CyJAMVQ==", - "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/mobx" @@ -6841,8 +6830,7 @@ "node_modules/postcss-value-parser": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", - "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", - "peer": true + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, "node_modules/prelude-ls": { "version": "1.2.1", @@ -6986,7 +6974,6 @@ "version": "17.0.2", "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", - "peer": true, "dependencies": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1" @@ -6999,7 +6986,6 @@ "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz", "integrity": "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==", - "peer": true, "dependencies": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", @@ -7738,7 +7724,6 @@ "version": "0.20.2", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", - "peer": true, "dependencies": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1" @@ -7840,8 +7825,7 @@ "node_modules/shallowequal": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", - "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==", - "peer": true + "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==" }, "node_modules/shebang-command": { "version": "2.0.0", @@ -8484,7 +8468,6 @@ "version": "5.3.3", "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-5.3.3.tgz", "integrity": "sha512-++4iHwBM7ZN+x6DtPPWkCI4vdtwumQ+inA/DdAsqYd4SVgUKJie5vXyzotA00ttcFdQkCng7zc6grwlfIfw+lw==", - "peer": true, "dependencies": { "@babel/helper-module-imports": "^7.0.0", "@babel/traverse": "^7.4.5", @@ -8514,7 +8497,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "peer": true, "engines": { "node": ">=4" } @@ -8523,7 +8505,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "peer": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -9606,10 +9587,14 @@ "glob": "^7.1.6", "glob-promise": "^3.4.0", "handlebars": "^4.7.6", + "mobx": "^6.0.4", "portfinder": "^1.0.26", + "react": "^17.0.0", + "react-dom": "^17.0.0", "redoc": "~2.0.0", "semver": "^7.5.2", "simple-websocket": "^9.0.0", + "styled-components": "^5.1.1", "yargs": "17.0.1" }, "bin": { @@ -9627,14 +9612,33 @@ }, "engines": { "node": ">=12.0.0" - }, - "peerDependencies": { - "mobx": "^6.0.4", - "react": "^16.8.4 || ^17.0.0", - "react-dom": "^16.8.4 || ^17.0.0", - "styled-components": "^4.1.1 || ^5.1.1" } }, + "packages/cli/node_modules/@redocly/openapi-core": { + "version": "1.0.0-beta.130", + "resolved": "https://registry.npmjs.org/@redocly/openapi-core/-/openapi-core-1.0.0-beta.130.tgz", + "integrity": "sha512-P24AcEw06s002JZsG6f79/oqEJm3vRj4RySPHjHiJA4JXugbI7Msx4shmIX2PaGsxCLo2aKK/QlDK/0TYDqkrA==", + "dependencies": { + "@redocly/ajv": "^8.11.0", + "@types/node": "^14.11.8", + "colorette": "^1.2.0", + "js-levenshtein": "^1.1.6", + "js-yaml": "^4.1.0", + "lodash.isequal": "^4.5.0", + "minimatch": "^5.0.1", + "node-fetch": "^2.6.1", + "pluralize": "^8.0.0", + "yaml-ast-parser": "0.0.43" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "packages/cli/node_modules/@types/node": { + "version": "14.18.53", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.53.tgz", + "integrity": "sha512-soGmOpVBUq+gaBMwom1M+krC/NNbWlosh4AtGA03SyWNDiqSKtwp7OulO1M6+mg8YkHMvJ/y0AkCeO8d1hNb7A==" + }, "packages/cli/node_modules/@types/yargs": { "version": "17.0.5", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.5.tgz", @@ -9761,7 +9765,6 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz", "integrity": "sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==", - "peer": true, "requires": { "@babel/types": "^7.18.6" } @@ -10134,7 +10137,6 @@ "version": "0.8.8", "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz", "integrity": "sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==", - "peer": true, "requires": { "@emotion/memoize": "0.7.4" } @@ -10142,20 +10144,17 @@ "@emotion/memoize": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz", - "integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==", - "peer": true + "integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==" }, "@emotion/stylis": { "version": "0.8.5", "resolved": "https://registry.npmjs.org/@emotion/stylis/-/stylis-0.8.5.tgz", - "integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==", - "peer": true + "integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==" }, "@emotion/unitless": { "version": "0.7.5", "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", - "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==", - "peer": true + "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" }, "@eslint/eslintrc": { "version": "1.3.0", @@ -10627,14 +10626,40 @@ "glob": "^7.1.6", "glob-promise": "^3.4.0", "handlebars": "^4.7.6", + "mobx": "^6.0.4", "portfinder": "^1.0.26", + "react": "^17.0.0", + "react-dom": "^17.0.0", "redoc": "~2.0.0", "semver": "^7.5.2", "simple-websocket": "^9.0.0", + "styled-components": "^5.1.1", "typescript": "^4.0.3", "yargs": "17.0.1" }, "dependencies": { + "@redocly/openapi-core": { + "version": "1.0.0-beta.130", + "resolved": "https://registry.npmjs.org/@redocly/openapi-core/-/openapi-core-1.0.0-beta.130.tgz", + "integrity": "sha512-P24AcEw06s002JZsG6f79/oqEJm3vRj4RySPHjHiJA4JXugbI7Msx4shmIX2PaGsxCLo2aKK/QlDK/0TYDqkrA==", + "requires": { + "@redocly/ajv": "^8.11.0", + "@types/node": "^14.11.8", + "colorette": "^1.2.0", + "js-levenshtein": "^1.1.6", + "js-yaml": "^4.1.0", + "lodash.isequal": "^4.5.0", + "minimatch": "^5.0.1", + "node-fetch": "^2.6.1", + "pluralize": "^8.0.0", + "yaml-ast-parser": "0.0.43" + } + }, + "@types/node": { + "version": "14.18.53", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.53.tgz", + "integrity": "sha512-soGmOpVBUq+gaBMwom1M+krC/NNbWlosh4AtGA03SyWNDiqSKtwp7OulO1M6+mg8YkHMvJ/y0AkCeO8d1hNb7A==" + }, "@types/yargs": { "version": "17.0.5", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.5.tgz", @@ -11538,7 +11563,6 @@ "version": "2.0.7", "resolved": "https://registry.npmjs.org/babel-plugin-styled-components/-/babel-plugin-styled-components-2.0.7.tgz", "integrity": "sha512-i7YhvPgVqRKfoQ66toiZ06jPNA3p6ierpfUuEWxNF+fV27Uv5gxBkf8KZLHUCc1nFA9j6+80pYoIpqCeyW3/bA==", - "peer": true, "requires": { "@babel/helper-annotate-as-pure": "^7.16.0", "@babel/helper-module-imports": "^7.16.0", @@ -11550,8 +11574,7 @@ "babel-plugin-syntax-jsx": { "version": "6.18.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", - "integrity": "sha512-qrPaCSo9c8RHNRHIotaufGbuOBN8rtdC4QrrFFc43vyWCCz7Kl7GL1PGaXtMGQZUXrkCjNEgxDfmAuAabr/rlw==", - "peer": true + "integrity": "sha512-qrPaCSo9c8RHNRHIotaufGbuOBN8rtdC4QrrFFc43vyWCCz7Kl7GL1PGaXtMGQZUXrkCjNEgxDfmAuAabr/rlw==" }, "babel-preset-current-node-syntax": { "version": "1.0.1", @@ -11718,8 +11741,7 @@ "camelize": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz", - "integrity": "sha512-W2lPwkBkMZwFlPCXhIlYgxu+7gC/NUlCtdK652DAJ1JdgV0sTrvuPFshNPrFa1TY2JOkLhgdeEBplB4ezEa+xg==", - "peer": true + "integrity": "sha512-W2lPwkBkMZwFlPCXhIlYgxu+7gC/NUlCtdK652DAJ1JdgV0sTrvuPFshNPrFa1TY2JOkLhgdeEBplB4ezEa+xg==" }, "caniuse-lite": { "version": "1.0.30001381", @@ -12016,14 +12038,12 @@ "css-color-keywords": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", - "integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==", - "peer": true + "integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==" }, "css-to-react-native": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.0.0.tgz", "integrity": "sha512-Ro1yETZA813eoyUp2GDBhG2j+YggidUmzO1/v9eYBKR2EHVEniE2MI/NqpTQ954BMpTPZFsGNPm46qFB9dpaPQ==", - "peer": true, "requires": { "camelize": "^1.0.0", "css-color-keywords": "^1.0.0", @@ -14488,8 +14508,7 @@ "mobx": { "version": "6.6.2", "resolved": "https://registry.npmjs.org/mobx/-/mobx-6.6.2.tgz", - "integrity": "sha512-IOpS0bf3+hXIhDIy+CmlNMBfFpAbHS0aVHcNC+xH/TFYEKIIVDKNYRh9eKlXuVfJ1iRKAp0cRVmO145CyJAMVQ==", - "peer": true + "integrity": "sha512-IOpS0bf3+hXIhDIy+CmlNMBfFpAbHS0aVHcNC+xH/TFYEKIIVDKNYRh9eKlXuVfJ1iRKAp0cRVmO145CyJAMVQ==" }, "mobx-react": { "version": "7.5.3", @@ -15047,8 +15066,7 @@ "postcss-value-parser": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", - "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", - "peer": true + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, "prelude-ls": { "version": "1.2.1", @@ -15156,7 +15174,6 @@ "version": "17.0.2", "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", - "peer": true, "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1" @@ -15166,7 +15183,6 @@ "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz", "integrity": "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==", - "peer": true, "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", @@ -15723,7 +15739,6 @@ "version": "0.20.2", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", - "peer": true, "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1" @@ -15802,8 +15817,7 @@ "shallowequal": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", - "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==", - "peer": true + "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==" }, "shebang-command": { "version": "2.0.0", @@ -16322,7 +16336,6 @@ "version": "5.3.3", "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-5.3.3.tgz", "integrity": "sha512-++4iHwBM7ZN+x6DtPPWkCI4vdtwumQ+inA/DdAsqYd4SVgUKJie5vXyzotA00ttcFdQkCng7zc6grwlfIfw+lw==", - "peer": true, "requires": { "@babel/helper-module-imports": "^7.0.0", "@babel/traverse": "^7.4.5", @@ -16339,14 +16352,12 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "peer": true + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "peer": true, "requires": { "has-flag": "^3.0.0" } diff --git a/packages/cli/package.json b/packages/cli/package.json index fb585a95..7b17fabf 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -14,6 +14,7 @@ "scripts": { "compile": "tsc", "copy-assets": "cp src/commands/preview-docs/preview-server/default.hbs lib/commands/preview-docs/preview-server/default.hbs && cp src/commands/preview-docs/preview-server/hot.js lib/commands/preview-docs/preview-server/hot.js && cp src/commands/preview-docs/preview-server/oauth2-redirect.html lib/commands/preview-docs/preview-server/oauth2-redirect.html && cp src/commands/build-docs/template.hbs lib/commands/build-docs/template.hbs", + "prepack": "npm run copy-assets", "prepublishOnly": "npm run copy-assets" }, "repository": { @@ -44,13 +45,11 @@ "redoc": "~2.0.0", "semver": "^7.5.2", "simple-websocket": "^9.0.0", - "yargs": "17.0.1" - }, - "peerDependencies": { + "yargs": "17.0.1", "mobx": "^6.0.4", - "react": "^16.8.4 || ^17.0.0", - "react-dom": "^16.8.4 || ^17.0.0", - "styled-components": "^4.1.1 || ^5.1.1" + "react": "^17.0.0", + "react-dom": "^17.0.0", + "styled-components": "^5.1.1" }, "devDependencies": { "@types/configstore": "^5.0.1", diff --git a/scripts/prepare-smoke.sh b/scripts/prepare-smoke.sh new file mode 100644 index 00000000..09d14f4b --- /dev/null +++ b/scripts/prepare-smoke.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# For Workflows (Webpack) +npm run webpack-bundle + +# For yarn (Doesn't support version changing) +(cd packages/cli && cli=$(npm pack | tail -n 1) && mv $cli ../../__tests__/smoke/redocly-cli-clean.tgz) + +# For npm (Mutates packages/cli/package.json) +npm run pack:prepare + +cp ./redocly-cli.tgz ./openapi-core.tgz ./dist/bundle.js ./__tests__/smoke/ + +echo "Current directory:" +pwd +echo +echo "Current directory content:" +ls -a +echo +echo "Target directory content:" +ls -a __tests__/smoke/ +echo