fix(ci): restore render diagnostics and include sharing workspace

This commit is contained in:
Terence Cho
2026-11-09 18:02:59 -08:00
parent e02294232d
commit 2187bdf302
4 changed files with 39 additions and 12 deletions
+1 -1
View File
@@ -1533,7 +1533,7 @@ jobs:
bun run --filter @hyperframes/cli dev -- lint /tmp/hf-cli-inside
bun run --filter @hyperframes/cli dev -- validate /tmp/hf-cli-inside --timeout 3000
bun run --filter @hyperframes/cli dev -- render /tmp/hf-cli-inside \
HF_DEBUG_RENDER=1 bun run --filter @hyperframes/cli dev -- render /tmp/hf-cli-inside \
--quality standard \
--workers auto \
--strict \
+3 -1
View File
@@ -104,6 +104,8 @@ COPY packages/engine/package.json packages/engine/package.json
COPY packages/player/package.json packages/player/package.json
COPY packages/producer/package.json packages/producer/package.json
COPY packages/cli/package.json packages/cli/package.json
# Sharing runs its prepare script at install time, so include its build inputs.
COPY packages/share/ packages/share/
COPY packages/studio/package.json packages/studio/package.json
COPY packages/shader-transitions/package.json packages/shader-transitions/package.json
COPY packages/aws-lambda/package.json packages/aws-lambda/package.json
@@ -137,7 +139,7 @@ COPY packages/studio-server/ packages/studio-server/
COPY packages/core/ packages/core/
# Build workspace packages so "node" export conditions resolve to built dist
RUN bun run --filter '@hyperframes/{parsers,lint,studio-server}' build \
RUN bun run --filter '@hyperframes/{parsers,lint,studio-server,share}' build \
&& bun run --cwd packages/core build
# Build core runtime artifacts (needed by renderer)
+21 -10
View File
@@ -9,22 +9,33 @@ export async function readSourceIgnore(root) {
const file = join(root, ".hyperframesignore");
const invalid = () =>
new Error(".hyperframesignore must be a regular file inside the project, smaller than 64 KiB.");
const before = await lstat(file).catch((/** @type {NodeJS.ErrnoException} */ error) => {
if (error.code === "ENOENT") return null;
throw invalid();
});
if (!before) return () => false;
if (!before.isFile() || before.size >= 65536) throw invalid();
const handle = await open(
file,
constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0),
).catch(() => {
throw invalid();
).catch(async (/** @type {NodeJS.ErrnoException} */ error) => {
if (error.code !== "ENOENT") throw invalid();
// An absent file means no exclusions; a dangling symlink is invalid.
const named = await lstat(file).catch((/** @type {NodeJS.ErrnoException} */ missing) => {
if (missing.code === "ENOENT") return null;
throw invalid();
});
if (named) throw invalid();
return null;
});
if (!handle) return () => false;
let text;
try {
const stat = await handle.stat();
if (!stat.isFile() || stat.ino !== before.ino || stat.dev !== before.dev) throw invalid();
// Validate the opened descriptor before reading. lstat additionally rejects links on
// platforms without O_NOFOLLOW; it never authorizes a later open of this path.
const [stat, named] = await Promise.all([handle.stat(), lstat(file)]);
if (
!stat.isFile() ||
stat.size >= 65536 ||
!named.isFile() ||
stat.ino !== named.ino ||
stat.dev !== named.dev
)
throw invalid();
const buffer = Buffer.alloc(65536);
let length = 0;
while (length < buffer.length) {
@@ -280,3 +280,17 @@ test("ignore rules fail closed for unsupported patterns, entrypoint exclusions,
await symlink(join(root, "index.html"), join(root, ".hyperframesignore"));
await assert.rejects(captureProject(root), /regular file/);
});
test("ignore configuration rejects oversized files, directories and dangling symlinks", async (t) => {
const root = await project({ "index.html": "<html></html>" });
t.after(() => rm(root, { recursive: true, force: true }));
const file = join(root, ".hyperframesignore");
await writeFile(file, "a".repeat(65536));
await assert.rejects(captureProject(root), /regular file/);
await rm(file);
await mkdir(file);
await assert.rejects(captureProject(root), /regular file/);
await rm(file, { recursive: true });
await symlink(join(root, "missing"), file);
await assert.rejects(captureProject(root), /regular file/);
});