Refactor UUID generation, remove unused logger and encryption utilities, and clean up request handling

- Updated `generateUUID` function for improved readability and performance.
- Deleted `logger.ts`, `other.ts`, `request.ts`, `storage.ts`, `tansParams.ts`, and `validate.ts` as they were no longer needed.
- Simplified TypeScript configuration by removing unnecessary paths and aliases.
- Enhanced Vite configuration for better project structure and maintainability.
This commit is contained in:
DEV_DSW
2026-04-17 15:38:08 +08:00
parent b1dea9a5c2
commit 79bea4f107
360 changed files with 14495 additions and 30856 deletions

View File

@@ -0,0 +1,74 @@
# React Migration Status - 2026-04-17
## Current Verdict
- The active renderer bootstrap is React-only.
- The legacy Vue bootstrap, page tree, component tree, store tree, request/api layer, and the final leftover `src/**` tree have been removed.
- The repository source/runtime is now effectively React-only.
## What Changed In This Pass
1. `index.html -> src/main.tsx` is now the only active renderer startup path.
2. The temporary compatibility shims `renderer-main.ts`, `ui-framework.ts`, `src/main.ts`, and `src/framework.ts` have been removed.
3. The dead Vue bootstrap chain was removed:
- `src/main-vue.ts`
- `src/router/index.ts`
- `src/permission.ts`
- `src/App.vue`
4. The dead Vue runtime tree was removed:
- `src/pages/**`
- `src/components/**`
- `src/stores/**`
- `src/api/**`
- `src/utils/request.ts`
- `src/auto-imports.d.ts`
- legacy Vue-only composables and i18n bootstrap files
- the remaining `src/main.ts`, `src/framework.ts`, assets, constants, locales, shared helpers, and utility files
5. `global.d.ts` no longer declares Vue-era modules or the deleted `@assets/images/*` alias.
6. `tsconfig.app.json`, `tsconfig.json`, and `vite.config.ts` no longer keep the stale `src/**` alias surface.
7. `openapi-ts-request.config.ts` now points at `src/api`, and `src/api/request.ts` provides the React-side generated request bridge.
8. `package.json` no longer lists Vue-era runtime/UI dependencies.
## Validation On 2026-04-17
- `pnpm typecheck` passes.
- `pnpm build:vite` passes.
- The renderer build, Electron main build, and preload build all complete successfully in the current workspace.
- The current build still emits a warning and skips bytenode bytecode compilation when the local Electron binary is unavailable in `node_modules/electron`.
## Remaining Non-Blocking Notes
1. `package-lock.json` still contains historical Vue-era entries; the active workspace lockfile is `pnpm-lock.yaml`.
2. `pnpm-lock.yaml` still includes `@vue/compiler-sfc` transitively through `openapi-ts-request`, not through the application runtime.
## Remaining Follow-Up
1. Clean up stale historical docs that still mention `src/**` as a live runtime path.
2. Decide whether to keep or remove `package-lock.json` in a `pnpm`-managed repo.
3. Keep build and typecheck green while the React/runtime-shared structure continues to evolve.
## Build Chain Notes
1. `vite.config.ts` now scopes Electron `build.watch` to development mode so `pnpm build:vite` exits cleanly in production mode.
2. The main-process Vite build now uses the same alias map as renderer/preload, so Electron imports like `@lib/constants` resolve correctly.
3. `vite-plugin-electron-encrypt` now degrades gracefully when the local Electron executable is missing, logging a warning instead of failing the build.
4. React router now guards workspace routes and redirects authenticated users away from `/login`.
## Practical Boundary After This Pass
- Safe now:
- Treat React as the only supported renderer startup path.
- Treat the old Vue tree as fully retired code.
- Remove `src/**` from migration planning, because it is no longer part of the repo.
- Not safe yet:
- Assume every transitive `vue` string in lockfiles is a runtime blocker; some now come only from tooling.
- Remove `@runtime/*` without replacing the shared Electron/runtime contract.
## Recommended Next Gate
Only consider the final Vue exit once:
1. No source file imports any Vue-era runtime package.
2. `package.json` stays free of the Vue-era dependencies and `pnpm-lock.yaml` stays refreshed.
3. Build and typecheck keep passing after future runtime-shared and React-side changes.
4. The remaining historical references are treated as documentation cleanup, not runtime migration blockers.