Skip to content

Commit

Permalink
chore: project setup updated
Browse files Browse the repository at this point in the history
  • Loading branch information
wellitongervickas committed Nov 1, 2023
1 parent 2ec4c37 commit fd4c78f
Show file tree
Hide file tree
Showing 10 changed files with 2,176 additions and 104 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"env": {
"jest": true
},
"extends": [
"next/core-web-vitals",
"eslint:recommended",
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Run Tests

on:
push:
branches:
- main # Change this to your default branch if it's different

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 18

- name: Install pnpm
run: npm install -g pnpm

- name: Install project dependencies
run: pnpm install

- name: Run Tests
run: pnpm test
2 changes: 1 addition & 1 deletion app/[locale]/apps/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function Layout({ children }: LayoutProps) {
const navLinks: AsideNavigationItemProps[] = [
{
href: '/apps/',
icon: <PuzzlePieceIcon width={18} />,
icon: <PuzzlePieceIcon width={32} className='w-6 lg:w-4' />,
label: t(Locales.APPS)
}
]
Expand Down
2 changes: 1 addition & 1 deletion app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function BaseLayout({ children, params }: BaseLayoutProps) {
className={classNames(
'flex min-h-screen flex-col',
'h-screen overflow-x-hidden text-sm font-medium',
'bg-stone-100 text-stone-900',
'bg-stone-100 text-black/70',
'dark:bg-third-100 dark:text-cyan-50'
)}
>
Expand Down
6 changes: 4 additions & 2 deletions app/components/navigation/aside/AsideNavigationItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ export const AsideNavigationItem = ({
}
)}
>
<span>{icon}</span>
<Typography.Text size='sm'>{label}</Typography.Text>
{icon}
<Typography.Text size='md' className='hidden lg:block'>
{label}
</Typography.Text>
</Link>
)
}
Expand Down
11 changes: 11 additions & 0 deletions app/lib/utils/__tests__/address.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { toEllipsis } from '../address'

describe('Address', () => {
describe('toEllipsis', () => {
it('should return ellipsis address', () => {
expect(toEllipsis('0x1234567890abcdef1234567890abcdef12345678')).toEqual(
'0x1234...5678'
)
})
})
})
2 changes: 1 addition & 1 deletion app/lib/utils/address.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const toEllipsis = (address?: string, head = 6, tail = 4) => {
export const toEllipsis = (address?: string, head = 6, tail = 4) => {
if (!address) return ''
return [address.slice(0, head), '...', address.slice(-tail)].join('')
}
Expand Down
17 changes: 17 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const nextJest = require('next/jest')

const createJestConfig = nextJest({
dir: './'
})

/** @type {import('jest').Config} */
const customJestConfig = {
moduleDirectories: ['<rootDir>/node_modules', '<rootDir>/'],
moduleNameMapper: {
'^@/app/utils/(.*)$': '<rootDir>/app/utils/$1'
},
modulePathIgnorePatterns: ['mocks'],
testEnvironment: 'jest-environment-jsdom'
}

module.exports = createJestConfig(customJestConfig)
39 changes: 23 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{
"name": "0xdevhub-v1",
"version": "0.1.0",
"private": true,
"name": "0xdevhub-dapp",
"version": "1.0.0",
"private": false,
"repository": "git@github.com:0xdevhub/dapp.git",
"author": "welliton gervickas <wellitogervickas@gmail.com>",
"license": "MIT",
"engines": {
"node": ">=18.18.2"
"node": ">=18.0.0"
},
"scripts": {
"dev": "next dev",
"test": "jest",
"test:watch": "jest --watch",
"build": "next build",
"start": "next start",
"lint": "next lint"
Expand All @@ -16,33 +21,35 @@
"classnames": "latest",
"cssnano": "latest",
"ethers": "latest",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lodash": "latest",
"next": "14.0.0",
"next-international": "latest",
"react-jazzicon": "latest",
"usehooks-ts": "latest",
"wagmi": "latest",
"react": "latest",
"react-dom": "latest",
"next": "14.0.0"
"react-jazzicon": "latest",
"usehooks-ts": "latest",
"wagmi": "latest"
},
"devDependencies": {
"@types/node": "latest",
"@types/react": "latest",
"@types/react-dom": "latest",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@vercel/edge-config": "^0.4.1",
"autoprefixer": "latest",
"cssnano": "^6.0.1",
"eslint": "latest",
"eslint-config-next": "14.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-tailwindcss": "^3.13.0",
"postcss": "latest",
"prettier": "latest",
"prettier-plugin-tailwindcss": "^0.5.6",
"sharp": "^0.32.6",
"typescript": "latest",
"@types/node": "latest",
"@types/react": "latest",
"@types/react-dom": "latest",
"autoprefixer": "latest",
"postcss": "latest",
"tailwindcss": "latest",
"eslint": "latest",
"eslint-config-next": "14.0.0"
"typescript": "latest"
}
}
Loading

0 comments on commit fd4c78f

Please sign in to comment.