diff --git a/.gitignore b/.gitignore index cf01bc35..f6249c0d 100644 --- a/.gitignore +++ b/.gitignore @@ -14,12 +14,14 @@ videos /build # misc +/src/config/index.ts .DS_Store .idea .env.local .env.development.local .env.test.local .env.production.local +.vscode npm-debug.log* yarn-debug.log* diff --git a/.swcrc b/.swcrc new file mode 100644 index 00000000..30025bf1 --- /dev/null +++ b/.swcrc @@ -0,0 +1,31 @@ +{ + "jsc": { + "target": "es2017", + "parser": { + "syntax": "typescript", + "tsx": true, + "decorators": false, + "dynamicImport": false + }, + "transform": { + "react": { + "pragma": "React.createElement", + "pragmaFrag": "React.Fragment", + "throwIfNamespace": true, + "development": false, + "useBuiltins": false, + "runtime": "automatic" + }, + "hidden": { + "jest": true + } + } + }, + "module": { + "type": "commonjs", + "strict": false, + "strictMode": true, + "lazy": false, + "noInterop": false + } +} diff --git a/README.md b/README.md index a985cc20..ae7201e7 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ See [Dapp template](https://template-dapp.multiversx.com/) for live demo. ## Requirements -- Node.js version 12.16.2+ -- Npm version 6.14.4+ +- Node.js version 16.20.0+ +- Npm version 8.19.4+ ## Getting Started @@ -24,35 +24,31 @@ From a terminal, navigate to the project folder and run: yarn install ``` -### Step 2. Update environment - -Go to `App.tsx` and edit the `environment` variable according to the environment you want the app to run on. -Valid values are `testnet`, `devnet` or `mainnet` - -If you need to edit the network configuration, you can pass in a `customNetworkConfig` object. -More info about this can be found in [sdk-dapp documentation](https://github.com/multiversx/sdk-dapp) - -### Step 3. Running in development mode +### Step 2. Running in development mode In the project folder run: ```bash -yarn start +yarn start-devnet - DEVNET environment +yarn start-testnet - TESTNET environmnet +yarn start-mainnet - MAINNET environmnet ``` -This will start the React app in development mode, using the configs found in the `config.tsx` file. +This will start the React app in development mode, using the configs found in the `vite.config.ts` file. Open [http://localhost:3000](http://localhost:3000) to view it in the browser. The page will reload if you make edits.\ You will also see any lint errors in the console. -### Step 4. Build for testing and production use +### Step 3. Build for testing and production use A build of the app is necessary to deploy for testing purposes or for production use. To build the project run: ```bash -yarn build +yarn build-devnet +yarn build-testnet +yarn build-mainnet ``` ## Roadmap diff --git a/config-overrides.js b/config-overrides.js deleted file mode 100644 index 1d5c1a80..00000000 --- a/config-overrides.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = function override(config) { - console.log('override'); - let loaders = config.resolve; - loaders.fallback = { - fs: false, - path: require.resolve('path-browserify'), - stream: require.resolve('stream-browserify'), - crypto: require.resolve('crypto-browserify') - }; - - return config; -}; diff --git a/public/index.html b/index.html similarity index 81% rename from public/index.html rename to index.html index 732752fd..c68c24a5 100644 --- a/public/index.html +++ b/index.html @@ -1,4 +1,4 @@ - + @@ -12,30 +12,12 @@ manifest.json provides metadata used when your web app is installed on a user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ --> - - - - - - + + + + + +