Dep update

This commit is contained in:
2025-04-08 22:00:41 +02:00
committed by Philipp Horstenkamp
parent f79e41cbfe
commit 78549e06b4
966 changed files with 43637 additions and 158248 deletions

View File

@ -1,41 +0,0 @@
name: Auto-update ABI JSON file
on:
schedule:
- cron: '0 * * * *'
jobs:
autoupdate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v1
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm install --no-package-lock
- name: Update ABI registry
run: npm run update-abi-registry
- name: Commit Changes to ABI registry
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "machine github.com login $GITHUB_ACTOR password $GITHUB_TOKEN" > ~/.netrc
chmod 600 ~/.netrc
git add abi_registry.json
if test -n "$(git status -s)"; then
git config user.name "GitHub Actions"
git config user.email "github-actions@users.noreply.github.com"
git diff --cached
git commit -m "feat: update ABI registry"
git push origin HEAD:$GITHUB_REF
else
echo No update needed
fi

17
node_modules/node-abi/.travis.yml generated vendored
View File

@ -1,17 +0,0 @@
language: node_js
cache:
directories:
- ~/.npm
notifications:
email: false
node_js:
- '14'
- '12'
- '10'
- '9'
- '8'
after_success:
- npm run travis-deploy-once "npm run semantic-release"
branches:
except:
- /^v\d+\.\d+\.\d+$/

View File

@ -1,73 +0,0 @@
# 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

View File

@ -1,53 +0,0 @@
# 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
node_modules/node-abi/LICENSE generated vendored
View File

@ -1,21 +0,0 @@
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.

50
node_modules/node-abi/README.md generated vendored
View File

@ -1,50 +0,0 @@
# Node.js ABI
[![Build Status](https://travis-ci.org/lgeiger/node-abi.svg?branch=v1.0.0)](https://travis-ci.org/lgeiger/node-abi) [![Greenkeeper badge](https://badges.greenkeeper.io/lgeiger/node-abi.svg)](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.additionalTargets
nodeAbi.futureTargets
// ...
```
## References
- https://github.com/lgeiger/electron-abi
- https://nodejs.org/en/download/releases/
- https://github.com/nodejs/Release

View File

@ -1,144 +0,0 @@
[
{
"runtime": "node",
"target": "11.0.0",
"lts": false,
"future": false,
"abi": "67"
},
{
"runtime": "node",
"target": "12.0.0",
"lts": [
"2019-10-21",
"2020-11-30"
],
"future": false,
"abi": "72"
},
{
"runtime": "node",
"target": "13.0.0",
"lts": false,
"future": false,
"abi": "79"
},
{
"runtime": "node",
"target": "14.0.0",
"lts": [
"2020-10-27",
"2021-10-19"
],
"future": false,
"abi": "83"
},
{
"runtime": "node",
"target": "15.0.0",
"lts": false,
"future": false,
"abi": "88"
},
{
"runtime": "node",
"target": "16.0.0",
"lts": [
"2021-10-26",
"2022-10-18"
],
"future": false,
"abi": "93"
},
{
"abi": "70",
"future": false,
"lts": false,
"runtime": "electron",
"target": "5.0.0-beta.9"
},
{
"abi": "73",
"future": false,
"lts": false,
"runtime": "electron",
"target": "6.0.0-beta.1"
},
{
"abi": "75",
"future": false,
"lts": false,
"runtime": "electron",
"target": "7.0.0-beta.1"
},
{
"abi": "76",
"future": false,
"lts": false,
"runtime": "electron",
"target": "8.0.0-beta.1"
},
{
"abi": "76",
"future": false,
"lts": false,
"runtime": "electron",
"target": "9.0.0-beta.1"
},
{
"abi": "80",
"future": false,
"lts": false,
"runtime": "electron",
"target": "9.0.0-beta.2"
},
{
"abi": "82",
"future": false,
"lts": false,
"runtime": "electron",
"target": "10.0.0-beta.1"
},
{
"abi": "82",
"future": false,
"lts": false,
"runtime": "electron",
"target": "11.0.0-beta.1"
},
{
"abi": "85",
"future": false,
"lts": false,
"runtime": "electron",
"target": "11.0.0-beta.11"
},
{
"abi": "87",
"future": false,
"lts": false,
"runtime": "electron",
"target": "12.0.0-beta.1"
},
{
"abi": "89",
"future": false,
"lts": false,
"runtime": "electron",
"target": "14.0.0-beta.1"
},
{
"abi": "89",
"future": false,
"lts": false,
"runtime": "electron",
"target": "13.0.0-beta.2"
},
{
"abi": "89",
"future": true,
"lts": false,
"runtime": "electron",
"target": "15.0.0-alpha.1"
}
]

176
node_modules/node-abi/index.js generated vendored
View File

@ -1,176 +0,0 @@
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'
var next = semver.inc(latest.target, increment)
// Electron releases appear in the registry in their beta form, sometimes there is
// no active beta line. During this time we need to double bump
if (runtime === 'electron' && semver.parse(latest.target).prerelease.length) {
next = semver.inc(next, 'major')
}
return next
}
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) {
var betaSeparatorIndex = match[0].indexOf("-")
return betaSeparatorIndex > -1
? match[0].substring(0, betaSeparatorIndex)
: match[0]
}
throw new Error('Could not detect target for abi ' + abi + ' and runtime ' + runtime)
}
function sortByTargetFn (a, b) {
var abiComp = Number(a.abi) - Number(b.abi)
if (abiComp !== 0) return abiComp
if (a.target < b.target) return -1
if (a.target > b.target) return 1
return 0
}
function loadGeneratedTargets () {
var registry = require('./abi_registry.json')
var targets = {
supported: [],
additional: [],
future: []
}
registry.forEach(function (item) {
var target = {
runtime: item.runtime,
target: item.target,
abi: item.abi
}
if (item.lts) {
var startDate = new Date(Date.parse(item.lts[0]))
var endDate = new Date(Date.parse(item.lts[1]))
var currentDate = new Date()
target.lts = startDate < currentDate && currentDate < endDate
} else {
target.lts = false
}
if (target.runtime === 'node-webkit') {
targets.additional.push(target)
} else if (item.future) {
targets.future.push(target)
} else {
targets.supported.push(target)
}
})
targets.supported.sort(sortByTargetFn)
targets.additional.sort(sortByTargetFn)
targets.future.sort(sortByTargetFn)
return targets
}
var generatedTargets = loadGeneratedTargets()
var supportedTargets = [
{runtime: 'node', target: '5.0.0', abi: '47', lts: false},
{runtime: 'node', target: '6.0.0', abi: '48', lts: false},
{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: false},
{runtime: 'node', target: '10.0.0', abi: '64', lts: new Date(2018, 10, 1) < new Date() && new Date() < new Date(2020, 4, 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},
{runtime: 'electron', target: '2.0.0', abi: '57', lts: false},
{runtime: 'electron', target: '3.0.0', abi: '64', lts: false},
{runtime: 'electron', target: '4.0.0', abi: '64', lts: false},
{runtime: 'electron', target: '4.0.4', abi: '69', lts: false}
]
supportedTargets.push.apply(supportedTargets, generatedTargets.supported)
var additionalTargets = [
{runtime: 'node-webkit', target: '0.13.0', abi: '47', lts: false},
{runtime: 'node-webkit', target: '0.15.0', abi: '48', lts: false},
{runtime: 'node-webkit', target: '0.18.3', abi: '51', lts: false},
{runtime: 'node-webkit', target: '0.23.0', abi: '57', lts: false},
{runtime: 'node-webkit', target: '0.26.5', abi: '59', lts: false}
]
additionalTargets.push.apply(additionalTargets, generatedTargets.additional)
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: 'node', target: '4.0.0', abi: '46', 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 = generatedTargets.future
var allTargets = deprecatedTargets
.concat(supportedTargets)
.concat(additionalTargets)
.concat(futureTargets)
exports.getAbi = getAbi
exports.getTarget = getTarget
exports.deprecatedTargets = deprecatedTargets
exports.supportedTargets = supportedTargets
exports.additionalTargets = additionalTargets
exports.futureTargets = futureTargets
exports.allTargets = allTargets
exports._getNextTarget = getNextTarget

38
node_modules/node-abi/package.json generated vendored
View File

@ -1,38 +0,0 @@
{
"name": "node-abi",
"version": "2.30.1",
"description": "Get the Node ABI for a given target and runtime, and vice versa.",
"main": "index.js",
"scripts": {
"semantic-release": "semantic-release",
"test": "tape test/index.js",
"travis-deploy-once": "travis-deploy-once",
"update-abi-registry": "node --unhandled-rejections=strict scripts/update-abi-registry.js"
},
"repository": {
"type": "git",
"url": "https://github.com/lgeiger/node-abi.git"
},
"keywords": [
"node",
"electron",
"node_module_version",
"abi",
"v8"
],
"author": "Lukas Geiger",
"license": "MIT",
"bugs": {
"url": "https://github.com/lgeiger/node-abi/issues"
},
"homepage": "https://github.com/lgeiger/node-abi#readme",
"devDependencies": {
"got": "^10.6.0",
"semantic-release": "^15.8.0",
"tape": "^4.6.3",
"travis-deploy-once": "^5.0.1"
},
"dependencies": {
"semver": "^5.4.1"
}
}

View File

@ -1,119 +0,0 @@
const got = require('got')
const path = require('path')
const semver = require('semver')
const { writeFile } = require('fs').promises
async function getJSONFromCDN (urlPath) {
const response = await got(`https://cdn.jsdelivr.net/gh/${urlPath}`)
return JSON.parse(response.body)
}
async function fetchElectronReleases () {
const response = await got(`https://electronjs.org/headers/index.json`)
return JSON.parse(response.body)
}
async function fetchNodeVersions () {
const schedule = await getJSONFromCDN('nodejs/Release/schedule.json')
const versions = {}
for (const [majorVersion, metadata] of Object.entries(schedule)) {
if (majorVersion.startsWith('v0')) {
continue
}
const version = `${majorVersion.slice(1)}.0.0`
const lts = metadata.hasOwnProperty('lts') ? [metadata.lts, metadata.maintenance] : false
versions[version] = {
runtime: 'node',
target: version,
lts: lts,
future: new Date(Date.parse(metadata.start)) > new Date()
}
}
return versions
}
async function fetchAbiVersions () {
return (await getJSONFromCDN('nodejs/node/doc/abi_version_registry.json'))
.NODE_MODULE_VERSION
.filter(({ modules }) => modules > 66)
}
function electronReleasesToTargets (releases) {
const versions = releases.map(({ version }) => version)
const versionsByModules = releases
.filter(release => Number(release.modules) >= 70)
.map(({ version, modules }) => ({
version,
modules,
}))
.filter(({ version }) => !version.includes('nightly'))
.sort((a, b) => Number(a.modules) - Number(b.modules))
.reduce(
(acc, { modules, version }) => ({
...acc,
[`${version.split('.')[0]}-${modules}`]: {
version,
modules,
}
}),
{}
)
return Object.entries(versionsByModules)
.map(
([major, {version, modules}]) => ({
abi: modules,
future: !versions.find(
v => {
const major = version.split(".")[0]
return semver.satisfies(
v,
/^[0-9]/.test(major) ? `>= ${major}` : major
)
}
),
lts: false,
runtime: 'electron',
target: version
})
)
}
function nodeVersionsToTargets (abiVersions, nodeVersions) {
return Object.values(
abiVersions
.filter(({ runtime }) => runtime === 'node')
.reduce(
(acc, abiVersion) => {
const { version: nodeVersion } = semver.coerce(abiVersion.versions)
return {
[nodeVersion]: {
...nodeVersions[nodeVersion],
abi: abiVersion.modules.toString(),
},
...acc,
};
},
{}
)
)
}
async function main () {
const nodeVersions = await fetchNodeVersions()
const abiVersions = await fetchAbiVersions()
const electronReleases = await fetchElectronReleases()
const electronTargets = electronReleasesToTargets(electronReleases)
const nodeTargets = nodeVersionsToTargets(abiVersions, nodeVersions)
const supportedTargets = [
...nodeTargets,
...electronTargets,
]
await writeFile(path.resolve(__dirname, '..', 'abi_registry.json'), JSON.stringify(supportedTargets, null, 2))
}
main()

174
node_modules/node-abi/test/index.js generated vendored
View File

@ -1,174 +0,0 @@
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 unsupported 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.equal(getTarget('67'), '11.0.0')
t.equal(getTarget('72'), '12.0.0')
t.equal(getTarget('83'), '14.0.0')
t.equal(getTarget('88'), '15.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.equal(getTarget('76', 'electron'), '8.0.0')
t.equal(getTarget('82', 'electron'), '10.0.0')
t.end()
})
test('getTarget calculates correct Node-Webkit target', function (t) {
t.throws(getTarget.bind(null, '14', 'ode-webkit'))
t.equal(getTarget('47', 'node-webkit'), '0.13.0')
t.equal(getTarget('48', 'node-webkit'), '0.15.0')
t.equal(getTarget('51', 'node-webkit'), '0.18.3')
t.equal(getTarget('57', 'node-webkit'), '0.23.0')
t.equal(getTarget('59', 'node-webkit'), '0.26.5')
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('15.0.0'), '88')
t.equal(getAbi('14.0.0'), '83')
t.equal(getAbi('13.0.0'), '79')
t.equal(getAbi('12.0.0'), '72')
t.equal(getAbi('11.0.0'), '67')
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('10.0.0-beta.1', 'electron'), '82')
t.equal(getAbi('10.0.0', 'electron'), '82')
t.equal(getAbi('9.0.0', 'electron'), '80')
t.equal(getAbi('8.0.0', 'electron'), '76')
t.equal(getAbi('7.0.0', 'electron'), '75')
t.equal(getAbi('6.0.0', 'electron'), '73')
t.equal(getAbi('5.0.0', 'electron'), '70')
t.equal(getAbi('4.1.4', 'electron'), '69')
t.equal(getAbi('4.0.4', 'electron'), '69')
t.equal(getAbi('4.0.3', 'electron'), '64')
t.equal(getAbi('3.1.8', 'electron'), '64')
t.equal(getAbi('2.0.18', 'electron'), '57')
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 calculates correct Node-Webkit ABI', function (t) {
t.throws(function () { getAbi(undefined, 'node-webkit') })
t.throws(function () { getAbi(getNextTarget('node-webkit'), 'node-webkit') })
t.equal(getAbi('0.13.0', 'node-webkit'), '47')
t.equal(getAbi('0.14.0', 'node-webkit'), '47')
t.equal(getAbi('0.15.0', 'node-webkit'), '48')
t.equal(getAbi('0.16.0', 'node-webkit'), '48')
t.equal(getAbi('0.17.0', 'node-webkit'), '48')
t.equal(getAbi('0.18.2', 'node-webkit'), '48')
t.equal(getAbi('0.18.3', 'node-webkit'), '51')
t.equal(getAbi('0.19.0', 'node-webkit'), '51')
t.equal(getAbi('0.20.0', 'node-webkit'), '51')
t.equal(getAbi('0.21.0', 'node-webkit'), '51')
t.equal(getAbi('0.22.0', 'node-webkit'), '51')
t.equal(getAbi('0.23.0', 'node-webkit'), '57')
t.equal(getAbi('0.24.0', 'node-webkit'), '57')
t.equal(getAbi('0.25.0', 'node-webkit'), '57')
t.equal(getAbi('0.26.4', 'node-webkit'), '57')
t.equal(getAbi('0.26.5', 'node-webkit'), '59')
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' })
var nodeWebkit = allTargets.filter(function (t) { return t.runtime === 'node-webkit' })
function sort (t1, t2) {
return semver.compare(t1.target, t2.target)
}
t.deepEqual(electron, electron.slice().sort(sort), 'electron targets are sorted')
t.deepEqual(node, node.slice().sort(sort), 'node targets are sorted')
t.deepEqual(nodeWebkit, nodeWebkit.slice().sort(sort), 'node-webkit targets are sorted')
t.end()
})