diff --git a/README.md b/README.md index a8decef..a989bd6 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The zero-knowledge part is provided via MINA's o1js library. ## Core Components This repository is organized as a monorepo containing all the system's core components. -### MinAuth Library [:link:](https://github.com/mlabs-haskell/MinAuth/tree/develop/minauth) +### MinAuth Library [:link:](https://github.com/mlabs-haskell/MinAuth/tree/develop/library/minauth) The library provides all the core types and interfaces that allow for cooperation between the system's elements. It has functions and utilities that help quickly set up compatible authorization plugins. Additionally, it contains tools that may be useful when working with MinAuth, for example, a plugin HTTP server, and a compatible passport.js strategy. ### MinAuth Plugins [:link:](https://github.com/mlabs-haskell/MinAuth/tree/develop/plugins) @@ -40,7 +40,7 @@ The client can prove "membership" into the sets represented by merkle trees, by The plugin then monitors the chain and the contract state (and events) to build a merkle tree of secret commitments. The prover can prove that -### MinAuth Demo [:link:](https://github.com/mlabs-haskell/MinAuth/tree/develop/minauth-demo) +### MinAuth Demo [:link:](https://github.com/mlabs-haskell/MinAuth/tree/develop/demo-apps) Part of MinAuth's value proposition is to show a way to connect these innovative technologies in a full-stack web application where all the system components are configured and set up to work together. Consider it an example of how MinAuth can be set up with JWT-based ZKP-backed authentication and a playground to test out plugins or build your own. ## Usage diff --git a/devops/README.md b/_devops/README.md similarity index 100% rename from devops/README.md rename to _devops/README.md diff --git a/devops/deps.edn b/_devops/deps.edn similarity index 100% rename from devops/deps.edn rename to _devops/deps.edn diff --git a/devops/install_deps.bb b/_devops/install_deps.bb similarity index 100% rename from devops/install_deps.bb rename to _devops/install_deps.bb diff --git a/devops/mkenvrc.sh b/_devops/mkenvrc.sh similarity index 100% rename from devops/mkenvrc.sh rename to _devops/mkenvrc.sh diff --git a/bun.lockb b/bun.lockb index 31444cf..e443a70 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/minauth-demo/README.md b/demo-apps/README.md similarity index 100% rename from minauth-demo/README.md rename to demo-apps/README.md diff --git a/minauth-demo/minauth-demo-client/.eslintrc.json b/demo-apps/minauth-demo-client/.eslintrc.json similarity index 100% rename from minauth-demo/minauth-demo-client/.eslintrc.json rename to demo-apps/minauth-demo-client/.eslintrc.json diff --git a/minauth-demo/minauth-demo-client/.gitignore b/demo-apps/minauth-demo-client/.gitignore similarity index 100% rename from minauth-demo/minauth-demo-client/.gitignore rename to demo-apps/minauth-demo-client/.gitignore diff --git a/minauth-demo/minauth-demo-client/README.md b/demo-apps/minauth-demo-client/README.md similarity index 100% rename from minauth-demo/minauth-demo-client/README.md rename to demo-apps/minauth-demo-client/README.md diff --git a/minauth-demo/minauth-demo-client/next-env.d.ts b/demo-apps/minauth-demo-client/next-env.d.ts similarity index 100% rename from minauth-demo/minauth-demo-client/next-env.d.ts rename to demo-apps/minauth-demo-client/next-env.d.ts diff --git a/demo-apps/minauth-demo-client/next.config.js b/demo-apps/minauth-demo-client/next.config.js new file mode 100644 index 0000000..8159584 --- /dev/null +++ b/demo-apps/minauth-demo-client/next.config.js @@ -0,0 +1,35 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = { + productionBrowserSourceMaps: false, + reactStrictMode: false, + + webpack(config) { + config.resolve.alias = { + ...config.resolve.alias, + o1js: `${process.env.NODE_MODULES}/o1js` + }; + config.experiments = { + ...config.experiments, + topLevelAwait: true + }; + return config; + }, + // To enable o1js for the web, we must set the COOP and COEP headers. + // See here for more information: https://docs.minaprotocol.com/zkapps/how-to-write-a-zkapp-ui#enabling-coop-and-coep-headers + async headers() { + return [{ + source: '/(.*)', + headers: [{ + key: 'Cross-Origin-Opener-Policy', + value: 'same-origin' + }, + { + key: 'Cross-Origin-Embedder-Policy', + value: 'require-corp' + } + ] + }]; + } +}; + +module.exports = nextConfig; diff --git a/minauth-demo/minauth-demo-client/package.json b/demo-apps/minauth-demo-client/package.json similarity index 100% rename from minauth-demo/minauth-demo-client/package.json rename to demo-apps/minauth-demo-client/package.json diff --git a/minauth-demo/minauth-demo-client/postcss.config.js b/demo-apps/minauth-demo-client/postcss.config.js similarity index 100% rename from minauth-demo/minauth-demo-client/postcss.config.js rename to demo-apps/minauth-demo-client/postcss.config.js diff --git a/minauth-demo/minauth-demo-client/public/assets/arrow-right-small.svg b/demo-apps/minauth-demo-client/public/assets/arrow-right-small.svg similarity index 100% rename from minauth-demo/minauth-demo-client/public/assets/arrow-right-small.svg rename to demo-apps/minauth-demo-client/public/assets/arrow-right-small.svg diff --git a/minauth-demo/minauth-demo-client/public/assets/button-hover-light.png b/demo-apps/minauth-demo-client/public/assets/button-hover-light.png similarity index 100% rename from minauth-demo/minauth-demo-client/public/assets/button-hover-light.png rename to demo-apps/minauth-demo-client/public/assets/button-hover-light.png diff --git a/minauth-demo/minauth-demo-client/public/assets/favicon.ico b/demo-apps/minauth-demo-client/public/assets/favicon.ico similarity index 100% rename from minauth-demo/minauth-demo-client/public/assets/favicon.ico rename to demo-apps/minauth-demo-client/public/assets/favicon.ico diff --git a/minauth-demo/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Bold.woff b/demo-apps/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Bold.woff similarity index 100% rename from minauth-demo/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Bold.woff rename to demo-apps/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Bold.woff diff --git a/minauth-demo/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Bold.woff2 b/demo-apps/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Bold.woff2 similarity index 100% rename from minauth-demo/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Bold.woff2 rename to demo-apps/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Bold.woff2 diff --git a/minauth-demo/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Light.woff b/demo-apps/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Light.woff similarity index 100% rename from minauth-demo/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Light.woff rename to demo-apps/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Light.woff diff --git a/minauth-demo/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Light.woff2 b/demo-apps/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Light.woff2 similarity index 100% rename from minauth-demo/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Light.woff2 rename to demo-apps/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Light.woff2 diff --git a/minauth-demo/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Regular.woff b/demo-apps/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Regular.woff similarity index 100% rename from minauth-demo/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Regular.woff rename to demo-apps/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Regular.woff diff --git a/minauth-demo/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Regular.woff2 b/demo-apps/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Regular.woff2 similarity index 100% rename from minauth-demo/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Regular.woff2 rename to demo-apps/minauth-demo-client/public/assets/fonts/ABCMonumentGrotesk-Regular.woff2 diff --git a/minauth-demo/minauth-demo-client/public/assets/hash-pattern.png b/demo-apps/minauth-demo-client/public/assets/hash-pattern.png similarity index 100% rename from minauth-demo/minauth-demo-client/public/assets/hash-pattern.png rename to demo-apps/minauth-demo-client/public/assets/hash-pattern.png diff --git a/minauth-demo/minauth-demo-client/public/assets/hero-mina-logo.svg b/demo-apps/minauth-demo-client/public/assets/hero-mina-logo.svg similarity index 100% rename from minauth-demo/minauth-demo-client/public/assets/hero-mina-logo.svg rename to demo-apps/minauth-demo-client/public/assets/hero-mina-logo.svg diff --git a/minauth-demo/minauth-demo-client/public/assets/mina-gradient-bg.png b/demo-apps/minauth-demo-client/public/assets/mina-gradient-bg.png similarity index 100% rename from minauth-demo/minauth-demo-client/public/assets/mina-gradient-bg.png rename to demo-apps/minauth-demo-client/public/assets/mina-gradient-bg.png diff --git a/minauth-demo/minauth-demo-client/src/api/resource.ts b/demo-apps/minauth-demo-client/src/api/resource.ts similarity index 100% rename from minauth-demo/minauth-demo-client/src/api/resource.ts rename to demo-apps/minauth-demo-client/src/api/resource.ts diff --git a/minauth-demo/minauth-demo-client/src/api/server-config.ts b/demo-apps/minauth-demo-client/src/api/server-config.ts similarity index 100% rename from minauth-demo/minauth-demo-client/src/api/server-config.ts rename to demo-apps/minauth-demo-client/src/api/server-config.ts diff --git a/minauth-demo/minauth-demo-client/src/components/GradientBG.js b/demo-apps/minauth-demo-client/src/components/GradientBG.js similarity index 100% rename from minauth-demo/minauth-demo-client/src/components/GradientBG.js rename to demo-apps/minauth-demo-client/src/components/GradientBG.js diff --git a/minauth-demo/minauth-demo-client/src/components/dropdown.tsx b/demo-apps/minauth-demo-client/src/components/dropdown.tsx similarity index 100% rename from minauth-demo/minauth-demo-client/src/components/dropdown.tsx rename to demo-apps/minauth-demo-client/src/components/dropdown.tsx diff --git a/minauth-demo/minauth-demo-client/src/components/json-text-area.tsx b/demo-apps/minauth-demo-client/src/components/json-text-area.tsx similarity index 100% rename from minauth-demo/minauth-demo-client/src/components/json-text-area.tsx rename to demo-apps/minauth-demo-client/src/components/json-text-area.tsx diff --git a/minauth-demo/minauth-demo-client/src/components/merkle-memberships-component.tsx b/demo-apps/minauth-demo-client/src/components/merkle-memberships-component.tsx similarity index 100% rename from minauth-demo/minauth-demo-client/src/components/merkle-memberships-component.tsx rename to demo-apps/minauth-demo-client/src/components/merkle-memberships-component.tsx diff --git a/minauth-demo/minauth-demo-client/src/components/nft-timelock-prover.tsx b/demo-apps/minauth-demo-client/src/components/nft-timelock-prover.tsx similarity index 100% rename from minauth-demo/minauth-demo-client/src/components/nft-timelock-prover.tsx rename to demo-apps/minauth-demo-client/src/components/nft-timelock-prover.tsx diff --git a/minauth-demo/minauth-demo-client/src/components/overlay.tsx b/demo-apps/minauth-demo-client/src/components/overlay.tsx similarity index 100% rename from minauth-demo/minauth-demo-client/src/components/overlay.tsx rename to demo-apps/minauth-demo-client/src/components/overlay.tsx diff --git a/minauth-demo/minauth-demo-client/src/components/preimage-input.tsx b/demo-apps/minauth-demo-client/src/components/preimage-input.tsx similarity index 100% rename from minauth-demo/minauth-demo-client/src/components/preimage-input.tsx rename to demo-apps/minauth-demo-client/src/components/preimage-input.tsx diff --git a/minauth-demo/minauth-demo-client/src/components/simple-preimage-prover.tsx b/demo-apps/minauth-demo-client/src/components/simple-preimage-prover.tsx similarity index 100% rename from minauth-demo/minauth-demo-client/src/components/simple-preimage-prover.tsx rename to demo-apps/minauth-demo-client/src/components/simple-preimage-prover.tsx diff --git a/minauth-demo/minauth-demo-client/src/helpers/demo-admin.ts b/demo-apps/minauth-demo-client/src/helpers/demo-admin.ts similarity index 100% rename from minauth-demo/minauth-demo-client/src/helpers/demo-admin.ts rename to demo-apps/minauth-demo-client/src/helpers/demo-admin.ts diff --git a/minauth-demo/minauth-demo-client/src/helpers/jwt.ts b/demo-apps/minauth-demo-client/src/helpers/jwt.ts similarity index 100% rename from minauth-demo/minauth-demo-client/src/helpers/jwt.ts rename to demo-apps/minauth-demo-client/src/helpers/jwt.ts diff --git a/minauth-demo/minauth-demo-client/src/pages/_app.tsx b/demo-apps/minauth-demo-client/src/pages/_app.tsx similarity index 100% rename from minauth-demo/minauth-demo-client/src/pages/_app.tsx rename to demo-apps/minauth-demo-client/src/pages/_app.tsx diff --git a/minauth-demo/minauth-demo-client/src/pages/_document.tsx b/demo-apps/minauth-demo-client/src/pages/_document.tsx similarity index 100% rename from minauth-demo/minauth-demo-client/src/pages/_document.tsx rename to demo-apps/minauth-demo-client/src/pages/_document.tsx diff --git a/minauth-demo/minauth-demo-client/src/pages/index.tsx b/demo-apps/minauth-demo-client/src/pages/index.tsx similarity index 100% rename from minauth-demo/minauth-demo-client/src/pages/index.tsx rename to demo-apps/minauth-demo-client/src/pages/index.tsx diff --git a/minauth-demo/minauth-demo-client/src/pages/minauth-demo.tsx b/demo-apps/minauth-demo-client/src/pages/minauth-demo.tsx similarity index 100% rename from minauth-demo/minauth-demo-client/src/pages/minauth-demo.tsx rename to demo-apps/minauth-demo-client/src/pages/minauth-demo.tsx diff --git a/minauth-demo/minauth-demo-client/src/styles/Home.module.css b/demo-apps/minauth-demo-client/src/styles/Home.module.css similarity index 100% rename from minauth-demo/minauth-demo-client/src/styles/Home.module.css rename to demo-apps/minauth-demo-client/src/styles/Home.module.css diff --git a/minauth-demo/minauth-demo-client/src/styles/globals.css b/demo-apps/minauth-demo-client/src/styles/globals.css similarity index 100% rename from minauth-demo/minauth-demo-client/src/styles/globals.css rename to demo-apps/minauth-demo-client/src/styles/globals.css diff --git a/minauth-demo/minauth-demo-client/tailwind.config.js b/demo-apps/minauth-demo-client/tailwind.config.js similarity index 100% rename from minauth-demo/minauth-demo-client/tailwind.config.js rename to demo-apps/minauth-demo-client/tailwind.config.js diff --git a/minauth-demo/minauth-demo-client/tsconfig.json b/demo-apps/minauth-demo-client/tsconfig.json similarity index 100% rename from minauth-demo/minauth-demo-client/tsconfig.json rename to demo-apps/minauth-demo-client/tsconfig.json diff --git a/minauth-demo/minauth-demo-server/.gitignore b/demo-apps/minauth-demo-server/.gitignore similarity index 100% rename from minauth-demo/minauth-demo-server/.gitignore rename to demo-apps/minauth-demo-server/.gitignore diff --git a/minauth-demo/minauth-demo-server/README.md b/demo-apps/minauth-demo-server/README.md similarity index 100% rename from minauth-demo/minauth-demo-server/README.md rename to demo-apps/minauth-demo-server/README.md diff --git a/minauth-demo/minauth-demo-server/eth-contract b/demo-apps/minauth-demo-server/eth-contract similarity index 100% rename from minauth-demo/minauth-demo-server/eth-contract rename to demo-apps/minauth-demo-server/eth-contract diff --git a/minauth-demo/minauth-demo-server/jest.config.ts b/demo-apps/minauth-demo-server/jest.config.ts similarity index 100% rename from minauth-demo/minauth-demo-server/jest.config.ts rename to demo-apps/minauth-demo-server/jest.config.ts diff --git a/minauth-demo/minauth-demo-server/minauth-config.template.json b/demo-apps/minauth-demo-server/minauth-config.template.json similarity index 100% rename from minauth-demo/minauth-demo-server/minauth-config.template.json rename to demo-apps/minauth-demo-server/minauth-config.template.json diff --git a/minauth-demo/minauth-demo-server/nodemon.json b/demo-apps/minauth-demo-server/nodemon.json similarity index 100% rename from minauth-demo/minauth-demo-server/nodemon.json rename to demo-apps/minauth-demo-server/nodemon.json diff --git a/minauth-demo/minauth-demo-server/package.json b/demo-apps/minauth-demo-server/package.json similarity index 100% rename from minauth-demo/minauth-demo-server/package.json rename to demo-apps/minauth-demo-server/package.json diff --git a/minauth-demo/minauth-demo-server/plugins/erc721-timelock b/demo-apps/minauth-demo-server/plugins/erc721-timelock similarity index 100% rename from minauth-demo/minauth-demo-server/plugins/erc721-timelock rename to demo-apps/minauth-demo-server/plugins/erc721-timelock diff --git a/minauth-demo/minauth-demo-server/plugins/merkle-membership-pg-conf.json b/demo-apps/minauth-demo-server/plugins/merkle-membership-pg-conf.json similarity index 100% rename from minauth-demo/minauth-demo-server/plugins/merkle-membership-pg-conf.json rename to demo-apps/minauth-demo-server/plugins/merkle-membership-pg-conf.json diff --git a/minauth-demo/minauth-demo-server/plugins/merkle-memberships b/demo-apps/minauth-demo-server/plugins/merkle-memberships similarity index 100% rename from minauth-demo/minauth-demo-server/plugins/merkle-memberships rename to demo-apps/minauth-demo-server/plugins/merkle-memberships diff --git a/minauth-demo/minauth-demo-server/plugins/simple-preimage b/demo-apps/minauth-demo-server/plugins/simple-preimage similarity index 100% rename from minauth-demo/minauth-demo-server/plugins/simple-preimage rename to demo-apps/minauth-demo-server/plugins/simple-preimage diff --git a/minauth-demo/minauth-demo-server/plugins/simple-preimage-pg-conf.json b/demo-apps/minauth-demo-server/plugins/simple-preimage-pg-conf.json similarity index 100% rename from minauth-demo/minauth-demo-server/plugins/simple-preimage-pg-conf.json rename to demo-apps/minauth-demo-server/plugins/simple-preimage-pg-conf.json diff --git a/minauth-demo/minauth-demo-server/plugins/storage/tree-admin b/demo-apps/minauth-demo-server/plugins/storage/tree-admin similarity index 100% rename from minauth-demo/minauth-demo-server/plugins/storage/tree-admin rename to demo-apps/minauth-demo-server/plugins/storage/tree-admin diff --git a/minauth-demo/minauth-demo-server/plugins/storage/tree-user b/demo-apps/minauth-demo-server/plugins/storage/tree-user similarity index 100% rename from minauth-demo/minauth-demo-server/plugins/storage/tree-user rename to demo-apps/minauth-demo-server/plugins/storage/tree-user diff --git a/minauth-demo/minauth-demo-server/scripts/resolve-and-run.cjs b/demo-apps/minauth-demo-server/scripts/resolve-and-run.cjs similarity index 100% rename from minauth-demo/minauth-demo-server/scripts/resolve-and-run.cjs rename to demo-apps/minauth-demo-server/scripts/resolve-and-run.cjs diff --git a/minauth-demo/minauth-demo-server/src/api-server/index.ts b/demo-apps/minauth-demo-server/src/api-server/index.ts similarity index 100% rename from minauth-demo/minauth-demo-server/src/api-server/index.ts rename to demo-apps/minauth-demo-server/src/api-server/index.ts diff --git a/minauth-demo/minauth-demo-server/src/api-server/setup_jwt_passport.ts b/demo-apps/minauth-demo-server/src/api-server/setup_jwt_passport.ts similarity index 100% rename from minauth-demo/minauth-demo-server/src/api-server/setup_jwt_passport.ts rename to demo-apps/minauth-demo-server/src/api-server/setup_jwt_passport.ts diff --git a/minauth-demo/minauth-demo-server/src/headless-test-client/README.md b/demo-apps/minauth-demo-server/src/headless-test-client/README.md similarity index 100% rename from minauth-demo/minauth-demo-server/src/headless-test-client/README.md rename to demo-apps/minauth-demo-server/src/headless-test-client/README.md diff --git a/minauth-demo/minauth-demo-server/src/headless-test-client/actions.ts b/demo-apps/minauth-demo-server/src/headless-test-client/actions.ts similarity index 100% rename from minauth-demo/minauth-demo-server/src/headless-test-client/actions.ts rename to demo-apps/minauth-demo-server/src/headless-test-client/actions.ts diff --git a/minauth-demo/minauth-demo-server/src/headless-test-client/cli.ts b/demo-apps/minauth-demo-server/src/headless-test-client/cli.ts similarity index 100% rename from minauth-demo/minauth-demo-server/src/headless-test-client/cli.ts rename to demo-apps/minauth-demo-server/src/headless-test-client/cli.ts diff --git a/minauth-demo/minauth-demo-server/src/headless-test-client/client.ts b/demo-apps/minauth-demo-server/src/headless-test-client/client.ts similarity index 100% rename from minauth-demo/minauth-demo-server/src/headless-test-client/client.ts rename to demo-apps/minauth-demo-server/src/headless-test-client/client.ts diff --git a/minauth-demo/minauth-demo-server/src/headless-test-client/commands/accessProtected.ts b/demo-apps/minauth-demo-server/src/headless-test-client/commands/accessProtected.ts similarity index 100% rename from minauth-demo/minauth-demo-server/src/headless-test-client/commands/accessProtected.ts rename to demo-apps/minauth-demo-server/src/headless-test-client/commands/accessProtected.ts diff --git a/minauth-demo/minauth-demo-server/src/headless-test-client/commands/common.ts b/demo-apps/minauth-demo-server/src/headless-test-client/commands/common.ts similarity index 100% rename from minauth-demo/minauth-demo-server/src/headless-test-client/commands/common.ts rename to demo-apps/minauth-demo-server/src/headless-test-client/commands/common.ts diff --git a/minauth-demo/minauth-demo-server/src/headless-test-client/commands/login.ts b/demo-apps/minauth-demo-server/src/headless-test-client/commands/login.ts similarity index 100% rename from minauth-demo/minauth-demo-server/src/headless-test-client/commands/login.ts rename to demo-apps/minauth-demo-server/src/headless-test-client/commands/login.ts diff --git a/minauth-demo/minauth-demo-server/src/headless-test-client/commands/refresh.ts b/demo-apps/minauth-demo-server/src/headless-test-client/commands/refresh.ts similarity index 100% rename from minauth-demo/minauth-demo-server/src/headless-test-client/commands/refresh.ts rename to demo-apps/minauth-demo-server/src/headless-test-client/commands/refresh.ts diff --git a/minauth-demo/minauth-demo-server/src/headless-test-client/index.ts b/demo-apps/minauth-demo-server/src/headless-test-client/index.ts similarity index 100% rename from minauth-demo/minauth-demo-server/src/headless-test-client/index.ts rename to demo-apps/minauth-demo-server/src/headless-test-client/index.ts diff --git a/minauth-demo/minauth-demo-server/src/tests/e2e.test.ts b/demo-apps/minauth-demo-server/src/tests/e2e.test.ts similarity index 100% rename from minauth-demo/minauth-demo-server/src/tests/e2e.test.ts rename to demo-apps/minauth-demo-server/src/tests/e2e.test.ts diff --git a/minauth-demo/minauth-demo-server/src/tests/test-helper.ts b/demo-apps/minauth-demo-server/src/tests/test-helper.ts similarity index 100% rename from minauth-demo/minauth-demo-server/src/tests/test-helper.ts rename to demo-apps/minauth-demo-server/src/tests/test-helper.ts diff --git a/minauth-demo/minauth-demo-server/tsconfig.json b/demo-apps/minauth-demo-server/tsconfig.json similarity index 100% rename from minauth-demo/minauth-demo-server/tsconfig.json rename to demo-apps/minauth-demo-server/tsconfig.json diff --git a/minauth/.eslintignore b/library/minauth/.eslintignore similarity index 100% rename from minauth/.eslintignore rename to library/minauth/.eslintignore diff --git a/minauth/.gitignore b/library/minauth/.gitignore similarity index 100% rename from minauth/.gitignore rename to library/minauth/.gitignore diff --git a/minauth/LICENSE b/library/minauth/LICENSE similarity index 100% rename from minauth/LICENSE rename to library/minauth/LICENSE diff --git a/minauth/README.md b/library/minauth/README.md similarity index 100% rename from minauth/README.md rename to library/minauth/README.md diff --git a/minauth/docs/dev/1_minauthstrategy_rework.md b/library/minauth/docs/dev/1_minauthstrategy_rework.md similarity index 100% rename from minauth/docs/dev/1_minauthstrategy_rework.md rename to library/minauth/docs/dev/1_minauthstrategy_rework.md diff --git a/minauth/jest.config.ts b/library/minauth/jest.config.ts similarity index 100% rename from minauth/jest.config.ts rename to library/minauth/jest.config.ts diff --git a/minauth/package.json b/library/minauth/package.json similarity index 97% rename from minauth/package.json rename to library/minauth/package.json index ac8aeff..0bac65e 100644 --- a/minauth/package.json +++ b/library/minauth/package.json @@ -10,7 +10,7 @@ "build": "tsc -p tsconfig.json", "lint": "eslint . --ext .ts", "prettier-format": "prettier --config .prettierrc 'src/**/*.ts' --write", - "test": "echo \"E2E & integration tests are provided in the minauth-demo package.\" && jest --config jest.config.ts" + "test": "echo \"E2E & integration tests are provided in the minauth-demo-server package.\" && jest --config jest.config.ts" }, "repository": { "type": "git", diff --git a/minauth/src/common/proof.ts b/library/minauth/src/common/proof.ts similarity index 100% rename from minauth/src/common/proof.ts rename to library/minauth/src/common/proof.ts diff --git a/minauth/src/common/request.ts b/library/minauth/src/common/request.ts similarity index 100% rename from minauth/src/common/request.ts rename to library/minauth/src/common/request.ts diff --git a/minauth/src/common/verificationkey.ts b/library/minauth/src/common/verificationkey.ts similarity index 100% rename from minauth/src/common/verificationkey.ts rename to library/minauth/src/common/verificationkey.ts diff --git a/minauth/src/plugin/dummyplugin.test.ts b/library/minauth/src/plugin/dummyplugin.test.ts similarity index 100% rename from minauth/src/plugin/dummyplugin.test.ts rename to library/minauth/src/plugin/dummyplugin.test.ts diff --git a/minauth/src/plugin/dummyplugin.ts b/library/minauth/src/plugin/dummyplugin.ts similarity index 100% rename from minauth/src/plugin/dummyplugin.ts rename to library/minauth/src/plugin/dummyplugin.ts diff --git a/minauth/src/plugin/encodedecoder.ts b/library/minauth/src/plugin/encodedecoder.ts similarity index 100% rename from minauth/src/plugin/encodedecoder.ts rename to library/minauth/src/plugin/encodedecoder.ts diff --git a/minauth/src/plugin/express.ts b/library/minauth/src/plugin/express.ts similarity index 100% rename from minauth/src/plugin/express.ts rename to library/minauth/src/plugin/express.ts diff --git a/minauth/src/plugin/interfacekind.ts b/library/minauth/src/plugin/interfacekind.ts similarity index 100% rename from minauth/src/plugin/interfacekind.ts rename to library/minauth/src/plugin/interfacekind.ts diff --git a/minauth/src/plugin/logger.ts b/library/minauth/src/plugin/logger.ts similarity index 100% rename from minauth/src/plugin/logger.ts rename to library/minauth/src/plugin/logger.ts diff --git a/minauth/src/plugin/pluginrouter.ts b/library/minauth/src/plugin/pluginrouter.ts similarity index 100% rename from minauth/src/plugin/pluginrouter.ts rename to library/minauth/src/plugin/pluginrouter.ts diff --git a/minauth/src/plugin/plugintype.ts b/library/minauth/src/plugin/plugintype.ts similarity index 100% rename from minauth/src/plugin/plugintype.ts rename to library/minauth/src/plugin/plugintype.ts diff --git a/minauth/src/plugin/proofgenerator.ts b/library/minauth/src/plugin/proofgenerator.ts similarity index 100% rename from minauth/src/plugin/proofgenerator.ts rename to library/minauth/src/plugin/proofgenerator.ts diff --git a/minauth/src/server/authmapper.ts b/library/minauth/src/server/authmapper.ts similarity index 100% rename from minauth/src/server/authmapper.ts rename to library/minauth/src/server/authmapper.ts diff --git a/minauth/src/server/authmapper/plugin-to-role-mapper.ts b/library/minauth/src/server/authmapper/plugin-to-role-mapper.ts similarity index 100% rename from minauth/src/server/authmapper/plugin-to-role-mapper.ts rename to library/minauth/src/server/authmapper/plugin-to-role-mapper.ts diff --git a/minauth/src/server/minauth-passport.ts b/library/minauth/src/server/minauth-passport.ts similarity index 100% rename from minauth/src/server/minauth-passport.ts rename to library/minauth/src/server/minauth-passport.ts diff --git a/minauth/src/server/plugin-fp-api.ts b/library/minauth/src/server/plugin-fp-api.ts similarity index 100% rename from minauth/src/server/plugin-fp-api.ts rename to library/minauth/src/server/plugin-fp-api.ts diff --git a/minauth/src/server/plugin-promise-api.ts b/library/minauth/src/server/plugin-promise-api.ts similarity index 100% rename from minauth/src/server/plugin-promise-api.ts rename to library/minauth/src/server/plugin-promise-api.ts diff --git a/minauth/src/server/pluginhost.ts b/library/minauth/src/server/pluginhost.ts similarity index 100% rename from minauth/src/server/pluginhost.ts rename to library/minauth/src/server/pluginhost.ts diff --git a/minauth/src/server/pluginhost/in-memory-pluginhost.test.ts b/library/minauth/src/server/pluginhost/in-memory-pluginhost.test.ts similarity index 100% rename from minauth/src/server/pluginhost/in-memory-pluginhost.test.ts rename to library/minauth/src/server/pluginhost/in-memory-pluginhost.test.ts diff --git a/minauth/src/server/pluginhost/in-memory-pluginhost.ts b/library/minauth/src/server/pluginhost/in-memory-pluginhost.ts similarity index 100% rename from minauth/src/server/pluginhost/in-memory-pluginhost.ts rename to library/minauth/src/server/pluginhost/in-memory-pluginhost.ts diff --git a/minauth/src/server/pluginhost/plugin-server-proxy-host.test.ts b/library/minauth/src/server/pluginhost/plugin-server-proxy-host.test.ts similarity index 100% rename from minauth/src/server/pluginhost/plugin-server-proxy-host.test.ts rename to library/minauth/src/server/pluginhost/plugin-server-proxy-host.test.ts diff --git a/minauth/src/server/pluginhost/plugin-server-proxy-host.ts b/library/minauth/src/server/pluginhost/plugin-server-proxy-host.ts similarity index 100% rename from minauth/src/server/pluginhost/plugin-server-proxy-host.ts rename to library/minauth/src/server/pluginhost/plugin-server-proxy-host.ts diff --git a/minauth/src/server/pluginruntime.ts b/library/minauth/src/server/pluginruntime.ts similarity index 100% rename from minauth/src/server/pluginruntime.ts rename to library/minauth/src/server/pluginruntime.ts diff --git a/minauth/src/tools/plugin-server/config.ts b/library/minauth/src/tools/plugin-server/config.ts similarity index 100% rename from minauth/src/tools/plugin-server/config.ts rename to library/minauth/src/tools/plugin-server/config.ts diff --git a/minauth/src/tools/plugin-server/express.ts b/library/minauth/src/tools/plugin-server/express.ts similarity index 100% rename from minauth/src/tools/plugin-server/express.ts rename to library/minauth/src/tools/plugin-server/express.ts diff --git a/minauth/src/tools/plugin-server/index.ts b/library/minauth/src/tools/plugin-server/index.ts similarity index 100% rename from minauth/src/tools/plugin-server/index.ts rename to library/minauth/src/tools/plugin-server/index.ts diff --git a/minauth/src/tools/plugin-server/types.ts b/library/minauth/src/tools/plugin-server/types.ts similarity index 100% rename from minauth/src/tools/plugin-server/types.ts rename to library/minauth/src/tools/plugin-server/types.ts diff --git a/minauth/src/utils/fp/debug.ts b/library/minauth/src/utils/fp/debug.ts similarity index 100% rename from minauth/src/utils/fp/debug.ts rename to library/minauth/src/utils/fp/debug.ts diff --git a/minauth/src/utils/fp/either.ts b/library/minauth/src/utils/fp/either.ts similarity index 100% rename from minauth/src/utils/fp/either.ts rename to library/minauth/src/utils/fp/either.ts diff --git a/minauth/src/utils/fp/fieldEncDec.ts b/library/minauth/src/utils/fp/fieldEncDec.ts similarity index 100% rename from minauth/src/utils/fp/fieldEncDec.ts rename to library/minauth/src/utils/fp/fieldEncDec.ts diff --git a/minauth/src/utils/fp/readertaskeither.ts b/library/minauth/src/utils/fp/readertaskeither.ts similarity index 100% rename from minauth/src/utils/fp/readertaskeither.ts rename to library/minauth/src/utils/fp/readertaskeither.ts diff --git a/minauth/src/utils/fp/taskeither.ts b/library/minauth/src/utils/fp/taskeither.ts similarity index 100% rename from minauth/src/utils/fp/taskeither.ts rename to library/minauth/src/utils/fp/taskeither.ts diff --git a/minauth/tsconfig.browser.json b/library/minauth/tsconfig.browser.json similarity index 100% rename from minauth/tsconfig.browser.json rename to library/minauth/tsconfig.browser.json diff --git a/minauth/tsconfig.json b/library/minauth/tsconfig.json similarity index 100% rename from minauth/tsconfig.json rename to library/minauth/tsconfig.json diff --git a/minauth/tsconfig.test.json b/library/minauth/tsconfig.test.json similarity index 100% rename from minauth/tsconfig.test.json rename to library/minauth/tsconfig.test.json diff --git a/minauth-demo/minauth-demo-client/next.config.js b/minauth-demo/minauth-demo-client/next.config.js deleted file mode 100644 index dc4771d..0000000 --- a/minauth-demo/minauth-demo-client/next.config.js +++ /dev/null @@ -1,35 +0,0 @@ -/** @type {import('next').NextConfig} */ -const nextConfig = { - productionBrowserSourceMaps: false, - reactStrictMode: false, - - webpack(config) { - config.resolve.alias = { - ...config.resolve.alias, - o1js: `${process.env.NODE_MODULES}/o1js` - }; - config.experiments = { ...config.experiments, topLevelAwait: true }; - return config; - }, - // To enable o1js for the web, we must set the COOP and COEP headers. - // See here for more information: https://docs.minaprotocol.com/zkapps/how-to-write-a-zkapp-ui#enabling-coop-and-coep-headers - async headers() { - return [ - { - source: '/(.*)', - headers: [ - { - key: 'Cross-Origin-Opener-Policy', - value: 'same-origin' - }, - { - key: 'Cross-Origin-Embedder-Policy', - value: 'require-corp' - } - ] - } - ]; - } -}; - -module.exports = nextConfig; diff --git a/package.json b/package.json index 4476a94..8ac94d5 100644 --- a/package.json +++ b/package.json @@ -2,12 +2,9 @@ "name": "minauth-project", "version": "0.12.0", "workspaces": [ - "minauth", - "minauth-demo/minauth-demo-client", - "minauth-demo/minauth-demo-server", - "plugins/minauth-erc721-timelock-plugin", - "plugins/minauth-merkle-membership-plugin", - "plugins/minauth-simple-preimage-plugin" + "library/minauth", + "demo-apps/*", + "plugins/*" ], "description": "", "main": "index.js",