Skip to content

Fix spaces-in-path (%20) bug and add missing tsx dependency#22

Open
tomiin wants to merge 1 commit into
eddalabs:mainfrom
tomiin:fix/spaces-in-path-and-missing-tsx
Open

Fix spaces-in-path (%20) bug and add missing tsx dependency#22
tomiin wants to merge 1 commit into
eddalabs:mainfrom
tomiin:fix/spaces-in-path-and-missing-tsx

Conversation

@tomiin

@tomiin tomiin commented Jun 21, 2026

Copy link
Copy Markdown

Summary

Two bugs prevent the template from running out of the box on a fresh clone. This PR fixes both.

1. %20 spaces-in-path bug (breaks setup-standalone and the contract build on any path containing a space)

counter-cli/src/config.ts and counter-contract/src/config.ts build currentDir with:

path.resolve(new URL(import.meta.url).pathname, '..')

new URL(import.meta.url).pathname leaves spaces URL-encoded as %20. On any project path with a space (e.g. the default macOS ~/Documents/...), the resolved path becomes a literal …Midnight%20code…, so file lookups fail. pnpm setup-standalone dies with:

Error: open /Users/.../Midnight%20code%20/.../counter-cli/standalone.yml: no such file or directory

Fix: use fileURLToPath(import.meta.url), which decodes the path correctly and works whether or not the path contains spaces.

2. Missing tsx dependency in counter-cli

counter-cli's scripts (setup-undeployed, tui-undeployed/preview/preprod) invoke tsx, but tsx isn't declared anywhere in the package. With pnpm's strict node_modules, tsx isn't on PATH, so a fresh pnpm install + pnpm setup-standalone fails with:

sh: tsx: command not found

Fix: add tsx to counter-cli's devDependencies.

Testing

After both fixes, pnpm install && pnpm build && pnpm setup-standalone runs cleanly from a path that contains spaces.

Built on / for Midnight. 🌙

@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

@tomiin is attempting to deploy a commit to the erickrs2's projects Team on Vercel.

A member of the Team first needs to authorize it.

@tomiin

tomiin commented Jul 4, 2026

Copy link
Copy Markdown
Author

Friendly follow-up on this one. Both fixes are small but they block a fresh clone from running: the %20 spaces-in-path bug breaks setup-standalone and the contract build on any path with a space (like the default macOS ~/Documents/...), and without tsx in counter-cli a clean pnpm install && pnpm setup-standalone fails with tsx: command not found. Happy to rebase or tweak anything if that helps it land. Thanks for taking a look.

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