{"_id":"@acedatacloud/common-frontend","name":"@acedatacloud/common-frontend","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@acedatacloud/common-frontend","version":"0.1.0","description":"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.","keywords":["acedata-cloud","vue","frontend","axios","telemetry","i18n"],"homepage":"https://github.com/AceDataCloud/CommonFrontend","bugs":{"url":"https://github.com/AceDataCloud/CommonFrontend/issues"},"repository":{"type":"git","url":"git+https://github.com/AceDataCloud/CommonFrontend.git"},"license":"UNLICENSED","private":false,"author":{"name":"Ace Data Cloud","email":"dev@acedata.cloud","url":"https://platform.acedata.cloud"},"type":"module","sideEffects":false,"main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./core":{"types":"./dist/core/index.d.ts","import":"./dist/core/index.js"},"./http":{"types":"./dist/http/index.d.ts","import":"./dist/http/index.js"},"./telemetry":{"types":"./dist/telemetry/index.d.ts","import":"./dist/telemetry/index.js"},"./fingerprint":{"types":"./dist/fingerprint/index.d.ts","import":"./dist/fingerprint/index.js"},"./types":{"types":"./dist/types/index.d.ts","import":"./dist/types/index.js"},"./constants":{"types":"./dist/constants/index.d.ts","import":"./dist/constants/index.js"},"./utils":{"types":"./dist/utils/index.d.ts","import":"./dist/utils/index.js"}},"scripts":{"clean":"rm -rf dist","build":"npm run clean && tsc -p tsconfig.build.json","typecheck":"tsc -p tsconfig.json","test":"vitest run","test:watch":"vitest","prepublishOnly":"npm run build"},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"peerDependencies":{"axios":">=1.0.0 <2","aegis-web-sdk":"*"},"peerDependenciesMeta":{"axios":{"optional":true},"aegis-web-sdk":{"optional":true}},"devDependencies":{"axios":"^1.7.0","jsdom":"^25.0.0","typescript":"^5.6.0","vitest":"^2.1.0"},"_id":"@acedatacloud/common-frontend@0.1.0","gitHead":"f908b2779ca9cf147269c36f5ed72069ed8d8f42","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-UhrPaygLc2rve28ENOGmL0TesF8XOrOB85ok2+x1WepXUV8UENUf1wK1HswO+Oj7OrTr0QYg0g8DW8RVCH03Gg==","shasum":"a39a820b38f7ff2cd6fe574963caa91e06239705","tarball":"https://registry.npmjs.org/@acedatacloud/common-frontend/-/common-frontend-0.1.0.tgz","fileCount":82,"unpackedSize":78790,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCID12Br7tE5jnhNn7+eqLgAD683Vl1ydpKMOEBvc0/w18AiEAriwvqri95n6S7vuc3aDCgKerS3/18Bd1nk/D+afPIZI="}]},"_npmUser":{"name":"germey","email":"cqc@cuiqingcai.com"},"directories":{},"maintainers":[{"name":"germey","email":"cqc@cuiqingcai.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/common-frontend_0.1.0_1781489780914_0.6219619294316185"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-15T02:16:20.791Z","0.1.0":"2026-06-15T02:16:21.080Z","modified":"2026-06-15T02:16:21.345Z"},"maintainers":[{"name":"germey","email":"cqc@cuiqingcai.com"}],"description":"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.","homepage":"https://github.com/AceDataCloud/CommonFrontend","keywords":["acedata-cloud","vue","frontend","axios","telemetry","i18n"],"repository":{"type":"git","url":"git+https://github.com/AceDataCloud/CommonFrontend.git"},"author":{"name":"Ace Data Cloud","email":"dev@acedata.cloud","url":"https://platform.acedata.cloud"},"bugs":{"url":"https://github.com/AceDataCloud/CommonFrontend/issues"},"license":"UNLICENSED","readme":"# @acedatacloud/common-frontend\n\nShared frontend core for AceDataCloud's three browser apps:\n\n- [`AuthFrontend`](https://github.com/AceDataCloud/AuthFrontend) — `auth.acedata.cloud`\n- [`Nexior`](https://github.com/AceDataCloud/Nexior) — `studio.acedata.cloud` (consumer / chat)\n- [`PlatformFrontend`](https://github.com/AceDataCloud/PlatformFrontend) — `platform.acedata.cloud` (developer / open API)\n\nThese apps had independently re-implemented the same plumbing (axios interceptors,\nchunk-load recovery, telemetry, fingerprint, locale resolution) and drifted on the\ndetails. This package lifts the **correctness-sensitive duplication** into one place so\nthe apps stop diverging on the parts where divergence causes real auth / observability bugs.\n\n## Distribution — published npm package\n\nConsumed via a normal `package.json` dependency (no submodule, no `@common` alias):\n\n```bash\nnpm install @acedatacloud/common-frontend\n```\n\nThe package is built with plain `tsc` to ESM (no Vite library mode) so any consumer's\nbundler (Vite 8 / 7 / 2) transpiles it cleanly. CI **auto-publishes on merge to `main`**,\nversion-gated: a merge publishes only when `package.json`'s version is not already on npm.\nTo ship a release, bump the version in `package.json` in your PR.\n\n### Subpath entry points\n\nImport only what you need — peer-dependent modules are subpath-only so they tree-shake:\n\n```ts\nimport { createChunkLoadErrorHandler, makeGetLocale, isWechat } from '@acedatacloud/common-frontend/core';\nimport { createHttpClient } from '@acedatacloud/common-frontend/http';           // peer: axios\nimport { createTelemetry } from '@acedatacloud/common-frontend/telemetry';       // peer: aegis-web-sdk (optional)\nimport { createFingerprintResolver } from '@acedatacloud/common-frontend/fingerprint';\nimport type { IUser, IConnection } from '@acedatacloud/common-frontend/types';\nimport { getBaseUrlAuth } from '@acedatacloud/common-frontend/utils';\n```\n\nThe root entry (`@acedatacloud/common-frontend`) re-exports the dependency-free surface\n(`core`, `types`, `constants`, `utils`).\n\n## Layout\n\n```\nsrc/\n├── core/            # Pure TS, zero framework deps\n│   ├── chunkLoadError.ts   createChunkLoadErrorHandler({ storagePrefix })\n│   ├── surface.ts          isWechat(), isMobile()\n│   └── locale.ts           makeGetLocale({ supportedLocales, defaultLocale })\n├── http/            # peer: axios\n│   └── createHttpClient.ts createHttpClient(config) — request/response interceptor contract\n├── telemetry/       # peer: aegis-web-sdk (optional, dynamically imported)\n│   └── createTelemetry.ts  createTelemetry({ projectId, hostUrl }) — Tencent RUM glue\n├── fingerprint/     # FingerprintJS loader injected (no SDK dep — v4/v5 both work)\n│   └── createFingerprintResolver.ts\n├── types/           # Pure TypeScript interfaces (user, connection, skill, oauthApp)\n├── constants/       # baseUrl constants\n├── utils/           # getBaseUrl* helpers (read import.meta.env)\n└── index.ts         # root re-export of the dependency-free surface\n```\n\n### Design notes\n\n- **Factories, not singletons.** Everything that differed across apps (timeout, header\n  casing, where the token/userId/fingerprint come from, what a 401 does, RUM ext-slot\n  mapping, FingerprintJS version) is injected via config. The package never imports a store,\n  a router, or `vuex`.\n- **What is intentionally *not* here:** Element-Plus-coupled UI/components, Vuex stores,\n  `crossSiteUser`/`verification` (app-specific routing coupling). See the project plan for\n  the full scope boundary.\n\n## Develop\n\n```bash\nnpm install\nnpm run typecheck   # tsc -p tsconfig.json (no emit)\nnpm test            # vitest (jsdom)\nnpm run build       # tsc -p tsconfig.build.json -> dist/\n```\n\n## License\n\nPrivate — AceDataCloud internal.\n","readmeFilename":"README.md","_rev":"1-f213a88513d09b4722b8ef67899a1c55"}