Skip to content

Commit 5a9e9a2

Browse files
committed
fix: type
1 parent ef48f60 commit 5a9e9a2

4 files changed

Lines changed: 50 additions & 14 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"devDependencies": {
3737
"@antfu/ni": "^0.20.0",
3838
"@biomejs/biome": "^1.9.4",
39-
"@types/node": "^18.15.5",
39+
"@types/node": "^24.10.1",
4040
"@types/semver": "^7.3.13",
4141
"bumpp": "^10.3.2",
4242
"nano-staged": "^0.8.0",

pnpm-lock.yaml

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

tests/rstest/modernjs.ts

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,47 @@
1+
import { join } from 'node:path';
2+
import cache from '@actions/cache';
13
import type { RunOptions } from '../../types';
2-
import { runInRepo } from '../../utils';
4+
import { $, runInRepo } from '../../utils';
5+
6+
const isGitHubActions = !!process.env.GITHUB_ACTIONS;
37

48
export async function test(options: RunOptions) {
9+
let nxCachePath: string;
10+
let nxCacheKey: string;
11+
512
await runInRepo({
613
...options,
714
repo: 'web-infra-dev/modern.js',
815
branch: process.env.MODERNJS ?? 'main',
16+
beforeInstall: async () => {
17+
if (isGitHubActions) {
18+
const modernJsDir = join(process.cwd(), 'workspace/modernjs/modern.js');
19+
nxCachePath = join(modernJsDir, '.nx/cache');
20+
const sha = await $`git rev-parse HEAD`;
21+
nxCacheKey = `modernjs-nx-${sha.trim()}`;
22+
const restoreKeys = ['modernjs-nx-'];
23+
const cacheHitKey = await cache.restoreCache(
24+
[nxCachePath],
25+
nxCacheKey,
26+
restoreKeys,
27+
);
28+
if (cacheHitKey) {
29+
console.log(`Cache hit for key: ${cacheHitKey}`);
30+
await $`ls -lah .nx/cache`;
31+
} else {
32+
console.log(
33+
`Cache miss for key: ${nxCacheKey}, proceeding without cache.`,
34+
);
35+
}
36+
}
37+
},
38+
afterInstall: async () => {
39+
if (isGitHubActions) {
40+
console.log('Caching `.nx/cache` directory for future builds.');
41+
await $`ls -lah .nx/cache`;
42+
await cache.saveCache([nxCachePath], nxCacheKey);
43+
}
44+
},
945
test: ['test:rstest'],
1046
});
1147
}

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"exclude": ["**/node_modules/**"],
44
"compilerOptions": {
55
"target": "esnext",
6-
"module": "nodenext",
7-
"moduleResolution": "node",
6+
"module": "esnext",
7+
"moduleResolution": "bundler",
88
"strict": true,
99
"declaration": true,
1010
"noImplicitOverride": true,

0 commit comments

Comments
 (0)