index | @vltpkg/spec
References
defaultGitHostArchives
Re-exports defaultGitHostArchives
defaultGitHosts
Re-exports defaultGitHosts
defaultRegistries
Re-exports defaultRegistries
defaultRegistry
Re-exports defaultRegistry
defaultScopeRegistries
Re-exports defaultScopeRegistries
getOptions
Re-exports getOptions
gitHostWebsites
Re-exports gitHostWebsites
kCustomInspect
Re-exports kCustomInspect
Classes
Spec
The base, isomorphic Spec implementation.
Extends
Implements
Constructors
new Spec()
The initial value of Object.prototype.constructor is the standard built-in Object constructor.
Parameters
• name: string
• bareSpec: string
• options?: SpecOptions
Returns
Inherited from
Defined in
browser.ts:265
new Spec()
The initial value of Object.prototype.constructor is the standard built-in Object constructor.
Parameters
• spec: string
• options?: SpecOptions
Returns
Inherited from
Defined in
browser.ts:266
new Spec()
The initial value of Object.prototype.constructor is the standard built-in Object constructor.
Parameters
• spec: string
| Spec
• bareOrOptions?: string
| SpecOptions
• options?: SpecOptions
Returns
Inherited from
Defined in
browser.ts:267
Properties
bareSpec
just the part AFTER the name, so 1.x
in [email protected]
Implementation of
SpecLike.bareSpec
Inherited from
Defined in
browser.ts:215
constructor
The initial value of Object.prototype.constructor is the standard built-in Object constructor.
Inherited from
BrowserSpec.constructor
Defined in
browser.ts:263
conventionalRegistryTarball?
conventional location of the tarball on the registry, if it can be guessed. This is only attempted if the spec is a registry type, with a single version comparator. This can be used to elide resolved urls that are repetitive and predictable.
Implementation of
SpecLike.conventionalRegistryTarball
Inherited from
Spec
.conventionalRegistryTarball
Defined in
browser.ts:227
distTag?
a dist-tag like ‘latest’
Implementation of
SpecLike.distTag
Inherited from
Defined in
browser.ts:230
file?
file path for file:// url specs
Implementation of
SpecLike.file
Inherited from
Defined in
browser.ts:232
gitCommittish?
the commit value we will check out
Implementation of
SpecLike.gitCommittish
Inherited from
Defined in
browser.ts:219
gitRemote?
the git remote to fetch from
Implementation of
SpecLike.gitRemote
Inherited from
Defined in
browser.ts:216
gitSelector?
the committish, semver range, and/or path portion of a git remote
Implementation of
SpecLike.gitSelector
Inherited from
Defined in
browser.ts:217
gitSelectorParsed?
the parsed ’::‘-separated key/value pairs:
semver:<range>
and path:<subpath>
Implementation of
SpecLike.gitSelectorParsed
Inherited from
Defined in
browser.ts:218
name
the name portion, so foo
in [email protected]
Implementation of
SpecLike.name
Inherited from
Defined in
browser.ts:212
namedGitHost?
github, gitlab, bitbucket, gist, etc.
Implementation of
SpecLike.namedGitHost
Inherited from
Defined in
browser.ts:220
namedGitHostPath?
the path that’s parsed when we have a named git host
Implementation of
SpecLike.namedGitHostPath
Inherited from
Defined in
browser.ts:221
namedRegistry?
In specs like foo@npm:bar@1
, this is the ‘npm’ part. Other
registries can be mapped using the registries
option.
Implementation of
SpecLike.namedRegistry
Inherited from
Defined in
browser.ts:224
options
options passed to the constructor, plus defaults
Implementation of
SpecLike.options
Inherited from
Defined in
browser.ts:211
range?
parsed semver range specifier
Implementation of
SpecLike.range
Inherited from
Defined in
browser.ts:229
registry?
registry to consult to resolve this spec
Implementation of
SpecLike.registry
Inherited from
Defined in
browser.ts:225
registrySpec?
semver range or dist-tag for resolving against a packument
Implementation of
SpecLike.registrySpec
Inherited from
Defined in
browser.ts:226
remoteURL?
URL to download a tarball from, if it can be determined.
This is set for url specs of course, but also git remotes on known hosts that provide a gitHostArchive template.
Implementation of
SpecLike.remoteURL
Inherited from
Defined in
browser.ts:231
scope?
the name’s scope, so @acme
in @acme/[email protected]
Implementation of
SpecLike.scope
Inherited from
Defined in
browser.ts:213
scopeRegistry?
if the name is scoped, and there’s a registry associated with the scope, then this is that registry
Implementation of
SpecLike.scopeRegistry
Inherited from
Defined in
browser.ts:214
semver?
spec to resolve against available versions
Implementation of
SpecLike.semver
Inherited from
Defined in
browser.ts:228
spec
the full named specifier passed to the constructor
Implementation of
SpecLike.spec
Inherited from
Defined in
browser.ts:210
subspec?
in bar@npm:[email protected]
, this is the spec for [email protected]
Implementation of
SpecLike.subspec
Inherited from
Defined in
browser.ts:233
type
the type of spec that this is, ultimately
Implementation of
SpecLike.type
Inherited from
Defined in
browser.ts:209
workspace?
the package name or path of the workspace being referenced
Implementation of
SpecLike.workspace
Inherited from
Defined in
browser.ts:223
workspaceSpec?
the specifier when using workspace:
specs
This can be either a semver range, *
, ~
, or ^
,
if the name is not modified. Or, it can include a workspace
package name or path, like workspace:packages/foo@*
or
workspace:@scope/foo@*
.
Implementation of
SpecLike.workspaceSpec
Inherited from
Defined in
browser.ts:222
nodejsDependencies?
Inherited from
Defined in
browser.ts:207
Accessors
final
Return the final entry in the chain of subspecs When deciding which thing to actually fetch, spec.final is the thing to look at.
Returns
Implementation of
SpecLike.final
Inherited from
Defined in
browser.ts:242
Methods
[kCustomInspect]()
Parameters
• _depth?: number
• options?: InspectOptions
Returns
string
Overrides
Defined in
index.ts:35
toString()
Normally, the string value of a Spec is just the string passed in to
be parsed. However, in the case of a chain of subspecs, like
foo@npm:bar@npm:baz@npm:quux@latest
, this simplifies out the middle
parts of the chain, returning just foo@npm:quux@latest
Returns
string
Inherited from
Defined in
browser.ts:253
parse()
parse(name, bareSpec, options)
Create a Spec object from a full spec, name+bareSpec, or Spec object
Note: If a Spec object is provided, it is returned as-is, without investigating whether the options match.
Parameters
• name: string
• bareSpec: string
• options?: SpecOptions
Returns
Inherited from
Defined in
browser.ts:158
parse(spec, options)
Parameters
• spec: string
• options?: SpecOptions
Returns
Inherited from
Defined in
browser.ts:163
parse(spec, options)
Parameters
• spec: Spec
• options?: SpecOptions
Returns
Inherited from
Defined in
browser.ts:164
parseArgs()
Parameters
• specOrBareSpec: string
• opts?: SpecOptions
Returns
Inherited from
Defined in
browser.ts:175
parseGitSelector()
Should only ever be called with the bit that comes AFTER the # in the git remote url.
Parameters
• selector: string
• spec?: Spec
Returns
[GitSelectorParsed
, string
, Range
]
Inherited from
Defined in
browser.ts:628
Type Aliases
GitSelectorParsed
Type declaration
path?
semver?
Defined in
types.ts:22
Scope
Defined in
types.ts:7
SpecLike<Type>
Type declaration
final
subspec?
Type Parameters
• Type extends SpecLikeBase
Defined in
types.ts:131
SpecLikeBase
Type declaration
bareSpec
just the part AFTER the name, so 1.x
in [email protected]
conventionalRegistryTarball?
conventional location of the tarball on the registry, if it can be guessed. This is only attempted if the spec is a registry type, with a single version comparator. This can be used to elide resolved urls that are repetitive and predictable.
distTag?
a dist-tag like ‘latest’
file?
file path for file:// url specs
final
getter that retrieves the actual spec value to be used
gitCommittish?
the commit value we will check out
gitRemote?
the git remote to fetch from
gitSelector?
the committish, semver range, and/or path portion of a git remote
gitSelectorParsed?
the parsed ’::‘-separated key/value pairs:
semver:<range>
and path:<subpath>
name
the name portion, so foo
in [email protected]
namedGitHost?
github, gitlab, bitbucket, gist, etc.
namedGitHostPath?
the path that’s parsed when we have a named git host
namedRegistry?
In specs like foo@npm:bar@1
, this is the ‘npm’ part. Other
registries can be mapped using the registries
option.
options
options passed to the constructor, plus defaults
range?
parsed semver range specifier
registry?
registry to consult to resolve this spec
registrySpec?
semver range or dist-tag for resolving against a packument
remoteURL?
URL to download a tarball from, if it can be determined.
This is set for url specs of course, but also git remotes on known hosts that provide a gitHostArchive template.
scope?
the name’s scope, so @acme
in @acme/[email protected]
scopeRegistry?
if the name is scoped, and there’s a registry associated with the scope, then this is that registry
semver?
spec to resolve against available versions
spec
the full named specifier passed to the constructor
subspec?
in bar@npm:[email protected]
, this is the spec for [email protected]
type
the type of spec that this is, ultimately
workspace?
the package name or path of the workspace being referenced
workspaceSpec?
the specifier when using workspace:
specs
This can be either a semver range, *
, ~
, or ^
,
if the name is not modified. Or, it can include a workspace
package name or path, like workspace:packages/foo@*
or
workspace:@scope/foo@*
.
Defined in
types.ts:27
SpecOptions
Defined in
types.ts:3
SpecOptionsFilled
Type declaration
git-host-archives
tarball hosting services for hosts listed in git-hosts
git-hosts
shorthand prefix names for known git hosts
registries
shorthand prefix names for known registries
registry
the registry where a spec should be resolved against
scope-registries
registries mapped to a @scope
Defined in
types.ts:9