question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect definition of Package interface in public @verdaccio/types

See original GitHub issue

Your Environment

  • verdaccio version: 5.2.2
  • node version [14.18.1]:
  • package manager: [npm 6.14.15]
  • os:[windows 11]
  • platform: [all platforms, starting verdaccio as part of larger system, not CLI]

Describe the bug

In the @verdaccio/types the Package has property defined as GenericBody while it really string/number according to Verdaccio internal types.

To Reproduce

  1. install @verdacco/types
  2. import Package from @verdaccio/types
  3. Write a code e. g. to serialize the Package object to Datastore or load it back.

Expected behavior

the properties of exposed types in @verdaccio/types must be same as same exposed types used within verdaccio core.

Configuration File (cat ~/.config/verdaccio/config.yaml)

This issue does not scoped to specific settings in config

Environment information

This issue affects development experience.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
koteisaevcommented, Dec 2, 2021

Hello! Thanks for reply. I implementing a standard integration in a corporate environment. I added a mini-plugin for auth, using our private auth API, and added a storage plugin to store packages in our private google cloud DB and bucket. I had also wrap the real verdaccio with an express-based “proxy” whose sole purpose is to override the url path from /some/prefix/to/npm into just / - because I can not just say with url_prefix that all requests, including from NPM CLI, should be at that /some/prefix/to/npm . The http-proxy-middleware npm package helped with this a lot, making this proxy literally a one-liner.

Such requirement for this behavior for url_prefix to be applied to all requests even to

PUT /@scope/package-name

comes from fact that for security reasons we can not expose repository existence at dns level with domain like npm.example.com Only with this mini-proxy I was able to achieve verdaccio (5.x.x) to accept package requests at proper urls (with url_prefix applied) there, without updating verdaccio internals.

BTW I guess that problem I reported seems to start to happen when I tried first to integrate not verdaccio package but rather @verdaccio/core or @verdaccio/server with being pubished @verdaccio/types referenced.

So for now the published @verdaccio/types compatible only with published verdaccio package.

0reactions
juanpicadocommented, Aug 20, 2022

Types were refactored with several improvements:

I consider this ticket outdated, so closing it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

types - AuthCallback: Incorrect definition · Issue #1924
However, the server seems to be expecting an object when there is an error for the callback, not a string. When I try...
Read more >
Java tutorial says I can have a package-private interface ...
I want to define an interface that allows unchecked access to members of a collection. However, when a public class implements this interface,...
Read more >
ABAP Package Concept Part 2 – Package Interfaces of ...
You can define properties of a package interface. One is to define which object types can be added. SAP distinguishes between package with...
Read more >
Packages In Java
Package in Java is a mechanism to encapsulate a group of classes, sub packages and interfaces. Packages are used for:.
Read more >
Real world advice for writing maintainable Go programs
Public functions are the way to communicate across packages, and interfaces are the mechanism to define behaviour across packages. Pure ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found