From fba7ee7f2f4166a1243d9f069c64da5b16473c1b Mon Sep 17 00:00:00 2001 From: Nikita Yutanov Date: Wed, 12 Jul 2023 12:52:01 +0300 Subject: [PATCH] Move create-gear-app to dApps repo (#1293) Co-authored-by: Dmitryii Osipov --- utils/create-gear-app/.npmignore | 1 - utils/create-gear-app/README.md | 31 ----- .../gear-app-template/package.json | 7 - .../gear-app-template/template.json | 56 -------- .../gear-app-template/template/.env | 1 - .../gear-app-template/template/.eslintrc.js | 36 ------ .../gear-app-template/template/README.md | 35 ----- .../template/config-overrides.js | 6 - .../gear-app-template/template/gitignore | 20 --- .../template/public/favicon.png | Bin 1565 -> 0 bytes .../template/public/index.html | 13 -- .../gear-app-template/template/src/App.scss | 22 ---- .../gear-app-template/template/src/App.tsx | 22 ---- .../template/src/assets/images/bg.svg | 20 --- .../template/src/assets/images/icons/gear.svg | 3 - .../src/assets/images/icons/login.svg | 4 - .../template/src/assets/images/logo.svg | 15 --- .../src/assets/images/socials/discord.svg | 3 - .../src/assets/images/socials/github.svg | 3 - .../src/assets/images/socials/medium.svg | 3 - .../src/assets/images/socials/twitter.svg | 3 - .../template/src/assets/styles/_shared.scss | 6 - .../template/src/assets/styles/index.scss | 2 - .../template/src/components/index.ts | 4 - .../layout/footer/Footer.module.scss | 8 -- .../src/components/layout/footer/Footer.tsx | 14 -- .../footer/copyright/Copyright.module.scss | 5 - .../layout/footer/copyright/Copyright.tsx | 9 -- .../layout/footer/copyright/index.ts | 3 - .../src/components/layout/footer/index.ts | 3 - .../layout/footer/socials/Socials.module.scss | 7 - .../layout/footer/socials/Socials.tsx | 27 ---- .../components/layout/footer/socials/index.ts | 3 - .../layout/header/Header.module.scss | 6 - .../src/components/layout/header/Header.tsx | 18 --- .../layout/header/account/Account.tsx | 32 ----- .../account/account-button/AccountButton.tsx | 29 ----- .../header/account/account-button/index.ts | 3 - .../account/accounts-modal/AccountsModal.tsx | 30 ----- .../header/account/accounts-modal/index.ts | 3 - .../account/accounts/Accounts.module.scss | 5 - .../header/account/accounts/Accounts.tsx | 46 ------- .../layout/header/account/accounts/index.ts | 3 - .../components/layout/header/account/index.ts | 3 - .../header/account/wallet/Wallet.module.scss | 16 --- .../layout/header/account/wallet/Wallet.tsx | 23 ---- .../layout/header/account/wallet/index.ts | 3 - .../src/components/layout/header/index.ts | 3 - .../components/layout/header/logo/Logo.tsx | 12 -- .../components/layout/header/logo/index.ts | 3 - .../template/src/components/layout/index.ts | 4 - .../loaders/api-loader/ApiLoader.module.scss | 25 ---- .../loaders/api-loader/ApiLoader.tsx | 7 - .../components/loaders/api-loader/index.ts | 3 - .../template/src/components/loaders/index.ts | 4 - .../loaders/loader/Loader.module.scss | 33 ----- .../src/components/loaders/loader/Loader.tsx | 7 - .../src/components/loaders/loader/index.ts | 3 - .../gear-app-template/template/src/consts.ts | 9 -- .../template/src/global.d.ts | 7 - .../template/src/hocs/index.tsx | 30 ----- .../gear-app-template/template/src/index.tsx | 12 -- .../template/src/pages/home/Home.tsx | 5 - .../template/src/pages/home/index.ts | 3 - .../template/src/pages/index.tsx | 12 -- .../template/src/react-app-env.d.ts | 1 - .../template/src/setupTests.ts | 5 - .../template/src/utils/index.ts | 6 - .../gear-app-template/template/tsconfig.json | 21 --- utils/create-gear-app/index.js | 12 -- utils/create-gear-app/package-lock.json | 121 ------------------ utils/create-gear-app/package.json | 11 -- 72 files changed, 974 deletions(-) delete mode 100644 utils/create-gear-app/.npmignore delete mode 100644 utils/create-gear-app/README.md delete mode 100644 utils/create-gear-app/gear-app-template/package.json delete mode 100644 utils/create-gear-app/gear-app-template/template.json delete mode 100644 utils/create-gear-app/gear-app-template/template/.env delete mode 100644 utils/create-gear-app/gear-app-template/template/.eslintrc.js delete mode 100644 utils/create-gear-app/gear-app-template/template/README.md delete mode 100644 utils/create-gear-app/gear-app-template/template/config-overrides.js delete mode 100644 utils/create-gear-app/gear-app-template/template/gitignore delete mode 100644 utils/create-gear-app/gear-app-template/template/public/favicon.png delete mode 100644 utils/create-gear-app/gear-app-template/template/public/index.html delete mode 100644 utils/create-gear-app/gear-app-template/template/src/App.scss delete mode 100644 utils/create-gear-app/gear-app-template/template/src/App.tsx delete mode 100644 utils/create-gear-app/gear-app-template/template/src/assets/images/bg.svg delete mode 100644 utils/create-gear-app/gear-app-template/template/src/assets/images/icons/gear.svg delete mode 100644 utils/create-gear-app/gear-app-template/template/src/assets/images/icons/login.svg delete mode 100644 utils/create-gear-app/gear-app-template/template/src/assets/images/logo.svg delete mode 100644 utils/create-gear-app/gear-app-template/template/src/assets/images/socials/discord.svg delete mode 100644 utils/create-gear-app/gear-app-template/template/src/assets/images/socials/github.svg delete mode 100644 utils/create-gear-app/gear-app-template/template/src/assets/images/socials/medium.svg delete mode 100644 utils/create-gear-app/gear-app-template/template/src/assets/images/socials/twitter.svg delete mode 100644 utils/create-gear-app/gear-app-template/template/src/assets/styles/_shared.scss delete mode 100644 utils/create-gear-app/gear-app-template/template/src/assets/styles/index.scss delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/index.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/footer/Footer.module.scss delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/footer/Footer.tsx delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/footer/copyright/Copyright.module.scss delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/footer/copyright/Copyright.tsx delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/footer/copyright/index.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/footer/index.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/footer/socials/Socials.module.scss delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/footer/socials/Socials.tsx delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/footer/socials/index.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/header/Header.module.scss delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/header/Header.tsx delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/header/account/Account.tsx delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/header/account/account-button/AccountButton.tsx delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/header/account/account-button/index.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/header/account/accounts-modal/AccountsModal.tsx delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/header/account/accounts-modal/index.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/header/account/accounts/Accounts.module.scss delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/header/account/accounts/Accounts.tsx delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/header/account/accounts/index.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/header/account/index.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/header/account/wallet/Wallet.module.scss delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/header/account/wallet/Wallet.tsx delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/header/account/wallet/index.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/header/index.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/header/logo/Logo.tsx delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/header/logo/index.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/layout/index.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/loaders/api-loader/ApiLoader.module.scss delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/loaders/api-loader/ApiLoader.tsx delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/loaders/api-loader/index.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/loaders/index.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/loaders/loader/Loader.module.scss delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/loaders/loader/Loader.tsx delete mode 100644 utils/create-gear-app/gear-app-template/template/src/components/loaders/loader/index.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/consts.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/global.d.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/hocs/index.tsx delete mode 100644 utils/create-gear-app/gear-app-template/template/src/index.tsx delete mode 100644 utils/create-gear-app/gear-app-template/template/src/pages/home/Home.tsx delete mode 100644 utils/create-gear-app/gear-app-template/template/src/pages/home/index.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/pages/index.tsx delete mode 100644 utils/create-gear-app/gear-app-template/template/src/react-app-env.d.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/setupTests.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/src/utils/index.ts delete mode 100644 utils/create-gear-app/gear-app-template/template/tsconfig.json delete mode 100644 utils/create-gear-app/index.js delete mode 100644 utils/create-gear-app/package-lock.json delete mode 100644 utils/create-gear-app/package.json diff --git a/utils/create-gear-app/.npmignore b/utils/create-gear-app/.npmignore deleted file mode 100644 index 42c036790b..0000000000 --- a/utils/create-gear-app/.npmignore +++ /dev/null @@ -1 +0,0 @@ -gear-app-template/ \ No newline at end of file diff --git a/utils/create-gear-app/README.md b/utils/create-gear-app/README.md deleted file mode 100644 index 332c20264a..0000000000 --- a/utils/create-gear-app/README.md +++ /dev/null @@ -1,31 +0,0 @@ -

- - GEAR - -

-

- -

-
- -## Description - -A ready-made application template with a well-thought-out infrastructure for quickly turning the application on Gear blockchain. - -## Installation - -```sh -npx create-gear-app d-app -``` - -or - -```sh -npm init gear-app d-app -``` - -or - -```sh -yarn create gear-app d-app -``` diff --git a/utils/create-gear-app/gear-app-template/package.json b/utils/create-gear-app/gear-app-template/package.json deleted file mode 100644 index 6bfb11418f..0000000000 --- a/utils/create-gear-app/gear-app-template/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@gear-js/cra-template-gear-app", - "version": "0.1.21", - "description": "A ready-made application template with a well-thought-out infrastructure for quickly turning the application on Gear blockchain.", - "author": "Gear Technologies", - "license": "GPL-3.0" -} diff --git a/utils/create-gear-app/gear-app-template/template.json b/utils/create-gear-app/gear-app-template/template.json deleted file mode 100644 index 89caef7b76..0000000000 --- a/utils/create-gear-app/gear-app-template/template.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "package": { - "scripts": { - "start": "react-app-rewired start", - "build": "react-app-rewired build", - "test": "react-app-rewired test" - }, - "dependencies": { - "@gear-js/api": "0.30.6", - "@gear-js/react-hooks": "0.5.16", - "@gear-js/ui": "0.5.19", - "@mantine/form": "6.0.8", - "@polkadot/api": "10.3.4", - "@polkadot/extension-dapp": "0.45.5", - "@polkadot/react-identicon": "3.1.4", - "@polkadot/types": "10.3.4", - "@polkadot/util": "11.1.3", - "@polkadot/wasm-crypto": "7.0.3", - "@testing-library/jest-dom": "5.16.4", - "@testing-library/react": "13.2.0", - "@testing-library/user-event": "13.5.0", - "@types/jest": "27.5.1", - "@types/node": "18.15.11", - "@types/react": "18.0.37", - "@types/react-dom": "18.0.11", - "assert": "2.0.0", - "buffer": "6.0.3", - "clsx": "1.2.1", - "react": "18.2.0", - "react-dom": "18.2.0", - "react-router-dom": "6.10.0", - "react-scripts": "5.0.1", - "react-transition-group": "4.4.5", - "sass": "1.62.0", - "typescript": "4.9.5", - "web-vitals": "3.3.1" - }, - "devDependencies": { - "@typescript-eslint/eslint-plugin": "5.25.0", - "@typescript-eslint/parser": "5.25.0", - "eslint": "8.16.0", - "eslint-config-airbnb": "19.0.4", - "eslint-config-airbnb-typescript": "17.0.0", - "eslint-config-prettier": "8.8.0", - "eslint-plugin-import": "2.27.5", - "eslint-plugin-jsx-a11y": "6.7.1", - "eslint-plugin-react": "7.32.2", - "eslint-plugin-react-hooks": "4.6.0", - "react-app-rewired": "2.2.1" - }, - "browserslist": { - "production": ["chrome >= 67", "edge >= 79", "firefox >= 68", "opera >= 54", "safari >= 14"], - "development": ["last 1 chrome version", "last 1 firefox version", "last 1 safari version"] - } - } -} diff --git a/utils/create-gear-app/gear-app-template/template/.env b/utils/create-gear-app/gear-app-template/template/.env deleted file mode 100644 index 3a0bd030c5..0000000000 --- a/utils/create-gear-app/gear-app-template/template/.env +++ /dev/null @@ -1 +0,0 @@ -REACT_APP_NODE_ADDRESS=wss://node-workshop.gear.rs:443 diff --git a/utils/create-gear-app/gear-app-template/template/.eslintrc.js b/utils/create-gear-app/gear-app-template/template/.eslintrc.js deleted file mode 100644 index e24d721bf1..0000000000 --- a/utils/create-gear-app/gear-app-template/template/.eslintrc.js +++ /dev/null @@ -1,36 +0,0 @@ -module.exports = { - root: true, - env: { - browser: true, - es2021: true, - }, - extends: [ - 'plugin:react/recommended', - 'airbnb', - 'airbnb/hooks', - 'airbnb-typescript', - - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md#when-not-to-use-it - // https://github.com/yannickcr/eslint-plugin-react/issues/3052#issuecomment-1017555974 - 'plugin:react/jsx-runtime', - - 'prettier', - ], - parser: '@typescript-eslint/parser', - parserOptions: { - project: './tsconfig.json', - }, - plugins: ['react', '@typescript-eslint'], - rules: { - 'react/require-default-props': 'off', // we don't use prop-types - - 'import/prefer-default-export': 'off', // force named exports - 'import/no-default-export': 'error', - - '@typescript-eslint/no-unused-vars': 'warn', // 'error' is not convinient in development - - 'consistent-return': 'off', // we want functions to have different return behavior - - 'react/jsx-props-no-spreading': ['error', { exceptions: ['Input', 'FileInput', 'Textarea', 'Select'] }], // disable for form elements, cuz @mantine/form input props needs to be desctructured - }, -}; diff --git a/utils/create-gear-app/gear-app-template/template/README.md b/utils/create-gear-app/gear-app-template/template/README.md deleted file mode 100644 index 8a2da907b1..0000000000 --- a/utils/create-gear-app/gear-app-template/template/README.md +++ /dev/null @@ -1,35 +0,0 @@ -

- - GEAR - -

-

- -

-
- -## Description - -React application of [_wiki link_](#) based on [Rust smart-contract](#). - -## Getting started - -### Install packages: - -```sh -yarn install -``` - -### Declare environment variables: - -Create `.env` file, `.env.example` will let you know what variables are expected. - -In order for all features to work as expected, the node and it's runtime version should be chosen based on the current `@gear-js/api` version. - -In case of issues with the application, try to switch to another network or run your own local node and specify its address in the .env file. When applicable, make sure the smart contract(s) wasm files are uploaded and running in this network accordingly. - -### Run the app: - -```sh -yarn start -``` diff --git a/utils/create-gear-app/gear-app-template/template/config-overrides.js b/utils/create-gear-app/gear-app-template/template/config-overrides.js deleted file mode 100644 index 602cf1defc..0000000000 --- a/utils/create-gear-app/gear-app-template/template/config-overrides.js +++ /dev/null @@ -1,6 +0,0 @@ -const webpack = require('webpack'); - -module.exports = (config) => { - config.plugins.push(new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'] })); - return config; -}; diff --git a/utils/create-gear-app/gear-app-template/template/gitignore b/utils/create-gear-app/gear-app-template/template/gitignore deleted file mode 100644 index c84a3db1a5..0000000000 --- a/utils/create-gear-app/gear-app-template/template/gitignore +++ /dev/null @@ -1,20 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env - -npm-debug.log* -yarn-debug.log* -yarn-error.log* diff --git a/utils/create-gear-app/gear-app-template/template/public/favicon.png b/utils/create-gear-app/gear-app-template/template/public/favicon.png deleted file mode 100644 index d8449f9a938fdeff5bf88e70e1ca811b17d55312..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1565 zcmZ{hdrZ?;6vr=*DwGxk1w^K+0t2SB{q-g7gwj&9RUlAG5k#S_eMw)^*5{apF%^t} zprMkPh=_=6U=33QK?77lK*a)%D56+&@|sfwdC7j5C1WQ05KJTA+S;+0$V1VVXvITDGya^*@$NXX#eU~q77Qc_ZGZtkZ~pSEw`o|u?e zSXijn>oYPkhK7dH)6=J>rnFk^vSrKa>+6+DrKhK7O-)TvQIUg#!-^FvPMkRL@ZrOo zH*fa#_8vceeE06%6%`f9$;p>5UpARc@7}$;cJ12Z$B#dL{8(IEJTfwJ>Cz=CmDSpHb?U{77e=G;?c2BZ_V!g(RgWG$N=r)<2m}g+!eX&xW@g64#m&sj zL`O&S`TV0tkLKj$BqSt|$>hGizNo0E(b3V8l9EG*4pmlGA`pnOvNA6(FDw>IB9S^e zI$T{{@7=qXot>SZpRdtqcs$RP#SWq5dadwcuj0PD?jiIA5oA|7tuXbX?^@D#tvz{p)c-}l+|HkrMF>R@> zuDNk=-+}!O)mt%R&XZG<$88ixZev&|M|-qGPA+S+cXS726#6SoCSoXa&8O1d1*y zr*{>SojP4Fbb?M763|1(67HWXSIcDHl+_epP<8A^@l^M~dbZDb((aUB(L3sAdrTKR<{aMAb1UhkTp{Vq?&1aq=ncxzHl-f8i18yY znhGTm8YdAYxtx(F>)MM~wcIrn4UfG(%H2Wu@qPm3!y4Hw&Ov>e^3l_$qtD`plUzo> zUS-bt&RU;j7X2_tj-}uFU1GJvy{|sUb1o=icD;FS?T`)T*TnIA=MZRkbUwPUt-758 zotP#{6~hS-@B}CTPYQs@JcvjmK{OI^Egnz9<4sA1SN{q{r@khvc@F9f{pVX zv}%cNuOL+nI7)$393ha(MJX5xc0D#QfQljDAyNRI8~_n8(GUeA)9Exc9B%L4y;%7? z4F^nP)v3~_M@C>nuzcQ;C(|p1G#X1S(ksO(9gP+Rqgnu!&eh_+U_SSx(PUz|RHg$E zmEZ(Ye}WnJ1wQ{Uaq^uy**s$YWwjlQcq~97ON$FSlkze>k@L&o+ z6ey5HB|&)N_rf|~7;#$Q6C*z$26!g()cN3HxWr#jisf>EM6M9S-^VFcI)z$_lL+?6 zMQW86_wQhEVu=th6jOzP6lx%eKqQOA5JgDd85l^UtY0q?39zsN3%`$%yCV$l061Zh JtO{mw`rm>^e - - - - - - Gear *app* dApp Example - - - -
- - diff --git a/utils/create-gear-app/gear-app-template/template/src/App.scss b/utils/create-gear-app/gear-app-template/template/src/App.scss deleted file mode 100644 index 595b35a7d0..0000000000 --- a/utils/create-gear-app/gear-app-template/template/src/App.scss +++ /dev/null @@ -1,22 +0,0 @@ -@use 'assets/styles'; -@use '@gear-js/ui/variables' as *; - -#root { - max-width: 1200px; - min-height: 100vh; - margin: 0 auto; - padding: 0 16px; - display: flex; - flex-direction: column; - box-sizing: content-box; -} - -main { - flex: 1; - padding: 30px 0 60px; - position: relative; // for loaders -} - -body { - background: $bgColor url(assets/images/bg.svg); -} diff --git a/utils/create-gear-app/gear-app-template/template/src/App.tsx b/utils/create-gear-app/gear-app-template/template/src/App.tsx deleted file mode 100644 index fed9fcf25f..0000000000 --- a/utils/create-gear-app/gear-app-template/template/src/App.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { useApi, useAccount } from '@gear-js/react-hooks'; -import { Routing } from 'pages'; -import { Header, Footer, ApiLoader } from 'components'; -import { withProviders } from 'hocs'; -import 'App.scss'; - -function Component() { - const { isApiReady } = useApi(); - const { isAccountReady } = useAccount(); - - const isAppReady = isApiReady && isAccountReady; - - return ( - <> -
-
{isAppReady ? : }
-