Skip to content

Commit

Permalink
[workspace] improve DX while working on Windows (#1272)
Browse files Browse the repository at this point in the history
Co-authored-by: Dominik Sokal <dominik.sokal@swmansion.com>
Co-authored-by: Wojciech Kozyra <wojciech.kozyra@swmansion.com>
  • Loading branch information
3 people authored Aug 16, 2022
1 parent af76a9c commit c8935e1
Show file tree
Hide file tree
Showing 11 changed files with 360 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* text eol=lf
**/yarn.lock linguist-generated
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"singleQuote": true,
"bracketSameLine": true,
"trailingComma": "es5",
"arrowParens": "avoid"
"arrowParens": "avoid",
"endOfLine": "auto"
}
2 changes: 1 addition & 1 deletion packages/eas-cli/graphql-codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ generates:
dedupeOperationSuffix: true
hooks:
afterOneFileWrite:
- ./annotate-graphql-codegen.sh
- 'node ./scripts/annotate-graphql-codegen.js'
./graphql.schema.json:
plugins:
- 'introspection'
290 changes: 290 additions & 0 deletions packages/eas-cli/graphql.schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions packages/eas-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"memfs": "3.4.7",
"mockdate": "3.0.5",
"nock": "13.2.9",
"rimraf": "3.0.2",
"tempy": "0.7.0",
"ts-deepmerge": "2.0.5",
"ts-mockito": "2.6.1",
Expand Down Expand Up @@ -193,16 +194,16 @@
},
"repository": "expo/eas-cli",
"scripts": {
"postpack": "rm -f oclif.manifest.json",
"prepack": "./scripts/prepack.sh",
"postpack": "rimraf oclif.manifest.json",
"prepack": "rimraf build && yarn build && node ./scripts/prepack.js",
"pretarball-ci": "./scripts/pretarball-ci.sh",
"build": "tsc --project tsconfig.build.json",
"watch": "yarn build --watch --preserveWatchOutput",
"typecheck": "tsc",
"test": "jest",
"version": "yarn oclif readme && node scripts/patch-readme && git add README.md",
"generate-graphql-code": "graphql-codegen --config graphql-codegen.yml",
"clean": "rm -rf dist build tmp node_modules yarn-error.log"
"clean": "rimraf dist build tmp node_modules yarn-error.log"
},
"volta": {
"node": "18.6.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/usr/bin/env sh
const fs = require('fs/promises');

OUTFILE="src/graphql/generated.ts"
const path = './src/graphql/generated.ts';

content="/**
(async () => {
const generatedCode = await fs.readFile(path, 'utf8');
const comment = `/**
* This file was generated using GraphQL Codegen
* Command: yarn generate-graphql-code
* Run this during development for automatic type generation when editing GraphQL documents
* For more info and docs, visit https://graphql-code-generator.com/
*/
"
*/\n\n`;

printf '%s\n%s\n' "$content" "$(cat $OUTFILE)" > $OUTFILE
await fs.writeFile(path, comment + generatedCode);
})();
Loading

0 comments on commit c8935e1

Please sign in to comment.