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

Commit 32eb724

Browse files
committed
chore: refactor yarn scripts
1 parent 19f5bce commit 32eb724

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

packages/graphqlgen/package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,18 @@
1313
"gg": "dist/index.js"
1414
},
1515
"scripts": {
16-
"clean": "rm -rf ./src/tests/**/tmp && rm -rf ./src/tests/**/generated",
17-
"prepublishOnly": "rm -rf example/node_modules && yarn test && yarn build",
16+
"clean": "rm -rf ./src/tests/**/tmp && rm -rf ./src/tests/**/generated && rm -rf ./dist",
17+
"prepublishOnly": "rm -rf example/node_modules && yarn checks && yarn test && yarn build",
18+
"postpublish": "yarn clean",
1819
"benchmarks": "ts-node benchmarks",
19-
"build": "yarn clean && yarn lint && tsc --declaration",
20+
"build": "yarn clean && tsc --declaration",
2021
"watch": "tsc --watch",
21-
"lint": "tslint --project tsconfig.json {src,test}/**/*.ts",
22-
"test": "jest",
2322
"check:types": "yarn tsc --noEmit",
23+
"check:lint": "tslint --project tsconfig.json {src,test}/**/*.ts",
24+
"checks": "yarn check:types && yarn check:lint",
25+
"test": "jest",
2426
"test:watch": "jest --watch",
25-
"test:ci": "yarn lint && jest --maxWorkers 4",
27+
"test:ci": "yarn check:lint && jest --maxWorkers 4",
2628
"gen": "ts-node --files src/index.ts"
2729
},
2830
"repository": {

packages/graphqlgen/src/parse.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ export function parseSchema(schemaPath: string): GraphQLTypes {
9090
// We can assume absolute path is cwd prefixed because
9191
// gg currently only works when run in a directory with the
9292
// graphqlgen manifest.
93-
const absoluteFilePath = Path.join(process.cwd(), filePath)
93+
const absoluteFilePath =
94+
filePath[0] == '/' ? filePath : Path.join(process.cwd(), filePath)
9495

9596
if (!fs.existsSync(absoluteFilePath)) {
9697
console.error(

0 commit comments

Comments
 (0)