Skip to content

When not using deno.json, ensure latest glue-runtime is used#31

Merged
Macil merged 1 commit into
masterfrom
chris/denoJsonlessUpdate
Apr 4, 2026
Merged

When not using deno.json, ensure latest glue-runtime is used#31
Macil merged 1 commit into
masterfrom
chris/denoJsonlessUpdate

Conversation

@Macil
Copy link
Copy Markdown
Contributor

@Macil Macil commented Apr 3, 2026

Follow-up to #30, which applies specifically for Glues that have a deno.json and shows a warning message if an old glue-runtime is being used.

This PR applies to Glues without a deno.json. It causes us to run the user's glue with the right Deno flags to ensure unversioned glue-runtime imports use the latest version.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 4, 2026

Greptile Summary

This PR adds --reload=jsr:@streak-glue/runtime to the Deno subprocess flags when the user's glue has no deno.json. Without a lock file to pin a version, Deno may serve a stale cached copy of the runtime; passing --reload for that specific specifier forces a fresh fetch from JSR on every run. The pre-existing deno.json path (outdated-version warning) is preserved and is now reached through the refactored streakRuntimeUpdateChecks helper, which also pre-computes DenoConfigPaths so getOutdatedStreakRuntimeVersion no longer needs to discover config files itself.

Confidence Score: 5/5

This PR is safe to merge; the only finding is a minor API cleanup suggestion (P2).

All logic changes are straightforward and well-reasoned. The --reload flag is scoped precisely to the runtime package specifier, the existing deno.json / warning path is preserved, and the test is updated correctly. The single finding (leaving a dead _filename parameter in the public API) is purely cosmetic and does not affect runtime behaviour.

lib/runtimeVersionCheck.ts — the unused _filename parameter could be removed to clean up the public API.

Important Files Changed

Filename Overview
commands/dev.ts Replaces warnIfStreakRuntimeIsOutdated with streakRuntimeUpdateChecks, which now branches on deno.json presence: returns true (triggering --reload) when no deno.json is found, or falls back to the outdated-version warning path when deno.json exists. spawnLocalGlueProcess receives the new boolean and conditionally appends --reload=jsr:@streak-glue/runtime.
lib/runtimeVersionCheck.ts Refactored to accept a pre-computed DenoConfigPaths instead of a raw filename; filename is now unused (_filename) but kept in the signature. The path import and findDenoConfigPaths call were removed.
lib/runtimeVersionCheck.test.ts Test updated to call findDenoConfigPaths and pass the result to getOutdatedStreakRuntimeVersion, matching the new signature.

Reviews (1): Last reviewed commit: "use --reload flag to make sure latest ru..." | Re-trigger Greptile

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the dev command to ensure the latest version of the streak runtime is used by conditionally applying the --reload flag, particularly when a deno.json configuration is missing. The getOutdatedStreakRuntimeVersion function was refactored to accept configuration paths directly. Feedback suggests removing the unused _filename parameter from this function to simplify its signature.


export async function getOutdatedStreakRuntimeVersion(
filename: string,
_filename: string,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The _filename parameter is no longer used within getOutdatedStreakRuntimeVersion because the configuration paths are now passed directly via the denoConfigPaths argument. Removing this unused parameter would simplify the function's signature. Note that call sites in commands/dev.ts and lib/runtimeVersionCheck.test.ts would also need to be updated to reflect this change.

@Macil Macil merged commit 37aa57c into master Apr 4, 2026
2 checks passed
@Macil Macil deleted the chris/denoJsonlessUpdate branch April 4, 2026 00:02
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.

1 participant