JoshuaKGoldberg / JoshuaKGoldberg/create-typescript-app

🛠 Tooling: Refactor `imageSize` to properly use Bingo Inputs

Open
#1,993 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, [`image-size`](https://www.npmjs.com/package/image-size) is used to get the size of a logo image on disk:

https://github.com/JoshuaKGoldberg/create-typescript-app/blob/666e3fa2d1d3b46bc32fac0b9bd5b54f24b7e808/src/options/readLogoSizing.ts#L39

This is one of the last pieces of Base options getting that doesn't use [`take`](https://www.create.bingo/build/details/contexts/#options-take) the proper way. Which makes it a bit harder to test internally.

Putting in `status: in discussion` to see if there's a good way to, say, have it use Bingo's plumbing for file system access. Which is tricky, as `imageSize` takes in a file path or buffer data, while `bingo-fs` only deals in strings...

### Additional Info

I really don't want to complicate `bingo-fs` with binary/buffer data concepts 😬. It's really nice having everything just be strings...

🎁

Contributor guide

Open the contributing guide

Research direction

Start with src/options/readLogoSizing.ts at the image-size call, then read Bingo's take documentation and the existing bingo-fs usage. Determine how image sizing can use Bingo Inputs for filesystem access without adding binary or buffer concepts to bingo-fs. Done means the image-size path no longer bypasses the intended Bingo plumbing and remains testable internally.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.