From 7eb37b7cf6971f1afc312d21b822e64b1676da76 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 17 Jun 2020 15:09:00 +0000 Subject: [PATCH 01/11] Update dependency typescript to v3.9.5 --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0fcf137cf..524bf5960 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12925,9 +12925,9 @@ "dev": true }, "typescript": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", - "integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==", + "version": "3.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.5.tgz", + "integrity": "sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index 8aef17ef5..fb7c08f2d 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "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": { From 6019194837384fc2714e48cb16dbaa0f52201f90 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 17 Jun 2020 17:35:38 +0000 Subject: [PATCH 02/11] Update dependency typescript to v3.9.5 --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0fcf137cf..524bf5960 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12925,9 +12925,9 @@ "dev": true }, "typescript": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", - "integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==", + "version": "3.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.5.tgz", + "integrity": "sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index 8aef17ef5..fb7c08f2d 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "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": { From 8577eb81bfc1d3b4f362888be8106c65c5afc592 Mon Sep 17 00:00:00 2001 From: Josias Iquabius Date: Wed, 17 Jun 2020 14:31:19 -0400 Subject: [PATCH 03/11] 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'." --- packages/api/codegen.yml | 26 +- .../api/src/__generated__/resolvers-types.ts | 990 ++++++++++-------- 2 files changed, 590 insertions(+), 426 deletions(-) diff --git a/packages/api/codegen.yml b/packages/api/codegen.yml index 924f07ea5..4812d7cd5 100644 --- a/packages/api/codegen.yml +++ b/packages/api/codegen.yml @@ -6,17 +6,23 @@ 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 + 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" diff --git a/packages/api/src/__generated__/resolvers-types.ts b/packages/api/src/__generated__/resolvers-types.ts index c735933d7..181687bdd 100644 --- a/packages/api/src/__generated__/resolvers-types.ts +++ b/packages/api/src/__generated__/resolvers-types.ts @@ -253,6 +253,8 @@ export interface QuestionChoiceUpdateManyInput { connect: Maybe; + set: Maybe; + disconnect: Maybe; deleteMany: Maybe; @@ -725,18 +727,11 @@ export interface DeleteSchoolMutationArgs { id: string; } -import { GraphQLResolveInfo, GraphQLScalarType, GraphQLScalarTypeConfig } from 'graphql'; - import { - City, - Olympiad, - OlympiadConnection, - Question, - QuestionConnection, - School, - Exam, - User, -} from './prisma-client'; + GraphQLResolveInfo, + GraphQLScalarType, + GraphQLScalarTypeConfig, +} from 'graphql'; import { OliContext } from '../utils'; @@ -762,8 +757,15 @@ export interface ISubscriptionResolverObject { ): R | Result | Promise; } -export type SubscriptionResolver = - | ((...args: any[]) => ISubscriptionResolverObject) +export type SubscriptionResolver< + Result, + Parent = {}, + Context = {}, + Args = {} +> = + | (( + ...args: any[] + ) => ISubscriptionResolverObject) | ISubscriptionResolverObject; export type TypeResolveFn = ( @@ -784,65 +786,111 @@ export type DirectiveResolverFn = ( export namespace QueryResolvers { export interface Resolvers { - city?: CityResolver, TypeParent, Context>; - - cities?: CitiesResolver; - - olympiad?: OlympiadResolver, TypeParent, Context>; - - olympiads?: OlympiadsResolver; - - olympiadsConnection?: OlympiadsConnectionResolver; - - question?: QuestionResolver, TypeParent, Context>; - - questions?: QuestionsResolver; - - questionsConnection?: QuestionsConnectionResolver; - - schools?: SchoolsResolver; - - school?: SchoolResolver, TypeParent, Context>; - - exams?: ExamsResolver; - - exam?: ExamResolver, TypeParent, Context>; - - me?: MeResolver, TypeParent, Context>; + city?: CityResolver< + Maybe, + TypeParent, + Context + >; + + cities?: CitiesResolver< + import('./prisma-client').City[], + TypeParent, + Context + >; + + olympiad?: OlympiadResolver< + Maybe, + TypeParent, + Context + >; + + olympiads?: OlympiadsResolver< + import('./prisma-client').Olympiad[], + TypeParent, + Context + >; + + olympiadsConnection?: OlympiadsConnectionResolver< + import('./prisma-client').OlympiadConnection, + TypeParent, + Context + >; + + question?: QuestionResolver< + Maybe, + TypeParent, + Context + >; + + questions?: QuestionsResolver< + import('./prisma-client').Question[], + TypeParent, + Context + >; + + questionsConnection?: QuestionsConnectionResolver< + import('./prisma-client').QuestionConnection, + TypeParent, + Context + >; + + schools?: SchoolsResolver< + import('./prisma-client').School[], + TypeParent, + Context + >; + + school?: SchoolResolver< + Maybe, + TypeParent, + Context + >; + + exams?: ExamsResolver< + import('./prisma-client').Exam[], + TypeParent, + Context + >; + + exam?: ExamResolver< + Maybe, + TypeParent, + Context + >; + + me?: MeResolver, TypeParent, Context>; } - export type CityResolver, Parent = {}, Context = OliContext> = Resolver< - R, - Parent, - Context, - CityArgs - >; + export type CityResolver< + R = Maybe, + Parent = {}, + Context = OliContext + > = Resolver; export interface CityArgs { id: string; } - export type CitiesResolver = Resolver< - R, - Parent, - Context - >; - export type OlympiadResolver, Parent = {}, Context = OliContext> = Resolver< - R, - Parent, - Context, - OlympiadArgs - >; + export type CitiesResolver< + R = import('./prisma-client').City[], + Parent = {}, + Context = OliContext + > = Resolver; + export type OlympiadResolver< + R = Maybe, + Parent = {}, + Context = OliContext + > = Resolver; export interface OlympiadArgs { id: string; } - export type OlympiadsResolver = Resolver< - R, - Parent, - Context - >; + export type OlympiadsResolver< + R = import('./prisma-client').Olympiad[], + Parent = {}, + Context = OliContext + > = Resolver; export type OlympiadsConnectionResolver< - R = OlympiadConnection, + R = import('./prisma-client').OlympiadConnection, Parent = {}, Context = OliContext > = Resolver; @@ -852,23 +900,22 @@ export namespace QueryResolvers { after: Maybe; } - export type QuestionResolver, Parent = {}, Context = OliContext> = Resolver< - R, - Parent, - Context, - QuestionArgs - >; + export type QuestionResolver< + R = Maybe, + Parent = {}, + Context = OliContext + > = Resolver; export interface QuestionArgs { id: string; } - export type QuestionsResolver = Resolver< - R, - Parent, - Context - >; + export type QuestionsResolver< + R = import('./prisma-client').Question[], + Parent = {}, + Context = OliContext + > = Resolver; export type QuestionsConnectionResolver< - R = QuestionConnection, + R = import('./prisma-client').QuestionConnection, Parent = {}, Context = OliContext > = Resolver; @@ -888,64 +935,68 @@ export namespace QueryResolvers { last: Maybe; } - export type SchoolsResolver = Resolver< - R, - Parent, - Context - >; - export type SchoolResolver, Parent = {}, Context = OliContext> = Resolver< - R, - Parent, - Context, - SchoolArgs - >; + export type SchoolsResolver< + R = import('./prisma-client').School[], + Parent = {}, + Context = OliContext + > = Resolver; + export type SchoolResolver< + R = Maybe, + Parent = {}, + Context = OliContext + > = Resolver; export interface SchoolArgs { id: string; } - export type ExamsResolver = Resolver< - R, - Parent, - Context - >; - export type ExamResolver, Parent = {}, Context = OliContext> = Resolver< - R, - Parent, - Context, - ExamArgs - >; + export type ExamsResolver< + R = import('./prisma-client').Exam[], + Parent = {}, + Context = OliContext + > = Resolver; + export type ExamResolver< + R = Maybe, + Parent = {}, + Context = OliContext + > = Resolver; export interface ExamArgs { id: string; } - export type MeResolver, Parent = {}, Context = OliContext> = Resolver< - R, - Parent, - Context - >; + export type MeResolver< + R = Maybe, + Parent = {}, + Context = OliContext + > = Resolver; } export namespace CityResolvers { - export interface Resolvers { + export interface Resolvers< + Context = OliContext, + TypeParent = import('./prisma-client').City + > { id?: IdResolver; name?: NameResolver; } - export type IdResolver = Resolver< - R, - Parent, - Context - >; - export type NameResolver = Resolver< - R, - Parent, - Context - >; + export type IdResolver< + R = string, + Parent = import('./prisma-client').City, + Context = OliContext + > = Resolver; + export type NameResolver< + R = string, + Parent = import('./prisma-client').City, + Context = OliContext + > = Resolver; } export namespace OlympiadResolvers { - export interface Resolvers { + export interface Resolvers< + Context = OliContext, + TypeParent = import('./prisma-client').Olympiad + > { id?: IdResolver; name?: NameResolver; @@ -954,123 +1005,145 @@ export namespace OlympiadResolvers { year?: YearResolver; - createdBy?: CreatedByResolver; + createdBy?: CreatedByResolver< + import('./prisma-client').User, + TypeParent, + Context + >; createdAt?: CreatedAtResolver; updatedAt?: UpdatedAtResolver; } - export type IdResolver = Resolver< - R, - Parent, - Context - >; - export type NameResolver = Resolver< - R, - Parent, - Context - >; + export type IdResolver< + R = string, + Parent = import('./prisma-client').Olympiad, + Context = OliContext + > = Resolver; + export type NameResolver< + R = string, + Parent = import('./prisma-client').Olympiad, + Context = OliContext + > = Resolver; export type IsPublishedResolver< R = Maybe, - Parent = Olympiad, + Parent = import('./prisma-client').Olympiad, + Context = OliContext + > = Resolver; + export type YearResolver< + R = DateTime, + Parent = import('./prisma-client').Olympiad, + Context = OliContext + > = Resolver; + export type CreatedByResolver< + R = import('./prisma-client').User, + Parent = import('./prisma-client').Olympiad, + Context = OliContext + > = Resolver; + export type CreatedAtResolver< + R = DateTime, + Parent = import('./prisma-client').Olympiad, + Context = OliContext + > = Resolver; + export type UpdatedAtResolver< + R = DateTime, + Parent = import('./prisma-client').Olympiad, Context = OliContext > = Resolver; - export type YearResolver = Resolver< - R, - Parent, - Context - >; - export type CreatedByResolver = Resolver< - R, - Parent, - Context - >; - export type CreatedAtResolver = Resolver< - R, - Parent, - Context - >; - export type UpdatedAtResolver = Resolver< - R, - Parent, - Context - >; } export namespace UserResolvers { - export interface Resolvers { + export interface Resolvers< + Context = OliContext, + TypeParent = import('./prisma-client').User + > { id?: IdResolver; email?: EmailResolver; name?: NameResolver; - exams?: ExamsResolver; + exams?: ExamsResolver< + import('./prisma-client').Exam[], + TypeParent, + Context + >; } - export type IdResolver = Resolver< - R, - Parent, - Context - >; - export type EmailResolver = Resolver< - R, - Parent, - Context - >; - export type NameResolver = Resolver< - R, - Parent, - Context - >; - export type ExamsResolver = Resolver< - R, - Parent, - Context - >; + export type IdResolver< + R = string, + Parent = import('./prisma-client').User, + Context = OliContext + > = Resolver; + export type EmailResolver< + R = string, + Parent = import('./prisma-client').User, + Context = OliContext + > = Resolver; + export type NameResolver< + R = string, + Parent = import('./prisma-client').User, + Context = OliContext + > = Resolver; + export type ExamsResolver< + R = import('./prisma-client').Exam[], + Parent = import('./prisma-client').User, + Context = OliContext + > = Resolver; } export namespace ExamResolvers { - export interface Resolvers { + export interface Resolvers< + Context = OliContext, + TypeParent = import('./prisma-client').Exam + > { id?: IdResolver; title?: TitleResolver; description?: DescriptionResolver, TypeParent, Context>; - author?: AuthorResolver; + author?: AuthorResolver< + import('./prisma-client').User, + TypeParent, + Context + >; - questions?: QuestionsResolver, TypeParent, Context>; + questions?: QuestionsResolver< + Maybe, + TypeParent, + Context + >; createdAt?: CreatedAtResolver; updatedAt?: UpdatedAtResolver; } - export type IdResolver = Resolver< - R, - Parent, - Context - >; - export type TitleResolver = Resolver< - R, - Parent, - Context - >; + export type IdResolver< + R = string, + Parent = import('./prisma-client').Exam, + Context = OliContext + > = Resolver; + export type TitleResolver< + R = string, + Parent = import('./prisma-client').Exam, + Context = OliContext + > = Resolver; export type DescriptionResolver< R = Maybe, - Parent = Exam, + Parent = import('./prisma-client').Exam, + Context = OliContext + > = Resolver; + export type AuthorResolver< + R = import('./prisma-client').User, + Parent = import('./prisma-client').Exam, Context = OliContext > = Resolver; - export type AuthorResolver = Resolver< - R, - Parent, - Context - >; export type QuestionsResolver< - R = Maybe, - Parent = Exam, + R = Maybe, + Parent = import('./prisma-client').Exam, Context = OliContext > = Resolver; export interface QuestionsArgs { @@ -1089,20 +1162,23 @@ export namespace ExamResolvers { last: Maybe; } - export type CreatedAtResolver = Resolver< - R, - Parent, - Context - >; - export type UpdatedAtResolver = Resolver< - R, - Parent, - Context - >; + export type CreatedAtResolver< + R = DateTime, + Parent = import('./prisma-client').Exam, + Context = OliContext + > = Resolver; + export type UpdatedAtResolver< + R = DateTime, + Parent = import('./prisma-client').Exam, + Context = OliContext + > = Resolver; } export namespace QuestionResolvers { - export interface Resolvers { + export interface Resolvers< + Context = OliContext, + TypeParent = import('./prisma-client').Question + > { id?: IdResolver; /** O tipo da questão, _múltipla escolha_ ou _discursiva_. */ type?: TypeResolver; @@ -1113,69 +1189,79 @@ export namespace QuestionResolvers { imageFullUrl?: ImageFullUrlResolver, TypeParent, Context>; /** Enunciado secundário, depois da imagem. */ - secondaryWording?: SecondaryWordingResolver, TypeParent, Context>; + secondaryWording?: SecondaryWordingResolver< + Maybe, + TypeParent, + Context + >; /** Alternativas da questão. */ choices?: ChoicesResolver; } - export type IdResolver = Resolver< - R, - Parent, - Context - >; - export type TypeResolver = Resolver< - R, - Parent, - Context - >; - export type WordingResolver = Resolver< - R, - Parent, - Context - >; + export type IdResolver< + R = string, + Parent = import('./prisma-client').Question, + Context = OliContext + > = Resolver; + export type TypeResolver< + R = QuestionType, + Parent = import('./prisma-client').Question, + Context = OliContext + > = Resolver; + export type WordingResolver< + R = string, + Parent = import('./prisma-client').Question, + Context = OliContext + > = Resolver; export type ImageUrlResolver< R = Maybe, - Parent = Question, + Parent = import('./prisma-client').Question, Context = OliContext > = Resolver; export type ImageFullUrlResolver< R = Maybe, - Parent = Question, + Parent = import('./prisma-client').Question, Context = OliContext > = Resolver; export type SecondaryWordingResolver< R = Maybe, - Parent = Question, + Parent = import('./prisma-client').Question, Context = OliContext > = Resolver; export type ChoicesResolver< R = QuestionChoice[], - Parent = Question, + Parent = import('./prisma-client').Question, Context = OliContext > = Resolver; } export namespace QuestionChoiceResolvers { - export interface Resolvers { + export interface Resolvers< + Context = OliContext, + TypeParent = QuestionChoice + > { id?: IdResolver; text?: TextResolver; } - export type IdResolver = Resolver< - R, - Parent, - Context - >; - export type TextResolver = Resolver< - R, - Parent, - Context - >; + export type IdResolver< + R = string, + Parent = QuestionChoice, + Context = OliContext + > = Resolver; + export type TextResolver< + R = string, + Parent = QuestionChoice, + Context = OliContext + > = Resolver; } export namespace OlympiadConnectionResolvers { - export interface Resolvers { + export interface Resolvers< + Context = OliContext, + TypeParent = import('./prisma-client').OlympiadConnection + > { pageInfo?: PageInfoResolver; edges?: EdgesResolver<(Maybe)[], TypeParent, Context>; @@ -1185,17 +1271,17 @@ export namespace OlympiadConnectionResolvers { export type PageInfoResolver< R = PageInfo, - Parent = OlympiadConnection, + Parent = import('./prisma-client').OlympiadConnection, Context = OliContext > = Resolver; export type EdgesResolver< R = (Maybe)[], - Parent = OlympiadConnection, + Parent = import('./prisma-client').OlympiadConnection, Context = OliContext > = Resolver; export type AggregateResolver< R = AggregateOlympiad, - Parent = OlympiadConnection, + Parent = import('./prisma-client').OlympiadConnection, Context = OliContext > = Resolver; } @@ -1211,11 +1297,11 @@ export namespace PageInfoResolvers { endCursor?: EndCursorResolver, TypeParent, Context>; } - export type HasNextPageResolver = Resolver< - R, - Parent, - Context - >; + export type HasNextPageResolver< + R = boolean, + Parent = PageInfo, + Context = OliContext + > = Resolver; export type HasPreviousPageResolver< R = boolean, Parent = PageInfo, @@ -1235,25 +1321,32 @@ export namespace PageInfoResolvers { export namespace OlympiadEdgeResolvers { export interface Resolvers { - node?: NodeResolver; + node?: NodeResolver< + import('./prisma-client').Olympiad, + TypeParent, + Context + >; cursor?: CursorResolver; } - export type NodeResolver = Resolver< - R, - Parent, - Context - >; - export type CursorResolver = Resolver< - R, - Parent, - Context - >; + export type NodeResolver< + R = import('./prisma-client').Olympiad, + Parent = OlympiadEdge, + Context = OliContext + > = Resolver; + export type CursorResolver< + R = string, + Parent = OlympiadEdge, + Context = OliContext + > = Resolver; } export namespace AggregateOlympiadResolvers { - export interface Resolvers { + export interface Resolvers< + Context = OliContext, + TypeParent = AggregateOlympiad + > { count?: CountResolver; } @@ -1265,7 +1358,10 @@ export namespace AggregateOlympiadResolvers { } export namespace QuestionConnectionResolvers { - export interface Resolvers { + export interface Resolvers< + Context = OliContext, + TypeParent = import('./prisma-client').QuestionConnection + > { pageInfo?: PageInfoResolver; edges?: EdgesResolver<(Maybe)[], TypeParent, Context>; @@ -1275,42 +1371,49 @@ export namespace QuestionConnectionResolvers { export type PageInfoResolver< R = PageInfo, - Parent = QuestionConnection, + Parent = import('./prisma-client').QuestionConnection, Context = OliContext > = Resolver; export type EdgesResolver< R = (Maybe)[], - Parent = QuestionConnection, + Parent = import('./prisma-client').QuestionConnection, Context = OliContext > = Resolver; export type AggregateResolver< R = AggregateQuestion, - Parent = QuestionConnection, + Parent = import('./prisma-client').QuestionConnection, Context = OliContext > = Resolver; } export namespace QuestionEdgeResolvers { export interface Resolvers { - node?: NodeResolver; + node?: NodeResolver< + import('./prisma-client').Question, + TypeParent, + Context + >; cursor?: CursorResolver; } - export type NodeResolver = Resolver< - R, - Parent, - Context - >; - export type CursorResolver = Resolver< - R, - Parent, - Context - >; + export type NodeResolver< + R = import('./prisma-client').Question, + Parent = QuestionEdge, + Context = OliContext + > = Resolver; + export type CursorResolver< + R = string, + Parent = QuestionEdge, + Context = OliContext + > = Resolver; } export namespace AggregateQuestionResolvers { - export interface Resolvers { + export interface Resolvers< + Context = OliContext, + TypeParent = AggregateQuestion + > { count?: CountResolver; } @@ -1322,7 +1425,10 @@ export namespace AggregateQuestionResolvers { } export namespace SchoolResolvers { - export interface Resolvers { + export interface Resolvers< + Context = OliContext, + TypeParent = import('./prisma-client').School + > { id?: IdResolver; name?: NameResolver; @@ -1331,62 +1437,66 @@ export namespace SchoolResolvers { phone?: PhoneResolver, TypeParent, Context>; - olympiadCood?: OlympiadCoodResolver; + olympiadCood?: OlympiadCoodResolver< + import('./prisma-client').User, + TypeParent, + Context + >; pedagogyCoord?: PedagogyCoordResolver, TypeParent, Context>; director?: DirectorResolver, TypeParent, Context>; - city?: CityResolver; + city?: CityResolver; address?: AddressResolver, TypeParent, Context>; } - export type IdResolver = Resolver< - R, - Parent, - Context - >; - export type NameResolver = Resolver< - R, - Parent, - Context - >; - export type EmailResolver = Resolver< - R, - Parent, - Context - >; - export type PhoneResolver, Parent = School, Context = OliContext> = Resolver< - R, - Parent, - Context - >; - export type OlympiadCoodResolver = Resolver< - R, - Parent, - Context - >; + export type IdResolver< + R = string, + Parent = import('./prisma-client').School, + Context = OliContext + > = Resolver; + export type NameResolver< + R = string, + Parent = import('./prisma-client').School, + Context = OliContext + > = Resolver; + export type EmailResolver< + R = string, + Parent = import('./prisma-client').School, + Context = OliContext + > = Resolver; + export type PhoneResolver< + R = Maybe, + Parent = import('./prisma-client').School, + Context = OliContext + > = Resolver; + export type OlympiadCoodResolver< + R = import('./prisma-client').User, + Parent = import('./prisma-client').School, + Context = OliContext + > = Resolver; export type PedagogyCoordResolver< R = Maybe, - Parent = School, + Parent = import('./prisma-client').School, + Context = OliContext + > = Resolver; + export type DirectorResolver< + R = Maybe, + Parent = import('./prisma-client').School, + Context = OliContext + > = Resolver; + export type CityResolver< + R = import('./prisma-client').City, + Parent = import('./prisma-client').School, + Context = OliContext + > = Resolver; + export type AddressResolver< + R = Maybe, + Parent = import('./prisma-client').School, Context = OliContext > = Resolver; - export type DirectorResolver, Parent = School, Context = OliContext> = Resolver< - R, - Parent, - Context - >; - export type CityResolver = Resolver< - R, - Parent, - Context - >; - export type AddressResolver, Parent = School, Context = OliContext> = Resolver< - R, - Parent, - Context - >; } export namespace MutationResolvers { @@ -1395,37 +1505,84 @@ export namespace MutationResolvers { login?: LoginResolver; - createCity?: CreateCityResolver; - - deleteCity?: DeleteCityResolver; - - updateCity?: UpdateCityResolver; - - createExam?: CreateExamResolver; - - deleteExam?: DeleteExamResolver; - - createOlympiad?: CreateOlympiadResolver; - - createQuestion?: CreateQuestionResolver; - - deleteQuestion?: DeleteQuestionResolver; - - updateQuestion?: UpdateQuestionResolver; - - createSchool?: CreateSchoolResolver; - - deleteOlympiad?: DeleteOlympiadResolver; - - deleteSchool?: DeleteSchoolResolver; + createCity?: CreateCityResolver< + import('./prisma-client').City, + TypeParent, + Context + >; + + deleteCity?: DeleteCityResolver< + import('./prisma-client').City, + TypeParent, + Context + >; + + updateCity?: UpdateCityResolver< + import('./prisma-client').City, + TypeParent, + Context + >; + + createExam?: CreateExamResolver< + import('./prisma-client').Exam, + TypeParent, + Context + >; + + deleteExam?: DeleteExamResolver< + import('./prisma-client').Exam, + TypeParent, + Context + >; + + createOlympiad?: CreateOlympiadResolver< + import('./prisma-client').Olympiad, + TypeParent, + Context + >; + + createQuestion?: CreateQuestionResolver< + QuestionPayload, + TypeParent, + Context + >; + + deleteQuestion?: DeleteQuestionResolver< + QuestionPayload, + TypeParent, + Context + >; + + updateQuestion?: UpdateQuestionResolver< + QuestionPayload, + TypeParent, + Context + >; + + createSchool?: CreateSchoolResolver< + import('./prisma-client').School, + TypeParent, + Context + >; + + deleteOlympiad?: DeleteOlympiadResolver< + import('./prisma-client').Olympiad, + TypeParent, + Context + >; + + deleteSchool?: DeleteSchoolResolver< + import('./prisma-client').School, + TypeParent, + Context + >; } - export type SignupResolver = Resolver< - R, - Parent, - Context, - SignupArgs - >; + export type SignupResolver< + R = AuthPayload, + Parent = {}, + Context = OliContext + > = Resolver; export interface SignupArgs { email: string; @@ -1434,78 +1591,71 @@ export namespace MutationResolvers { name: string; } - export type LoginResolver = Resolver< - R, - Parent, - Context, - LoginArgs - >; + export type LoginResolver< + R = AuthPayload, + Parent = {}, + Context = OliContext + > = Resolver; export interface LoginArgs { email: string; password: string; } - export type CreateCityResolver = Resolver< - R, - Parent, - Context, - CreateCityArgs - >; + export type CreateCityResolver< + R = import('./prisma-client').City, + Parent = {}, + Context = OliContext + > = Resolver; export interface CreateCityArgs { name: string; } - export type DeleteCityResolver = Resolver< - R, - Parent, - Context, - DeleteCityArgs - >; + export type DeleteCityResolver< + R = import('./prisma-client').City, + Parent = {}, + Context = OliContext + > = Resolver; export interface DeleteCityArgs { id: string; } - export type UpdateCityResolver = Resolver< - R, - Parent, - Context, - UpdateCityArgs - >; + export type UpdateCityResolver< + R = import('./prisma-client').City, + Parent = {}, + Context = OliContext + > = Resolver; export interface UpdateCityArgs { id: string; name: string; } - export type CreateExamResolver = Resolver< - R, - Parent, - Context, - CreateExamArgs - >; + export type CreateExamResolver< + R = import('./prisma-client').Exam, + Parent = {}, + Context = OliContext + > = Resolver; export interface CreateExamArgs { title: string; description: string; } - export type DeleteExamResolver = Resolver< - R, - Parent, - Context, - DeleteExamArgs - >; + export type DeleteExamResolver< + R = import('./prisma-client').Exam, + Parent = {}, + Context = OliContext + > = Resolver; export interface DeleteExamArgs { id: string; } - export type CreateOlympiadResolver = Resolver< - R, - Parent, - Context, - CreateOlympiadArgs - >; + export type CreateOlympiadResolver< + R = import('./prisma-client').Olympiad, + Parent = {}, + Context = OliContext + > = Resolver; export interface CreateOlympiadArgs { name: string; @@ -1539,12 +1689,11 @@ export namespace MutationResolvers { input: UpdateQuestionInput; } - export type CreateSchoolResolver = Resolver< - R, - Parent, - Context, - CreateSchoolArgs - >; + export type CreateSchoolResolver< + R = import('./prisma-client').School, + Parent = {}, + Context = OliContext + > = Resolver; export interface CreateSchoolArgs { name: string; @@ -1561,22 +1710,20 @@ export namespace MutationResolvers { address: Maybe; } - export type DeleteOlympiadResolver = Resolver< - R, - Parent, - Context, - DeleteOlympiadArgs - >; + export type DeleteOlympiadResolver< + R = import('./prisma-client').Olympiad, + Parent = {}, + Context = OliContext + > = Resolver; export interface DeleteOlympiadArgs { id: string; } - export type DeleteSchoolResolver = Resolver< - R, - Parent, - Context, - DeleteSchoolArgs - >; + export type DeleteSchoolResolver< + R = import('./prisma-client').School, + Parent = {}, + Context = OliContext + > = Resolver; export interface DeleteSchoolArgs { id: string; } @@ -1586,28 +1733,35 @@ export namespace AuthPayloadResolvers { export interface Resolvers { token?: TokenResolver; - user?: UserResolver; + user?: UserResolver; } - export type TokenResolver = Resolver< - R, - Parent, - Context - >; - export type UserResolver = Resolver< - R, - Parent, - Context - >; + export type TokenResolver< + R = string, + Parent = AuthPayload, + Context = OliContext + > = Resolver; + export type UserResolver< + R = import('./prisma-client').User, + Parent = AuthPayload, + Context = OliContext + > = Resolver; } export namespace QuestionPayloadResolvers { - export interface Resolvers { - question?: QuestionResolver, TypeParent, Context>; + export interface Resolvers< + Context = OliContext, + TypeParent = QuestionPayload + > { + question?: QuestionResolver< + Maybe, + TypeParent, + Context + >; } export type QuestionResolver< - R = Maybe, + R = Maybe, Parent = QuestionPayload, Context = OliContext > = Resolver; @@ -1619,7 +1773,9 @@ export namespace NodeResolvers { } export type ResolveType< R = 'User' | 'Question', - Parent = User | Question, + Parent = + | import('./prisma-client').User + | import('./prisma-client').Question, Context = OliContext > = TypeResolveFn; } @@ -1668,10 +1824,12 @@ export interface DeprecatedDirectiveArgs { reason: string; } -export interface DateTimeScalarConfig extends GraphQLScalarTypeConfig { +export interface DateTimeScalarConfig + extends GraphQLScalarTypeConfig { name: 'DateTime'; } -export interface UploadScalarConfig extends GraphQLScalarTypeConfig { +export interface UploadScalarConfig + extends GraphQLScalarTypeConfig { name: 'Upload'; } From 092d39b22a1442b28f12e5834f87a39fd96e09f7 Mon Sep 17 00:00:00 2001 From: Josias Iquabius Date: Wed, 17 Jun 2020 15:53:06 -0400 Subject: [PATCH 04/11] 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... https://github.com/microsoft/TypeScript/issues/36917 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fb7c08f2d..c5d403b9d 100644 --- a/package.json +++ b/package.json @@ -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:api": "tsc --noEmit --composite false --project packages/api/tsconfig.json", "typecheck:web": "tsc --noEmit --project packages/web/tsconfig.json" } } From dac8cd94aad518bbfca3d805b4cbb344a45812b9 Mon Sep 17 00:00:00 2001 From: Josias Iquabius Date: Wed, 17 Jun 2020 15:55:03 -0400 Subject: [PATCH 05/11] Suppress TS errors from mocked server context --- packages/api/src/__tests__/resolvers/__utils/mockContext.ts | 2 ++ packages/api/src/__tests__/resolvers/question.ts | 2 ++ packages/api/src/__tests__/resolvers/test.ts | 3 +++ 3 files changed, 7 insertions(+) diff --git a/packages/api/src/__tests__/resolvers/__utils/mockContext.ts b/packages/api/src/__tests__/resolvers/__utils/mockContext.ts index 16962b880..f63a92222 100644 --- a/packages/api/src/__tests__/resolvers/__utils/mockContext.ts +++ b/packages/api/src/__tests__/resolvers/__utils/mockContext.ts @@ -5,6 +5,8 @@ import { OliContext } from '@olimat/api/utils'; const createMockContext = jest.fn(() => ({ // @ts-ignore prisma: { + // This gives an error when using it: + // "error TS2339: Property 'mockReturnValueOnce' does not exist on type" question: jest.fn(), exam: jest.fn(), }, diff --git a/packages/api/src/__tests__/resolvers/question.ts b/packages/api/src/__tests__/resolvers/question.ts index 2a4e6c5ca..b5d0f61fd 100644 --- a/packages/api/src/__tests__/resolvers/question.ts +++ b/packages/api/src/__tests__/resolvers/question.ts @@ -1,6 +1,7 @@ import { Question } from '@olimat/api/__generated__/prisma-client'; import resolvers from '@olimat/api/resolvers'; +// eslint-disable-next-line import/order import mockContext from './__utils/mockContext'; const mockQuestion: Question = { @@ -13,6 +14,7 @@ describe('[Question.choices]', () => { test('uses question id from parent to lookup choices', async () => { const mockChoices = [{ id: 'cId1' }]; // o prisma client usa métodos encadeados pra buscar relações + // @ts-ignore mockContext.prisma.question.mockReturnValueOnce({ choices: () => mockChoices, }); diff --git a/packages/api/src/__tests__/resolvers/test.ts b/packages/api/src/__tests__/resolvers/test.ts index 4a8d73b33..a39e13a47 100644 --- a/packages/api/src/__tests__/resolvers/test.ts +++ b/packages/api/src/__tests__/resolvers/test.ts @@ -14,6 +14,7 @@ describe('[Exam.author]', () => { test('uses exam id from parent to lookup author', async () => { const mockAuthor = { id: 'aId1' }; // o prisma client usa métodos encadeados pra buscar relações + // @ts-ignore mockContext.prisma.exam.mockReturnValueOnce({ author: () => mockAuthor, }); @@ -30,6 +31,7 @@ describe('[Exam.author]', () => { describe('[Exam.questions]', () => { test('uses exam id from parent to lookup questions', async () => { const mockQuestions = [{ id: 'qId1', wording: 'Questão 1' }]; + // @ts-ignore mockContext.prisma.exam.mockReturnValueOnce({ questions: () => mockQuestions, }); @@ -46,6 +48,7 @@ describe('[Exam.questions]', () => { }); test('returns empty array if no response', async () => { + // @ts-ignore mockContext.prisma.exam.mockReturnValueOnce({ questions: () => [], }); From 020b901cde2f5b02ff837de6b71bad4976a41da9 Mon Sep 17 00:00:00 2001 From: Josias Iquabius Date: Wed, 17 Jun 2020 15:58:44 -0400 Subject: [PATCH 06/11] Fix *Payload interfaces with a temporary hack --- packages/api/codegen.yml | 13 ++++--- .../api/src/__generated__/resolvers-types.ts | 35 +++++++++++-------- packages/api/src/utils.ts | 15 +++++++- 3 files changed, 42 insertions(+), 21 deletions(-) diff --git a/packages/api/codegen.yml b/packages/api/codegen.yml index 4812d7cd5..efa12f6b8 100644 --- a/packages/api/codegen.yml +++ b/packages/api/codegen.yml @@ -8,12 +8,15 @@ generates: # Corresponding mapped types should be excluded from generated file # 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 + # 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: + # 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 diff --git a/packages/api/src/__generated__/resolvers-types.ts b/packages/api/src/__generated__/resolvers-types.ts index 181687bdd..6bbd934d8 100644 --- a/packages/api/src/__generated__/resolvers-types.ts +++ b/packages/api/src/__generated__/resolvers-types.ts @@ -733,6 +733,8 @@ import { GraphQLScalarTypeConfig, } from 'graphql'; +import { AuthPayloadHack, QuestionPayloadHack } from '../utils'; + import { OliContext } from '../utils'; export type Resolver = ( @@ -1501,9 +1503,9 @@ export namespace SchoolResolvers { export namespace MutationResolvers { export interface Resolvers { - signup?: SignupResolver; + signup?: SignupResolver; - login?: LoginResolver; + login?: LoginResolver; createCity?: CreateCityResolver< import('./prisma-client').City, @@ -1542,19 +1544,19 @@ export namespace MutationResolvers { >; createQuestion?: CreateQuestionResolver< - QuestionPayload, + QuestionPayloadHack, TypeParent, Context >; deleteQuestion?: DeleteQuestionResolver< - QuestionPayload, + QuestionPayloadHack, TypeParent, Context >; updateQuestion?: UpdateQuestionResolver< - QuestionPayload, + QuestionPayloadHack, TypeParent, Context >; @@ -1579,7 +1581,7 @@ export namespace MutationResolvers { } export type SignupResolver< - R = AuthPayload, + R = AuthPayloadHack, Parent = {}, Context = OliContext > = Resolver; @@ -1592,7 +1594,7 @@ export namespace MutationResolvers { } export type LoginResolver< - R = AuthPayload, + R = AuthPayloadHack, Parent = {}, Context = OliContext > = Resolver; @@ -1663,7 +1665,7 @@ export namespace MutationResolvers { } export type CreateQuestionResolver< - R = QuestionPayload, + R = QuestionPayloadHack, Parent = {}, Context = OliContext > = Resolver; @@ -1672,7 +1674,7 @@ export namespace MutationResolvers { } export type DeleteQuestionResolver< - R = QuestionPayload, + R = QuestionPayloadHack, Parent = {}, Context = OliContext > = Resolver; @@ -1681,7 +1683,7 @@ export namespace MutationResolvers { } export type UpdateQuestionResolver< - R = QuestionPayload, + R = QuestionPayloadHack, Parent = {}, Context = OliContext > = Resolver; @@ -1730,7 +1732,10 @@ export namespace MutationResolvers { } export namespace AuthPayloadResolvers { - export interface Resolvers { + export interface Resolvers< + Context = OliContext, + TypeParent = AuthPayloadHack + > { token?: TokenResolver; user?: UserResolver; @@ -1738,12 +1743,12 @@ export namespace AuthPayloadResolvers { export type TokenResolver< R = string, - Parent = AuthPayload, + Parent = AuthPayloadHack, Context = OliContext > = Resolver; export type UserResolver< R = import('./prisma-client').User, - Parent = AuthPayload, + Parent = AuthPayloadHack, Context = OliContext > = Resolver; } @@ -1751,7 +1756,7 @@ export namespace AuthPayloadResolvers { export namespace QuestionPayloadResolvers { export interface Resolvers< Context = OliContext, - TypeParent = QuestionPayload + TypeParent = QuestionPayloadHack > { question?: QuestionResolver< Maybe, @@ -1762,7 +1767,7 @@ export namespace QuestionPayloadResolvers { export type QuestionResolver< R = Maybe, - Parent = QuestionPayload, + Parent = QuestionPayloadHack, Context = OliContext > = Resolver; } diff --git a/packages/api/src/utils.ts b/packages/api/src/utils.ts index 1cd43f4c0..b4227fedb 100644 --- a/packages/api/src/utils.ts +++ b/packages/api/src/utils.ts @@ -1,7 +1,7 @@ import express from 'express'; import jwt from 'jsonwebtoken'; -import { Prisma } from './__generated__/prisma-client'; +import { Prisma, User, Question } from './__generated__/prisma-client'; // Tem que ser um nome diferente de 'Context', porque o graphql-code-generator // usa esse nome internamente. @@ -11,6 +11,19 @@ export interface OliContext { config: any; } +// These Hack interfaces where added because the ones generated by codegen are +// incompatible with the ones from prisma. +export interface AuthPayloadHack { + token: string; + + user: User; +} + +export type Maybe = T | null; +export interface QuestionPayloadHack { + question: Maybe; +} + export function getUserId(ctx: OliContext) { const Authorization = ctx.req.get('Authorization'); // Apollo Client sets header to the string 'null' when not logged in From 37c67f9a94eb95f64698ec069aaaf5b9837dce88 Mon Sep 17 00:00:00 2001 From: Josias Iquabius Date: Wed, 17 Jun 2020 15:59:30 -0400 Subject: [PATCH 07/11] Fix directories in VS Code workspace config --- olimat.code-workspace | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/olimat.code-workspace b/olimat.code-workspace index 618a08a34..ac3277eaf 100644 --- a/olimat.code-workspace +++ b/olimat.code-workspace @@ -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": { From f7ee680ef27e657e5d277e43d624a7bbf324ddec Mon Sep 17 00:00:00 2001 From: Josias Iquabius Date: Wed, 17 Jun 2020 16:17:44 -0400 Subject: [PATCH 08/11] Add --composite false to "typecheck:web" npm command --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c5d403b9d..40863219a 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,6 @@ "test:watch": "jest --watch", "typecheck": "npm-run-all --parallel typecheck:*", "typecheck:api": "tsc --noEmit --composite false --project packages/api/tsconfig.json", - "typecheck:web": "tsc --noEmit --project packages/web/tsconfig.json" + "typecheck:web": "tsc --noEmit --composite false --project packages/web/tsconfig.json" } } From 0ae88a61637438636638e4156bf75929cc119b27 Mon Sep 17 00:00:00 2001 From: Josias Iquabius Date: Wed, 17 Jun 2020 16:44:28 -0400 Subject: [PATCH 09/11] Add tsconfig.build.json to avoid incremental build For package/web, which uses Babel. --- package.json | 2 +- packages/tsconfig.build.json | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 packages/tsconfig.build.json diff --git a/package.json b/package.json index 40863219a..55b7a8a29 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "clean": "lerna clean -y && rm -rf node_modules", "build": "lerna run prebuild && lerna run build && tsc --build --verbose packages", "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", diff --git a/packages/tsconfig.build.json b/packages/tsconfig.build.json new file mode 100644 index 000000000..7e3da51a1 --- /dev/null +++ b/packages/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + "files": [], + "references": [ + { "path": "api" }, + // "error TS5053: Option 'noEmit' cannot be specified with option 'composite'." + // TS incremental build is not playing well with Babel projects + // { "path": "web" } + ] +} From 2c723234ca0d01c5fd3a4e083116e0198e2c187e Mon Sep 17 00:00:00 2001 From: Josias Iquabius Date: Wed, 17 Jun 2020 16:55:46 -0400 Subject: [PATCH 10/11] Replace GlobalFetch with WindowOrWorkerGlobalScope GlobalFetch was removed in TS 3.6.2: https://github.com/apollographql/apollo-link/issues/1131 --- packages/web/global.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web/global.d.ts b/packages/web/global.d.ts index 4b8b2b139..784576d12 100644 --- a/packages/web/global.d.ts +++ b/packages/web/global.d.ts @@ -1,6 +1,6 @@ declare namespace NodeJS { // O initApollo.ts faz polyfill do fetch no servidor - interface Global extends GlobalFetch {} + interface Global extends WindowOrWorkerGlobalScope {} interface Process { browser: boolean; } From 9c3c72b8cdc80a55fe25d22a87ecfb867cdf79ee Mon Sep 17 00:00:00 2001 From: Josias Iquabius Date: Wed, 17 Jun 2020 17:04:34 -0400 Subject: [PATCH 11/11] Fix root "build" command to use tsconfig.build.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 55b7a8a29..b8de994a3 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "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/tsconfig.build.json", "build:watch": "lerna run prebuild && tsc --build --verbose --watch packages",