Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@typescript/ata should support npm: specifiers #3314

Open
steveluscher opened this issue Jan 29, 2025 · 0 comments
Open

@typescript/ata should support npm: specifiers #3314

steveluscher opened this issue Jan 29, 2025 · 0 comments

Comments

@steveluscher
Copy link

steveluscher commented Jan 29, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant