From bb97ff4278794e78d84936469935501e5f1214ff Mon Sep 17 00:00:00 2001 From: artem-zakharchenko Date: Thu, 3 Oct 2019 15:17:16 +0200 Subject: [PATCH] chore: configures CI to work with a monorepo --- .circleci/config.yml | 56 +++++------- .gitignore | 1 + .../dredd/CONTRIBUTING.md => CONTRIBUTING.md | 0 packages/dredd/README.md => README.md | 0 appveyor.yml | 12 +-- .../docs => docs}/_extensions/cli_options.py | 0 .../docs => docs}/_extensions/ghissue.py | 0 .../docs => docs}/_extensions/ghlink_check.py | 0 .../dredd/docs => docs}/_extensions/specs.py | 0 {packages/dredd/docs => docs}/_links.rst | 0 .../dredd/docs => docs}/_static/css/dredd.css | 0 .../docs => docs}/_static/images/README.md | 0 .../_static/images/apiary-tests-tutorial.png | Bin .../_static/images/apiary-tests.png | Bin .../_static/images/dredd-logo.png | Bin .../docs => docs}/_static/images/dredd.png | Bin .../_static/images/hooks-handler.key | Bin .../_static/images/hooks-handler.png | Bin {packages/dredd/docs => docs}/conf.py | 1 + .../dredd/docs => docs}/data-structures.rst | 2 +- {packages/dredd/docs => docs}/hooks/go.rst | 0 {packages/dredd/docs => docs}/hooks/index.rst | 8 +- {packages/dredd/docs => docs}/hooks/js.rst | 0 .../docs => docs}/hooks/new-language.rst | 0 {packages/dredd/docs => docs}/hooks/perl.rst | 0 {packages/dredd/docs => docs}/hooks/php.rst | 0 .../dredd/docs => docs}/hooks/python.rst | 0 {packages/dredd/docs => docs}/hooks/ruby.rst | 0 {packages/dredd/docs => docs}/hooks/rust.rst | 0 .../dredd/docs => docs}/how-it-works.rst | 2 +- .../dredd/docs => docs}/how-to-guides.rst | 82 +++++++++--------- {packages/dredd/docs => docs}/index.rst | 0 .../dredd/docs => docs}/installation.rst | 0 {packages/dredd/docs => docs}/internals.rst | 2 +- {packages/dredd/docs => docs}/quickstart.rst | 0 {packages/dredd/docs => docs}/redirects.yml | 0 .../dredd/docs => docs}/requirements.txt | 0 {packages/dredd/docs => docs}/usage-cli.rst | 2 +- {packages/dredd/docs => docs}/usage-js.rst | 0 package.json | 15 ++++ packages/dredd/.gitignore | 1 - packages/dredd/package.json | 7 +- 42 files changed, 98 insertions(+), 93 deletions(-) rename packages/dredd/CONTRIBUTING.md => CONTRIBUTING.md (100%) rename packages/dredd/README.md => README.md (100%) rename {packages/dredd/docs => docs}/_extensions/cli_options.py (100%) rename {packages/dredd/docs => docs}/_extensions/ghissue.py (100%) rename {packages/dredd/docs => docs}/_extensions/ghlink_check.py (100%) rename {packages/dredd/docs => docs}/_extensions/specs.py (100%) rename {packages/dredd/docs => docs}/_links.rst (100%) rename {packages/dredd/docs => docs}/_static/css/dredd.css (100%) rename {packages/dredd/docs => docs}/_static/images/README.md (100%) rename {packages/dredd/docs => docs}/_static/images/apiary-tests-tutorial.png (100%) rename {packages/dredd/docs => docs}/_static/images/apiary-tests.png (100%) rename {packages/dredd/docs => docs}/_static/images/dredd-logo.png (100%) rename {packages/dredd/docs => docs}/_static/images/dredd.png (100%) rename {packages/dredd/docs => docs}/_static/images/hooks-handler.key (100%) rename {packages/dredd/docs => docs}/_static/images/hooks-handler.png (100%) rename {packages/dredd/docs => docs}/conf.py (98%) rename {packages/dredd/docs => docs}/data-structures.rst (98%) rename {packages/dredd/docs => docs}/hooks/go.rst (100%) rename {packages/dredd/docs => docs}/hooks/index.rst (95%) rename {packages/dredd/docs => docs}/hooks/js.rst (100%) rename {packages/dredd/docs => docs}/hooks/new-language.rst (100%) rename {packages/dredd/docs => docs}/hooks/perl.rst (100%) rename {packages/dredd/docs => docs}/hooks/php.rst (100%) rename {packages/dredd/docs => docs}/hooks/python.rst (100%) rename {packages/dredd/docs => docs}/hooks/ruby.rst (100%) rename {packages/dredd/docs => docs}/hooks/rust.rst (100%) rename {packages/dredd/docs => docs}/how-it-works.rst (99%) rename {packages/dredd/docs => docs}/how-to-guides.rst (87%) rename {packages/dredd/docs => docs}/index.rst (100%) rename {packages/dredd/docs => docs}/installation.rst (100%) rename {packages/dredd/docs => docs}/internals.rst (99%) rename {packages/dredd/docs => docs}/quickstart.rst (100%) rename {packages/dredd/docs => docs}/redirects.yml (100%) rename {packages/dredd/docs => docs}/requirements.txt (100%) rename {packages/dredd/docs => docs}/usage-cli.rst (97%) rename {packages/dredd/docs => docs}/usage-js.rst (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1a3d298a8..7f8f04cf0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,31 +1,23 @@ version: 2.1 commands: - npm-install: - steps: - - run: echo $(node --version) > .node-version - - restore_cache: - key: js-deps-{{ checksum ".node-version" }}-{{ checksum "package.json" }} - - run: npm install --no-save - - save_cache: - key: js-deps-{{ checksum "package.json" }} - paths: - - ./node_modules - pip-install-docs: steps: - run: echo $(python --version) > .python-version - restore_cache: - key: py-deps-{{ checksum ".python-version" }}-{{ checksum "docs/requirements.txt" }} + key: py-deps-{{ checksum ".python-version" }}-{{ checksum "./docs/requirements.txt" }} - run: 'if [ ! -d ./venv ]; then python -m venv ./venv; fi' - run: echo "source $(pwd)/venv/bin/activate" >> $BASH_ENV - run: pip install -r ./docs/requirements.txt - save_cache: - key: py-deps-{{ checksum "docs/requirements.txt" }} + key: py-deps-{{ checksum "./docs/requirements.txt" }} paths: - ./venv aliases: + - &install + - run: sudo npm i -g yarn && yarn install --frozen-lockfile + - &node12 image: circleci/node:12 @@ -35,9 +27,9 @@ aliases: - &test-steps steps: - checkout - - npm-install - - run: npm run build - - run: npm run ci:test + - <<: *install + - run: yarn build + - run: yarn ci:test jobs: test-node12: @@ -56,32 +48,32 @@ jobs: docker: [<<: *node12] steps: - checkout - - npm-install - - run: npm run build - - run: npm run e2e:apib + - <<: *install + - run: yarn build + - run: yarn e2e:apib test-e2e-openapi2: docker: [<<: *node12] steps: - checkout - - npm-install - - run: npm run build - - run: npm run e2e:openapi2 + - <<: *install + - run: yarn build + - run: yarn e2e:openapi2 quality-checks: docker: [<<: *python-docs] steps: - checkout - - npm-install + - <<: *install - pip-install-docs - - run: npm run ci:lint + - run: yarn ci:lint format-check: docker: [<<: *node12] steps: - checkout - - npm-install - - run: npm run prettify:check + - <<: *install + - run: yarn prettify:check docs-dry-run: # 'dry run', because production build happens directly on the ReadTheDocs @@ -89,9 +81,9 @@ jobs: docker: [<<: *python-docs] steps: - checkout - - npm-install + - <<: *install - pip-install-docs - - run: npm run ci:docs + - run: yarn ci:docs smoke-tests: docker: @@ -99,8 +91,8 @@ jobs: - image: circleci/mongo:latest steps: - checkout - - npm-install - - run: npm run ci:smoke + - <<: *install + - run: yarn ci:smoke release: # the GH_TOKEN and NPM_TOKEN environment variables are expected to be set @@ -108,8 +100,8 @@ jobs: docker: [<<: *node12] steps: - checkout - - npm-install - - run: npm run ci:release + - <<: *install + - run: yarn ci:release workflows: version: 2 diff --git a/.gitignore b/.gitignore index ddb54fabc..0aa41ae56 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ cov.* *.log .env* __pycache__ +/docs/_build # Regardless the rules above, never ignore following !.vscode/launch.json diff --git a/packages/dredd/CONTRIBUTING.md b/CONTRIBUTING.md similarity index 100% rename from packages/dredd/CONTRIBUTING.md rename to CONTRIBUTING.md diff --git a/packages/dredd/README.md b/README.md similarity index 100% rename from packages/dredd/README.md rename to README.md diff --git a/appveyor.yml b/appveyor.yml index eb2365aad..3082a1a26 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,14 +3,16 @@ environment: install: - ps: Install-Product node 12 - 'npm -g install npm@6' + - 'npm install -g yarn' - "set PATH=%APPDATA%\\npm;%PATH%" - - 'npm install' + - 'yarn install' cache: - - 'node_modules -> package.json' - - "%APPDATA%\\npm-cache -> package.json" + - 'node_modules -> yarn.lock' + - "%APPDATA%\\npm-cache -> yarn.lock" build: off test_script: - 'node --version' - 'npm --version' - - 'npm run build' - - 'npm test' + - 'yarn --version' + - 'yarn build' + - 'yarn test' diff --git a/packages/dredd/docs/_extensions/cli_options.py b/docs/_extensions/cli_options.py similarity index 100% rename from packages/dredd/docs/_extensions/cli_options.py rename to docs/_extensions/cli_options.py diff --git a/packages/dredd/docs/_extensions/ghissue.py b/docs/_extensions/ghissue.py similarity index 100% rename from packages/dredd/docs/_extensions/ghissue.py rename to docs/_extensions/ghissue.py diff --git a/packages/dredd/docs/_extensions/ghlink_check.py b/docs/_extensions/ghlink_check.py similarity index 100% rename from packages/dredd/docs/_extensions/ghlink_check.py rename to docs/_extensions/ghlink_check.py diff --git a/packages/dredd/docs/_extensions/specs.py b/docs/_extensions/specs.py similarity index 100% rename from packages/dredd/docs/_extensions/specs.py rename to docs/_extensions/specs.py diff --git a/packages/dredd/docs/_links.rst b/docs/_links.rst similarity index 100% rename from packages/dredd/docs/_links.rst rename to docs/_links.rst diff --git a/packages/dredd/docs/_static/css/dredd.css b/docs/_static/css/dredd.css similarity index 100% rename from packages/dredd/docs/_static/css/dredd.css rename to docs/_static/css/dredd.css diff --git a/packages/dredd/docs/_static/images/README.md b/docs/_static/images/README.md similarity index 100% rename from packages/dredd/docs/_static/images/README.md rename to docs/_static/images/README.md diff --git a/packages/dredd/docs/_static/images/apiary-tests-tutorial.png b/docs/_static/images/apiary-tests-tutorial.png similarity index 100% rename from packages/dredd/docs/_static/images/apiary-tests-tutorial.png rename to docs/_static/images/apiary-tests-tutorial.png diff --git a/packages/dredd/docs/_static/images/apiary-tests.png b/docs/_static/images/apiary-tests.png similarity index 100% rename from packages/dredd/docs/_static/images/apiary-tests.png rename to docs/_static/images/apiary-tests.png diff --git a/packages/dredd/docs/_static/images/dredd-logo.png b/docs/_static/images/dredd-logo.png similarity index 100% rename from packages/dredd/docs/_static/images/dredd-logo.png rename to docs/_static/images/dredd-logo.png diff --git a/packages/dredd/docs/_static/images/dredd.png b/docs/_static/images/dredd.png similarity index 100% rename from packages/dredd/docs/_static/images/dredd.png rename to docs/_static/images/dredd.png diff --git a/packages/dredd/docs/_static/images/hooks-handler.key b/docs/_static/images/hooks-handler.key similarity index 100% rename from packages/dredd/docs/_static/images/hooks-handler.key rename to docs/_static/images/hooks-handler.key diff --git a/packages/dredd/docs/_static/images/hooks-handler.png b/docs/_static/images/hooks-handler.png similarity index 100% rename from packages/dredd/docs/_static/images/hooks-handler.png rename to docs/_static/images/hooks-handler.png diff --git a/packages/dredd/docs/conf.py b/docs/conf.py similarity index 98% rename from packages/dredd/docs/conf.py rename to docs/conf.py index 03e1abfaf..b36258411 100644 --- a/packages/dredd/docs/conf.py +++ b/docs/conf.py @@ -116,6 +116,7 @@ linkcheck_ignore = [ 'https://crates.io/crates/dredd-hooks', # https://github.com/sphinx-doc/sphinx/pull/5140 + r'https?://github\.com/apiaryio/dredd/.+', ] sphinx_tabs_valid_builders = ['linkcheck'] diff --git a/packages/dredd/docs/data-structures.rst b/docs/data-structures.rst similarity index 98% rename from packages/dredd/docs/data-structures.rst rename to docs/data-structures.rst index 40a3c0560..a004a6afa 100644 --- a/packages/dredd/docs/data-structures.rst +++ b/docs/data-structures.rst @@ -175,7 +175,7 @@ Apiary Reporter Test Data (object) Internal Apiary Data Structures ------------------------------- -These are private data structures used in Apiary internally and they are documented incompletely. They’re present in this document just to provide better insight on what and how Apiary internally saves. It is closely related to what you can see in documentation for `Apiary Tests API for authenticated test reports `__. +These are private data structures used in Apiary internally and they are documented incompletely. They’re present in this document just to provide better insight on what and how Apiary internally saves. It is closely related to what you can see in documentation for `Apiary Tests API for authenticated test reports `__. .. _apiary-test-run: diff --git a/packages/dredd/docs/hooks/go.rst b/docs/hooks/go.rst similarity index 100% rename from packages/dredd/docs/hooks/go.rst rename to docs/hooks/go.rst diff --git a/packages/dredd/docs/hooks/index.rst b/docs/hooks/index.rst similarity index 95% rename from packages/dredd/docs/hooks/index.rst rename to docs/hooks/index.rst index ab95ca005..4529f6e53 100644 --- a/packages/dredd/docs/hooks/index.rst +++ b/docs/hooks/index.rst @@ -28,12 +28,12 @@ Let's have a description of a blog API, which allows to list all articles, and t .. group-tab:: API Blueprint - .. literalinclude:: ../../test/fixtures/blog/apidesc.apib + .. literalinclude:: ../../packages/dredd/test/fixtures/blog/apidesc.apib :language: apiblueprint .. group-tab:: OpenAPI 2 - .. literalinclude:: ../../test/fixtures/blog/apidesc.openapi2.yaml + .. literalinclude:: ../../packages/dredd/test/fixtures/blog/apidesc.openapi2.yaml :language: openapi2 Now let's say the real instance of the API has the POST request protected so it is not possible for everyone to publish new articles. We do not want to hardcode secret tokens in our API description, but we want to get Dredd to pass the auth. This is where the hooks can help. @@ -52,7 +52,7 @@ Dredd supports :ref:`writing hooks in multiple programming languages Publish an article``. This path-like identifier is a :ref:`transaction name `. @@ -61,7 +61,7 @@ Dredd supports :ref:`writing hooks in multiple programming languages Publish an article > 201 > application/json``. This path-like identifier is a :ref:`transaction name `. diff --git a/packages/dredd/docs/hooks/js.rst b/docs/hooks/js.rst similarity index 100% rename from packages/dredd/docs/hooks/js.rst rename to docs/hooks/js.rst diff --git a/packages/dredd/docs/hooks/new-language.rst b/docs/hooks/new-language.rst similarity index 100% rename from packages/dredd/docs/hooks/new-language.rst rename to docs/hooks/new-language.rst diff --git a/packages/dredd/docs/hooks/perl.rst b/docs/hooks/perl.rst similarity index 100% rename from packages/dredd/docs/hooks/perl.rst rename to docs/hooks/perl.rst diff --git a/packages/dredd/docs/hooks/php.rst b/docs/hooks/php.rst similarity index 100% rename from packages/dredd/docs/hooks/php.rst rename to docs/hooks/php.rst diff --git a/packages/dredd/docs/hooks/python.rst b/docs/hooks/python.rst similarity index 100% rename from packages/dredd/docs/hooks/python.rst rename to docs/hooks/python.rst diff --git a/packages/dredd/docs/hooks/ruby.rst b/docs/hooks/ruby.rst similarity index 100% rename from packages/dredd/docs/hooks/ruby.rst rename to docs/hooks/ruby.rst diff --git a/packages/dredd/docs/hooks/rust.rst b/docs/hooks/rust.rst similarity index 100% rename from packages/dredd/docs/hooks/rust.rst rename to docs/hooks/rust.rst diff --git a/packages/dredd/docs/how-it-works.rst b/docs/how-it-works.rst similarity index 99% rename from packages/dredd/docs/how-it-works.rst rename to docs/how-it-works.rst index 7508fcb55..7350eb896 100644 --- a/packages/dredd/docs/how-it-works.rst +++ b/docs/how-it-works.rst @@ -190,7 +190,7 @@ If there is no body example or schema specified for the response in your API des If you want to enforce the incoming body is empty, you can use :ref:`hooks `: -.. literalinclude:: ../test/fixtures/response/empty-body-hooks.js +.. literalinclude:: ../packages/dredd/test/fixtures/response/empty-body-hooks.js :language: javascript In case of responses with 204 or 205 status codes Dredd still behaves the same way, but it warns about violating the :rfc:`7231` when the responses have non-empty bodies. diff --git a/packages/dredd/docs/how-to-guides.rst b/docs/how-to-guides.rst similarity index 87% rename from packages/dredd/docs/how-to-guides.rst rename to docs/how-to-guides.rst index d21048b0b..3f7707600 100644 --- a/packages/dredd/docs/how-to-guides.rst +++ b/docs/how-to-guides.rst @@ -533,19 +533,19 @@ Most of the authentication schemes use HTTP header for carrying the authenticati Sending Multipart Requests -------------------------- -.. literalinclude:: ../test/fixtures/request/multipart-form-data.apib +.. literalinclude:: ../packages/dredd/test/fixtures/request/multipart-form-data.apib :language: apiblueprint -.. literalinclude:: ../test/fixtures/request/multipart-form-data.yaml +.. literalinclude:: ../packages/dredd/test/fixtures/request/multipart-form-data.yaml :language: openapi2 Sending Form Data ----------------- -.. literalinclude:: ../test/fixtures/request/application-x-www-form-urlencoded.apib +.. literalinclude:: ../packages/dredd/test/fixtures/request/application-x-www-form-urlencoded.apib :language: apiblueprint -.. literalinclude:: ../test/fixtures/request/application-x-www-form-urlencoded.yaml +.. literalinclude:: ../packages/dredd/test/fixtures/request/application-x-www-form-urlencoded.yaml :language: openapi2 Working with Images and other Binary Bodies @@ -559,13 +559,13 @@ Binary Request Body API Blueprint ^^^^^^^^^^^^^ -.. literalinclude:: ../test/fixtures/request/image-png.apib +.. literalinclude:: ../packages/dredd/test/fixtures/request/image-png.apib :language: apiblueprint OpenAPI 2 ^^^^^^^^^ -.. literalinclude:: ../test/fixtures/request/image-png.yaml +.. literalinclude:: ../packages/dredd/test/fixtures/request/image-png.yaml :language: openapi2 Hooks @@ -573,7 +573,7 @@ Hooks In hooks, you can populate the request body with real binary data. The data must be in a form of a `Base64-encoded `__ string. -.. literalinclude:: ../test/fixtures/request/image-png-hooks.js +.. literalinclude:: ../packages/dredd/test/fixtures/request/image-png-hooks.js :language: javascript Binary Response Body @@ -582,13 +582,13 @@ Binary Response Body API Blueprint ^^^^^^^^^^^^^ -.. literalinclude:: ../test/fixtures/response/binary.apib +.. literalinclude:: ../packages/dredd/test/fixtures/response/binary.apib :language: apiblueprint OpenAPI 2 ^^^^^^^^^ -.. literalinclude:: ../test/fixtures/response/binary.yaml +.. literalinclude:: ../packages/dredd/test/fixtures/response/binary.yaml :language: openapi2 .. note:: @@ -599,12 +599,12 @@ Hooks In hooks, you can either assert the body: -.. literalinclude:: ../test/fixtures/response/binary-assert-body-hooks.js +.. literalinclude:: ../packages/dredd/test/fixtures/response/binary-assert-body-hooks.js :language: javascript Or you can ignore it: -.. literalinclude:: ../test/fixtures/response/binary-ignore-body-hooks.js +.. literalinclude:: ../packages/dredd/test/fixtures/response/binary-ignore-body-hooks.js :language: javascript .. _multiple-requests-and-responses: @@ -765,80 +765,80 @@ Sometimes your API sends back sensitive information you don’t want to get disc Sanitation of the Entire Request Body ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- `API Blueprint `__ -- `Hooks `__ +- `API Blueprint `__ +- `Hooks `__ Sanitation of the Entire Response Body ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- `API Blueprint `__ -- `Hooks `__ +- `API Blueprint `__ +- `Hooks `__ Sanitation of a Request Body Attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- `API Blueprint `__ -- `Hooks `__ +- `API Blueprint `__ +- `Hooks `__ Sanitation of a Response Body Attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- `API Blueprint `__ -- `Hooks `__ +- `API Blueprint `__ +- `Hooks `__ Sanitation of Plain Text Response Body by Pattern Matching ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- `API Blueprint `__ -- `Hooks `__ +- `API Blueprint `__ +- `Hooks `__ Sanitation of Request Headers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- `API Blueprint `__ -- `Hooks `__ +- `API Blueprint `__ +- `Hooks `__ Sanitation of Response Headers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- `API Blueprint `__ -- `Hooks `__ +- `API Blueprint `__ +- `Hooks `__ Sanitation of URI Parameters by Pattern Matching ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- `API Blueprint `__ -- `Hooks `__ +- `API Blueprint `__ +- `Hooks `__ Sanitation of Any Content by Pattern Matching ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- `API Blueprint `__ -- `Hooks `__ +- `API Blueprint `__ +- `Hooks `__ Sanitation of Test Data of Passing Transaction ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- `API Blueprint `__ -- `Hooks `__ +- `API Blueprint `__ +- `Hooks `__ Sanitation of Test Data When Transaction Is Marked as Failed in 'before' Hook ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- `API Blueprint `__ -- `Hooks `__ +- `API Blueprint `__ +- `Hooks `__ Sanitation of Test Data When Transaction Is Marked as Failed in 'after' Hook ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- `API Blueprint `__ -- `Hooks `__ +- `API Blueprint `__ +- `Hooks `__ Sanitation of Test Data When Transaction Is Marked as Skipped ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- `API Blueprint `__ -- `Hooks `__ +- `API Blueprint `__ +- `Hooks `__ .. _sanitation-ultimate-guard: @@ -847,8 +847,8 @@ Ultimate ‘afterEach’ Guard Using Pattern Matching You can use this guard to make sure you won’t leak any sensitive data by mistake. -- `API Blueprint `__ -- `Hooks `__ +- `API Blueprint `__ +- `Hooks `__ .. _sanitation-secured-erroring-hooks: @@ -857,5 +857,5 @@ Sanitation of Test Data of Transaction With Secured Erroring Hooks If your hooks crash, Dredd will send an error to reporters, alongside with current contents of the ``transaction.test`` (:ref:`docs `) object. If you want to prevent this, you need to add ``try/catch`` to your hooks, sanitize the test object, and gracefully fail the transaction. -- `API Blueprint `__ -- `Hooks `__ +- `API Blueprint `__ +- `Hooks `__ diff --git a/packages/dredd/docs/index.rst b/docs/index.rst similarity index 100% rename from packages/dredd/docs/index.rst rename to docs/index.rst diff --git a/packages/dredd/docs/installation.rst b/docs/installation.rst similarity index 100% rename from packages/dredd/docs/installation.rst rename to docs/installation.rst diff --git a/packages/dredd/docs/internals.rst b/docs/internals.rst similarity index 99% rename from packages/dredd/docs/internals.rst rename to docs/internals.rst index bb2d79d2a..981be3d66 100644 --- a/packages/dredd/docs/internals.rst +++ b/docs/internals.rst @@ -196,7 +196,7 @@ Hacking Apiary reporter ~~~~~~~~~~~~~~~~~~~~~~~ If you want to build something on top of the Apiary Reporter, note that -it uses a public API described in `Apiary Tests API for authenticated test reports `__ +it uses a public API described in `Apiary Tests API for authenticated test reports `__ Following data are sent over the wire to Apiary: diff --git a/packages/dredd/docs/quickstart.rst b/docs/quickstart.rst similarity index 100% rename from packages/dredd/docs/quickstart.rst rename to docs/quickstart.rst diff --git a/packages/dredd/docs/redirects.yml b/docs/redirects.yml similarity index 100% rename from packages/dredd/docs/redirects.yml rename to docs/redirects.yml diff --git a/packages/dredd/docs/requirements.txt b/docs/requirements.txt similarity index 100% rename from packages/dredd/docs/requirements.txt rename to docs/requirements.txt diff --git a/packages/dredd/docs/usage-cli.rst b/docs/usage-cli.rst similarity index 97% rename from packages/dredd/docs/usage-cli.rst rename to docs/usage-cli.rst index 1c9c72a73..229ab590a 100644 --- a/packages/dredd/docs/usage-cli.rst +++ b/docs/usage-cli.rst @@ -83,4 +83,4 @@ CLI Options Reference Remember you can always list all available arguments by ``dredd --help``. -.. cli-options:: ../options.json +.. cli-options:: ../packages/dredd/options.json diff --git a/packages/dredd/docs/usage-js.rst b/docs/usage-js.rst similarity index 100% rename from packages/dredd/docs/usage-js.rst rename to docs/usage-js.rst diff --git a/package.json b/package.json index 07ed26471..a3b721c02 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,20 @@ { "private": true, + "scripts": { + "build": "lerna exec --scope='dredd' yarn build", + "prettify:check": "lerna exec --scope='dredd' yarn prettify:check", + "docs:lint": "sphinx-build -nW -b linkcheck ./docs ./docs/_build", + "docs:test-extensions": "python -m unittest docs/_extensions/*.py --verbose", + "docs:build": "sphinx-build -nW -b html ./docs ./docs/_build", + "docs:serve": "sphinx-autobuild ./docs ./docs/_build", + "e2e:apib": "lerna exec --scope='dredd' yarn e2e:apib", + "e2e:openapi2": "lerna exec --scope='dredd' yarn e2e:openapi2", + "ci:release": "lerna exec --scope='dredd' yarn ci:release", + "ci:docs": "yarn docs:build", + "ci:lint": "lerna exec --scope=\"dredd\" yarn ci:lint && yarn docs:lint && yarn docs:test-extensions", + "ci:smoke": "lerna exec --scope=\"dredd\" yarn ci:smoke", + "ci:test": "lerna exec --scope=\"dredd\" yarn ci:test" + }, "devDependencies": { "lerna": "^3.16.4" }, diff --git a/packages/dredd/.gitignore b/packages/dredd/.gitignore index 5dd78a31b..c40a5dc32 100644 --- a/packages/dredd/.gitignore +++ b/packages/dredd/.gitignore @@ -1,3 +1,2 @@ /build /coverage -/docs/_build diff --git a/packages/dredd/package.json b/packages/dredd/package.json index 6196e0515..acfa9c498 100644 --- a/packages/dredd/package.json +++ b/packages/dredd/package.json @@ -12,10 +12,6 @@ "scripts": { "start": "npm run build -- --watch", "build": "tsc --build tsconfig.json", - "docs:lint": "sphinx-build -nW -b linkcheck ./docs ./docs/_build", - "docs:test-extensions": "python -m unittest docs/_extensions/*.py --verbose", - "docs:build": "sphinx-build -nW -b html ./docs ./docs/_build", - "docs:serve": "sphinx-autobuild ./docs ./docs/_build", "lint": "./scripts/commitlint.sh && eslint . bin/dredd", "prettify": "prettier --write lib/**/*.js test/**/*.js", "prettify:check": "prettier --check lib/**/*.js test/**/*.js", @@ -24,8 +20,7 @@ "e2e": "npm run e2e:apib && npm run e2e:openapi2", "e2e:apib": "cucumber-js", "e2e:openapi2": "cucumber-js --world-parameters=\"{\\\"apiDescriptionFormat\\\": \\\"application/swagger+yaml\\\"}\"", - "ci:lint": "npm run lint && npm run docs:lint && npm run docs:test-extensions", - "ci:docs": "npm run docs:build", + "ci:lint": "npm run lint", "ci:test": "npm test", "ci:smoke": "bash ./scripts/smoke.sh", "ci:release": "semantic-release && npm dist-tag add \"dredd@$(npm view dredd version)\" stable",