Skip to content

[storage packages] Published manifests point package roots at src while only dist is shipped #578

Description

@kang-heewon

[P2] Storage packages point package roots at src while only dist is shipped

Category: Architecture / Packaging Effort: S Confidence: High
Evidence: 3 package manifests · 3 package surfaces · duplicate search found no open issue

상세 내용

  • 주요 위치: packages/storage-core/package.json:5
  • 추가 발생 위치:
    • packages/storage-cloudinary/package.json:5
    • packages/storage-r2/package.json:5

문제 코드

{
  "main": "./src/index.ts",
  "types": "./src/index.ts",
  "publishConfig": {
    "main": "./dist/index.js",
    "types": "./dist/index.d.ts"
  },
  "files": ["dist"]
}

왜 문제인가?

Storage package roots are documented as importable package entry points, but the source manifest points main and types at src/index.ts while the published file set contains only dist. If the publish-time manifest is not rewritten exactly as expected, package consumers can resolve a root entry that is missing from the tarball or resolves TypeScript source rather than emitted declarations. The same policy appears across storage-core, storage-cloudinary, and storage-r2, so this is a packaging contract drift rather than a one-off typo.

제안 해결 방안

  1. Decide whether package manifests should use emitted dist paths directly or rely on publish-time rewriting.
  2. Align main, types, exports, publishConfig, and files across the storage packages.
  3. Add a package manifest check that verifies every published root entry points to a file included in files.
  4. Run a dry pack check for the storage packages and verify package-root imports resolve from the packed artifact.

Acceptance Criteria

  • @croco/storage-core, @croco/storage-cloudinary, and @croco/storage-r2 package root entries resolve to shipped files in a packed artifact.
  • The storage package manifests use one consistent policy for main, types, exports, and publishConfig.
  • CI or a package check catches future root entries that point outside the published file set.

Regression Prevention

Add a manifest validation step that packs each package and confirms all declared root entry files exist inside the package archive.

Related

  • Files: packages/storage-core/package.json, packages/storage-cloudinary/package.json, packages/storage-r2/package.json

Metadata

Metadata

Assignees

Labels

P2Priority 2 issuearchitectureArchitecture and module boundary issuestech-debtTechnical debt

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions