Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Release
on:
push: { tags: 'v[0-9]+.[0-9]+.[0-9]+*' }

permissions: {contents: write, id-token: write}
push: { tags: "v[0-9]+.[0-9]+.[0-9]+*" }

permissions: {}
jobs:
release:
uses: nodenv/.github/.github/workflows/release.yml@v4
permissions: { contents: write, id-token: write }
uses: nodenv/.github/.github/workflows/release.yml@v6
secrets: inherit
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: Test
on:
push:
pull_request:
schedule: [{ cron: "0 0 10 * *" }] # monthly https://crontab.guru/#0_0_10_*_*
workflow_dispatch:
schedule: [{cron: '0 0 10 * *'}] # monthly https://crontab.guru/#0_0_10_*_*

permissions: read-all

permissions: {}
jobs:
test:
uses: nodenv/.github/.github/workflows/test.yml@v4
uses: nodenv/.github/.github/workflows/test.yml@v6
with: { npm: false }
permissions:
contents: read
packages: read
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/node_modules
/package*/
/tmp

/nodenv-node-build-update-defs-*.tgz

# normally, it's okay for node-version to be committed
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ create [node-build][]-compatible definitions from [nodejs.org](https://nodejs.or
<!-- toc -->

- [Installation](#installation)
* [Installing with Git](#installing-with-git)
* [Installing with Homebrew](#installing-with-homebrew)
* [Installation with npm](#installation-with-npm)
- [Installing with Git](#installing-with-git)
- [Installing with Homebrew](#installing-with-homebrew)
- [Installation with npm](#installation-with-npm)
- [Requirements](#requirements)
- [Usage](#usage)
* [Special environment variables](#special-environment-variables)
- [Special environment variables](#special-environment-variables)
- [Cleanup/Pruning](#cleanuppruning)

<!-- tocstop -->

## Installation

Recommended installation is via git clone into your nodenv root, as per below.
However, this plugin may also be installed via homebrew or npm.
Recommended installation is via Git clone into your nodenv root, as per below.
However, this plugin may also be installed via Homebrew or npm.
If installed outside of `NODENV_ROOT`, you must ensure its `share/node-build` directory has been added to the `NODE_BUILD_DEFINITIONS` path.

### Installing with Git
Expand Down Expand Up @@ -69,14 +69,14 @@ See [special environment variables](#special-environment-variables)

Only definitions that aren't already in node-build's lookup path (`NODE_BUILD_DEFINITIONS`) will be created.
That is, under typical usage only definitions not already shipped with node-build will be created.
To override this and write definitions for *all* available node/io versions, use `--force`.
To override this and write definitions for _all_ available node/io versions, use `--force`.
(This will overwrite any conflicting definition files that already exist in the destination directory.)

### Special environment variables

- `NODE_BUILD_DEFINITIONS` can be a list of colon-separated paths that get additionally searched when looking up build definitions.
The `share/node-build/` directories of any plugin under `$(nodenv root)/plugins` are appended to this path by `nodenv install` automatically.
Definitions already found in these paths will be skipped (unless `--force`).
The `share/node-build/` directories of any plugin under `$(nodenv root)/plugins` are appended to this path by `nodenv install` automatically.
Definitions already found in these paths will be skipped (unless `--force`).

## Cleanup/Pruning

Expand All @@ -88,8 +88,8 @@ In order to ensure one is frequently running on the "proper" build definitions f

This subcommand removes (or lists with `--dry-run`) any duplicate build definitions.
Like `update-version-defs`, `--destination <dir>` overrides the default value of `<plugin-root>/share/node-build` as the directory from which duplicates are removed.
Duplicates are searched for under `NODE_BUILD_DEFINITIONS` and are determined by both filename *and* contents.
The file contents check can be overridden with `--force`, which will delete duplicates based solely on filename.
Duplicates are searched for under `NODE_BUILD_DEFINITIONS` and are determined by both filename _and_ contents.
The file contents check can be overridden with `--force`, which will delete duplicates based solely on filename.

This subcommand is silent by default, only printing removed duplicates if `--verbose`.
(`--dry-run` implies `--verbose`)
Expand Down
5 changes: 5 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import neostandard from "neostandard";

export default neostandard({
noStyle: true, // compat with prettier
});
60 changes: 30 additions & 30 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
const DefinitionFile = require('./src/definition-file')
const GithubScraper = require('./src/scraper-github')
const NodejsOrgScraper = require('./src/scraper-nodejs_org')
const DefinitionFile = require("./src/definition-file")
const GithubScraper = require("./src/scraper-github")
const NodejsOrgScraper = require("./src/scraper-nodejs_org")

const scrapers = {
nodejs: new NodejsOrgScraper({
displayName: 'nodejs',
baseUri: 'https://nodejs.org/dist/'
displayName: "nodejs",
baseUri: "https://nodejs.org/dist/"
}),

'nodejs-pre': new NodejsOrgScraper({
displayName: 'nodejs release candidate',
baseUri: 'https://nodejs.org/download/rc/'
"nodejs-pre": new NodejsOrgScraper({
displayName: "nodejs release candidate",
baseUri: "https://nodejs.org/download/rc/"
}),

'nodejs-nightly': new NodejsOrgScraper({
displayName: 'nodejs nightly',
baseUri: 'https://nodejs.org/download/nightly/'
"nodejs-nightly": new NodejsOrgScraper({
displayName: "nodejs nightly",
baseUri: "https://nodejs.org/download/nightly/"
}),

chakracore: new NodejsOrgScraper({
name: 'chakracore',
baseUri: 'https://nodejs.org/download/chakracore-release/'
name: "chakracore",
baseUri: "https://nodejs.org/download/chakracore-release/"
}),

'chakracore-pre': new NodejsOrgScraper({
name: 'chakracore',
displayName: 'chakracore release candidate',
baseUri: 'https://nodejs.org/download/chakracore-rc/'
"chakracore-pre": new NodejsOrgScraper({
name: "chakracore",
displayName: "chakracore release candidate",
baseUri: "https://nodejs.org/download/chakracore-rc/"
}),

'chakracore-nightly': new NodejsOrgScraper({
name: 'chakracore',
displayName: 'chakracore nightly',
baseUri: 'https://nodejs.org/download/chakracore-nightly/'
"chakracore-nightly": new NodejsOrgScraper({
name: "chakracore",
displayName: "chakracore nightly",
baseUri: "https://nodejs.org/download/chakracore-nightly/"
}),

graal: new GithubScraper({
name: 'graal+ce',
org: 'oracle',
repo: 'graal',
filterReleases: releases =>
name: "graal+ce",
org: "oracle",
repo: "graal",
filterReleases: (releases) =>
releases
.filter(r => /^vm-/.test(r.tag_name))
.map(r => ({
tag_name: r.tag_name.replace(/^vm-/, ''),
.filter((r) => /^vm-/.test(r.tag_name))
.map((r) => ({
tag_name: r.tag_name.replace(/^vm-/, ""),
assets: r.assets
}))
})
}

module.exports = function scrape (options) {
module.exports = function scrape(options) {
DefinitionFile.configure(options)

options.run.forEach(scraper => scrapers[scraper].scrape(options))
options.run.forEach((scraper) => scrapers[scraper].scrape(options))
}
Loading
Loading