NewLife/NewLife.Cube.TDesign

NewLife.Cube.TDesign
Detail
Zip
Compare
README.md
# NewLife.Cube.TDesign - Vue 3 + TDesign + Vite 6 skin for NewLife.Cube ![Nuget](https://img.shields.io/nuget/v/newlife.cube.tdesign?logo=nuget) ![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/newlife.cube.tdesign?label=dev%20nuget&logo=nuget) ![GitHub License](https://img.shields.io/github/license/NewLifeX/NewLife.Cube.TDesign?logo=github) <!-- lang:start --> 🌐 [简体中文](/NewLife/NewLife.Cube.TDesign/Blob/master/README.zh-CN.md) | [繁體中文](/NewLife/NewLife.Cube.TDesign/Blob/master/README.zh-TW.md) | [Español](/NewLife/NewLife.Cube.TDesign/Blob/master/README.es.md) | [Deutsch](/NewLife/NewLife.Cube.TDesign/Blob/master/README.de.md) | [日本語](/NewLife/NewLife.Cube.TDesign/Blob/master/README.ja.md) | [Français](/NewLife/NewLife.Cube.TDesign/Blob/master/README.fr.md) | [Português](/NewLife/NewLife.Cube.TDesign/Blob/master/README.pt.md) | [Русский](/NewLife/NewLife.Cube.TDesign/Blob/master/README.ru.md) | [한국어](/NewLife/NewLife.Cube.TDesign/Blob/master/README.ko.md) | [العربية](/NewLife/NewLife.Cube.TDesign/Blob/master/README.ar.md) <!-- lang:end --> The **TDesign skin** for the third-generation Web API front end of Cube (NewLife.Cube), delivered as a standalone NuGet package and repository. Built with **Vue 3 + TDesign + Vite 6**, it renders metadata-driven lists and forms and follows the Cube skin design specification. ## Highlights - Out of the box: reference the NuGet package, run `AddCube` + `UseCube`, and the embedded admin console is ready; no physical front-end files are required. - Metadata driven: lists, forms, search and detail pages are rendered from backend `meta`; adding an entity needs no front-end work. - Shared npm core: uses `@newlifex/cube` for API, page logic, field mapping and auth; the framework-agnostic core is shared by all Cube skins. - Skin switching: Cube auto-discovers referenced skin packages; switch with the `SpaSkin` setting. - Feature parity with Cube.Vue / Cube.React: sign-in (captcha, MFA, tenant, OAuth), registration, password recovery, account activation, workbench, account center (profile/security), tree tables, column settings, import/export, developer actions, menu search, multi-tab navigation, theming and UI language. - Two test layers: Vitest for utility modules, Playwright for sign-in, navigation, entity CRUD, config pages, permissions, account center and list enhancements. ## Documentation - [Requirements (zh-CN)](/NewLife/NewLife.Cube.TDesign/Blob/master/Doc/需求文档.md) - [Feature list (zh-CN)](/NewLife/NewLife.Cube.TDesign/Blob/master/Doc/功能清单.md) - [Architecture (zh-CN)](/NewLife/NewLife.Cube.TDesign/Blob/master/Doc/架构设计.md) - [Multi-language README guide (zh-CN)](/NewLife/NewLife.Cube.TDesign/Blob/master/Doc/README多语言规范.md) ## Quick Start Reference `NewLife.Cube` and `NewLife.Cube.TDesign`, then start the host: ```bash dotnet add package NewLife.Cube dotnet add package NewLife.Cube.TDesign ``` ```csharp services.AddCube(); var app = builder.Build(); app.UseCube(app.Environment); app.MapControllers(); app.Run(); ``` ## Local Development Start the demo backend and the Vite dev server: ```bash # backend (SQLite, http://localhost:7120) dotnet run --project CubeDemo/TDesignCubeDemo.csproj # frontend (http://localhost:5187) cd NewLife.Cube.TDesign/web pnpm install pnpm dev ``` ### Local boundary channel .NET: `dotnet build 魔方TDesign.slnx -p:UseLocalNewLifeSource=true` uses the sibling `../NewLife.Cube` source. npm: `pnpm link:local` / `pnpm unlink:local` switches to `../NewLife.Cube/packages/cube` and back. ## Build and Test Build the web assets, run checks and pack the NuGet package: ```bash cd NewLife.Cube.TDesign/web pnpm build pnpm test:unit dotnet build 魔方TDesign.slnx -c Release dotnet pack NewLife.Cube.TDesign/NewLife.Cube.TDesign.csproj -c Release -o out ``` ### E2E tests The Playwright suite in `E2ETest/` covers every menu page plus CRUD, config, permission and navigation flows against the demo site. ```bash # demo site on http://localhost:7120 (SQLite) dotnet run --project CubeDemo/TDesignCubeDemo.csproj cd E2ETest pnpm install pnpm exec playwright install chromium pnpm test ``` Set `E2E_BASE_URL` (for example `http://localhost:7117`) to target another host/port, or `E2E_NO_WEBSERVER=1` when the site is already running. Admin credentials come from `ADMIN_USER` / `ADMIN_PASS` (default `admin` / `admin`). ## Release CI builds the web assets, embeds `wwwroot` into the DLL, then packs and publishes `NewLife.Cube.TDesign` to NuGet. ## Related repositories | Repository | Description | | --- | --- | | [NewLife.Cube](https://github.com/NewLifeX/NewLife.Cube) | Cube core, shared npm package `@newlifex/cube` and skin design specification. | | [NewLife.Cube.React](https://github.com/NewLifeX/NewLife.Cube.React) | React skin (React 19 + Ant Design). | | [NewLife.Cube.TDesign](https://github.com/NewLifeX/NewLife.Cube.TDesign) | TDesign skin. | | [NewLife.Cube.Soybean](https://github.com/NewLifeX/NewLife.Cube.Soybean) | Soybean Admin skin. | ## License MIT