chore: make twenty-server nest command scripts depend on twenty-email… (#4055)

chore: make twenty-server nest command scripts depend on twenty-emails build

Closes #4013
This commit is contained in:
Thaïs 2024-02-20 10:35:09 -03:00 committed by GitHub
parent 9aefab2297
commit ec20117e80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 28 additions and 15 deletions

View File

@ -274,6 +274,7 @@
"ts-jest": "^29.1.1", "ts-jest": "^29.1.1",
"ts-loader": "^9.2.3", "ts-loader": "^9.2.3",
"ts-node": "10.9.1", "ts-node": "10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.3.3", "typescript": "^5.3.3",
"vite": "^5.0.0", "vite": "^5.0.0",
"vite-plugin-checker": "^0.6.2", "vite-plugin-checker": "^0.6.2",

View File

@ -8,7 +8,7 @@
"scripts": { "scripts": {
"nx": "NX_DEFAULT_PROJECT=twenty-server node ../../node_modules/nx/bin/nx.js", "nx": "NX_DEFAULT_PROJECT=twenty-server node ../../node_modules/nx/bin/nx.js",
"prebuild": "rimraf dist", "prebuild": "rimraf dist",
"build": "yarn prebuild && nest build --path ./tsconfig.build.json", "build": "npx nx prebuild && nest build --path ./tsconfig.build.json",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "NODE_ENV=development && nest start", "start": "NODE_ENV=development && nest start",
"start:dev": "npx nx start --watch", "start:dev": "npx nx start --watch",
@ -20,17 +20,14 @@
"test:cov": "npx nx test --coverage", "test:cov": "npx nx test --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register ../../node_modules/.bin/jest --runInBand", "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register ../../node_modules/.bin/jest --runInBand",
"test:e2e": "./scripts/run-integration.sh", "test:e2e": "./scripts/run-integration.sh",
"typeorm": "npx ts-node -r tsconfig-paths/register ../../node_modules/typeorm/cli.js", "typeorm": "npx ts-node ../../node_modules/typeorm/cli.js",
"typeorm:migrate": "yarn typeorm migration:run -d ./src/database/typeorm/metadata/metadata.datasource.ts && yarn typeorm migration:run -d ./src/database/typeorm/core/core.datasource.ts", "database:init": "npx nx database:setup && npx nx database:seed:dev",
"database:init": "yarn database:setup && yarn database:seed:dev", "database:setup": "npx ts-node ./scripts/setup-db.ts && npx nx database:migrate",
"database:setup": "npx ts-node ./scripts/setup-db.ts && yarn database:migrate",
"database:setup:prod": "npx ts-node ./scripts/setup-db.ts && yarn typeorm:migrate",
"database:truncate": "npx ts-node ./scripts/truncate-db.ts", "database:truncate": "npx ts-node ./scripts/truncate-db.ts",
"database:migrate": "yarn build && yarn typeorm:migrate", "database:migrate": "npx nx typeorm -- migration:run -d src/database/typeorm/metadata/metadata.datasource && npx nx typeorm -- migration:run -d src/database/typeorm/core/core.datasource",
"database:seed:dev": "yarn build && yarn command workspace:seed:dev", "database:seed:dev": "npx nx command -- workspace:seed:dev",
"database:seed:demo": "yarn build && yarn command workspace:seed:demo", "database:seed:demo": "npx nx command -- workspace:seed:demo",
"database:reset": "yarn database:truncate && yarn database:init", "database:reset": "npx nx database:truncate && npx nx database:init",
"command": "node dist/src/command",
"queue:work": "node dist/src/queue-worker" "queue:work": "node dist/src/queue-worker"
}, },
"dependencies": { "dependencies": {
@ -39,7 +36,6 @@
"@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-graphql": "patch:@ptc-org/nestjs-query-graphql@4.2.0#./patches/@ptc-org+nestjs-query-graphql+4.2.0.patch",
"class-validator": "patch:class-validator@0.14.0#./patches/class-validator+0.14.0.patch", "class-validator": "patch:class-validator@0.14.0#./patches/class-validator+0.14.0.patch",
"graphql-middleware": "^6.1.35", "graphql-middleware": "^6.1.35",
"lodash.isequal": "^4.5.0",
"passport": "^0.7.0" "passport": "^0.7.0"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,4 +1,6 @@
{ {
"name": "twenty-server",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application", "projectType": "application",
"targets": { "targets": {
"build:packageJson": { "build:packageJson": {
@ -13,6 +15,16 @@
"updateBuildableProjectDepsInPackageJson": true "updateBuildableProjectDepsInPackageJson": true
} }
}, },
"command": {
"executor": "nx:run-commands",
"dependsOn": [
"build"
],
"options": {
"cwd": "packages/twenty-server",
"command": "node dist/src/command.js"
}
},
"test:debug": { "test:debug": {
"dependsOn": [ "dependsOn": [
"^build" "^build"

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
export PG_DATABASE_URL=postgres://twenty:twenty@$PG_DATABASE_HOST:$PG_DATABASE_PORT/default export PG_DATABASE_URL=postgres://twenty:twenty@$PG_DATABASE_HOST:$PG_DATABASE_PORT/default
yarn database:setup:prod yarn database:setup
node dist/src/main node dist/src/main

View File

@ -27,5 +27,9 @@
"src/*": ["packages/twenty-server/src/*"], "src/*": ["packages/twenty-server/src/*"],
"twenty-emails": ["packages/twenty-emails/src/index.ts"] "twenty-emails": ["packages/twenty-emails/src/index.ts"]
} }
},
"ts-node": {
"files": true,
"require": ["tsconfig-paths/register"]
} }
} }

View File

@ -43879,7 +43879,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"tsconfig-paths@npm:4.2.0, tsconfig-paths@npm:^4.1.2": "tsconfig-paths@npm:4.2.0, tsconfig-paths@npm:^4.1.2, tsconfig-paths@npm:^4.2.0":
version: 4.2.0 version: 4.2.0
resolution: "tsconfig-paths@npm:4.2.0" resolution: "tsconfig-paths@npm:4.2.0"
dependencies: dependencies:
@ -44107,7 +44107,6 @@ __metadata:
"@types/react": "npm:^18.2.39" "@types/react": "npm:^18.2.39"
class-validator: "patch:class-validator@0.14.0#./patches/class-validator+0.14.0.patch" class-validator: "patch:class-validator@0.14.0#./patches/class-validator+0.14.0.patch"
graphql-middleware: "npm:^6.1.35" graphql-middleware: "npm:^6.1.35"
lodash.isequal: "npm:^4.5.0"
passport: "npm:^0.7.0" passport: "npm:^0.7.0"
rimraf: "npm:^5.0.5" rimraf: "npm:^5.0.5"
typescript: "npm:^5.3.3" typescript: "npm:^5.3.3"
@ -44400,6 +44399,7 @@ __metadata:
ts-key-enum: "npm:^2.0.12" ts-key-enum: "npm:^2.0.12"
ts-loader: "npm:^9.2.3" ts-loader: "npm:^9.2.3"
ts-node: "npm:10.9.1" ts-node: "npm:10.9.1"
tsconfig-paths: "npm:^4.2.0"
tslib: "npm:^2.3.0" tslib: "npm:^2.3.0"
tsup: "npm:^8.0.1" tsup: "npm:^8.0.1"
type-fest: "npm:4.10.1" type-fest: "npm:4.10.1"