From 6c4b0272c7a279791c28696ef350330c0a0ec2fd Mon Sep 17 00:00:00 2001
From: Szymon Szlachtowicz <38212223+Szymx95@users.noreply.github.com>
Date: Thu, 2 Sep 2021 01:10:14 +0200
Subject: [PATCH] Change repo to allow proposal in monorepo (#39)
---
package.json | 2 +
packages/contracts/package.json | 4 +-
packages/core/package.json | 11 +
packages/example/package.json | 9 +-
packages/example/src/assets/images/close.svg | 3 -
packages/example/src/assets/images/dapp.svg | 13 -
.../example/src/assets/images/metamask.svg | 10 -
packages/example/src/assets/images/status.svg | 5 -
packages/example/src/components/Modal.tsx | 94 -----
packages/example/src/index.html | 2 +-
packages/example/src/index.tsx | 70 +---
packages/example/src/pages/Poling.tsx | 28 --
packages/example/tsconfig.json | 1 -
packages/polling-components/.eslintrc.json | 5 +
packages/polling-components/.mocharc.json | 8 +
packages/polling-components/README.md | 0
packages/polling-components/package.json | 61 +++
.../polling-components/prettier.config.js | 1 +
.../src/components}/Poll.tsx | 3 +-
.../src/components}/PollCreation.tsx | 5 +-
.../src/components}/PollList.tsx | 0
.../src/components}/PollResults.tsx | 5 +-
packages/polling-components/src/index.ts | 6 +
.../polling-components/test/index.test.ts | 7 +
packages/polling-components/test/setup.ts | 0
packages/polling-components/tsconfig.json | 25 ++
packages/polling-hooks/.eslintrc.json | 5 +
packages/polling-hooks/.mocharc.json | 8 +
packages/polling-hooks/README.md | 0
packages/polling-hooks/package.json | 52 +++
packages/polling-hooks/prettier.config.js | 1 +
.../polling-hooks/src/hooks/useWakuVoting.ts | 10 +
packages/polling-hooks/src/index.ts | 3 +
packages/polling-hooks/test/index.test.ts | 7 +
packages/polling-hooks/test/setup.ts | 0
packages/polling-hooks/tsconfig.json | 25 ++
packages/polling-page/.eslintrc.json | 5 +
packages/polling-page/.mocharc.json | 8 +
packages/polling-page/README.md | 0
packages/polling-page/package.json | 62 +++
packages/polling-page/prettier.config.js | 1 +
.../src/assets/assets.d.ts | 0
.../src/assets/images/pollingIcon.svg | 0
.../src/components/TopBar.tsx | 11 +-
.../src/components/WakuPolling.tsx} | 50 +--
packages/polling-page/src/index.tsx | 84 ++++
packages/polling-page/test/index.test.ts | 7 +
packages/polling-page/test/setup.ts | 0
packages/polling-page/tsconfig.json | 25 ++
packages/proposal-components/.eslintrc.json | 5 +
packages/proposal-components/.mocharc.json | 8 +
packages/proposal-components/README.md | 0
packages/proposal-components/package.json | 58 +++
.../proposal-components/prettier.config.js | 1 +
.../src/components/Proposal.tsx | 5 +
packages/proposal-components/src/index.ts | 3 +
.../proposal-components/test/index.test.ts | 7 +
packages/proposal-components/test/setup.ts | 0
packages/proposal-components/tsconfig.json | 25 ++
packages/proposal-hooks/.eslintrc.json | 5 +
packages/proposal-hooks/.mocharc.json | 8 +
packages/proposal-hooks/README.md | 0
packages/proposal-hooks/package.json | 52 +++
packages/proposal-hooks/prettier.config.js | 1 +
packages/proposal-hooks/src/hooks/useTest.ts | 3 +
packages/proposal-hooks/src/index.ts | 3 +
packages/proposal-hooks/test/index.test.ts | 7 +
packages/proposal-hooks/test/setup.ts | 0
packages/proposal-hooks/tsconfig.json | 25 ++
packages/proposal-page/.eslintrc.json | 5 +
packages/proposal-page/.mocharc.json | 8 +
packages/proposal-page/README.md | 0
packages/proposal-page/package.json | 59 +++
packages/proposal-page/prettier.config.js | 1 +
packages/proposal-page/src/index.tsx | 12 +
packages/proposal-page/test/index.test.ts | 7 +
packages/proposal-page/test/setup.ts | 0
packages/proposal-page/tsconfig.json | 25 ++
packages/react-components/package.json | 13 +-
packages/react-components/src/index.tsx | 31 +-
yarn.lock | 374 +++++++++++++++---
81 files changed, 1159 insertions(+), 334 deletions(-)
delete mode 100644 packages/example/src/assets/images/close.svg
delete mode 100644 packages/example/src/assets/images/dapp.svg
delete mode 100644 packages/example/src/assets/images/metamask.svg
delete mode 100644 packages/example/src/assets/images/status.svg
delete mode 100644 packages/example/src/components/Modal.tsx
delete mode 100644 packages/example/src/pages/Poling.tsx
create mode 100644 packages/polling-components/.eslintrc.json
create mode 100644 packages/polling-components/.mocharc.json
create mode 100644 packages/polling-components/README.md
create mode 100644 packages/polling-components/package.json
create mode 100644 packages/polling-components/prettier.config.js
rename packages/{react-components/src/WakuPolling => polling-components/src/components}/Poll.tsx (96%)
rename packages/{react-components/src/WakuPolling => polling-components/src/components}/PollCreation.tsx (95%)
rename packages/{react-components/src/WakuPolling => polling-components/src/components}/PollList.tsx (100%)
rename packages/{react-components/src/WakuPolling => polling-components/src/components}/PollResults.tsx (93%)
create mode 100644 packages/polling-components/src/index.ts
create mode 100644 packages/polling-components/test/index.test.ts
create mode 100644 packages/polling-components/test/setup.ts
create mode 100644 packages/polling-components/tsconfig.json
create mode 100644 packages/polling-hooks/.eslintrc.json
create mode 100644 packages/polling-hooks/.mocharc.json
create mode 100644 packages/polling-hooks/README.md
create mode 100644 packages/polling-hooks/package.json
create mode 100644 packages/polling-hooks/prettier.config.js
create mode 100644 packages/polling-hooks/src/hooks/useWakuVoting.ts
create mode 100644 packages/polling-hooks/src/index.ts
create mode 100644 packages/polling-hooks/test/index.test.ts
create mode 100644 packages/polling-hooks/test/setup.ts
create mode 100644 packages/polling-hooks/tsconfig.json
create mode 100644 packages/polling-page/.eslintrc.json
create mode 100644 packages/polling-page/.mocharc.json
create mode 100644 packages/polling-page/README.md
create mode 100644 packages/polling-page/package.json
create mode 100644 packages/polling-page/prettier.config.js
rename packages/{example => polling-page}/src/assets/assets.d.ts (100%)
rename packages/{example => polling-page}/src/assets/images/pollingIcon.svg (100%)
rename packages/{example => polling-page}/src/components/TopBar.tsx (93%)
rename packages/{react-components/src/WakuPolling/index.tsx => polling-page/src/components/WakuPolling.tsx} (62%)
create mode 100644 packages/polling-page/src/index.tsx
create mode 100644 packages/polling-page/test/index.test.ts
create mode 100644 packages/polling-page/test/setup.ts
create mode 100644 packages/polling-page/tsconfig.json
create mode 100644 packages/proposal-components/.eslintrc.json
create mode 100644 packages/proposal-components/.mocharc.json
create mode 100644 packages/proposal-components/README.md
create mode 100644 packages/proposal-components/package.json
create mode 100644 packages/proposal-components/prettier.config.js
create mode 100644 packages/proposal-components/src/components/Proposal.tsx
create mode 100644 packages/proposal-components/src/index.ts
create mode 100644 packages/proposal-components/test/index.test.ts
create mode 100644 packages/proposal-components/test/setup.ts
create mode 100644 packages/proposal-components/tsconfig.json
create mode 100644 packages/proposal-hooks/.eslintrc.json
create mode 100644 packages/proposal-hooks/.mocharc.json
create mode 100644 packages/proposal-hooks/README.md
create mode 100644 packages/proposal-hooks/package.json
create mode 100644 packages/proposal-hooks/prettier.config.js
create mode 100644 packages/proposal-hooks/src/hooks/useTest.ts
create mode 100644 packages/proposal-hooks/src/index.ts
create mode 100644 packages/proposal-hooks/test/index.test.ts
create mode 100644 packages/proposal-hooks/test/setup.ts
create mode 100644 packages/proposal-hooks/tsconfig.json
create mode 100644 packages/proposal-page/.eslintrc.json
create mode 100644 packages/proposal-page/.mocharc.json
create mode 100644 packages/proposal-page/README.md
create mode 100644 packages/proposal-page/package.json
create mode 100644 packages/proposal-page/prettier.config.js
create mode 100644 packages/proposal-page/src/index.tsx
create mode 100644 packages/proposal-page/test/index.test.ts
create mode 100644 packages/proposal-page/test/setup.ts
create mode 100644 packages/proposal-page/tsconfig.json
diff --git a/package.json b/package.json
index 52d70e6..b4aac48 100644
--- a/package.json
+++ b/package.json
@@ -12,9 +12,11 @@
},
"scripts": {
"start": "yarn --cwd ./packages/example start",
+ "watch": "wsrun -m watch",
"lint": "wsrun -c -s lint",
"lint:fix": "wsrun -c -s lint:fix",
"build": "wsrun -e -c -s build",
+ "clean:all": "wsrun -e -c -s clean:all && rm -r ./node_modules",
"test": "wsrun -e -c -s --exclude-missing test"
},
"dependencies": {
diff --git a/packages/contracts/package.json b/packages/contracts/package.json
index 9346c41..df53984 100644
--- a/packages/contracts/package.json
+++ b/packages/contracts/package.json
@@ -5,7 +5,8 @@
"repository": "git@github.com:EthWorks/status-waku-voting.git",
"license": "MIT",
"scripts": {
- "clean": "rm -r ./{build,dist,flatten}",
+ "clean:all": "yarn clean && rimraf node_modules/",
+ "clean": "rimraf build/ && rimraf dist/ && rimraf flatten/ rimraf cache/",
"build:sol": "waffle waffle.config.json",
"build:ts": "tsc",
"build": "yarn build:sol && yarn build:ts",
@@ -25,6 +26,7 @@
"eslint": "^7.28.0",
"ethereum-waffle": "^3.3.0",
"mocha": "^9.0.0",
+ "rimraf": "^3.0.2",
"prettier": "^2.3.1",
"prettier-plugin-solidity": "^1.0.0-beta.13",
"solhint": "^3.3.6",
diff --git a/packages/core/package.json b/packages/core/package.json
index 98c3ef8..16cde94 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -5,7 +5,17 @@
"types": "dist/esm/src/index.d.ts",
"version": "0.1.0",
"license": "MIT",
+ "watch": {
+ "build": {
+ "patterns": ["src"],
+ "extensions": "ts,tsx",
+ "runOnChangeOnly": false
+ }
+ },
"scripts": {
+ "clean:all": "yarn clean && rimraf node_modules/",
+ "clean": "rimraf dist/",
+ "watch": "yarn npm-watch",
"build": "yarn run build:esm && yarn run build:cjs",
"build:esm": "tsc --module es2020 --target es2017 --outDir dist/esm",
"build:cjs": "tsc --outDir dist/cjs",
@@ -26,6 +36,7 @@
"jsdom": "^16.7.0",
"jsdom-global": "^3.0.2",
"mocha": "^9.0.3",
+ "npm-watch": "^0.11.0",
"ts-node": "^10.1.0",
"typescript": "^4.3.5"
},
diff --git a/packages/example/package.json b/packages/example/package.json
index 341219c..80b1d3a 100644
--- a/packages/example/package.json
+++ b/packages/example/package.json
@@ -4,6 +4,8 @@
"main": "index.js",
"license": "MIT",
"scripts": {
+ "clean:all": "yarn clean && rimraf node_modules/",
+ "clean": "rimraf dist/",
"build": "rm -rf dist && webpack --mode=production --env ENV=production",
"start": "webpack serve --mode=development --env ENV=development --https",
"test": "mocha -r jsdom-global/register",
@@ -13,8 +15,8 @@
"lint:prettier": "yarn prettier './{src,test}/**/*.{ts,tsx}'"
},
"dependencies": {
- "@status-waku-voting/react-components": "^0.1.0",
- "@usedapp/core": "^0.4.6",
+ "@status-waku-voting/polling-page": "^0.1.0",
+ "@status-waku-voting/proposal-page": "^0.1.0",
"assert": "^2.0.0",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0",
@@ -22,8 +24,7 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router-dom": "^5.2.0",
- "stream-browserify": "^3.0.0",
- "styled-components": "^5.3.0"
+ "stream-browserify": "^3.0.0"
},
"devDependencies": {
"@testing-library/react-hooks": "^7.0.1",
diff --git a/packages/example/src/assets/images/close.svg b/packages/example/src/assets/images/close.svg
deleted file mode 100644
index 6f9425b..0000000
--- a/packages/example/src/assets/images/close.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/packages/example/src/assets/images/dapp.svg b/packages/example/src/assets/images/dapp.svg
deleted file mode 100644
index ea6750b..0000000
--- a/packages/example/src/assets/images/dapp.svg
+++ /dev/null
@@ -1,13 +0,0 @@
-
diff --git a/packages/example/src/assets/images/metamask.svg b/packages/example/src/assets/images/metamask.svg
deleted file mode 100644
index eb78c2b..0000000
--- a/packages/example/src/assets/images/metamask.svg
+++ /dev/null
@@ -1,10 +0,0 @@
-
diff --git a/packages/example/src/assets/images/status.svg b/packages/example/src/assets/images/status.svg
deleted file mode 100644
index 28f3f58..0000000
--- a/packages/example/src/assets/images/status.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
diff --git a/packages/example/src/components/Modal.tsx b/packages/example/src/components/Modal.tsx
deleted file mode 100644
index 5523c9d..0000000
--- a/packages/example/src/components/Modal.tsx
+++ /dev/null
@@ -1,94 +0,0 @@
-import React, { ReactNode, useEffect } from 'react'
-import styled from 'styled-components'
-import closeButton from '../assets/images/close.svg'
-
-type ModalProps = {
- heading: string
- children: ReactNode
- setShowModal: (val: boolean) => void
-}
-
-export function Modal({ heading, children, setShowModal }: ModalProps) {
- const body = document.getElementById('root')
-
- useEffect(() => {
- if (body) {
- body.style.position = 'fixed'
- return () => {
- body.style.position = 'static'
- }
- }
- }, [])
-
- return (
-