Skip to content

Commit

Permalink
feat: 🎸 update template, jest,ts,lint,etc
Browse files Browse the repository at this point in the history
chore: 🤖 add dependences, update workflows for aelf-template

chore: 🤖 *.yml move to ./workflows

chore: 🤖 update

chore: 🤖 update workflow

chore: 🤖 update

chore: 🤖 update

chore: 🤖 remove

feat: 🎸 update

feat: 🎸 update

feat: 🎸 remove
  • Loading branch information
hzz780 authored and [email protected] committed Oct 18, 2024
1 parent 91a8050 commit fecb985
Show file tree
Hide file tree
Showing 198 changed files with 3,587 additions and 2,069 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/jestTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test by jest

on: [pull_request]

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # Your node version, default 20 in 2024

- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install pnpm
run: npm install -g pnpm

- name: Install Dependencies
run: pnpm install

- name: Run Jest Test
run: pnpm run -C apps/aelf-template test
35 changes: 35 additions & 0 deletions .github/workflows/nextBuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Next Build

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # Your node version, default 20 in 2024

- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install pnpm
run: npm install -g pnpm

- name: Install Dependencies
run: pnpm install

- name: Run Next Build
run: pnpm run -C apps/aelf-template build
35 changes: 35 additions & 0 deletions .github/workflows/nextLint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Next Lint

on: [pull_request]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # Your node version, default 20 in 2024

- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install pnpm
run: npm install -g pnpm

- name: Install Dependencies
run: pnpm install

- name: Run ESLint
run: pnpm run -C apps/aelf-template lint
12 changes: 0 additions & 12 deletions .idea/aelf-nextjs-cli.iml

This file was deleted.

11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ lerna run build

publish to npm
```bash
# Publish all packages
lerna publish

# Publish single package
cd apps/create-aelf-dapp
npm publish
```

rm node_modules
Expand All @@ -48,3 +53,9 @@ lerna clean
rm -rf node_modules/
```

## add dependence

```bash
# example
pnpm install -C apps/aelf-template @ant-design/icons
```
5 changes: 5 additions & 0 deletions apps/aelf-template/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist
.git
Dockerfile
.dockerignore
36 changes: 35 additions & 1 deletion apps/aelf-template/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,40 @@
{
"plugins": ["tailwindcss"],
"extends": [
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended",
"plugin:tailwindcss/recommended",
"plugin:prettier/recommended",
"plugin:@tanstack/eslint-plugin-query/recommended"
]
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 11,
"sourceType": "module"
},
"ignorePatterns": [],
"rules": {
"quotes": [
"error",
"single",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
],
"@typescript-eslint/no-explicit-any": "off",
"tailwindcss/classnames-order": "off",
"tailwindcss/no-custom-classname": "off",
"tailwindcss/no-contradicting-classname": "error",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/ban-ts-comment": [
"error",
{
"ts-ignore": false
}
]
}
}
25 changes: 20 additions & 5 deletions apps/aelf-template/.github/workflows/jestTest.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Test by jest

on: [push, pull_request]
on: [pull_request]

jobs:
lint:
test:
runs-on: ubuntu-latest

steps:
Expand All @@ -13,8 +13,23 @@ jobs:
with:
node-version: '20' # Your node version, default 20 in 2024

- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install pnpm
run: npm install -g pnpm

- name: Install Dependencies
run: yarn
run: pnpm install

- name: Run Test
run: yarn test
- name: Run Jest Test
run: pnpm test
35 changes: 35 additions & 0 deletions apps/aelf-template/.github/workflows/nextBuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Next Build

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # Your node version, default 20 in 2024

- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install pnpm
run: npm install -g pnpm

- name: Install Dependencies
run: pnpm install

- name: Run Next Build
run: pnpm build
11 changes: 7 additions & 4 deletions apps/aelf-template/.github/workflows/nextLint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Next Lint

on: [push, pull_request]
on: [pull_request]

jobs:
lint:
Expand All @@ -19,14 +19,17 @@ jobs:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn-lock.json') }}
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install pnpm
run: npm install -g pnpm

- name: Install Dependencies
run: yarn
run: pnpm install

- name: Run ESLint
run: yarn lint
run: pnpm lint
2 changes: 2 additions & 0 deletions apps/aelf-template/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ package

# git ls-files > filelist.txt
filelist.txt

.eslintcache
3 changes: 2 additions & 1 deletion apps/aelf-template/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"plugins": ["prettier-plugin-tailwindcss"]
"plugins": ["prettier-plugin-tailwindcss"],
"singleQuote": true
}
37 changes: 37 additions & 0 deletions apps/aelf-template/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"extends": [
"stylelint-config-standard",
"stylelint-config-css-modules",
"stylelint-prettier/recommended"
],
"plugins": [
"stylelint-order"
],
"rules": {
"at-rule-no-unknown": [
true,
{
"ignoreAtRules": [
"tailwind",
"apply",
"variants",
"responsive",
"screen"
]
}
],
"order/order": [
"custom-properties",
"declarations"
],
"order/properties-alphabetical-order": true,
"selector-class-pattern": null,
"prettier/prettier": true
},
"ignoreFiles": [
"**/node_modules/**",
"**/dist/**",
"**/build/**",
"**/.next/**"
]
}
Loading

0 comments on commit fecb985

Please sign in to comment.