phase-1: RED→GREEN — scaffold Solid.js + Vite + vitest, smoke test passes

This commit is contained in:
root
2026-05-22 06:03:56 +00:00
parent ef91b55943
commit f6726c8236
7 changed files with 3403 additions and 0 deletions

12
index.html Normal file
View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en" class="dark">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Damascus Dashboard</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>

3316
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

25
package.json Normal file
View File

@@ -0,0 +1,25 @@
{
"name": "damascus-dashboard",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"test": "vitest run",
"test:watch": "vitest"
},
"dependencies": {
"solid-js": "^1.9.13"
},
"devDependencies": {
"@solidjs/testing-library": "^0.8.10",
"jsdom": "^29.1.1",
"msw": "^2.14.6",
"typescript": "^6.0.3",
"vite": "^8.0.14",
"vite-plugin-solid": "^2.11.12",
"vitest": "^4.1.7"
}
}

View File

@@ -0,0 +1,9 @@
import { render } from "@solidjs/testing-library";
import { describe, it, expect } from "vitest";
describe("smoke", () => {
it("renders", () => {
const { getByTestId } = render(() => <div data-testid="app">damascus</div>);
expect(getByTestId("app").textContent).toBe("damascus");
});
});

21
tsconfig.json Normal file
View File

@@ -0,0 +1,21 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
"jsxImportSource": "solid-js",
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"]
}

6
vite.config.ts Normal file
View File

@@ -0,0 +1,6 @@
import { defineConfig } from "vite";
import solid from "vite-plugin-solid";
export default defineConfig({
plugins: [solid()],
});

14
vitest.config.ts Normal file
View File

@@ -0,0 +1,14 @@
import { defineConfig } from "vitest/config";
import solid from "vite-plugin-solid";
export default defineConfig({
plugins: [solid()],
test: {
environment: "jsdom",
globals: true,
setupFiles: [],
},
resolve: {
conditions: ["development", "browser"],
},
});