Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

socket pnpm add / socket yarn add scan the alias name instead of the aliased package

Offen Anfängerfreundlich
#1,655 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
85/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
node.js, typescript
Bereich
cli, security

Rechercherichtung

Lies src/utils/npm-spec.mts und die Funktion safeParseNpmSpec; sie hat keinen alias-Zweig und verwendet das Ergebnis von npm-package-arg. Füge eine Handhabung für den Typ 'alias' unter Verwendung von subSpec hinzu, um das tatsächliche Paket und die Version zurückzugeben. Verifiziere mit SOCKET_CLI_DEBUG=1 socket pnpm add my-lodash@npm:[email protected], dass pkg:npm/[email protected] gesendet wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

The shadow pnpm and yarn wrappers check packages with the Socket API before they install them. For an npm alias spec, the check looks up the alias name instead of the package that gets installed.

safeParseNpmSpec in src/utils/npm-spec.mts reads name and version from the npm-package-arg result. For an alias, npm-package-arg returns type: 'alias', sets name to the alias, and puts the real package in subSpec. The function has no branch for alias, so it returns the alias name with no version.

Command argument PURL sent for scanning Package installed
my-lodash@npm:[email protected] pkg:npm/my-lodash [email protected]
node-types@npm:@types/[email protected] pkg:npm/node-types @types/[email protected]

As a result, the installed package never gets checked. If an unrelated package has the alias name, its alerts are reported instead. socket yarn install has the same problem with aliased package.json dependencies such as "my-lodash": "npm:lodash@^4", because it builds name@version from each entry and passes the result to the same function.

Steps to reproduce

  1. Run SOCKET_CLI_DEBUG=1 socket pnpm add my-lodash@npm:[email protected].
  2. Check the packagePurls debug output.

Expected result

pkg:npm/[email protected]

Actual result

pkg:npm/my-lodash

Version

v1.x branch at 766b1e6 / [email protected].

Vorherrschende Sprache
TypeScript
Sterne
336
Forks
72
Ø Merge
1 T. 12 Std.
Gemergte PRs (30 T.)
87

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus SocketDev/socket-cli

Alle Issues in SocketDev/socket-cli

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.