diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..a3d67912 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,59 @@ +version: 2.1 +jobs: + + test: + working_directory: ~/ci + docker: + # Primary container image where all steps run. + - image: 487920318758.dkr.ecr.us-west-2.amazonaws.com/cljs-web3-ci:node-16.15.1 + # Secondary container images on common network. + - image: trufflesuite/ganache:v7.6.0 + command: [-v -m "easy leave proof verb wait patient fringe laptop intact opera slab shine", -p 8549, -l 8000000, -b 0, --chain.allowUnlimitedContractSize=true] + steps: + - checkout + - restore_cache: + name: Restore npm package cache + keys: + - npm-packages-{{ checksum "yarn.lock" }} + - run: + name: Install node modules + command: yarn install + - save_cache: + name: Save npm package cache + key: npm-packages-{{ checksum "yarn.lock" }} + paths: + - ./node_modules/ + - run: npx truffle migrate --network development --reset + - run: npx shadow-cljs compile test-node + - run: node out/node-tests.js + + deploy: + working_directory: ~/ci + + docker: + - image: 487920318758.dkr.ecr.us-west-2.amazonaws.com/cljs-web3-ci:latest + aws_auth: + aws_access_key_id: $AWS_ACCESS_KEY_ID + aws_secret_access_key: $AWS_SECRET_ACCESS_KEY + steps: + - checkout + - run: + name: Build JAR + command: clojure -T:build jar + - run: + name: Release to clojars + command: clojure -T:build deploy + +workflows: + version: 2 + test_and_deploy: + jobs: + - test: + context: district0x + - deploy: + context: district0x + requires: + - test + filters: + branches: + only: master diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index da4a4cbc..00000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: feature/[FEATURE] -labels: '' -assignees: '' - ---- - -# Problem - -An overview of the background required to understand the problem. -A problem description. - -## Implementation - -Known steps towards feature implementation. -What needs further specifying and investigating. - -## Acceptance Criteria - -Rules for the future PR to be accepted. - -## Notes - -Random notes to keep in mind while implementing it. Mostly about related issues and future plans and thoughts. - -## Future Steps - -Steps which should be taken after this issue has been resolved. Is it linked to other issue? diff --git a/.github/ISSUE_TEMPLATE/full-bug-report.md b/.github/ISSUE_TEMPLATE/full-bug-report.md deleted file mode 100644 index 498d78d3..00000000 --- a/.github/ISSUE_TEMPLATE/full-bug-report.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -name: Full bug report -about: bug report template -title: bug/[BUG] -labels: bug -assignees: '' - ---- - -[comment]: # (Please replace ... with your information. Remove < and >) - -### User Story - -As a , I want to so that . - -### Description - -[comment]: # (Feature or Bug? i.e Type: Bug) -*Type*: - -[comment]: # (Describe the feature you would like, or briefly summarize the bug and what you did, what you expected to happen, and what actually happens. Sections below) -*Summary*: ... - -#### Expected behavior - -[comment]: # (Describe what you expected to happen.) - -#### Actual behavior - -[comment]: # (Describe what actually happened.) - -### Reproduction - -[comment]: # (Describe how we can replicate the bug step by step.) - -- Open webapp -- ... -- Step 3, etc. - -### Solution - -[comment]: # (Please summarise the solution and provide a task list on what needs to be fixed.) -*Summary*: - -- [ ] ... -- [ ] ... - -### Additional Information - -[comment]: # (Please do your best to fill this out.) -- browser console logs: ... -[comment]: # (browser version) -- Browser: - -#### Logs - -[comment]: # (if any sentry logs connected please paste links here) - -``` -... -``` diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index a94c227b..00000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,13 +0,0 @@ -### Summary - -[comment]: # (Summarise the problem and how the pull request solves it. You can use github links) -... - - -Documentation changes - -### Review notes - - -### Testing notes - diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 9169f396..00000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,52 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '0 9 * * 5' - -jobs: - code_analysis: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'javascript' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/hadolint.yml b/.github/workflows/hadolint.yml deleted file mode 100644 index 383610fe..00000000 --- a/.github/workflows/hadolint.yml +++ /dev/null @@ -1,48 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# hadoint is a Dockerfile linter written in Haskell -# that helps you build best practice Docker images. -# More details at https://github.com/hadolint/hadolint - -name: Hadolint - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - -permissions: - contents: read - -jobs: - hadolint: - name: Run hadolint scanning - runs-on: ubuntu-latest - strategy: - matrix: - image: ["server", "ui"] - permissions: - contents: read # for actions/checkout to fetch code - security-events: write # for github/codeql-action/upload-sarif to upload SARIF results - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Run hadolint - uses: hadolint/hadolint-action@f988afea3da57ee48710a9795b6bb677cc901183 - with: - dockerfile: ./docker-builds/${{ matrix.image }}/Dockerfile - format: sarif - output-file: hadolint-results.sarif - no-fail: true - - - name: Upload analysis results to GitHub - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: hadolint-results.sarif - wait-for-processing: true diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml deleted file mode 100644 index c4d4b7f2..00000000 --- a/.github/workflows/production.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: "production" - -on: - push: - tags: ['*'] - -jobs: - build-and-push: - runs-on: ubuntu-latest - strategy: - matrix: - image: [ 'server', 'ui' ] - steps: - - name: checkout - uses: actions/checkout@v2 - - - name: version - id: version - run: echo ::set-output name=git_tag::${GITHUB_REF#refs/tags/} - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_DEFAULT_REGION }} - - - name: Login to Amazon ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - -# TODO -# this workflow should not build image, but add tag to already existing image. -# we can't do it right now, because of BUILD_ENV=prod. It needs to be change in the project first. - - - name: ${{ matrix.image }} image - uses: docker/build-push-action@v3 - with: - push: true - file: docker-builds/${{ matrix.image }}/Dockerfile - cache-from: type=gha - cache-to: type=gha,mode=max - tags: | - ${{ secrets.ECR_REGISTRY }}/namebazaar-${{ matrix.image }}:${{ steps.version.outputs.git_tag }}-prod - ${{ secrets.ECR_REGISTRY }}/namebazaar-${{ matrix.image }}:latest-prod - build-args: | - BUILD_ENV=prod \ No newline at end of file diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml deleted file mode 100644 index 07402078..00000000 --- a/.github/workflows/qa.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: "QA" - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build-and-push: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - image: [ 'server', 'ui' ] - steps: - - name: checkout - uses: actions/checkout@v2 - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_DEFAULT_REGION }} - - - name: Login to Amazon ECR - uses: aws-actions/amazon-ecr-login@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: ${{ matrix.image }} image - uses: docker/build-push-action@v3 - with: - push: true - file: docker-builds/${{ matrix.image }}/Dockerfile - cache-from: type=gha - cache-to: type=gha,mode=max - tags: | - ${{ secrets.ECR_REGISTRY }}/namebazaar-${{ matrix.image }}:${{ github.sha }}-qa - ${{ secrets.ECR_REGISTRY }}/namebazaar-${{ matrix.image }}:latest-qa - build-args: | - BUILD_ENV=qa - trivy: - needs: build-and-push - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - image: [ 'server', 'ui' ] - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_DEFAULT_REGION }} - - - name: Login to Amazon ECR - uses: aws-actions/amazon-ecr-login@v1 - - - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@2a2157eb22c08c9a1fac99263430307b8d1bc7a2 - with: - image-ref: '${{ secrets.ECR_REGISTRY }}/namebazaar-${{ matrix.image }}:${{ github.sha }}-qa' - format: 'template' - template: '@/contrib/sarif.tpl' - output: 'trivy-results.sarif' - severity: 'CRITICAL,HIGH' - - - name: Upload Trivy scan results to GitHub Security tab - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: 'trivy-results.sarif' diff --git a/.gitignore b/.gitignore index 34eb1238..f28638b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,39 +1,11 @@ -/target -/classes -/checkouts -pom.xml -pom.xml.asc -*.jar -*.class -/package-lock.json -/package.json -/.lein-* -/.nrepl-port -.hgignore -.hg/ -/.idea/ -/name-bazaar.iml -/name-bazaar-1.iml -node_modules/ -/test-fig-compiled/ -/resources/public/js/compiled/ -/figwheel_server.log -/resources/public/contracts/build/ -/dev-backend/ -/dev-server/ -/server/ -/dev-tests/ -/server-tests/ -/src/name_bazaar/server/repl.cljs -/resources/public/css/name-bazaar.main.css.map -/npm-debug.log -/resources/public/css/ -/resources/semantic/dist/ -/config.edn -/config-beta.edn -/.node-xmlhttprequest-sync-* -/cypress/screenshots -/cypress/videos -.gradle -/resources/public/contracts-build -/.python-version \ No newline at end of file +# Shadow migration related folders +.cpcache +out +yarn-error.log +.shadow-cljs +resources/public/contracts-build +node_modules +resources/public/js +resources/public/css +Session.vim +/resources/semantic/dist/ \ No newline at end of file diff --git a/.projectile b/.projectile deleted file mode 100644 index ca7636b2..00000000 --- a/.projectile +++ /dev/null @@ -1,12 +0,0 @@ --/dev-server --/resources/public/js/compiled --/resources/public/contracts/build --/resources/semantic --/resources/public/fonts --/resources/public/icons --/resources/public/css --/resources/public/assets --/figwheel_server.log --/target --/node_modules --/.cljs_node_repl \ No newline at end of file diff --git a/.soliumignore b/.soliumignore deleted file mode 100644 index ba859017..00000000 --- a/.soliumignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -resources/public/contracts/src/ens-repo -resources/public/contracts/src/strings.sol diff --git a/.soliumrc.json b/.soliumrc.json deleted file mode 100644 index e2741f2b..00000000 --- a/.soliumrc.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "extends": "solium:recommended", - "plugins": [ - "security" - ], - "rules": { - "error-reason": "off", - "no-constant": "error", - "security/enforce-explicit-visibility": "error", - "security/no-block-members": "off", - "security/no-send": "off", - "security/no-sha3": "error", - "constructor": "error", - "visibility-first": "error", - "no-empty-blocks": "error", - "emit": "error", - "security/no-inline-assembly": "off", - "operator-whitespace": "off", - "quotes": [ - "error", - "double" - ], - "indentation": [ - "error", - 4 - ], - "linebreak-style": [ - "error", - "unix" - ] - } -} \ No newline at end of file diff --git a/bb.edn b/bb.edn new file mode 100644 index 00000000..d7f06e1e --- /dev/null +++ b/bb.edn @@ -0,0 +1,39 @@ +{:paths [] + :deps {org.babashka/cli {:mvn/version "0.4.39"}} + :tasks + {testnet {:doc "Start testnet" + :task (let [seed "easy leave proof verb wait patient fringe laptop intact opera slab shine" + host "0.0.0.0" + port "8549" + block-time "0" ; Seconds (could be fractional). 0 means instamine https://trufflesuite.com/docs/ganache/reference/cli-options/#miner + args (format "ganache --logging.verbose --wallet.mnemonic \"%s\" --server.host %s --server.port %s --miner.blockGasLimit 8000000 --chain.allowUnlimitedContractSize true --miner.blockTime=%s --chain.vmErrorsOnRPCResponse --chain.chainId 1337" seed host port block-time)] + (println "Starting testnet") + (shell args))} + compile-css {:doc "Compile LESS to CSS on file changes" + :task (do + (println "Compiling CSS/LESS under resources/semantic") + (shell {:dir "resources/semantic"} "../../node_modules/.bin/gulp build"))} + watch-css {:doc "Watch & recompile LESS to CSS on file changes" + :task (do + (println "Watching CSS/LESS under resources/semantic") + (shell {:dir "resources/semantic"} "../../node_modules/.bin/gulp watch"))} + ; Currently watch-ui runs via clojure command and watch-server via npx + ; This is to avoid the both of them binding to 9630 port (and the last one failing) + ; By starting server via npx, it connects to the existing shadow-cljs server process + watch-ui {:doc "Watch and compile ui code changes CLJS -> JS in ui/src/**" + :requires ([babashka.cli :as cli]) + :task (let [aliases (or *command-line-args* []) + command-args (format "-A:dev:shadow-cljs:ui-deps%s watch dev-ui" (clojure.string.join "" aliases))] + (println "Starting watch-ui. args:" command-args) + (clojure command-args))} + watch-server {:doc "Watch and compile server code changes CLJS -> JS in server/src/**" + :requires ([babashka.cli :as cli]) + :task (let [aliases (or *command-line-args* []) + ; command-args (format "-A:dev:shadow-cljs%s watch dev-server" (clojure.string.join "" aliases)) + command-args "npx shadow-cljs watch dev-server"] + (println "Starting watch dev-server args:" command-args) + (shell command-args))} + run-server {:doc "Start Node.js API server process" + :task (do + (println "Starting name-bazaar API server") + (shell "node out/dev-server.js"))}}} diff --git a/resources/public/contracts-migration/1_initial_migration.js b/contracts-migrations/1_initial_migration.js similarity index 100% rename from resources/public/contracts-migration/1_initial_migration.js rename to contracts-migrations/1_initial_migration.js diff --git a/resources/public/contracts-migration/2_namebazaar_migration.js b/contracts-migrations/2_namebazaar_migration.js similarity index 100% rename from resources/public/contracts-migration/2_namebazaar_migration.js rename to contracts-migrations/2_namebazaar_migration.js diff --git a/resources/public/contracts/src/AuctionOffering.sol b/contracts/AuctionOffering.sol similarity index 100% rename from resources/public/contracts/src/AuctionOffering.sol rename to contracts/AuctionOffering.sol diff --git a/resources/public/contracts/src/AuctionOfferingFactory.sol b/contracts/AuctionOfferingFactory.sol similarity index 100% rename from resources/public/contracts/src/AuctionOfferingFactory.sol rename to contracts/AuctionOfferingFactory.sol diff --git a/resources/public/contracts/src/BuyNowOffering.sol b/contracts/BuyNowOffering.sol similarity index 100% rename from resources/public/contracts/src/BuyNowOffering.sol rename to contracts/BuyNowOffering.sol diff --git a/resources/public/contracts/src/BuyNowOfferingFactory.sol b/contracts/BuyNowOfferingFactory.sol similarity index 100% rename from resources/public/contracts/src/BuyNowOfferingFactory.sol rename to contracts/BuyNowOfferingFactory.sol diff --git a/resources/public/contracts/src/District0xEmails.sol b/contracts/District0xEmails.sol similarity index 100% rename from resources/public/contracts/src/District0xEmails.sol rename to contracts/District0xEmails.sol diff --git a/resources/public/contracts/src/Migrations.sol b/contracts/Migrations.sol similarity index 100% rename from resources/public/contracts/src/Migrations.sol rename to contracts/Migrations.sol diff --git a/resources/public/contracts/src/NameBazaarDevContracts.sol b/contracts/NameBazaarDevContracts.sol similarity index 100% rename from resources/public/contracts/src/NameBazaarDevContracts.sol rename to contracts/NameBazaarDevContracts.sol diff --git a/resources/public/contracts/src/Offering.sol b/contracts/Offering.sol similarity index 100% rename from resources/public/contracts/src/Offering.sol rename to contracts/Offering.sol diff --git a/resources/public/contracts/src/OfferingFactory.sol b/contracts/OfferingFactory.sol similarity index 100% rename from resources/public/contracts/src/OfferingFactory.sol rename to contracts/OfferingFactory.sol diff --git a/resources/public/contracts/src/OfferingRegistry.sol b/contracts/OfferingRegistry.sol similarity index 100% rename from resources/public/contracts/src/OfferingRegistry.sol rename to contracts/OfferingRegistry.sol diff --git a/resources/public/contracts/src/UsedByFactories.sol b/contracts/UsedByFactories.sol similarity index 100% rename from resources/public/contracts/src/UsedByFactories.sol rename to contracts/UsedByFactories.sol diff --git a/resources/public/contracts/src/proxy/DelegateProxy.sol b/contracts/proxy/DelegateProxy.sol similarity index 100% rename from resources/public/contracts/src/proxy/DelegateProxy.sol rename to contracts/proxy/DelegateProxy.sol diff --git a/resources/public/contracts/src/proxy/Forwarder.sol b/contracts/proxy/Forwarder.sol similarity index 100% rename from resources/public/contracts/src/proxy/Forwarder.sol rename to contracts/proxy/Forwarder.sol diff --git a/resources/public/contracts/src/proxy/MutableForwarder.sol b/contracts/proxy/MutableForwarder.sol similarity index 100% rename from resources/public/contracts/src/proxy/MutableForwarder.sol rename to contracts/proxy/MutableForwarder.sol diff --git a/resources/public/contracts/src/strings.sol b/contracts/strings.sol similarity index 100% rename from resources/public/contracts/src/strings.sol rename to contracts/strings.sol diff --git a/deps.edn b/deps.edn new file mode 100644 index 00000000..42d7f4e1 --- /dev/null +++ b/deps.edn @@ -0,0 +1,65 @@ +{:paths ["src"] + :deps {binaryage/devtools {:mvn/version "1.0.6"} + org.clojure/core.match {:mvn/version "1.0.1"} + ;is.d0x/cljs-web3-next {:mvn/version "LATEST"} + com.rpl/specter {:mvn/version "1.1.1"} + compojure/compojure {:mvn/version "1.6.2"} + day8.re-frame/async-flow-fx {:mvn/version "0.0.8"} + day8.re-frame/forward-events-fx {:mvn/version "0.0.6"} + medley/medley {:mvn/version "1.4.0"} + org.clojure/clojure {:mvn/version "1.10.3"} + org.clojure/clojurescript {:mvn/version "1.11.60"} + print-foo-cljs {:mvn/version "2.0.3"} + re-frame/re-frame {:mvn/version "1.3.0"} + re-promise/re-promise {:mvn/version "0.1.1"} + ring/ring-defaults {:mvn/version "0.3.2"} + + is.d0x/district-server-bundle {:mvn/version "23.1.26"} + is.d0x/district-ui-bundle {:mvn/version "23.2.9"} + is.d0x/district-shared-bundle {:mvn/version "23.2.9"} + + district0x/async-helpers {:mvn/version "0.1.3"} + district0x/bignumber {:mvn/version "1.0.3"} + district0x/district-encryption {:mvn/version "1.0.2"} + district0x/district-sendgrid {:mvn/version "1.1.0-SNAPSHOT"} + district0x/district-server-config {:mvn/version "1.0.1"} + ;is.d0x/district-server-db {:mvn/version "LATEST"} + ;; TODO: Update to latest version. + ;; Version 1.0.2 splits the package into two separate modules. + district0x/district-server-endpoints {:mvn/version "1.0.1"} + district0x/district-server-logging {:mvn/version "1.0.6"} + ;district0x/district-server-smart-contracts {:mvn/version "1.2.9"} + ;is.d0x/district-server-web3 {:mvn/version "LATEST"} + ;is.d0x/district-server-web3-events {:mvn/version "LATEST"} + district0x/district-ui-logging {:mvn/version "1.1.0"} + district0x/district-ui-mobile {:mvn/version "1.0.0"} + district0x/error-handling {:mvn/version "1.0.4"} + + ;; d0xINFRA temporary here + akiroz.re-frame/storage {:mvn/version "0.1.2"} + bidi/bidi {:mvn/version "2.1.6"} + mount/mount {:mvn/version "0.1.11"} + camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.3"} + cljsjs/bignumber {:mvn/version "2.1.4-1"} + cljsjs/react-flexbox-grid {:mvn/version "1.0.0-0"} + cljsjs/react-highlight {:mvn/version "1.0.7-2"} + cljsjs/react-truncate {:mvn/version "2.0.3-0"} + cljsjs/react-ultimate-pagination {:mvn/version "0.8.0-0"} + com.andrewmcveigh/cljs-time {:mvn/version "0.5.2"} + com.cognitect/transit-cljs {:mvn/version "0.8.243"} + com.taoensso/timbre {:mvn/version "4.10.0"} + com.taoensso/encore {:mvn/version "2.92.0"} + day8.re-frame/http-fx {:mvn/version "0.1.4"} + kibu/pushy {:mvn/version "0.3.8"} + madvas.re-frame/google-analytics-fx {:mvn/version "0.1.0"} + madvas/cemerick-url-patched {:mvn/version "0.1.2-SNAPSHOT"} ;; Temporary until cemerick merges PR26 + madvas.re-frame/web3-fx {:mvn/version "0.2.3"}} + :aliases {:shadow-cljs {:extra-deps {thheller/shadow-cljs {:mvn/version "2.20.20"}} + :extra-paths ["test"] + :main-opts ["-m" "shadow.cljs.devtools.cli"]} + :dev {:extra-paths ["dev"]} + :ui-deps {:extra-deps + {cljsjs/sentry-browser {:mvn/version "5.4.3-0"} + reagent {:mvn/version "1.1.1"} + soda-ash/soda-ash {:mvn/version "0.83.0"}}}}} + diff --git a/dev/cljs/user.cljs b/dev/cljs/user.cljs deleted file mode 100644 index ba9ce446..00000000 --- a/dev/cljs/user.cljs +++ /dev/null @@ -1,16 +0,0 @@ -(ns cljs.user - (:require - [name-bazaar.server.dev] - [taoensso.timbre :as log])) - -(log/info "Initialized Development Environment!") -(log/info "Run (generate-data) to initialize sample dev data") - - -(defn generate-data - "Generate sample dev data" - [] - (name-bazaar.server.dev/generate-data) - (log/info "Data generation finished!")) - -(set! *main-cli-fn* name-bazaar.server.dev/-main) diff --git a/dev/user.clj b/dev/user.clj deleted file mode 100644 index f980e8ff..00000000 --- a/dev/user.clj +++ /dev/null @@ -1,77 +0,0 @@ -(ns user - (:require - [com.rpl.specter :as s] - [figwheel-sidecar.repl-api :as fw-repl] - [figwheel-sidecar.config :as fw-config] - [taoensso.timbre :as log] - [compojure.core :refer [defroutes]] - [compojure.route :as route] - [ring.middleware.defaults :refer [site-defaults wrap-defaults]] - [clojure.string :refer [starts-with?]])) - -(defn- wrap-default-index [next-handler] - (fn [request] - (next-handler - ;; whenever there is a request for asset, try to serve the asset - ;; otherwise fallback to index.html - (if (or (starts-with? (:uri request) "/css/") - (starts-with? (:uri request) "/js/") - (starts-with? (:uri request) "/images/")) - request - (assoc request :uri "/index.html"))))) - -(defroutes routes (route/resources "/")) - -;; Inspired by https://github.com/bhauman/lein-figwheel/issues/344#issuecomment-374774199 -;; and also https://github.com/quangv/re-frame-html5-routing/pull/1 -(def route-handler - "This function is responsible to serve index.html on every web route. - See :ring-handler in project.clj." - (wrap-defaults (wrap-default-index routes) site-defaults)) - -(defn- set-closure-define - "Sets the :closure-defines for the given `build-id` in the given - figwheel config `config`" - [config build-id key value] - (s/setval - [:data :all-builds (s/filterer #(= (:id %) build-id)) s/FIRST - (s/keypath :build-options :closure-defines key)] - value config)) - - -(defn start-server! [] - (fw-repl/start-figwheel! - (-> (fw-config/fetch-config) - (assoc-in [:data :figwheel-options :server-port] 4541) - ;; the next option is for contract deployment to real networks - ;; it can take time and we don't want the eval to timeout and break deployment - (assoc-in [:data :figwheel-options :repl-eval-timeout] 1800000)) ;; 30 min - "dev-server") - (fw-repl/cljs-repl "dev-server")) - - -(defn start-ui! - "Start the client build. - Passing {:prod-config? true} points the client to the production server and logging service!" - [& {:keys [:prod-config?]}] - (let [environment (if prod-config? "prod" "dev") - fig-config (fw-config/fetch-config)] - (when prod-config? (log/info "Performing ui-only build...")) - (fw-repl/start-figwheel! - (set-closure-define fig-config "dev-ui" 'name-bazaar.ui.config.environment environment) - "dev-ui") - (fw-repl/cljs-repl "dev-ui"))) - - -(defn start-tests! [] - (fw-repl/start-figwheel! - (assoc-in (fw-config/fetch-config) - [:data :figwheel-options :server-port] 4543) - "server-tests") - (fw-repl/cljs-repl "server-tests")) - - -(comment - (start-ui!) - (start-server!) - (start-tests!)) diff --git a/package.json b/package.json new file mode 100644 index 00000000..0149f119 --- /dev/null +++ b/package.json @@ -0,0 +1,45 @@ +{ + "dependencies": { + "@ensdomains/ens-contracts": "0.0.4", + "@openzeppelin/contracts": "4.1.0", + "@sentry/browser": "7.36.0", + "@sentry/node": "7.31.1", + "@ungap/global-this": "0.4.4", + "axios": "0.27.2", + "better-sqlite3": "8.0.1", + "buffer": "6.0.3", + "chalk": "2.3.0", + "create-react-class": "15.7.0", + "eccjs": "0.3.1", + "eth-ens-namehash": "2.0.0", + "file-saver": "2.0.4", + "karma": "6.3.0", + "karma-chrome-launcher": "2.2.0", + "karma-cli": "2.0.0", + "karma-cljs-test": "0.1.0", + "moment": "^2.29.4", + "react": "17.0.2", + "react-datepicker": "4.10.0", + "react-dom": "17.0.2", + "react-infinite": "0.13.0", + "react-meta-tags": "1.0.1", + "semantic-ui": "2.5.0", + "semantic-ui-react": "2.1.4", + "shadow-cljs": "2.20.20", + "web3": "1.7.3", + "ws": "2.3.1", + "xhr2": "0.1.4", + "xmlhttprequest": "1.8.0", + "xregexp": "5.1.1" + }, + "devDependencies": { + "@truffle/hdwallet-provider": "2.1.6", + "gulp": "4.0.2", + "jsedn": "0.4.1", + "source-map-support": "^0.5.21", + "truffle": "^5.8.1" + }, + "resolutions": { + "del": "6.1" + } +} diff --git a/project.clj b/project.clj.back similarity index 100% rename from project.clj rename to project.clj.back diff --git a/resources/public/index.html b/resources/public/index.html index dce12415..a7e229d3 100644 --- a/resources/public/index.html +++ b/resources/public/index.html @@ -11,6 +11,9 @@ + + + @@ -37,12 +40,11 @@ - - + - +