redhat-developer / redhat-developer/vscode-openshift-tools

Investigate replacing `proxyquire`

Open
#2,951 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debt priority/minor
Dominant language
TypeScript
Stars
123
Forks
63
Avg merge
6h 16m
Merged PRs (30d)
74

Description

In order for proxyquire to work, all the libraries that you want to stub need to be imported using require() instead of import ... from 'library-name'. This is annoying, because:

  • the first import strategy doesn't work well with TypeScript, so none of the library functions we import this way have type checking
  • the first import strategy doesn't work well with esbuild, which is why I gave up on bundling ./src/extension.ts

A possible alternative is https://github.com/testdouble/quibble

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing how proxyquire is used with the imports in ./src/extension.ts, especially the require() versus import ... from patterns. Compare the proposed quibble alternative against the TypeScript type-checking and esbuild concerns described in the issue. Done means determining whether a replacement is viable and identifying the migration scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, testing, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.