Add string literal completions for `package.json` `imports` field
closes https://github.com/microsoft/TypeScript/issues/52460 closes https://github.com/microsoft/TypeScript/issues/57680 closes https://github.com/microsoft/TypeScript/issues/57777
Currently, this only has tests based on https://github.com/microsoft/TypeScript/pull/55015 but I still have to add more
@andrewbranch I opened this as a draft because there are some minor cleanups to be done here. I'd appreciate an early review here though - in case there is something fundamentally wrong with this.
@Andarist did you still want to pursue this? We're looking to get this done in the TS 5.7 timeframe.
@DanielRosenwasser yes, it would be great if @andrewbranch could give this a quick look to check if im not doing anything overly wrong so I dont spend too much time on cleaning up things that will turn out to be wrong in the end ;p
@andrewbranch thanks for the review! I’ll try to clean this up asap
The TypeScript team hasn't accepted the linked issue #52460. If you can get it accepted, this PR will have a better chance of being reviewed.
I have been busy the last 2 weeks, I've done some progress on this in the past days but I hope to get everything done till the end of this week 🤞
@andrewbranch it's ready for re-review :)
I could also use a build of this to test it more easily in a real project, and not only in the test harness ;p cc @jakebailey
@typescript-bot pack this
Starting jobs; this comment will be updated as builds start and complete.
| Command | Status | Results |
|---|---|---|
pack this |
✅ Started | ✅ Results |
Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:
{
"devDependencies": {
"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/164040/artifacts?artifactName=tgz&fileId=7D1CD9129128DE0FC3646A76F014BB023412AEA343119330949BF42DF191661C02&fileName=/typescript-5.7.0-insiders.20241031.tgz"
}
}
and then running npm install.
There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/[email protected]".;