Skip to content

chore: use tinyexec - #1213

Open
sacrosanctic wants to merge 19 commits into
sveltejs:mainfrom
sacrosanctic:tinyexec
Open

chore: use tinyexec#1213
sacrosanctic wants to merge 19 commits into
sveltejs:mainfrom
sacrosanctic:tinyexec

Conversation

@sacrosanctic

Copy link
Copy Markdown
Contributor

Closes #

Description

Checklist

  • Update snapshots (if applicable)
  • Add a changeset (if applicable)
  • Allow maintainers to edit this PR
  • I care about what I'm doing, no matter the tool I use (Notepad, Sublime, VSCode, AI...)

@pkg-svelte-dev

pkg-svelte-dev Bot commented Aug 1, 2026

Copy link
Copy Markdown

Install the latest version of sv from 1ab1830:

pnpm add https://pkg.svelte.dev/sv/c/1ab1830738c64cd5455a7ec612d1b1f5c64e339b

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/cli/pr/1213

Note

This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed.

@changeset-bot

changeset-bot Bot commented Aug 1, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1ab1830

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sacrosanctic sacrosanctic left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure if these are supposed to throw.

Comment thread packages/sv/src/testing.ts Outdated
Comment thread packages/sv/src/testing.ts Outdated
Comment thread packages/sv/src/addons/tests/vitest/test.ts
Comment thread packages/sv/src/core/verifiers.ts Outdated
Comment thread packages/sv/src/core/verifiers.ts Outdated
Comment thread packages/sv/src/core/formatFiles.ts Outdated
await exec(command, args, { nodeOptions: { cwd }, throwOnError: true });
return {};
} catch (e) {
// @ts-expect-error tinyexec rethrows the spawn error as-is

@AdrianGonz97 AdrianGonz97 Aug 1, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

// @ts-expect-error tinyexec rethrows the spawn error as-is

I know you didn't change this catch-block, but is this still correct? Looking through NonZeroExitError, I don't see e.code as an available prop.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

e.code is a node error. I'll update the code to clarify this.

Comment thread packages/sv/src/addons/tests/drizzle/test.ts Outdated
Comment thread packages/sv/src/testing.ts Outdated
Comment thread packages/sv/src/addons/tests/drizzle/test.ts Outdated
Comment thread packages/sv/src/addons/tests/better-auth/test.ts Outdated
Comment thread packages/sv/src/addons/tests/better-auth/test.ts Outdated
}

if (dockerInstalled) execSync('docker compose up --detach', { cwd, stdio: 'pipe' });
if (dockerInstalled) execSync('docker', ['compose', 'up', '--detach'], { nodeOptions: { cwd } });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this one should probably throw (or at least be handled in some way) as well if we're depending on it running successfully


fs.writeFileSync(path.join(test_workspace_dir, 'pnpm-workspace.yaml'), 'packages:\n - ./*\n');

const exec_async = promisify(nodeExec);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hmmm, there was a reason we used this instead due to failing tests, but if it's no longer failing then we're probably good

Co-authored-by: CokaKoala <31664583+AdrianGonz97@users.noreply.github.com>
@sacrosanctic

Copy link
Copy Markdown
Contributor Author

I just learned that execsync still throws even when it is false if the command itself is invalid...

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