Skip to content

Commit

Permalink
Replaced vite for next.js
Browse files Browse the repository at this point in the history
  • Loading branch information
rsodre committed Jan 11, 2024
1 parent 43b427a commit 6e47abe
Show file tree
Hide file tree
Showing 45 changed files with 1,007 additions and 2,005 deletions.
16 changes: 8 additions & 8 deletions client/.env.dev
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# static
VITE_PUBLIC_ETH_CONTRACT_ADDRESS=0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7
VITE_PUBLIC_ACCOUNT_CLASS_HASH=0x04d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f
VITE_EVENT_KEY=0x1a2f334228cee715f1f0f54053bb6b5eac54fa336e0bc1aacf7516decb0471d
VITE_PUBLIC_WORLD_ADDRESS=0x3cc6a9ed7c1e2485d4fe787a7191f1f6835cd905a3d0731fc9e24f5a39d9415
NEXT_PUBLIC_ETH_CONTRACT_ADDRESS=0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7
NEXT_PUBLIC_ACCOUNT_CLASS_HASH=0x04d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f
NEXT_EVENT_KEY=0x1a2f334228cee715f1f0f54053bb6b5eac54fa336e0bc1aacf7516decb0471d
NEXT_PUBLIC_WORLD_ADDRESS=0x3cc6a9ed7c1e2485d4fe787a7191f1f6835cd905a3d0731fc9e24f5a39d9415

# Development
VITE_PUBLIC_NODE_URL=http://localhost:5050
VITE_PUBLIC_TORII=http://0.0.0.0:8080
NEXT_PUBLIC_NODE_URL=http://localhost:5050
NEXT_PUBLIC_TORII=http://0.0.0.0:8080
# from katana
VITE_PUBLIC_MASTER_ADDRESS=0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973
VITE_PUBLIC_MASTER_PRIVATE_KEY=0x1800000000300000180000000000030000000000003006001800006600
NEXT_PUBLIC_MASTER_ADDRESS=0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973
NEXT_PUBLIC_MASTER_PRIVATE_KEY=0x1800000000300000180000000000030000000000003006001800006600
16 changes: 8 additions & 8 deletions client/.env.slot
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# static
VITE_PUBLIC_ETH_CONTRACT_ADDRESS=0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7
VITE_PUBLIC_ACCOUNT_CLASS_HASH=0x04d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f
VITE_EVENT_KEY=0x1a2f334228cee715f1f0f54053bb6b5eac54fa336e0bc1aacf7516decb0471d
VITE_PUBLIC_WORLD_ADDRESS=0x3cc6a9ed7c1e2485d4fe787a7191f1f6835cd905a3d0731fc9e24f5a39d9415
NEXT_PUBLIC_ETH_CONTRACT_ADDRESS=0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7
NEXT_PUBLIC_ACCOUNT_CLASS_HASH=0x04d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f
NEXT_EVENT_KEY=0x1a2f334228cee715f1f0f54053bb6b5eac54fa336e0bc1aacf7516decb0471d
NEXT_PUBLIC_WORLD_ADDRESS=0x3cc6a9ed7c1e2485d4fe787a7191f1f6835cd905a3d0731fc9e24f5a39d9415

# # SLOT
# VITE_PUBLIC_NODE_URL=https://api.cartridge.gg/x/loot_underworld/katana
# VITE_PUBLIC_TORII=https://api.cartridge.gg/x/loot_underworld/torii
# NEXT_PUBLIC_NODE_URL=https://api.cartridge.gg/x/loot_underworld/katana
# NEXT_PUBLIC_TORII=https://api.cartridge.gg/x/loot_underworld/torii
# # from katana
# VITE_PUBLIC_MASTER_ADDRESS=0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973
# VITE_PUBLIC_MASTER_PRIVATE_KEY=0x1800000000300000180000000000030000000000003006001800006600
# NEXT_PUBLIC_MASTER_ADDRESS=0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973
# NEXT_PUBLIC_MASTER_PRIVATE_KEY=0x1800000000300000180000000000030000000000003006001800006600
11 changes: 9 additions & 2 deletions client/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
module.exports = {
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
// 'eslint:recommended',
// 'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'plugin:@next/next/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
plugins: ['react-refresh'],
rules: {
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/no-duplicate-enum-values': 0,
'react-refresh/only-export-components': 'warn',
'no-mixed-spaces-and-tabs': 0,
// TODO: uncomment and fix all this...
'react-hooks/exhaustive-deps': 0,
'react-refresh/only-export-components': 0,
},
}
4 changes: 4 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# next.js
.next
next-env.d.ts
13 changes: 0 additions & 13 deletions client/editor/index.html

This file was deleted.

13 changes: 0 additions & 13 deletions client/index.html

This file was deleted.

23 changes: 23 additions & 0 deletions client/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

// const withTM = require('next-transpile-modules')(['somemodule', 'and-another']) // pass the modules you would like to see transpiled

/** @type {import('next').NextConfig} */
const nextConfig = {
env: {
SERVER_URL: process.env.SERVER_URL ?? '',
},
reactStrictMode: true,
transpilePackages: [
'react-ascii-text',
],
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
config.externals.push({
'utf-8-validate': 'commonjs utf-8-validate',
'bufferutil': 'commonjs bufferutil',
})
config.experiments = { asyncWebAssembly: true }
return config
},
}

export default nextConfig
Loading

0 comments on commit 6e47abe

Please sign in to comment.