Skip to content

Commit

Permalink
Merge pull request #130 from NethermindEth/migrate-vite
Browse files Browse the repository at this point in the history
chore: move build tool to vite
  • Loading branch information
prix0007 authored Oct 3, 2023
2 parents c344c78 + 5081660 commit 0fd2e48
Show file tree
Hide file tree
Showing 13 changed files with 3,101 additions and 9,996 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/api-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:
# inject the expected React package URL for CORS logic
environment-variables: |
RUST_LOG=INFO
REACT_APP_URL=https://cairo-remix-dev.nethermind.io
VITE_URL=https://cairo-remix-dev.nethermind.io
PROMTAIL_USERNAME=${{secrets.PROMTAIL_USERNAME}}
PROMTAIL_PASSWORD=${{secrets.PROMTAIL_PASSWORD}}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ api/casm
api/casm/*


api/*.env

api/upload
api/upload/*

Expand Down
2 changes: 1 addition & 1 deletion api/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl Fairing for CORS {
}

// Take the Plugin App URL from the env variable, if set
match env::var("REACT_APP_URL") {
match env::var("VITE_URL") {
Ok(v) => {
response.set_header(Header::new("Access-Control-Allow-Origin", v));
}
Expand Down
8 changes: 4 additions & 4 deletions plugin/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GENERATE_SOURCEMAP=false
REACT_APP_API_URL=https://cairo-remix-api-dev.nethermind.io
REACT_APP_DEVNET_URL=http://127.0.0.1:5050
REACT_APP_REMOTE_DEVNET_URL=https://starknet-remix-devnet.nethermind.io
REACT_APP_VERSION=$npm_package_version
VITE_API_URL=https://cairo-remix-api-dev.nethermind.io
VITE_DEVNET_URL=http://127.0.0.1:5050
VITE_REMOTE_DEVNET_URL=https://starknet-remix-devnet.nethermind.io
VITE_VERSION=$npm_package_version
8 changes: 4 additions & 4 deletions plugin/.env.development
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
REACT_APP_API_URL=https://cairo-compile-remix-test.nethermind.io
REACT_APP_DEVNET_URL=http://127.0.0.1:5050
REACT_APP_REMOTE_DEVNET_URL=https://starknet-devnet-dev.nethermind.io
REACT_APP_VERSION=$npm_package_version
VITE_API_URL=https://cairo-compile-remix-test.nethermind.io
VITE_DEVNET_URL=http://127.0.0.1:5050
VITE_REMOTE_DEVNET_URL=https://starknet-devnet-dev.nethermind.io
VITE_VERSION=$npm_package_version
1 change: 1 addition & 0 deletions plugin/public/index.html → plugin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
12 changes: 7 additions & 5 deletions plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.10.1",
"react-scripts": "5.0.1",
"starknet": "5.14.1",
"vite-plugin-svgr": "^4.0.0",
"web-vitals": "^2.1.4",
"yup": "^1.2.0"
},
Expand All @@ -39,6 +39,7 @@
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@vitejs/plugin-react": "^4.1.0",
"assemblyscript": "^0.27.5",
"eslint": "^8.45.0",
"eslint-config-standard-with-typescript": "^35.0.0",
Expand All @@ -47,12 +48,13 @@
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.32.2",
"typescript": "^4.9.5"
"typescript": "^4.9.5",
"vite": "^4.4.9"
},
"scripts": {
"start": "DISABLE_ESLINT_PLUGIN=true react-scripts start",
"build": "DISABLE_ESLINT_PLUGIN=true react-scripts build",
"serve": "pnpx serve -s build",
"start": "vite",
"build": "vite build",
"serve": "vite preview --port 3000",
"deploy": "pnpm run build; pnpm run serve",
"test": "react-scripts test",
"eject": "react-scripts eject",
Expand Down
Loading

0 comments on commit 0fd2e48

Please sign in to comment.