Skip to content

Commit d3b1caf

Browse files
committed
Use --experimental-transform-types
1 parent 5905657 commit d3b1caf

37 files changed

+142
-122
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
fetch-depth: 1
1313
- uses: actions/setup-node@v3
1414
with:
15-
node-version: 21
15+
node-version: 22
1616
- uses: pnpm/action-setup@v2
1717
with:
1818
version: latest

.github/workflows/deploy-web.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
fetch-depth: 1
1313
- uses: actions/setup-node@v3
1414
with:
15-
node-version: 21
15+
node-version: 22
1616
- uses: pnpm/action-setup@v2
1717
with:
1818
version: latest

.github/workflows/version-or-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
fetch-depth: 1
2121
- uses: actions/setup-node@v3
2222
with:
23-
node-version: 21
23+
node-version: 22
2424
- uses: pnpm/action-setup@v2
2525
with:
2626
version: latest

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@
1111
"build": "pnpm tsc && pnpm -r build",
1212
"format": "prettier --write \"**/*.{ts,json,css}\"",
1313
"test": "pnpm -r test",
14+
"test-js": "pnpm tsc && pnpm -r test-js",
1415
"check-dts": "tsc -p tsconfig.check-dts.json",
1516
"start": "pnpm --filter @arethetypeswrong/web start",
1617
"version": "changeset version && pnpm install --lockfile-only"
1718
},
1819
"devDependencies": {
1920
"@changesets/cli": "^2.27.1",
2021
"prettier": "^3.0.3",
21-
"typescript": "5.6.1-rc"
22+
"typescript": "npm:@typescript-deploys/[email protected]"
2223
},
2324
"engines": {
24-
"node": ">=18",
25+
"node": ">=22",
2526
"pnpm": ">=8"
2627
}
2728
}

packages/cli/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"tsc": "tsc -b",
4141
"local:install": "npm install -g .",
4242
"local:uninstall": "npm uninstall -g @arethetypeswrong/cli",
43-
"test": "tsc -b test && node --test 'test/dist/**/*.test.js'",
43+
"test": "node --experimental-transform-types --conditions=@arethetypeswrong/source --test 'test/**/*.test.ts'",
44+
"test-js": "node --experimental-transform-types --test 'test/**/*.test.ts'",
4445
"prepack": "pnpm tsc"
4546
},
4647
"type": "module",

packages/cli/src/getExitCode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { CheckResult } from "@arethetypeswrong/core";
2-
import { problemFlags } from "./problemUtils.js";
3-
import type { RenderOptions } from "./render/index.js";
2+
import { problemFlags } from "./problemUtils.ts";
3+
import type { RenderOptions } from "./render/index.ts";
44

55
export function getExitCode(analysis: CheckResult, opts?: RenderOptions): number {
66
if (!analysis.types) {

packages/cli/src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import { readFile, stat, unlink } from "fs/promises";
1010
import { createRequire } from "module";
1111
import path from "path";
1212
import readline from "readline";
13-
import { problemFlags } from "./problemUtils.js";
14-
import { readConfig } from "./readConfig.js";
15-
import * as render from "./render/index.js";
13+
import { problemFlags } from "./problemUtils.ts";
14+
import { readConfig } from "./readConfig.ts";
15+
import * as render from "./render/index.ts";
1616
import { major, minor } from "semver";
17-
import { getExitCode } from "./getExitCode.js";
17+
import { getExitCode } from "./getExitCode.ts";
1818

1919
const packageJson = createRequire(import.meta.url)("../package.json");
2020
const version = packageJson.version;
@@ -74,8 +74,8 @@ particularly ESM-related module resolution issues.`,
7474
.option("--exclude-entrypoints <entrypoints...>", "Specify entrypoints to exclude from checking.")
7575
.option(
7676
"--entrypoints-legacy",
77-
'In packages without the `exports` field, every file is an entry point. Specifying this option ' +
78-
'only takes effect when no entrypoints are automatically detected, or explicitly provided with other options.'
77+
"In packages without the `exports` field, every file is an entry point. Specifying this option " +
78+
"only takes effect when no entrypoints are automatically detected, or explicitly provided with other options.",
7979
)
8080
.addOption(
8181
new Option("--ignore-rules <rules...>", "Specify rules to ignore").choices(Object.values(problemFlags)).default([]),

packages/cli/src/readConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Command } from "commander";
22
import { readFile } from "fs/promises";
3-
import { problemFlags } from "./problemUtils.js";
3+
import { problemFlags } from "./problemUtils.ts";
44

55
export async function readConfig(program: Command, alternate = ".attw.json") {
66
try {

packages/cli/src/render/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { problemFlags } from "../problemUtils.js";
1+
import type { problemFlags } from "../problemUtils.ts";
22

33
export type Format = "auto" | "table" | "table-flipped" | "ascii" | "json";
44
export interface RenderOptions {
@@ -9,5 +9,5 @@ export interface RenderOptions {
99
emoji?: boolean;
1010
}
1111

12-
export * from "./typed.js";
13-
export * from "./untyped.js";
12+
export * from "./typed.ts";
13+
export * from "./untyped.ts";

packages/cli/src/render/typed.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import chalk from "chalk";
55
import Table, { type GenericTable, type HorizontalTableRow } from "cli-table3";
66
import { marked } from "marked";
77
import TerminalRenderer from "marked-terminal";
8-
import { moduleKinds, problemFlags, resolutionKinds } from "../problemUtils.js";
9-
import { asciiTable } from "./asciiTable.js";
10-
import type { RenderOptions } from "./index.js";
8+
import { moduleKinds, problemFlags, resolutionKinds } from "../problemUtils.ts";
9+
import { asciiTable } from "./asciiTable.ts";
10+
import type { RenderOptions } from "./index.ts";
1111

1212
export async function typed(
1313
analysis: core.Analysis,

0 commit comments

Comments
 (0)