Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shadow-cljs #225

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ pom.xml.asc
*.jar
*.class
/package-lock.json
/package.json
/.lein-*
/.nrepl-port
.hgignore
Expand Down Expand Up @@ -36,4 +35,10 @@ node_modules/
/cypress/videos
.gradle
/resources/public/contracts-build
/.python-version
/.python-version
/.cpcache

# Shadow migration related folders
out
yarn-error.log
.shadow-cljs
50 changes: 50 additions & 0 deletions config/dev_config.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{:emailer {:private-key "25677d268904ea651f84e37cfd580696c5c793dcd9730c415bf03b96003c09e9ef8"
:print-mode? true}
:logging {:level :debug
:console? true}
; :web3 {:url "wss://ropsten.infura.io/ws/v3/874e0519ba33487f89ef854b0179906c"}
:web3 {:url "ws://127.0.0.1:8549"}
:web3-events {:from-block "latest"
;; for replaying past events
:block-step 1000}
:endpoints {:port 6200}
:district/db {:user "ethlanceuser"
:host "localhost"
:database "ethlance"
:password "pass"
:port 5432}
:smart-contracts
{:contracts-build-path "./resources/public/contracts-build/"
;; a working Ropsten testnet deployment
:contracts-var
{:auction-offering-factory {:name "AuctionOfferingFactory",
:address "0x959113e1c88d7e866e168ded02bf5cf8aaba2e0f"},
:buy-now-offering-factory {:name "BuyNowOfferingFactory",
:address "0xcaf0523f1ca2985b5cbba8a42a8cc413ff7512d0"},
;; Ropsten BaseRegistrarImplementation
;; https://ropsten.etherscan.io/address/0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85
:eth-registrar {:name "NameBazaarDevRegistrar",
:address "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85"},
:buy-now-offering {:name "BuyNowOffering",
:address "0x57001d4d427b9c862544b56b84a5520db10206b0"},
;; Ropsten ReverseRegistrar
;; https://ropsten.etherscan.io/address/0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c
:reverse-registrar {:name "NamebazaarDevReverseRegistrar",
:address "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c"},
;; Ropsten PublicResolver
;; https://ropsten.etherscan.io/address/0x42d63ae25990889e35f215bc95884039ba354115
:public-resolver {:name "NamebazaarDevPublicResolver",
:address "0x42D63ae25990889E35F215bC95884039Ba354115"},
:reverse-name-resolver {:name "NamebazaarDevNameResolver",
:address "0x0000000000000000000000000000000000000000"},
;; Ropsten ENSRegistry
;; https://docs.ens.domains/ens-deployments
;; https://ropsten.etherscan.io/address/0x00000000000c2e074ec69a0dfb2997ba6c7d2e1e
:ens {:name "ENSRegistry",
:address "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},
:offering-registry {:name "OfferingRegistry",
:address "0x501fa189c6ed1789cf6be5728c5e4b0a94d0c4b2"},
:district0x-emails {:name "District0xEmails",
:address "0x1383405e11d179581ae3128c0c1698be29e40565"},
:auction-offering {:name "AuctionOffering",
:address "0x0fc5ae5770a8188e1dcf46777020c186884d44dc"}}}}
File renamed without changes.
File renamed without changes.
File renamed without changes.
78 changes: 78 additions & 0 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{:paths ["src"]
:deps {
; cljs-http {:mvn/version "0.1.46"} ; Didn't find any direct uses
;; TODO migration from cljs-web3 to cljs-web3-next can be completed
;; only when the latter contains all so far missing functionality
; cljs-web3 {:mvn/version "0.19.0-0-11"}
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"}

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"}}
:main-opts ["-m" "shadow.cljs.devtools.cli"]}
:dev
{:extra-paths ["dev"]}
:ui-deps
{:extra-deps
{cljsjs/sentry-browser {:mvn/version "5.4.3-0"}
;; Can be removed when re-frame bump includes reagent 8.0.1+
reagent {:mvn/version "1.1.1"}
soda-ash/soda-ash {:mvn/version "0.83.0"}
; cljsjs/filesaverjs {:mvn/version "1.3.3-0"}
; cljsjs/prop-types {:mvn/version "15.6.0-0"}
; cljsjs/react {:mvn/version "16.4.1-0"}
; cljsjs/react-datepicker {:mvn/version "1.5.0-0"}
; cljsjs/react-dom {:mvn/version "16.4.1-0"}
; cljsjs/react-infinite {:mvn/version "0.13.0-0"}
; cljsjs/react-meta-tags {:mvn/version "0.3.0-1"}
}}}}

10 changes: 9 additions & 1 deletion dev/user.clj → dev/user_back.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns user
(ns user-bacl
(:require
[com.rpl.specter :as s]
[figwheel-sidecar.repl-api :as fw-repl]
Expand All @@ -9,6 +9,14 @@
[ring.middleware.defaults :refer [site-defaults wrap-defaults]]
[clojure.string :refer [starts-with?]]))

;(ns user)
;
;(comment
; (shadow.user/repl :spa)
; (shadow/repl :spa)
; ;:cljs/quit
; )

(defn- wrap-default-index [next-handler]
(fn [request]
(next-handler
Expand Down
43 changes: 43 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"dependencies": {
"@sentry/node": "7.31.1",
"chalk": "2.3.0",
"xmlhttprequest": "1.8.0",
"axios": "0.27.2",
"better-sqlite3": "8.0.1",
"buffer": "6.0.3",
"eccjs": "0.3.1",
"shadow-cljs": "2.20.20",
"web3": "1.7.3",
"xhr2": "0.2.1",
"chalk": "2.3.0",
"eth-ens-namehash": "2.0.0",
"ws": "2.3.1",
"xhr2": "0.1.4",
"@ensdomains/ens-contracts": "0.0.4",
"@openzeppelin/contracts": "4.1.0",
"@ungap/global-this": "0.4.4",


"react": "17.0.2",
"react-dom": "17.0.2",
"create-react-class": "15.7.0",
"@sentry/browser": "7.36.0",
"file-saver": "2.0.4",
"semantic-ui": "2.5.0",
"semantic-ui-react": "2.1.4",
"react-meta-tags": "1.0.1",
"react-infinite": "0.13.0",
"react-datepicker": "4.10.0"

},
"devDependencies": {
"source-map-support": "^0.5.21",
"@truffle/hdwallet-provider": "2.1.6",
"jsedn": "0.4.1",
"gulp": "4.0.2"
},
"resolutions": {
"del": "6.1"
}
}
7 changes: 5 additions & 2 deletions resources/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

<meta id="description" name="description" content="A peer-to-peer marketplace for the exchange of names registered via the Ethereum Name Service."/>
<link rel="stylesheet" href="/css/semantic.min.css?v=14">
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<script src="/css/semantic.min.js"></script>
<!-- End of manual semantic (link & script tags) -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/react-datepicker/0.55.0/react-datepicker.min.css">
<link rel="icon" href="/images/favicon.png">

Expand All @@ -37,9 +40,9 @@
</script>
<script src="/js/vendor/eth-ens-namehash.js"></script>
<script src="/js/vendor/sha3.min.js"></script>
<script src="/js/compiled/app.js?v=28"></script>
<script src="/js/main.js"></script>
<!-- Ethers is here only for its ABI coder. Remove when updating to a web3 version that exposes its own one. -->
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/ethers-all.umd.min.js"></script>
<!-- <script type="text/javascript" src="https://unpkg.com/[email protected]/dist/ethers-all.umd.min.js"></script> -->
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/index.js"></script>
<script type="text/javascript" src="https://unpkg.com/@walletconnect/[email protected]/dist/umd/index.min.js"></script>
<script>name_bazaar.ui.core.init();</script>
Expand Down
Loading