Skip to content

Fix wrangler shell command helper#202

Merged
just-be-dev merged 5 commits intomainfrom
just-be/lyon-v2
Feb 2, 2026
Merged

Fix wrangler shell command helper#202
just-be-dev merged 5 commits intomainfrom
just-be/lyon-v2

Conversation

@just-be-dev
Copy link
Owner

@just-be-dev just-be-dev commented Feb 2, 2026

Well, the last PR did fix some things, but the tokenization of the command wasn't working out that well. It was too clever, so I just dropped the template string function and passed the args as args. Problem solved?

AI Summary

The initial fix in #201 addressed the basic tokenization issue but incorrectly split non-whitespace characters like / that appear between template literal values. This caused commands like r2 object put bucket/key to be tokenized as three separate arguments instead of one concatenated path.

This PR improves the tokenization algorithm to properly handle concatenated values by treating only whitespace as token delimiters. Non-whitespace characters adjacent to interpolated values are now correctly concatenated together.

Changes include extracting the logic into a testable tokenizeCommand function and adding 16 comprehensive test cases covering edge cases like paths with slashes, multiple concatenations, special characters, and real-world usage patterns from the deploy script.

just-be-dev and others added 3 commits February 2, 2026 01:24
The previous fix split all string parts on whitespace, which incorrectly
split paths like "bucket/key" into separate tokens. Now properly tokenizes
by treating only whitespace as delimiters while preserving non-whitespace
characters (like "/") that should be concatenated with adjacent values.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Extracted tokenizeCommand as a testable function and added 16 test cases
covering various scenarios including concatenated values, multiple
interpolations, special characters, and real-world usage patterns.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 2, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
just-be-dev 48fe0df Commit Preview URL

Branch Preview URL
Feb 02 2026, 06:38 AM

just-be-dev and others added 2 commits February 2, 2026 01:35
Replaced complex template literal tokenization with a simple variadic
function that takes string arguments. This is more explicit, easier to
understand, and lets callers do their own string concatenation when needed.

Updated all call sites and tests to use the new simpler approach.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@just-be-dev just-be-dev changed the title Fix wrangler tokenization for concatenated values Fix wrangler shell command helper Feb 2, 2026
@just-be-dev just-be-dev merged commit 8d38ada into main Feb 2, 2026
3 checks passed
@just-be-dev just-be-dev deleted the just-be/lyon-v2 branch February 2, 2026 06:38
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