Skip to content

Commit

Permalink
chore: init of v5 compatiable (#135)
Browse files Browse the repository at this point in the history
* chore: init

* chore: antd v5

* chore: clean up

* test: test case

* test: warning test

* chore: sample

* chore: pkg version

* chore: workflow

* chore: commented

* test: comment part
  • Loading branch information
zombieJ authored Aug 2, 2022
1 parent aa33fdf commit 2d8c213
Show file tree
Hide file tree
Showing 56 changed files with 367 additions and 4,314 deletions.
37 changes: 0 additions & 37 deletions .circleci/config.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
22 changes: 14 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@ module.exports = {
...base,
rules: {
...base.rules,
'@typescript-eslint/class-name-casing': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/ban-types': 0,
'react/no-did-update-set-state': 0,
'react/no-find-dom-node': 0,
'no-continue': 0,
'jsx-a11y/label-has-for': 0,
'arrow-parens': 0,
'no-confusing-arrow': 0,
'no-template-curly-in-string': 0,
'prefer-promise-reject-errors': 0,
'react/no-array-index-key': 0,
'react/sort-comp': 0,
'react/prefer-stateless-function': 0,
'import/no-named-as-default-member': 0,
'jsx-a11y/label-has-for': 0,
'jsx-a11y/label-has-associated-control': 0,
'import/no-extraneous-dependencies': 0,
'import/no-unresolved': 0,
'@typescript-eslint/no-redeclare': 0,
'@typescript-eslint/method-signature-style': 0,
'no-async-promise-executor': 0,
'@typescript-eslint/consistent-type-definitions': 0,
},
};
8 changes: 0 additions & 8 deletions .fatherrc.js

This file was deleted.

10 changes: 10 additions & 0 deletions .fatherrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from 'father';

export default defineConfig({
platform: 'browser',
cjs: { output: 'lib' },
esm: {
output: 'es',
alias: { 'rc-util/lib': 'rc-util/es' },
},
});
113 changes: 113 additions & 0 deletions .github/workflows/react-component-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

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

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

- name: cache package-lock.json
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: hack for singe file
run: |
if [ ! -d "package-temp-dir" ]; then
mkdir package-temp-dir
fi
cp package-lock.json 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') }}

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

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

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

- name: restore cache from node_modules
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}

- name: lint
run: npm run lint

needs: setup

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

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

- name: restore cache from node_modules
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}

- name: compile
run: npm run compile

needs: setup

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

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

- name: restore cache from node_modules
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}

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

needs: setup
45 changes: 19 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
.storybook

# See https://help.github.com/ignore-files/ for more about ignoring files.
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules/

# testing
/node_modules
/npm-debug.log*
/yarn-error.log
/yarn.lock
/package-lock.json

# production
/dist
/docs-dist
/es
/lib
.doc
/coverage

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn.lock

# IDE
/.idea

lib/
es/
dist/
build/
assets/*.css
.vscode
.idea

# publish
*.tgz
# umi
.umi
.umi-production
.umi-test
.env.local
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**/*.svg
**/*.ejs
**/*.html
package.json
.umi
.umi-production
.umi-test
4 changes: 3 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"arrowParens": "avoid",
"endOfLine": "lf",
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all"
"trailingComma": "all",
"printWidth": 100
}
22 changes: 22 additions & 0 deletions .umirc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// more config: https://d.umijs.org/config
import { defineConfig } from 'dumi';

export default defineConfig({
title: '@ant-design/compatible',
favicon: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
outputPath: '.doc',
exportStatic: {},
styles: [
// Remove when antd fix this
`
.markdown table {
width: auto !important;
}
* {
box-sizing: border-box;
}
`,
],
});
Loading

1 comment on commit 2d8c213

@vercel
Copy link

@vercel vercel bot commented on 2d8c213 Aug 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.