Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improved based on feedback
Browse files Browse the repository at this point in the history
Thunkar committed Feb 8, 2024

Verified

This commit was signed with the committer’s verified signature.
Thunkar Gregorio Juliana
1 parent 20dbadc commit 536b2a9
Showing 3 changed files with 47 additions and 3 deletions.
22 changes: 22 additions & 0 deletions compiler/wasm/src/index.cts
Original file line number Diff line number Diff line change
@@ -12,6 +12,28 @@ import { inflateDebugSymbols } from './noir/debug';
* @param projectPath - The path to the project inside the file manager. Defaults to the root of the file manager
* @param logFn - A logging function. If not provided, console.log will be used
* @param debugLogFn - A debug logging function. If not provided, logFn will be used
*
* @example
* ```typescript
* // Node.js
*
* import { compile, createFileManager } from '@noir-lang/noir_wasm';
*
* const fm = createFileManager(myProjectPath);
* const myCompiledCode = await compile(fm);
* ```
*
* ```typescript
* // Browser
*
* import { compile, createFileManager } from '@noir-lang/noir_wasm';
*
* const fm = createFileManager('/');
* for (const path of files) {
* await fm.writeFile(path, await getFileAsStream(path));
* }
* const myCompiledCode = await compile(fm);
* ```
*/
async function compile(
fileManager: FileManager,
22 changes: 22 additions & 0 deletions compiler/wasm/src/index.mts
Original file line number Diff line number Diff line change
@@ -12,6 +12,28 @@ import { inflateDebugSymbols } from './noir/debug';
* @param projectPath - The path to the project inside the file manager. Defaults to the root of the file manager
* @param logFn - A logging function. If not provided, console.log will be used
* @param debugLogFn - A debug logging function. If not provided, logFn will be used
*
* @example
* ```typescript
* // Node.js
*
* import { compile, createFileManager } from '@noir-lang/noir_wasm';
*
* const fm = createFileManager(myProjectPath);
* const myCompiledCode = await compile(fm);
* ```
*
* ```typescript
* // Browser
*
* import { compile, createFileManager } from '@noir-lang/noir_wasm';
*
* const fm = createFileManager('/');
* for (const path of files) {
* await fm.writeFile(path, await getFileAsStream(path));
* }
* const myCompiledCode = await compile(fm);
* ```
*/
async function compile(
fileManager: FileManager,
6 changes: 3 additions & 3 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -217,7 +217,7 @@ export default {
entryPoints: ['../compiler/wasm/src/index.cts'],
tsconfig: '../compiler/wasm/tsconfig.json',
entryPointStrategy: 'resolve',
out: 'processed-docs/reference/noir_wasm',
out: 'processed-docs/reference/NoirJS/noir_wasm',
plugin: ['typedoc-plugin-markdown'],
name: 'noir_wasm',
disableSources: true,
@@ -226,7 +226,7 @@ export default {
sidebar: {
filteredIds: ['reference/noir_wasm/index'],
},
readme: '../compiler/wasm/README.md',
readme: 'none',
hidePageHeader: true,
hideBreadcrumbs: true,
hideInPageTOC: true,
@@ -238,7 +238,7 @@ export default {
indexFormat: 'table',
outputFileStrategy: 'members',
memberPageTitle: '{name}',
membersWithOwnFile: ['Interface', 'Class', 'TypeAlias'],
membersWithOwnFile: ['Function', 'TypeAlias'],
},
],
],

0 comments on commit 536b2a9

Please sign in to comment.