Releases: wn0x00/arco-cli
Releases · wn0x00/arco-cli
v0.14.0
- Feat
arco doctor— static diagnostic command for scaffolded arco-pro-recommend projects. Runs four checks and exits non-zero on any failure (CI-friendly):- 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). - Mock handlers — every file under
src/mock/*.tsorsrc/pages/**/mock/index.tsthat exportshandlersmust be imported + spread insrc/mock/handlers.ts. Helper modules (noexport const handlers) are skipped, somock/random.tsetc. don't produce false positives. - Access flags — every
access.fooreference acrosssrc/**/*.{ts,tsx}must be defined indefineAccess()'s return shape. Uses a\baccess\.\w+\bregex (not\ba\.\w+\b) so sort-callback shorthands like(a, b) => a.x - b.xdon't trigger false positives. - Route → page mapping — every leaf
key: 'foo/bar'insrc/routes.tsmust have a matchingsrc/pages/foo/bar/index.tsx.
- Project shape — probes for the standard layout markers (
- Feat (template) Logout now goes through
Modal.confirminstead of firing immediately on click — the warning and OK/cancel labels are localised (navbar.logout.confirm.{title,content,ok,cancel}keys inen-US.ts+zh-CN.ts), and the OK button usesstatus: 'danger'for a visual safety cue.
v0.13.1
- Docs Added
docs/auth-backend.{md,zh-CN.md}— end-to-end guide for wiring the new<Access>system to a real backend. Covers theUserInfocontract, 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.
v0.13.0
- Feat (breaking, template) Modern
<Access>permission system. Replaces the previous<PermissionWrapper>+requiredPermissionsarray convention with a hybrid RBAC + fine-grained model that mirrors ant-design-pro's<Access>API:src/auth/access.tsx—defineAccess(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:
userInfonow exposes bothroles: string[](coarse RBAC) andpermissions?: Record<string, string[]>(optional fine-grained overlay). The frontenddefineAccessuses both — most flags resolve from roles alone, occasionalcan(resource, action)checks cover "give this user one extra capability outside their role" cases. src/routes.ts: route nodes carry anaccess?: (a: AccessMap) => booleanpredicate instead ofrequiredPermissions: [{ resource, actions }]. Cleaner type-checked references to central flags.src/auth/ProtectedRoute.tsxgains arequireAccessprop for route-level gating with redirect to/exception/403(override viadenyRedirect).- Migrated 3 call sites in
pages/list/{search-table,card}to use<Access accessible={access.canX}>. - Removed
src/components/PermissionWrapper/andsrc/utils/authentication.ts— no backward-compat shim.
v0.12.1
- Security
pages/login/form.tsxno 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
/loginno longer force-setsarco-theme=lighton 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 fromlocation.state.from) instead ofwindow.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 (
bindNavigatorinapi/client.ts); falls back tolocation.hrefonly when the interceptor fires before React mounts. - Cleanup Deleted
utils/is.ts—isArray/isObject/isStringhad zero references, andisSSRwas theatre in a Vite SPA.useStorage.tsandgetUrlParams.tslost theirisSSRguards;useStoragealso picked up a cross-tabstorageevent listener so two windows sharing the samearco-lang/arco-themestay in sync. - Cleanup Stripped
import React from 'react'from 32.tsxfiles where the namespace wasn't actually referenced — Vite 7's automatic JSX runtime makes the default import dead weight. - UX
Footerandpages/login/index.tsxnow renderenv.appTitleinstead of the hardcoded literal "Arco Design Pro". Thelogin.form.titlelocale key is also localisation-neutral ("Sign in" / "登录") rather than baking the brand name into every translation. - Types Typed
pages/profile/basic/{item,index}.tsxonBasicProfile(no moredata: any/{} as any),pages/user/setting/header.tsxonUserInfo,pages/list/card/index.tsxonCardListBundle.
v0.12.0
- Feat
arco add table <name>— single-command full CRUD module scaffold. Generates a page (index.tsx+columns.tsx+ drawerform.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-editssrc/routes.ts,src/locale/{en-US,zh-CN}.ts(or legacyindex.ts), andsrc/mock/handlers.tsto register everything. Falls back to printing the snippet when any of the three files doesn't match the expected upstream shape — same pattern asadd page/add api. Reuses the existingaddPage/routesEdit,addPage/localeEdit, andaddApi/handlersEditengines.
v0.11.2
- 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. NewinitI18n()fromsrc/i18n/index.tsis awaited inmain.tsxbefore React mounts. - Feat
MutationCache.onSuccessnow reads a typedmeta.successMessageand fires the global Arco toast — same pattern the error toast already used. AddedAppMetatype +declare module '@tanstack/react-query'block so the field is autocompleted at call sites.useSubmitGroupFormMutationaccepts 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.tsxswapped<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 useSpin— Skeleton doesn't match a chart's visual footprint.
v0.11.1
- 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 underpages/login/assets/. - Fix i18n holes:
NavBarmenu-item placeholder toast was hardcoded English;welcome/code-blockhad hardcoded zh-CN copy/copied strings. Both now read locale keys. - Security
http://p1-arco.byteimg.com/...refs indashboard/monitor/{data-statistic-list,studio}.tsxupgraded tohttps://to avoid mixed-content blocks under HTTPS deploys. - Perf All
useQueryhooks acrosssrc/api/*.tsnow forwardsignalfromQueryFunctionContextinto 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.useSearchTableQuerygained an explicitPromise<SearchTableResponse>annotation to keep type inference clean alongsideplaceholderData: keepPreviousData.
v0.11.0
- Feat
arco add api <name>— scaffold a TanStack Query hook + zod schema + MSW handler in one shot, and auto-register the handler insrc/mock/handlers.ts.--method get(default) generatesuseXxxQuery+ list response schema;--method post|put|deletegeneratesuseXxxMutation+ input schema + cache invalidation.--skip-mockskips the mock generation when the consumer brings their own backend.