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

chore: mirgation nextJS #5

Merged
merged 27 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
cd0f674
chore: nextJS migration | *removed styles due to near future material…
0xtiti Mar 15, 2024
7be2f67
test: vitest adapted to nextJS environment, simple testing
0xtiti Mar 17, 2024
0423a75
fix: test type assertion | build type assertion fixes
0xtiti Mar 17, 2024
b2c20e5
fix: removed build info file
0xtiti Mar 17, 2024
bc5047e
fix: added tsconfig.tsbuildinfo to gitignore - false possitive on pri…
0xtiti Mar 17, 2024
af6a7d0
fix: removed caret
0xtiti Mar 17, 2024
4ad963e
fix: reinstalled yarn.lock build issues
0xtiti Mar 17, 2024
9395dac
fix: build issue with node version
0xtiti Mar 17, 2024
9835ed7
fix: update nodejs version
0xtiti Mar 17, 2024
eee572a
fix: Ensure using correct Node.js version in GitHub Actions
0xtiti Mar 17, 2024
0cb0315
fix: nodejs version issue
0xtiti Mar 17, 2024
4cc58d6
fix: revert back to nodejs -v 18.7
0xtiti Mar 17, 2024
2345a7e
fix: resolve "x" type + udpate version 21.4
0xtiti Mar 18, 2024
17337eb
fix: remove carets
0xtiti Mar 18, 2024
ac7d671
Merge branch 'chore/migration-nextjs' of github-defi:defi-wonderland/…
0xtiti Mar 18, 2024
af82dd5
fix: remove carets
0xtiti Mar 18, 2024
9b5c51f
fix: footer/header tags | group imports | sort imports
0xtiti Mar 18, 2024
a77794c
fix: next.config default
0xtiti Mar 18, 2024
1b2facf
fix: eslintrc remove typeprops rule + default file
0xtiti Mar 18, 2024
9a9683f
fix: remove unused libs and old tests
0xtiti Mar 18, 2024
0d212dd
fix: remove vite and vitest
0xtiti Mar 18, 2024
cc5360c
fix:lint issue
0xtiti Mar 18, 2024
2b5828f
fix: layout children proptype validation
0xtiti Mar 18, 2024
6e40a96
fix: remove test - cypress migration
0xtiti Mar 18, 2024
c96505d
fix: remove vitest and yarn | add pnpm
0xtiti Mar 19, 2024
995ea88
fix: added cypress and pnpm
0xtiti Mar 19, 2024
58f0ce8
fix: remove caret
0xtiti Mar 19, 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
7 changes: 4 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
VITE_RPC_URL= # Example: https://localhost:8545
VITE_PROJECT_ID= # Example API from WalletConnect: ""
VITE_ALCHEMY_KEY= # API key from Alchemy
NEXT_PUBLIC_RPC_URL= # Example: https://localhost:8545
NEXT_PUBLIC_PROJECT_ID= # Example API from WalletConnect: ""
NEXT_PUBLIC_ALCHEMY_KEY= # API key from Alchemy
NEXT_PUBLIC_BASE_PATH= #"/some-base-path"
33 changes: 17 additions & 16 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@ module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"plugin:prettier/recommended",
'prettier',
'eslint:recommended',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
'plugin:@next/next/recommended',
],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parser: "@typescript-eslint/parser",
plugins: ["react-refresh"],
rules: {
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
settings: {
react: {
version: 'detect',
},
},
};
4 changes: 2 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: "18.7"
node-version: "21.4"
registry-url: "https://registry.npmjs.org"

- name: Get yarn cache directory path
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.7"
node-version: "21.4"
registry-url: "https://registry.npmjs.org"

- name: Get yarn cache directory path
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ pnpm-debug.log*
lerna-debug.log*

node_modules
.next
next-env.d.ts
dist
dist-ssr
*.local
Expand All @@ -24,4 +26,5 @@ dist-ssr
*.sw?

.eslintcache
.env
.env
tsconfig.tsbuildinfo
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,23 @@ Available scripts that can be run using `yarn`:

| Script | Description |
| -------------- | ------------------------------------------------------------ |
| `dev` | Start the development server using Vite. |
| `dev` | Start the development server using Next. |
| `build` | Build the project for production. |
| `preview` | Preview the production build using Vite. |
| `preview` | Preview the production build using Next. |
| `lint` | Run ESLint on the source code to check for coding standards. |
| `lint:fix` | Run ESLint and automatically fix code formatting issues. |
| `prettier` | Check code formatting using Prettier. |
| `prettier:fix` | Format code using Prettier and automatically fix issues. |
| `format` | Run Prettier and ESLint to format and fix code issues. |
| `format:check` | Check code formatting and linting without making changes. |
| `test` | Run unit tests using Vitest. |
| `test:watch` | Run Vitest in watch mode. |
| `test` | Run unit tests using - . |
| `test:watch` | Run - in watch mode. |

## Technologies Used

This boilerplate leverages the latest technologies, including:

- [Vite](https://vitejs.dev/)
- [Vitest](https://vitest.dev/)
- [NextJS](https://nextjs.org/)
- [Wagmi](https://wagmi.sh/)
- [Viem](https://viem.sh/)
- [Rainbowkit](https://www.rainbowkit.com/)
9 changes: 9 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from "cypress";

export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
});
5 changes: 5 additions & 0 deletions cypress/e2e/fundamentals.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('template spec', () => {
it('passes', () => {
cy.visit('https://example.cypress.io');
});
});
5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "[email protected]",
"body": "Fixtures are a great way to mock data for responses to routes"
}
37 changes: 37 additions & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/// <reference types="cypress" />
// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
//
// declare global {
// namespace Cypress {
// interface Chainable {
// login(email: string, password: string): Chainable<void>
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }
20 changes: 20 additions & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/e2e.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
13 changes: 0 additions & 13 deletions index.html

This file was deleted.

4 changes: 4 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};

export default nextConfig;
27 changes: 15 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,32 @@
"type": "module",
"license": "MIT",
"author": "Wonderland",
"engines": {
"node": ">=18.17.0"
},
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"dev": "next dev",
"build": "next build",
"start": "next start",
"preview": "next start",
"lint": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
"lint:fix": "yarn run lint -- --fix",
"prettier": "prettier src --check",
"prettier:fix": "yarn run prettier -- --write",
"format": "yarn run prettier:fix && yarn run lint:fix",
"format:check": "yarn run prettier && yarn run lint",
"prepare": "husky install && wonderland-crypto-husky-checks install",
"test": "vitest run --dir src/tests/",
"test:watch": "vitest --dir src/tests/"
"test": "yarn cypress run"
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx}": "eslint --cache --fix",
"src/**/*.{js,jsx,ts,tsx,css,scss,md,html}": "prettier --write --ignore-unknown"
},
"dependencies": {
"@next/eslint-plugin-next": "14.1.3",
"@rainbow-me/rainbowkit": "2.0.2",
"@tanstack/react-query": "5.28.0",
"next": "14.1.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-router-dom": "6.15.0",
Expand All @@ -35,30 +40,28 @@
"devDependencies": {
"@defi-wonderland/crypto-husky-checks": "1.3.0",
"@testing-library/jest-dom": "6.1.2",
"@testing-library/react": "14.0.0",
"@testing-library/react": "14.2.1",
"@testing-library/user-event": "14.4.3",
"@types/lodash.merge": "4.6.7",
"@types/react": "18.2.15",
"@types/react-dom": "18.2.7",
"@typescript-eslint/eslint-plugin": "6.0.0",
"@typescript-eslint/parser": "6.0.0",
"@vitejs/plugin-react": "4.0.3",
"cypress": "13.7.0",
"eslint": "8.45.0",
"eslint-config-prettier": "9.0.0",
"eslint-formatter-codeframe": "7.32.1",
"eslint-plugin-import": "2.28.1",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-prettier": "5.0.0",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-react-refresh": "0.4.3",
"husky": "8.0.3",
"jsdom": "22.1.0",
"jsdom": "24.0.0",
"lodash.merge": "4.6.2",
"prettier": "3.0.3",
"styled-components": "6.0.7",
"typescript": "5.0.2",
"vite": "4.4.5",
"vite-tsconfig-paths": "4.2.0",
"vitest": "0.34.3"
"typescript": "^5.4.2"
0xArdy marked this conversation as resolved.
Show resolved Hide resolved
}
}
Loading
Loading