Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
"changelog:weekly": "tsx scripts/changelog-weekly.ts",
"sync-schemas": "tsx scripts/sync-schemas.ts",
"sync-schemas:check": "tsx scripts/sync-schemas.ts --check",
"lint": "bun run check:tracked-artifacts && bun run check:workspace-contracts && bun run check:package-cycles && oxlint . && tsx scripts/lint-skills.ts",
"sync:package-subpaths": "node scripts/package-subpaths.mjs --write",
"check:package-subpaths": "node scripts/package-subpaths.mjs",
"lint": "bun run check:tracked-artifacts && bun run check:workspace-contracts && bun run check:package-cycles && bun run check:package-subpaths && oxlint . && tsx scripts/lint-skills.ts",
"lint:skills": "tsx scripts/lint-skills.ts",
"lint:fix": "oxlint --fix .",
"check:tracked-artifacts": "node scripts/check-tracked-artifacts.mjs",
Expand All @@ -42,7 +44,7 @@
"player:perf": "bun run --filter @hyperframes/player perf",
"format:check": "oxfmt --check .",
"knip": "knip",
"test:scripts": "node --import tsx --test scripts/check-tracked-artifacts.test.mjs scripts/check-workspace-contracts.test.mjs scripts/check-package-cycles.test.mjs scripts/validate-release-channel.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/studio-runtime-smoke.test.mjs scripts/verify-packed-manifests.test.mjs",
"test:scripts": "node --import tsx --test scripts/check-tracked-artifacts.test.mjs scripts/check-workspace-contracts.test.mjs scripts/check-package-cycles.test.mjs scripts/package-subpaths.test.mjs scripts/validate-release-channel.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/studio-runtime-smoke.test.mjs scripts/verify-packed-manifests.test.mjs",
"test:skills": "node --test 'skills/**/*.test.mjs'",
"generate:previews": "tsx scripts/generate-template-previews.ts",
"generate:catalog-previews": "tsx scripts/generate-catalog-previews.ts",
Expand Down
29 changes: 29 additions & 0 deletions packages/aws-lambda/package-subpaths.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"package": "@hyperframes/aws-lambda",
"subpaths": {
".": {
"source": "./src/index.ts",
"runtime": "./dist/index.js",
"types": "./dist/index.d.ts",
"environments": ["bun", "node"]
},
"./handler": {
"source": "./src/handler.ts",
"runtime": "./dist/handler.js",
"types": "./dist/handler.d.ts",
"environments": ["bun", "node"]
},
"./sdk": {
"source": "./src/sdk/index.ts",
"runtime": "./dist/sdk/index.js",
"types": "./dist/sdk/index.d.ts",
"environments": ["bun", "node"]
},
"./cdk": {
"source": "./src/cdk/index.ts",
"runtime": "./dist/cdk/index.js",
"types": "./dist/cdk/index.d.ts",
"environments": ["bun", "node"]
}
}
}
38 changes: 30 additions & 8 deletions packages/aws-lambda/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,46 @@
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
"bun": "./src/index.ts",
"import": "./src/index.ts",
"types": "./src/index.ts"
},
"./handler": {
"import": "./dist/handler.js",
"types": "./dist/handler.d.ts"
"bun": "./src/handler.ts",
"import": "./src/handler.ts",
"types": "./src/handler.ts"
},
"./sdk": {
"import": "./dist/sdk/index.js",
"types": "./dist/sdk/index.d.ts"
"bun": "./src/sdk/index.ts",
"import": "./src/sdk/index.ts",
"types": "./src/sdk/index.ts"
},
"./cdk": {
"import": "./dist/cdk/index.js",
"types": "./dist/cdk/index.d.ts"
"bun": "./src/cdk/index.ts",
"import": "./src/cdk/index.ts",
"types": "./src/cdk/index.ts"
}
},
"publishConfig": {
"access": "public",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./handler": {
"import": "./dist/handler.js",
"types": "./dist/handler.d.ts"
},
"./sdk": {
"import": "./dist/sdk/index.js",
"types": "./dist/sdk/index.d.ts"
},
"./cdk": {
"import": "./dist/cdk/index.js",
"types": "./dist/cdk/index.d.ts"
}
},
"registry": "https://registry.npmjs.org/"
},
"scripts": {
Expand Down
28 changes: 7 additions & 21 deletions packages/cli/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig } from "tsup";
import { resolve } from "node:path";
import { readFileSync } from "node:fs";
import { sourceAliases } from "../../scripts/package-subpaths.mjs";

const pkg = JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf-8")) as {
version: string;
Expand Down Expand Up @@ -79,27 +80,12 @@ var __dirname = __hf_dirname(__filename);`,
},
esbuildOptions(options) {
options.alias = {
"@hyperframes/producer": resolve(__dirname, "../producer/src/index.ts"),
// esbuild's alias map treats `@hyperframes/producer` as a file path
// and would otherwise resolve `@hyperframes/producer/distributed`
// to `../producer/src/index.ts/distributed` (treating the file as a
// directory). Adding an explicit alias for every subpath we import
// avoids the prefix-substitution misfire.
"@hyperframes/producer/distributed": resolve(__dirname, "../producer/src/distributed.ts"),
// Same reason: the lambda CLI imports `@hyperframes/aws-lambda/sdk`,
// which would resolve to `../aws-lambda/src/index.ts/sdk` without
// an explicit subpath alias. The SDK subpath has its own barrel.
"@hyperframes/aws-lambda/sdk": resolve(__dirname, "../aws-lambda/src/sdk/index.ts"),
// Same for the GCP adapter's SDK subpath barrel.
"@hyperframes/gcp-cloud-run/sdk": resolve(__dirname, "../gcp-cloud-run/src/sdk/index.ts"),
// hf#677 follow-up: the shader-blend worker imports from
// `@hyperframes/engine/shader-transitions` (subpath export) — a
// standalone TS file with zero internal imports that survives the
// worker_thread loader boundary.
"@hyperframes/engine/shader-transitions": resolve(
__dirname,
"../engine/src/utils/shaderTransitions.ts",
),
// Exact subpaths are generated from the same contracts as package
// exports, avoiding esbuild's root-alias prefix substitution trap.
...sourceAliases(resolve(__dirname, "../producer"), [".", "./distributed"]),
...sourceAliases(resolve(__dirname, "../aws-lambda"), ["./sdk"]),
...sourceAliases(resolve(__dirname, "../gcp-cloud-run"), ["./sdk"]),
...sourceAliases(resolve(__dirname, "../engine"), [".", "./shader-transitions"]),
};
options.loader = { ...options.loader, ".browser.js": "text" };
},
Expand Down
Loading
Loading