Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3592-Redesign of BSG sample app and port to React. #119

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fde9d86
WIP: React UI for the BSG sample app and contract update to provide h…
pbienek Jul 11, 2024
a7a8801
WIP: Fixes some missing depenencies
pbienek Jul 12, 2024
c74abad
Introduce proper linting and package order etc
pbienek Jul 12, 2024
406564e
WIP: Updates contract to emit game state when the user makes a guess.…
pbienek Jul 12, 2024
3e81662
WIP: Add some extra polish around guess states adding cursor effects …
pbienek Jul 13, 2024
2409efd
WIP: Add Unknown game state to components. Fix layout bug in the HUD …
pbienek Jul 13, 2024
de93b11
WIP: Persist data between page reloads by saving state to local storage.
pbienek Jul 13, 2024
00880d0
WIP: Added unknown state. Added battle store types. Added additional …
pbienek Jul 14, 2024
b361c59
WIP: Vastly improve performance by significantly reducing the number …
pbienek Jul 15, 2024
25cea55
WIP: Fix missing question marks due to last commit.
pbienek Jul 15, 2024
0e79849
WIP: Adds how to play page.
pbienek Jul 15, 2024
f426109
WIP: Add charts to fleet strength and cells remaining components.
pbienek Jul 15, 2024
138d6fa
WIP: move new BSG codebase from work from wip folder to the existing one
pbienek Jul 15, 2024
b29beff
WIP: Fix type errors
pbienek Jul 15, 2024
174b1d8
WIP: Adds hardhat step to build process
pbienek Jul 15, 2024
cbe288f
WIP: prevent page from shifting down when notification window opens
pbienek Jul 16, 2024
ffcbc90
Fix bug where Connect to metamask button doesnt work
pbienek Jul 16, 2024
4933f19
reposition guess notification window
pbienek Jul 16, 2024
7d6dbb9
ensure UI doesnt hang with a blank while waiting for initial wallet c…
pbienek Jul 16, 2024
27d0725
Removes styles applied in light mode.
pbienek Jul 16, 2024
419c13a
some refactoring
pbienek Jul 18, 2024
cdc6792
Adds responsiveness and a number of bug fixes.
Jul 22, 2024
b94cf59
Merge branch 'main' into pete/3591-BSG-react-port
Jul 23, 2024
3335f87
Merge branch 'main' into pete/3591-BSG-react-port
Aug 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions battleship-game/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
Expand Down
1 change: 1 addition & 0 deletions battleship-game/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.15.1
19 changes: 19 additions & 0 deletions battleship-game/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"importOrder": [
"^react$",
"<THIRD_PARTY_MODULES>",
"^@/(.*)$",
"^[./]"
],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"printWidth": 100,
"tabWidth": 4,
"singleQuote": true,
"trailingComma": "es5",
"semi": true,
"newline-before-return": true,
"no-duplicate-variable": [true, "check-parameters"],
"no-var-keyword": true
}
8 changes: 0 additions & 8 deletions battleship-game/.prettierrc.json

This file was deleted.

3 changes: 0 additions & 3 deletions battleship-game/.vscode/extensions.json

This file was deleted.

52 changes: 21 additions & 31 deletions battleship-game/README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,30 @@
# vue-tutorial
# React + TypeScript + Vite

This template should help get you started developing with Vue 3 in Vite.
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

## Recommended IDE Setup
Currently, two official plugins are available:

[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Type Support for `.vue` Imports in TS
## Expanding the ESLint configuration

TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
- Configure the top-level `parserOptions` property like this:

1. Disable the built-in TypeScript Extension
1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.

## Customize configuration

See [Vite Configuration Reference](https://vitejs.dev/config/).

## Project Setup

```sh
npm install
```js
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}
```

### Compile and Hot-Reload for Development

```sh
npm run dev
```

### Type-Check, Compile and Minify for Production

```sh
npm run build
```
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
Loading