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/**"],
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user