@aztec/builder 0.0.1-commit.d431d1c → 0.0.1-commit.dbf9cec
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.
|
@@ -5,5 +5,5 @@ export type GenerateCodeOptions = {
|
|
|
5
5
|
/**
|
|
6
6
|
* Generates Noir interface or Typescript interface for a folder or single file from a Noir compilation artifact.
|
|
7
7
|
*/
|
|
8
|
-
export declare function generateCode(outputPath: string, fileOrDirPath: string, opts?: GenerateCodeOptions): Promise<string[]>;
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
8
|
+
export declare function generateCode(outputPath: string, fileOrDirPath: string, opts?: GenerateCodeOptions): Promise<(string | undefined)[]>;
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29kZWdlbi5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbnRyYWN0LWludGVyZmFjZS1nZW4vY29kZWdlbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFZQSw0QkFBNEI7QUFDNUIsTUFBTSxNQUFNLG1CQUFtQixHQUFHO0lBQUUsS0FBSyxDQUFDLEVBQUUsT0FBTyxDQUFBO0NBQUUsQ0FBQztBQUV0RDs7R0FFRztBQUNILHdCQUFzQixZQUFZLENBQUMsVUFBVSxFQUFFLE1BQU0sRUFBRSxhQUFhLEVBQUUsTUFBTSxFQUFFLElBQUksR0FBRSxtQkFBd0IsbUNBa0IzRyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../src/contract-interface-gen/codegen.ts"],"names":[],"mappings":"AAYA,4BAA4B;AAC5B,MAAM,MAAM,mBAAmB,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEtD;;GAEG;AACH,wBAAsB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,GAAE,mBAAwB,
|
|
1
|
+
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../src/contract-interface-gen/codegen.ts"],"names":[],"mappings":"AAYA,4BAA4B;AAC5B,MAAM,MAAM,mBAAmB,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEtD;;GAEG;AACH,wBAAsB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,GAAE,mBAAwB,mCAkB3G"}
|
|
@@ -38,6 +38,10 @@ let cache = {};
|
|
|
38
38
|
}
|
|
39
39
|
const file = await readFile(noirAbiPath, 'utf8');
|
|
40
40
|
const contract = JSON.parse(file);
|
|
41
|
+
if (!Array.isArray(contract.functions)) {
|
|
42
|
+
console.log(`${fileName} is not a contract artifact. Skipping.`);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
41
45
|
const aztecAbi = loadContractArtifact(contract);
|
|
42
46
|
await mkdir(outputPath, {
|
|
43
47
|
recursive: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/builder",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.dbf9cec",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
71
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
70
|
+
"@aztec/foundation": "0.0.1-commit.dbf9cec",
|
|
71
|
+
"@aztec/stdlib": "0.0.1-commit.dbf9cec",
|
|
72
72
|
"commander": "^12.1.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
@@ -50,6 +50,12 @@ async function generateFromNoirAbi(outputPath: string, noirAbiPath: string, opts
|
|
|
50
50
|
|
|
51
51
|
const file = await readFile(noirAbiPath, 'utf8');
|
|
52
52
|
const contract = JSON.parse(file);
|
|
53
|
+
|
|
54
|
+
if (!Array.isArray(contract.functions)) {
|
|
55
|
+
console.log(`${fileName} is not a contract artifact. Skipping.`);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
53
59
|
const aztecAbi = loadContractArtifact(contract);
|
|
54
60
|
|
|
55
61
|
await mkdir(outputPath, { recursive: true });
|