virtual-machine 0.0.3 → 0.0.10
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/build/{chunk-GZ343GYI.mjs → chunk-MELUIZWO.mjs} +6 -104
- package/build/cli.js +591 -709
- package/build/index.d.ts +2 -11
- package/build/index.js +9 -107
- package/build/index.mjs +4 -4
- package/build/{riscv_vm-3CIEJ5K7.mjs → riscv_vm-JTPPWIT3.mjs} +1 -1
- package/package.json +12 -5
- package/.yarn/install-state.gz +0 -0
- package/.yarnrc.yml +0 -1
- package/Cargo.toml +0 -49
- package/build/chunk-LJUNPJTY.mjs +0 -670
- package/build/chunk-Q7TFYQ5G.mjs +0 -670
- package/build/riscv_vm-MHIWEZQY.mjs +0 -12
- package/build/riscv_vm-VNML57ES.mjs +0 -12
- package/build.sh +0 -25
- package/cli.ts +0 -268
- package/index.ts +0 -16
- package/src/bus.rs +0 -558
- package/src/clint.rs +0 -132
- package/src/console.rs +0 -83
- package/src/cpu.rs +0 -1913
- package/src/csr.rs +0 -67
- package/src/decoder.rs +0 -789
- package/src/dram.rs +0 -146
- package/src/emulator.rs +0 -603
- package/src/lib.rs +0 -270
- package/src/main.rs +0 -373
- package/src/mmu.rs +0 -331
- package/src/net.rs +0 -121
- package/src/net_tap.rs +0 -164
- package/src/net_webtransport.rs +0 -446
- package/src/net_ws.rs +0 -396
- package/src/plic.rs +0 -261
- package/src/uart.rs +0 -233
- package/src/virtio.rs +0 -1074
- package/tsconfig.json +0 -19
- package/tsup/index.ts +0 -79
- package/tsup/tsup.cli.ts +0 -8
- package/tsup/tsup.core.cjs.ts +0 -7
- package/tsup/tsup.core.esm.ts +0 -8
package/tsconfig.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"outDir": "build",
|
|
4
|
-
"skipLibCheck": true,
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"allowJs": true,
|
|
7
|
-
"target": "es2022",
|
|
8
|
-
"module": "es2022",
|
|
9
|
-
"declaration": true,
|
|
10
|
-
"emitDeclarationOnly": false,
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
"forceConsistentCasingInFileNames": true,
|
|
13
|
-
"moduleDetection": "force",
|
|
14
|
-
"strict": true,
|
|
15
|
-
"lib": ["ES2022", "DOM"],
|
|
16
|
-
},
|
|
17
|
-
"include": ["pkg", "index.ts"],
|
|
18
|
-
"exclude": ["node_modules", "build"]
|
|
19
|
-
}
|
package/tsup/index.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/** biome-ignore-all lint/suspicious/noExplicitAny: Not needed here */
|
|
2
|
-
|
|
3
|
-
import fs from "node:fs";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import { NodeResolvePlugin } from "@esbuild-plugins/node-resolve";
|
|
6
|
-
import { defineConfig, type Format } from "tsup";
|
|
7
|
-
|
|
8
|
-
const packagesDir = path.resolve(process.cwd());
|
|
9
|
-
export const wasmPlugin = {
|
|
10
|
-
name: "wasm",
|
|
11
|
-
setup(build: any) {
|
|
12
|
-
build.onResolve({ filter: /\.wasm$/ }, (args: any) => {
|
|
13
|
-
if (fs.existsSync(path.resolve(packagesDir, args.path))) {
|
|
14
|
-
return { path: path.resolve(packagesDir, args.path), namespace: "wasm" };
|
|
15
|
-
}
|
|
16
|
-
return { path: path.resolve("node_modules", args.path), namespace: "wasm" };
|
|
17
|
-
});
|
|
18
|
-
build.onLoad({ filter: /.*/, namespace: "wasm" }, async (args: any) => {
|
|
19
|
-
const buffer = await fs.promises.readFile(args.path);
|
|
20
|
-
const base64 = buffer.toString("base64");
|
|
21
|
-
return {
|
|
22
|
-
contents: `export default Buffer.from("${base64}", "base64")`,
|
|
23
|
-
loader: "js",
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const plugins = [
|
|
30
|
-
NodeResolvePlugin({
|
|
31
|
-
extensions: [".ts", ".js", ".wasm"],
|
|
32
|
-
onResolved: (resolved) => {
|
|
33
|
-
if (resolved.includes("node_modules")) {
|
|
34
|
-
return {
|
|
35
|
-
external: true,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
return resolved;
|
|
39
|
-
},
|
|
40
|
-
}),
|
|
41
|
-
];
|
|
42
|
-
|
|
43
|
-
export default function createConfig({
|
|
44
|
-
format,
|
|
45
|
-
entry,
|
|
46
|
-
banner,
|
|
47
|
-
platform,
|
|
48
|
-
external
|
|
49
|
-
}: {
|
|
50
|
-
format: Format | Format[] | undefined;
|
|
51
|
-
entry: string[] | undefined;
|
|
52
|
-
banner?: { js: string };
|
|
53
|
-
platform?: "neutral" | "node" | "browser";
|
|
54
|
-
external?: string[] | undefined;
|
|
55
|
-
}) {
|
|
56
|
-
return defineConfig(({ watch: _watch }) => ({
|
|
57
|
-
entry,
|
|
58
|
-
format,
|
|
59
|
-
outDir: "build",
|
|
60
|
-
target: "esnext",
|
|
61
|
-
minify: false,
|
|
62
|
-
platform: platform || "neutral",
|
|
63
|
-
clean: false,
|
|
64
|
-
esbuildPlugins: [wasmPlugin, ...plugins],
|
|
65
|
-
banner,
|
|
66
|
-
esbuildOptions: (options, _context) => {
|
|
67
|
-
options.platform = platform || "neutral";
|
|
68
|
-
},
|
|
69
|
-
external: [
|
|
70
|
-
"buffer",
|
|
71
|
-
"next",
|
|
72
|
-
"vitest",
|
|
73
|
-
"react-server-dom-webpack",
|
|
74
|
-
"tsup",
|
|
75
|
-
"react-server-dom-webpack/client.edge",
|
|
76
|
-
...(external ?? [])
|
|
77
|
-
],
|
|
78
|
-
}));
|
|
79
|
-
}
|
package/tsup/tsup.cli.ts
DELETED
package/tsup/tsup.core.cjs.ts
DELETED