first commit
This commit is contained in:
24
build/node_modules/node-abi/.travis.yml
generated
vendored
Normal file
24
build/node_modules/node-abi/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
language: node_js
|
||||
notifications:
|
||||
email: false
|
||||
node_js:
|
||||
- '8'
|
||||
- '6'
|
||||
- '4'
|
||||
- '0.12'
|
||||
- '0.10'
|
||||
matrix:
|
||||
include:
|
||||
- node_js: "8"
|
||||
env: TEST_SUITE=lint
|
||||
env:
|
||||
- TEST_SUITE=unit
|
||||
before_script:
|
||||
- npm prune
|
||||
script:
|
||||
- npm run-script $TEST_SUITE
|
||||
after_success:
|
||||
- npm run semantic-release
|
||||
branches:
|
||||
except:
|
||||
- /^v\d+\.\d+\.\d+$/
|
||||
73
build/node_modules/node-abi/CODE_OF_CONDUCT.md
generated
vendored
Normal file
73
build/node_modules/node-abi/CODE_OF_CONDUCT.md
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
nationality, personal appearance, race, religion, or sexual identity and
|
||||
orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at lukas.geiger94@gmail.com. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct/
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
53
build/node_modules/node-abi/CONTRIBUTING.md
generated
vendored
Normal file
53
build/node_modules/node-abi/CONTRIBUTING.md
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
# Contributing to `node-abi`
|
||||
|
||||
:+1::tada: First off, thanks for taking the time to contribute to `node-abi`! :tada::+1:
|
||||
|
||||
## Commit Message Guidelines
|
||||
|
||||
This module uses [`semantic-release`](https://github.com/semantic-release/semantic-release) to automatically release new versions via Travis.
|
||||
Therefor we have very precise rules over how our git commit messages can be formatted.
|
||||
|
||||
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
|
||||
format that includes a **type**, a **scope** and a **subject** ([full explanation](https://github.com/stevemao/conventional-changelog-angular/blob/master/convention.md)):
|
||||
|
||||
```
|
||||
<type>(<scope>): <subject>
|
||||
<BLANK LINE>
|
||||
<body>
|
||||
<BLANK LINE>
|
||||
<footer>
|
||||
```
|
||||
|
||||
### Type
|
||||
|
||||
Must be one of the following:
|
||||
|
||||
- **feat**: A new feature. **Will trigger a new release**
|
||||
- **fix**: A bug fix or a addition to one of the target arrays. **Will trigger a new release**
|
||||
- **docs**: Documentation only changes
|
||||
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
||||
- **refactor**: A code change that neither fixes a bug nor adds a feature
|
||||
- **perf**: A code change that improves performance
|
||||
- **test**: Adding missing or correcting existing tests
|
||||
- **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
|
||||
|
||||
|
||||
### Patch Release
|
||||
|
||||
```
|
||||
fix(electron): Support Electron 1.8.0
|
||||
```
|
||||
|
||||
### ~~Minor~~ Feature Release
|
||||
|
||||
```
|
||||
feat: add .getTarget(abi, runtime)
|
||||
```
|
||||
|
||||
### ~~Major~~ Breaking Release
|
||||
|
||||
```
|
||||
feat: Add amazing new feature
|
||||
|
||||
BREAKING CHANGE: This removes support for Node 0.10 and 0.12.
|
||||
```
|
||||
21
build/node_modules/node-abi/LICENSE
generated
vendored
Normal file
21
build/node_modules/node-abi/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016 Lukas Geiger
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
49
build/node_modules/node-abi/README.md
generated
vendored
Normal file
49
build/node_modules/node-abi/README.md
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
# Node.js ABI
|
||||
|
||||
[](https://travis-ci.org/lgeiger/node-abi) [](https://greenkeeper.io/)
|
||||
|
||||
|
||||
Get the Node ABI for a given target and runtime, and vice versa.
|
||||
|
||||
## Installation
|
||||
```
|
||||
npm install node-abi
|
||||
```
|
||||
|
||||
## Usage
|
||||
```javascript
|
||||
const nodeAbi = require('node-abi')
|
||||
|
||||
nodeAbi.getAbi('7.2.0', 'node')
|
||||
// '51'
|
||||
nodeAbi.getAbi('1.4.10', 'electron')
|
||||
// '50'
|
||||
nodeAbi.getTarget('51', 'node')
|
||||
// '7.2.0'
|
||||
nodeAbi.getTarget('50', 'electron')
|
||||
// '1.4.15'
|
||||
|
||||
nodeAbi.allTargets
|
||||
// [
|
||||
// { runtime: 'node', target: '0.10.48', abi: '11', lts: false },
|
||||
// { runtime: 'node', target: '0.12.17', abi: '14', lts: false },
|
||||
// { runtime: 'node', target: '4.6.1', abi: '46', lts: true },
|
||||
// { runtime: 'node', target: '5.12.0', abi: '47', lts: false },
|
||||
// { runtime: 'node', target: '6.9.4', abi: '48', lts: true },
|
||||
// { runtime: 'node', target: '7.4.0', abi: '51', lts: false },
|
||||
// { runtime: 'electron', target: '1.0.2', abi: '47', lts: false },
|
||||
// { runtime: 'electron', target: '1.2.8', abi: '48', lts: false },
|
||||
// { runtime: 'electron', target: '1.3.13', abi: '49', lts: false },
|
||||
// { runtime: 'electron', target: '1.4.15', abi: '50', lts: false }
|
||||
// ]
|
||||
nodeAbi.deprecatedTargets
|
||||
nodeAbi.supportedTargets
|
||||
nodeAbi.futureTargets
|
||||
// ...
|
||||
```
|
||||
|
||||
## References
|
||||
|
||||
- https://github.com/lgeiger/electron-abi
|
||||
- https://nodejs.org/en/download/releases/
|
||||
- https://github.com/nodejs/LTS
|
||||
95
build/node_modules/node-abi/index.js
generated
vendored
Normal file
95
build/node_modules/node-abi/index.js
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
var semver = require('semver')
|
||||
|
||||
function getNextTarget (runtime, targets) {
|
||||
if (targets == null) targets = allTargets
|
||||
var latest = targets.filter(function (t) { return t.runtime === runtime }).slice(-1)[0]
|
||||
var increment = runtime === 'electron' ? 'minor' : 'major'
|
||||
return semver.inc(latest.target, increment)
|
||||
}
|
||||
|
||||
function getAbi (target, runtime) {
|
||||
if (target === String(Number(target))) return target
|
||||
if (target) target = target.replace(/^v/, '')
|
||||
if (!runtime) runtime = 'node'
|
||||
|
||||
if (runtime === 'node') {
|
||||
if (!target) return process.versions.modules
|
||||
if (target === process.versions.node) return process.versions.modules
|
||||
}
|
||||
|
||||
var abi
|
||||
|
||||
for (var i = 0; i < allTargets.length; i++) {
|
||||
var t = allTargets[i]
|
||||
if (t.runtime !== runtime) continue
|
||||
if (semver.lte(t.target, target)) abi = t.abi
|
||||
else break
|
||||
}
|
||||
|
||||
if (abi && semver.lt(target, getNextTarget(runtime))) return abi
|
||||
throw new Error('Could not detect abi for version ' + target + ' and runtime ' + runtime + '. Updating "node-abi" might help solve this issue if it is a new release of ' + runtime)
|
||||
}
|
||||
|
||||
function getTarget (abi, runtime) {
|
||||
if (abi && abi !== String(Number(abi))) return abi
|
||||
if (!runtime) runtime = 'node'
|
||||
|
||||
if (runtime === 'node' && !abi) return process.versions.node
|
||||
|
||||
var match = allTargets
|
||||
.filter(function (t) {
|
||||
return t.abi === abi && t.runtime === runtime
|
||||
})
|
||||
.map(function (t) {
|
||||
return t.target
|
||||
})
|
||||
if (match.length) return match[0]
|
||||
|
||||
throw new Error('Could not detect target for abi ' + abi + ' and runtime ' + runtime)
|
||||
}
|
||||
|
||||
var supportedTargets = [
|
||||
{runtime: 'node', target: '4.0.0', abi: '46', lts: false},
|
||||
{runtime: 'node', target: '5.0.0', abi: '47', lts: false},
|
||||
{runtime: 'node', target: '6.0.0', abi: '48', lts: new Date() < new Date(2018, 4, 18)},
|
||||
{runtime: 'node', target: '7.0.0', abi: '51', lts: false},
|
||||
{runtime: 'node', target: '8.0.0', abi: '57', lts: false},
|
||||
{runtime: 'node', target: '9.0.0', abi: '59', lts: new Date() < new Date(2019, 12, 31)},
|
||||
{runtime: 'electron', target: '0.36.0', abi: '47', lts: false},
|
||||
{runtime: 'electron', target: '1.1.0', abi: '48', lts: false},
|
||||
{runtime: 'electron', target: '1.3.0', abi: '49', lts: false},
|
||||
{runtime: 'electron', target: '1.4.0', abi: '50', lts: false},
|
||||
{runtime: 'electron', target: '1.5.0', abi: '51', lts: false},
|
||||
{runtime: 'electron', target: '1.6.0', abi: '53', lts: false},
|
||||
{runtime: 'electron', target: '1.7.0', abi: '54', lts: false},
|
||||
{runtime: 'electron', target: '1.8.0', abi: '57', lts: false}
|
||||
]
|
||||
|
||||
var deprecatedTargets = [
|
||||
{runtime: 'node', target: '0.2.0', abi: '1', lts: false},
|
||||
{runtime: 'node', target: '0.9.1', abi: '0x000A', lts: false},
|
||||
{runtime: 'node', target: '0.9.9', abi: '0x000B', lts: false},
|
||||
{runtime: 'node', target: '0.10.4', abi: '11', lts: false},
|
||||
{runtime: 'node', target: '0.11.0', abi: '0x000C', lts: false},
|
||||
{runtime: 'node', target: '0.11.8', abi: '13', lts: false},
|
||||
{runtime: 'node', target: '0.11.11', abi: '14', lts: false},
|
||||
{runtime: 'node', target: '1.0.0', abi: '42', lts: false},
|
||||
{runtime: 'node', target: '1.1.0', abi: '43', lts: false},
|
||||
{runtime: 'node', target: '2.0.0', abi: '44', lts: false},
|
||||
{runtime: 'node', target: '3.0.0', abi: '45', lts: false},
|
||||
{runtime: 'electron', target: '0.30.0', abi: '44', lts: false},
|
||||
{runtime: 'electron', target: '0.31.0', abi: '45', lts: false},
|
||||
{runtime: 'electron', target: '0.33.0', abi: '46', lts: false}
|
||||
]
|
||||
|
||||
var futureTargets = []
|
||||
|
||||
var allTargets = deprecatedTargets.concat(supportedTargets).concat(futureTargets)
|
||||
|
||||
exports.getAbi = getAbi
|
||||
exports.getTarget = getTarget
|
||||
exports.deprecatedTargets = deprecatedTargets
|
||||
exports.supportedTargets = supportedTargets
|
||||
exports.futureTargets = futureTargets
|
||||
exports.allTargets = allTargets
|
||||
exports._getNextTarget = getNextTarget
|
||||
1
build/node_modules/node-abi/node_modules/.bin/semver
generated
vendored
Symbolic link
1
build/node_modules/node-abi/node_modules/.bin/semver
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../semver/bin/semver
|
||||
15
build/node_modules/node-abi/node_modules/semver/LICENSE
generated
vendored
Normal file
15
build/node_modules/node-abi/node_modules/semver/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
366
build/node_modules/node-abi/node_modules/semver/README.md
generated
vendored
Normal file
366
build/node_modules/node-abi/node_modules/semver/README.md
generated
vendored
Normal file
@@ -0,0 +1,366 @@
|
||||
semver(1) -- The semantic versioner for npm
|
||||
===========================================
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
npm install --save semver
|
||||
````
|
||||
|
||||
## Usage
|
||||
|
||||
As a node module:
|
||||
|
||||
```js
|
||||
const semver = require('semver')
|
||||
|
||||
semver.valid('1.2.3') // '1.2.3'
|
||||
semver.valid('a.b.c') // null
|
||||
semver.clean(' =v1.2.3 ') // '1.2.3'
|
||||
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
|
||||
semver.gt('1.2.3', '9.8.7') // false
|
||||
semver.lt('1.2.3', '9.8.7') // true
|
||||
```
|
||||
|
||||
As a command-line utility:
|
||||
|
||||
```
|
||||
$ semver -h
|
||||
|
||||
SemVer 5.3.0
|
||||
|
||||
A JavaScript implementation of the http://semver.org/ specification
|
||||
Copyright Isaac Z. Schlueter
|
||||
|
||||
Usage: semver [options] <version> [<version> [...]]
|
||||
Prints valid versions sorted by SemVer precedence
|
||||
|
||||
Options:
|
||||
-r --range <range>
|
||||
Print versions that match the specified range.
|
||||
|
||||
-i --increment [<level>]
|
||||
Increment a version by the specified level. Level can
|
||||
be one of: major, minor, patch, premajor, preminor,
|
||||
prepatch, or prerelease. Default level is 'patch'.
|
||||
Only one version may be specified.
|
||||
|
||||
--preid <identifier>
|
||||
Identifier to be used to prefix premajor, preminor,
|
||||
prepatch or prerelease version increments.
|
||||
|
||||
-l --loose
|
||||
Interpret versions and ranges loosely
|
||||
|
||||
Program exits successfully if any valid version satisfies
|
||||
all supplied ranges, and prints all satisfying versions.
|
||||
|
||||
If no satisfying versions are found, then exits failure.
|
||||
|
||||
Versions are printed in ascending order, so supplying
|
||||
multiple versions to the utility will just sort them.
|
||||
```
|
||||
|
||||
## Versions
|
||||
|
||||
A "version" is described by the `v2.0.0` specification found at
|
||||
<http://semver.org/>.
|
||||
|
||||
A leading `"="` or `"v"` character is stripped off and ignored.
|
||||
|
||||
## Ranges
|
||||
|
||||
A `version range` is a set of `comparators` which specify versions
|
||||
that satisfy the range.
|
||||
|
||||
A `comparator` is composed of an `operator` and a `version`. The set
|
||||
of primitive `operators` is:
|
||||
|
||||
* `<` Less than
|
||||
* `<=` Less than or equal to
|
||||
* `>` Greater than
|
||||
* `>=` Greater than or equal to
|
||||
* `=` Equal. If no operator is specified, then equality is assumed,
|
||||
so this operator is optional, but MAY be included.
|
||||
|
||||
For example, the comparator `>=1.2.7` would match the versions
|
||||
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
|
||||
or `1.1.0`.
|
||||
|
||||
Comparators can be joined by whitespace to form a `comparator set`,
|
||||
which is satisfied by the **intersection** of all of the comparators
|
||||
it includes.
|
||||
|
||||
A range is composed of one or more comparator sets, joined by `||`. A
|
||||
version matches a range if and only if every comparator in at least
|
||||
one of the `||`-separated comparator sets is satisfied by the version.
|
||||
|
||||
For example, the range `>=1.2.7 <1.3.0` would match the versions
|
||||
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
|
||||
or `1.1.0`.
|
||||
|
||||
The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
|
||||
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
|
||||
|
||||
### Prerelease Tags
|
||||
|
||||
If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
|
||||
it will only be allowed to satisfy comparator sets if at least one
|
||||
comparator with the same `[major, minor, patch]` tuple also has a
|
||||
prerelease tag.
|
||||
|
||||
For example, the range `>1.2.3-alpha.3` would be allowed to match the
|
||||
version `1.2.3-alpha.7`, but it would *not* be satisfied by
|
||||
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
|
||||
than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
|
||||
range only accepts prerelease tags on the `1.2.3` version. The
|
||||
version `3.4.5` *would* satisfy the range, because it does not have a
|
||||
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
|
||||
|
||||
The purpose for this behavior is twofold. First, prerelease versions
|
||||
frequently are updated very quickly, and contain many breaking changes
|
||||
that are (by the author's design) not yet fit for public consumption.
|
||||
Therefore, by default, they are excluded from range matching
|
||||
semantics.
|
||||
|
||||
Second, a user who has opted into using a prerelease version has
|
||||
clearly indicated the intent to use *that specific* set of
|
||||
alpha/beta/rc versions. By including a prerelease tag in the range,
|
||||
the user is indicating that they are aware of the risk. However, it
|
||||
is still not appropriate to assume that they have opted into taking a
|
||||
similar risk on the *next* set of prerelease versions.
|
||||
|
||||
#### Prerelease Identifiers
|
||||
|
||||
The method `.inc` takes an additional `identifier` string argument that
|
||||
will append the value of the string as a prerelease identifier:
|
||||
|
||||
```javascript
|
||||
semver.inc('1.2.3', 'prerelease', 'beta')
|
||||
// '1.2.4-beta.0'
|
||||
```
|
||||
|
||||
command-line example:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.3 -i prerelease --preid beta
|
||||
1.2.4-beta.0
|
||||
```
|
||||
|
||||
Which then can be used to increment further:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.4-beta.0 -i prerelease
|
||||
1.2.4-beta.1
|
||||
```
|
||||
|
||||
### Advanced Range Syntax
|
||||
|
||||
Advanced range syntax desugars to primitive comparators in
|
||||
deterministic ways.
|
||||
|
||||
Advanced ranges may be combined in the same way as primitive
|
||||
comparators using white space or `||`.
|
||||
|
||||
#### Hyphen Ranges `X.Y.Z - A.B.C`
|
||||
|
||||
Specifies an inclusive set.
|
||||
|
||||
* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
|
||||
|
||||
If a partial version is provided as the first version in the inclusive
|
||||
range, then the missing pieces are replaced with zeroes.
|
||||
|
||||
* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
|
||||
|
||||
If a partial version is provided as the second version in the
|
||||
inclusive range, then all versions that start with the supplied parts
|
||||
of the tuple are accepted, but nothing that would be greater than the
|
||||
provided tuple parts.
|
||||
|
||||
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0`
|
||||
* `1.2.3 - 2` := `>=1.2.3 <3.0.0`
|
||||
|
||||
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
|
||||
|
||||
Any of `X`, `x`, or `*` may be used to "stand in" for one of the
|
||||
numeric values in the `[major, minor, patch]` tuple.
|
||||
|
||||
* `*` := `>=0.0.0` (Any version satisfies)
|
||||
* `1.x` := `>=1.0.0 <2.0.0` (Matching major version)
|
||||
* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions)
|
||||
|
||||
A partial version range is treated as an X-Range, so the special
|
||||
character is in fact optional.
|
||||
|
||||
* `""` (empty string) := `*` := `>=0.0.0`
|
||||
* `1` := `1.x.x` := `>=1.0.0 <2.0.0`
|
||||
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0`
|
||||
|
||||
#### Tilde Ranges `~1.2.3` `~1.2` `~1`
|
||||
|
||||
Allows patch-level changes if a minor version is specified on the
|
||||
comparator. Allows minor-level changes if not.
|
||||
|
||||
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0`
|
||||
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`)
|
||||
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`)
|
||||
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0`
|
||||
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`)
|
||||
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`)
|
||||
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in
|
||||
the `1.2.3` version will be allowed, if they are greater than or
|
||||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||
different `[major, minor, patch]` tuple.
|
||||
|
||||
#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
|
||||
|
||||
Allows changes that do not modify the left-most non-zero digit in the
|
||||
`[major, minor, patch]` tuple. In other words, this allows patch and
|
||||
minor updates for versions `1.0.0` and above, patch updates for
|
||||
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
|
||||
|
||||
Many authors treat a `0.x` version as if the `x` were the major
|
||||
"breaking-change" indicator.
|
||||
|
||||
Caret ranges are ideal when an author may make breaking changes
|
||||
between `0.2.4` and `0.3.0` releases, which is a common practice.
|
||||
However, it presumes that there will *not* be breaking changes between
|
||||
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
|
||||
additive (but non-breaking), according to commonly observed practices.
|
||||
|
||||
* `^1.2.3` := `>=1.2.3 <2.0.0`
|
||||
* `^0.2.3` := `>=0.2.3 <0.3.0`
|
||||
* `^0.0.3` := `>=0.0.3 <0.0.4`
|
||||
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in
|
||||
the `1.2.3` version will be allowed, if they are greater than or
|
||||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||
different `[major, minor, patch]` tuple.
|
||||
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the
|
||||
`0.0.3` version *only* will be allowed, if they are greater than or
|
||||
equal to `beta`. So, `0.0.3-pr.2` would be allowed.
|
||||
|
||||
When parsing caret ranges, a missing `patch` value desugars to the
|
||||
number `0`, but will allow flexibility within that value, even if the
|
||||
major and minor versions are both `0`.
|
||||
|
||||
* `^1.2.x` := `>=1.2.0 <2.0.0`
|
||||
* `^0.0.x` := `>=0.0.0 <0.1.0`
|
||||
* `^0.0` := `>=0.0.0 <0.1.0`
|
||||
|
||||
A missing `minor` and `patch` values will desugar to zero, but also
|
||||
allow flexibility within those values, even if the major version is
|
||||
zero.
|
||||
|
||||
* `^1.x` := `>=1.0.0 <2.0.0`
|
||||
* `^0.x` := `>=0.0.0 <1.0.0`
|
||||
|
||||
### Range Grammar
|
||||
|
||||
Putting all this together, here is a Backus-Naur grammar for ranges,
|
||||
for the benefit of parser authors:
|
||||
|
||||
```bnf
|
||||
range-set ::= range ( logical-or range ) *
|
||||
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||
hyphen ::= partial ' - ' partial
|
||||
simple ::= primitive | partial | tilde | caret
|
||||
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial
|
||||
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||
xr ::= 'x' | 'X' | '*' | nr
|
||||
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
|
||||
tilde ::= '~' partial
|
||||
caret ::= '^' partial
|
||||
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||
pre ::= parts
|
||||
build ::= parts
|
||||
parts ::= part ( '.' part ) *
|
||||
part ::= nr | [-0-9A-Za-z]+
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
All methods and classes take a final `loose` boolean argument that, if
|
||||
true, will be more forgiving about not-quite-valid semver strings.
|
||||
The resulting output will always be 100% strict, of course.
|
||||
|
||||
Strict-mode Comparators and Ranges will be strict about the SemVer
|
||||
strings that they parse.
|
||||
|
||||
* `valid(v)`: Return the parsed version, or null if it's not valid.
|
||||
* `inc(v, release)`: Return the version incremented by the release
|
||||
type (`major`, `premajor`, `minor`, `preminor`, `patch`,
|
||||
`prepatch`, or `prerelease`), or null if it's not valid
|
||||
* `premajor` in one call will bump the version up to the next major
|
||||
version and down to a prerelease of that major version.
|
||||
`preminor`, and `prepatch` work the same way.
|
||||
* If called from a non-prerelease version, the `prerelease` will work the
|
||||
same as `prepatch`. It increments the patch version, then makes a
|
||||
prerelease. If the input version is already a prerelease it simply
|
||||
increments it.
|
||||
* `prerelease(v)`: Returns an array of prerelease components, or null
|
||||
if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
|
||||
* `major(v)`: Return the major version number.
|
||||
* `minor(v)`: Return the minor version number.
|
||||
* `patch(v)`: Return the patch version number.
|
||||
* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
|
||||
or comparators intersect.
|
||||
|
||||
### Comparison
|
||||
|
||||
* `gt(v1, v2)`: `v1 > v2`
|
||||
* `gte(v1, v2)`: `v1 >= v2`
|
||||
* `lt(v1, v2)`: `v1 < v2`
|
||||
* `lte(v1, v2)`: `v1 <= v2`
|
||||
* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
|
||||
even if they're not the exact same string. You already know how to
|
||||
compare strings.
|
||||
* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
|
||||
* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
|
||||
the corresponding function above. `"==="` and `"!=="` do simple
|
||||
string comparison, but are included for completeness. Throws if an
|
||||
invalid comparison string is provided.
|
||||
* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
|
||||
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
|
||||
* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
|
||||
in descending order when passed to `Array.sort()`.
|
||||
* `diff(v1, v2)`: Returns difference between two versions by the release type
|
||||
(`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
|
||||
or null if the versions are the same.
|
||||
|
||||
### Comparators
|
||||
|
||||
* `intersects(comparator)`: Return true if the comparators intersect
|
||||
|
||||
### Ranges
|
||||
|
||||
* `validRange(range)`: Return the valid range or null if it's not valid
|
||||
* `satisfies(version, range)`: Return true if the version satisfies the
|
||||
range.
|
||||
* `maxSatisfying(versions, range)`: Return the highest version in the list
|
||||
that satisfies the range, or `null` if none of them do.
|
||||
* `minSatisfying(versions, range)`: Return the lowest version in the list
|
||||
that satisfies the range, or `null` if none of them do.
|
||||
* `gtr(version, range)`: Return `true` if version is greater than all the
|
||||
versions possible in the range.
|
||||
* `ltr(version, range)`: Return `true` if version is less than all the
|
||||
versions possible in the range.
|
||||
* `outside(version, range, hilo)`: Return true if the version is outside
|
||||
the bounds of the range in either the high or low direction. The
|
||||
`hilo` argument must be either the string `'>'` or `'<'`. (This is
|
||||
the function called by `gtr` and `ltr`.)
|
||||
* `intersects(range)`: Return true if any of the ranges comparators intersect
|
||||
|
||||
Note that, since ranges may be non-contiguous, a version might not be
|
||||
greater than a range, less than a range, *or* satisfy a range! For
|
||||
example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
|
||||
until `2.0.0`, so the version `1.2.10` would not be greater than the
|
||||
range (because `2.0.1` satisfies, which is higher), nor less than the
|
||||
range (since `1.2.8` satisfies, which is lower), and it also does not
|
||||
satisfy the range.
|
||||
|
||||
If you want to know if a version satisfies or does not satisfy a
|
||||
range, use the `satisfies(version, range)` function.
|
||||
133
build/node_modules/node-abi/node_modules/semver/bin/semver
generated
vendored
Executable file
133
build/node_modules/node-abi/node_modules/semver/bin/semver
generated
vendored
Executable file
@@ -0,0 +1,133 @@
|
||||
#!/usr/bin/env node
|
||||
// Standalone semver comparison program.
|
||||
// Exits successfully and prints matching version(s) if
|
||||
// any supplied version is valid and passes all tests.
|
||||
|
||||
var argv = process.argv.slice(2)
|
||||
, versions = []
|
||||
, range = []
|
||||
, gt = []
|
||||
, lt = []
|
||||
, eq = []
|
||||
, inc = null
|
||||
, version = require("../package.json").version
|
||||
, loose = false
|
||||
, identifier = undefined
|
||||
, semver = require("../semver")
|
||||
, reverse = false
|
||||
|
||||
main()
|
||||
|
||||
function main () {
|
||||
if (!argv.length) return help()
|
||||
while (argv.length) {
|
||||
var a = argv.shift()
|
||||
var i = a.indexOf('=')
|
||||
if (i !== -1) {
|
||||
a = a.slice(0, i)
|
||||
argv.unshift(a.slice(i + 1))
|
||||
}
|
||||
switch (a) {
|
||||
case "-rv": case "-rev": case "--rev": case "--reverse":
|
||||
reverse = true
|
||||
break
|
||||
case "-l": case "--loose":
|
||||
loose = true
|
||||
break
|
||||
case "-v": case "--version":
|
||||
versions.push(argv.shift())
|
||||
break
|
||||
case "-i": case "--inc": case "--increment":
|
||||
switch (argv[0]) {
|
||||
case "major": case "minor": case "patch": case "prerelease":
|
||||
case "premajor": case "preminor": case "prepatch":
|
||||
inc = argv.shift()
|
||||
break
|
||||
default:
|
||||
inc = "patch"
|
||||
break
|
||||
}
|
||||
break
|
||||
case "--preid":
|
||||
identifier = argv.shift()
|
||||
break
|
||||
case "-r": case "--range":
|
||||
range.push(argv.shift())
|
||||
break
|
||||
case "-h": case "--help": case "-?":
|
||||
return help()
|
||||
default:
|
||||
versions.push(a)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
versions = versions.filter(function (v) {
|
||||
return semver.valid(v, loose)
|
||||
})
|
||||
if (!versions.length) return fail()
|
||||
if (inc && (versions.length !== 1 || range.length))
|
||||
return failInc()
|
||||
|
||||
for (var i = 0, l = range.length; i < l ; i ++) {
|
||||
versions = versions.filter(function (v) {
|
||||
return semver.satisfies(v, range[i], loose)
|
||||
})
|
||||
if (!versions.length) return fail()
|
||||
}
|
||||
return success(versions)
|
||||
}
|
||||
|
||||
function failInc () {
|
||||
console.error("--inc can only be used on a single version with no range")
|
||||
fail()
|
||||
}
|
||||
|
||||
function fail () { process.exit(1) }
|
||||
|
||||
function success () {
|
||||
var compare = reverse ? "rcompare" : "compare"
|
||||
versions.sort(function (a, b) {
|
||||
return semver[compare](a, b, loose)
|
||||
}).map(function (v) {
|
||||
return semver.clean(v, loose)
|
||||
}).map(function (v) {
|
||||
return inc ? semver.inc(v, inc, loose, identifier) : v
|
||||
}).forEach(function (v,i,_) { console.log(v) })
|
||||
}
|
||||
|
||||
function help () {
|
||||
console.log(["SemVer " + version
|
||||
,""
|
||||
,"A JavaScript implementation of the http://semver.org/ specification"
|
||||
,"Copyright Isaac Z. Schlueter"
|
||||
,""
|
||||
,"Usage: semver [options] <version> [<version> [...]]"
|
||||
,"Prints valid versions sorted by SemVer precedence"
|
||||
,""
|
||||
,"Options:"
|
||||
,"-r --range <range>"
|
||||
," Print versions that match the specified range."
|
||||
,""
|
||||
,"-i --increment [<level>]"
|
||||
," Increment a version by the specified level. Level can"
|
||||
," be one of: major, minor, patch, premajor, preminor,"
|
||||
," prepatch, or prerelease. Default level is 'patch'."
|
||||
," Only one version may be specified."
|
||||
,""
|
||||
,"--preid <identifier>"
|
||||
," Identifier to be used to prefix premajor, preminor,"
|
||||
," prepatch or prerelease version increments."
|
||||
,""
|
||||
,"-l --loose"
|
||||
," Interpret versions and ranges loosely"
|
||||
,""
|
||||
,"Program exits successfully if any valid version satisfies"
|
||||
,"all supplied ranges, and prints all satisfying versions."
|
||||
,""
|
||||
,"If no satisfying versions are found, then exits failure."
|
||||
,""
|
||||
,"Versions are printed in ascending order, so supplying"
|
||||
,"multiple versions to the utility will just sort them."
|
||||
].join("\n"))
|
||||
}
|
||||
57
build/node_modules/node-abi/node_modules/semver/package.json
generated
vendored
Normal file
57
build/node_modules/node-abi/node_modules/semver/package.json
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"semver@5.4.1",
|
||||
"/Users/asciidisco/Desktop/asciidisco.com/build"
|
||||
]
|
||||
],
|
||||
"_from": "semver@5.4.1",
|
||||
"_id": "semver@5.4.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==",
|
||||
"_location": "/node-abi/semver",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "semver@5.4.1",
|
||||
"name": "semver",
|
||||
"escapedName": "semver",
|
||||
"rawSpec": "5.4.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "5.4.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/node-abi"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz",
|
||||
"_spec": "5.4.1",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"bin": {
|
||||
"semver": "./bin/semver"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/npm/node-semver/issues"
|
||||
},
|
||||
"description": "The semantic version parser used by npm.",
|
||||
"devDependencies": {
|
||||
"tap": "^10.7.0"
|
||||
},
|
||||
"files": [
|
||||
"bin",
|
||||
"range.bnf",
|
||||
"semver.js"
|
||||
],
|
||||
"homepage": "https://github.com/npm/node-semver#readme",
|
||||
"license": "ISC",
|
||||
"main": "semver.js",
|
||||
"name": "semver",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/npm/node-semver.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tap test/*.js --cov -J"
|
||||
},
|
||||
"version": "5.4.1"
|
||||
}
|
||||
16
build/node_modules/node-abi/node_modules/semver/range.bnf
generated
vendored
Normal file
16
build/node_modules/node-abi/node_modules/semver/range.bnf
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
range-set ::= range ( logical-or range ) *
|
||||
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||
hyphen ::= partial ' - ' partial
|
||||
simple ::= primitive | partial | tilde | caret
|
||||
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial
|
||||
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||
xr ::= 'x' | 'X' | '*' | nr
|
||||
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
|
||||
tilde ::= '~' partial
|
||||
caret ::= '^' partial
|
||||
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||
pre ::= parts
|
||||
build ::= parts
|
||||
parts ::= part ( '.' part ) *
|
||||
part ::= nr | [-0-9A-Za-z]+
|
||||
1296
build/node_modules/node-abi/node_modules/semver/semver.js
generated
vendored
Normal file
1296
build/node_modules/node-abi/node_modules/semver/semver.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
67
build/node_modules/node-abi/package.json
generated
vendored
Normal file
67
build/node_modules/node-abi/package.json
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"node-abi@2.1.2",
|
||||
"/Users/asciidisco/Desktop/asciidisco.com/build"
|
||||
]
|
||||
],
|
||||
"_from": "node-abi@2.1.2",
|
||||
"_id": "node-abi@2.1.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-hmUtb8m75RSi7N+zZLYqe75XDvZB+6LyTBPkj2DConvNgQet2e3BIqEwe1LLvqMrfyjabuT5ZOrTioLCH1HTdA==",
|
||||
"_location": "/node-abi",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "node-abi@2.1.2",
|
||||
"name": "node-abi",
|
||||
"escapedName": "node-abi",
|
||||
"rawSpec": "2.1.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.1.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/prebuild-install"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.1.2.tgz",
|
||||
"_spec": "2.1.2",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"author": {
|
||||
"name": "Lukas Geiger"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/lgeiger/node-abi/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"semver": "^5.4.1"
|
||||
},
|
||||
"description": "Get the Node ABI for a given target and runtime, and vice versa.",
|
||||
"devDependencies": {
|
||||
"semantic-release": "^8.0.0",
|
||||
"standard": "^10.0.0",
|
||||
"tape": "^4.6.3"
|
||||
},
|
||||
"homepage": "https://github.com/lgeiger/node-abi#readme",
|
||||
"keywords": [
|
||||
"node",
|
||||
"electron",
|
||||
"node_module_version",
|
||||
"abi",
|
||||
"v8"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "node-abi",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/lgeiger/node-abi.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "standard",
|
||||
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
|
||||
"test": "npm run lint && npm run unit",
|
||||
"unit": "tape test/index.js"
|
||||
},
|
||||
"version": "2.1.2"
|
||||
}
|
||||
117
build/node_modules/node-abi/test/index.js
generated
vendored
Normal file
117
build/node_modules/node-abi/test/index.js
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
var test = require('tape')
|
||||
var semver = require('semver')
|
||||
var getAbi = require('../index').getAbi
|
||||
var getTarget = require('../index').getTarget
|
||||
var getNextTarget = require('../index')._getNextTarget
|
||||
var allTargets = require('../index').allTargets
|
||||
|
||||
test('getNextTarget gets the next unsopported target', function (t) {
|
||||
var mockTargets = [
|
||||
{runtime: 'node', target: '7.0.0', abi: '51', lts: false},
|
||||
{runtime: 'node', target: '8.0.0', abi: '57', lts: false},
|
||||
{runtime: 'electron', target: '0.36.0', abi: '47', lts: false},
|
||||
{runtime: 'electron', target: '1.1.0', abi: '48', lts: false}
|
||||
]
|
||||
t.equal(getNextTarget('node', mockTargets), '9.0.0')
|
||||
t.equal(getNextTarget('electron', mockTargets), '1.2.0')
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('getTarget calculates correct Node target', function (t) {
|
||||
t.equal(getTarget(undefined), process.versions.node)
|
||||
t.equal(getTarget(null), process.versions.node)
|
||||
t.equal(getTarget('11'), '0.10.4')
|
||||
t.equal(getTarget('14'), '0.11.11')
|
||||
t.equal(getTarget('46'), '4.0.0')
|
||||
t.equal(getTarget('47'), '5.0.0')
|
||||
t.equal(getTarget('48'), '6.0.0')
|
||||
t.equal(getTarget('51'), '7.0.0')
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('getTarget calculates correct Electron target', function (t) {
|
||||
t.throws(getTarget.bind(null, '14', 'electron'))
|
||||
t.equal(getTarget('47', 'electron'), '0.36.0')
|
||||
t.equal(getTarget('48', 'electron'), '1.1.0')
|
||||
t.equal(getTarget('49', 'electron'), '1.3.0')
|
||||
t.equal(getTarget('50', 'electron'), '1.4.0')
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('getAbi calculates correct Node ABI', function (t) {
|
||||
t.equal(getAbi(undefined), process.versions.modules)
|
||||
t.equal(getAbi(null), process.versions.modules)
|
||||
t.throws(function () { getAbi('a.b.c') })
|
||||
t.throws(function () { getAbi(getNextTarget('node')) })
|
||||
t.equal(getAbi('7.2.0'), '51')
|
||||
t.equal(getAbi('7.0.0'), '51')
|
||||
t.equal(getAbi('6.9.9'), '48')
|
||||
t.equal(getAbi('6.0.0'), '48')
|
||||
t.equal(getAbi('5.9.9'), '47')
|
||||
t.equal(getAbi('5.0.0'), '47')
|
||||
t.equal(getAbi('4.9.9'), '46')
|
||||
t.equal(getAbi('4.0.0'), '46')
|
||||
t.equal(getAbi('0.12.17'), '14')
|
||||
t.equal(getAbi('0.12.0'), '14')
|
||||
t.equal(getAbi('0.11.16'), '14')
|
||||
t.equal(getAbi('0.11.11'), '14')
|
||||
t.equal(getAbi('0.11.10'), '13')
|
||||
t.equal(getAbi('0.11.8'), '13')
|
||||
t.equal(getAbi('0.11.7'), '0x000C')
|
||||
t.equal(getAbi('0.11.0'), '0x000C')
|
||||
t.equal(getAbi('0.10.48'), '11')
|
||||
t.equal(getAbi('0.10.30'), '11')
|
||||
t.equal(getAbi('0.10.4'), '11')
|
||||
t.equal(getAbi('0.10.3'), '0x000B')
|
||||
t.equal(getAbi('0.10.1'), '0x000B')
|
||||
t.equal(getAbi('0.10.0'), '0x000B')
|
||||
t.equal(getAbi('0.9.12'), '0x000B')
|
||||
t.equal(getAbi('0.9.9'), '0x000B')
|
||||
t.equal(getAbi('0.9.8'), '0x000A')
|
||||
t.equal(getAbi('0.9.1'), '0x000A')
|
||||
t.equal(getAbi('0.9.0'), '1')
|
||||
t.equal(getAbi('0.8.0'), '1')
|
||||
t.equal(getAbi('0.2.0'), '1')
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('getAbi calculates correct Electron ABI', function (t) {
|
||||
t.throws(function () { getAbi(undefined, 'electron') })
|
||||
t.throws(function () { getAbi(getNextTarget('electron'), 'electron') })
|
||||
t.equal(getAbi('1.4.0', 'electron'), '50')
|
||||
t.equal(getAbi('1.3.0', 'electron'), '49')
|
||||
t.equal(getAbi('1.2.0', 'electron'), '48')
|
||||
t.equal(getAbi('1.1.0', 'electron'), '48')
|
||||
t.equal(getAbi('1.0.0', 'electron'), '47')
|
||||
t.equal(getAbi('0.37.0', 'electron'), '47')
|
||||
t.equal(getAbi('0.36.0', 'electron'), '47')
|
||||
t.equal(getAbi('0.35.0', 'electron'), '46')
|
||||
t.equal(getAbi('0.34.0', 'electron'), '46')
|
||||
t.equal(getAbi('0.33.0', 'electron'), '46')
|
||||
t.equal(getAbi('0.32.0', 'electron'), '45')
|
||||
t.equal(getAbi('0.31.0', 'electron'), '45')
|
||||
t.equal(getAbi('0.30.0', 'electron'), '44')
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('getAbi supports leading v', function (t) {
|
||||
t.equal(getAbi('v7.2.0'), '51')
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('getAbi returns abi if passed as target', function (t) {
|
||||
t.equal(getAbi('57'), '57')
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('allTargets are sorted', function (t) {
|
||||
var electron = allTargets.filter(function (t) { return t.runtime === 'electron' })
|
||||
var node = allTargets.filter(function (t) { return t.runtime === 'node' })
|
||||
function sort (t1, t2) {
|
||||
return semver.compare(t1.target, t2.target)
|
||||
}
|
||||
|
||||
t.deepEqual(electron, electron.slice().sort(sort))
|
||||
t.deepEqual(node, node.slice().sort(sort))
|
||||
t.end()
|
||||
})
|
||||
Reference in New Issue
Block a user