warpo 2.0.1 → 2.1.0-beta-2

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.
@@ -0,0 +1,5 @@
1
+ // Copyright (C) 2025 wasm-ecosystem
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export declare function getCreateFileDirName(): string;
5
+ export declare function onModuleResolve(callbackFnIndex: i32, rtId: i32): void;
@@ -0,0 +1,5 @@
1
+ import * as api from "./__warpo_create";
2
+ import { __collect } from "rt/itcms";
3
+
4
+ __collect(); // trigger GC to ensure the env is loaded.
5
+ export const __dirname: string = api.getCreateFileDirName();
@@ -0,0 +1,17 @@
1
+ // Copyright (C) 2025 wasm-ecosystem
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import * as api from "./__warpo_create";
5
+
6
+ export class ModuleResolve {
7
+ packageName!: string;
8
+ private packagePath: string | null = null;
9
+ setPackagePath(packagePath: string): void {
10
+ this.packagePath = packagePath;
11
+ }
12
+ }
13
+
14
+ export type Fn = (task: ModuleResolve) => void;
15
+ export function onModuleResolve(fn: Fn): void {
16
+ api.onModuleResolve(fn.index, idof<ModuleResolve>());
17
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "../tsconfig-warpo.json",
3
+ "include": ["./**/*.ts"]
4
+ }
package/dist/warpo.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  import * as os from "node:os";
2
3
  import { execSync, spawn } from "node:child_process";
3
4
  import { existsSync, readFileSync } from "node:fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "warpo",
3
- "version": "2.0.1",
3
+ "version": "2.1.0-beta-2",
4
4
  "description": "next generation AssemblyScript compiler with optimizations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,13 +11,19 @@
11
11
  "build:cpp": "cmake -S . -B build && cmake --build build --parallel",
12
12
  "build": "npm run build:ts && npm run build:cpp",
13
13
  "test:ut": "cd build && ctest --output-on-failure",
14
- "test:as:snapshot": "./build/tests/frontend/warpo_frontend_test",
14
+ "test:as:snapshot": "cross-env-shell ./build/tests/frontend/warpo_frontend_test",
15
15
  "test:opt:snapshot": "node tests/snapshot_diff/index.mjs",
16
16
  "test:bootstrap:debug": "./tests/bootstrap/debug.sh",
17
17
  "test:bootstrap:release": "./tests/bootstrap/release.sh",
18
- "test": "npm run test:ut && npm run test:as:snapshot && npm run test:opt:snapshot && npm run test:bootstrap:debug && npm run test:bootstrap:release",
18
+ "test:debug_symbol": "cross-env-shell ./build/tests/DebugSymbol/TestDebugSymbol",
19
+ "test:debug_symbol:update": "cross-env-shell build/tests/DebugSymbol/TestDebugSymbol --update-fixtures",
20
+ "test:driver": "node tests/driver/index.mjs",
21
+ "test": "npm run test:ut && npm run test:as:snapshot && npm run test:opt:snapshot && npm run test:driver && npm run test:debug_symbol && npm run test:bootstrap:debug && npm run test:bootstrap:release",
19
22
  "docs:dev": "vitepress dev docs",
20
- "docs:build": "vitepress build docs"
23
+ "docs:build": "vitepress build docs",
24
+ "prettier": "prettier --check .",
25
+ "prettier:fix": "prettier --write .",
26
+ "cspell": "cspell ."
21
27
  },
22
28
  "license": "Apache-2.0",
23
29
  "keywords": [
@@ -28,6 +34,7 @@
28
34
  ],
29
35
  "author": "congcong.cai@bmw.com",
30
36
  "files": [
37
+ "create",
31
38
  "dist",
32
39
  "types",
33
40
  "tsconfig-warpo.json",
@@ -35,10 +42,14 @@
35
42
  "assemblyscript/std/assembly/index.d.ts"
36
43
  ],
37
44
  "devDependencies": {
45
+ "@assemblyscript/loader": "^0.28.9",
38
46
  "@types/node": "^22.15.21",
39
47
  "assemblyscript": "^0.28.4",
40
48
  "assemblyscript-prettier": "^3.0.1",
41
- "diff": "^7.0.0",
49
+ "chalk": "^5.6.2",
50
+ "cross-env": "^10.1.0",
51
+ "cspell": "^9.3.0",
52
+ "diff": "^8.0.0",
42
53
  "prettier": "^3.6.2",
43
54
  "typescript": "^5.8.3",
44
55
  "vitepress": "^1.6.3"
@@ -8,3 +8,7 @@ declare namespace utf8 {
8
8
  }
9
9
  function build(s: string): ConstStr;
10
10
  }
11
+
12
+ declare module "rt/itcms" {
13
+ export function __collect(): void;
14
+ }