Skip to content

fix(run): pin bootstrap import version#1150

Merged
guitavano merged 2 commits intomainfrom
fix/pin-deco-run-version
Apr 1, 2026
Merged

fix(run): pin bootstrap import version#1150
guitavano merged 2 commits intomainfrom
fix/pin-deco-run-version

Conversation

@guitavano
Copy link
Copy Markdown
Contributor

@guitavano guitavano commented Apr 1, 2026

Summary

  • remove runtime meta.json fetch from scripts/run.ts
  • pin jsr:@deco/deco import to deno.json package version
  • reduce startup latency and avoid long unversioned JSR metadata resolution

Test plan

  • Run deno task start from a project consuming ../deco/scripts/run.ts
  • Confirm script logs pinned version usage from deno.json
  • Confirm no @deco/deco/meta.json fetch from the local run script path

Made with Cursor


Summary by cubic

Pin the @deco/deco bootstrap import in scripts/run.ts to a fixed version from DECO_VERSION or deno.json to reduce startup latency and avoid network lookups.

  • Refactors
    • Resolve version from DECO_VERSION, then deno.json.version, with fallback to "1".
    • Import jsr:@deco/deco@<version>/scripts/run and log the used version.
    • Removed meta.json fetch, abort/timeout, and timing code.

Written for commit 7a6e2e2. Summary will update on new commits.

Summary by CodeRabbit

Performance

  • Improved script startup time by eliminating network requests for version information.

Bug Fixes

  • Enhanced reliability by sourcing version from environment variables and local configuration instead of remote endpoints, reducing timeout and network dependency issues.

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
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Tagging Options

Should a new tag be published when this PR is merged?

  • 👍 for Patch 1.188.1 update
  • 🎉 for Minor 1.189.0 update
  • 🚀 for Major 2.0.0 update

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 565dbb82-b7f8-4d7e-970d-5696615211b8

📥 Commits

Reviewing files that changed from the base of the PR and between f5307c0 and 7a6e2e2.

📒 Files selected for processing (1)
  • scripts/run.ts

📝 Walkthrough

Walkthrough

The 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

Cohort / File(s) Summary
Version Resolution Simplification
scripts/run.ts
Replaced network-dependent version fetching from JSR endpoint with environment variable and config file fallback chain. Removed network timeout handling and related error handling. Updated import URL to use resolved version directly.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 No network hops, just env vars clean,
Version flows from configs, no fetch in between,
Fallbacks align in elegant grace,
Simpler, faster—a speedier race! 🏃‍♂️✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(run): pin bootstrap import version' accurately summarizes the main change: pinning the bootstrap import to a specific version instead of fetching it at runtime.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pin-deco-run-version

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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";
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Suggested change
const version = Deno.env.get("DECO_VERSION") ?? denoJSON.version ?? "1";
const version = Deno.env.get("DECO_VERSION")?.trim() || denoJSON.version || "1";
Fix with Cubic

@guitavano guitavano merged commit c1498ab into main Apr 1, 2026
4 checks passed
@guitavano guitavano deleted the fix/pin-deco-run-version branch April 1, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants