JoshuaKGoldberg / JoshuaKGoldberg/create-typescript-app

🛠 Tooling: Figure out strategy with `resolveBin`

Open
#1,992 0 comments 0 reactions 0 assignees View on GitHub
area: tooling status: in discussion
Dominant language
TypeScript
Stars
1.4k
Forks
89
Avg merge
1m
Merged PRs (30d)
3

Description

### Tooling Report Checklist

- [x] I have tried restarting my IDE and the issue persists.
- [x] I have pulled the latest `main` branch of the repository.
- [x] I have [searched for related issues](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aissue) and found none that matched my issue.

### Overview

Right now in CTA, this `resolveBin` function is used to get the paths to binaries to execute:

https://github.com/JoshuaKGoldberg/create-typescript-app/blob/666e3fa2d1d3b46bc32fac0b9bd5b54f24b7e808/src/utils/resolveBin.ts#L1-L7

https://github.com/JoshuaKGoldberg/create-typescript-app/blob/666e3fa2d1d3b46bc32fac0b9bd5b54f24b7e808/src/blocks/blockCSpell.ts#L81-L88

I don't love having a weird, rather-untestable function sitting around in the commands. It would be nice to figure out a cleaner approach than this... but I don't know what that would look like. 🤔

### Additional Info

IIRC I'd added the `resolveBin` in there to work even if the project wasn't able to install its own dependencies. As in, it should use `create-typescript-app/node_modules/` as the resolution root, not the generated package's.

Whatever solution is resolved here will likely need to be pushed up to Bingo. Other templates will have this issue as well.

🎁

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.