fix(core): publish missing subpath exports (#1616)

This commit is contained in:
Miguel Ángel
2026-06-20 18:04:43 -04:00
committed by GitHub
parent 6b279267cd
commit 960690e8e5
4 changed files with 34 additions and 3 deletions
+17
View File
@@ -141,6 +141,15 @@
"import": "./dist/index.js", "import": "./dist/index.js",
"types": "./dist/index.d.ts" "types": "./dist/index.d.ts"
}, },
"./package.json": "./package.json",
"./beats": {
"import": "./dist/beats/index.js",
"types": "./dist/beats/index.d.ts"
},
"./html-attr-safety": {
"import": "./dist/utils/htmlAttrSafety.js",
"types": "./dist/utils/htmlAttrSafety.d.ts"
},
"./lint": { "./lint": {
"import": "./dist/lint/index.js", "import": "./dist/lint/index.js",
"types": "./dist/lint/index.d.ts" "types": "./dist/lint/index.d.ts"
@@ -161,7 +170,15 @@
"import": "./dist/colorLuts.js", "import": "./dist/colorLuts.js",
"types": "./dist/colorLuts.d.ts" "types": "./dist/colorLuts.d.ts"
}, },
"./storyboard": {
"import": "./dist/storyboard/index.js",
"types": "./dist/storyboard/index.d.ts"
},
"./runtime": "./dist/hyperframe.runtime.iife.js", "./runtime": "./dist/hyperframe.runtime.iife.js",
"./runtime/clipTree": {
"import": "./dist/runtime/clipTree.js",
"types": "./dist/runtime/clipTree.d.ts"
},
"./runtime/lottie-readiness": { "./runtime/lottie-readiness": {
"import": "./dist/lottieReadiness.js", "import": "./dist/lottieReadiness.js",
"types": "./dist/lottieReadiness.d.ts" "types": "./dist/lottieReadiness.d.ts"
+2 -2
View File
@@ -1,2 +1,2 @@
export * from "./beatDetection"; export * from "./beatDetection.js";
export * from "./beatFile"; export * from "./beatFile.js";
+1 -1
View File
@@ -13,7 +13,7 @@
"outDir": "./dist", "outDir": "./dist",
"rootDir": "./src" "rootDir": "./src"
}, },
"files": ["src/runtime/mediaVolumeEnvelope.ts"], "files": ["src/runtime/clipTree.ts", "src/runtime/mediaVolumeEnvelope.ts"],
"include": ["src/**/*"], "include": ["src/**/*"],
"exclude": [ "exclude": [
"node_modules", "node_modules",
+14
View File
@@ -29,6 +29,12 @@ function listWorkspaceRefs(pkg) {
return refs; return refs;
} }
function listMissingPublishedExports(pkg) {
if (!pkg.exports || !pkg.publishConfig?.exports) return [];
return Object.keys(pkg.exports).filter((exportKey) => !(exportKey in pkg.publishConfig.exports));
}
function parsePackJson(output, workspace) { function parsePackJson(output, workspace) {
try { try {
const parsed = JSON.parse(output); const parsed = JSON.parse(output);
@@ -44,6 +50,14 @@ function main() {
readFileSync(join(ROOT, workspace, "package.json"), "utf8"), readFileSync(join(ROOT, workspace, "package.json"), "utf8"),
); );
if (sourcePackageJson.private) continue; if (sourcePackageJson.private) continue;
const missingPublishedExports = listMissingPublishedExports(sourcePackageJson);
if (missingPublishedExports.length > 0) {
throw new Error(
`${workspace} publishConfig.exports is missing source exports: ${missingPublishedExports.join(", ")}`,
);
}
if (listWorkspaceRefs(sourcePackageJson).length === 0) continue; if (listWorkspaceRefs(sourcePackageJson).length === 0) continue;
const packDir = mkdtempSync(join(tmpdir(), "hyperframes-pack-")); const packDir = mkdtempSync(join(tmpdir(), "hyperframes-pack-"));