@kb-labs/devkit 2.34.0 → 2.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +93 -93
- package/tsup/node.js +14 -9
package/package.json
CHANGED
|
@@ -1,57 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kb-labs/devkit",
|
|
3
|
-
"version": "2.34.0",
|
|
4
|
-
"type": "module",
|
|
5
3
|
"description": "Shared developer toolkit for KB Labs projects: TS/ESLint/Prettier/Vitest/Tsup presets and reusable GitHub Actions.",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"tsconfig",
|
|
10
|
-
"eslint",
|
|
11
|
-
"prettier",
|
|
12
|
-
"vitest",
|
|
13
|
-
"vite",
|
|
14
|
-
"tsup",
|
|
15
|
-
"templates",
|
|
16
|
-
".github",
|
|
17
|
-
"bin",
|
|
18
|
-
"sync",
|
|
19
|
-
"AGENTS.md",
|
|
20
|
-
".github",
|
|
21
|
-
".github/workflow-templates/**",
|
|
22
|
-
".github/actions/**"
|
|
23
|
-
],
|
|
24
|
-
"bin": {
|
|
25
|
-
"kb-devkit-sync": "./bin/devkit-sync.mjs",
|
|
26
|
-
"kb-devkit-paths": "./bin/devkit-paths.mjs",
|
|
27
|
-
"kb-devkit-tsup-external": "./bin/devkit-tsup-external.mjs",
|
|
28
|
-
"kb-devkit-validate-naming": "./bin/devkit-validate-naming.mjs",
|
|
29
|
-
"kb-devkit-check-imports": "./bin/devkit-check-imports.mjs",
|
|
30
|
-
"kb-devkit-check-exports": "./bin/devkit-check-exports.mjs",
|
|
31
|
-
"kb-devkit-check-duplicates": "./bin/devkit-check-duplicates.mjs",
|
|
32
|
-
"kb-devkit-check-structure": "./bin/devkit-check-structure.mjs",
|
|
33
|
-
"kb-devkit-check-commands": "./bin/devkit-check-commands.mjs",
|
|
34
|
-
"kb-devkit-check-types": "./bin/devkit-check-types.mjs",
|
|
35
|
-
"kb-devkit-check-configs": "./bin/devkit-check-configs.mjs",
|
|
36
|
-
"kb-devkit-check-scripts": "./bin/devkit-check-scripts.mjs",
|
|
37
|
-
"kb-devkit-migrate-configs": "./bin/devkit-migrate-configs.mjs",
|
|
38
|
-
"kb-devkit-types-audit": "./bin/devkit-types-audit.mjs",
|
|
39
|
-
"kb-devkit-build-order": "./bin/devkit-build-order.mjs",
|
|
40
|
-
"kb-devkit-types-order": "./bin/devkit-types-order.mjs",
|
|
41
|
-
"kb-devkit-visualize": "./bin/devkit-visualize.mjs",
|
|
42
|
-
"kb-devkit-ci": "./bin/devkit-ci.mjs",
|
|
43
|
-
"kb-devkit-fix-deps": "./bin/devkit-fix-deps.mjs",
|
|
44
|
-
"kb-devkit-stats": "./bin/devkit-stats.mjs",
|
|
45
|
-
"kb-devkit-check-paths": "./bin/devkit-check-paths.mjs",
|
|
46
|
-
"kb-devkit-architecture": "./bin/devkit-architecture.mjs",
|
|
47
|
-
"kb-devkit-freshness": "./bin/devkit-freshness.mjs",
|
|
48
|
-
"kb-devkit-check-deprecated": "./bin/devkit-check-deprecated.mjs",
|
|
49
|
-
"kb-devkit-check-build-readiness": "./bin/devkit-check-build-readiness.mjs",
|
|
50
|
-
"kb-devkit-health": "./bin/devkit-health.mjs",
|
|
51
|
-
"kb-devkit-qa": "./bin/kb-devkit-qa.mjs",
|
|
52
|
-
"kb-devkit-qa-history": "./bin/kb-devkit-qa-history.mjs",
|
|
53
|
-
"kb-devkit-core-gate": "./bin/devkit-core-gate.mjs"
|
|
54
|
-
},
|
|
4
|
+
"version": "2.35.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
55
7
|
"exports": {
|
|
56
8
|
"./tsconfig/": "./tsconfig/",
|
|
57
9
|
"./tsconfig/base.json": "./tsconfig/base.json",
|
|
@@ -103,6 +55,85 @@
|
|
|
103
55
|
"./tsup/external-sync": "./tsup/external-sync.mjs",
|
|
104
56
|
"./sync": "./sync/index.mjs"
|
|
105
57
|
},
|
|
58
|
+
"bin": {
|
|
59
|
+
"kb-devkit-sync": "./bin/devkit-sync.mjs",
|
|
60
|
+
"kb-devkit-paths": "./bin/devkit-paths.mjs",
|
|
61
|
+
"kb-devkit-tsup-external": "./bin/devkit-tsup-external.mjs",
|
|
62
|
+
"kb-devkit-validate-naming": "./bin/devkit-validate-naming.mjs",
|
|
63
|
+
"kb-devkit-check-imports": "./bin/devkit-check-imports.mjs",
|
|
64
|
+
"kb-devkit-check-exports": "./bin/devkit-check-exports.mjs",
|
|
65
|
+
"kb-devkit-check-duplicates": "./bin/devkit-check-duplicates.mjs",
|
|
66
|
+
"kb-devkit-check-structure": "./bin/devkit-check-structure.mjs",
|
|
67
|
+
"kb-devkit-check-commands": "./bin/devkit-check-commands.mjs",
|
|
68
|
+
"kb-devkit-check-types": "./bin/devkit-check-types.mjs",
|
|
69
|
+
"kb-devkit-check-configs": "./bin/devkit-check-configs.mjs",
|
|
70
|
+
"kb-devkit-check-scripts": "./bin/devkit-check-scripts.mjs",
|
|
71
|
+
"kb-devkit-migrate-configs": "./bin/devkit-migrate-configs.mjs",
|
|
72
|
+
"kb-devkit-types-audit": "./bin/devkit-types-audit.mjs",
|
|
73
|
+
"kb-devkit-build-order": "./bin/devkit-build-order.mjs",
|
|
74
|
+
"kb-devkit-types-order": "./bin/devkit-types-order.mjs",
|
|
75
|
+
"kb-devkit-visualize": "./bin/devkit-visualize.mjs",
|
|
76
|
+
"kb-devkit-ci": "./bin/devkit-ci.mjs",
|
|
77
|
+
"kb-devkit-fix-deps": "./bin/devkit-fix-deps.mjs",
|
|
78
|
+
"kb-devkit-stats": "./bin/devkit-stats.mjs",
|
|
79
|
+
"kb-devkit-check-paths": "./bin/devkit-check-paths.mjs",
|
|
80
|
+
"kb-devkit-architecture": "./bin/devkit-architecture.mjs",
|
|
81
|
+
"kb-devkit-freshness": "./bin/devkit-freshness.mjs",
|
|
82
|
+
"kb-devkit-check-deprecated": "./bin/devkit-check-deprecated.mjs",
|
|
83
|
+
"kb-devkit-check-build-readiness": "./bin/devkit-check-build-readiness.mjs",
|
|
84
|
+
"kb-devkit-health": "./bin/devkit-health.mjs",
|
|
85
|
+
"kb-devkit-qa": "./bin/kb-devkit-qa.mjs",
|
|
86
|
+
"kb-devkit-qa-history": "./bin/kb-devkit-qa-history.mjs",
|
|
87
|
+
"kb-devkit-core-gate": "./bin/devkit-core-gate.mjs"
|
|
88
|
+
},
|
|
89
|
+
"files": [
|
|
90
|
+
"agents",
|
|
91
|
+
"assets",
|
|
92
|
+
"tsconfig",
|
|
93
|
+
"eslint",
|
|
94
|
+
"prettier",
|
|
95
|
+
"vitest",
|
|
96
|
+
"vite",
|
|
97
|
+
"tsup",
|
|
98
|
+
"templates",
|
|
99
|
+
".github",
|
|
100
|
+
"bin",
|
|
101
|
+
"sync",
|
|
102
|
+
"AGENTS.md",
|
|
103
|
+
".github",
|
|
104
|
+
".github/workflow-templates/**",
|
|
105
|
+
".github/actions/**"
|
|
106
|
+
],
|
|
107
|
+
"dependencies": {
|
|
108
|
+
"eslint-import-resolver-typescript": "^3.10.1",
|
|
109
|
+
"eslint-plugin-import": "^2.32.0",
|
|
110
|
+
"eslint-plugin-jsx-a11y": "^6.10.0",
|
|
111
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
112
|
+
"eslint-plugin-unused-imports": "^4.1.4",
|
|
113
|
+
"glob": "^11.0.0",
|
|
114
|
+
"yaml": "^2.8.0"
|
|
115
|
+
},
|
|
116
|
+
"devDependencies": {
|
|
117
|
+
"@types/node": "^24.3.3",
|
|
118
|
+
"@vitest/coverage-istanbul": "^4.1.4",
|
|
119
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
120
|
+
"eslint": "^9.35.0",
|
|
121
|
+
"eslint-plugin-filenames-simple": "^0.9.0",
|
|
122
|
+
"eslint-plugin-sonarjs": "^3.0.6",
|
|
123
|
+
"eslint-plugin-unicorn": "^62.0.0",
|
|
124
|
+
"jsdom": "^27.0.0",
|
|
125
|
+
"prettier": "^3.6.2",
|
|
126
|
+
"rimraf": "^6.0.1",
|
|
127
|
+
"tsup": "^8.5.0",
|
|
128
|
+
"typescript": "^5.9.2",
|
|
129
|
+
"typescript-eslint": "^8.44.0",
|
|
130
|
+
"vitest": "^3.2.4",
|
|
131
|
+
"@kb-labs/devkit": "2.35.0"
|
|
132
|
+
},
|
|
133
|
+
"engines": {
|
|
134
|
+
"node": ">=20.0.0",
|
|
135
|
+
"pnpm": ">=9.11.0"
|
|
136
|
+
},
|
|
106
137
|
"peerDependencies": {
|
|
107
138
|
"@playwright/test": "*",
|
|
108
139
|
"eslint": "^9.35.0",
|
|
@@ -134,58 +165,27 @@
|
|
|
134
165
|
"optional": true
|
|
135
166
|
}
|
|
136
167
|
},
|
|
137
|
-
"dependencies": {
|
|
138
|
-
"eslint-import-resolver-typescript": "^3.10.1",
|
|
139
|
-
"eslint-plugin-import": "^2.32.0",
|
|
140
|
-
"eslint-plugin-jsx-a11y": "^6.10.0",
|
|
141
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
142
|
-
"eslint-plugin-unused-imports": "^4.1.4",
|
|
143
|
-
"glob": "^11.0.0",
|
|
144
|
-
"yaml": "^2.8.0"
|
|
145
|
-
},
|
|
146
|
-
"devDependencies": {
|
|
147
|
-
"@types/node": "^24.3.3",
|
|
148
|
-
"@vitest/coverage-istanbul": "^4.1.4",
|
|
149
|
-
"@vitest/coverage-v8": "^3.2.4",
|
|
150
|
-
"eslint": "^9.35.0",
|
|
151
|
-
"eslint-plugin-filenames-simple": "^0.9.0",
|
|
152
|
-
"eslint-plugin-sonarjs": "^3.0.6",
|
|
153
|
-
"eslint-plugin-unicorn": "^62.0.0",
|
|
154
|
-
"jsdom": "^27.0.0",
|
|
155
|
-
"prettier": "^3.6.2",
|
|
156
|
-
"rimraf": "^6.0.1",
|
|
157
|
-
"tsup": "^8.5.0",
|
|
158
|
-
"typescript": "^5.9.2",
|
|
159
|
-
"typescript-eslint": "^8.44.0",
|
|
160
|
-
"vitest": "^3.2.4",
|
|
161
|
-
"@kb-labs/devkit": "2.34.0"
|
|
162
|
-
},
|
|
163
|
-
"engines": {
|
|
164
|
-
"node": ">=20.0.0",
|
|
165
|
-
"pnpm": ">=9.11.0"
|
|
166
|
-
},
|
|
167
|
-
"license": "MIT",
|
|
168
168
|
"publishConfig": {
|
|
169
169
|
"access": "public"
|
|
170
170
|
},
|
|
171
171
|
"scripts": {
|
|
172
|
-
"clean": "rimraf dist",
|
|
173
172
|
"build": "echo \"@kb-labs/devkit: nothing to build\"",
|
|
174
|
-
"
|
|
175
|
-
"
|
|
176
|
-
"test": "vitest run --passWithNoTests",
|
|
177
|
-
"test:watch": "vitest --passWithNoTests",
|
|
178
|
-
"paths": "node ./bin/devkit-paths.mjs",
|
|
173
|
+
"clean": "rimraf dist",
|
|
174
|
+
"dev": "tsup --config tsup.config.ts --watch",
|
|
179
175
|
"fixtures": "node scripts/fixtures.js –help",
|
|
176
|
+
"fixtures:bootstrap": "node scripts/fixtures.js –action=bootstrap",
|
|
177
|
+
"fixtures:build": "node scripts/fixtures.js –action=build",
|
|
180
178
|
"fixtures:check": "node scripts/fixtures.js –action=check",
|
|
179
|
+
"fixtures:ci": "node scripts/fixtures.js –action=check –since=${GITHUB_BASE_REF:-origin/main} –concurrency=3 || node scripts/fixtures.js –action=check",
|
|
180
|
+
"fixtures:clean": "node scripts/fixtures.js –action=clean",
|
|
181
181
|
"fixtures:lint": "node scripts/fixtures.js –action=lint",
|
|
182
182
|
"fixtures:test": "node scripts/fixtures.js –action=test",
|
|
183
|
-
"
|
|
184
|
-
"
|
|
185
|
-
"
|
|
186
|
-
"fixtures:ci": "node scripts/fixtures.js –action=check –since=${GITHUB_BASE_REF:-origin/main} –concurrency=3 || node scripts/fixtures.js –action=check",
|
|
183
|
+
"lint": "echo \"@kb-labs/devkit: lint skipped (plain JS/MJS, not TS project)\" && exit 0",
|
|
184
|
+
"lint:fix": "eslint . --fix --ignore-pattern 'dist/**'",
|
|
185
|
+
"paths": "node ./bin/devkit-paths.mjs",
|
|
187
186
|
"postinstall": "kb-devkit-tsup-external --generate || true",
|
|
188
|
-
"
|
|
187
|
+
"test": "vitest run --passWithNoTests",
|
|
188
|
+
"test:watch": "vitest --passWithNoTests",
|
|
189
189
|
"type-check": "echo \"@kb-labs/devkit: type-check skipped (plain JS/MJS, not TS project)\" && exit 0"
|
|
190
190
|
}
|
|
191
191
|
}
|
package/tsup/node.js
CHANGED
|
@@ -4,25 +4,30 @@ import { readFileSync, existsSync } from 'node:fs'
|
|
|
4
4
|
import { join } from 'node:path'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Derive tsup entry points from package.json
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Derive tsup entry points from package.json.
|
|
8
|
+
* Reads two sources of published dist artifacts:
|
|
9
|
+
* 1. `exports` — public module surface ("./dist/foo.js" → "src/foo.ts")
|
|
10
|
+
* 2. `kb.manifest` — plugin/adapter manifest loaded at runtime by the
|
|
11
|
+
* kb-labs platform; it's referenced as a dist path but not exported,
|
|
12
|
+
* so it would otherwise be silently omitted from the build.
|
|
13
|
+
* Falls back to ['src/index.ts'] if nothing resolves.
|
|
10
14
|
*/
|
|
11
15
|
function resolveEntryFromExports() {
|
|
12
16
|
try {
|
|
13
17
|
const pkgPath = join(process.cwd(), 'package.json')
|
|
14
18
|
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'))
|
|
15
|
-
const exportsMap = pkg.exports ?? {}
|
|
16
19
|
const srcFiles = new Set()
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
const distPaths = []
|
|
22
|
+
for (const condition of Object.values(pkg.exports ?? {})) {
|
|
20
23
|
const importPath = typeof condition === 'string' ? condition
|
|
21
24
|
: (condition.import ?? condition.default ?? null)
|
|
22
|
-
if (
|
|
25
|
+
if (importPath && typeof importPath === 'string') distPaths.push(importPath)
|
|
26
|
+
}
|
|
27
|
+
if (typeof pkg.kb?.manifest === 'string') distPaths.push(pkg.kb.manifest)
|
|
23
28
|
|
|
24
|
-
|
|
25
|
-
const base =
|
|
29
|
+
for (const p of distPaths) {
|
|
30
|
+
const base = p.replace(/^\.\/dist\//, '').replace(/\.js$/, '')
|
|
26
31
|
const candidates = [`src/${base}.ts`, `${base}.ts`]
|
|
27
32
|
for (const c of candidates) {
|
|
28
33
|
if (existsSync(join(process.cwd(), c))) { srcFiles.add(c); break }
|