microsoft / microsoft/TypeScript-Website

@typescript/ata should support `npm:` specifiers

Open
#3,314 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.6k
Forks
1.5k
Avg merge
2d 2h
Merged PRs (30d)
7

Description

Keywords: Automatic Type Acquisition, npm

I would like to produce a TypeScript playground using a particular version of a package. The suggestion is to support npm: package specifiers in import, like Deno does.

import { IInstruction, address } from 'npm:@solana/web3.js@2';

// @ts-expect-error
const ix: IInstruction = {
    keys: [],
    programAddress: address('abc'),
}
Output
import { address } from 'npm:@solana/web3.js@2';
// @ts-expect-error
const ix = {
    keys: [],
    programAddress: address('abc'),
};

Compiler Options
{
  "compilerOptions": {
    "strict": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "strictPropertyInitialization": true,
    "strictBindCallApply": true,
    "noImplicitThis": true,
    "noImplicitReturns": true,
    "alwaysStrict": true,
    "esModuleInterop": true,
    "declaration": true,
    "target": "ES2017",
    "jsx": "react",
    "module": "ESNext",
    "moduleResolution": "node"
  }
}

Playground Link: Provided

Adjacent to #3202.

Contributor guide

No contributing guide indexed for this repository

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 with the linked TypeScript Playground reproduction and compare the requested npm:@solana/web3.js@2 import with the current Automatic Type Acquisition behavior. Review the adjacent #3202 discussion for context, then verify that a versioned npm specifier resolves and produces the expected type error in the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.