-
Notifications
You must be signed in to change notification settings - Fork 280
(Archived) Adopt TypeScript #1497
Changes from all commits
d7169da
722a50f
a363d2e
b8b0304
9746627
94522b9
760d899
9dc1dde
fd46b03
1b6ab77
b7911c8
7b15907
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
version: 2.1 | ||
|
||
|
||
commands: | ||
npm-install: | ||
steps: | ||
|
@@ -18,31 +17,36 @@ 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: | ||
build: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it need to be tested separately if it's a part of all the other jobs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Besides, this job isn't included in the workflow, so it isn't currently being ran. |
||
docker: [<<: *node12] | ||
steps: | ||
- checkout | ||
- npm-install | ||
- run: npm run build | ||
|
||
test-node12: | ||
docker: [<<: *node12] | ||
<<: *test-steps | ||
|
@@ -60,13 +64,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: | ||
|
@@ -94,6 +100,7 @@ jobs: | |
steps: | ||
- checkout | ||
- npm-install | ||
- run: npm run build | ||
- run: npm run ci:smoke | ||
|
||
release: | ||
|
@@ -103,21 +110,22 @@ jobs: | |
steps: | ||
- checkout | ||
- npm-install | ||
- run: npm run build | ||
- run: npm run ci:release | ||
|
||
|
||
workflows: | ||
version: 2 | ||
test-and-release: | ||
jobs: | ||
- quality-checks | ||
- docs-dry-run | ||
- test-node12 | ||
- test-node10 | ||
- test-node8 | ||
- test-e2e-apib | ||
- test-e2e-openapi2 | ||
- smoke-tests | ||
- docs-dry-run | ||
|
||
- release: | ||
requires: | ||
- quality-checks | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,20 @@ | ||
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', | ||
artem-zakharchenko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
'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 | ||
'no-underscore-dangle': 'off', | ||
|
||
'import/prefer-default-export': 'off', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Allows
|
||
|
||
// Following rules were introduced to make the decaffeination | ||
// of the codebase possible and are to be removed in the future | ||
'class-methods-use-this': 'off', | ||
|
@@ -38,6 +30,6 @@ module.exports = { | |
'no-plusplus': 'off', | ||
'no-restricted-syntax': 'off', | ||
'no-use-before-define': 'off', | ||
'prefer-destructuring': 'off', | ||
'prefer-destructuring': 'off' | ||
} | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ npm-shrinkwrap.json | |
|
||
/coverage | ||
/docs/_build | ||
build | ||
typings | ||
node_modules | ||
.idea | ||
.vscode | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Prevent publishing source code to NPM | ||
lib | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use package.json's |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"semi": false, | ||
"trailingComma": "all", | ||
"singleQuote": true, | ||
"arrowParens": "always" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
environment: | ||
nodejs_version: "10" | ||
nodejs_version: '10' | ||
install: | ||
- ps: Install-Product node 10 | ||
- "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' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the build be an explicit step or should it be implicitly included as something like
pretest
script?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried to perform a build once and store it, but since its quite fast, we've decided with @kylef that such setup may be an overkill (attaching a workspace with the build takes multiple times longer than the build itself). I'm okay to revisit this, if you find it necessary.