node-bin-gen 12.0.0 → 12.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/sync-node-version.yml +30 -21
- package/index.js +4 -3
- package/node-bin-README.md +10 -0
- package/package.json +6 -4
|
@@ -19,7 +19,7 @@ jobs:
|
|
|
19
19
|
- name: Set up Node.js
|
|
20
20
|
uses: actions/setup-node@v4
|
|
21
21
|
with:
|
|
22
|
-
node-version: '
|
|
22
|
+
node-version: '24.x'
|
|
23
23
|
registry-url: 'https://registry.npmjs.org' # set ~/.npmrc need add repository secrets in the settings
|
|
24
24
|
|
|
25
25
|
- name: Ensure latest npm 11
|
|
@@ -30,36 +30,45 @@ jobs:
|
|
|
30
30
|
|
|
31
31
|
- name: Fetch Node.js versions released in the last 30 days
|
|
32
32
|
run: |
|
|
33
|
-
|
|
33
|
+
set -x
|
|
34
34
|
DATE_30_DAYS_AGO=$(date --date='30 days ago' +%Y-%m-%d)
|
|
35
|
-
curl -s https://nodejs.org/dist/index.json | jq --arg DATE "$DATE_30_DAYS_AGO" -r '.[] | select(.date >= $DATE) | .version' > versions.txt
|
|
35
|
+
curl -s https://nodejs.org/dist/index.json | jq --arg DATE "$DATE_30_DAYS_AGO" -r '.[] | select(.date >= $DATE) | .version' | sed -e 's@^v@@g' | sort > versions.txt
|
|
36
36
|
echo "Node.js versions released in the last 30 days:"
|
|
37
37
|
cat versions.txt
|
|
38
|
-
#set +x
|
|
39
38
|
|
|
40
39
|
- name: Check each version and sync if not published
|
|
41
40
|
run: |
|
|
42
|
-
|
|
41
|
+
set -x
|
|
43
42
|
while IFS= read -r VERSION; do
|
|
44
43
|
echo "Checking version $VERSION..."
|
|
45
44
|
if [ -z "$(npm view node@$VERSION)" ]; then
|
|
46
|
-
echo "Version $VERSION is not published on npm.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
45
|
+
echo "Version $VERSION is not published on npm."
|
|
46
|
+
(
|
|
47
|
+
mkdir -p "target/$VERSION" && cd "target/$VERSION"
|
|
48
|
+
node ../../index.js $VERSION
|
|
49
|
+
for dir in */ ; do
|
|
50
|
+
pkg="$(cat $dir/package.json | jq -r .name)"
|
|
51
|
+
if [ -z "$(npm view $pkg@$VERSION)" ]; then
|
|
52
|
+
echo "$pkg has not been published."
|
|
53
|
+
echo "Publishing directory: $dir"
|
|
54
|
+
npm view $pkg version | IFS=. read MAJOR MINOR PATCH
|
|
55
|
+
echo $VERSION | IFS=. read NEWMAJ NEWMIN NEWPATCH
|
|
56
|
+
if [ $NEWMAJOR -gt $MAJOR ] || [ $NEWMAJOR = $MAJOR -a $NEWMINOR -gt $MINOR ] || [ $NEWMAJOR = $MAJOR -a $NEWMINOR = $MINOR -a $NEWPATCH -gt $PATCH ]; then
|
|
57
|
+
TAG=latest
|
|
58
|
+
else
|
|
59
|
+
TAG=v$NEWMAJOR-latest
|
|
60
|
+
fi
|
|
61
|
+
(
|
|
62
|
+
cd "$dir"
|
|
63
|
+
npm publish --tag="$TAG"
|
|
64
|
+
# npm publish --dry-run
|
|
65
|
+
)
|
|
66
|
+
else
|
|
67
|
+
echo "$pkg@$VERSION is already published on npm. Skipping."
|
|
68
|
+
fi
|
|
69
|
+
done
|
|
70
|
+
)
|
|
61
71
|
else
|
|
62
72
|
echo "Version $VERSION is already published on npm. Skipping."
|
|
63
73
|
fi
|
|
64
74
|
done < versions.txt
|
|
65
|
-
#set +x
|
package/index.js
CHANGED
|
@@ -76,14 +76,15 @@ async function buildArchPackage(os, cpu, version, pre) {
|
|
|
76
76
|
os +
|
|
77
77
|
"-" +
|
|
78
78
|
cpu,
|
|
79
|
-
version: version + (pre != null ? "-" + pre : ""),
|
|
79
|
+
version: version.replace(/^v/, "") + (pre != null ? "-" + pre : ""),
|
|
80
80
|
description: "node",
|
|
81
81
|
repository: {
|
|
82
|
-
url: "https://github.com/aredridel/node-bin-gen"
|
|
82
|
+
url: "git+https://github.com/aredridel/node-bin-gen.git"
|
|
83
83
|
},
|
|
84
84
|
bin: {
|
|
85
85
|
node: executable,
|
|
86
86
|
},
|
|
87
|
+
license: "MIT",
|
|
87
88
|
files: [
|
|
88
89
|
os == "win" ? "bin/node.exe" : "bin/node",
|
|
89
90
|
"share",
|
|
@@ -274,7 +275,7 @@ async function buildMetapackage(version) {
|
|
|
274
275
|
dependencies: {
|
|
275
276
|
"node-bin-setup": "^1.0.0",
|
|
276
277
|
},
|
|
277
|
-
license: "
|
|
278
|
+
license: "MIT",
|
|
278
279
|
author: "",
|
|
279
280
|
engines: {
|
|
280
281
|
npm: ">=5.0.0",
|
package/node-bin-README.md
CHANGED
|
@@ -12,6 +12,16 @@ Use
|
|
|
12
12
|
npm i ${packagename}@lts
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
> **Note:** This package uses a `preinstall` script to download the correct binary for your platform. Newer versions of npm block install scripts by default. If installation fails or the `node` binary is missing, add the following to your `package.json` and reinstall:
|
|
16
|
+
>
|
|
17
|
+
> ```json
|
|
18
|
+
> {
|
|
19
|
+
> "allowScripts": ["${packagename}"]
|
|
20
|
+
> }
|
|
21
|
+
> ```
|
|
22
|
+
>
|
|
23
|
+
> Or run `npm approve-scripts` after installation.
|
|
24
|
+
|
|
15
25
|
Use with `npx`
|
|
16
26
|
--------------
|
|
17
27
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-bin-gen",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.1.0",
|
|
4
4
|
"description": "Generate a node binary package",
|
|
5
5
|
"author": "Aria Stewart <aredridel@dinhe.net>",
|
|
6
6
|
"main": "index.js",
|
|
7
|
-
"bin": "index.js",
|
|
8
7
|
"license": "ISC",
|
|
9
8
|
"repository": {
|
|
10
9
|
"type": "git",
|
|
@@ -40,6 +39,9 @@
|
|
|
40
39
|
}
|
|
41
40
|
},
|
|
42
41
|
"devDependencies": {
|
|
43
|
-
"eslint": "^
|
|
42
|
+
"eslint": "^10.0.2"
|
|
43
|
+
},
|
|
44
|
+
"bin": {
|
|
45
|
+
"node-bin-gen": "index.js"
|
|
44
46
|
}
|
|
45
|
-
}
|
|
47
|
+
}
|