Skip to content

Commit c537210

Browse files
committed
build: fix issues with module resolution
This is not a bug with the TypeScript compiler but a "feature"... See microsoft/TypeScript#49160 See ajv-validator/ajv#2047
1 parent 2c4e540 commit c537210

File tree

6 files changed

+15
-14
lines changed

6 files changed

+15
-14
lines changed

bin/octokit-webhooks.mts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env ts-node-transpile-only
22

33
import yargs from "yargs";
4+
import type { Options as yargsOptions, Arguments } from "yargs";
45
import { hideBin } from "yargs/helpers";
56
import { checkOrUpdateWebhooks } from "../lib/index.mjs";
67

@@ -11,7 +12,7 @@ interface Options {
1112
updateAll?: boolean;
1213
}
1314

14-
const options: Record<string, yargs.Options> = {
15+
const options: Record<string, yargsOptions> = {
1516
cached: {
1617
describe: "Load HTML from local cache",
1718
type: "boolean",
@@ -52,7 +53,7 @@ const {
5253
.alias("h", ["help", "usage"])
5354
.demandCommand(1, "")
5455
.scriptName("bin/octokit-webhooks")
55-
.usage("$0 <command> [--cached]").argv as yargs.Arguments<Options>;
56+
.usage("$0 <command> [--cached]").argv as Arguments<Options>;
5657

5758
if (!["update", "check"].includes(command.toString())) {
5859
console.log(`"${command}" must be one of: update, check`);

bin/validate-schema.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import { parseArgv } from "./utils/index.mjs";
1010
const __filename = fileURLToPath(import.meta.url);
1111
const [, {}] = parseArgv(__filename, [], []);
1212

13-
const ajv = new Ajv({ strict: true });
13+
const ajv = new Ajv.default({ strict: true });
1414

15-
addFormats(ajv);
15+
addFormats.default(ajv);
1616
ajv.addKeyword("tsAdditionalProperties");
1717

1818
const __dirname = fileURLToPath(new URL(".", import.meta.url));

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"ajv-formats": "^2.1.1",
8080
"cheerio": "^1.0.0-rc.10",
8181
"fast-deep-equal": "^3.1.3",
82-
"got": "^12.6.1",
82+
"got": "^13.0.0",
8383
"json-diff": "^1.0.0",
8484
"json-schema-to-typescript": "^13.0.0",
8585
"prettier": "3.0.3",

payload-schemas/index.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import { readFileSync, readdirSync } from "fs";
44
import { resolve } from "path";
55
import { fileURLToPath } from "url";
66

7-
export const ajv = new Ajv({
7+
export const ajv = new Ajv.default({
88
strict: true,
99
strictTypes: true,
1010
strictTuples: true,
1111
});
1212

13-
addFormats(ajv);
13+
addFormats.default(ajv);
1414

1515
const __dirname = fileURLToPath(new URL('.', import.meta.url));
1616
const schemaDir = resolve(__dirname, "api.github.com");

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"compilerOptions": {
33
"target": "es2019",
4-
"module": "ESNext",
5-
"moduleResolution": "node",
4+
"module": "Node16",
5+
"moduleResolution": "node16",
66
"lib": ["es2020"],
77
"rootDir": "./",
88
"allowJs": true,

0 commit comments

Comments
 (0)