expedition icon indicating copy to clipboard operation
expedition copied to clipboard

Upgrade to Node 12

Open toddmedema opened this issue 6 years ago • 3 comments

Fixes #804 , including update to typescript and a bunch of other dependencies because a lot of them were years out of date + didn't like the upgrade

toddmedema avatar Nov 14 '19 04:11 toddmedema

Errors remaining:

ERROR in [at-loader] ../../shared/schema/Constants.tsx:2:29 
    TS2345: Argument of type '(k: keyof T) => T[keyof T]' is not assignable to parameter of type '(value: string, index: number, array: string[]) => T[keyof T]'.
  Types of parameters 'k' and 'value' are incompatible.
    Type 'string' is not assignable to type 'keyof T'.

ERROR in [at-loader] ../api/src/models/Users.ts:32:46 
    TS2551: Property 'dataValues' does not exist on type 'Model<unknown, unknown>'. Did you mean 'getDataValue'?

ERROR in [at-loader] ../api/src/models/Users.ts:41:47 
    TS2551: Property 'dataValues' does not exist on type 'Model<unknown, unknown>'. Did you mean 'getDataValue'?

ERROR in [at-loader] ../api/src/models/Quests.ts:88:5 
    TS2326: Types of property '[Op.ne]' are incompatible.
  Type 'null' is not assignable to type 'string | number | Literal | WhereOperators | undefined'.

ERROR in [at-loader] ../api/src/models/Quests.ts:191:3 
    TS2322: Type 'Promise<Model<unknown, unknown>[]>' is not assignable to type 'Bluebird<QuestInstance[]>'.
  Type 'Model<unknown, unknown>[]' is not assignable to type 'QuestInstance[]'.
    Property 'dataValues' is missing in type 'Model<unknown, unknown>' but required in type 'QuestInstance'.

ERROR in [at-loader] ../api/src/models/Feedback.ts:31:3 
    TS2322: Type 'Promise<Model<unknown, unknown> | null>' is not assignable to type 'Bluebird<FeedbackInstance | null>'.
  Type 'Model<unknown, unknown> | null' is not assignable to type 'FeedbackInstance | null'.
    Property 'dataValues' is missing in type 'Model<unknown, unknown>' but required in type 'FeedbackInstance'.

ERROR in [at-loader] ../api/src/models/Feedback.ts:39:3 
    TS2322: Type 'Promise<Model<unknown, unknown>[]>' is not assignable to type 'Bluebird<FeedbackInstance[]>'.
  Type 'Model<unknown, unknown>[]' is not assignable to type 'FeedbackInstance[]'.
    Type 'Model<unknown, unknown>' is not assignable to type 'FeedbackInstance'.

ERROR in [at-loader] ../api/src/models/multiplayer/Events.ts:18:3 
    TS2322: Type 'Promise<Model<unknown, unknown> | null>' is not assignable to type 'Bluebird<EventInstance | null>'.
  Type 'Model<unknown, unknown> | null' is not assignable to type 'EventInstance | null'.
    Property 'dataValues' is missing in type 'Model<unknown, unknown>' but required in type 'EventInstance'.

ERROR in [at-loader] ../api/src/models/multiplayer/Events.ts:29:3 
    TS2322: Type 'Promise<Model<unknown, unknown>[]>' is not assignable to type 'Bluebird<EventInstance[] | null>'.
  Type 'Model<unknown, unknown>[]' is not assignable to type 'EventInstance[]'.
    Type 'Model<unknown, unknown>' is not assignable to type 'EventInstance'.

ERROR in [at-loader] ../api/src/models/multiplayer/SessionClients.ts:15:3 
    TS2322: Type 'Promise<Model<unknown, unknown>[]>' is not assignable to type 'Bluebird<SessionClientInstance[]>'.
  Type 'Model<unknown, unknown>[]' is not assignable to type 'SessionClientInstance[]'.
    Property 'dataValues' is missing in type 'Model<unknown, unknown>' but required in type 'SessionClientInstance'.

ERROR in [at-loader] ../api/src/models/multiplayer/Sessions.ts:21:3 
    TS2322: Type 'Promise<Model<unknown, unknown>>' is not assignable to type 'Bluebird<SessionInstance>'.
  Property 'dataValues' is missing in type 'Model<unknown, unknown>' but required in type 'SessionInstance'.

toddmedema avatar Nov 24 '19 19:11 toddmedema

I'm having some issues reproducing those errors / getting a good build (crostini / cloud-shell hijinks)... but here's some hints that might help:

The dataValues errors you're getting make it sound like that field isn't present in the typings for Sequelize. In Sequelize v5 it appears there's no dataValues anymore - see here fore more details on this. You may be able to replace instances of .dataValues with .get() per here.

There's also different typing suggested for sequelize.define, see here at the bottom and compare vs the definitions in Database.ts. Seems like ...Instance maps to MyModel, ...Model maps to MyModelStatic, and each of the defined fields in the Database class are MyDefineModel.

smartin015 avatar Nov 27 '19 08:11 smartin015

Made a few tweaks, the app should at least build now. yarn test fails in a bunch of ways, afaict due to typescript build failure issues as well. Can you take a look?

smartin015 avatar Dec 15 '19 16:12 smartin015