@acedatacloud/core
v0.8.1
Published
Shared frontend core for AceDataCloud's browser apps (AuthFrontend / Nexior / PlatformFrontend): http client factory, telemetry, fingerprint, chunk-load recovery, locale + surface helpers, and shared types.
Downloads
2,293
Maintainers
Readme
@acedatacloud/core
Shared frontend core for AceDataCloud's three browser apps:
AuthFrontend—auth.acedata.cloudNexior—studio.acedata.cloud(consumer / chat)PlatformFrontend—platform.acedata.cloud(developer / open API)
These apps had independently re-implemented the same plumbing (axios interceptors, chunk-load recovery, telemetry, fingerprint, locale resolution) and drifted on the details. This package lifts the correctness-sensitive duplication into one place so the apps stop diverging on the parts where divergence causes real auth / observability bugs.
Distribution — published npm package
Consumed via a normal package.json dependency (no submodule, no @common alias):
npm install @acedatacloud/coreThe package is built with plain tsc to ESM (no Vite library mode) so any consumer's
bundler (Vite 8 / 7 / 2) transpiles it cleanly. CI auto-publishes on merge to main,
version-gated: a merge publishes only when package.json's version is not already on npm.
To ship a release, bump the version in package.json in your PR.
Subpath entry points
Import only what you need — peer-dependent modules are subpath-only so they tree-shake:
import { createChunkLoadErrorHandler, makeGetLocale, isWechat } from '@acedatacloud/core/core';
import { createHttpClient } from '@acedatacloud/core/http'; // peer: axios
import { createTelemetry } from '@acedatacloud/core/telemetry'; // peer: aegis-web-sdk (optional)
import { createFingerprintResolver } from '@acedatacloud/core/fingerprint';
import type { IUser, IConnection } from '@acedatacloud/core/types';
import { getBaseUrlAuth } from '@acedatacloud/core/utils';The root entry (@acedatacloud/core) re-exports the dependency-free surface
(core, types, constants, utils).
Layout
src/
├── core/ # Pure TS, zero framework deps
│ ├── chunkLoadError.ts createChunkLoadErrorHandler({ storagePrefix })
│ ├── surface.ts isWechat(), isMobile()
│ └── locale.ts makeGetLocale({ supportedLocales, defaultLocale })
├── http/ # peer: axios
│ └── createHttpClient.ts createHttpClient(config) — request/response interceptor contract
├── telemetry/ # peer: aegis-web-sdk (optional, dynamically imported)
│ └── createTelemetry.ts createTelemetry({ projectId, hostUrl }) — Tencent RUM glue
├── fingerprint/ # FingerprintJS loader injected (no SDK dep — v4/v5 both work)
│ └── createFingerprintResolver.ts
├── types/ # Pure TypeScript interfaces (user, connection, skill, oauthApp)
├── constants/ # baseUrl constants
├── utils/ # getBaseUrl* helpers (read import.meta.env)
└── index.ts # root re-export of the dependency-free surfaceDesign notes
- Factories, not singletons. Everything that differed across apps (timeout, header
casing, where the token/userId/fingerprint come from, what a 401 does, RUM ext-slot
mapping, FingerprintJS version) is injected via config. The package never imports a store,
a router, or
vuex. - What is intentionally not here: Element-Plus-coupled UI/components, Vuex stores,
crossSiteUser/verification(app-specific routing coupling). See the project plan for the full scope boundary.
Develop
npm install
npm run typecheck # tsc -p tsconfig.json (no emit)
npm test # vitest (jsdom)
npm run build # tsc -p tsconfig.build.json -> dist/License
Private — AceDataCloud internal.
