From b4d46a799fe1371ea62c7c7d2b2c01e192ff7094 Mon Sep 17 00:00:00 2001 From: Aleksandr Shevchuk Date: Tue, 3 Nov 2026 02:15:51 +0200 Subject: [PATCH] fix(h5p-author): sync:skill builds the player's plan first (#120) sync-skill.mjs imports lib/author.mjs, which since #106 imports the player's ./plan, dist/h5p-plan.js. The Library pack workflow runs sync:skill on a fresh checkout before pnpm build, and it stopped there with ERR_MODULE_NOT_FOUND. The script builds the plan first now, as the package's test:unit does, so it works on any fresh clone. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 4 ++-- packages/author/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index f6ef32f8..53786948 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -95,8 +95,8 @@ packages/player/ @missing-elements/h5p-offline-player — the published warm.ts walks the library spans off one ranged request each and caches their entries scripts/ sync-h5p-assets (builds the runtime package and copies its dist/ to public/frame-assets/, writes frame-fonts.ts and pack-index.ts, stamps the versions), build-workers, - build-plan (dist/h5p-plan.js alone, which `prepare:dev` and h5p-author's tests - run, since h5p-author imports it), build-fixtures, prepack; + build-plan (dist/h5p-plan.js alone, which `prepare:dev`, h5p-author's tests + and its `sync:skill` run, since h5p-author imports it), build-fixtures, prepack; scripts/lib/worker-bundle.mjs builds both workers, and a host's own worker with the handlers mounted (the demo uses it for h5p-sw.js and the app's sw.js) vite.config.ts the library build and the test runner diff --git a/packages/author/package.json b/packages/author/package.json index 95424b76..60e6560d 100644 --- a/packages/author/package.json +++ b/packages/author/package.json @@ -53,7 +53,7 @@ "test": "pnpm --filter @missing-elements/h5p-offline-player build && vitest run", "test:unit": "pnpm --filter @missing-elements/h5p-offline-player build:plan && vitest run --project node", "typecheck": "pnpm types && tsc -p tsconfig.json", - "sync:skill": "node scripts/sync-skill.mjs", + "sync:skill": "pnpm --filter @missing-elements/h5p-offline-player build:plan && node scripts/sync-skill.mjs", "prepack": "node -e \"require('node:fs').copyFileSync('../../LICENSE', 'LICENSE')\" && pnpm types", "prepublishOnly": "node -e \"if (!/^pnpm\\//.test(process.env.npm_config_user_agent || '')) { console.error('Publish with pnpm publish: npm would ship the workspace: dependency ranges as they are, and the package would not install.'); process.exit(1) }\" && node scripts/check-pack-published.mjs && pnpm typecheck && pnpm test", "types": "pnpm --filter @missing-elements/h5p-offline-player exec tsc -b && node -e \"require('node:fs').rmSync('types', { recursive: true, force: true })\" && tsc -p tsconfig.types.json"