Skip to content

Commit

Permalink
Merge pull request #1530 from apiaryio/1524-typescript
Browse files Browse the repository at this point in the history
Adds TypeScript
  • Loading branch information
artem-zakharchenko authored Oct 3, 2019
2 parents 2604c7e + 940fd5f commit 414e900
Show file tree
Hide file tree
Showing 125 changed files with 10,474 additions and 7,086 deletions.
20 changes: 13 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
version: 2.1


commands:
npm-install:
steps:
Expand All @@ -18,30 +17,28 @@ commands:
- run: echo $(python --version) > .python-version
- restore_cache:
key: py-deps-{{ checksum ".python-version" }}-{{ checksum "docs/requirements.txt" }}
- run: "if [ ! -d ./venv ]; then python -m venv ./venv; fi"
- 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" }}
paths:
- ./venv


aliases:
- &node12
image: circleci/node:12

- &python-docs
# using Python 3.6 as that's the version ReadTheDocs is running
- &python-docs # using Python 3.6 as that's the version ReadTheDocs is running
image: circleci/python:3.6-node

- &test-steps
steps:
- checkout
- npm-install
- run: npm run build
- run: npm run ci:test


jobs:
test-node12:
docker: [<<: *node12]
Expand All @@ -60,13 +57,15 @@ jobs:
steps:
- checkout
- npm-install
- run: npm run build
- run: npm run e2e:apib

test-e2e-openapi2:
docker: [<<: *node12]
steps:
- checkout
- npm-install
- run: npm run build
- run: npm run e2e:openapi2

quality-checks:
Expand All @@ -77,6 +76,13 @@ jobs:
- pip-install-docs
- run: npm run ci:lint

format-check:
docker: [<<: *node12]
steps:
- checkout
- npm-install
- run: npm run prettify:check

docs-dry-run:
# 'dry run', because production build happens directly on the ReadTheDocs
# infrastructure
Expand Down Expand Up @@ -105,11 +111,11 @@ jobs:
- npm-install
- run: npm run ci:release


workflows:
version: 2
test-and-release:
jobs:
- format-check
- quality-checks
- test-node12
- test-node10
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.github
.vscode
build
coverage
docs

Expand Down
17 changes: 4 additions & 13 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
module.exports = {
extends: 'airbnb-base',
extends: ['airbnb-base', 'prettier'],
env: {
'node': true
node: true,
},
rules: {
// Using 'console' is perfectly okay for a Node.js CLI tool and avoiding
// it only brings unnecessary complexity
'no-console': 'off',

// Node 6 does not support dangling commas in function arguments
'comma-dangle': [
'error',
{
'arrays': 'always-multiline',
'objects': 'always-multiline',
'functions': 'never'
}
],

// This is to allow a convention for exporting functions solely for
// the purpose of the unit tests, see
// https://github.com/apiaryio/dredd-transactions/pull/179#discussion_r206852270
Expand All @@ -29,6 +19,7 @@ module.exports = {
'consistent-return': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-unresolved': 'off',
'import/prefer-default-export': 'off',
'max-len': 'off',
'no-continue': 'off',
'no-empty': 'off',
Expand All @@ -39,5 +30,5 @@ module.exports = {
'no-restricted-syntax': 'off',
'no-use-before-define': 'off',
'prefer-destructuring': 'off',
}
},
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package-lock.json
npm-shrinkwrap.json

/build
/coverage
/docs/_build
node_modules
Expand Down
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"useTabs": false,
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"arrowParens": "always",
"bracketSpacing": true,
"trailingComma": "all"
}
15 changes: 8 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
environment:
nodejs_version: "12"
nodejs_version: '12'
install:
- ps: Install-Product node 12
- "npm -g install npm@6"
- 'npm -g install npm@6'
- "set PATH=%APPDATA%\\npm;%PATH%"
- "npm install"
- 'npm install'
cache:
- "node_modules -> package.json"
- 'node_modules -> package.json'
- "%APPDATA%\\npm-cache -> package.json"
build: off
test_script:
- "node --version"
- "npm --version"
- "npm test"
- 'node --version'
- 'npm --version'
- 'npm run build'
- 'npm test'
2 changes: 1 addition & 1 deletion bin/dredd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}
});

const CLI = require('../lib/CLI');
const CLI = require('../build/CLI').default;

const dreddCli = new CLI({
custom: {
Expand Down
2 changes: 1 addition & 1 deletion docs/usage-cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ CLI Options Reference

Remember you can always list all available arguments by ``dredd --help``.

.. cli-options:: ../lib/options.json
.. cli-options:: ../options.json
Loading

0 comments on commit 414e900

Please sign in to comment.