fix(run): pin bootstrap import version#1150
Conversation
Avoid runtime fetch/version resolution in scripts/run.ts by importing @deco/deco using the local package version from deno.json, reducing startup latency and preventing long metadata lookups. Made-with: Cursor
Tagging OptionsShould a new tag be published when this PR is merged?
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe version resolution mechanism in the run script has been simplified. Instead of fetching version metadata from a network endpoint with timeout handling, the script now resolves the version from an environment variable, configuration file, or default value in a straightforward fallback sequence. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Prefer DECO_VERSION when set in scripts/run.ts while keeping deno.json version as default, so runtime version can be explicitly overridden without changing source. Made-with: Cursor
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="scripts/run.ts">
<violation number="1" location="scripts/run.ts:7">
P2: Using `??` here preserves empty-string versions, which can build an invalid JSR import path and break startup. Use a non-empty check fallback for `DECO_VERSION`.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| ); | ||
| return { latest: "1" }; | ||
| }); | ||
| const version = Deno.env.get("DECO_VERSION") ?? denoJSON.version ?? "1"; |
There was a problem hiding this comment.
P2: Using ?? here preserves empty-string versions, which can build an invalid JSR import path and break startup. Use a non-empty check fallback for DECO_VERSION.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/run.ts, line 7:
<comment>Using `??` here preserves empty-string versions, which can build an invalid JSR import path and break startup. Use a non-empty check fallback for `DECO_VERSION`.</comment>
<file context>
@@ -4,7 +4,7 @@ import denoJSON from "../deno.json" with { type: "json" };
const packageName = "@deco/deco";
-const version = denoJSON.version || "1";
+const version = Deno.env.get("DECO_VERSION") ?? denoJSON.version ?? "1";
console.log(
</file context>
| const version = Deno.env.get("DECO_VERSION") ?? denoJSON.version ?? "1"; | |
| const version = Deno.env.get("DECO_VERSION")?.trim() || denoJSON.version || "1"; |
Summary
meta.jsonfetch fromscripts/run.tsjsr:@deco/decoimport todeno.jsonpackage versionTest plan
deno task startfrom a project consuming../deco/scripts/run.tsdeno.json@deco/deco/meta.jsonfetch from the local run script pathMade with Cursor
Summary by cubic
Pin the
@deco/decobootstrap import inscripts/run.tsto a fixed version fromDECO_VERSIONordeno.jsonto reduce startup latency and avoid network lookups.DECO_VERSION, thendeno.json.version, with fallback to"1".jsr:@deco/deco@<version>/scripts/runand log the used version.meta.jsonfetch, abort/timeout, and timing code.Written for commit 7a6e2e2. Summary will update on new commits.
Summary by CodeRabbit
Performance
Bug Fixes