2024-02-14 00:16:21 +03:00
|
|
|
{
|
2024-03-25 14:31:18 +03:00
|
|
|
"name": "twenty-server",
|
|
|
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
|
|
"projectType": "application",
|
chore: use Nx affected tasks in CI (#5110)
Closes #5097
- Uses "nx affected" to detect what projects need to be checked in the
current PR (for now, `ci-front` and `ci-server` workflows only).
- Caches results of certain tasks (`lint`, `typecheck`, `test`,
`storybook:build`) when a PR pipeline runs. The next runs of the same
PR's pipeline will then be able to reuse the PR's task cache to execute
tasks faster.
- Caches Yarn's cache folder to install dependencies faster in CI jobs.
- Rewrites the node modules cache/install steps as a custom, reusable
Github action.
- Distributes `ci-front` jobs with a "matrix" strategy.
- Sets common tasks config at the root `nx.json`. For instance, to
activate the `typecheck` task in a project, add `typecheck: {}` to its
`project.json` and it'll use the default config set in `nx.json` for the
`typecheck` task. Options can be overridden in each individual
`project.json` if needed.
- Adds "scope" tags to some projects: `scope:frontend`, `scope:backend`,
`scope:shared`. An eslint rule ensures that `scope:frontend` only
depends on `scope:frontent` or `scope:shared` projects, same for
`scope:backend`. These tags are used by `nx affected` to filter projects
by scope and generates different task cache keys according to the
requested scope.
- Enables checks for twenty-emails in the `ci-server` workflow.
2024-04-30 17:28:25 +03:00
|
|
|
"tags": ["scope:backend"],
|
2024-03-25 14:31:18 +03:00
|
|
|
"targets": {
|
|
|
|
"build": {
|
|
|
|
"executor": "nx:run-commands",
|
|
|
|
"options": {
|
|
|
|
"cwd": "packages/twenty-server",
|
|
|
|
"commands": ["rimraf dist", "nest build --path ./tsconfig.build.json"]
|
|
|
|
}
|
2024-04-22 18:34:24 +03:00
|
|
|
},
|
2024-03-25 14:31:18 +03:00
|
|
|
"build:packageJson": {
|
|
|
|
"executor": "@nx/js:tsc",
|
|
|
|
"options": {
|
|
|
|
"main": "packages/twenty-server/dist/src/main.js",
|
|
|
|
"tsConfig": "packages/twenty-server/tsconfig.json",
|
|
|
|
"outputPath": "packages/twenty-server/dist",
|
|
|
|
"updateBuildableProjectDepsInPackageJson": true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"start": {
|
|
|
|
"executor": "nx:run-commands",
|
2024-08-26 17:35:09 +03:00
|
|
|
"dependsOn": ["typecheck", "build"],
|
2024-03-25 14:31:18 +03:00
|
|
|
"options": {
|
|
|
|
"cwd": "packages/twenty-server",
|
|
|
|
"command": "NODE_ENV=development && nest start --watch"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"start:debug": {
|
|
|
|
"executor": "nx:run-commands",
|
|
|
|
"dependsOn": ["build"],
|
|
|
|
"options": {
|
|
|
|
"cwd": "packages/twenty-server",
|
|
|
|
"command": "nx start --debug"
|
|
|
|
}
|
|
|
|
},
|
chore: use Nx affected tasks in CI (#5110)
Closes #5097
- Uses "nx affected" to detect what projects need to be checked in the
current PR (for now, `ci-front` and `ci-server` workflows only).
- Caches results of certain tasks (`lint`, `typecheck`, `test`,
`storybook:build`) when a PR pipeline runs. The next runs of the same
PR's pipeline will then be able to reuse the PR's task cache to execute
tasks faster.
- Caches Yarn's cache folder to install dependencies faster in CI jobs.
- Rewrites the node modules cache/install steps as a custom, reusable
Github action.
- Distributes `ci-front` jobs with a "matrix" strategy.
- Sets common tasks config at the root `nx.json`. For instance, to
activate the `typecheck` task in a project, add `typecheck: {}` to its
`project.json` and it'll use the default config set in `nx.json` for the
`typecheck` task. Options can be overridden in each individual
`project.json` if needed.
- Adds "scope" tags to some projects: `scope:frontend`, `scope:backend`,
`scope:shared`. An eslint rule ensures that `scope:frontend` only
depends on `scope:frontent` or `scope:shared` projects, same for
`scope:backend`. These tags are used by `nx affected` to filter projects
by scope and generates different task cache keys according to the
requested scope.
- Enables checks for twenty-emails in the `ci-server` workflow.
2024-04-30 17:28:25 +03:00
|
|
|
"reset:env": {
|
|
|
|
"executor": "nx:run-commands",
|
|
|
|
"inputs": ["{projectRoot}/.env.example"],
|
|
|
|
"outputs": ["{projectRoot}/.env"],
|
|
|
|
"cache": true,
|
|
|
|
"options": {
|
|
|
|
"cwd": "{projectRoot}",
|
|
|
|
"command": "cp .env.example .env"
|
|
|
|
}
|
|
|
|
},
|
2024-03-25 14:31:18 +03:00
|
|
|
"command": {
|
|
|
|
"executor": "nx:run-commands",
|
|
|
|
"dependsOn": ["build"],
|
|
|
|
"options": {
|
|
|
|
"cwd": "packages/twenty-server",
|
|
|
|
"command": "node dist/src/command/command.js"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"command-no-deps": {
|
|
|
|
"executor": "nx:run-commands",
|
|
|
|
"options": {
|
|
|
|
"cwd": "packages/twenty-server",
|
|
|
|
"command": "node dist/src/command/command.js"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"worker": {
|
|
|
|
"executor": "nx:run-commands",
|
|
|
|
"dependsOn": ["build"],
|
|
|
|
"options": {
|
|
|
|
"cwd": "packages/twenty-server",
|
|
|
|
"command": "node dist/src/queue-worker/queue-worker.js"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"typeorm": {
|
|
|
|
"executor": "nx:run-commands",
|
|
|
|
"options": {
|
|
|
|
"cwd": "packages/twenty-server",
|
|
|
|
"command": "ts-node ../../node_modules/typeorm/cli.js"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"ts-node": {
|
|
|
|
"executor": "nx:run-commands",
|
|
|
|
"dependsOn": ["build"],
|
|
|
|
"options": {
|
|
|
|
"cwd": "packages/twenty-server",
|
|
|
|
"command": "ts-node"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"ts-node-no-deps": {
|
|
|
|
"executor": "nx:run-commands",
|
|
|
|
"options": {
|
|
|
|
"cwd": "packages/twenty-server",
|
|
|
|
"command": "ts-node"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"lint": {
|
|
|
|
"options": {
|
2024-04-22 18:34:24 +03:00
|
|
|
"lintFilePatterns": ["{projectRoot}/src/**/*.{ts,json}"]
|
|
|
|
},
|
|
|
|
"configurations": {
|
|
|
|
"ci": { "lintFilePatterns": ["{projectRoot}/**/*.{ts,json}"] },
|
chore: use Nx affected tasks in CI (#5110)
Closes #5097
- Uses "nx affected" to detect what projects need to be checked in the
current PR (for now, `ci-front` and `ci-server` workflows only).
- Caches results of certain tasks (`lint`, `typecheck`, `test`,
`storybook:build`) when a PR pipeline runs. The next runs of the same
PR's pipeline will then be able to reuse the PR's task cache to execute
tasks faster.
- Caches Yarn's cache folder to install dependencies faster in CI jobs.
- Rewrites the node modules cache/install steps as a custom, reusable
Github action.
- Distributes `ci-front` jobs with a "matrix" strategy.
- Sets common tasks config at the root `nx.json`. For instance, to
activate the `typecheck` task in a project, add `typecheck: {}` to its
`project.json` and it'll use the default config set in `nx.json` for the
`typecheck` task. Options can be overridden in each individual
`project.json` if needed.
- Adds "scope" tags to some projects: `scope:frontend`, `scope:backend`,
`scope:shared`. An eslint rule ensures that `scope:frontend` only
depends on `scope:frontent` or `scope:shared` projects, same for
`scope:backend`. These tags are used by `nx affected` to filter projects
by scope and generates different task cache keys according to the
requested scope.
- Enables checks for twenty-emails in the `ci-server` workflow.
2024-04-30 17:28:25 +03:00
|
|
|
"fix": {}
|
2024-03-25 14:31:18 +03:00
|
|
|
}
|
|
|
|
},
|
chore: use Nx affected tasks in CI (#5110)
Closes #5097
- Uses "nx affected" to detect what projects need to be checked in the
current PR (for now, `ci-front` and `ci-server` workflows only).
- Caches results of certain tasks (`lint`, `typecheck`, `test`,
`storybook:build`) when a PR pipeline runs. The next runs of the same
PR's pipeline will then be able to reuse the PR's task cache to execute
tasks faster.
- Caches Yarn's cache folder to install dependencies faster in CI jobs.
- Rewrites the node modules cache/install steps as a custom, reusable
Github action.
- Distributes `ci-front` jobs with a "matrix" strategy.
- Sets common tasks config at the root `nx.json`. For instance, to
activate the `typecheck` task in a project, add `typecheck: {}` to its
`project.json` and it'll use the default config set in `nx.json` for the
`typecheck` task. Options can be overridden in each individual
`project.json` if needed.
- Adds "scope" tags to some projects: `scope:frontend`, `scope:backend`,
`scope:shared`. An eslint rule ensures that `scope:frontend` only
depends on `scope:frontent` or `scope:shared` projects, same for
`scope:backend`. These tags are used by `nx affected` to filter projects
by scope and generates different task cache keys according to the
requested scope.
- Enables checks for twenty-emails in the `ci-server` workflow.
2024-04-30 17:28:25 +03:00
|
|
|
"test": {},
|
|
|
|
"test:debug": {
|
2024-03-25 14:31:18 +03:00
|
|
|
"executor": "nx:run-commands",
|
|
|
|
"options": {
|
|
|
|
"cwd": "packages/twenty-server",
|
|
|
|
"command": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register ../../node_modules/.bin/jest --runInBand"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"test:e2e": {
|
|
|
|
"executor": "nx:run-commands",
|
|
|
|
"dependsOn": ["build"],
|
|
|
|
"options": {
|
|
|
|
"cwd": "packages/twenty-server",
|
|
|
|
"command": "./scripts/run-integration.sh"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"database:migrate": {
|
|
|
|
"executor": "nx:run-commands",
|
2024-05-06 16:30:03 +03:00
|
|
|
"dependsOn": ["build"],
|
2024-03-25 14:31:18 +03:00
|
|
|
"options": {
|
|
|
|
"cwd": "packages/twenty-server",
|
|
|
|
"commands": [
|
|
|
|
"nx typeorm -- migration:run -d src/database/typeorm/metadata/metadata.datasource",
|
|
|
|
"nx typeorm -- migration:run -d src/database/typeorm/core/core.datasource"
|
|
|
|
],
|
|
|
|
"parallel": false
|
|
|
|
}
|
|
|
|
},
|
2024-08-01 18:05:15 +03:00
|
|
|
"database:migrate:revert": {
|
|
|
|
"executor": "nx:run-commands",
|
|
|
|
"dependsOn": ["build"],
|
|
|
|
"options": {
|
|
|
|
"cwd": "packages/twenty-server",
|
|
|
|
"commands": [
|
|
|
|
"nx typeorm -- migration:revert -d src/database/typeorm/metadata/metadata.datasource",
|
|
|
|
"nx typeorm -- migration:revert -d src/database/typeorm/core/core.datasource"
|
|
|
|
],
|
|
|
|
"parallel": false
|
|
|
|
}
|
|
|
|
},
|
2024-03-25 14:31:18 +03:00
|
|
|
"database:reset": {
|
|
|
|
"executor": "nx:run-commands",
|
|
|
|
"dependsOn": ["build"],
|
|
|
|
"options": {
|
|
|
|
"cwd": "packages/twenty-server",
|
|
|
|
"commands": [
|
|
|
|
"nx ts-node-no-deps -- ./scripts/truncate-db.ts",
|
|
|
|
"nx ts-node-no-deps -- ./scripts/setup-db.ts",
|
|
|
|
"nx database:migrate",
|
|
|
|
"nx command-no-deps -- workspace:seed:dev"
|
|
|
|
],
|
|
|
|
"parallel": false
|
|
|
|
}
|
2024-02-14 00:16:21 +03:00
|
|
|
}
|
2024-03-25 14:31:18 +03:00
|
|
|
}
|
|
|
|
}
|