feat(FN-969): scaffold TUI package with Ink entry point and vitest config
- Create @fusion/tui package structure with ink and react dependencies - Add basic App component entry point using Ink's Box and Text primitives - Configure vitest with passWithNoTests and coverage settings - Fix tsconfig to exclude vitest/globals types from production build
This commit is contained in:
@@ -13,20 +13,22 @@
|
||||
"README.md"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "tsx src/index.tsx",
|
||||
"build": "tsc",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test": "echo 'No tests yet' && exit 0"
|
||||
"test": "vitest run"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fusion/core": "workspace:*",
|
||||
"ink": "^6.8.0",
|
||||
"ink-text-input": "^6.0.0",
|
||||
"react": "^19.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^25.5.0",
|
||||
"@types/react": "^19.0.0",
|
||||
"typescript": "^5.7.0"
|
||||
"@vitest/coverage-v8": "^3.1.0",
|
||||
"tsx": "^4.19.0",
|
||||
"typescript": "^5.7.0",
|
||||
"vitest": "^3.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22.5.0"
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/** @fusion/tui — Terminal UI components for kb */
|
||||
|
||||
export {};
|
||||
import { render, Text } from "ink";
|
||||
import React from "react";
|
||||
|
||||
/** Main application component for dev mode */
|
||||
function App() {
|
||||
return <Text>Hello from @fusion/tui!</Text>;
|
||||
}
|
||||
|
||||
// When run directly via `pnpm dev`, render the app
|
||||
render(<App />);
|
||||
|
||||
19
packages/tui/vitest.config.ts
Normal file
19
packages/tui/vitest.config.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { defineConfig } from "vitest/config";
|
||||
|
||||
const maxWorkers = Number.parseInt(process.env.VITEST_MAX_WORKERS ?? "16", 10);
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
include: ["src/**/*.test.ts", "src/**/*.test.tsx"],
|
||||
passWithNoTests: true,
|
||||
maxWorkers,
|
||||
fileParallelism: true,
|
||||
coverage: {
|
||||
enabled: false,
|
||||
reporter: ["text", "html", "json"],
|
||||
reportsDirectory: "./coverage",
|
||||
include: ["src/**/*.ts", "src/**/*.tsx"],
|
||||
exclude: ["**/*.test.ts", "**/*.test.tsx", "**/*.d.ts", "dist/**"],
|
||||
},
|
||||
},
|
||||
});
|
||||
35
pnpm-lock.yaml
generated
35
pnpm-lock.yaml
generated
@@ -246,15 +246,9 @@ importers:
|
||||
|
||||
packages/tui:
|
||||
dependencies:
|
||||
'@fusion/core':
|
||||
specifier: workspace:*
|
||||
version: link:../core
|
||||
ink:
|
||||
specifier: ^6.8.0
|
||||
version: 6.8.0(@types/react@19.2.14)(react@19.2.4)
|
||||
ink-text-input:
|
||||
specifier: ^6.0.0
|
||||
version: 6.0.0(ink@6.8.0(@types/react@19.2.14)(react@19.2.4))(react@19.2.4)
|
||||
react:
|
||||
specifier: ^19.0.0
|
||||
version: 19.2.4
|
||||
@@ -265,9 +259,18 @@ importers:
|
||||
'@types/react':
|
||||
specifier: ^19.0.0
|
||||
version: 19.2.14
|
||||
'@vitest/coverage-v8':
|
||||
specifier: ^3.1.0
|
||||
version: 3.2.4(vitest@3.2.4(@types/debug@4.1.13)(@types/node@25.5.0)(jsdom@29.0.1)(tsx@4.21.0)(yaml@2.8.3))
|
||||
tsx:
|
||||
specifier: ^4.19.0
|
||||
version: 4.21.0
|
||||
typescript:
|
||||
specifier: ^5.7.0
|
||||
version: 5.9.3
|
||||
vitest:
|
||||
specifier: ^3.1.0
|
||||
version: 3.2.4(@types/debug@4.1.13)(@types/node@25.5.0)(jsdom@29.0.1)(tsx@4.21.0)(yaml@2.8.3)
|
||||
|
||||
packages:
|
||||
|
||||
@@ -2578,13 +2581,6 @@ packages:
|
||||
inherits@2.0.4:
|
||||
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
|
||||
|
||||
ink-text-input@6.0.0:
|
||||
resolution: {integrity: sha512-Fw64n7Yha5deb1rHY137zHTAbSTNelUKuB5Kkk2HACXEtwIHBCf9OH2tP/LQ9fRYTl1F0dZgbW0zPnZk6FA9Lw==}
|
||||
engines: {node: '>=18'}
|
||||
peerDependencies:
|
||||
ink: '>=5'
|
||||
react: '>=18'
|
||||
|
||||
ink@6.8.0:
|
||||
resolution: {integrity: sha512-sbl1RdLOgkO9isK42WCZlJCFN9hb++sX9dsklOvfd1YQ3bQ2AiFu12Q6tFlr0HvEUvzraJntQCCpfEoUe9DSzA==}
|
||||
engines: {node: '>=20'}
|
||||
@@ -3734,10 +3730,6 @@ packages:
|
||||
engines: {node: '>=18.0.0'}
|
||||
hasBin: true
|
||||
|
||||
type-fest@4.41.0:
|
||||
resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==}
|
||||
engines: {node: '>=16'}
|
||||
|
||||
type-fest@5.5.0:
|
||||
resolution: {integrity: sha512-PlBfpQwiUvGViBNX84Yxwjsdhd1TUlXr6zjX7eoirtCPIr08NAmxwa+fcYBTeRQxHo9YC9wwF3m9i700sHma8g==}
|
||||
engines: {node: '>=20'}
|
||||
@@ -6838,13 +6830,6 @@ snapshots:
|
||||
|
||||
inherits@2.0.4: {}
|
||||
|
||||
ink-text-input@6.0.0(ink@6.8.0(@types/react@19.2.14)(react@19.2.4))(react@19.2.4):
|
||||
dependencies:
|
||||
chalk: 5.6.2
|
||||
ink: 6.8.0(@types/react@19.2.14)(react@19.2.4)
|
||||
react: 19.2.4
|
||||
type-fest: 4.41.0
|
||||
|
||||
ink@6.8.0(@types/react@19.2.14)(react@19.2.4):
|
||||
dependencies:
|
||||
'@alcalzone/ansi-tokenize': 0.2.5
|
||||
@@ -8248,8 +8233,6 @@ snapshots:
|
||||
optionalDependencies:
|
||||
fsevents: 2.3.3
|
||||
|
||||
type-fest@4.41.0: {}
|
||||
|
||||
type-fest@5.5.0:
|
||||
dependencies:
|
||||
tagged-tag: 1.0.0
|
||||
|
||||
Reference in New Issue
Block a user