Skip to content

Refactor dumi #220

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

Merged
merged 12 commits into from
Nov 16, 2020
Merged
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
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
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# tests
# docs
# examples
6 changes: 2 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ module.exports = {
'import/no-named-as-default-member': 0,
'jsx-a11y/label-has-for': 0,
'jsx-a11y/label-has-associated-control': 0,
'import/no-extraneous-dependencies': [
'error',
{ devDependencies: true, optionalDependencies: true, peerDependencies: true },
],
'import/no-extraneous-dependencies': 0,
'import/no-unresolved': 0,
},
};
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}

- name: compile
run: npm run compile
run: npm run build

needs: setup

Expand All @@ -110,4 +110,4 @@ jobs:
- name: coverage
run: npm test -- --coverage && bash <(curl -s https://codecov.io/bash)

needs: setup
needs: setup
35 changes: 23 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
.storybook
.doc
*.log
node_modules
coverage/
es/
lib/
~*
yarn.lock
package-lock.json
.idea/
examples/debug.tsx
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

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

# production
/dist
/docs-dist
/es
/lib

# misc
.DS_Store

# 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
13 changes: 13 additions & 0 deletions .umirc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from 'dumi';

export default defineConfig({
title: 'rc-field-form',
favicon:
'https://user-images.githubusercontent.com/9554297/83762004-a0761b00-a6a9-11ea-83b4-9c8ff721d4b8.png',
logo:
'https://user-images.githubusercontent.com/9554297/83762004-a0761b00-a6a9-11ea-83b4-9c8ff721d4b8.png',
outputPath: '.doc',
exportStatic: {},
// mode: 'site',
// more config: https://d.umijs.org/config
});
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cSpell.words": [
"draggable"
]
}
284 changes: 1 addition & 283 deletions README.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions docs/StateForm-list-draggable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## StateForm-list-draggable

<code src="./examples/StateForm-list-draggable.tsx" />
4 changes: 4 additions & 0 deletions docs/basic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Basic


<code src="./examples/basic.tsx" />
3 changes: 3 additions & 0 deletions docs/component.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Component

<code src="./examples/component.tsx" />
3 changes: 3 additions & 0 deletions docs/context.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Context

<code src="./examples/context.tsx" />
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react';
/* eslint-enable react/prop-types */
import HTML5Backend from 'react-dnd-html5-backend';
import { DndProvider } from 'react-dnd';
import Form, { List, useForm } from '../src';
import Form, { List, useForm } from 'rc-field-form';
import Input from './components/Input';
import LabelField from './components/LabelField';
import useDraggable from './components/useDraggable';
Expand Down
4 changes: 2 additions & 2 deletions examples/basic.tsx → docs/examples/basic.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Form, { Field, FormInstance } from '../src';
import Form, { Field, FormInstance } from 'rc-field-form';
import Input from './components/Input';

const list = new Array(1111).fill(() => null);
Expand All @@ -13,7 +13,7 @@ interface FormValues {
}

export default class Demo extends React.Component {
formRef = React.createRef<FormInstance<FormValues>>();
formRef: any = React.createRef<FormInstance<FormValues>>();

onFinish = (values: FormValues) => {
console.log('Submit:', values);
Expand Down
2 changes: 1 addition & 1 deletion examples/component.tsx → docs/examples/component.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Form, { Field, useForm } from '../src';
import Form, { Field, useForm } from 'rc-field-form';
import Input from './components/Input';

export default () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import Form from '../../src';
import { FieldProps } from '../../src/Field';
import Form from 'rc-field-form';
import { FieldProps } from '@/Field';

const { Field } = Form;

Expand Down
4 changes: 2 additions & 2 deletions examples/context.tsx → docs/examples/context.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-disable react/prop-types */

import React from 'react';
import Form, { FormProvider } from '../src';
import Form, { FormProvider } from 'rc-field-form';
import Input from './components/Input';
import LabelField from './components/LabelField';
import { ValidateMessages } from '../src/interface';
import { ValidateMessages } from '@/interface';

const myMessages: ValidateMessages = {
required: '${name} 是必需品',
Expand Down
2 changes: 1 addition & 1 deletion examples/deps.tsx → docs/examples/deps.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Form, { Field } from '../src';
import Form, { Field } from 'rc-field-form';
import Input from './components/Input';

let x = 0;
Expand Down
2 changes: 1 addition & 1 deletion examples/layout.tsx → docs/examples/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable jsx-a11y/label-has-associated-control, react/prop-types */

import React from 'react';
import Form from '../src';
import Form from 'rc-field-form';
import Input from './components/Input';
import LabelField from './components/LabelField';

Expand Down
2 changes: 1 addition & 1 deletion examples/list.tsx → docs/examples/list.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable react/prop-types */

import React from 'react';
import Form from '../src';
import Form from 'rc-field-form';
import Input from './components/Input';
import LabelField from './components/LabelField';

Expand Down
2 changes: 1 addition & 1 deletion examples/redux.tsx → docs/examples/redux.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import React from 'react';
import { connect, Provider } from 'react-redux';
import { createStore } from 'redux';
import Form from '../src';
import Form from 'rc-field-form';
import Input from './components/Input';
import LabelField from './components/LabelField';

Expand Down
2 changes: 1 addition & 1 deletion examples/renderProps.tsx → docs/examples/renderProps.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable jsx-a11y/label-has-associated-control */
import React from 'react';
import Form from '../src';
import Form from 'rc-field-form';
import Input from './components/Input';

const { Field } = Form;
Expand Down
2 changes: 1 addition & 1 deletion examples/reset.tsx → docs/examples/reset.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/prop-types */
import React from 'react';
import Form from '../src';
import Form from 'rc-field-form';
import Input from './components/Input';

const { Field } = Form;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/useForm.tsx → docs/examples/useForm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Form from '../src';
import Form from 'rc-field-form';
import Input from './components/Input';

const { Field, useForm } = Form;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-disable react/prop-types */

import React from 'react';
import Form, { Field, FormInstance } from '../src';
import Form, { Field, FormInstance } from 'rc-field-form';
import Input from './components/Input';
import LabelField from './components/LabelField';
import { ValidateMessages } from '../src/interface';
import { ValidateMessages } from '@/interface';

const myMessages: ValidateMessages = {
default: '${name} 看起来怪怪的……',
Expand Down
2 changes: 1 addition & 1 deletion examples/validate.tsx → docs/examples/validate.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable react/prop-types */

import React from 'react';
import Form from '../src';
import Form from 'rc-field-form';
import Input from './components/Input';

const { Field } = Form;
Expand Down
Loading