Update scripts and documentation to use nx and new monorepo architecture (#2912)

* Update scripts and documentation to use nx and new monorepo architecture

* Start fixing docker

* Migrate eslint plugin and postgres setup

* Fix docker

* Fix patches

* Fix

* fix: wip try to fix the patches

* Apply patches

---------

Co-authored-by: Jérémy Magrin <jeremy.magrin@gmail.com>
This commit is contained in:
Charles Bochet
2023-12-11 10:54:57 +01:00
committed by GitHub
parent f91bb35573
commit 44baaee28e
67 changed files with 411 additions and 14097 deletions

1
packages/twenty-server/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
dist/*

View File

@ -1 +0,0 @@
18.16.0

View File

@ -6,7 +6,6 @@
"private": true,
"license": "UNLICENSED",
"scripts": {
"postinstall": "patch-package",
"prebuild": "rimraf dist",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
@ -37,12 +36,12 @@
"@aws-sdk/credential-providers": "^3.363.0",
"@google-cloud/local-auth": "2.1.0",
"@graphql-tools/schema": "^10.0.0",
"@graphql-yoga/nestjs": "2.1.0",
"@graphql-yoga/nestjs": "patch:@graphql-yoga/nestjs@2.1.0#./patches/@graphql-yoga+nestjs+2.1.0.patch",
"@nestjs/apollo": "^11.0.5",
"@nestjs/common": "^9.0.0",
"@nestjs/config": "^2.3.2",
"@nestjs/core": "^9.0.0",
"@nestjs/graphql": "12.0.8",
"@nestjs/graphql": "patch:@nestjs/graphql@12.0.8#./patches/@nestjs+graphql+12.0.8.patch",
"@nestjs/jwt": "^10.0.3",
"@nestjs/passport": "^9.0.3",
"@nestjs/platform-express": "^9.0.0",
@ -50,7 +49,7 @@
"@nestjs/terminus": "^9.2.2",
"@nestjs/typeorm": "^10.0.0",
"@ptc-org/nestjs-query-core": "^4.2.0",
"@ptc-org/nestjs-query-graphql": "4.2.0",
"@ptc-org/nestjs-query-graphql": "patch:@ptc-org/nestjs-query-graphql@4.2.0#./patches/@ptc-org+nestjs-query-graphql+4.2.0.patch",
"@ptc-org/nestjs-query-typeorm": "4.2.1-alpha.2",
"@sentry/node": "^7.66.0",
"@sentry/profiling-node": "^1.2.6",
@ -65,7 +64,7 @@
"bullmq": "^4.14.0",
"bytes": "^3.1.2",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"class-validator": "patch:class-validator@^0.14.0#./patches/class-validator+0.14.0.patch",
"dataloader": "^2.2.2",
"date-fns": "^2.30.0",
"file-type": "16.5.4",
@ -93,10 +92,8 @@
"passport-google-oauth20": "^2.0.0",
"passport-jwt": "^4.0.1",
"passport-local": "^1.0.0",
"patch-package": "^8.0.0",
"pg": "^8.11.3",
"pg-boss": "^9.0.3",
"postinstall-postinstall": "^2.1.0",
"rimraf": "^3.0.2",
"rxjs": "^7.2.0",
"sharp": "^0.32.1",
@ -147,5 +144,10 @@
},
"resolutions": {
"graphql": "16.8.0"
},
"engines": {
"node": "^18.16.0",
"npm": "please-use-yarn",
"yarn": "^4.0.2"
}
}

View File

@ -1,7 +1,7 @@
diff --git a/node_modules/@graphql-yoga/nestjs/dist/cjs/index.js b/node_modules/@graphql-yoga/nestjs/dist/cjs/index.js
diff --git a/dist/cjs/index.js b/dist/cjs/index.js
index 1684394..8a92c3c 100644
--- a/node_modules/@graphql-yoga/nestjs/dist/cjs/index.js
+++ b/node_modules/@graphql-yoga/nestjs/dist/cjs/index.js
--- a/dist/cjs/index.js
+++ b/dist/cjs/index.js
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
const graphql_1 = require("graphql");
const graphql_yoga_1 = require("graphql-yoga");
@ -69,10 +69,10 @@ index 1684394..8a92c3c 100644
graphqlEndpoint: options.path,
// disable logging by default
// however, if `true` use fastify logger
diff --git a/node_modules/@graphql-yoga/nestjs/dist/esm/index.js b/node_modules/@graphql-yoga/nestjs/dist/esm/index.js
diff --git a/dist/esm/index.js b/dist/esm/index.js
index 7068c51..8ba5d2a 100644
--- a/node_modules/@graphql-yoga/nestjs/dist/esm/index.js
+++ b/node_modules/@graphql-yoga/nestjs/dist/esm/index.js
--- a/dist/esm/index.js
+++ b/dist/esm/index.js
@@ -2,6 +2,7 @@ import { __decorate } from "tslib";
import { printSchema } from 'graphql';
import { createYoga, filter, pipe } from 'graphql-yoga';
@ -140,10 +140,10 @@ index 7068c51..8ba5d2a 100644
graphqlEndpoint: options.path,
// disable logging by default
// however, if `true` use fastify logger
diff --git a/node_modules/@graphql-yoga/nestjs/dist/typings/index.d.cts b/node_modules/@graphql-yoga/nestjs/dist/typings/index.d.cts
diff --git a/dist/typings/index.d.cts b/dist/typings/index.d.cts
index 2c6a965..fd86dac 100644
--- a/node_modules/@graphql-yoga/nestjs/dist/typings/index.d.cts
+++ b/node_modules/@graphql-yoga/nestjs/dist/typings/index.d.cts
--- a/dist/typings/index.d.cts
+++ b/dist/typings/index.d.cts
@@ -1,7 +1,8 @@
import type { Express, Request as ExpressRequest, Response as ExpressResponse } from 'express';
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
@ -178,10 +178,10 @@ index 2c6a965..fd86dac 100644
preStartHook?: (app: FastifyInstance) => void;
}): void;
subscriptionWithFilter<TPayload, TVariables, TContext>(instanceRef: unknown, filterFn: (payload: TPayload, variables: TVariables, context: TContext) => boolean | Promise<boolean>, createSubscribeContext: Function): (args_0: TPayload, args_1: TVariables, args_2: TContext) => Promise<import("graphql-yoga").Repeater<TPayload, void, unknown>>;
diff --git a/node_modules/@graphql-yoga/nestjs/dist/typings/index.d.ts b/node_modules/@graphql-yoga/nestjs/dist/typings/index.d.ts
diff --git a/dist/typings/index.d.ts b/dist/typings/index.d.ts
index 2c6a965..fd86dac 100644
--- a/node_modules/@graphql-yoga/nestjs/dist/typings/index.d.ts
+++ b/node_modules/@graphql-yoga/nestjs/dist/typings/index.d.ts
--- a/dist/typings/index.d.ts
+++ b/dist/typings/index.d.ts
@@ -1,7 +1,8 @@
import type { Express, Request as ExpressRequest, Response as ExpressResponse } from 'express';
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
@ -216,10 +216,10 @@ index 2c6a965..fd86dac 100644
preStartHook?: (app: FastifyInstance) => void;
}): void;
subscriptionWithFilter<TPayload, TVariables, TContext>(instanceRef: unknown, filterFn: (payload: TPayload, variables: TVariables, context: TContext) => boolean | Promise<boolean>, createSubscribeContext: Function): (args_0: TPayload, args_1: TVariables, args_2: TContext) => Promise<import("graphql-yoga").Repeater<TPayload, void, unknown>>;
diff --git a/node_modules/@graphql-yoga/nestjs/src/index.ts b/node_modules/@graphql-yoga/nestjs/src/index.ts
diff --git a/src/index.ts b/src/index.ts
index ce142f6..cda4117 100644
--- a/node_modules/@graphql-yoga/nestjs/src/index.ts
+++ b/node_modules/@graphql-yoga/nestjs/src/index.ts
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,9 +1,10 @@
import type { Express, Request as ExpressRequest, Response as ExpressResponse } from 'express';
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';

View File

@ -1,7 +1,7 @@
diff --git a/node_modules/@nestjs/graphql/dist/schema-builder/graphql-schema.factory.js b/node_modules/@nestjs/graphql/dist/schema-builder/graphql-schema.factory.js
diff --git a/dist/schema-builder/graphql-schema.factory.js b/dist/schema-builder/graphql-schema.factory.js
index 787bcbc..1c825bd 100644
--- a/node_modules/@nestjs/graphql/dist/schema-builder/graphql-schema.factory.js
+++ b/node_modules/@nestjs/graphql/dist/schema-builder/graphql-schema.factory.js
--- a/dist/schema-builder/graphql-schema.factory.js
+++ b/dist/schema-builder/graphql-schema.factory.js
@@ -32,6 +32,7 @@ let GraphQLSchemaFactory = exports.GraphQLSchemaFactory = GraphQLSchemaFactory_1
else {
options = scalarsOrOptions;
@ -10,10 +10,10 @@ index 787bcbc..1c825bd 100644
lazy_metadata_storage_1.LazyMetadataStorage.load(resolvers);
type_metadata_storage_1.TypeMetadataStorage.compile(options.orphanedTypes);
this.typeDefinitionsGenerator.generate(options);
diff --git a/node_modules/@nestjs/graphql/dist/schema-builder/storages/type-definitions.storage.js b/node_modules/@nestjs/graphql/dist/schema-builder/storages/type-definitions.storage.js
diff --git a/dist/schema-builder/storages/type-definitions.storage.js b/dist/schema-builder/storages/type-definitions.storage.js
index d100444..158c592 100644
--- a/node_modules/@nestjs/graphql/dist/schema-builder/storages/type-definitions.storage.js
+++ b/node_modules/@nestjs/graphql/dist/schema-builder/storages/type-definitions.storage.js
--- a/dist/schema-builder/storages/type-definitions.storage.js
+++ b/dist/schema-builder/storages/type-definitions.storage.js
@@ -81,6 +81,10 @@ let TypeDefinitionsStorage = exports.TypeDefinitionsStorage = class TypeDefiniti
}
return;
@ -25,10 +25,10 @@ index d100444..158c592 100644
};
exports.TypeDefinitionsStorage = TypeDefinitionsStorage = tslib_1.__decorate([
(0, common_1.Injectable)()
diff --git a/node_modules/@nestjs/graphql/dist/schema-builder/type-definitions.generator.js b/node_modules/@nestjs/graphql/dist/schema-builder/type-definitions.generator.js
diff --git a/dist/schema-builder/type-definitions.generator.js b/dist/schema-builder/type-definitions.generator.js
index eb6bcfd..4fbc1ae 100644
--- a/node_modules/@nestjs/graphql/dist/schema-builder/type-definitions.generator.js
+++ b/node_modules/@nestjs/graphql/dist/schema-builder/type-definitions.generator.js
--- a/dist/schema-builder/type-definitions.generator.js
+++ b/dist/schema-builder/type-definitions.generator.js
@@ -26,6 +26,9 @@ let TypeDefinitionsGenerator = exports.TypeDefinitionsGenerator = class TypeDefi
this.generateObjectTypeDefs(options);
this.generateInputTypeDefs(options);

View File

@ -1,7 +1,7 @@
diff --git a/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/cursor/page-info.type.js b/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/cursor/page-info.type.js
diff --git a/src/types/connection/cursor/page-info.type.js b/src/types/connection/cursor/page-info.type.js
index 00d836d..8eef442 100644
--- a/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/cursor/page-info.type.js
+++ b/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/cursor/page-info.type.js
--- a/src/types/connection/cursor/page-info.type.js
+++ b/src/types/connection/cursor/page-info.type.js
@@ -39,7 +39,6 @@ const getOrCreatePageInfoType = () => {
tslib_1.__metadata("design:type", String)
], PageInfoTypeImpl.prototype, "endCursor", void 0);
@ -10,10 +10,10 @@ index 00d836d..8eef442 100644
(0, graphql_1.ObjectType)('PageInfo'),
tslib_1.__metadata("design:paramtypes", [Boolean, Boolean, String, String])
], PageInfoTypeImpl);
diff --git a/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/offset/offset-connection.type.js b/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/offset/offset-connection.type.js
diff --git a/src/types/connection/offset/offset-connection.type.js b/src/types/connection/offset/offset-connection.type.js
index b47564f..d33f391 100644
--- a/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/offset/offset-connection.type.js
+++ b/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/offset/offset-connection.type.js
--- a/src/types/connection/offset/offset-connection.type.js
+++ b/src/types/connection/offset/offset-connection.type.js
@@ -64,7 +64,6 @@ function getOrCreateOffsetConnectionType(TItemClass, opts) {
tslib_1.__metadata("design:paramtypes", [])
], AbstractConnection.prototype, "totalCount", null);
@ -22,10 +22,10 @@ index b47564f..d33f391 100644
(0, graphql_1.ObjectType)(connectionName),
tslib_1.__metadata("design:paramtypes", [Object, Array, Function])
], AbstractConnection);
diff --git a/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/offset/offset-page-info.type.js b/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/offset/offset-page-info.type.js
diff --git a/src/types/connection/offset/offset-page-info.type.js b/src/types/connection/offset/offset-page-info.type.js
index 4803306..d459b16 100644
--- a/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/offset/offset-page-info.type.js
+++ b/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/offset/offset-page-info.type.js
--- a/src/types/connection/offset/offset-page-info.type.js
+++ b/src/types/connection/offset/offset-page-info.type.js
@@ -25,7 +25,6 @@ const getOrCreateOffsetPageInfoType = () => {
tslib_1.__metadata("design:type", Boolean)
], PageInfoTypeImpl.prototype, "hasPreviousPage", void 0);
@ -34,10 +34,10 @@ index 4803306..d459b16 100644
(0, graphql_1.ObjectType)('OffsetPageInfo'),
tslib_1.__metadata("design:paramtypes", [Boolean, Boolean])
], PageInfoTypeImpl);
diff --git a/node_modules/@ptc-org/nestjs-query-graphql/src/types/delete-many-reponse.type.js b/node_modules/@ptc-org/nestjs-query-graphql/src/types/delete-many-reponse.type.js
diff --git a/src/types/delete-many-reponse.type.js b/src/types/delete-many-reponse.type.js
index 4de72de..b42f05f 100644
--- a/node_modules/@ptc-org/nestjs-query-graphql/src/types/delete-many-reponse.type.js
+++ b/node_modules/@ptc-org/nestjs-query-graphql/src/types/delete-many-reponse.type.js
--- a/src/types/delete-many-reponse.type.js
+++ b/src/types/delete-many-reponse.type.js
@@ -16,7 +16,6 @@ const DeleteManyResponseType = () => {
tslib_1.__metadata("design:type", Number)
], DeleteManyResponseTypeImpl.prototype, "deletedCount", void 0);
@ -46,10 +46,10 @@ index 4de72de..b42f05f 100644
(0, graphql_1.ObjectType)('DeleteManyResponse')
], DeleteManyResponseTypeImpl);
deleteManyResponseType = DeleteManyResponseTypeImpl;
diff --git a/node_modules/@ptc-org/nestjs-query-graphql/src/types/update-many-response.type.js b/node_modules/@ptc-org/nestjs-query-graphql/src/types/update-many-response.type.js
diff --git a/src/types/update-many-response.type.js b/src/types/update-many-response.type.js
index c525d14..74be84f 100644
--- a/node_modules/@ptc-org/nestjs-query-graphql/src/types/update-many-response.type.js
+++ b/node_modules/@ptc-org/nestjs-query-graphql/src/types/update-many-response.type.js
--- a/src/types/update-many-response.type.js
+++ b/src/types/update-many-response.type.js
@@ -16,7 +16,6 @@ const UpdateManyResponseType = () => {
tslib_1.__metadata("design:type", Number)
], UpdateManyResponseTypeImpl.prototype, "updatedCount", void 0);

File diff suppressed because one or more lines are too long

View File

@ -31,7 +31,6 @@ export class IsFieldMetadataDefaultValue
if (!type) {
// Extract id value from the instance, should happen only when updating
// @ts-expect-error Todo: Fix typing error
const id: string | undefined = args.instance?.['id'];
if (!id) {

View File

@ -25,7 +25,6 @@ export class IsFieldMetadataOptions {
if (!type) {
// Extract id value from the instance, should happen only when updating
// @ts-expect-error Todo: Fix typing error
const id: string | undefined = args.instance?.['id'];
if (!id) {