Skip to content

Commit c2ce07a

Browse files
skajicodex
andcommitted
Tighten TypeScript configuration
Co-authored-by: Codex <267193182+codex@users.noreply.github.com>
1 parent bcb7776 commit c2ce07a

4 files changed

Lines changed: 13 additions & 12 deletions

File tree

dist/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22475,8 +22475,8 @@ function endGroup() {
2247522475
issue("endgroup");
2247622476
}
2247722477

22478-
// src/installer.ts
22479-
var path6 = __toESM(require("path"));
22478+
// src/main.ts
22479+
var os7 = __toESM(require("node:os"));
2248022480

2248122481
// node_modules/@actions/tool-cache/lib/tool-cache.js
2248222482
var crypto = __toESM(require("crypto"), 1);
@@ -22839,7 +22839,8 @@ function _getGlobal(key, defaultValue) {
2283922839
}
2284022840

2284122841
// src/installer.ts
22842-
var import_fs2 = require("fs");
22842+
var import_node_fs = require("node:fs");
22843+
var path6 = __toESM(require("node:path"));
2284322844
async function getAllReleases() {
2284422845
const client = new HttpClient("setup-raku", [], {
2284522846
allowRetries: true,
@@ -22886,7 +22887,7 @@ async function getRaku(version, platform3, arch4) {
2288622887
extPath = await extractTar(downloadPath);
2288722888
}
2288822889
let dirname4 = (url.split("/").pop() || "").replace(/\.(tar\.gz|zip)$/, "");
22889-
await import_fs2.promises.access(path6.join(extPath, dirname4)).catch(() => {
22890+
await import_node_fs.promises.access(path6.join(extPath, dirname4)).catch(() => {
2289022891
dirname4 = `rakudo-${ver}`;
2289122892
});
2289222893
const versionWithBuildRev = `${ver}-0${release.build_rev}`;
@@ -22902,7 +22903,6 @@ async function getRaku(version, platform3, arch4) {
2290222903
}
2290322904

2290422905
// src/main.ts
22905-
var os7 = __toESM(require("os"));
2290622906
async function run() {
2290722907
try {
2290822908
const version = getInput("raku-version") || "latest";
@@ -22913,7 +22913,7 @@ async function run() {
2291322913
await exec("raku", ["-V"]);
2291422914
endGroup();
2291522915
} catch (error2) {
22916-
setFailed(error2.message);
22916+
setFailed(error2 instanceof Error ? error2.message : String(error2));
2291722917
}
2291822918
}
2291922919

src/installer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as core from "@actions/core";
22
import * as http from "@actions/http-client";
3-
import * as path from "path";
43
import * as toolCache from "@actions/tool-cache";
5-
import { promises as fs } from "fs";
4+
import { promises as fs } from "node:fs";
5+
import * as path from "node:path";
66

77
export interface Release {
88
arch: string;

src/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as core from "@actions/core";
22
import * as exec from "@actions/exec";
3+
import * as os from "node:os";
34
import * as installer from "./installer.js";
4-
import * as os from "os";
55

66
export async function run(): Promise<void> {
77
try {
@@ -18,7 +18,7 @@ export async function run(): Promise<void> {
1818
core.startGroup("raku -V");
1919
await exec.exec("raku", ["-V"]);
2020
core.endGroup();
21-
} catch (error: any) {
22-
core.setFailed(error.message);
21+
} catch (error: unknown) {
22+
core.setFailed(error instanceof Error ? error.message : String(error));
2323
}
2424
}

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
"lib": [
77
"es2022"
88
],
9+
"types": ["node"],
10+
"rootDir": "./src",
911
"strict": true, /* Enable all strict type-checking options. */
10-
"noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
1112
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
1213
},
1314
"include": ["src/**/*.ts"],

0 commit comments

Comments
 (0)