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

WIP: Feature/update react 18 + improvements #581

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
File renamed without changes.
34 changes: 18 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,43 @@ jobs:

- uses: actions/setup-node@v1
with:
node-version: '12'
node-version: '18'

- name: cache package-lock.json
- name: cache pnpm-lock.yaml
uses: actions/cache@v2
with:
path: package-temp-dir
key: lock-${{ github.sha }}

- name: create package-lock.json
run: npm i --package-lock-only
- name: create pnpm-lock.yaml
run: |
npm install --global pnpm@7
pnpm config set store-dir .pnpm-store

- name: hack for singe file
run: |
if [ ! -d "package-temp-dir" ]; then
mkdir package-temp-dir
fi
cp package-lock.json package-temp-dir
cp pnpm-lock.yaml package-temp-dir
- name: cache node_modules
id: node_modules_cache_id
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
key: node_modules-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }}

- name: install
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: npm ci
run: pnpm install

lint:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master

- name: restore cache from package-lock.json
- name: restore cache from pnpm-lock.yaml
uses: actions/cache@v2
with:
path: package-temp-dir
Expand All @@ -59,10 +61,10 @@ jobs:
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
key: node_modules-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }}

- name: lint
run: npm run lint
run: pnpm lint

needs: setup

Expand All @@ -72,7 +74,7 @@ jobs:
- name: checkout
uses: actions/checkout@master

- name: restore cache from package-lock.json
- name: restore cache from pnpm-lock.yaml
uses: actions/cache@v2
with:
path: package-temp-dir
Expand All @@ -82,10 +84,10 @@ jobs:
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
key: node_modules-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }}

- name: compile
run: npm run compile
run: pnpm compile

needs: setup

Expand All @@ -95,7 +97,7 @@ jobs:
- name: checkout
uses: actions/checkout@master

- name: restore cache from package-lock.json
- name: restore cache from pnpm-lock.yaml
uses: actions/cache@v2
with:
path: package-temp-dir
Expand All @@ -105,9 +107,9 @@ jobs:
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
key: node_modules-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }}

- name: coverage
run: npm test -- --coverage && bash <(curl -s https://codecov.io/bash)
run: pnpm test:coverage && bash <(curl -s https://codecov.io/bash)

needs: setup
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
7 changes: 0 additions & 7 deletions jest.config.ts

This file was deleted.

58 changes: 33 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "rc-field-form",
"version": "1.29.1",
"version": "2.0.0",
"type": "module",
"description": "React Form Component",
"typings": "es/index.d.ts",
"engines": {
"node": ">=8.x"
"node": ">=18.x"
},
"keywords": [
"react",
Expand All @@ -30,56 +30,64 @@
"license": "MIT",
"main": "./lib/index",
"module": "./es/index",
"typings": "es/index.d.ts",
"scripts": {
"start": "dumi dev",
"docs:build": "dumi build",
"start": "export NODE_OPTIONS=--openssl-legacy-provider && dumi dev",
"docs:build": "export NODE_OPTIONS=--openssl-legacy-provider && dumi build",
"docs:deploy": "gh-pages -d docs-dist",
"build": "pnpm compile",
"compile": "father-build",
"deploy": "npm run docs:build && npm run docs:deploy",
"deploy": "pnpm run docs:build && pnpm run docs:deploy",
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
"test": "father test",
"test:coverage": "umi-test --coverage",
"prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish",
"test": "vitest --watch=false",
"test:watch": "vitest --ui --changed",
"test:coverage": "vitest run --coverage",
"prepublishOnly": "pnpm run compile && np --no-cleanup --yolo --no-publish",
"lint": "eslint src/ --ext .tsx,.ts",
"lint:tsc": "tsc -p tsconfig.json --noEmit",
"now-build": "npm run docs:build"
"now-build": "pnpm run docs:build"
},
"peerDependencies": {
"react": ">=16.9.0",
"react-dom": ">=16.9.0"
"react": ">=18",
"react-dom": ">=18"
},
"dependencies": {
"@babel/runtime": "^7.18.0",
"async-validator": "^4.1.0",
"rc-util": "^5.8.0"
"rc-util": "^5.29.3"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^12.1.5",
"@types/enzyme": "^3.10.5",
"@testing-library/react": "14.0.0",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^29.2.5",
"@types/lodash": "^4.14.135",
"@types/react": "^18.0.0",
"@types/node": "^18.15.11",
"@types/react": "^18.0.32",
"@types/react-dom": "^18.0.0",
"@umijs/fabric": "^2.5.2",
"@umijs/test": "^3.2.27",
"@umijs/test": "4.0.61",
"@vitejs/plugin-react": "^3.1.0",
"@vitest/coverage-c8": "^0.29.8",
"@vitest/ui": "^0.29.8",
"dumi": "^1.1.0",
"enzyme": "^3.1.0",
"enzyme-adapter-react-16": "^1.0.2",
"enzyme-to-json": "^3.1.4",
"eslint": "^7.18.0",
"father": "^2.13.6",
"father": "4.1.7",
"father-build": "^1.18.6",
"gh-pages": "^3.1.0",
"jest": "^29.3.1",
"np": "^5.0.3",
"prettier": "^2.1.2",
"react": "^16.14.0",
"prettier": "^2.8.7",
"react": "18.2.0",
"react-dnd": "^8.0.3",
"react-dnd-html5-backend": "^8.0.3",
"react-dom": "^16.14.0",
"react-dom": "18.2.0",
"react-redux": "^4.4.10",
"redux": "^3.7.2",
"typescript": "^4.6.3"
"ts-node": "^10.9.1",
"typescript": "5.0.3",
"vite": "^4.2.1",
"vitest": "^0.29.8"
}
}
Loading