Skip to content

Commit 23b1cc8

Browse files
committed
revert to tsc build and add lint rules to set cli dependencies
1 parent e66b1a6 commit 23b1cc8

File tree

8 files changed

+66
-17
lines changed

8 files changed

+66
-17
lines changed

.github/workflows/composite/verify/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ runs:
1010
registry-url: 'https://registry.npmjs.org'
1111
- run: npm install --force
1212
shell: bash
13+
14+
- run: npm run lint:cli
15+
shell: bash
16+
1317
- run: npm run build
1418
shell: bash
19+
1520
- run: npm run test
1621
shell: bash

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,17 @@ npx nx generate @nx/js:library --name=libs/[topic]/[command] --projectNameAndRoo
1818
```
1919
npx nx generate @nx/js:library --name=libs/[command] --projectNameAndRootFormat=as-provided --no-interactive
2020
```
21+
22+
## Adding a library
23+
24+
When adding a library to the monorepo, remember to update the CLI's lint rules to ignore the new library.
25+
26+
path to the cli lint rules: apps/cli/.eslintrc.json
27+
28+
## Lint Failures
29+
30+
To fix lint failures run:
31+
32+
```
33+
npm run lint:cli:fix
34+
```

apps/cli/.eslintrc.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,23 @@
1818
"files": ["*.json"],
1919
"parser": "jsonc-eslint-parser",
2020
"rules": {
21-
"@nx/dependency-checks": "error"
21+
"@nx/dependency-checks": [
22+
"error",
23+
{
24+
"includeTransitiveDependencies": true,
25+
"useLocalPathsForWorkspaceDependencies": true,
26+
"ignoredDependencies": [
27+
"@herodevs/report-committers",
28+
"@herodevs/report-diagnostics",
29+
"@herodevs/tracker-init",
30+
"@herodevs/tracker-run",
31+
"@herodevs/nes-init",
32+
"@herodevs/utility",
33+
"@herodevs/core-types",
34+
"@herodevs/tracker-shared"
35+
]
36+
}
37+
]
2238
}
2339
}
2440
]

apps/cli/package.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
{
22
"name": "@herodevs/cli",
33
"version": "0.0.0",
4-
"bin": "./hd-cli.js",
4+
"bin": "./src/main.js",
55
"dependencies": {
6-
"tslib": "^2.3.0"
6+
"tslib": "^2.3.0",
7+
"yargs": "^17.7.2",
8+
"get-json": "^1.0.1",
9+
"date-fns": "^3.6.0",
10+
"@inquirer/prompts": "^5.0.2",
11+
"git-last-commit": "^1.0.1",
12+
"sloc": "^0.3.2",
13+
"@apollo/client": "^3.10.1",
14+
"ora": "5.3.0"
715
},
816
"type": "commonjs",
9-
"main": "./hd-cli.js"
17+
"main": "./src/main.js",
18+
"typings": "./src/main.d.ts"
1019
}

apps/cli/project.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,21 @@
1414
"tags": [],
1515
"targets": {
1616
"build": {
17-
"executor": "@nx/esbuild:esbuild",
17+
"executor": "@nx/js:tsc",
18+
"outputs": ["{options.outputPath}"],
1819
"options": {
1920
"outputPath": "dist/apps/cli",
20-
"main": "apps/cli/src/lib/cli.ts",
21+
"main": "apps/cli/src/main.ts",
2122
"tsConfig": "apps/cli/tsconfig.lib.json",
22-
"format": ["cjs"],
23-
"generatePackageJson": true,
24-
"assets": [
25-
{
26-
"input": "apps/cli/src/",
27-
"glob": "hd-cli.js",
28-
"output": "/"
29-
}
30-
]
23+
"assets": ["apps/cli/*.md"],
24+
"external": "none"
25+
}
26+
},
27+
"lint": {
28+
"executor": "@nx/eslint:lint",
29+
"outputs": ["{options.outputFile}"],
30+
"options": {
31+
"lintFilePatterns": ["apps/cli/**/*.{ts,tsx,js,jsx}", "apps/cli/package.json"]
3132
}
3233
},
3334
"nx-release-publish": {

apps/cli/src/hd-cli.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

apps/cli/src/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { cli } from './lib/cli';
2+
3+
cli();

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"build": "nx run-many --target=build --all",
88
"test": "nx run-many --target=test --all",
99
"x": "nx affected:test --watch",
10-
"lint": "nx run-many --target=lint --all"
10+
"lint": "nx run-many --target=lint --all",
11+
"lint:cli": "nx lint cli",
12+
"lint:cli:fix": "nx lint cli --fix"
1113
},
1214
"private": true,
1315
"dependencies": {

0 commit comments

Comments
 (0)