Skip to content

Commit

Permalink
fix: revert "binary" to "bin"
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-aztec authored and alexghr committed Nov 7, 2023
1 parent c8b8181 commit 9966ddc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion yarn-project/foundation/src/noir/noir_package_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const noirLocalDependencySchema = z.object({
const noirPackageConfigSchema = z.object({
package: z.object({
name: z.string().default(''),
type: z.enum(['lib', 'contract', 'binary']).default('binary'),
type: z.enum(['lib', 'contract', 'bin']).default('bin'),
entry: z.string().optional(),
description: z.string().optional(),
authors: z.array(z.string()).optional(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,20 @@ export class NoirWasmContractCompiler {
* Compiles the project.
*/
public async compile(): Promise<NoirCompilationArtifacts[]> {
const isContract = this.#package.getType() === 'contract';
// limit to contracts-only because the rest of the pipeline only supports processing contracts
if (!isContract) {
throw new Error('Noir project is not a contract');
}

this.#debugLog(`Compiling contract at ${this.#package.getEntryPointPath()}`);
await this.#dependencyManager.resolveDependencies();
this.#debugLog(`Dependencies: ${this.#dependencyManager.getPackageNames().join(', ')}`);

initializeResolver(this.#resolveFile);

try {
const result = compile(this.#package.getEntryPointPath(), true, {
const result = compile(this.#package.getEntryPointPath(), isContract, {
/* eslint-disable camelcase */
root_dependencies: this.#dependencyManager.getEntrypointDependencies(),
library_dependencies: this.#dependencyManager.getLibraryDependencies(),
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/noir-compiler/src/compile/noir/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class NoirPackage {
entrypoint = 'lib.nr';
break;
case 'contract':
case 'binary':
case 'bin':
entrypoint = 'main.nr';
break;
default:
Expand Down

0 comments on commit 9966ddc

Please sign in to comment.