Skip to content

Commit 6cc5a33

Browse files
committed
refactor: setup ts plugin
1 parent 66b25e6 commit 6cc5a33

File tree

27 files changed

+102
-47
lines changed

27 files changed

+102
-47
lines changed

examples/plugins/tsconfig.lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"outDir": "../../dist/out-tsc",
4+
"outDir": "dist",
55
"declaration": true,
66
"types": ["node"]
77
},

nx.json

Lines changed: 65 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
"$schema": "./node_modules/nx/schemas/nx-schema.json",
33
"namedInputs": {
44
"default": ["{projectRoot}/**/*", "sharedGlobals"],
5-
"os": [{ "runtime": "node -e \"console.log(require('os').platform())\"" }],
5+
"os": [
6+
{
7+
"runtime": "node -e \"console.log(require('os').platform())\""
8+
}
9+
],
610
"production": [
711
"default",
812
"!{projectRoot}/README.md",
@@ -25,23 +29,42 @@
2529
],
2630
"test-vitest-inputs": [
2731
"os",
28-
{ "env": "NX_VERBOSE_LOGGING" },
29-
{ "externalDependencies": ["vitest"] }
32+
{
33+
"env": "NX_VERBOSE_LOGGING"
34+
},
35+
{
36+
"externalDependencies": ["vitest"]
37+
}
3038
],
3139
"lint-eslint-inputs": [
3240
"{workspaceRoot}/eslint.config.js",
33-
{ "externalDependencies": ["eslint"] }
41+
{
42+
"externalDependencies": ["eslint"]
43+
}
3444
],
3545
"typecheck-typescript-inputs": [
3646
"{workspaceRoot}/tsconfig.base.json",
37-
{ "externalDependencies": ["typescript"] }
47+
{
48+
"externalDependencies": ["typescript"]
49+
}
3850
],
3951
"code-pushup-inputs": [
4052
"{workspaceRoot}/code-pushup.preset.ts",
41-
{ "env": "NODE_OPTIONS" },
42-
{ "env": "TSX_TSCONFIG_PATH" }
53+
{
54+
"env": "NODE_OPTIONS"
55+
},
56+
{
57+
"env": "TSX_TSCONFIG_PATH"
58+
}
4359
],
44-
"sharedGlobals": [{ "runtime": "node -v" }, { "runtime": "npm -v" }]
60+
"sharedGlobals": [
61+
{
62+
"runtime": "node -v"
63+
},
64+
{
65+
"runtime": "npm -v"
66+
}
67+
]
4568
},
4669
"targetDefaults": {
4770
"lint": {
@@ -67,15 +90,7 @@
6790
}
6891
},
6992
"build": {
70-
"dependsOn": ["^build"],
71-
"inputs": ["production", "^production"],
72-
"cache": true,
73-
"executor": "@nx/js:tsc",
74-
"outputs": ["{options.outputPath}"],
7593
"options": {
76-
"outputPath": "{projectRoot}/dist",
77-
"main": "{projectRoot}/src/index.ts",
78-
"tsConfig": "{projectRoot}/tsconfig.lib.json",
7994
"assets": ["{projectRoot}/*.md"]
8095
}
8196
},
@@ -311,6 +326,11 @@
311326
"packageRoot": "{projectRoot}/dist",
312327
"registry": "https://registry.npmjs.org/"
313328
}
329+
},
330+
"@nx/js:tsc": {
331+
"cache": true,
332+
"dependsOn": ["^build"],
333+
"inputs": ["production", "^production"]
314334
}
315335
},
316336
"workspaceLayout": {
@@ -360,6 +380,35 @@
360380
"filterByTags": ["publishable"]
361381
}
362382
}
383+
},
384+
{
385+
"plugin": "@nx/js/typescript",
386+
"options": {
387+
"typecheck": false,
388+
"build": {
389+
"targetName": "build",
390+
"configName": "tsconfig.lib.json",
391+
"buildDepsName": "tsc:build-deps",
392+
"watchDepsName": "tsc:watch-deps",
393+
"options": {
394+
"assets": ["{projectRoot}/*.md"]
395+
}
396+
}
397+
},
398+
"exclude": ["packages/utils/tmp/*"]
399+
},
400+
{
401+
"plugin": "@nx/js/typescript",
402+
"include": ["packages/utils/tmp/*"],
403+
"options": {
404+
"typecheck": {
405+
"targetName": "typecheck"
406+
},
407+
"build": {
408+
"targetName": "build",
409+
"configName": "tsconfig.lib.json"
410+
}
411+
}
363412
}
364413
],
365414
"nxCloudId": "65d4d862d2adb16a45a4bc7c"

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"@commitlint/types": "^19.5.0",
6060
"@nodelib/fs.walk": "^2.0.0",
6161
"@nx/eslint-plugin": "22.3.3",
62-
"@nx/js": "22.3.3",
62+
"@nx/js": "^22.3.3",
6363
"@nx/plugin": "22.3.3",
6464
"@nx/react": "22.3.3",
6565
"@nx/vite": "22.3.3",
@@ -110,7 +110,7 @@
110110
"minimatch": "^10.0.1",
111111
"moment": "^2.30.1",
112112
"pkg-pr-new": "^0.0.54",
113-
"prettier": "^3.4.1",
113+
"prettier": "~3.6.2",
114114
"react": "18.3.1",
115115
"react-dom": "18.3.1",
116116
"ts-patch": "^3.3.0",

packages/ci/tsconfig.lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"outDir": "../../dist/out-tsc",
4+
"outDir": "dist",
55
"declaration": true,
66
"types": ["node"]
77
},

packages/cli/tsconfig.lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"outDir": "../../dist/out-tsc",
4+
"outDir": "dist",
55
"declaration": true,
66
"types": ["node"]
77
},

packages/core/tsconfig.lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"outDir": "../../dist/out-tsc",
4+
"outDir": "dist",
55
"declaration": true,
66
"types": ["node"]
77
},

packages/create-cli/tsconfig.lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"outDir": "../../dist/out-tsc",
4+
"outDir": "dist",
55
"declaration": true,
66
"types": ["node"]
77
},

packages/models/tsconfig.lib.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"outDir": "../../dist/out-tsc",
4+
"outDir": "dist",
55
"declaration": true,
66
"types": ["node"],
77
"plugins": [
88
{
9-
"transform": "./tools/zod2md-jsdocs/dist",
9+
"transform": "../../tools/zod2md-jsdocs/dist",
1010
"afterDeclarations": true,
1111
"baseUrl": "https://github.com/code-pushup/cli/blob/main/packages/models/docs/models-reference.md"
1212
}

packages/nx-plugin/tsconfig.lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"outDir": "../../dist/out-tsc",
4+
"outDir": "dist",
55
"declaration": true,
66
"types": ["node"]
77
},

0 commit comments

Comments
 (0)