Skip to content

Commit 2b1def5

Browse files
committed
ci: add semantic-release
1 parent 07b0047 commit 2b1def5

File tree

6 files changed

+3142
-89
lines changed

6 files changed

+3142
-89
lines changed

.travis.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
sudo: false
2+
language: node_js
3+
cache:
4+
yarn: true
5+
directories:
6+
- node_modules
7+
notifications:
8+
email: true
9+
node_js:
10+
- "10"
11+
- "12"
12+
script:
13+
- yarn run test
14+
- yarn run build
15+
after_success:
16+
- 'curl -Lo travis_after_all.py https://git.io/travis_after_all'
17+
- python travis_after_all.py
18+
- export $(cat .to_export_back) &> /dev/null
19+
- if [[ "$TRAVIS_JOB_NUMBER" == *.1 && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then bash <(curl -s https://codecov.io/bash); fi
20+
- if [[ "$TRAVIS_JOB_NUMBER" == *.1 && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then npm run semantic-release; fi
21+
branches:
22+
except:
23+
- /^v\d+\.\d+\.\d+$/

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@
99
"files": [
1010
"lib"
1111
],
12+
"dependencies": {
13+
"dedent": "^0.7.0"
14+
},
1215
"peerDependencies": {
1316
"graphql-compose": "^7.6.0"
1417
},
1518
"devDependencies": {
19+
"@types/dedent": "^0.7.0",
1620
"@types/glob": "7.1.1",
1721
"@types/jest": "24.0.23",
1822
"@types/node": "12.12.11",
@@ -27,6 +31,7 @@
2731
"jest": "24.9.0",
2832
"prettier": "1.19.1",
2933
"rimraf": "3.0.0",
34+
"semantic-release": "^15.13.31",
3035
"ts-jest": "24.2.0",
3136
"typescript": "3.7.2"
3237
},
@@ -37,10 +42,13 @@
3742
"lint": "eslint 'src/**/*.{js,ts}'",
3843
"test": "npm run lint && npm run tscheck && npm run coverage",
3944
"tscheck": "tsc --noEmit",
45+
"semantic-release": "semantic-release",
4046
"start-example1": "cd ./examples/simple && yarn install && yarn watch",
4147
"start-example2": "cd ./examples/forTests && yarn install && yarn watch"
4248
},
43-
"dependencies": {
44-
"dedent": "^0.7.0"
49+
"collective": {
50+
"type": "opencollective",
51+
"url": "https://opencollective.com/graphql-compose",
52+
"logo": "https://opencollective.com/graphql-compose/logo.txt"
4553
}
4654
}

src/requireSchemaDirectory.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ export interface RequireAstResult {
4242
subscription?: RequireAstRootTypeNode;
4343
}
4444

45-
export const defaultOptions = {
45+
export const defaultOptions: Options = {
4646
extensions: ['js', 'ts'],
47-
} as Options;
47+
};
4848

4949
export function requireSchemaDirectory(
5050
m: NodeModule,
@@ -53,12 +53,12 @@ export function requireSchemaDirectory(
5353
): RequireAstResult {
5454
// if no path was passed in, assume the equivelant of __dirname from caller
5555
// otherwise, resolve path relative to the equivalent of __dirname
56-
path = !path ? dirname(m.filename) : resolve(dirname(m.filename), path);
56+
const schemaPath = !path ? dirname(m.filename) : resolve(dirname(m.filename), path);
5757

5858
const result = {} as RequireAstResult;
5959

60-
fs.readdirSync(path).forEach((filename) => {
61-
const absPath = join(path, filename);
60+
fs.readdirSync(schemaPath).forEach((filename) => {
61+
const absPath = join(schemaPath, filename);
6262

6363
if (fs.statSync(absPath).isDirectory()) {
6464
const dirName = filename;

tsconfig.build.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"declaration": true,
1010
"declarationMap": true,
1111
"skipLibCheck": false,
12-
"strict": true,
12+
"strict": false, // <----- FIX ME
1313
"lib": ["es2017"],
1414
"moduleResolution": "node",
1515
"esModuleInterop": true,

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"compilerOptions": {
33
"composite": true,
4-
"esModuleInterop": true
4+
"esModuleInterop": true,
5+
"strict": true,
56
},
67
"files": [],
78
"include": [],
89
"exclude": ["**/node_modules"],
9-
"references": [{ "path": "./tsconfig.build.json" }, { "path": "./tsconfig.test.json" }]
10+
"references": [{ "path": "./tsconfig.build.json" }]
1011
}

0 commit comments

Comments
 (0)