Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(checkpoint-validation): fix broken initial release #618

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion libs/checkpoint-validation/bin/cli.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env node

import { register } from "node:module";
import { main } from "../dist/cli.js";

register("@swc-node/register/esm", import.meta.url);

await main();
4 changes: 1 addition & 3 deletions libs/checkpoint-validation/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { dirname, resolve as pathResolve } from "node:path";
import { fileURLToPath } from "node:url";
import { runCLI } from "@jest/core";

// make it so we can import/require .ts files
import "@swc-node/register/esm-register";
import { parseArgs } from "./parse_args.js";

export async function main() {
Expand All @@ -18,6 +16,6 @@ export async function main() {
$0: "",
runInBand: true,
},
[pathResolve(moduleDirname, "..", "bin", "jest.config.js")]
[pathResolve(moduleDirname, "runtime_jest_config.js")]
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,27 @@
// For the Jest config for the tests in this project, see the `jest.config.cjs` in the root of the package workspace.
import path from "node:path";
import { fileURLToPath } from "node:url";
import { parseArgs } from "../dist/parse_args.js";
import type { JestConfigWithTsJest } from "ts-jest";
import { parseArgs } from "./parse_args.js";

const args = await parseArgs(process.argv.slice(2));

/** @type {import('ts-jest').JestConfigWithTsJest} */
export default {
const config: JestConfigWithTsJest = {
preset: "ts-jest/presets/default-esm",
rootDir: path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "dist"),
rootDir: path.resolve(
path.dirname(fileURLToPath(import.meta.url)),
"..",
"dist"
),
testEnvironment: "node",
testMatch: ["<rootDir>/runner.js"],
transform: {
"^.+\\.[jt]sx?$": ["@swc/jest"],
"^.+\\.[jt]sx?$": "@swc/jest",
},
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.[jt]sx?$": "$1",
},
globals: args,
};

export default config;
3 changes: 2 additions & 1 deletion libs/checkpoint-validation/tsconfig.cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"src/cli.ts",
"src/import_utils.ts",
"src/runner.ts",
"src/parse_args.ts"
"src/parse_args.ts",
"src/runtime_jest_config.ts"
]
}
2 changes: 1 addition & 1 deletion libs/checkpoint-validation/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"target": "ES2021",
"lib": ["ES2021", "ES2022.Object", "DOM"],
"types": ["node", "jest"],
"module": "ES2020",
"module": "ES2022",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"declaration": true,
Expand Down
Loading