Classes
Spec
Defined in: browser.ts:151
The base, isomorphic Spec implementation.
Extended by
Implements
Constructors
new Spec()
Defined in: browser.ts:265
Parameters
name
string
bareSpec
string
options?
Returns
new Spec()
Defined in: browser.ts:266
Parameters
spec
string
options?
Returns
new Spec()
Defined in: browser.ts:267
Parameters
spec
string
| Spec
bareOrOptions?
string
| SpecOptions
options?
Returns
Properties
bareSpec
Defined in: browser.ts:215
just the part AFTER the name, so 1.x
in [email protected]
Implementation of
constructor
Defined in: browser.ts:263
The initial value of Object.prototype.constructor is the standard built-in Object constructor.
conventionalRegistryTarball?
Defined in: browser.ts:227
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
distTag?
Defined in: browser.ts:230
a dist-tag like ‘latest’
Implementation of
file?
Defined in: browser.ts:232
file path for file:// url specs
Implementation of
gitCommittish?
Defined in: browser.ts:219
the commit value we will check out
Implementation of
gitRemote?
Defined in: browser.ts:216
the git remote to fetch from
Implementation of
gitSelector?
Defined in: browser.ts:217
the committish, semver range, and/or path portion of a git remote
Implementation of
gitSelectorParsed?
Defined in: browser.ts:218
the parsed ’::‘-separated key/value pairs:
semver:<range>
and path:<subpath>
Implementation of
name
Defined in: browser.ts:212
the name portion, so foo
in [email protected]
Implementation of
namedGitHost?
Defined in: browser.ts:220
github, gitlab, bitbucket, gist, etc.
Implementation of
namedGitHostPath?
Defined in: browser.ts:221
the path that’s parsed when we have a named git host
Implementation of
namedRegistry?
Defined in: browser.ts:224
In specs like foo@npm:bar@1
, this is the ‘npm’ part. Other
registries can be mapped using the registries
option.
Implementation of
options
Defined in: browser.ts:211
options passed to the constructor, plus defaults
Implementation of
range?
Defined in: browser.ts:229
parsed semver range specifier
Implementation of
registry?
Defined in: browser.ts:225
registry to consult to resolve this spec
Implementation of
registrySpec?
Defined in: browser.ts:226
semver range or dist-tag for resolving against a packument
Implementation of
remoteURL?
Defined in: browser.ts:231
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
scope?
Defined in: browser.ts:213
the name’s scope, so @acme
in @acme/[email protected]
Implementation of
scopeRegistry?
Defined in: browser.ts:214
if the name is scoped, and there’s a registry associated with the scope, then this is that registry
Implementation of
semver?
Defined in: browser.ts:228
spec to resolve against available versions
Implementation of
spec
Defined in: browser.ts:210
the full named specifier passed to the constructor
Implementation of
subspec?
Defined in: browser.ts:233
in bar@npm:[email protected]
, this is the spec for [email protected]
Implementation of
type
Defined in: browser.ts:209
the type of spec that this is, ultimately
Implementation of
workspace?
Defined in: browser.ts:223
the package name or path of the workspace being referenced
Implementation of
workspaceSpec?
Defined in: browser.ts:222
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
nodejsDependencies?
Defined in: browser.ts:207
Accessors
final
Get Signature
Defined in: browser.ts:242
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
Methods
[kCustomInspect]()
Defined in: browser.ts:577
Returns
string
toString()
Defined in: browser.ts:253
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
Implementation of
parse()
Call Signature
Defined in: browser.ts:158
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?
Returns
Call Signature
Defined in: browser.ts:163
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
spec
string
options?
Returns
Call Signature
Defined in: browser.ts:164
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
spec
options?
Returns
parseArgs()
Defined in: browser.ts:175
Parameters
specOrBareSpec
string
opts?
Returns
parseGitSelector()
Defined in: browser.ts:628
Should only ever be called with the bit that comes AFTER the # in the git remote url.
Parameters
selector
string
spec?
Returns
[GitSelectorParsed
, string
, Range
]
Type Aliases
NodeJSDependenciesOptions
Defined in: browser.ts:140
Injects the Node.js dependencies into the Spec class.
Type declaration
homedir
isAbsolute
join
resolve
winPath
Variables
defaultGitHostArchives
Defined in: browser.ts:31
Type declaration
bitbucket
gist
github
gitlab
defaultGitHosts
Defined in: browser.ts:24
Type declaration
bitbucket
gist
github
gitlab
defaultRegistries
Defined in: browser.ts:20
Type declaration
npm
defaultRegistry
Defined in: browser.ts:18
defaultScopeRegistries
Defined in: browser.ts:54
gitHostWebsites
Defined in: browser.ts:47
These are just for legacy support of urls that are supported by npm and observed in the wild.
Not configurable, because no more will be added. If you wish to define
custom git hosts, use it with the 'git-hosts'
and 'git-host-archives'
options.
Type declaration
bitbucket
gist
github
gitlab
kCustomInspect
Defined in: browser.ts:16
Functions
getNormalizeFile()
Defined in: browser.ts:704
Parameters
opts?
Returns
Function
Parameters
bareSpec
string
spec
Returns
[string
, string
]
getOptions()
Defined in: browser.ts:56
Parameters
options?
Returns
References
GitSelectorParsed
Re-exports GitSelectorParsed
Scope
Re-exports Scope
SpecLike
Re-exports SpecLike
SpecLikeBase
Re-exports SpecLikeBase
SpecOptions
Re-exports SpecOptions
SpecOptionsFilled
Re-exports SpecOptionsFilled