@isentinel/jest-roblox 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/jest-roblox.js +3 -2
- package/dist/cli.mjs +236 -51
- package/dist/{game-output-BL7u7qMT.mjs → game-output-C0KykXIi.mjs} +73 -59
- package/dist/index.mjs +1 -1
- package/dist/sea/jest-roblox +0 -0
- package/dist/sea-entry.cjs +18361 -17955
- package/loaders/luau-raw.d.mts +34 -0
- package/loaders/luau-raw.mjs +33 -0
- package/package.json +14 -13
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
interface ResolveContext {
|
|
2
|
+
conditions?: Array<string>;
|
|
3
|
+
importAttributes?: Record<string, string>;
|
|
4
|
+
parentURL?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface ResolveResult {
|
|
8
|
+
format?: string;
|
|
9
|
+
url: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type NextResolve = (specifier: string, context: ResolveContext) => Promise<ResolveResult>;
|
|
13
|
+
|
|
14
|
+
interface LoadContext {
|
|
15
|
+
conditions?: Array<string>;
|
|
16
|
+
format?: string;
|
|
17
|
+
importAttributes?: Record<string, string>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface LoadResult {
|
|
21
|
+
format: string;
|
|
22
|
+
shortCircuit?: boolean;
|
|
23
|
+
source: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
type NextLoad = (url: string, context: LoadContext) => Promise<LoadResult>;
|
|
27
|
+
|
|
28
|
+
export function resolve(
|
|
29
|
+
specifier: string,
|
|
30
|
+
context: ResolveContext,
|
|
31
|
+
nextResolve: NextResolve,
|
|
32
|
+
): Promise<ResolveResult>;
|
|
33
|
+
|
|
34
|
+
export function load(url: string, context: LoadContext, nextLoad: NextLoad): Promise<LoadResult>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
|
|
4
|
+
export async function resolve(specifier, context, nextResolve) {
|
|
5
|
+
const resolved = await nextResolve(specifier, context);
|
|
6
|
+
|
|
7
|
+
if (resolved.url.endsWith(".luau") || resolved.url.endsWith(".lua")) {
|
|
8
|
+
return { ...resolved, format: "luau-raw" };
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return resolved;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export async function load(url, context, nextLoad) {
|
|
15
|
+
if (context.format === "luau-raw") {
|
|
16
|
+
if (url.endsWith(".lua")) {
|
|
17
|
+
return {
|
|
18
|
+
format: "module",
|
|
19
|
+
shortCircuit: true,
|
|
20
|
+
source: "export default {};",
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const content = await readFile(fileURLToPath(url), "utf-8");
|
|
25
|
+
return {
|
|
26
|
+
format: "module",
|
|
27
|
+
shortCircuit: true,
|
|
28
|
+
source: `export default ${JSON.stringify(content)};`,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return nextLoad(url, context);
|
|
33
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isentinel/jest-roblox",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Jest-compatible CLI for running roblox-ts tests via Roblox Open Cloud",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jest",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"files": [
|
|
34
34
|
"bin",
|
|
35
35
|
"dist",
|
|
36
|
+
"loaders",
|
|
36
37
|
"plugin",
|
|
37
38
|
"!dist/**/*.map",
|
|
38
39
|
"!dist/**/*.tsbuildinfo"
|
|
@@ -40,17 +41,17 @@
|
|
|
40
41
|
"dependencies": {
|
|
41
42
|
"@jridgewell/trace-mapping": "0.3.31",
|
|
42
43
|
"@roblox-ts/rojo-resolver": "1.1.0",
|
|
43
|
-
"arktype": "2.
|
|
44
|
+
"arktype": "2.2.0",
|
|
44
45
|
"c12": "4.0.0-beta.4",
|
|
45
46
|
"confbox": "0.2.4",
|
|
46
47
|
"defu": "6.1.4",
|
|
47
|
-
"get-tsconfig": "4.13.
|
|
48
|
+
"get-tsconfig": "4.13.7",
|
|
48
49
|
"highlight.js": "11.11.1",
|
|
49
50
|
"istanbul-lib-coverage": "3.2.2",
|
|
50
51
|
"istanbul-lib-report": "3.0.1",
|
|
51
52
|
"istanbul-reports": "3.2.0",
|
|
52
53
|
"oxc-parser": "0.120.0",
|
|
53
|
-
"picomatch": "4.0.
|
|
54
|
+
"picomatch": "4.0.4",
|
|
54
55
|
"std-env": "4.0.0",
|
|
55
56
|
"tinyrainbow": "3.0.3",
|
|
56
57
|
"ws": "8.18.0"
|
|
@@ -60,31 +61,31 @@
|
|
|
60
61
|
"@isentinel/tsconfig": "1.2.0",
|
|
61
62
|
"@oxc-project/types": "0.120.0",
|
|
62
63
|
"@rbxts/jest": "3.13.3-ts.1",
|
|
63
|
-
"@rbxts/types": "1.0.
|
|
64
|
+
"@rbxts/types": "1.0.913",
|
|
64
65
|
"@total-typescript/shoehorn": "0.1.2",
|
|
65
|
-
"@tsdown/exe": "0.21.
|
|
66
|
+
"@tsdown/exe": "0.21.5",
|
|
66
67
|
"@types/istanbul-lib-coverage": "2.0.6",
|
|
67
68
|
"@types/istanbul-lib-report": "3.0.3",
|
|
68
69
|
"@types/istanbul-reports": "3.0.4",
|
|
69
|
-
"@types/node": "24.
|
|
70
|
+
"@types/node": "24.12.0",
|
|
70
71
|
"@types/picomatch": "4.0.2",
|
|
71
72
|
"@types/ws": "8.5.13",
|
|
72
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
73
|
-
"@vitest/coverage-v8": "4.1.
|
|
73
|
+
"@typescript/native-preview": "7.0.0-dev.20260325.1",
|
|
74
|
+
"@vitest/coverage-v8": "4.1.2",
|
|
74
75
|
"@vitest/eslint-plugin": "1.6.13",
|
|
75
76
|
"better-typescript-lib": "2.12.0",
|
|
76
77
|
"bumpp": "10.4.1",
|
|
77
78
|
"eslint": "9.39.2",
|
|
78
79
|
"eslint-plugin-jest-extended": "3.0.1",
|
|
79
|
-
"eslint-plugin-n": "17.
|
|
80
|
-
"eslint-plugin-pnpm": "1.
|
|
80
|
+
"eslint-plugin-n": "17.24.0",
|
|
81
|
+
"eslint-plugin-pnpm": "1.6.0",
|
|
81
82
|
"jest-extended": "7.0.0",
|
|
82
83
|
"memfs": "4.56.11",
|
|
83
84
|
"publint": "0.3.18",
|
|
84
|
-
"tsdown": "0.21.
|
|
85
|
+
"tsdown": "0.21.5",
|
|
85
86
|
"type-fest": "5.2.0",
|
|
86
87
|
"typescript": "5.9.3",
|
|
87
|
-
"vitest": "4.1.
|
|
88
|
+
"vitest": "4.1.2"
|
|
88
89
|
},
|
|
89
90
|
"engines": {
|
|
90
91
|
"node": ">=24.10.0"
|