-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added support for generating type definitions from the graphql …
…schemas
- Loading branch information
1 parent
a477265
commit e4a8482
Showing
22 changed files
with
9,530 additions
and
5,767 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,115 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": true, | ||
"tsconfigRootDir": ".", | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["@typescript-eslint", "sonarjs", "jest", "prettier"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"airbnb-base", | ||
"airbnb-typescript/base", | ||
"plugin:jest/recommended", | ||
"plugin:sonarjs/recommended", | ||
"plugin:@typescript-eslint/strict-type-checked", | ||
"plugin:@typescript-eslint/stylistic-type-checked", | ||
"plugin:prettier/recommended" | ||
], | ||
"ignorePatterns": ["**/node_modules/**", "dist/**", "src/entity/**"], | ||
"rules": { | ||
// These rules are for reference only. | ||
//#region eslint | ||
"class-methods-use-this": "off", | ||
// https://github.com/typescript-eslint/typescript-eslint/issues/1277 | ||
"consistent-return": "off", | ||
"func-names": "off", | ||
"max-len": ["error", { "code": 140, "ignoreTemplateLiterals": true, "ignoreUrls": true }], | ||
"newline-per-chained-call": "off", | ||
"no-await-in-loop": "off", | ||
"no-continue": "off", | ||
// https://github.com/airbnb/javascript/issues/1342 | ||
"no-param-reassign": ["error", { "props": false }], | ||
// https://github.com/airbnb/javascript/issues/1271 | ||
// https://github.com/airbnb/javascript/blob/fd77bbebb77362ddecfef7aba3bf6abf7bdd81f2/packages/eslint-config-airbnb-base/rules/style.js#L340-L358 | ||
"no-restricted-syntax": ["error", "ForInStatement", "LabeledStatement", "WithStatement"], | ||
"no-underscore-dangle": ["error", { "allow": ["_id"] }], | ||
"no-void": ["error", { "allowAsStatement": true }], | ||
"object-curly-newline": "off", | ||
"spaced-comment": ["error", "always", { "line": { "markers": ["/", "#region", "#endregion"] } }], | ||
//#endregion | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": true, | ||
"tsconfigRootDir": ".", | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["@typescript-eslint", "sonarjs", "jest", "prettier"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"airbnb-base", | ||
"airbnb-typescript/base", | ||
"plugin:jest/recommended", | ||
"plugin:sonarjs/recommended", | ||
"plugin:@typescript-eslint/strict-type-checked", | ||
"plugin:@typescript-eslint/stylistic-type-checked", | ||
"plugin:prettier/recommended" | ||
], | ||
"ignorePatterns": ["**/node_modules/**", "dist/**", "*.graphql"], | ||
"rules": { | ||
// These rules are for reference only. | ||
//#region eslint | ||
"class-methods-use-this": "off", | ||
// https://github.com/typescript-eslint/typescript-eslint/issues/1277 | ||
"consistent-return": "off", | ||
"func-names": "off", | ||
"max-len": ["error", { "code": 140, "ignoreTemplateLiterals": true, "ignoreUrls": true }], | ||
"newline-per-chained-call": "off", | ||
"no-await-in-loop": "off", | ||
"no-continue": "off", | ||
// https://github.com/airbnb/javascript/issues/1342 | ||
"no-param-reassign": ["error", { "props": false }], | ||
// https://github.com/airbnb/javascript/issues/1271 | ||
// https://github.com/airbnb/javascript/blob/fd77bbebb77362ddecfef7aba3bf6abf7bdd81f2/packages/eslint-config-airbnb-base/rules/style.js#L340-L358 | ||
"no-restricted-syntax": ["error", "ForInStatement", "LabeledStatement", "WithStatement"], | ||
"no-underscore-dangle": ["error", { "allow": ["_id"] }], | ||
"no-void": ["error", { "allowAsStatement": true }], | ||
"object-curly-newline": "off", | ||
"spaced-comment": [ | ||
"error", | ||
"always", | ||
{ "line": { "markers": ["/", "#region", "#endregion"] } } | ||
], | ||
//#endregion | ||
|
||
//#region import | ||
"import/extensions": ["error", "never"], | ||
// https://github.com/benmosher/eslint-plugin-import/issues/1753 | ||
"import/named": "off", | ||
"import/no-default-export": "error", | ||
"import/order": [ | ||
"error", | ||
{ | ||
"groups": [["builtin", "external", "internal"]], | ||
"newlines-between": "always", | ||
"alphabetize": { "order": "asc", "caseInsensitive": true } | ||
} | ||
], | ||
"import/prefer-default-export": "off", | ||
//#endregion | ||
//#region import | ||
"import/extensions": ["error", "never"], | ||
// https://github.com/benmosher/eslint-plugin-import/issues/1753 | ||
"import/named": "off", | ||
"import/no-default-export": "error", | ||
"import/order": [ | ||
"error", | ||
{ | ||
"groups": [["builtin", "external", "internal"]], | ||
"newlines-between": "always", | ||
"alphabetize": { "order": "asc", "caseInsensitive": true } | ||
} | ||
], | ||
"import/prefer-default-export": "off", | ||
//#endregion | ||
|
||
//#region @typescript-eslint | ||
"@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "angle-bracket" }], | ||
"@typescript-eslint/lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }], | ||
"@typescript-eslint/naming-convention": [ | ||
"error", | ||
{ "selector": "default", "format": ["strictCamelCase"] }, | ||
{ "selector": "variable", "format": ["strictCamelCase", "UPPER_CASE", "StrictPascalCase"] }, | ||
// https://github.com/microsoft/TypeScript/issues/9458 | ||
{ | ||
"selector": "parameter", | ||
"modifiers": ["unused"], | ||
"format": ["strictCamelCase"], | ||
"leadingUnderscore": "allow" | ||
}, | ||
{ "selector": "property", "format": null }, | ||
{ "selector": "typeProperty", "format": null }, | ||
{ "selector": "typeLike", "format": ["StrictPascalCase"] }, | ||
{ "selector": "enumMember", "format": ["UPPER_CASE"] } | ||
], | ||
"@typescript-eslint/no-extraneous-class": "off", | ||
"@typescript-eslint/no-unsafe-member-access": "off", | ||
//#endregion | ||
//#region @typescript-eslint | ||
"@typescript-eslint/consistent-type-assertions": [ | ||
"error", | ||
{ "assertionStyle": "angle-bracket" } | ||
], | ||
"@typescript-eslint/lines-between-class-members": [ | ||
"error", | ||
"always", | ||
{ "exceptAfterSingleLine": true } | ||
], | ||
"@typescript-eslint/naming-convention": [ | ||
"error", | ||
{ "selector": "default", "format": ["strictCamelCase"] }, | ||
{ "selector": "variable", "format": ["strictCamelCase", "UPPER_CASE", "StrictPascalCase"] }, | ||
// https://github.com/microsoft/TypeScript/issues/9458 | ||
{ | ||
"selector": "parameter", | ||
"modifiers": ["unused"], | ||
"format": ["strictCamelCase"], | ||
"leadingUnderscore": "allow" | ||
}, | ||
{ "selector": "property", "format": null }, | ||
{ "selector": "typeProperty", "format": null }, | ||
{ "selector": "typeLike", "format": ["StrictPascalCase"] }, | ||
{ "selector": "enumMember", "format": ["UPPER_CASE"] } | ||
], | ||
"@typescript-eslint/no-extraneous-class": "off", | ||
"@typescript-eslint/no-unsafe-member-access": "off", | ||
//#endregion | ||
|
||
//#region sonarjs | ||
"sonarjs/no-duplicate-string": "off", | ||
"sonarjs/cognitive-complexity": ["error", 25], | ||
//#endregion | ||
//#region sonarjs | ||
"sonarjs/no-duplicate-string": "off", | ||
"sonarjs/cognitive-complexity": ["error", 25], | ||
//#endregion | ||
|
||
"prettier/prettier": [ | ||
"error", | ||
{ | ||
"singleQuote": true, | ||
"endOfLine": "auto" | ||
} | ||
], | ||
"prettier/prettier": [ | ||
"error", | ||
{ | ||
"singleQuote": true, | ||
"endOfLine": "auto" | ||
} | ||
], | ||
|
||
"quotes": [ | ||
2, | ||
"single", | ||
{ | ||
"avoidEscape": true, | ||
"allowTemplateLiterals": true | ||
} | ||
] | ||
} | ||
"quotes": [ | ||
2, | ||
"single", | ||
{ | ||
"avoidEscape": true, | ||
"allowTemplateLiterals": true | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,70 @@ | ||
{ | ||
"scss.lint.unknownAtRules": "ignore", | ||
"files.eol": "\n", | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": true, | ||
"editor.detectIndentation": true, | ||
"editor.fontLigatures": false, | ||
"editor.snippetSuggestions": "top", | ||
"editor.suggest.localityBonus": true, | ||
"editor.acceptSuggestionOnCommitCharacter": false, | ||
"editor.renderWhitespace": "boundary", | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
"editor.cursorSmoothCaretAnimation": "on", | ||
"editor.fontSize": 20, | ||
"editor.minimap.enabled": false, | ||
"editor.tabSize": 2, | ||
"scss.lint.unknownAtRules": "ignore", | ||
"files.eol": "\n", | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": true, | ||
"editor.detectIndentation": true, | ||
"editor.fontLigatures": false, | ||
"editor.snippetSuggestions": "top", | ||
"editor.suggest.localityBonus": true, | ||
"editor.acceptSuggestionOnCommitCharacter": false, | ||
"editor.renderWhitespace": "boundary", | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
"editor.cursorSmoothCaretAnimation": "on", | ||
"editor.fontSize": 30, | ||
"editor.minimap.enabled": false, | ||
"editor.tabSize": 2, | ||
|
||
"files.trimTrailingWhitespace": true, | ||
"files.trimFinalNewlines": true, | ||
"files.trimTrailingWhitespace": true, | ||
"files.trimFinalNewlines": true, | ||
|
||
"workbench.sideBar.location": "right", | ||
"workbench.sideBar.location": "right", | ||
|
||
"javascript.updateImportsOnFileMove.enabled": "always", | ||
"javascript.updateImportsOnFileMove.enabled": "always", | ||
|
||
"typescript.validate.enable": true, | ||
"typescript.validate.enable": true, | ||
|
||
"files.autoSave": "off", | ||
"files.exclude": { | ||
"USE_GITIGNORE": true | ||
}, | ||
"files.defaultLanguage": "{activeEditorLanguage}", | ||
"files.autoSave": "off", | ||
"files.exclude": { | ||
"USE_GITIGNORE": true | ||
}, | ||
"files.defaultLanguage": "{activeEditorLanguage}", | ||
|
||
"javascript.validate.enable": true, // Highligts the unused imports when true | ||
"editor.showUnused": true, // Highligts the unused imports when true | ||
"javascript.validate.enable": true, // Highligts the unused imports when true | ||
"editor.showUnused": true, // Highligts the unused imports when true | ||
|
||
"search.exclude": { | ||
"**/node_modules": true, | ||
"**/bower_components": true, | ||
"**/*.code-search": true, | ||
"**/build": true, | ||
"**/.build": true | ||
}, | ||
"search.exclude": { | ||
"**/node_modules": true, | ||
"**/bower_components": true, | ||
"**/*.code-search": true, | ||
"**/build": true, | ||
"**/.build": true | ||
}, | ||
|
||
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"], | ||
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"], | ||
|
||
"breadcrumbs.enabled": true, | ||
"npm.runSilent": true, | ||
"explorer.confirmDragAndDrop": true, | ||
"breadcrumbs.enabled": true, | ||
"npm.runSilent": true, | ||
"explorer.confirmDragAndDrop": true, | ||
|
||
"[javascript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.suggestSelection": "recentlyUsedByPrefix", | ||
"editor.suggest.showKeywords": true | ||
}, | ||
"[javascript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.suggestSelection": "recentlyUsedByPrefix", | ||
"editor.suggest.showKeywords": true | ||
}, | ||
|
||
"[json]": { | ||
"breadcrumbs.showBooleans": true | ||
}, | ||
"[json]": { | ||
"breadcrumbs.showBooleans": true | ||
}, | ||
|
||
"files.associations": { | ||
"*.react.js": "javascriptreact", | ||
"*.jsx": "javascriptreact" | ||
}, | ||
"terminal.integrated.fontSize": 20, | ||
"screencastMode.fontSize": 59, | ||
"scm.inputFontSize": 20 | ||
"files.associations": { | ||
"*.react.js": "javascriptreact", | ||
"*.jsx": "javascriptreact" | ||
}, | ||
"terminal.integrated.fontSize": 20, | ||
"screencastMode.fontSize": 59, | ||
"scm.inputFontSize": 20 | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodeLinker: node-modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
"license": "UNLICENSED", | ||
"scripts": { | ||
"build": "nest build", | ||
"lint": "yarn run eslint ./src/** --ext ts,tsx --fix", | ||
"lint": "yarn run eslint ./src/**/*.{ts,tsx} --fix", | ||
"format": "prettier --write ./src", | ||
"ts-validate": "tsc", | ||
"validate": "yarn run ts-validate && yarn run format && yarn run lint", | ||
|
@@ -20,14 +20,20 @@ | |
"test:cov": "jest --coverage", | ||
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", | ||
"test:e2e": "jest --config ./test/jest-e2e.json", | ||
"prepare": "husky install" | ||
"prepare": "husky install", | ||
"gql-to-interfaces": "cd ./src && ts-node schema-to-typings" | ||
}, | ||
"dependencies": { | ||
"@apollo/server": "^4.10.4", | ||
"@nestjs/apollo": "^12.1.0", | ||
"@nestjs/common": "^10.0.0", | ||
"@nestjs/core": "^10.0.0", | ||
"@nestjs/graphql": "^12.1.1", | ||
"@nestjs/platform-express": "^10.0.0", | ||
"graphql": "^16.8.1", | ||
"reflect-metadata": "^0.1.13", | ||
"rxjs": "^7.8.1" | ||
"rxjs": "^7.8.1", | ||
"ts-morph": "^22.0.0" | ||
}, | ||
"devDependencies": { | ||
"@nestjs/cli": "^10.0.0", | ||
|
@@ -47,6 +53,7 @@ | |
"eslint-plugin-jest": "^27.6.0", | ||
"eslint-plugin-prettier": "^5.1.2", | ||
"eslint-plugin-sonarjs": "^0.23.0", | ||
"husky": "^8.0.0", | ||
"jest": "^29.5.0", | ||
"prettier": "^3.0.0", | ||
"source-map-support": "^0.5.21", | ||
|
@@ -55,8 +62,7 @@ | |
"ts-loader": "^9.4.3", | ||
"ts-node": "^10.9.1", | ||
"tsconfig-paths": "^4.2.0", | ||
"typescript": "^5.1.3", | ||
"husky": "^8.0.0" | ||
"typescript": "^5.1.3" | ||
}, | ||
"jest": { | ||
"moduleFileExtensions": [ | ||
|
@@ -74,5 +80,6 @@ | |
], | ||
"coverageDirectory": "../coverage", | ||
"testEnvironment": "node" | ||
} | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
Oops, something went wrong.