@ohos-ports/azle 0.33.0-beta.0 → 0.33.0-beta.1

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/package.json CHANGED
@@ -1,102 +1,105 @@
1
1
  {
2
- "name": "@ohos-ports/azle",
3
- "version": "0.33.0-beta.0",
4
- "description": "TypeScript and JavaScript CDK for the Internet Computer",
5
- "scripts": {
6
- "typecheck": "tsc",
7
- "lint": "if [ \"$npm_config_fix\" ]; then eslint . --cache --fix; else eslint . --cache; fi",
8
- "prepare": "husky",
9
- "install": "cd src/stable/build/dfx_extension && ./install.sh",
10
- "test": "echo 'test'",
11
- "license-check": "licensee --errors-only && echo \"License check passed successfully!\" || { echo \"License check failed! Non-compliant licenses found.\"; exit 1; }"
12
- },
13
- "type": "module",
14
- "bin": {
15
- "azle": "./src/build.ts"
16
- },
17
- "exports": {
18
- ".": "./src/stable/lib/index.ts",
19
- "./_internal": "./src/exports/_internal.ts",
20
- "./_internal/*": "./src/exports/_internal/*.ts",
21
- "./canisters/*": "./src/exports/canisters/*.ts",
22
- "./experimental": "./src/exports/experimental.ts",
23
- "./experimental/*": "./src/exports/experimental/*.ts"
24
- },
25
- "imports": {
26
- "#build/*": "./src/stable/build/*.ts",
27
- "#commands/*": "./src/stable/build/commands/*.ts",
28
- "#experimental/commands/*": "./src/experimental/build/commands/*.ts",
29
- "#experimental/build/*": "./src/experimental/build/*.ts",
30
- "#experimental/lib/*": "./src/experimental/lib/*.ts",
31
- "#experimental/test/*": "./src/experimental/test/*.ts",
32
- "#experimental/test/property/*": "./src/experimental/test/property/*.ts",
33
- "#experimental/test/type/*": "./src/experimental/test/type/*.ts",
34
- "#experimental/utils/*": "./src/experimental/build/utils/*.ts",
35
- "#lib/*": "./src/stable/lib/*.ts",
36
- "#test/*": "./src/stable/test/*.ts",
37
- "#test/property/*": "./src/stable/test/property/*.ts",
38
- "#test/type/*": "./src/stable/test/type/*.ts",
39
- "#utils/*": "./src/stable/build/utils/*.ts"
40
- },
41
- "repository": {
42
- "type": "git",
43
- "url": "https://github.com/ohos-ports/ohos-ports.git",
44
- "directory": "ports/azle/0.33.0"
45
- },
46
- "keywords": [],
47
- "author": "AZLE token holders (nlhft-2iaaa-aaaae-qaaua-cai)",
48
- "license": "MIT",
49
- "bugs": {
50
- "url": "https://github.com/ohos-ports/ohos-ports/issues"
51
- },
52
- "homepage": "https://github.com/demergent-labs/azle#readme",
53
- "dependencies": {
54
- "@dfinity/agent": "^3.2.1",
55
- "@sinonjs/text-encoding": "0.7.3",
56
- "binaryen": "^116.0.0",
57
- "@ohos-ports/esbuild": "^0.28.1-beta.1",
58
- "jssha": "^3.3.1",
59
- "@ohos-ports/tsx": "^4.22.4-beta.4",
60
- "typescript": "^5.9.2",
61
- "uuid": "^11.1.0"
62
- },
63
- "devDependencies": {
64
- "@dfinity/identity": "^3.2.1",
65
- "@eslint/js": "^9.33.0",
66
- "@types/semver": "^7.7.0",
67
- "@types/uuid": "^10.0.0",
68
- "@typescript-eslint/eslint-plugin": "^8.39.1",
69
- "@typescript-eslint/parser": "^8.39.1",
70
- "azle-experimental-deps": "github:demergent-labs/azle-experimental-deps#d520f28563b2d255c7edf5b672da6083fd722259",
71
- "@ohos-ports/cuzz": "^0.0.23-beta.0",
72
- "eslint": "^9.33.0",
73
- "eslint-config-prettier": "^10.1.8",
74
- "eslint-plugin-simple-import-sort": "^12.1.1",
75
- "fast-check": "^4.2.0",
76
- "husky": "9.1.7",
77
- "jest": "^30.0.5",
78
- "licensee": "^11.1.1",
79
- "lint-staged": "16.1.5",
80
- "prettier": "^3.6.2",
81
- "@ohos-ports/puppeteer": "^25.6.0-beta.0",
82
- "semver": "^7.7.2",
83
- "ts-jest": "^29.4.1",
84
- "@ohos-ports/typescript-eslint": "^8.65.0-beta.0"
85
- },
86
- "lint-staged": {
87
- "*.{js,ts}": "eslint --cache --fix",
88
- "**/*": "prettier --write --ignore-unknown"
89
- },
90
- "azle": {
91
- "globalDependencies": {
92
- "dfx": "0.28.0",
93
- "node": "22.17.1",
94
- "rust": "1.88.0",
95
- "cargo-auditable": "0.7.0",
96
- "cargo-audit": "https://github.com/rustsec/rustsec?rev=13604e1909456e25752784681f0367b13a21e47b#13604e19",
97
- "cargo-bundle-licenses": "4.0.0",
98
- "cargo-deny": "0.18.3",
99
- "wasi2ic": "0.2.15"
2
+ "name": "@ohos-ports/azle",
3
+ "version": "0.33.0-beta.1",
4
+ "description": "TypeScript and JavaScript CDK for the Internet Computer",
5
+ "scripts": {
6
+ "typecheck": "tsc",
7
+ "lint": "if [ \"$npm_config_fix\" ]; then eslint . --cache --fix; else eslint . --cache; fi",
8
+ "prepare": "husky",
9
+ "install": "cd src/stable/build/dfx_extension && ./install.sh",
10
+ "test": "echo 'test'",
11
+ "license-check": "licensee --errors-only && echo \"License check passed successfully!\" || { echo \"License check failed! Non-compliant licenses found.\"; exit 1; }"
12
+ },
13
+ "type": "module",
14
+ "bin": {
15
+ "azle": "./src/build.ts"
16
+ },
17
+ "exports": {
18
+ ".": "./src/stable/lib/index.ts",
19
+ "./_internal": "./src/exports/_internal.ts",
20
+ "./_internal/*": "./src/exports/_internal/*.ts",
21
+ "./canisters/*": "./src/exports/canisters/*.ts",
22
+ "./experimental": "./src/exports/experimental.ts",
23
+ "./experimental/*": "./src/exports/experimental/*.ts"
24
+ },
25
+ "imports": {
26
+ "#build/*": "./src/stable/build/*.ts",
27
+ "#commands/*": "./src/stable/build/commands/*.ts",
28
+ "#experimental/commands/*": "./src/experimental/build/commands/*.ts",
29
+ "#experimental/build/*": "./src/experimental/build/*.ts",
30
+ "#experimental/lib/*": "./src/experimental/lib/*.ts",
31
+ "#experimental/test/*": "./src/experimental/test/*.ts",
32
+ "#experimental/test/property/*": "./src/experimental/test/property/*.ts",
33
+ "#experimental/test/type/*": "./src/experimental/test/type/*.ts",
34
+ "#experimental/utils/*": "./src/experimental/build/utils/*.ts",
35
+ "#lib/*": "./src/stable/lib/*.ts",
36
+ "#test/*": "./src/stable/test/*.ts",
37
+ "#test/property/*": "./src/stable/test/property/*.ts",
38
+ "#test/type/*": "./src/stable/test/type/*.ts",
39
+ "#utils/*": "./src/stable/build/utils/*.ts"
40
+ },
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "https://github.com/ohos-ports/ohos-ports.git",
44
+ "directory": "ports/azle/0.33.0"
45
+ },
46
+ "keywords": [],
47
+ "author": "AZLE token holders (nlhft-2iaaa-aaaae-qaaua-cai)",
48
+ "license": "MIT",
49
+ "bugs": {
50
+ "url": "https://github.com/ohos-ports/ohos-ports/issues"
51
+ },
52
+ "homepage": "https://github.com/demergent-labs/azle#readme",
53
+ "dependencies": {
54
+ "@dfinity/agent": "^3.2.1",
55
+ "@sinonjs/text-encoding": "0.7.3",
56
+ "binaryen": "^116.0.0",
57
+ "@ohos-ports/esbuild": "^0.28.1-beta.1",
58
+ "ethers": "^6.13.5",
59
+ "jssha": "^3.3.1",
60
+ "http-message-parser": "^0.0.34",
61
+ "pako": "^2.1.0",
62
+ "@ohos-ports/tsx": "^4.22.4-beta.4",
63
+ "typescript": "^5.9.2",
64
+ "uuid": "^11.1.0"
65
+ },
66
+ "devDependencies": {
67
+ "@dfinity/identity": "^3.2.1",
68
+ "@eslint/js": "^9.33.0",
69
+ "@types/semver": "^7.7.0",
70
+ "@types/uuid": "^10.0.0",
71
+ "@typescript-eslint/eslint-plugin": "^8.39.1",
72
+ "@typescript-eslint/parser": "^8.39.1",
73
+ "azle-experimental-deps": "github:demergent-labs/azle-experimental-deps#d520f28563b2d255c7edf5b672da6083fd722259",
74
+ "@ohos-ports/cuzz": "^0.0.23-beta.0",
75
+ "eslint": "^9.33.0",
76
+ "eslint-config-prettier": "^10.1.8",
77
+ "eslint-plugin-simple-import-sort": "^12.1.1",
78
+ "fast-check": "^4.2.0",
79
+ "husky": "9.1.7",
80
+ "jest": "^30.0.5",
81
+ "licensee": "^11.1.1",
82
+ "lint-staged": "16.1.5",
83
+ "prettier": "^3.6.2",
84
+ "@ohos-ports/puppeteer": "^25.6.0-beta.0",
85
+ "semver": "^7.7.2",
86
+ "ts-jest": "^29.4.1",
87
+ "@ohos-ports/typescript-eslint": "^8.65.0-beta.0"
88
+ },
89
+ "lint-staged": {
90
+ "*.{js,ts}": "eslint --cache --fix",
91
+ "**/*": "prettier --write --ignore-unknown"
92
+ },
93
+ "azle": {
94
+ "globalDependencies": {
95
+ "dfx": "0.28.0",
96
+ "node": "22.17.1",
97
+ "rust": "1.88.0",
98
+ "cargo-auditable": "0.7.0",
99
+ "cargo-audit": "https://github.com/rustsec/rustsec?rev=13604e1909456e25752784681f0367b13a21e47b#13604e19",
100
+ "cargo-bundle-licenses": "4.0.0",
101
+ "cargo-deny": "0.18.3",
102
+ "wasi2ic": "0.2.15"
103
+ }
100
104
  }
101
- }
102
105
  }
@@ -1,6 +1,6 @@
1
1
  import '#experimental/build/assert_experimental';
2
2
 
3
- import { BuildOptions } from 'esbuild';
3
+ import { BuildOptions } from '@ohos-ports/esbuild';
4
4
  import esbuildPluginTsc from 'esbuild-plugin-tsc';
5
5
  import { existsSync } from 'fs';
6
6
  import { join } from 'path';
@@ -140,6 +140,9 @@ export async function getBuildOptions(
140
140
  // Thus we are pegging the target to es2021. We will eventually get rid of wasmedge-quickjs and just use rquickjs for experimental anyway.
141
141
  target: 'es2021',
142
142
  alias: {
143
+ // The canister prelude and canister source code reference the bare
144
+ // name 'azle', which must resolve to this package's published name.
145
+ azle: '@ohos-ports/azle',
143
146
  internal: `${WASMEDGE_QUICKJS_PATH}/modules/internal`,
144
147
  util: `${WASMEDGE_QUICKJS_PATH}/modules/util`,
145
148
  fs: `${WASMEDGE_QUICKJS_PATH}/modules/fs`,
@@ -2,7 +2,10 @@ import '#experimental/lib/assert_experimental';
2
2
  import '#lib/globals'; // We import this to remove type errors having to do with the stable and experimental globals
3
3
 
4
4
  // @ts-ignore
5
- import { TextDecoder, TextEncoder } from '@sinonjs/text-encoding';
5
+ import textEncoding from '@sinonjs/text-encoding';
6
+
7
+ const { TextDecoder, TextEncoder } = textEncoding;
8
+
6
9
  import { Buffer } from 'buffer';
7
10
  import * as process from 'process';
8
11
  import { URL } from 'url';
@@ -1,10 +1,6 @@
1
1
  import '#experimental/lib/assert_experimental';
2
2
 
3
- import { Server as NodeServer, ServerResponse } from 'http';
4
- // @ts-ignore
5
- import { HttpConn } from 'http';
6
- // @ts-ignore
7
- import { IncomingMessageForServer } from 'http';
3
+ import * as nodeHttp from 'http';
8
4
  // @ts-ignore
9
5
  import httpMessageParser from 'http-message-parser';
10
6
 
@@ -17,6 +13,15 @@ import { idlDecode, idlEncode } from '#lib/execute_and_reply_with_candid_serde';
17
13
  import { msgArgData, msgReply } from '#lib/ic_apis/index';
18
14
  import { query, update } from '#lib/index';
19
15
 
16
+ const { Server: NodeServer, ServerResponse } = nodeHttp;
17
+
18
+ // HttpConn and IncomingMessageForServer are provided by the wasmedge-quickjs
19
+ // canister runtime's http shim; they are absent from the standard Node.js
20
+ // export surface. They are retrieved as runtime properties so that this module
21
+ // can be loaded in any runtime; they are only touched on the actual http
22
+ // serving path inside httpHandler().
23
+ const { HttpConn, IncomingMessageForServer } = nodeHttp as any;
24
+
20
25
  export class Server {
21
26
  nodeServer?: NodeServer;
22
27
 
@@ -1,8 +1,5 @@
1
- export {
2
- generateFileOfSize,
3
- toBytes,
4
- Unit
5
- } from '../../../.scripts/file_generator';
1
+ export { generateFileOfSize, toBytes } from '../../../.scripts/file_generator';
2
+ export type { Unit } from '../../../.scripts/file_generator';
6
3
  export { hashFileByParts } from '../../../.scripts/hash_file_by_parts';
7
4
  export { createActor } from '#experimental/commands/upload_assets/file_uploader/uploader_actor';
8
5
  export { AZLE_UPLOADER_IDENTITY_NAME } from '#experimental/commands/upload_assets/uploader_identity';
@@ -1,4 +1,4 @@
1
- import { build, BuildOptions } from 'esbuild';
1
+ import { build, BuildOptions } from '@ohos-ports/esbuild';
2
2
  import { dirname, join } from 'path';
3
3
 
4
4
  import { getDfxRoot } from '#utils/dfx_root';
@@ -186,6 +186,11 @@ export function getBuildOptions(ts: string, main: string): BuildOptions {
186
186
  logLevel: 'silent',
187
187
  target: 'es2024',
188
188
  preserveSymlinks: true,
189
+ // The canister prelude and canister source code reference the bare name
190
+ // 'azle', which must resolve to this package's published name.
191
+ alias: {
192
+ azle: '@ohos-ports/azle'
193
+ },
189
194
  plugins: [
190
195
  {
191
196
  name: 'Azle experimental check',
@@ -1,7 +1,9 @@
1
1
  import './state';
2
2
 
3
3
  // @ts-ignore
4
- import { TextDecoder, TextEncoder } from '@sinonjs/text-encoding';
4
+ import textEncoding from '@sinonjs/text-encoding';
5
+
6
+ const { TextDecoder, TextEncoder } = textEncoding;
5
7
 
6
8
  import { AzleIcExperimental } from '#experimental/lib/ic/azle_ic_experimental';
7
9
 
@@ -1,5 +1,5 @@
1
- export {
2
- call,
1
+ export { call } from './call';
2
+ export type {
3
3
  CallError,
4
4
  CallOptions,
5
5
  CallPerformFailed,
@@ -1,6 +1,8 @@
1
1
  import { Principal } from '@dfinity/principal';
2
2
  // @ts-ignore
3
- import { TextDecoder, TextEncoder } from '@sinonjs/text-encoding';
3
+ import textEncoding from '@sinonjs/text-encoding';
4
+
5
+ const { TextDecoder, TextEncoder } = textEncoding;
4
6
 
5
7
  import { jsonParse, jsonStringify } from '../json';
6
8
  import { Serializable } from './stable_b_tree_map';