Open tschaffter opened 2 months ago
Create a TS project in the monorepo that will contains multiple executors:
nx g @nx/js:lib sage-monorepo --bundler=tsc --directory=libs/sage-monorepo --unitTestRunner=jest \
--projectNameAndRootFormat=as-provided --dry-run
Generate an executor:
nx generate @nx/plugin:executor about --directory=libs/sage-monorepo/src/executors/about \
--nameAndDirectoryFormat=as-provided
Update tsconfig.base.json
so that we import the executor as @sagebionetworks/sage-monorepo:about
(standard format suggested by Nx) instead of sage-monorepo:about
:
"@sagebionetworks/sage-monorepo": [
"libs/sage-monorepo/src/index.ts"
]
Add the task about
to a openchallenges-api-description
project by updating its project.json
:
"about": {
"executor": "@sagebionetworks/sage-monorepo:about"
}
Run the task:
$ nx about openchallenges-api-description
> nx run openchallenges-api-description:about
Executor ran for About {}
—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
NX Successfully ran target about for project openchallenges-api-description (1s)
What product(s) is this feature for?
Sage Monorepo
Description
A simple executor could be to print information about a project using NX CLI.
Anything else?
No response
Code of Conduct