Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit 0d12b50

Browse files
feat: adds basic typescript setup
1 parent d91f1ad commit 0d12b50

File tree

6 files changed

+38
-18
lines changed

6 files changed

+38
-18
lines changed

‎.circleci/config.yml‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
version: 2.1
22

3-
43
commands:
54
npm-install:
65
steps:
@@ -18,30 +17,28 @@ commands:
1817
- run: echo $(python --version) > .python-version
1918
- restore_cache:
2019
key: py-deps-{{ checksum ".python-version" }}-{{ checksum "docs/requirements.txt" }}
21-
- run: "if [ ! -d ./venv ]; then python -m venv ./venv; fi"
20+
- run: 'if [ ! -d ./venv ]; then python -m venv ./venv; fi'
2221
- run: echo "source $(pwd)/venv/bin/activate" >> $BASH_ENV
2322
- run: pip install -r ./docs/requirements.txt
2423
- save_cache:
2524
key: py-deps-{{ checksum "docs/requirements.txt" }}
2625
paths:
2726
- ./venv
2827

29-
3028
aliases:
3129
- &node12
3230
image: circleci/node:12
3331

34-
- &python-docs
35-
# using Python 3.6 as that's the version ReadTheDocs is running
32+
- &python-docs # using Python 3.6 as that's the version ReadTheDocs is running
3633
image: circleci/python:3.6-node
3734

3835
- &test-steps
3936
steps:
4037
- checkout
4138
- npm-install
39+
- run: npm run build
4240
- run: npm run ci:test
4341

44-
4542
jobs:
4643
test-node12:
4744
docker: [<<: *node12]
@@ -60,13 +57,15 @@ jobs:
6057
steps:
6158
- checkout
6259
- npm-install
60+
- run: npm run build
6361
- run: npm run e2e:apib
6462

6563
test-e2e-openapi2:
6664
docker: [<<: *node12]
6765
steps:
6866
- checkout
6967
- npm-install
68+
- run: npm run build
7069
- run: npm run e2e:openapi2
7170

7271
quality-checks:
@@ -112,7 +111,6 @@ jobs:
112111
- npm-install
113112
- run: npm run ci:release
114113

115-
116114
workflows:
117115
version: 2
118116
test-and-release:

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package-lock.json
22
npm-shrinkwrap.json
33

4+
/build
45
/coverage
56
/docs/_build
67
node_modules

‎appveyor.yml‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
environment:
2-
nodejs_version: "12"
2+
nodejs_version: '12'
33
install:
44
- ps: Install-Product node 12
5-
- "npm -g install npm@6"
5+
- 'npm -g install npm@6'
66
- "set PATH=%APPDATA%\\npm;%PATH%"
7-
- "npm install"
7+
- 'npm install'
88
cache:
9-
- "node_modules -> package.json"
9+
- 'node_modules -> package.json'
1010
- "%APPDATA%\\npm-cache -> package.json"
1111
build: off
1212
test_script:
13-
- "node --version"
14-
- "npm --version"
15-
- "npm test"
13+
- 'node --version'
14+
- 'npm --version'
15+
- 'npm run build'
16+
- 'npm test'

‎bin/dredd‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
}
99
});
1010

11-
const CLI = require('../lib/CLI');
11+
const CLI = require('../build/CLI');
1212

1313
const dreddCli = new CLI({
1414
custom: {

‎package.json‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
"name": "dredd",
33
"version": "0.0.0-semantically-released",
44
"description": "HTTP API Testing Framework",
5-
"main": "lib/Dredd.js",
5+
"main": "build/Dredd.js",
66
"bin": {
77
"dredd": "bin/dredd"
88
},
99
"engines": {
1010
"node": ">=8"
1111
},
1212
"scripts": {
13+
"start": "npm run build -- --watch",
14+
"build": "tsc --build tsconfig.json",
1315
"docs:lint": "sphinx-build -nW -b linkcheck ./docs ./docs/_build",
1416
"docs:test-extensions": "python -m unittest docs/_extensions/*.py --verbose",
1517
"docs:build": "sphinx-build -nW -b html ./docs ./docs/_build",
@@ -26,15 +28,16 @@
2628
"ci:docs": "npm run docs:build",
2729
"ci:test": "npm test",
2830
"ci:smoke": "bash ./scripts/smoke.sh",
29-
"ci:release": "semantic-release && npm dist-tag add \"dredd@$(npm view dredd version)\" stable"
31+
"ci:release": "semantic-release && npm dist-tag add \"dredd@$(npm view dredd version)\" stable",
32+
"prepack": "npm run build"
3033
},
3134
"repository": {
3235
"type": "git",
3336
"url": "https://github.com/apiaryio/dredd"
3437
},
3538
"files": [
3639
"bin",
37-
"lib",
40+
"build",
3841
"options.json",
3942
"README.md"
4043
],

‎tsconfig.json‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"compileOnSave": true,
3+
"compilerOptions": {
4+
"module": "commonjs",
5+
"target": "es2017",
6+
"lib": ["es2017"],
7+
"typeRoots": ["node_modules/@types"],
8+
"rootDir": "./lib",
9+
"outDir": "./build",
10+
"moduleResolution": "node",
11+
"esModuleInterop": true,
12+
"allowJs": true,
13+
"allowSyntheticDefaultImports": true
14+
},
15+
"include": ["./lib/**/*.ts", "./lib/**/*.js"],
16+
"exclude": ["node_modules", "build"]
17+
}

0 commit comments

Comments
 (0)