TypeScript 7 toolchain migration: tsgo declaration emit, TS6 tooling alias, entity type alignment - #228
Conversation
Co-Authored-By: Claude Fable 5 <[email protected]>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe PR makes billing provider fields optional across persistence, validation, entity, DTO, and mapper layers; adds RBAC definitions; updates framework ORM and build typing; refreshes package exports, versions, dependencies, changelogs, and TypeScript build configurations across the workspace. ChangesBilling provider contract updates
RBAC and framework compatibility
Workspace release and build updates
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 11
🧹 Nitpick comments (1)
blueprint/billing-base/persistence/entities/plan.entity.ts (1)
21-24: 🗄️ Data Integrity & Integration | 🔵 TrivialVerify the database migration for nullable provider columns.
These persistence definitions now permit
NULL; confirm deployed schemas and migrations update every correspondingbillingProvidercolumn, including existing rows and rollback behavior.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@blueprint/billing-base/persistence/entities/plan.entity.ts` around lines 21 - 24, Verify and update migrations for every nullable billingProvider definition, covering blueprint/billing-base/persistence/entities/plan.entity.ts:21-24, blueprint/billing-stripe/persistence/entities/plan.entity.ts:24-27, blueprint/billing-stripe/persistence/entities/subscription.entity.ts:21-24, and both corresponding sites in blueprint/implementations/billing/stripe/persistence/entities/index.ts:46 and 58. Ensure deployed schemas allow NULL, existing rows are handled safely, and rollback restores the prior constraint or data behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@blueprint/implementations/billing/base/package.json`:
- Around line 34-57: Align the package exports with the artifacts produced by
the build: update the `exports` entries for `./schemas/*`, `./services/*`, and
`./types/*` to remove the nonexistent wildcard subpaths, or change the build
configuration to emit matching per-file JS/MJS artifacts. Preserve the public
subpaths only if their corresponding runtime files are actually generated.
In `@blueprint/implementations/billing/stripe/package.json`:
- Around line 40-63: Align the wildcard package exports with the files emitted
by the tsup build: either add matching per-file entrypoints for the enum,
schemas, services, and types export patterns, or remove those wildcard exports.
Apply the same correction to
blueprint/implementations/billing/stripe/package.json at lines 40-63 and 69, and
blueprint/implementations/ecommerce/base/package.json at lines 34-51 and 57;
ensure all remaining export targets correspond to actual generated artifacts.
In `@blueprint/implementations/iam/base/package.json`:
- Around line 34-57: Remove the unsupported wildcard subpath export entries for
./types/*, ./schemas/*, and ./services/* from
blueprint/implementations/iam/base/package.json, retaining the barrel-only
exports. Apply the same removal to the wildcard subpath exports in
blueprint/interfaces/ecommerce/package.json; no per-file build entries are
needed.
In `@blueprint/implementations/worker/bullmq/package.json`:
- Around line 40-69: Restrict the wildcard export entries in the package.json
manifests to paths actually emitted by the build, or add matching build
entrypoints for every wildcard module. Apply the same correction to
blueprint/implementations/worker/bullmq/package.json (lines 40-69) and
blueprint/implementations/worker/redis/package.json (lines 40-69), ensuring the
exports for consumers, producers, schemas, and types resolve to generated files.
In `@blueprint/implementations/worker/database/package.json`:
- Around line 40-69: Update the build scripts in
blueprint/implementations/worker/database/package.json (lines 40-69) and
blueprint/implementations/worker/kafka/package.json (lines 40-69) so tsup emits
the leaf modules targeted by the wildcard exports, including consumer, producer,
schema, and type files, while preserving the existing index entrypoints and
declaration generation. Ensure the resulting lib paths match each package’s
exports for both import and require resolution.
In `@cli/src/core/package_json/package_json_constants.rs`:
- Line 48: Update the TYPESCRIPT_VERSION constant to remove the outer caret
while preserving the inner version range, so application.rs writes
npm:`@typescript/typescript6`@^6.0.2 to package.json.
In `@framework/common/package.json`:
- Line 31: Update the declaration build configuration for framework/common so
the root index.ts entry point is included and emits the published
lib/index.d.ts. In framework/common/tsconfig.json, adjust the include/rootDir
settings or relocate the barrel under src while preserving the existing package
build command in framework/common/package.json.
In `@framework/core/package.json`:
- Line 3: Document the published releases consistently: in
framework/core/package.json at lines 3-3, either set the version to the intended
release covered by the changelog or retain 1.5.6; in framework/core/CHANGELOG.md
at lines 3-20, add release-note entries for versions 1.5.5 and 1.5.6, including
their dependency changes.
In `@framework/express/src/cluster/bun.serve.shim.ts`:
- Around line 1105-1108: Update the request handling around the
reqEE/AbortController setup to propagate request.signal into the abort path,
ensuring client cancellation aborts the active writer and responsePromise.
Remove the associated request.signal listener when the response completes or
closes, using the existing response cleanup handlers.
In `@framework/testing/CHANGELOG.md`:
- Around line 3-14: Add a changelog section for version 1.2.21 in
framework/testing/CHANGELOG.md to match the version declared by
framework/testing/package.json, or update the manifest back to 1.2.20 if that
release is not intended.
In `@framework/testing/src/database.ts`:
- Around line 2-10: Update setupTestORM to return Promise<AnyMikroORM> (or an
equivalent generic ORM type), matching the relaxed type used by
clearTestDatabase and the harness. Preserve its existing setup behavior while
ensuring callers receive the aligned ORM contract without variance errors.
---
Nitpick comments:
In `@blueprint/billing-base/persistence/entities/plan.entity.ts`:
- Around line 21-24: Verify and update migrations for every nullable
billingProvider definition, covering
blueprint/billing-base/persistence/entities/plan.entity.ts:21-24,
blueprint/billing-stripe/persistence/entities/plan.entity.ts:24-27,
blueprint/billing-stripe/persistence/entities/subscription.entity.ts:21-24, and
both corresponding sites in
blueprint/implementations/billing/stripe/persistence/entities/index.ts:46 and
58. Ensure deployed schemas allow NULL, existing rows are handled safely, and
rollback restores the prior constraint or data behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 60552b06-d5fe-42f3-ac0d-8a2fd2286500
⛔ Files ignored due to path filters (4)
blueprint/core/auth/rbac.d.ts.mapis excluded by!**/*.mapblueprint/core/auth/rbac.js.mapis excluded by!**/*.mapblueprint/pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlframework/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (147)
blueprint/billing-base/domain/mappers/plan.mappers.tsblueprint/billing-base/domain/mappers/subscription.mappers.tsblueprint/billing-base/package.jsonblueprint/billing-base/persistence/entities/plan.entity.tsblueprint/billing-base/persistence/entities/subscription.entity.tsblueprint/billing-stripe/domain/mappers/plan.mappers.tsblueprint/billing-stripe/domain/mappers/subscription.mappers.tsblueprint/billing-stripe/package.jsonblueprint/billing-stripe/persistence/entities/plan.entity.tsblueprint/billing-stripe/persistence/entities/subscription.entity.tsblueprint/billing-stripe/scripts/seed-plans-from-stripe.tsblueprint/billing-stripe/scripts/sync-stripe-plans.tsblueprint/client-sdk/package.jsonblueprint/core/auth/rbac.d.tsblueprint/core/auth/rbac.jsblueprint/core/package.jsonblueprint/ecommerce-stripe/mikro-orm.config.tsblueprint/ecommerce-stripe/package.jsonblueprint/ecommerce-stripe/schema.tsblueprint/iam-base/package.jsonblueprint/iam-better-auth/auth.tsblueprint/iam-better-auth/package.jsonblueprint/implementations/billing/base/CHANGELOG.mdblueprint/implementations/billing/base/domain/schemas/typebox/plan.schema.tsblueprint/implementations/billing/base/domain/schemas/typebox/subscription.schema.tsblueprint/implementations/billing/base/domain/schemas/zod/plan.schema.tsblueprint/implementations/billing/base/domain/schemas/zod/subscription.schema.tsblueprint/implementations/billing/base/domain/types/baseBillingEntity.types.tsblueprint/implementations/billing/base/package.jsonblueprint/implementations/billing/base/tsconfig.build.jsonblueprint/implementations/billing/stripe/CHANGELOG.mdblueprint/implementations/billing/stripe/domain/schemas/typebox/plan.schema.tsblueprint/implementations/billing/stripe/domain/schemas/typebox/subscription.schema.tsblueprint/implementations/billing/stripe/domain/schemas/zod/plan.schema.tsblueprint/implementations/billing/stripe/domain/schemas/zod/subscription.schema.tsblueprint/implementations/billing/stripe/domain/types/stripe.entity.types.tsblueprint/implementations/billing/stripe/package.jsonblueprint/implementations/billing/stripe/persistence/entities/index.tsblueprint/implementations/billing/stripe/tsconfig.build.jsonblueprint/implementations/ecommerce/base/CHANGELOG.mdblueprint/implementations/ecommerce/base/package.jsonblueprint/implementations/ecommerce/base/tsconfig.build.jsonblueprint/implementations/iam/base/CHANGELOG.mdblueprint/implementations/iam/base/package.jsonblueprint/implementations/iam/base/tsconfig.build.jsonblueprint/implementations/worker/bullmq/CHANGELOG.mdblueprint/implementations/worker/bullmq/package.jsonblueprint/implementations/worker/bullmq/tsconfig.build.jsonblueprint/implementations/worker/database/CHANGELOG.mdblueprint/implementations/worker/database/package.jsonblueprint/implementations/worker/database/tsconfig.build.jsonblueprint/implementations/worker/kafka/CHANGELOG.mdblueprint/implementations/worker/kafka/package.jsonblueprint/implementations/worker/kafka/tsconfig.build.jsonblueprint/implementations/worker/redis/CHANGELOG.mdblueprint/implementations/worker/redis/package.jsonblueprint/implementations/worker/redis/tsconfig.build.jsonblueprint/interfaces/billing/CHANGELOG.mdblueprint/interfaces/billing/package.jsonblueprint/interfaces/billing/tsconfig.build.jsonblueprint/interfaces/billing/types/plan.service.types.tsblueprint/interfaces/billing/types/subscription.service.types.tsblueprint/interfaces/ecommerce/CHANGELOG.mdblueprint/interfaces/ecommerce/package.jsonblueprint/interfaces/ecommerce/tsconfig.build.jsonblueprint/interfaces/iam/CHANGELOG.mdblueprint/interfaces/iam/package.jsonblueprint/interfaces/iam/tsconfig.build.jsonblueprint/interfaces/worker/CHANGELOG.mdblueprint/interfaces/worker/package.jsonblueprint/interfaces/worker/tsconfig.build.jsonblueprint/monitoring/package.jsonblueprint/package.jsonblueprint/pnpm-workspace.yamlblueprint/sample-worker/package.jsoncli/src/core/package_json/package_json_constants.rsframework/bunrun/CHANGELOG.mdframework/bunrun/package.jsonframework/bunrun/tsup.config.tsframework/common/CHANGELOG.mdframework/common/package.jsonframework/common/tsconfig.jsonframework/core/CHANGELOG.mdframework/core/__test__/compliance.test.tsframework/core/package.jsonframework/core/src/http/mcpGenerator/mcpGenerator.tsframework/core/src/http/middleware/request/auth.middleware.tsframework/core/src/http/middleware/request/enrichDetails.middleware.tsframework/core/src/http/openApiV3Generator/openApiV3Generator.tsframework/core/src/http/router/expressLikeRouter.tsframework/core/src/http/router/routerSharedLogic.tsframework/core/src/http/telemetry/openTelemetryCollector.tsframework/core/src/http/types/apiDefinition.types.tsframework/core/src/http/types/contractDetails.types.tsframework/core/src/http/types/expressLikeRouter.types.tsframework/core/src/http/types/sdk.types.tsframework/core/src/persistence/defineComplianceEntity.tsframework/core/src/persistence/rls.tsframework/core/src/services/complianceDataService.tsframework/core/src/services/retentionService.tsframework/core/src/ws/webSocketLike.tsframework/core/tsconfig.build.jsonframework/e2e-tests/package.jsonframework/express/CHANGELOG.mdframework/express/package.jsonframework/express/src/cluster/bun.serve.shim.tsframework/express/src/expressApplication.tsframework/express/tsconfig.build.jsonframework/hyper-express/CHANGELOG.mdframework/hyper-express/package.jsonframework/hyper-express/src/hyperExpressApplication.tsframework/hyper-express/tsconfig.build.jsonframework/infrastructure/S3/CHANGELOG.mdframework/infrastructure/S3/package.jsonframework/infrastructure/S3/tsconfig.build.jsonframework/infrastructure/redis/CHANGELOG.mdframework/infrastructure/redis/index.tsframework/infrastructure/redis/package.jsonframework/infrastructure/redis/tsconfig.build.jsonframework/internal/CHANGELOG.mdframework/internal/package.jsonframework/internal/tsconfig.jsonframework/package.jsonframework/pnpm-workspace.yamlframework/testing/CHANGELOG.mdframework/testing/package.jsonframework/testing/src/containers.tsframework/testing/src/database.tsframework/testing/src/harness.tsframework/testing/tsconfig.build.jsonframework/universal-sdk/CHANGELOG.mdframework/universal-sdk/package.jsonframework/universal-sdk/src/universalSdk.tsframework/universal-sdk/tsconfig.build.jsonframework/validator/CHANGELOG.mdframework/validator/__test__/utils/mockSchemaValidator.tsframework/validator/package.jsonframework/validator/shims/zod-v3-openapi/zod-openapi.tsframework/validator/src/shared/types/schema.types.tsframework/validator/src/typebox/typeboxSchemaValidator.tsframework/validator/src/zod/types/schema.types.tsframework/validator/src/zod/zodSchemaValidator.tsframework/validator/tsconfig.build.jsonframework/ws/CHANGELOG.mdframework/ws/package.jsonframework/ws/src/__tests__/webSocketIntegration.test.tsframework/ws/tsconfig.build.json
| "./consumers/*": { | ||
| "types": "./lib/consumers/*.d.ts", | ||
| "import": "./lib/consumers/*.mjs", | ||
| "require": "./lib/consumers/*.js", | ||
| "default": "./lib/consumers/*.js" | ||
| }, | ||
| "./producers/*": { | ||
| "types": "./lib/producers/*.d.ts", | ||
| "import": "./lib/producers/*.mjs", | ||
| "require": "./lib/producers/*.js", | ||
| "default": "./lib/producers/*.js" | ||
| }, | ||
| "./schemas/*": { | ||
| "types": "./lib/domain/schemas/*.d.ts", | ||
| "import": "./lib/domain/schemas/*.mjs", | ||
| "require": "./lib/domain/schemas/*.js", | ||
| "default": "./lib/domain/schemas/*.js" | ||
| }, | ||
| "./types/*": { | ||
| "types": "./lib/domain/types/*.d.ts", | ||
| "import": "./lib/domain/types/*.mjs", | ||
| "require": "./lib/domain/types/*.js", | ||
| "default": "./lib/domain/types/*.js" | ||
| } | ||
| }, | ||
| "files": [ | ||
| "lib/**" | ||
| ], | ||
| "scripts": { | ||
| "build": "tsgo --noEmit && tsup producers/index.ts consumers/index.ts domain/schemas/index.ts domain/types/index.ts --format cjs,esm --no-splitting --dts --tsconfig tsconfig.json --out-dir lib --clean && if [ -f eject-package.bash ]; then pnpm package:eject; fi", | ||
| "build": "tsgo --noEmit && tsup producers/index.ts consumers/index.ts domain/schemas/index.ts domain/types/index.ts --format cjs,esm --no-splitting --tsconfig tsconfig.json --out-dir lib --clean && tsgo -p tsconfig.build.json --emitDeclarationOnly && if [ -f eject-package.bash ]; then pnpm package:eject; fi", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Run after the package build in CI; do not rebuild here.
set -euo pipefail
for package_dir in \
blueprint/implementations/worker/database \
blueprint/implementations/worker/kafka
do
fd -t f -e ts -E index.ts . \
"$package_dir/consumers" \
"$package_dir/producers" \
"$package_dir/domain/schemas" \
"$package_dir/domain/types" |
while IFS= read -r source; do
relative="${source#"$package_dir"/}"
expected="$package_dir/lib/${relative%.ts}.mjs"
test -f "$expected" || printf 'Missing wildcard export target: %s\n' "$expected"
done
doneRepository: forklaunch/forklaunch
Length of output: 1551
🏁 Script executed:
#!/bin/bash
set -euo pipefail
for pkg in blueprint/implementations/worker/database blueprint/implementations/worker/kafka; do
echo "## $pkg"
echo "--- package.json scripts/exports/files ---"
python3 - <<'PY' "$pkg/package.json"
import json, sys
p = sys.argv[1]
with open(p) as f:
data = json.load(f)
for k in ["scripts", "exports", "files"]:
print(f"[{k}]")
print(data.get(k))
PY
echo "--- source tree (selected) ---"
find "$pkg" -maxdepth 4 -type f \( \
-path "*/consumers/*.ts" -o \
-path "*/producers/*.ts" -o \
-path "*/domain/schemas/*.ts" -o \
-path "*/domain/types/*.ts" \
\) | sort
echo
doneRepository: forklaunch/forklaunch
Length of output: 6156
Emit the leaf modules for these wildcard exports.
tsup only builds the four index.ts entrypoints, but these wildcard exports point at leaf files like ./consumers/databaseWorker.consumer and ./domain/schemas/databaseWorker.schema. Those paths will not exist under lib/** in the published package, so imports through the new subpath exports will fail in both:
blueprint/implementations/worker/database/package.jsonblueprint/implementations/worker/kafka/package.json
📍 Affects 2 files
blueprint/implementations/worker/database/package.json#L40-L69(this comment)blueprint/implementations/worker/kafka/package.json#L40-L69
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@blueprint/implementations/worker/database/package.json` around lines 40 - 69,
Update the build scripts in
blueprint/implementations/worker/database/package.json (lines 40-69) and
blueprint/implementations/worker/kafka/package.json (lines 40-69) so tsup emits
the leaf modules targeted by the wildcard exports, including consumer, producer,
schema, and type files, while preserving the existing index entrypoints and
declaration generation. Ensure the resulting lib paths match each package’s
exports for both import and require resolution.
| ], | ||
| "scripts": { | ||
| "build": "tsgo --noEmit && tsup index.ts --format cjs,esm --no-splitting --tsconfig tsconfig.json --outDir lib --dts --clean", | ||
| "build": "tsgo --noEmit && tsup index.ts --format cjs,esm --no-splitting --tsconfig tsconfig.json --outDir lib --clean && tsgo --emitDeclarationOnly", |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
jq '{build: .scripts.build, types, exports}' framework/common/package.json
jq '{rootDir: .compilerOptions.rootDir, include}' framework/common/tsconfig.json
sed -n '1,80p' framework/common/index.tsRepository: forklaunch/forklaunch
Length of output: 604
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n[framework/common files]\n'
git ls-files framework/common | sed -n '1,120p'
printf '\n[framework/common index + tsconfig + package]\n'
cat -n framework/common/index.ts
printf '\n--- tsconfig ---\n'
cat -n framework/common/tsconfig.json
printf '\n--- package ---\n'
cat -n framework/common/package.jsonRepository: forklaunch/forklaunch
Length of output: 159
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n '"lib/index\.d\.ts"|index\.d\.ts|emitDeclarationOnly|tsgo --emitDeclarationOnly' -S framework common . || trueRepository: forklaunch/forklaunch
Length of output: 159
Emit declarations for the package entry point.
framework/common/package.json publishes lib/index.d.ts, but framework/common/tsconfig.json only includes src/**/*.ts and uses rootDir: "src", so the root index.ts barrel that tsup builds has no matching declaration output. Include index.ts in the declaration project or move the barrel under src/ so the published types file exists.
📍 Affects 2 files
framework/common/package.json#L31-L31(this comment)framework/common/tsconfig.json#L4-L7
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@framework/common/package.json` at line 31, Update the declaration build
configuration for framework/common so the root index.ts entry point is included
and emits the published lib/index.d.ts. In framework/common/tsconfig.json,
adjust the include/rootDir settings or relocate the barrel under src while
preserving the existing package build command in framework/common/package.json.
pnpm publish rewrites workspace:* to an exact version, so published packages hard-pinned stale siblings ([email protected] -> [email protected]), producing duplicate @forklaunch/core instances and TS2883 in scaffolded apps. workspace:^ publishes caret ranges instead. Republished all framework packages with inter-deps and all blueprint interface/ implementation packages (also picking up the tsgo declaration-emit output). Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
♻️ Duplicate comments (1)
blueprint/implementations/billing/base/package.json (1)
33-57:⚠️ Potential issue | 🟠 MajorWildcard export targets still lack matching runtime artifacts across the implementation packages. The tsgo declaration-only migration does not add the JS/MJS leaf files advertised by these exports.
blueprint/implementations/billing/base/package.json#L33-L57: remove or emit matchingschemas,services, andtypesleaf modules.blueprint/implementations/billing/stripe/package.json#L39-L69: remove or emit matchingenum,schemas,services, andtypesleaf modules.blueprint/implementations/ecommerce/base/package.json#L33-L57: remove or emit matchingschemas,services, andtypesleaf modules.blueprint/implementations/iam/base/package.json#L33-L57: remove or emit matchingtypes,schemas, andservicesleaf modules.blueprint/implementations/worker/bullmq/package.json#L39-L69: remove or emit matchingconsumers,producers,schemas, andtypesleaf modules.blueprint/implementations/worker/database/package.json#L39-L63: remove or emit matchingconsumers,producers,schemas, andtypesleaf modules.blueprint/implementations/worker/redis/package.json#L39-L63: remove or emit matchingconsumers,producers,schemas, andtypesleaf modules.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@blueprint/implementations/billing/base/package.json` around lines 33 - 57, Update the package export maps or build outputs so every wildcard export resolves to matching runtime JS/MJS artifacts, not declarations alone. In blueprint/implementations/billing/base/package.json (lines 33-57), remove or emit schemas, services, and types leaf modules; apply the same change to billing/stripe/package.json (lines 39-69) for enum, schemas, services, and types; ecommerce/base/package.json (lines 33-57) for schemas, services, and types; iam/base/package.json (lines 33-57) for types, schemas, and services; worker/bullmq/package.json (lines 39-69) for consumers, producers, schemas, and types; worker/database/package.json (lines 39-63) for consumers, producers, schemas, and types; and worker/redis/package.json (lines 39-63) for consumers, producers, schemas, and types.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@blueprint/implementations/billing/base/package.json`:
- Around line 33-57: Update the package export maps or build outputs so every
wildcard export resolves to matching runtime JS/MJS artifacts, not declarations
alone. In blueprint/implementations/billing/base/package.json (lines 33-57),
remove or emit schemas, services, and types leaf modules; apply the same change
to billing/stripe/package.json (lines 39-69) for enum, schemas, services, and
types; ecommerce/base/package.json (lines 33-57) for schemas, services, and
types; iam/base/package.json (lines 33-57) for types, schemas, and services;
worker/bullmq/package.json (lines 39-69) for consumers, producers, schemas, and
types; worker/database/package.json (lines 39-63) for consumers, producers,
schemas, and types; and worker/redis/package.json (lines 39-63) for consumers,
producers, schemas, and types.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e384b86a-3ce1-415a-80f7-a8a32df1ce03
⛔ Files ignored due to path filters (2)
blueprint/pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlframework/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (29)
blueprint/billing-base/package.jsonblueprint/billing-stripe/package.jsonblueprint/client-sdk/package.jsonblueprint/ecommerce-stripe/package.jsonblueprint/iam-base/package.jsonblueprint/iam-better-auth/package.jsonblueprint/implementations/billing/base/package.jsonblueprint/implementations/billing/stripe/package.jsonblueprint/implementations/ecommerce/base/package.jsonblueprint/implementations/iam/base/package.jsonblueprint/implementations/worker/bullmq/package.jsonblueprint/implementations/worker/database/package.jsonblueprint/implementations/worker/kafka/package.jsonblueprint/implementations/worker/redis/package.jsonblueprint/interfaces/billing/package.jsonblueprint/interfaces/ecommerce/package.jsonblueprint/interfaces/iam/package.jsonblueprint/interfaces/worker/package.jsonblueprint/sample-worker/package.jsonframework/core/package.jsonframework/e2e-tests/package.jsonframework/express/package.jsonframework/hyper-express/package.jsonframework/infrastructure/S3/package.jsonframework/infrastructure/redis/package.jsonframework/internal/package.jsonframework/universal-sdk/package.jsonframework/validator/package.jsonframework/ws/package.json
🚧 Files skipped from review as they are similar to previous changes (7)
- blueprint/interfaces/billing/package.json
- blueprint/interfaces/ecommerce/package.json
- framework/infrastructure/S3/package.json
- blueprint/client-sdk/package.json
- blueprint/implementations/worker/kafka/package.json
- blueprint/interfaces/worker/package.json
- blueprint/interfaces/iam/package.json
tsgo's declaration emitter names types by their declaring file, which must be directly importable via the exports map. The per-file d.ts trees (replacing rollup-bundled declarations) made deep files like universal-sdk lib/src/types/contentTypes.types.d.ts unaddressable, breaking scaffolded client-sdk builds with TS2883. Co-Authored-By: Claude Fable 5 <[email protected]>
- wildcard subpath exports restricted to the types condition; the import/require targets advertised files the build never emits - CLI TYPESCRIPT_VERSION had a stray leading caret before the npm: alias protocol - bun.serve shim: forward client aborts (request.signal) into the shim abort controller so writer/responsePromise are released - setupTestORM returns AnyMikroORM to match the relaxed harness types - backfill @forklaunch/core and @forklaunch/testing changelogs Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@framework/express/src/cluster/bun.serve.shim.ts`:
- Around line 1424-1433: Update the client-abort handling around onClientAbort
so it also settles responsePromise by invoking ensureResponse() when the request
aborts, including when request.signal is already aborted. Preserve the existing
abort-controller forwarding and listener cleanup behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4699d716-afb2-4d9d-8909-1026e91be2f8
📒 Files selected for processing (28)
blueprint/implementations/billing/base/package.jsonblueprint/implementations/billing/stripe/package.jsonblueprint/implementations/ecommerce/base/package.jsonblueprint/implementations/iam/base/package.jsonblueprint/implementations/worker/bullmq/package.jsonblueprint/implementations/worker/database/package.jsonblueprint/implementations/worker/kafka/package.jsonblueprint/implementations/worker/redis/package.jsonblueprint/interfaces/billing/package.jsonblueprint/interfaces/ecommerce/package.jsonblueprint/interfaces/iam/package.jsonblueprint/interfaces/worker/package.jsoncli/src/core/package_json/package_json_constants.rsframework/common/package.jsonframework/core/CHANGELOG.mdframework/core/package.jsonframework/express/package.jsonframework/express/src/cluster/bun.serve.shim.tsframework/hyper-express/package.jsonframework/infrastructure/S3/package.jsonframework/infrastructure/redis/package.jsonframework/internal/package.jsonframework/testing/CHANGELOG.mdframework/testing/package.jsonframework/testing/src/database.tsframework/universal-sdk/package.jsonframework/validator/package.jsonframework/ws/package.json
🚧 Files skipped from review as they are similar to previous changes (3)
- framework/testing/CHANGELOG.md
- framework/testing/src/database.ts
- framework/core/CHANGELOG.md
| // client disconnects surface on the fetch request signal; forward them | ||
| // so writer/responsePromise are released | ||
| const onClientAbort = () => abort.abort(); | ||
| if (request.signal.aborted) { | ||
| abort.abort(); | ||
| } else { | ||
| request.signal.addEventListener('abort', onClientAbort, { | ||
| once: true | ||
| }); | ||
| } |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Settle responsePromise on client abort.
The new forwarding reaches onAbort, but that path never calls ensureResponse(). If the client disconnects before headers are sent, return await responsePromise remains pending and retains the request state.
Proposed fix
const onAbort = () => {
+ ensureResponse();
cleanup();
Object.assign(req, {
aborted: true,📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // client disconnects surface on the fetch request signal; forward them | |
| // so writer/responsePromise are released | |
| const onClientAbort = () => abort.abort(); | |
| if (request.signal.aborted) { | |
| abort.abort(); | |
| } else { | |
| request.signal.addEventListener('abort', onClientAbort, { | |
| once: true | |
| }); | |
| } | |
| const onAbort = () => { | |
| ensureResponse(); | |
| cleanup(); | |
| Object.assign(req, { | |
| aborted: true, |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@framework/express/src/cluster/bun.serve.shim.ts` around lines 1424 - 1433,
Update the client-abort handling around onClientAbort so it also settles
responsePromise by invoking ensureResponse() when the request aborts, including
when request.signal is already aborted. Preserve the existing abort-controller
forwarding and listener cleanup behavior.
…npm placeholders (#230) ## Summary Fixes the scaffold issues that force downstream consumers (ForkLaunch Studio) to patch generated files after `init`. Audit of the reported five items against main: | # | Issue | Status | |---|-------|--------| | 1 | pnpm-workspace.yaml placeholder breaks installs; re-init clobbers fixes | **Fixed here** | | 2 | MikroORM version skew (7.0.15 vs 7.1.8) | Already fixed on main (#228): CLI pins 7.1.8, scaffold resolves a single instance | | 3 | BullMqWorkerOptions.queueOptions TS2345 | Not reproducible on main: scaffold emits concrete `queueOptions`, fresh `init worker -t bullmq` + `tsc --noEmit` passes with 0 errors (was collateral of the #2-era duplicate-package skew) | | 4 | Root workspace globs `apps/*` | Not present on main: the CLI emits no root pnpm-workspace.yaml and no `apps/*` glob anywhere | | 5 | Bun temp-dir sandbox blocks module installs | **Mitigated here** | ## Root cause for #1 The placeholder text is written by **pnpm itself**, not the CLI: the post-init `pnpm format` triggers pnpm 11's auto-install, which blocks unapproved build scripts and injects `allowBuilds: { esbuild: set this to true or false, ... }` into the workspace yaml. The CLI then made it unfixable: every `init service/router/worker` and `change application` round-tripped the yaml through a `packages`-only struct, silently dropping `allowBuilds` and any other consumer-added keys. ## Changes - `generate_pnpm_workspace` seeds `allowBuilds: true` for the scaffold's known build-script deps, so pnpm never injects placeholders - The workspace struct preserves unmodeled keys (`overrides`, `blockExoticSubdeps`, ...) via serde flatten, and every rewrite heals placeholder string values to `true` - `change application` renders through the same preserving helper instead of a from-scratch struct - `release create` bun installs get a project-local `TMPDIR` so Bun's temporary-directory sandbox cannot block them - New fixture test (`init_worker_workspace_and_typecheck.sh`): scaffolds fresh, asserts no placeholders + `allowBuilds` seeded, asserts survival across `init worker`/`init service`, poisons the yaml with placeholders + foreign keys and asserts healing + preservation, then requires `pnpm install` and per-project `tsc --noEmit` to pass with zero patches ## Test plan - `cargo test`: 327 passed - Fixture script run locally end-to-end: passes (install clean, `tsgo --noEmit` clean in core/worker/service, full build green) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Workspace configuration now supports build-script allowlists for safer dependency installation. - Existing workspace settings, including custom configuration, are preserved when projects are initialized or updated. - Missing workspace package entries and pnpm placeholders are automatically restored. - **Bug Fixes** - Runtime switching now keeps workspace package definitions intact. - Bun dependency installation uses a project-local temporary directory, improving reliability in restricted environments. - Invalid build allowlist values are normalized automatically. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude Fable 5 <[email protected]>
Summary
Migrates the framework and blueprint workspaces to build cleanly on TypeScript 7 (tsgo), and aligns the billing entity/DTO types that the migration surfaced.
Build toolchain
--dts→tsgo --emitDeclarationOnlyacross all framework packages and blueprint interfaces/implementations. Thetypescript@7package ships no JS Compiler API, so rollup-plugin-dts crashes; worse, its bundling duplicates MikroORM'sunique symbolbrands, making identical entity types unrelated (TS2719). Per-file declaration emit viatsconfig.build.json(explicitrootDir, entry-scopedinclude) fixes both.typescriptaliased tonpm:@typescript/typescript6in all packages so typescript-eslint/typedoc get the TS 6 API (official side-by-side guidance);tsgo(from@typescript/native-preview) does typechecking and emit."./types/*"etc.) added to blueprint lib packages — tsgo's declaration emitter cannot name types through re-export chains (TS2883).implements SV<...>first type args — tsgo emitsSV<<T>...which it then fails to re-parse (TS1005 cascade in consumers).API/type fixes surfaced by TS7 typechecking
setupRls,ComplianceDataService,RetentionService, testing harness: bareMikroORMparams replaced with structural/relaxed types — v7MikroORM.init()returns a readonly entities array that a bareMikroORMannotation rejects.BatchLogRecordProcessoroptions-object API, expressRequest.signalpassthrough in the Bun shim..nullable()alignment onbillingProvideracross base/stripe implementations and apps; response DTOs and response schemas mark it optional; mappers coercenull → undefined. Constraint intersections widened to| null | undefined.apiVersionliterals bumped to2026-06-24.dahlia.Publishing
publishConfig.access: publicon all blueprint packages (new scoped packages default to restricted).private.blockExoticSubdeps: falsein framework workspace (uWebSockets.js is git-distributed).Test plan
pnpm -r run buildgreen across framework and blueprint workspaces__test__/test-utils.ts, missingENCRYPTION_KEYin.env.test)🤖 Generated with Claude Code
Summary by CodeRabbit
billingProviderwhen available.billingProvideroptional/nullable across validation, persistence, and exported service contracts (it is omitted cleanly when unset).