Compile with swc on twenty-server (#4863)

Experiment using swc instead of tsc (as we did the switch on
twenty-front)

It's **much** faster (at least 5x) but has stricter requirements.
I fixed the build but there's still an error while starting the server,
opening this PR for discussion.

Checkout the branch and try `nx build:swc twenty-server`

Read: https://docs.nestjs.com/recipes/swc#common-pitfalls
This commit is contained in:
Félix Malfait
2024-04-14 09:09:51 +02:00
committed by GitHub
parent f82b1ff9ef
commit 9aa24ed803
50 changed files with 600 additions and 152 deletions

View File

@ -6,6 +6,7 @@ import {
ManyToOne,
OneToOne,
PrimaryGeneratedColumn,
Relation,
UpdateDateColumn,
} from 'typeorm';
@ -65,7 +66,7 @@ export class RelationMetadataEntity implements RelationMetadataInterface {
onDelete: 'CASCADE',
},
)
fromObjectMetadata: ObjectMetadataEntity;
fromObjectMetadata: Relation<ObjectMetadataEntity>;
@ManyToOne(
() => ObjectMetadataEntity,
@ -74,21 +75,21 @@ export class RelationMetadataEntity implements RelationMetadataInterface {
onDelete: 'CASCADE',
},
)
toObjectMetadata: ObjectMetadataEntity;
toObjectMetadata: Relation<ObjectMetadataEntity>;
@OneToOne(
() => FieldMetadataEntity,
(field: FieldMetadataEntity) => field.fromRelationMetadata,
)
@JoinColumn()
fromFieldMetadata: FieldMetadataEntity;
fromFieldMetadata: Relation<FieldMetadataEntity>;
@OneToOne(
() => FieldMetadataEntity,
(field: FieldMetadataEntity) => field.toRelationMetadata,
)
@JoinColumn()
toFieldMetadata: FieldMetadataEntity;
toFieldMetadata: Relation<FieldMetadataEntity>;
@CreateDateColumn({ type: 'timestamptz' })
createdAt: Date;