Skip to content

Latest commit

 

History

History
225 lines (181 loc) · 21 KB

File metadata and controls

225 lines (181 loc) · 21 KB

Changelog

All notable changes to @guanzhu.me/arco-cli are documented here. Format loosely follows Keep a Changelog; versions follow SemVer. The npm registry is the source of truth: https://www.npmjs.com/package/@guanzhu.me/arco-cli.

[0.14.0] — 2026-05-21

  • Feat arco doctor — static diagnostic command for scaffolded arco-pro-recommend projects. Runs four checks and exits non-zero on any failure (CI-friendly):
    1. Project shape — probes for the standard layout markers (src/api/client.ts, src/auth/access.tsx, src/mock/handlers.ts, src/routes.ts, package.json).
    2. Mock handlers — every file under src/mock/*.ts or src/pages/**/mock/index.ts that exports handlers must be imported + spread in src/mock/handlers.ts. Helper modules (no export const handlers) are skipped, so mock/random.ts etc. don't produce false positives.
    3. Access flags — every access.foo reference across src/**/*.{ts,tsx} must be defined in defineAccess()'s return shape. Uses a \baccess\.\w+\b regex (not \ba\.\w+\b) so sort-callback shorthands like (a, b) => a.x - b.x don't trigger false positives.
    4. Route → page mapping — every leaf key: 'foo/bar' in src/routes.ts must have a matching src/pages/foo/bar/index.tsx.
  • Feat (template) Logout now goes through Modal.confirm instead of firing immediately on click — the warning and OK/cancel labels are localised (navbar.logout.confirm.{title,content,ok,cancel} keys in en-US.ts + zh-CN.ts), and the OK button uses status: 'danger' for a visual safety cue.

0.13.1 — 2026-05-21

  • Docs Added docs/auth-backend.{md,zh-CN.md} — end-to-end guide for wiring the new <Access> system to a real backend. Covers the UserInfo contract, three permission models (pure RBAC / pure ACL / hybrid) with SQL schemas, middleware examples in Node/Express, Spring Boot, Python/FastAPI, and Go, session vs JWT trade-offs with refresh-token rotation, data-level filtering (Postgres RLS), permission cache invalidation, best practices, and a migration checklist from existing auth backends.
  • Docs Both READMEs now have a "Wiring a real backend" section linking to the new guide.

0.13.0 — 2026-05-21

  • Feat (breaking, template) Modern <Access> permission system. Replaces the previous <PermissionWrapper> + requiredPermissions array convention with a hybrid RBAC + fine-grained model that mirrors ant-design-pro's <Access> API:
    • src/auth/access.tsxdefineAccess(userInfo) factory + useAccess() hook + <Access accessible fallback> component. All boolean flags consumed by the UI live in one place; backend shape changes are a one-file edit.
    • Backend shape: userInfo now exposes both roles: string[] (coarse RBAC) and permissions?: Record<string, string[]> (optional fine-grained overlay). The frontend defineAccess uses both — most flags resolve from roles alone, occasional can(resource, action) checks cover "give this user one extra capability outside their role" cases.
    • src/routes.ts: route nodes carry an access?: (a: AccessMap) => boolean predicate instead of requiredPermissions: [{ resource, actions }]. Cleaner type-checked references to central flags.
    • src/auth/ProtectedRoute.tsx gains a requireAccess prop for route-level gating with redirect to /exception/403 (override via denyRedirect).
    • Migrated 3 call sites in pages/list/{search-table,card} to use <Access accessible={access.canX}>.
    • Removed src/components/PermissionWrapper/ and src/utils/authentication.ts — no backward-compat shim.

0.12.1 — 2026-05-21

  • Security pages/login/form.tsx no longer JSON.stringifies the password into localStorage when "Remember me" is checked. Only the username is persisted, and is rehydrated into the form on next visit (password field stays blank). The locale key + label changed from "Remember password" → "Remember me" / "记住账号".
  • Fix /login no longer force-sets arco-theme=light on mount, so dark-mode users bounced to the login page (e.g. after a 401) don't see a theme flash.
  • Fix Successful login now navigate('/') (with redirect-target restoration from location.state.from) instead of window.location.href = '/'. The page-reload was throwing away the TanStack Query cache that the login itself just warmed.
  • Fix The axios 401 interceptor now calls a router-aware navigate when one's been bound by the layout (bindNavigator in api/client.ts); falls back to location.href only when the interceptor fires before React mounts.
  • Cleanup Deleted utils/is.tsisArray/isObject/isString had zero references, and isSSR was theatre in a Vite SPA. useStorage.ts and getUrlParams.ts lost their isSSR guards; useStorage also picked up a cross-tab storage event listener so two windows sharing the same arco-lang / arco-theme stay in sync.
  • Cleanup Stripped import React from 'react' from 32 .tsx files where the namespace wasn't actually referenced — Vite 7's automatic JSX runtime makes the default import dead weight.
  • UX Footer and pages/login/index.tsx now render env.appTitle instead of the hardcoded literal "Arco Design Pro". The login.form.title locale key is also localisation-neutral ("Sign in" / "登录") rather than baking the brand name into every translation.
  • Types Typed pages/profile/basic/{item,index}.tsx on BasicProfile (no more data: any / {} as any), pages/user/setting/header.tsx on UserInfo, pages/list/card/index.tsx on CardListBundle.

0.12.0 — 2026-05-21

  • Feat arco add table <name> — single-command full CRUD module scaffold. Generates a page (index.tsx + columns.tsx + drawer form.tsx + locale/), four API hooks (list / create / update / delete with zod schemas + cache invalidation), and MSW handlers that actually mutate an in-memory list (POST/PUT/DELETE persist for the session). Auto-edits src/routes.ts, src/locale/{en-US,zh-CN}.ts (or legacy index.ts), and src/mock/handlers.ts to register everything. Falls back to printing the snippet when any of the three files doesn't match the expected upstream shape — same pattern as add page / add api. Reuses the existing addPage/routesEdit, addPage/localeEdit, and addApi/handlersEdit engines.

0.11.2 — 2026-05-21

  • Perf Global locale split per language (src/locale/{en-US,zh-CN}.ts); only the active language ships in the entry chunk. Switching languages dynamic-imports the other bundle and adds it to i18next on the fly. New initI18n() from src/i18n/index.ts is awaited in main.tsx before React mounts.
  • Feat MutationCache.onSuccess now reads a typed meta.successMessage and fires the global Arco toast — same pattern the error toast already used. Added AppMeta type + declare module '@tanstack/react-query' block so the field is autocompleted at call sites. useSubmitGroupFormMutation accepts the meta as a parameter; the form page passes its localised success string in once at construction instead of re-implementing the toast inline.
  • UX pages/dashboard/monitor/chat-panel.tsx swapped <Spin> for <Skeleton> shaped like a chat row (avatar + 3 text lines), matching the Skeleton pattern used by the workplace overview cards. Chart loaders still use Spin — Skeleton doesn't match a chart's visual footprint.

0.11.1 — 2026-05-21

  • Fix pages/user/setting/info.tsx: Message.success('userSetting.saveSuccess') was passing the literal locale key instead of the translated string — users saw the raw key in the toast.
  • Fix pages/login/banner.tsx: all three carousel slides referenced the same image URL. Replaced the three ByteDance CDN URLs with three distinct local SVG illustrations under pages/login/assets/.
  • Fix i18n holes: NavBar menu-item placeholder toast was hardcoded English; welcome/code-block had hardcoded zh-CN copy/copied strings. Both now read locale keys.
  • Security http://p1-arco.byteimg.com/... refs in dashboard/monitor/{data-statistic-list,studio}.tsx upgraded to https:// to avoid mixed-content blocks under HTTPS deploys.
  • Perf All useQuery hooks across src/api/*.ts now forward signal from QueryFunctionContext into the axios call. TanStack Query aborts the underlying request when the component unmounts or the queryKey changes — previously the response was downloaded and silently dropped. useSearchTableQuery gained an explicit Promise<SearchTableResponse> annotation to keep type inference clean alongside placeholderData: keepPreviousData.

0.11.0 — 2026-05-21

  • Feat arco add api <name> — scaffold a TanStack Query hook + zod schema + MSW handler in one shot, and auto-register the handler in src/mock/handlers.ts. --method get (default) generates useXxxQuery + list response schema; --method post|put|delete generates useXxxMutation + input schema + cache invalidation. --skip-mock skips the mock generation when the consumer brings their own backend.

0.10.21 — 2026-05-21

  • Chore Dropped the unused .github/workflows/deploy-pages.yml; collapsed the Cloudflare section in both deploy docs to a 10-line "same as Vercel with these diffs" note (the hosted demo runs on Vercel).

0.10.20 — 2026-05-21

  • Docs CHANGELOG.md backfilled from git tag history (v0.1.0 → v0.10.19).
  • Feat Public-demo banner (<Alert>) in the layout, gated on VITE_DEMO_BANNER=1.
  • Cleanup Replaced byted-CDN favicon with a local SVG (260 bytes).
  • Feat Added OG / Twitter Card meta tags + og-image.png extracted from the demo GIF; deployed demo now renders rich previews when shared.

0.10.19 — 2026-05-21

  • Docs Animated demo hero (docs/assets/demo.gif) added to both READMEs — login → dashboard → theme cycle → search-table mock data. Commits the Playwright scripts/record-demo.mjs for re-generating.

0.10.18 — 2026-05-21

  • Docs Demo badge + Live demo ↗ link in both READMEs; deploy guide rewritten to lead with Vercel (matches what powers the live demo) and demote Cloudflare to the second slot.

0.10.17 — 2026-05-21

  • Docs Bilingual README.zh-CN.md + docs/deploy.{md,zh-CN.md} with auto-deploy + manual paths.
  • CI New .github/workflows/deploy-pages.yml for auto-deploying the template to Cloudflare Pages via Wrangler.

0.10.16 — 2026-05-21

  • Meta npm description rewritten, keywords expanded 3 → 20 for search discoverability. GitHub repo description + 18 topics mirrored. Adds bugs.url and explicit homepage.

0.10.15 — 2026-05-21

  • Docs README rewritten with hero / comparison table / scripts table / roadmap.
  • CLI pro-recommend moved to position 3 in template menu; label changed Arco Pro (Recommend)Arco Pro (Unofficial); hint corrected to React 18.
  • Fix Studio-status panel — restored paired column={2} layout; right side widened 280 → 320 px so zh-CN labels don't wrap vertically.

0.10.14 — 2026-05-21

  • Perf MSW lazy-imported in main.tsx — production entry chunk drops from ~1.15 MB to ~289 KB (75% smaller) when VITE_API_BASE is set.
  • Test Playwright smoke E2E (T2-15): e2e/smoke.spec.ts covers login redirect, search-table mock rows, theme cycle, 404 route. New scripts npm run e2e + npm run e2e:install.

0.10.13 — 2026-05-21

  • Fix Swap abandoned react-color@2.19 (last release 2020-10) for react-colorful@^5.7 (2 KB vs ~50 KB). Removes one React 19 blocker.
  • Feat Settings drawer now mirrors the NavBar's theme cycle as a 3-option Radio.Group (System / Light / Dark), reading/writing the same GlobalContext.theme.

0.10.12 — 2026-05-21

  • Fix Layout's * catch-all route was lazy-loading pages/exception/403 (Forbidden) instead of 404.
  • Cleanup Dropped ~30 lines of dead .bizcharts-tooltip CSS (bizcharts swapped for VChart in v0.10.0). Removed query-string dep (replaced with URLSearchParams); de-duped clipboard (kept copy-to-clipboard pkg, dropped utils/clipboard.ts); removed console.log from search-table.

0.10.11 — 2026-05-21

  • Feat Theme defaults to system; NavBar icon now cycles system → light → dark → system; main.tsx listens for live OS dark-mode toggles when in system mode.
  • Cleanup Dropped NProgress + NavBar avatar IconLoading (both flashed concurrently during nav). Preload-before-navigate keeps the Suspense fallback from flashing.
  • Fix Studio-status: switched zh-CN paired metrics to column={1} to dodge a character-wrap (later reverted in v0.10.15 with proper widening).
  • Style Reset .arco-typography { margin-top } to 0 inside .arco-layout-content.

0.10.10 — 2026-05-21

  • Fix /api/list mock returned 0 rows on the initial unfiltered request. URLSearchParams.getAll() returns [] when the key is missing, and [] is truthy — so if (contentType) always ran [].includes(...) and rejected every row. Gate every multi-select filter on .length.

0.10.9 — 2026-05-21

  • Feat Template tsconfig.json flips to strict: true + noImplicitOverride (T2-12). Pays down 76 errors across ~30 files (callback annotations, util helpers, VChart datum types, route helpers).
  • Fix Removed dead multi-dimension/utils/map.ts (last user removed when bizcharts → VChart). Dropped @turf/turf dep that lived only in that file.
  • Types Local shims for react-color and @arco-design/color (they ship no .d.ts).

0.10.8 — 2026-05-21

  • Perf Vite manualChunks pins react / arco / vchart / tanstack to their own chunks for parallel loading + long-term cache (T2-9).
  • Test npm run test:coverage script with v8 provider (T2-10).
  • DX npm run analyze (rollup-plugin-visualizer) opens a sunburst report (T2-11). Gated on vite build --mode analyze for Windows-cmd compatibility.

0.10.7 — 2026-05-20

  • Feat Global API error handling via TanStack Query's QueryCache.onError / MutationCache.onError → Arco Message (T2-6).
  • Feat Centralised auth surface: useAuth() hook + <ProtectedRoute> for declarative route gating (T2-7). Removes imperative checkLogin() boot redirect.
  • Feat Per-route document title via react-helmet-async, driven by breadcrumb (T2-8). Fixed a long-standing breadcrumb-empty bug.

0.10.6 — 2026-05-20

  • Feat Wire up react-i18next with i18next-browser-languagedetector (T2-5). Existing 48 useLocale() call sites kept working via a backward-compat shim.

0.10.5 — 2026-05-20

  • Cleanup Dropped @arco-themes/react-arco-pro (T2-4). It was a stale 2022 copy of Arco's default tokens. Replaced with Less modifyVars direct override for the only knob we use (brand colour).

0.10.4 — 2026-05-20

  • Refactor Split monolithic layout/index.tsx into layout/, layout/icons.ts, layout/flattenRoutes.ts (T2-1).
  • Refactor Swap @loadable/component for native React.lazy (T2-2).
  • Cleanup Drop mockjs entirely — mock/random.ts is a tiny @faker-js/faker-backed shim of the helpers we actually used (T2-3).

0.10.3 — 2026-05-20

  • Feat Migrate form pages to react-hook-form + zod via a thin components/Form/Field.tsx bridge to Arco's <Form.Item>.

0.10.2 — 2026-05-20

  • Feat Replace Redux with Zustand v5 for client settings state. Persisted to localStorage with merge callback.

0.10.1 — 2026-05-20

  • Feat Server state migrated to TanStack Query v5 with queryClient singleton + per-resource hooks (useUserInfoQuery, etc.).

0.10.0 — 2026-05-20

  • Feat Mock layer swapped from mockjs HTTP interception to MSW v2 service-worker.
  • Feat Migrate from react-router v5 to v7 (declarative Routes + BrowserRouter).
  • Feat react-error-boundary wraps the routed Content so a single throwing chart doesn't whiteout the page.
  • Feat Vitest sample test setup; new npm test script.

0.9.3 — 2026-05-20

  • Feat arco upgrade command — bumps @arco-design/* deps in the consumer's package.json.
  • DX Passive update-notifier banner so users learn about newer CLI releases without us touching their project.

0.9.2 — 2026-05-14

  • Fix Template react/react-dom downgraded from ^19.1^18.3.0. Arco's cloneElement reads child.ref (React-16-era), which React 19 removed → noisy console warnings; we don't use React 19 features.
  • CI ESLint flat config (eslint.config.js) + tsc --noEmit gates the template build. Replaces legacy .eslintrc/.eslintignore.

0.9.1 — 2026-05-11

  • Fix Breadcrumb restored to the 3-segment "icon · section · leaf" shape that matches official Arco Pro.

0.9.0 — 2026-05-11

  • Feat Charts migrated from BizCharts to VChart with @visactor/vchart-arco-theme. BizCharts was unmaintained; VChart is Visactor's actively-developed successor.
  • Fix SVGR v4 + Vite 7 broke import Logo from './logo.svg' (now returns URL not component). Plugin config forces back default-export ReactComponent.

0.8.x — 2026-05-11

  • A burst of fidelity work bringing the bundled pro-recommend-full template to parity with the official arco-design-pro Vite/Full output: chart palette polish, table column tweaks, layout sider/footer alignment, locale wording, mock data shapes.

0.7.0 — 2026-05-11

  • Feat Started shipping a maintained bundled template under templates/arco-pro-recommend-* — the headline feature of this fork.

0.6.0 — 2026-05-11

  • Refactor Reorganised src/ by command (init/, addPage/, commands/, utils/). Dropped jest + ts-jest in favour of node's built-in node:test + tsx. Added arco dev passthrough.

0.5.0 — 2026-05-11

  • Feat arco add page gets an interactive menu-placement picker that edits src/routes.ts + src/locale/index.ts in place.

0.4.0 — 2026-05-11

  • Feat arco add page <name> [--type blank|table] scaffolds new pages following arco-design-pro's conventions.

0.3.0 — 2026-05-11

  • Refactor Init flow split + interactive UI migrated to @clack/prompts.

0.2.0 — 2026-05-11

  • Feat Toolchain modernised (Node 22, TypeScript 5, ESLint 9). Adds the Windows child_process compatibility shim required by arco-design-pro's spawnSync('npm.cmd', …) after the BatBadBut (CVE-2024-27980) Node fix.

0.1.0 — 2026-05

  • Initial fork of the abandoned arco-cli under @guanzhu.me/arco-cli. Preserves the original interactive template selection and init flow; modernises packaging, types, and engines.