Skip to content

Commit

Permalink
Update dependency typescript to v3.9.5 (#278)
Browse files Browse the repository at this point in the history
* Update dependency typescript to v3.9.5

* Update dependency typescript to v3.9.5

* Fix name clashes in resolvers-types.ts with a hack

I modified indent_style back to "space" in .editorconfig to avoid too
much changes in this commit's diff.

We still have the following problem: "error TS5053: Option 'noEmit'
cannot be specified with option 'composite'."

* Add --composite false to "typecheck:api" npm command

TypeScript incremental build seems to be a problem for projects using
Babel, like Next.js apps:

"error TS5053: Option 'noEmit' cannot be specified with option 'composite'."

So... microsoft/TypeScript#36917

* Suppress TS errors from mocked server context

* Fix *Payload interfaces with a temporary hack

* Fix directories in VS Code workspace config

* Add --composite false to "typecheck:web" npm command

* Add tsconfig.build.json to avoid incremental build

For package/web, which uses Babel.

* Replace GlobalFetch with WindowOrWorkerGlobalScope

GlobalFetch was removed in TS 3.6.2:
apollographql/apollo-link#1131

* Fix root "build" command to use tsconfig.build.json

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Josias Iquabius <iquabius@gmail.com>
  • Loading branch information
3 people committed Jun 17, 2020
1 parent 40c0b94 commit 184e555
Show file tree
Hide file tree
Showing 11 changed files with 648 additions and 447 deletions.
4 changes: 2 additions & 2 deletions olimat.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"folders": [
{
// Servidor Apollo + Prisma
"path": "api"
"path": "packages/api"
},
{
// Aplicação Next.js + React.js
"path": "web"
"path": "packages/web"
}
],
"launch": {
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

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

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
"npm-run-all": "4.1.5",
"prettier": "1.18.2",
"ts-jest": "24.3.0",
"typescript": "3.5.3"
"typescript": "3.9.5"
},
"repository": "github:iquabius/olimat",
"scripts": {
"bootstrap": "npm i && lerna bootstrap && npm run build:skip-web",
"clean": "lerna clean -y && rm -rf node_modules",
"build": "lerna run prebuild && lerna run build && tsc --build --verbose packages",
"build": "lerna run prebuild && lerna run build && tsc --build --verbose packages/tsconfig.build.json",
"build:clean": "lerna run build:clean",
"build:skip-web": "lerna run prebuild && tsc --build --verbose packages",
"build:skip-web": "lerna run prebuild && tsc --build --verbose packages/tsconfig.build.json",
"build:watch": "lerna run prebuild && tsc --build --verbose --watch packages",
"cy:run": "cypress run",
"cy:open": "cypress open",
Expand All @@ -48,7 +48,7 @@
"test:codecov:validate": "curl --data-binary @codecov.yml https://codecov.io/validate",
"test:watch": "jest --watch",
"typecheck": "npm-run-all --parallel typecheck:*",
"typecheck:api": "tsc --noEmit --project packages/api/tsconfig.json",
"typecheck:web": "tsc --noEmit --project packages/web/tsconfig.json"
"typecheck:api": "tsc --noEmit --composite false --project packages/api/tsconfig.json",
"typecheck:web": "tsc --noEmit --composite false --project packages/web/tsconfig.json"
}
}
29 changes: 19 additions & 10 deletions packages/api/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,26 @@ generates:
avoidOptionals: true
contextType: ../utils#OliContext
# Corresponding mapped types should be excluded from generated file
# since they're imported from prisma-client
# since they're imported from prisma-client. But it doesn't look possible.
# So we add a suffix to the imported names to prevent name clashes.
# mapperTypeSuffix: Model
# But it's not supported until v1.13.0
# https://github.com/dotansimha/graphql-code-generator/releases/tag/v1.13.0
# So make this hack for now, as per:
# https://github.com/dotansimha/graphql-code-generator/issues/2932#issuecomment-552910765
mappers:
City: ./prisma-client#City
# Node: ./prisma-client#Node
Olympiad: ./prisma-client#Olympiad
OlympiadConnection: ./prisma-client#OlympiadConnection
Question: ./prisma-client#Question
QuestionConnection: ./prisma-client#QuestionConnection
School: ./prisma-client#School
Exam: ./prisma-client#Exam
User: ./prisma-client#User
# Types from codegen and prisma are incompatible...
AuthPayload: ../utils#AuthPayloadHack
QuestionPayload: ../utils#QuestionPayloadHack
City: import('./prisma-client').City
# Node: import('./prisma-client').Node
Olympiad: import('./prisma-client').Olympiad
OlympiadConnection: import('./prisma-client').OlympiadConnection
Question: import('./prisma-client').Question
QuestionConnection: import('./prisma-client').QuestionConnection
School: import('./prisma-client').School
Exam: import('./prisma-client').Exam
User: import('./prisma-client').User
plugins:
- "typescript-common"
- "typescript-server"
Expand Down
Loading

0 comments on commit 184e555

Please sign in to comment.