Split webui tooling into separate configs
- Move Vite, Vitest, Oxfmt, and Oxlint into standalone config files - Replace vite-plus scripts and test imports with direct tools - Keep the generated route tree out of formatter and linter checks
This commit is contained in:
parent
adb6426a2f
commit
ce1fb16b76
13 changed files with 889 additions and 734 deletions
18
webui/.oxfmtrc.json
Normal file
18
webui/.oxfmtrc.json
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"$schema": "./node_modules/oxfmt/configuration_schema.json",
|
||||
"ignorePatterns": ["src/routeTree.gen.ts"],
|
||||
"singleQuote": true,
|
||||
"sortImports": {
|
||||
"groups": [
|
||||
"type-import",
|
||||
["value-builtin", "value-external"],
|
||||
"type-internal",
|
||||
"value-internal",
|
||||
["type-parent", "type-sibling", "type-index"],
|
||||
["value-parent", "value-sibling", "value-index"],
|
||||
"unknown"
|
||||
]
|
||||
},
|
||||
"sortPackageJson": true,
|
||||
"trailingComma": "all"
|
||||
}
|
||||
8
webui/.oxlintrc.json
Normal file
8
webui/.oxlintrc.json
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||
"ignorePatterns": ["src/routeTree.gen.ts"],
|
||||
"options": {
|
||||
"typeAware": true,
|
||||
"typeCheck": true
|
||||
}
|
||||
}
|
||||
1502
webui/package-lock.json
generated
1502
webui/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -3,12 +3,12 @@
|
|||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"check": "vp check src",
|
||||
"dev": "vp dev",
|
||||
"fix": "vp check --fix src",
|
||||
"build": "vp build",
|
||||
"test": "vp test run",
|
||||
"test:watch": "vp test",
|
||||
"check": "oxfmt --check src && oxlint --type-check src",
|
||||
"dev": "vite",
|
||||
"fix": "oxfmt src && oxlint --type-check src --fix",
|
||||
"build": "vite build",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"test:e2e": "playwright test"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
@ -30,18 +30,14 @@
|
|||
"@types/react": "^19.2.14",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"@vitejs/plugin-react": "^6.0.1",
|
||||
"@voidzero-dev/vite-plus-core": "^0.1.19",
|
||||
"@voidzero-dev/vite-plus-test": "^0.1.19",
|
||||
"jsdom": "^29.0.2",
|
||||
"msw": "^2.14.2",
|
||||
"oxfmt": "^0.47.0",
|
||||
"oxlint": "^1.62.0",
|
||||
"oxlint-tsgolint": "^0.22.1",
|
||||
"typescript": "^6.0.3",
|
||||
"vite": "npm:@voidzero-dev/vite-plus-core@^0.1.19",
|
||||
"vite-plus": "^0.1.19",
|
||||
"vitest": "npm:@voidzero-dev/vite-plus-test@^0.1.19"
|
||||
"vite": "^8.0.10",
|
||||
"vitest": "^4.1.5"
|
||||
},
|
||||
"packageManager": "npm@11.13.0",
|
||||
"overrides": {
|
||||
"vite": "npm:@voidzero-dev/vite-plus-core@^0.1.19",
|
||||
"vitest": "npm:@voidzero-dev/vite-plus-test@^0.1.19"
|
||||
}
|
||||
"packageManager": "npm@11.13.0"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { ResponsePromise } from 'ky';
|
||||
|
||||
import { HTTPError } from 'ky';
|
||||
import { describe, expect, it, vi } from 'vite-plus/test';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { readJson } from './api-client';
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|||
import {
|
||||
SHELL_PROFILE_CONTEXT_CHANGED_EVENT,
|
||||
type ShellBridge,
|
||||
type ShellProfileContext,
|
||||
type ShellPageId,
|
||||
} from '@/platform/shell/bridge';
|
||||
|
||||
|
|
@ -138,7 +139,7 @@ describe('createAppRouter', () => {
|
|||
});
|
||||
|
||||
it('waits for profile context before rendering React routes', async () => {
|
||||
const getCurrentProfileContext = vi.fn(() => null);
|
||||
const getCurrentProfileContext = vi.fn<() => ShellProfileContext | null>(() => null);
|
||||
window.SoulSyncWebShellBridge = createShellBridge({
|
||||
getCurrentProfileContext,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { describe, expect, it } from 'vite-plus/test';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import {
|
||||
getShellRouteByPageId,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { describe, expect, it } from 'vite-plus/test';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { HttpResponse, http, server } from '@/test/msw';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { describe, expect, it } from 'vite-plus/test';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { ISSUE_CATEGORY_META, normalizeIssuesSearch } from './-issues.helpers';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { createMemoryHistory } from '@tanstack/react-router';
|
||||
import { act, fireEvent, render, screen, waitFor } from '@testing-library/react';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vite-plus/test';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import type { ShellBridge, ShellPageId } from '@/platform/shell/bridge';
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,13 @@
|
|||
"noEmit": true,
|
||||
"types": ["node", "vitest/globals", "@testing-library/jest-dom", "react", "react-dom"]
|
||||
},
|
||||
"include": ["./src", "./tests", "./vitest.setup.ts", "./vite.config.ts", "./playwright.config.ts"],
|
||||
"include": [
|
||||
"./src",
|
||||
"./tests",
|
||||
"./vitest.setup.ts",
|
||||
"./vite.config.ts",
|
||||
"./vitest.config.ts",
|
||||
"./playwright.config.ts"
|
||||
],
|
||||
"references": []
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,25 +1,9 @@
|
|||
import { tanstackRouter } from '@tanstack/router-plugin/vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import path from 'node:path';
|
||||
import { defineConfig } from 'vite-plus';
|
||||
import { defineConfig } from 'vite';
|
||||
|
||||
export default defineConfig({
|
||||
fmt: {
|
||||
singleQuote: true,
|
||||
sortImports: {
|
||||
groups: [
|
||||
'type-import',
|
||||
['value-builtin', 'value-external'],
|
||||
'type-internal',
|
||||
'value-internal',
|
||||
['type-parent', 'type-sibling', 'type-index'],
|
||||
['value-parent', 'value-sibling', 'value-index'],
|
||||
'unknown',
|
||||
],
|
||||
},
|
||||
sortPackageJson: true,
|
||||
trailingComma: 'all',
|
||||
},
|
||||
plugins: [
|
||||
tanstackRouter({
|
||||
target: 'react',
|
||||
|
|
@ -44,13 +28,4 @@ export default defineConfig({
|
|||
input: [path.resolve(import.meta.dirname, 'src/app/main.tsx')],
|
||||
},
|
||||
},
|
||||
test: {
|
||||
include: ['src/**/*.test.ts', 'src/**/*.test.tsx', 'src/**/*.spec.ts', 'src/**/*.spec.tsx'],
|
||||
exclude: ['tests/**'],
|
||||
environment: 'jsdom',
|
||||
globals: true,
|
||||
setupFiles: ['./vitest.setup.ts'],
|
||||
css: true,
|
||||
restoreMocks: true,
|
||||
},
|
||||
});
|
||||
|
|
|
|||
18
webui/vitest.config.ts
Normal file
18
webui/vitest.config.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { mergeConfig, defineConfig } from 'vitest/config';
|
||||
|
||||
import viteConfig from './vite.config';
|
||||
|
||||
export default mergeConfig(
|
||||
viteConfig,
|
||||
defineConfig({
|
||||
test: {
|
||||
include: ['src/**/*.test.ts', 'src/**/*.test.tsx', 'src/**/*.spec.ts', 'src/**/*.spec.tsx'],
|
||||
exclude: ['tests/**'],
|
||||
environment: 'jsdom',
|
||||
globals: true,
|
||||
setupFiles: ['./vitest.setup.ts'],
|
||||
css: true,
|
||||
restoreMocks: true,
|
||||
},
|
||||
}),
|
||||
);
|
||||
Loading…
Reference in a new issue