Skip to content

Commit 3771885

Browse files
authored
Merge pull request vlang#11 from cadamsdev/bump-node-version
chore: Bump node to v24
2 parents 0a679bf + ed0be93 commit 3771885

File tree

10 files changed

+3286
-3076
lines changed

10 files changed

+3286
-3076
lines changed

.eslintrc.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"camelcase": "off",
2121
"@typescript-eslint/consistent-type-assertions": "error",
2222
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
23-
"@typescript-eslint/func-call-spacing": ["error", "never"],
2423
"@typescript-eslint/no-array-constructor": "error",
2524
"@typescript-eslint/no-empty-interface": "error",
2625
"@typescript-eslint/no-explicit-any": "error",
@@ -42,8 +41,6 @@
4241
"@typescript-eslint/require-array-sort-compare": "error",
4342
"@typescript-eslint/restrict-plus-operands": "error",
4443
"semi": "off",
45-
"@typescript-eslint/semi": ["error", "never"],
46-
"@typescript-eslint/type-annotation-spacing": "error",
4744
"@typescript-eslint/unbound-method": "error",
4845
"@typescript-eslint/ban-ts-comment": [
4946
"error",
@@ -58,4 +55,4 @@
5855
"es6": true,
5956
"jest/globals": true
6057
}
61-
}
58+
}

.github/workflows/check-dist.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
steps:
2525
- uses: actions/checkout@v4
2626

27-
- name: Set Node.js 12.x
28-
uses: actions/setup-node@v4
27+
- name: Setup Node
28+
uses: actions/setup-node@v6
2929
with:
30-
node-version: 20
30+
node-version: 24
3131

3232
- name: Install dependencies
3333
run: npm ci

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
- uses: actions/setup-node@v6
1919
with:
20-
node-version: '20'
20+
node-version: 24
2121
cache: 'npm'
2222

2323
- name: Install dependencies

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20.10.0
1+
v24

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ outputs:
3737
architecture:
3838
description: 'Architecture that was used to install V'
3939
runs:
40-
using: 'node20'
40+
using: 'node24'
4141
main: 'dist/index.js'
4242
post: 'dist/index.js'

lib/main.js

Lines changed: 71 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
1515
}) : function(o, v) {
1616
o["default"] = v;
1717
});
18-
var __importStar = (this && this.__importStar) || function (mod) {
19-
if (mod && mod.__esModule) return mod;
20-
var result = {};
21-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22-
__setModuleDefault(result, mod);
23-
return result;
24-
};
25-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27-
return new (P || (P = Promise))(function (resolve, reject) {
28-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31-
step((generator = generator.apply(thisArg, _arguments || [])).next());
32-
});
33-
};
18+
var __importStar = (this && this.__importStar) || (function () {
19+
var ownKeys = function(o) {
20+
ownKeys = Object.getOwnPropertyNames || function (o) {
21+
var ar = [];
22+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23+
return ar;
24+
};
25+
return ownKeys(o);
26+
};
27+
return function (mod) {
28+
if (mod && mod.__esModule) return mod;
29+
var result = {};
30+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31+
__setModuleDefault(result, mod);
32+
return result;
33+
};
34+
})();
3435
Object.defineProperty(exports, "__esModule", { value: true });
35-
exports.cleanup = exports.execer = void 0;
36+
exports.execer = void 0;
37+
exports.cleanup = cleanup;
3638
const core = __importStar(require("@actions/core"));
3739
const cp = __importStar(require("child_process"));
3840
const fs = __importStar(require("fs"));
@@ -43,56 +45,51 @@ const tc = __importStar(require("@actions/tool-cache"));
4345
const util = __importStar(require("util"));
4446
const state_helper_1 = require("./state-helper");
4547
exports.execer = util.promisify(cp.exec);
46-
function run() {
47-
return __awaiter(this, void 0, void 0, function* () {
48-
try {
49-
//
50-
// Version is optional. If supplied, install / use from the tool cache
51-
// If not supplied then task is still used to setup proxy, auth, etc...
52-
//
53-
const version = resolveVersionInput();
54-
let arch = core.getInput('architecture');
55-
// if architecture supplied but version is not
56-
// if we don't throw a warning, the already installed x64 node will be used which is not probably what user meant.
57-
if (arch && !version) {
58-
core.warning('`architecture` is provided but `version` is missing. In this configuration, the version/architecture of Node will not be changed. To fix this, provide `architecture` in combination with `version`');
59-
}
60-
if (!arch) {
61-
arch = os.arch();
62-
}
63-
const token = core.getInput('token', { required: true });
64-
const stable = strToBoolean(core.getInput('stable') || 'false');
65-
const checkLatest = strToBoolean(core.getInput('check-latest') || 'false');
66-
const binPath = yield installer.getVlang({
67-
authToken: token,
68-
version,
69-
checkLatest,
70-
stable,
71-
arch
72-
});
73-
core.info('Adding v to the cache...');
74-
const installedVersion = yield getVersion(binPath);
75-
const cachedPath = yield tc.cacheDir(binPath, 'v', installedVersion);
76-
core.info(`Cached v to: ${cachedPath}`);
77-
core.addPath(cachedPath);
78-
const vBinPath = path.join(binPath, 'v');
79-
core.setOutput('bin-path', binPath);
80-
core.setOutput('v-bin-path', vBinPath);
81-
core.setOutput('version', installedVersion);
82-
core.setOutput('architecture', arch);
48+
async function run() {
49+
try {
50+
//
51+
// Version is optional. If supplied, install / use from the tool cache
52+
// If not supplied then task is still used to setup proxy, auth, etc...
53+
//
54+
const version = resolveVersionInput();
55+
let arch = core.getInput('architecture');
56+
// if architecture supplied but version is not
57+
// if we don't throw a warning, the already installed x64 node will be used which is not probably what user meant.
58+
if (arch && !version) {
59+
core.warning('`architecture` is provided but `version` is missing. In this configuration, the version/architecture of Node will not be changed. To fix this, provide `architecture` in combination with `version`');
8360
}
84-
catch (error) {
85-
if (error instanceof Error)
86-
core.setFailed(error.message);
61+
if (!arch) {
62+
arch = os.arch();
8763
}
88-
});
64+
const token = core.getInput('token', { required: true });
65+
const stable = strToBoolean(core.getInput('stable') || 'false');
66+
const checkLatest = strToBoolean(core.getInput('check-latest') || 'false');
67+
const binPath = await installer.getVlang({
68+
authToken: token,
69+
version,
70+
checkLatest,
71+
stable,
72+
arch
73+
});
74+
core.info('Adding v to the cache...');
75+
const installedVersion = await getVersion(binPath);
76+
const cachedPath = await tc.cacheDir(binPath, 'v', installedVersion);
77+
core.info(`Cached v to: ${cachedPath}`);
78+
core.addPath(cachedPath);
79+
const vBinPath = path.join(binPath, 'v');
80+
core.setOutput('bin-path', binPath);
81+
core.setOutput('v-bin-path', vBinPath);
82+
core.setOutput('version', installedVersion);
83+
core.setOutput('architecture', arch);
84+
}
85+
catch (error) {
86+
if (error instanceof Error)
87+
core.setFailed(error.message);
88+
}
8989
}
90-
function cleanup() {
91-
return __awaiter(this, void 0, void 0, function* () {
92-
// @todo: implement
93-
});
90+
async function cleanup() {
91+
// @todo: implement
9492
}
95-
exports.cleanup = cleanup;
9693
function resolveVersionInput() {
9794
let version = core.getInput('version');
9895
const versionFileInput = core.getInput('version-file');
@@ -121,19 +118,17 @@ function strToBoolean(str) {
121118
const falsyValues = ['false', 'no', '0', '', 'undefined', 'null'];
122119
return !falsyValues.includes(str.toLowerCase());
123120
}
124-
function getVersion(binPath) {
125-
return __awaiter(this, void 0, void 0, function* () {
126-
const vBinPath = path.join(binPath, 'v');
127-
const { stdout, stderr } = yield (0, exports.execer)(`${vBinPath} version`);
128-
if (stderr !== '') {
129-
throw new Error(`Unable to get version from ${vBinPath}`);
130-
}
131-
if (stdout !== '') {
132-
return stdout.trim().split(' ')[1];
133-
}
134-
core.warning('Unable to get version from v executable.');
135-
return '0.0.0';
136-
});
121+
async function getVersion(binPath) {
122+
const vBinPath = path.join(binPath, 'v');
123+
const { stdout, stderr } = await (0, exports.execer)(`${vBinPath} version`);
124+
if (stderr !== '') {
125+
throw new Error(`Unable to get version from ${vBinPath}`);
126+
}
127+
if (stdout !== '') {
128+
return stdout.trim().split(' ')[1];
129+
}
130+
core.warning('Unable to get version from v executable.');
131+
return '0.0.0';
137132
}
138133
if (state_helper_1.IS_POST) {
139134
cleanup();

lib/wait.js

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,11 @@
11
"use strict";
2-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4-
return new (P || (P = Promise))(function (resolve, reject) {
5-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8-
step((generator = generator.apply(thisArg, _arguments || [])).next());
9-
});
10-
};
112
Object.defineProperty(exports, "__esModule", { value: true });
12-
exports.wait = void 0;
13-
function wait(milliseconds) {
14-
return __awaiter(this, void 0, void 0, function* () {
15-
return new Promise(resolve => {
16-
if (isNaN(milliseconds)) {
17-
throw new Error('milliseconds not a number');
18-
}
19-
setTimeout(() => resolve('done!'), milliseconds);
20-
});
3+
exports.wait = wait;
4+
async function wait(milliseconds) {
5+
return new Promise(resolve => {
6+
if (isNaN(milliseconds)) {
7+
throw new Error('milliseconds not a number');
8+
}
9+
setTimeout(() => resolve('done!'), milliseconds);
2110
});
2211
}
23-
exports.wait = wait;

0 commit comments

Comments
 (0)