Context
packages/backend.ai-client/package.json (introduced in #6614 / FR-2529) has gaps that make it unsafe to publish or consume from other packages.
Current state
tsup builds ESM only (format: ['esm']) but package.json has both "main": "./dist/index.js" (ambiguous) and an "exports" map without a require branch. CJS consumers will silently get the ESM file.
- No
"publishConfig" block — first publish would default to whatever registry is configured locally, with whatever access setting is default.
"repository.url" points to a tree path, not a git URL — npm metadata pages can render this oddly.
"files": ["dist"] is fine but should also include README.md and LICENSE once those land (FR-2788).
Scope
Pick (a) ESM-only route (preferred — keeps the build simple, matches "type": "module"):
- Remove
"main" field
- Set
"exports" to:
{
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
}
- Add
"engines": { "node": ">=18" }
- Add
"sideEffects": false (already present — confirm)
- Add
"publishConfig": { "access": "public" } (or restricted, decide with maintainer)
- Fix
"repository" to:
{
"type": "git",
"url": "git+https://github.com/lablup/backend.ai-webui.git",
"directory": "packages/backend.ai-client"
}
- Add
"homepage", "bugs.url" already present.
Verification
pnpm --filter backend.ai-client run build succeeds
pnpm --filter backend.ai-client pack --dry-run lists dist/, package.json, README.md, LICENSE (latter two land in FR-2788, so a stale state is acceptable but should be noted)
- A throwaway
import { Client } from 'backend.ai-client' resolves in both Node and Vite/esbuild
bash scripts/verify.sh passes
pnpm install from repo root still resolves the workspace link
Out of scope
- ESLint config (separate issue)
- CI workflow (separate issue)
JIRA Issue: FR-2789
Context
packages/backend.ai-client/package.json(introduced in #6614 / FR-2529) has gaps that make it unsafe to publish or consume from other packages.Current state
tsupbuilds ESM only (format: ['esm']) butpackage.jsonhas both"main": "./dist/index.js"(ambiguous) and an"exports"map without arequirebranch. CJS consumers will silently get the ESM file."publishConfig"block — first publish would default to whatever registry is configured locally, with whatever access setting is default."repository.url"points to a tree path, not a git URL — npm metadata pages can render this oddly."files": ["dist"]is fine but should also includeREADME.mdandLICENSEonce those land (FR-2788).Scope
Pick (a) ESM-only route (preferred — keeps the build simple, matches
"type": "module"):"main"field"exports"to:{ ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" } }"engines": { "node": ">=18"}"sideEffects": false(already present — confirm)"publishConfig": { "access": "public"} (or restricted, decide with maintainer)"repository"to:{ "type": "git", "url": "git+https://github.com/lablup/backend.ai-webui.git", "directory": "packages/backend.ai-client" }"homepage","bugs.url"already present.Verification
pnpm --filter backend.ai-client run buildsucceedspnpm --filter backend.ai-client pack --dry-runlistsdist/,package.json,README.md,LICENSE(latter two land in FR-2788, so a stale state is acceptable but should be noted)import { Client } from 'backend.ai-client'resolves in both Node and Vite/esbuildbash scripts/verify.shpassespnpm installfrom repo root still resolves the workspace linkOut of scope
JIRA Issue: FR-2789