Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
#21 TEMPORARY CHECKIN, issues with build due to react esm and maybe y…
Browse files Browse the repository at this point in the history
…arn 3
  • Loading branch information
ShravanSunder committed Oct 21, 2021
1 parent 5d81def commit 6384451
Show file tree
Hide file tree
Showing 8 changed files with 323 additions and 223 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
"ship": "yarn workspace @scaffold-eth/vite-app ship",
"generate": "yarn workspace @scaffold-eth/hardhat generate",
"account": "yarn workspace @scaffold-eth/hardhat account",
"mine": "cd packages/hardhat && npx hardhat mine",
"wallet": "cd packages/hardhat && npx hardhat wallet",
"fundedwallet": "cd packages/hardhat && npx hardhat fundedwallet",
"flatten": "cd packages/hardhat && npx hardhat flatten",
"clean": "cd packages/hardhat && npx hardhat clean",
"mine": "cd packages/hardhat-ts && npx hardhat mine",
"wallet": "cd packages/hardhat-ts && npx hardhat wallet",
"fundedwallet": "cd packages/hardhat-ts && npx hardhat fundedwallet",
"flatten": "cd packages/hardhat-ts && npx hardhat flatten",
"clean": "cd packages/hardhat-ts && npx hardhat clean",
"run-graph-node": "yarn workspace @scaffold-eth/services run-graph-node",
"remove-graph-node": "yarn workspace @scaffold-eth/services remove-graph-node",
"clean-graph-node": "yarn workspace @scaffold-eth/services clean-graph-node",
Expand Down
25 changes: 12 additions & 13 deletions packages/hardhat-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
},
"dependencies": {
"@eth-optimism/hardhat-ovm": "^0.2.2",
"@ethereumjs/vm": "^5.4.1",
"@ethereumjs/vm": "^5.5.3",
"@ethersproject/providers": "^5.4.1",
"@nomiclabs/hardhat-ethers": "portal:./node_modules/hardhat-deploy-ethers",
"@nomiclabs/hardhat-waffle": "^2.0.0",
"@openzeppelin/contracts": "^4.1.0",
"@tenderly/hardhat-tenderly": "^1.0.10",
Expand All @@ -39,22 +38,22 @@
},
"devDependencies": {
"@types/jest": "^27.0.2",
"@types/node": "^16.10.2",
"eslint": "^7.29.0",
"@types/node": "^16.11.1",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-airbnb-typescript": "^14.0.0",
"eslint-config-airbnb-typescript": "^14.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jest": "^24.3.6",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jest": "^24.7.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^27.0.4",
"jest": "^27.3.1",
"node-watch": "^0.7.1",
"prettier": "^2.3.1",
"prettier": "^2.4.1",
"prettier-plugin-solidity": "^1.0.0-beta.13",
"rlp": "^2.2.6",
"solidity-coverage": "^0.7.16",
"ts-node": "^10.0.0",
"tsconfig-paths": "^3.9.0",
"rlp": "^2.2.7",
"solidity-coverage": "^0.7.17",
"ts-node": "^10.3.0",
"tsconfig-paths": "^3.11.0",
"typescript": "^4.3.4"
},
"installConfig": {
Expand Down
57 changes: 29 additions & 28 deletions packages/vite-app-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
},
"dependencies": {
"@ant-design/icons": "^4.2.2",
"@apollo/client": "^3.4.15",
"@apollo/client": "^3.4.16",
"@apollo/react-hooks": "^4.0.0",
"@emotion/react": "^11.4.0",
"@emotion/react": "^11.5.0",
"@ethersproject/address": "^5.4.0",
"@ethersproject/bignumber": "^5.4.0",
"@ethersproject/bytes": "^5.4.0",
Expand Down Expand Up @@ -55,12 +55,12 @@
"react-dom": "^17.0.2",
"react-error-boundary": "^3.1.3",
"react-qr-reader": "^2.2.1",
"react-router-dom": "^5.2.0",
"react-router-dom": "^5.3.0",
"react-stack-grid": "^0.7.1",
"request": "^2.88.2",
"stream": "^0.0.2",
"stream-browserify": "^3.0.0",
"tailwindcss": "^2.2.2",
"tailwindcss": "^2.2.17",
"timers-browserify": "^2.0.12",
"tiny-invariant": "^1.1.0",
"use-debounce": "^7.0.0",
Expand All @@ -83,48 +83,49 @@
"@typechain/hardhat": "^2.0.2",
"@types/isomorphic-fetch": "^0.0.35",
"@types/jest": "^27.0.2",
"@types/node": "^16.10.2",
"@types/pretty-time": "^1.1.0",
"@types/qrcode.react": "^1.0.1",
"@types/react": "^17.0.11",
"@types/react-blockies": "^1.4.0",
"@types/react-dom": "^17.0.8",
"@types/react-qr-reader": "^2.1.3",
"@types/react-router-dom": "^5.1.7",
"@types/react-stack-grid": "^0.7.2",
"@typescript-eslint/eslint-plugin": "^4.28.1",
"@typescript-eslint/parser": "^4.28.1",
"@vitejs/plugin-react-refresh": "^1.3.3",
"@types/node": "^16.11.1",
"@types/pretty-time": "^1.1.1",
"@types/qrcode.react": "^1.0.2",
"@types/react": "^17.0.31",
"@types/react-blockies": "^1.4.1",
"@types/react-dom": "^17.0.10",
"@types/react-qr-reader": "^2.1.4",
"@types/react-router-dom": "^5.3.1",
"@types/react-stack-grid": "^0.7.3",
"@typescript-eslint/eslint-plugin": "^5.1.0",
"@typescript-eslint/parser": "^5.1.0",
"@vitejs/plugin-react": "^1.0.5",
"@vitejs/plugin-react-refresh": "^1.3.6",
"@walletconnect/ethereum-provider": "^1.6.5",
"@web3-react/types": "^6.0.7",
"autoprefixer": "^10.2.6",
"cross-env": "^7.0.3",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-airbnb-typescript": "^14.0.0",
"eslint-config-airbnb-typescript": "^14.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-formatjs": "^2.16.1",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-formatjs": "^2.17.9",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-tailwind": "^0.2.1",
"eslint-plugin-unused-imports": "^1.1.2",
"eslint-plugin-unused-imports": "^1.1.5",
"less": "^4.1.2",
"postcss": "^8.3.5",
"prettier": "^2.3.1",
"prettier": "^2.4.1",
"rollup-plugin-polyfill-node": "^0.7.0",
"shx": "^0.3.3",
"stylelint": "^13.13.1",
"stylelint-config-recommended": "^5.0.0",
"tailwindcss": "^2.2.2",
"tailwindcss": "^2.2.17",
"tailwindcss-elevation": "^1.0.1",
"ts-node": "^10.0.0",
"twin.macro": "^2.5.0",
"ts-node": "^10.3.0",
"twin.macro": "^2.8.0",
"typescript": "^4.3.4",
"vite": "^2.3.8",
"vite": "^2.6.10",
"vite-plugin-babel-macros": "^1.0.5",
"vite-tsconfig-paths": "^3.3.13"
"vite-tsconfig-paths": "^3.3.17"
},
"browserslist": {
"production": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const ErrorFallback: FC<FallbackProps> = ({ error }) => {
<>
<div>{msg} </div>
<div>
<pre css={{ fontFamily: 'inherit' }}>{msgDetails}</pre>
<pre style={{ fontFamily: 'inherit' }}>{msgDetails}</pre>
</div>
</>
)}
Expand Down
12 changes: 8 additions & 4 deletions packages/vite-app-ts/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
/* eslint-disable */

import React from 'react';
import { StrictMode } from 'react';

//import React from 'react';

const run = async (): Promise<void> => {
// dynamic imports for code splitting
const { lazy, Suspense } = await import('react');
const { lazy, Suspense, StrictMode } = await import('react');
const ReactDOM = await import('react-dom');
await import('./helpers/__global');
const App = lazy(() => import('./components/routes/App'));

ReactDOM.render(
<React.StrictMode>
<StrictMode>
<Suspense fallback={<div />}>
<App />
</Suspense>
</React.StrictMode>,
</StrictMode>,
document.getElementById('root')
);
};

void run();

export {};
22 changes: 10 additions & 12 deletions packages/vite-app-ts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"compilerOptions": {
"target": "ESNext",
"lib": ["DOM", "DOM.Iterable", "ESNext", "ES2017"],
"sourceMap": true,
"inlineSources": true,
//"sourceMap": true,
// "inlineSources": true,
"allowJs": false,
"declarationMap": true,
"declaration": true,
Expand All @@ -13,15 +13,13 @@
"allowSyntheticDefaultImports": true,
"strict": true,
"types": [
"vite/client",
"@emotion/react",
"react",
"node",
"ethers",
"@ethersproject/providers",
"@ethersproject/abstract-provider",
"@ethersproject/abstract-signer",
"@ethersproject/wallet"
// "vite/client",
// "node",
// "ethers",
// "@ethersproject/providers",
// "@ethersproject/abstract-provider",
// "@ethersproject/abstract-signer",
// "@ethersproject/wallet"
],
"typeRoots": ["node_modules/@types", "helpers/types"] /* List of folders to include type definitions from. */,
"forceConsistentCasingInFileNames": true,
Expand All @@ -35,7 +33,7 @@
"baseUrl": ".",
"outDir": "dist",
"jsx": "react-jsxdev",
"jsxImportSource": "@emotion/react",
// "jsxImportSource": "@emotion/react",
"paths": {
"~~/*": ["./src/*"]
}
Expand Down
31 changes: 14 additions & 17 deletions packages/vite-app-ts/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,34 @@
import { defineConfig } from 'vite';
import reactRefresh from '@vitejs/plugin-react-refresh';
//import reactRefresh from '@vitejs/plugin-react-refresh';
import macrosPlugin from 'vite-plugin-babel-macros';
import react from '@vitejs/plugin-react';
import tsconfigPaths from 'vite-tsconfig-paths';
import path, { resolve } from 'path';
import nodePolyfills from 'rollup-plugin-polyfill-node';
import react from 'react';
import { esbuildCommonjs } from '@originjs/vite-plugin-commonjs';

console.log('env:dev', process.env.ENVIRONMENT);
//console.log('env:dev', process.env.ENVIRONMENT);
// https://vitejs.dev/config/
export default defineConfig({
plugins: [nodePolyfills(), reactRefresh(), macrosPlugin(), tsconfigPaths()],
plugins: [nodePolyfills(), react(), macrosPlugin(), tsconfigPaths()],

build: {
sourcemap: true,
// sourcemap: true,
commonjsOptions: {
include: /node_modules/,
transformMixedEsModules: true,
...{
namedExports: {
react: Object.keys(react),
// 'react-dom': Object.keys(reactDom),
// 'react-is': Object.keys(reactIs),
// 'prop-types': Object.keys(propTypes),
},
},
// esmExternals: true,
},
},
esbuild: {
jsxFactory: 'jsx',
jsxInject: `import {jsx, css} from '@emotion/react'`,
//jsxFactory: 'jsx',
//jsxInject: `import {jsx, css} from '@emotion/react'`,
},

define: {},
optimizeDeps: {
include: ['eth-hooks', 'eth-components'],
exclude: ['@apollo/client', `graphql`],
include: ['react', 'react/jsx-runtime'],
//exclude: ['@apollo/client', `graphql`, 'react'],
},
resolve: {
alias: {
Expand Down
Loading

0 comments on commit 6384451

Please sign in to comment.