[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.
제안 해결 방안
- Decide whether package manifests should use emitted
dist paths directly or rely on publish-time rewriting.
- Align
main, types, exports, publishConfig, and files across the storage packages.
- Add a package manifest check that verifies every published root entry points to a file included in
files.
- Run a dry pack check for the storage packages and verify package-root imports resolve from the packed artifact.
Acceptance Criteria
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
[P2] Storage packages point package roots at src while only dist is shipped
상세 내용
packages/storage-core/package.json:5packages/storage-cloudinary/package.json:5packages/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
mainandtypesatsrc/index.tswhile the published file set contains onlydist. 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.제안 해결 방안
distpaths directly or rely on publish-time rewriting.main,types,exports,publishConfig, andfilesacross the storage packages.files.Acceptance Criteria
@croco/storage-core,@croco/storage-cloudinary, and@croco/storage-r2package root entries resolve to shipped files in a packed artifact.main,types,exports, andpublishConfig.Regression Prevention
Add a manifest validation step that packs each package and confirms all declared root entry files exist inside the package archive.
Related
packages/storage-core/package.json,packages/storage-cloudinary/package.json,packages/storage-r2/package.json