Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MO-322 adding check-types command to base monorepo targets as well as… #968

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ Libraries are generated by `@nx/js` plugin. For more information, check out thei

`npx nx g library <library-name>`

Shared library will need to have the `check-types` command added manually to ensure proper type checking. This is because the the `@nx/js` plugin does not add it by default.
```json
"check-types": {
"executor": "nx:run-commands",
"options": {
"cwd": "{projectRoot}",
"color": true,
"command": "tsc --noEmit --pretty"
},
}
```

### General Nx. commands

Below are some example of general Nx. commands. For more information, check out their [document](https://nx.dev/packages/nx/documents).
Expand Down
3 changes: 3 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
"outputs": ["{projectRoot}/.serverless"],
"cache": true
},
"check-types": {
"cache": true
},
"lint": {
"inputs": [
"default",
Expand Down
8 changes: 8 additions & 0 deletions tools/serverless-plugin/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
"generatePackageJson": true
}
},
"check-types": {
"executor": "nx:run-commands",
"options": {
"cwd": "{projectRoot}",
"color": true,
"command": "tsc --noEmit --pretty"
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
Expand Down
8 changes: 8 additions & 0 deletions tools/serverless-plugin/src/generators/service/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ export async function serviceGenerator(
remove: {
...buildRunCommandConfig(projectRoot, 'sls remove'),
},
'check-types': {
'executor': 'nx:run-commands',
'options': {
'cwd': '{projectRoot}',
'color': true,
'command': 'tsc --noEmit --pretty'
}
},
lint: {
executor: '@nx/linter:eslint',
outputs: ['{options.outputFile}'],
Expand Down