From 41d11d8bd398f195603be7fa659115ece89a4438 Mon Sep 17 00:00:00 2001 From: Miguel Angel Simon Sierra Date: Sun, 20 Sep 2026 18:54:31 -0400 Subject: [PATCH] fix(cli): cover relocated media-use tests --- .fallowrc.jsonc | 5 +---- .github/workflows/ci.yml | 4 ++-- package.json | 2 +- .../cli/src/media-use/lib/cutlist.test.mjs | 3 +++ packages/cli/src/media-use/lib/duck.test.mjs | 2 ++ skills/media-use/scripts/resolve.mjs | 18 ++++++++++++++++-- 6 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.fallowrc.jsonc b/.fallowrc.jsonc index dee2e1bcb8..6ef827b56c 100644 --- a/.fallowrc.jsonc +++ b/.fallowrc.jsonc @@ -71,7 +71,7 @@ "packages/player/tests/**", "packages/engine/tests/**", "skills/**/test-corpus/**", - "skills/**/scripts/**", + "packages/cli/src/media-use/**", // Agent-invoked motion-graphics tools co-located with their docs (run via // `node ` per grounding/PROTOCOL.md / categories/maps/module.md // prose), not import-graph reachable. @@ -845,9 +845,6 @@ // adding branches. The line-shift fingerprint re-flags the inherited // complexity even though the logic is unchanged. "packages/cli/src/commands/info.ts", - // media-use was relocated from skills/ without changing its engine logic; - // preserve the inherited audit baseline while the compatibility move lands. - "packages/cli/src/media-use/**", // gsapParserAcorn.ts: the flagged `sameMemberAccess` (structural equality // of two member-access nodes) pre-dates this PR's motion-eval work // (added in #1760, unchanged since). The new const-folding / set-seeding / diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 499ef7d52c..d746305ba4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -396,14 +396,14 @@ jobs: # would defeat the whole point of this job). run: | set -euo pipefail - mapfile -t SKILLS_TESTS < <(find skills packages/cli/src/media-use -type f -name "*.test.mjs" | sort) + mapfile -t SKILLS_TESTS < <(find skills -type f -name "*.test.mjs" | sort) if [ "${#SKILLS_TESTS[@]}" -eq 0 ]; then echo "::error::No skills/**/*.test.mjs files found. Did the layout change?" exit 1 fi printf 'Running %d skills test file(s):\n' "${#SKILLS_TESTS[@]}" printf ' * %s\n' "${SKILLS_TESTS[@]}" - node --test "${SKILLS_TESTS[@]}" + bun run test:skills test-skill-bootstrap-windows: name: "Test: skill bootstrap (Windows, Node 24)" diff --git a/package.json b/package.json index 22606600b1..c438979507 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "knip": "knip", "test:scripts": "node --import tsx --test scripts/animejs-v4-guidance.test.mjs scripts/check-tracked-artifacts.test.mjs scripts/check-no-main-deletions.test.mjs scripts/check-pr-captures.test.mjs scripts/check-docs-snippet-motion.test.mjs scripts/registry-target-paths.test.mjs scripts/check-workspace-contracts.test.mjs scripts/check-package-cycles.test.mjs scripts/check-cli-process-ownership.test.mjs scripts/check-large-files.test.mjs scripts/package-subpaths.test.mjs scripts/validate-release-channel.test.mjs scripts/publish-workflow.test.mjs scripts/install-workspace-dependencies.test.mjs scripts/draft-changelog.test.ts scripts/set-version.test.ts scripts/release-prepare.test.ts scripts/cli-options.test.ts scripts/changelog-weekly.test.ts scripts/claude-plugin-compression.test.ts scripts/catalog-payload-assets.test.ts scripts/host-registry-assets.test.ts scripts/catalog-preview-temp.test.ts scripts/catalog-hosted-files.test.ts scripts/player-cdn-pin.test.ts scripts/studio-runtime-smoke.test.mjs scripts/verify-packed-manifests.test.mjs scripts/lint-skills.test.mjs scripts/creator-editing-recipes.test.mjs packages/gcp-cloud-run/check-dockerfile-workspaces.test.mjs packages/core/scripts/writeGeneratedFile.test.ts scripts/catalog-drift.test.ts scripts/catalog-fetch-mirror.test.ts scripts/catalog-script-inlining.test.ts scripts/catalog-detail.test.ts scripts/generate-catalog-pages.test.ts scripts/verify-catalog-payloads.test.ts scripts/registry-skill-files.test.ts && vitest run scripts/catalog/", "typecheck:scripts": "tsc --noEmit -p scripts/tsconfig.json", - "test:skills": "node --test 'skills/**/*.test.mjs'", + "test:skills": "node --test 'skills/**/*.test.mjs' 'packages/cli/src/media-use/**/*.test.mjs'", "generate:previews": "tsx scripts/generate-template-previews.ts", "generate:catalog-previews": "tsx scripts/generate-catalog-previews.ts", "package:codex-plugin": "node scripts/package-codex-plugin.mjs", diff --git a/packages/cli/src/media-use/lib/cutlist.test.mjs b/packages/cli/src/media-use/lib/cutlist.test.mjs index deac815dfc..98e7710a27 100644 --- a/packages/cli/src/media-use/lib/cutlist.test.mjs +++ b/packages/cli/src/media-use/lib/cutlist.test.mjs @@ -8,6 +8,9 @@ import { test } from "node:test"; import { compileCutList } from "./cutlist.mjs"; const HERE = dirname(fileURLToPath(import.meta.url)); +// These legacy wrappers remain under skills/media-use/scripts because the +// skill's public audio entrypoints still invoke them; the moved engine tests +// their implementation here while preserving that compatibility surface. const SCRIPT = join( HERE, "..", diff --git a/packages/cli/src/media-use/lib/duck.test.mjs b/packages/cli/src/media-use/lib/duck.test.mjs index a912361f26..471eafff6d 100644 --- a/packages/cli/src/media-use/lib/duck.test.mjs +++ b/packages/cli/src/media-use/lib/duck.test.mjs @@ -8,6 +8,8 @@ import { test } from "node:test"; import { duckKeyframes, duckLane, speechSpans } from "./duck.mjs"; const HERE = dirname(fileURLToPath(import.meta.url)); +// Keep the skill-owned wrapper path under test until the compatibility layer +// is removed in a later release. const SCRIPT = join( HERE, "..", diff --git a/skills/media-use/scripts/resolve.mjs b/skills/media-use/scripts/resolve.mjs index 4b04f8b38a..84480705b2 100644 --- a/skills/media-use/scripts/resolve.mjs +++ b/skills/media-use/scripts/resolve.mjs @@ -1,3 +1,17 @@ #!/usr/bin/env node -import { spawnSync } from "node:child_process"; import { existsSync } from "node:fs"; import { join } from "node:path"; import { fileURLToPath } from "node:url"; -const root = join(fileURLToPath(new URL("../../../", import.meta.url))); const dist = join(root, "packages/cli/dist/cli.js"); const result = existsSync(dist) ? spawnSync(process.execPath, [dist, "media-use", "resolve", ...process.argv.slice(2)], { stdio: "inherit" }) : spawnSync("bun", [join(root, "packages/cli/src/cli.ts"), "media-use", "resolve", ...process.argv.slice(2)], { stdio: "inherit" }); process.exit(result.status ?? 1); +import { spawnSync } from "node:child_process"; +import { existsSync } from "node:fs"; +import { join } from "node:path"; +import { fileURLToPath } from "node:url"; +const root = join(fileURLToPath(new URL("../../../", import.meta.url))); +const dist = join(root, "packages/cli/dist/cli.js"); +const result = existsSync(dist) + ? spawnSync(process.execPath, [dist, "media-use", "resolve", ...process.argv.slice(2)], { + stdio: "inherit", + }) + : spawnSync( + "bun", + [join(root, "packages/cli/src/cli.ts"), "media-use", "resolve", ...process.argv.slice(2)], + { stdio: "inherit" }, + ); +process.exit(result.status ?? 1);