cloudflare / cloudflare/workers-sdk
Wrangler's `check:type` script should fully include the `templates` directory
- Dominant language
- TypeScript
- Stars
- 4.5k
- Forks
- 1.5k
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 187
Description
Currently wrangler's `check:type` script is not including at all the `templates` directory, that is being addressed in https://github.com/cloudflare/workers-sdk/pull/8302 (hopefully the PR will lend soon and I'll accordingly update this issue)
However in the PR two sub directories of `templates` are being excluded `startDevWorker` and `middleware`, I've attempted to also include those in the type checking but that turned out to be quite problematic because the files inside `templates` are type checked in a worker context but some of their files (inside `startDevWorker` and `middleware`) import files from the wrangler `src` directory where the context is that of nodejs, causing lots of type errors.
There are a good number of type errors currently and there seem to be quite a bunch to untangle, since this is not blocking anyone I thought it would not be worth it for me to spend too much time on this right now, so I'm just excluding such directories in the type checking and hopefully me or someone else can pick this back up when they have extra cycles to spare.
Contributor guide
Research direction
Start with Wrangler's `check:type` script and the exclusions for `templates/startDevWorker` and `templates/middleware`. Read the imported files in those directories and the corresponding files under Wrangler's `src` to identify the worker-versus-Node.js type conflicts. Done means both directories are included in type checking without unresolved type errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100