Skip to content

Commit 5019b77

Browse files
Merge pull request #177 from terascope/switch-to-ts
Migrate to typescript to reduce the dependencies
2 parents b6035e8 + 44a533c commit 5019b77

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+3241
-2925
lines changed

.babelrc

Lines changed: 0 additions & 8 deletions
This file was deleted.

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
10+
[*.{js,ts,jsx,tsx,json,md}]
11+
indent_style = space
12+
indent_size = 4
13+
14+
[*.{yml,yaml}]
15+
indent_style = space
16+
indent_size = 2
17+
18+
[*.md]
19+
max_line_length = off

.eslintrc

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
11
{
2-
"parser": "babel-eslint",
3-
"extends": "airbnb/base",
4-
"env": {
5-
"mocha": true,
6-
"node": true
7-
},
8-
"rules": {
9-
"comma-dangle": 0,
10-
"no-console": 0
11-
}
2+
"extends": "@terascope"
123
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
*.log
33
node_modules
44
lib
5+
dist
56
tmp
67
coverage

.npmignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

.travis.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@
22
dist: bionic
33
language: node_js
44
node_js:
5-
- '10'
65
- '12'
6+
- '14'
77
branches:
88
only:
9-
- master
10-
- "/^v\\d+\\.\\d+\\.\\d+/"
9+
- master
10+
- "/^v\\d+\\.\\d+\\.\\d+/"
1111
install:
12-
- yarn
12+
- yarn
13+
before_script:
14+
- yarn build
1315
script:
14-
- stty cols 80
15-
- yarn test:cov
16-
- yarn build:lib
16+
- stty cols 80
17+
- yarn test
18+
after_script:
19+
- yarn lint
1720
after_success:
18-
- bash <(curl -s https://codecov.io/bash)
21+
- bash <(curl -s https://codecov.io/bash)
1922
deploy:
2023
provider: npm
2124
email: ci@terascope.io

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ yarn add @terascope/fetch-github-release
6666
### Usage
6767

6868
```javascript
69-
const downloadRelease = require('@terascope/fetch-github-release');
69+
const { downloadRelease } = require('@terascope/fetch-github-release');
7070

7171
const user = 'some user';
7272
const repo = 'some repo';

bin/fetch-github-release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
var path = require('path');
44
var fs = require('fs');
5-
require(path.join(path.dirname(fs.realpathSync(__filename)), '../lib/cli'));
5+
require(path.join(path.dirname(fs.realpathSync(__filename)), '../dist/src/cli'));

index.d.ts

Lines changed: 0 additions & 54 deletions
This file was deleted.

jest.config.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
'use strict';
2+
3+
module.exports = {
4+
verbose: true,
5+
testEnvironment: 'node',
6+
setupFilesAfterEnv: ['jest-extended'],
7+
collectCoverage: true,
8+
coverageReporters: ['json', 'lcov', 'text', 'html'],
9+
coverageDirectory: 'coverage',
10+
collectCoverageFrom: [
11+
'<rootDir>/src/**/*.ts',
12+
'!<rootDir>/**/coverage/**',
13+
'!<rootDir>/**/*.d.ts',
14+
'!<rootDir>/**/dist/**',
15+
'!<rootDir>/**/coverage/**'
16+
],
17+
testMatch: [
18+
'<rootDir>/test/**/*-spec.{ts,js}',
19+
'<rootDir>/test/*-spec.{ts,js}',
20+
],
21+
preset: 'ts-jest',
22+
globals: {
23+
'ts-jest': {
24+
tsconfig: './tsconfig.json',
25+
diagnostics: true,
26+
},
27+
ignoreDirectories: ['dist'],
28+
availableExtensions: ['.js', '.ts']
29+
}
30+
};

0 commit comments

Comments
 (0)