diff --git a/apps/noir-compiler/.eslintrc b/apps/noir-compiler/.eslintrc new file mode 100644 index 00000000000..2d85f9fa667 --- /dev/null +++ b/apps/noir-compiler/.eslintrc @@ -0,0 +1,3 @@ +{ + "extends": "../../.eslintrc.json", +} \ No newline at end of file diff --git a/apps/noir-compiler/project.json b/apps/noir-compiler/project.json new file mode 100644 index 00000000000..43c9e9e4a20 --- /dev/null +++ b/apps/noir-compiler/project.json @@ -0,0 +1,67 @@ +{ + "name": "noir-compiler", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "apps/noir-compiler/src", + "projectType": "application", + "implicitDependencies": [], + "targets": { + "build": { + "executor": "@nrwl/webpack:webpack", + "outputs": ["{options.outputPath}"], + "defaultConfiguration": "development", + "options": { + "compiler": "babel", + "outputPath": "dist/apps/noir-compiler", + "index": "apps/noir-compiler/src/index.html", + "baseHref": "./", + "main": "apps/noir-compiler/src/main.tsx", + "polyfills": "apps/noir-compiler/src/polyfills.ts", + "tsConfig": "apps/noir-compiler/tsconfig.app.json", + "assets": ["apps/noir-compiler/src/profile.json", "apps/noir-compiler/src/snarkjs.min.js"], + "styles": ["apps/noir-compiler/src/css/app.css"], + "scripts": [], + "webpackConfig": "apps/noir-compiler/webpack.config.js" + }, + "configurations": { + "development": { + }, + "production": { + "fileReplacements": [ + { + "replace": "apps/noir-compiler/src/environments/environment.ts", + "with": "apps/noir-compiler/src/environments/environment.prod.ts" + } + ] + } + } + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["apps/noir-compiler/**/*.ts"], + "eslintConfig": "apps/noir-compiler/.eslintrc" + } + }, + "serve": { + "executor": "@nrwl/webpack:dev-server", + "defaultConfiguration": "development", + "options": { + "buildTarget": "noir-compiler:build", + "hmr": true, + "baseHref": "/" + }, + "configurations": { + "development": { + "buildTarget": "noir-compiler:build:development", + "port": 2023 + }, + "production": { + "buildTarget": "noir-compiler:build:production" + } + } + } + }, + "tags": [] + } + \ No newline at end of file diff --git a/apps/noir-compiler/src/app/services/noirPluginClient.ts b/apps/noir-compiler/src/app/services/noirPluginClient.ts new file mode 100644 index 00000000000..e2872172100 --- /dev/null +++ b/apps/noir-compiler/src/app/services/noirPluginClient.ts @@ -0,0 +1,23 @@ +import { PluginClient } from '@remixproject/plugin' +import { createClient } from '@remixproject/plugin-webview' +import EventManager from 'events' + +export class NoirPluginClient extends PluginClient { + public internalEvents: EventManager + + constructor() { + super() + this.methods = ['init'] + createClient(this) + this.internalEvents = new EventManager() + this.onload() + } + + init(): void { + console.log('initializing noir plugin...') + } + + onActivation(): void { + this.internalEvents.emit('noir_activated') + } +} diff --git a/apps/noir-compiler/src/index.html b/apps/noir-compiler/src/index.html new file mode 100644 index 00000000000..a0a6618077f --- /dev/null +++ b/apps/noir-compiler/src/index.html @@ -0,0 +1,22 @@ + + +
+ +