ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Registry.Npm.DependencySource

Description

npm dependency specs a client fetches from outside the registry. Only registry ranges and tags, npm: aliases, file:, link: and workspace: specs, and local paths pass, so any other scheme fails closed. Aliases and local specs stay exempt on npm-package-arg's terms, by its POSIX path grammar, the narrower of its two. Git detection follows hosted-git-info, widened to what another client or URL parsing could fetch.

Synopsis

One spec

data ExternalSource Source #

Where a client fetches a dependency from instead of the registry.

Constructors

GitSource

A git repository, by URL, hosted shortcut, GitHub shorthand or scp-like address.

RemoteUrl

A tarball at an http or https URL.

UnsupportedScheme

Any other scheme, such as pnpm's jsr:, which this registry does not resolve.

Instances

Instances details
Generic ExternalSource Source # 
Instance details

Defined in Ecluse.Core.Registry.Npm.DependencySource

Associated Types

type Rep ExternalSource 
Instance details

Defined in Ecluse.Core.Registry.Npm.DependencySource

type Rep ExternalSource = D1 ('MetaData "ExternalSource" "Ecluse.Core.Registry.Npm.DependencySource" "ecluse-0.4.0-inplace-ecluse-core" 'False) (C1 ('MetaCons "GitSource" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "RemoteUrl" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UnsupportedScheme" 'PrefixI 'False) (U1 :: Type -> Type)))
Show ExternalSource Source # 
Instance details

Defined in Ecluse.Core.Registry.Npm.DependencySource

Eq ExternalSource Source # 
Instance details

Defined in Ecluse.Core.Registry.Npm.DependencySource

Universe ExternalSource Source # 
Instance details

Defined in Ecluse.Core.Registry.Npm.DependencySource

type Rep ExternalSource Source # 
Instance details

Defined in Ecluse.Core.Registry.Npm.DependencySource

type Rep ExternalSource = D1 ('MetaData "ExternalSource" "Ecluse.Core.Registry.Npm.DependencySource" "ecluse-0.4.0-inplace-ecluse-core" 'False) (C1 ('MetaCons "GitSource" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "RemoteUrl" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UnsupportedScheme" 'PrefixI 'False) (U1 :: Type -> Type)))

externalSource :: Text -> Maybe ExternalSource Source #

Classify one spec. A spec with neither a colon nor a slash is a registry range, a tag or a file name, so the common case reads the text once and allocates nothing.

A release's installable dependencies

data InstallableField Source #

The dependency maps a consumer's install reads, in the order a refusal names them.

Instances

Instances details
Generic InstallableField Source # 
Instance details

Defined in Ecluse.Core.Registry.Npm.DependencySource

Associated Types

type Rep InstallableField 
Instance details

Defined in Ecluse.Core.Registry.Npm.DependencySource

type Rep InstallableField = D1 ('MetaData "InstallableField" "Ecluse.Core.Registry.Npm.DependencySource" "ecluse-0.4.0-inplace-ecluse-core" 'False) (C1 ('MetaCons "Dependencies" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "OptionalDependencies" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PeerDependencies" 'PrefixI 'False) (U1 :: Type -> Type)))
Show InstallableField Source # 
Instance details

Defined in Ecluse.Core.Registry.Npm.DependencySource

Eq InstallableField Source # 
Instance details

Defined in Ecluse.Core.Registry.Npm.DependencySource

Ord InstallableField Source # 
Instance details

Defined in Ecluse.Core.Registry.Npm.DependencySource

Universe InstallableField Source # 
Instance details

Defined in Ecluse.Core.Registry.Npm.DependencySource

type Rep InstallableField Source # 
Instance details

Defined in Ecluse.Core.Registry.Npm.DependencySource

type Rep InstallableField = D1 ('MetaData "InstallableField" "Ecluse.Core.Registry.Npm.DependencySource" "ecluse-0.4.0-inplace-ecluse-core" 'False) (C1 ('MetaCons "Dependencies" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "OptionalDependencies" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PeerDependencies" 'PrefixI 'False) (U1 :: Type -> Type)))

installableFieldName :: InstallableField -> Text Source #

The member name of the field in a release object.

data ExternalDependency Source #

One installable dependency whose spec fetches from outside the registry.

Constructors

ExternalDependency 

Fields

externalDependencyOf :: KeyMap Value -> Maybe ExternalDependency Source #

A release object's external dependency, reading only maps that are objects and specs that are strings. Several pick the first field, then the smallest name, so every read form reports one.

earlierDependency :: ExternalDependency -> ExternalDependency -> ExternalDependency Source #

The dependency externalDependencyOf would report of the two: the earlier field, then the smaller name.

renderExternalDependency :: ExternalDependency -> Text Source #

Name the dependency, its field and the kind of source, without the spec.