@noir-lang/noir_wasm 0.23.0 → 0.24.0-3386067.nightly
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/README.md +24 -1
- package/build/cjs/package.json +1 -1
- package/build/esm/package.json +1 -1
- package/dist/node/index_bg.wasm +0 -0
- package/dist/node/main.js +91 -136
- package/dist/node/main.js.map +1 -1
- package/dist/types/build/cjs/index.d.ts +15 -17
- package/dist/types/build/esm/index.d.ts +10 -10
- package/dist/types/src/index.d.cts +30 -0
- package/dist/types/src/index.d.mts +30 -0
- package/dist/types/src/noir/debug.d.ts +4 -1
- package/dist/types/src/noir/file-manager/nodejs-file-manager.d.ts +3 -2
- package/dist/types/src/noir/package.d.ts +2 -2
- package/dist/types/src/types/noir_artifact.d.ts +3 -1
- package/dist/types/src/types/noir_package_config.d.ts +1 -1
- package/dist/types/webpack.config.d.ts +0 -1
- package/dist/web/main.mjs +91 -134
- package/dist/web/main.mjs.map +1 -1
- package/package.json +10 -6
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
export function compile(entry_point: string, contracts: boolean | undefined, dependency_graph: DependencyGraph | undefined, file_source_map: PathToFileSourceMap): CompileResult;
|
|
2
1
|
export function compile_(entry_point: string, contracts: boolean | undefined, dependency_graph: DependencyGraph | undefined, file_source_map: PathToFileSourceMap): CompileResult;
|
|
3
|
-
export function init_log_level(
|
|
2
|
+
export function init_log_level(level: string): void;
|
|
4
3
|
export function build_info(): any;
|
|
4
|
+
export function compile(entry_point: string, contracts: boolean | undefined, dependency_graph: DependencyGraph | undefined, file_source_map: PathToFileSourceMap): CompileResult;
|
|
5
5
|
export function __wbindgen_object_drop_ref(arg0: any): void;
|
|
6
|
-
export function __wbg_constructor_28ca684b2f9696ac(...args: any[]): any;
|
|
7
6
|
export function __wbindgen_is_undefined(arg0: any): boolean;
|
|
8
|
-
export function
|
|
9
|
-
export function
|
|
10
|
-
export function
|
|
11
|
-
export function
|
|
7
|
+
export function __wbg_constructor_e8767839abf8a966(arg0: any): number;
|
|
8
|
+
export function __wbg_constructor_05d6d198f3477d6f(): number;
|
|
9
|
+
export function __wbg_new_abda76e883ba8a5f(): number;
|
|
10
|
+
export function __wbg_stack_658279fe44541cf6(arg0: any, arg1: any): void;
|
|
11
|
+
export function __wbg_error_f851667af71bcfc6(arg0: any, arg1: any): void;
|
|
12
12
|
export function __wbindgen_string_new(arg0: any, arg1: any): number;
|
|
13
|
-
export function __wbg_debug_e3f6a1578e6d45ca(
|
|
14
|
-
export function __wbg_debug_efabe4eb183aa5d4(
|
|
15
|
-
export function __wbg_error_a7e23606158b68b9(
|
|
16
|
-
export function __wbg_error_50f42b952a595a23(
|
|
17
|
-
export function __wbg_info_05db236d79f1b785(
|
|
18
|
-
export function __wbg_info_24d8f53d98f12b95(
|
|
19
|
-
export function
|
|
20
|
-
export function
|
|
21
|
-
export function __wbg_warn_9bdd743e9f5fe1e0(...args: any[]): any;
|
|
22
|
-
export function __wbg_warn_8342bfbc6028193a(...args: any[]): any;
|
|
13
|
+
export function __wbg_debug_e3f6a1578e6d45ca(arg0: any): void;
|
|
14
|
+
export function __wbg_debug_efabe4eb183aa5d4(arg0: any, arg1: any, arg2: any, arg3: any): void;
|
|
15
|
+
export function __wbg_error_a7e23606158b68b9(arg0: any): void;
|
|
16
|
+
export function __wbg_error_50f42b952a595a23(arg0: any, arg1: any, arg2: any, arg3: any): void;
|
|
17
|
+
export function __wbg_info_05db236d79f1b785(arg0: any): void;
|
|
18
|
+
export function __wbg_info_24d8f53d98f12b95(arg0: any, arg1: any, arg2: any, arg3: any): void;
|
|
19
|
+
export function __wbg_warn_9bdd743e9f5fe1e0(arg0: any): void;
|
|
20
|
+
export function __wbg_warn_8342bfbc6028193a(arg0: any, arg1: any, arg2: any, arg3: any): void;
|
|
23
21
|
export function __wbindgen_string_get(arg0: any, arg1: any): void;
|
|
24
22
|
export function __wbg_parse_76a8a18ca3f8730b(...args: any[]): any;
|
|
25
23
|
export function __wbg_stringify_d06ad2addc54d51e(...args: any[]): any;
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @param {string} entry_point
|
|
3
|
-
* @param {boolean | undefined} contracts
|
|
4
|
-
* @param {DependencyGraph | undefined} dependency_graph
|
|
5
|
-
* @param {PathToFileSourceMap} file_source_map
|
|
6
|
-
* @returns {CompileResult}
|
|
7
|
-
*/
|
|
8
|
-
export function compile(entry_point: string, contracts: boolean | undefined, dependency_graph: DependencyGraph | undefined, file_source_map: PathToFileSourceMap): CompileResult;
|
|
9
|
-
/**
|
|
10
2
|
* This is a method that exposes the same API as `compile`
|
|
11
3
|
* But uses the Context based APi internally
|
|
12
4
|
* @param {string} entry_point
|
|
@@ -17,14 +9,22 @@ export function compile(entry_point: string, contracts: boolean | undefined, dep
|
|
|
17
9
|
*/
|
|
18
10
|
export function compile_(entry_point: string, contracts: boolean | undefined, dependency_graph: DependencyGraph | undefined, file_source_map: PathToFileSourceMap): CompileResult;
|
|
19
11
|
/**
|
|
20
|
-
* @param {string}
|
|
12
|
+
* @param {string} level
|
|
21
13
|
*/
|
|
22
|
-
export function init_log_level(
|
|
14
|
+
export function init_log_level(level: string): void;
|
|
23
15
|
/**
|
|
24
16
|
* @returns {any}
|
|
25
17
|
*/
|
|
26
18
|
export function build_info(): any;
|
|
27
19
|
/**
|
|
20
|
+
* @param {string} entry_point
|
|
21
|
+
* @param {boolean | undefined} contracts
|
|
22
|
+
* @param {DependencyGraph | undefined} dependency_graph
|
|
23
|
+
* @param {PathToFileSourceMap} file_source_map
|
|
24
|
+
* @returns {CompileResult}
|
|
25
|
+
*/
|
|
26
|
+
export function compile(entry_point: string, contracts: boolean | undefined, dependency_graph: DependencyGraph | undefined, file_source_map: PathToFileSourceMap): CompileResult;
|
|
27
|
+
/**
|
|
28
28
|
* This is a wrapper class that is wasm-bindgen compatible
|
|
29
29
|
* We do not use js_name and rename it like CrateId because
|
|
30
30
|
* then the impl block is not picked up in javascript.
|
|
@@ -3,6 +3,36 @@ import { createNodejsFileManager } from './noir/file-manager/nodejs-file-manager
|
|
|
3
3
|
import { LogFn } from './utils';
|
|
4
4
|
import { CompilationResult } from './types/noir_artifact';
|
|
5
5
|
import { inflateDebugSymbols } from './noir/debug';
|
|
6
|
+
/**
|
|
7
|
+
* Compiles a Noir project
|
|
8
|
+
*
|
|
9
|
+
* @param fileManager - The file manager to use
|
|
10
|
+
* @param projectPath - The path to the project inside the file manager. Defaults to the root of the file manager
|
|
11
|
+
* @param logFn - A logging function. If not provided, console.log will be used
|
|
12
|
+
* @param debugLogFn - A debug logging function. If not provided, logFn will be used
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // Node.js
|
|
17
|
+
*
|
|
18
|
+
* import { compile, createFileManager } from '@noir-lang/noir_wasm';
|
|
19
|
+
*
|
|
20
|
+
* const fm = createFileManager(myProjectPath);
|
|
21
|
+
* const myCompiledCode = await compile(fm);
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* ```typescript
|
|
25
|
+
* // Browser
|
|
26
|
+
*
|
|
27
|
+
* import { compile, createFileManager } from '@noir-lang/noir_wasm';
|
|
28
|
+
*
|
|
29
|
+
* const fm = createFileManager('/');
|
|
30
|
+
* for (const path of files) {
|
|
31
|
+
* await fm.writeFile(path, await getFileAsStream(path));
|
|
32
|
+
* }
|
|
33
|
+
* const myCompiledCode = await compile(fm);
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
6
36
|
declare function compile(fileManager: FileManager, projectPath?: string, logFn?: LogFn, debugLogFn?: LogFn): Promise<CompilationResult>;
|
|
7
37
|
declare const createFileManager: typeof createNodejsFileManager;
|
|
8
38
|
export { compile, createFileManager, inflateDebugSymbols, CompilationResult };
|
|
@@ -3,6 +3,36 @@ import { createNodejsFileManager } from './noir/file-manager/nodejs-file-manager
|
|
|
3
3
|
import { LogFn } from './utils';
|
|
4
4
|
import { CompilationResult } from './types/noir_artifact';
|
|
5
5
|
import { inflateDebugSymbols } from './noir/debug';
|
|
6
|
+
/**
|
|
7
|
+
* Compiles a Noir project
|
|
8
|
+
*
|
|
9
|
+
* @param fileManager - The file manager to use
|
|
10
|
+
* @param projectPath - The path to the project inside the file manager. Defaults to the root of the file manager
|
|
11
|
+
* @param logFn - A logging function. If not provided, console.log will be used
|
|
12
|
+
* @param debugLogFn - A debug logging function. If not provided, logFn will be used
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // Node.js
|
|
17
|
+
*
|
|
18
|
+
* import { compile, createFileManager } from '@noir-lang/noir_wasm';
|
|
19
|
+
*
|
|
20
|
+
* const fm = createFileManager(myProjectPath);
|
|
21
|
+
* const myCompiledCode = await compile(fm);
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* ```typescript
|
|
25
|
+
* // Browser
|
|
26
|
+
*
|
|
27
|
+
* import { compile, createFileManager } from '@noir-lang/noir_wasm';
|
|
28
|
+
*
|
|
29
|
+
* const fm = createFileManager('/');
|
|
30
|
+
* for (const path of files) {
|
|
31
|
+
* await fm.writeFile(path, await getFileAsStream(path));
|
|
32
|
+
* }
|
|
33
|
+
* const myCompiledCode = await compile(fm);
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
6
36
|
declare function compile(fileManager: FileManager, projectPath?: string, logFn?: LogFn, debugLogFn?: LogFn): Promise<CompilationResult>;
|
|
7
37
|
declare const createFileManager: typeof createNodejsFileManager;
|
|
8
38
|
export { compile, createFileManager, inflateDebugSymbols, CompilationResult };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FileManager } from './file-manager';
|
|
2
2
|
export declare function readdirRecursive(dir: string): Promise<string[]>;
|
|
3
3
|
/**
|
|
4
|
-
* Creates a new FileManager instance based on
|
|
5
|
-
*
|
|
4
|
+
* Creates a new FileManager instance based on fs in node and memfs in the browser (via webpack alias)
|
|
5
|
+
*
|
|
6
|
+
* @param dataDir - root of the file system
|
|
6
7
|
*/
|
|
7
8
|
export declare function createNodejsFileManager(dataDir: string): FileManager;
|
|
@@ -40,13 +40,13 @@ export declare class Package {
|
|
|
40
40
|
backend?: string | undefined;
|
|
41
41
|
license?: string | undefined;
|
|
42
42
|
};
|
|
43
|
-
dependencies
|
|
43
|
+
dependencies?: Record<string, {
|
|
44
44
|
git: string;
|
|
45
45
|
tag: string;
|
|
46
46
|
directory?: string | undefined;
|
|
47
47
|
} | {
|
|
48
48
|
path: string;
|
|
49
|
-
}
|
|
49
|
+
}> | undefined;
|
|
50
50
|
};
|
|
51
51
|
/**
|
|
52
52
|
* The path to the source directory.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Abi, AbiType } from '@noir-lang/
|
|
1
|
+
import { Abi, AbiType } from '@noir-lang/types';
|
|
2
2
|
/**
|
|
3
3
|
* A named type.
|
|
4
4
|
*/
|
|
@@ -67,6 +67,8 @@ export interface ContractArtifact {
|
|
|
67
67
|
* The compilation result of an Noir contract.
|
|
68
68
|
*/
|
|
69
69
|
export interface ProgramArtifact {
|
|
70
|
+
/** Version of noir used for the build. */
|
|
71
|
+
noir_version: string;
|
|
70
72
|
/** The hash of the circuit. */
|
|
71
73
|
hash?: number;
|
|
72
74
|
/** * The ABI of the function. */
|
|
@@ -18,7 +18,7 @@ type NoirPackageConfigSchema = {
|
|
|
18
18
|
backend?: string;
|
|
19
19
|
license?: string;
|
|
20
20
|
};
|
|
21
|
-
dependencies
|
|
21
|
+
dependencies?: Record<string, GitDependencyConfig | LocalDependencyConfig>;
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
24
|
* Noir package configuration.
|