create-umi 0.25.0 → 4.0.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/README.md +2 -97
  2. package/bin/create-umi.js +3 -0
  3. package/dist/cli.d.ts +1 -0
  4. package/dist/cli.js +31 -0
  5. package/dist/index.d.ts +6 -0
  6. package/dist/index.js +105 -0
  7. package/package.json +18 -40
  8. package/templates/app/.gitignore.tpl +8 -0
  9. package/templates/app/.npmrc.tpl +1 -0
  10. package/templates/app/.umirc.ts.tpl +3 -0
  11. package/templates/app/layouts/index.tsx +22 -0
  12. package/templates/app/package.json.tpl +16 -0
  13. package/templates/app/pages/index.tsx +5 -0
  14. package/templates/app/pages/users/foo.tsx +3 -0
  15. package/templates/app/pages/users.tsx +9 -0
  16. package/templates/plugin/.fatherrc.ts +5 -0
  17. package/templates/plugin/.gitignore.tpl +2 -0
  18. package/templates/plugin/.npmrc.tpl +1 -0
  19. package/templates/plugin/README.md.tpl +38 -0
  20. package/templates/plugin/package.json.tpl +24 -0
  21. package/templates/plugin/src/index.ts.tpl +5 -0
  22. package/CHANGELOG.md +0 -44
  23. package/cli.js +0 -37
  24. package/index.js +0 -3
  25. package/lib/BasicGenerator.js +0 -70
  26. package/lib/generators/ant-design-pro/.babelrc +0 -10
  27. package/lib/generators/ant-design-pro/README.md +0 -57
  28. package/lib/generators/ant-design-pro/filterPkg.js +0 -15
  29. package/lib/generators/ant-design-pro/index.js +0 -232
  30. package/lib/generators/ant-design-pro/meta.json +0 -3
  31. package/lib/generators/app/index.js +0 -69
  32. package/lib/generators/app/meta.json +0 -3
  33. package/lib/generators/app/templates/.editorconfig +0 -16
  34. package/lib/generators/app/templates/.env +0 -2
  35. package/lib/generators/app/templates/.eslintrc +0 -3
  36. package/lib/generators/app/templates/.prettierignore +0 -7
  37. package/lib/generators/app/templates/.prettierrc +0 -11
  38. package/lib/generators/app/templates/.umirc.js +0 -37
  39. package/lib/generators/app/templates/.umirc.ts +0 -40
  40. package/lib/generators/app/templates/_gitignore +0 -18
  41. package/lib/generators/app/templates/mock/.gitkeep +0 -0
  42. package/lib/generators/app/templates/package.json +0 -60
  43. package/lib/generators/app/templates/src/app.js +0 -8
  44. package/lib/generators/app/templates/src/app.ts +0 -8
  45. package/lib/generators/app/templates/src/assets/welcomeImgs/0.jpg +0 -0
  46. package/lib/generators/app/templates/src/assets/welcomeImgs/1.jpg +0 -0
  47. package/lib/generators/app/templates/src/global.css +0 -7
  48. package/lib/generators/app/templates/src/layouts/__tests__/index.test.js +0 -14
  49. package/lib/generators/app/templates/src/layouts/__tests__/index.test.tsx +0 -16
  50. package/lib/generators/app/templates/src/layouts/index.css +0 -15
  51. package/lib/generators/app/templates/src/layouts/index.js +0 -12
  52. package/lib/generators/app/templates/src/layouts/index.tsx +0 -13
  53. package/lib/generators/app/templates/src/locales/en-US.js +0 -3
  54. package/lib/generators/app/templates/src/locales/en-US.ts +0 -3
  55. package/lib/generators/app/templates/src/models/.gitkeep +0 -0
  56. package/lib/generators/app/templates/src/pages/__tests__/__mocks__/umi-plugin-locale.js +0 -1
  57. package/lib/generators/app/templates/src/pages/__tests__/__mocks__/umi-plugin-locale.ts +0 -1
  58. package/lib/generators/app/templates/src/pages/__tests__/index.test.js +0 -19
  59. package/lib/generators/app/templates/src/pages/__tests__/index.test.tsx +0 -21
  60. package/lib/generators/app/templates/src/pages/index.css +0 -23
  61. package/lib/generators/app/templates/src/pages/index.js +0 -18
  62. package/lib/generators/app/templates/src/pages/index.tsx +0 -19
  63. package/lib/generators/app/templates/tsconfig.json +0 -18
  64. package/lib/generators/app/templates/typings.d.ts +0 -2
  65. package/lib/generators/app/templates/webpack.config.js +0 -12
  66. package/lib/generators/block/index.js +0 -56
  67. package/lib/generators/block/meta.json +0 -3
  68. package/lib/generators/block/templates/.prettierignore +0 -7
  69. package/lib/generators/block/templates/.prettierrc +0 -11
  70. package/lib/generators/block/templates/.umirc.js +0 -5
  71. package/lib/generators/block/templates/.umirc.ts +0 -9
  72. package/lib/generators/block/templates/LICENSE +0 -21
  73. package/lib/generators/block/templates/README.md +0 -13
  74. package/lib/generators/block/templates/_gitignore +0 -7
  75. package/lib/generators/block/templates/package.json +0 -27
  76. package/lib/generators/block/templates/src/index.css +0 -3
  77. package/lib/generators/block/templates/src/index.js +0 -9
  78. package/lib/generators/block/templates/src/index.tsx +0 -12
  79. package/lib/generators/block/templates/tsconfig.json +0 -18
  80. package/lib/generators/block/templates/typings.d.ts +0 -2
  81. package/lib/generators/library/index.js +0 -55
  82. package/lib/generators/library/meta.json +0 -3
  83. package/lib/generators/library/templates/.fatherrc.js +0 -4
  84. package/lib/generators/library/templates/.fatherrc.ts +0 -9
  85. package/lib/generators/library/templates/.prettierignore +0 -5
  86. package/lib/generators/library/templates/.prettierrc +0 -11
  87. package/lib/generators/library/templates/LICENSE +0 -21
  88. package/lib/generators/library/templates/README.md +0 -13
  89. package/lib/generators/library/templates/_gitignore +0 -5
  90. package/lib/generators/library/templates/package.json +0 -28
  91. package/lib/generators/library/templates/src/index.css +0 -4
  92. package/lib/generators/library/templates/src/index.js +0 -15
  93. package/lib/generators/library/templates/src/index.mdx +0 -18
  94. package/lib/generators/library/templates/src/index.tsx +0 -21
  95. package/lib/generators/library/templates/tsconfig.json +0 -17
  96. package/lib/generators/library/templates/typings.d.ts +0 -2
  97. package/lib/generators/plugin/index.js +0 -81
  98. package/lib/generators/plugin/meta.json +0 -3
  99. package/lib/generators/plugin/templates/.editorconfig +0 -16
  100. package/lib/generators/plugin/templates/.fatherrc.js +0 -35
  101. package/lib/generators/plugin/templates/.fatherrc.ts +0 -35
  102. package/lib/generators/plugin/templates/.gitignore +0 -8
  103. package/lib/generators/plugin/templates/.prettierignore +0 -8
  104. package/lib/generators/plugin/templates/.prettierrc +0 -14
  105. package/lib/generators/plugin/templates/CONTRIBUTING.md +0 -40
  106. package/lib/generators/plugin/templates/README.md +0 -51
  107. package/lib/generators/plugin/templates/example/.gitignore +0 -5
  108. package/lib/generators/plugin/templates/example/.umirc.js +0 -8
  109. package/lib/generators/plugin/templates/example/.umirc.ts +0 -8
  110. package/lib/generators/plugin/templates/example/app.jsx +0 -3
  111. package/lib/generators/plugin/templates/example/app.tsx +0 -3
  112. package/lib/generators/plugin/templates/example/package.json +0 -3
  113. package/lib/generators/plugin/templates/example/pages/index.css +0 -17
  114. package/lib/generators/plugin/templates/example/pages/index.jsx +0 -8
  115. package/lib/generators/plugin/templates/example/pages/index.tsx +0 -8
  116. package/lib/generators/plugin/templates/example/tsconfig.json +0 -37
  117. package/lib/generators/plugin/templates/example/typing.d.ts +0 -2
  118. package/lib/generators/plugin/templates/jest.config.js +0 -8
  119. package/lib/generators/plugin/templates/package.json +0 -65
  120. package/lib/generators/plugin/templates/src/index.js +0 -26
  121. package/lib/generators/plugin/templates/src/index.ts +0 -29
  122. package/lib/generators/plugin/templates/test/fixtures/normal/.umirc.js +0 -4
  123. package/lib/generators/plugin/templates/test/fixtures/normal/.umirc.ts +0 -4
  124. package/lib/generators/plugin/templates/test/fixtures/normal/pages/index.css +0 -4
  125. package/lib/generators/plugin/templates/test/fixtures/normal/pages/index.jsx +0 -10
  126. package/lib/generators/plugin/templates/test/fixtures/normal/pages/index.tsx +0 -11
  127. package/lib/generators/plugin/templates/test/fixtures/normal/test.js +0 -10
  128. package/lib/generators/plugin/templates/test/fixtures/normal/test.ts +0 -10
  129. package/lib/generators/plugin/templates/test/index.e2e.js +0 -5
  130. package/lib/generators/plugin/templates/test/index.e2e.ts +0 -5
  131. package/lib/generators/plugin/templates/tsconfig.json +0 -23
  132. package/lib/generators/plugin/templates/ui/index.jsx +0 -28
  133. package/lib/generators/plugin/templates/ui/index.tsx +0 -29
  134. package/lib/run.js +0 -76
@@ -1,12 +0,0 @@
1
- import styles from './index.css';
2
-
3
- function BasicLayout(props) {
4
- return (
5
- <div className={styles.normal}>
6
- <h1 className={styles.title}>Yay! Welcome to umi!</h1>
7
- {props.children}
8
- </div>
9
- );
10
- }
11
-
12
- export default BasicLayout;
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import styles from './index.css';
3
-
4
- const BasicLayout: React.FC = props => {
5
- return (
6
- <div className={styles.normal}>
7
- <h1 className={styles.title}>Yay! Welcome to umi!</h1>
8
- {props.children}
9
- </div>
10
- );
11
- };
12
-
13
- export default BasicLayout;
@@ -1,3 +0,0 @@
1
- export default {
2
- 'index.start': 'Getting Started',
3
- }
@@ -1,3 +0,0 @@
1
- export default {
2
- 'index.start': 'Getting Started',
3
- }
File without changes
@@ -1 +0,0 @@
1
- export const formatMessage = () => 'Mock text';
@@ -1 +0,0 @@
1
- export const formatMessage = (): string => 'Mock text';
@@ -1,19 +0,0 @@
1
- import Index from '..';
2
- import renderer from 'react-test-renderer';
3
-
4
- <% if (reactFeatures.includes('locale')) { %>jest.mock('umi-plugin-locale');
5
- <% } %>
6
- describe('Page: index', () => {
7
- it('Render correctly', () => {
8
- const wrapper = renderer.create(<Index />);
9
- expect(wrapper.root.children.length).toBe(1);
10
- const outerLayer = wrapper.root.children[0];
11
- expect(outerLayer.type).toBe('div');
12
- expect(outerLayer.children.length).toBe(2);
13
- <% if (reactFeatures.includes('locale')) { %>const getStartLink = outerLayer.findAllByProps({
14
- href: 'https://umijs.org/guide/getting-started.html',
15
- });
16
- expect(getStartLink.length).toBe(1);
17
- expect(getStartLink[0].children).toMatchObject(['Mock text']);<% } %>
18
- });
19
- });
@@ -1,21 +0,0 @@
1
- import 'jest';
2
- import Index from '..';
3
- import React from 'react';
4
- import renderer, { ReactTestInstance, ReactTestRenderer } from 'react-test-renderer';
5
-
6
- <% if (reactFeatures.includes('locale')) { %>jest.mock('umi-plugin-locale');
7
- <% } %>
8
- describe('Page: index', () => {
9
- it('Render correctly', () => {
10
- const wrapper: ReactTestRenderer = renderer.create(<Index />);
11
- expect(wrapper.root.children.length).toBe(1);
12
- const outerLayer = wrapper.root.children[0] as ReactTestInstance;
13
- expect(outerLayer.type).toBe('div');
14
- expect(outerLayer.children.length).toBe(2);
15
- <% if (reactFeatures.includes('locale')) { %>const getStartLink = outerLayer.findAllByProps({
16
- href: 'https://umijs.org/guide/getting-started.html',
17
- }) as ReactTestInstance[];
18
- expect(getStartLink.length).toBe(1);
19
- expect(getStartLink[0].children).toMatchObject(['Mock text']);<% } %>
20
- });
21
- });
@@ -1,23 +0,0 @@
1
-
2
- .normal {
3
- font-family: Georgia, sans-serif;
4
- margin-top: 4em;
5
- text-align: center;
6
- }
7
-
8
- .welcome {
9
- height: 512px;
10
- background: url(../assets/yay.jpg) no-repeat center 0;
11
- background-size: 512px 512px;
12
- }
13
-
14
- .list {
15
- font-size: 1.2em;
16
- margin: 1.8em 0 0;
17
- list-style: none;
18
- line-height: 1.5em;
19
- }
20
-
21
- .list code {
22
- background: #f7f7f7;
23
- }
@@ -1,18 +0,0 @@
1
- import styles from './index.css';
2
- <% if (reactFeatures.includes('locale')) { %>import { formatMessage } from 'umi-plugin-locale';<% } -%>
3
-
4
- export default function() {
5
- return (
6
- <div className={styles.normal}>
7
- <div className={styles.welcome} />
8
- <ul className={styles.list}>
9
- <li>To get started, edit <code>src/pages/index.js</code> and save to reload.</li>
10
- <li>
11
- <a href="https://umijs.org/guide/getting-started.html">
12
- <% if (reactFeatures.includes('locale')) { %>{formatMessage({ id: 'index.start' })}<% } else { %>Getting Started<% } %>
13
- </a>
14
- </li>
15
- </ul>
16
- </div>
17
- );
18
- }
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import styles from './index.css';
3
- <% if (reactFeatures.includes('locale')) { %>import { formatMessage } from 'umi-plugin-locale';<% } -%>
4
-
5
- export default function() {
6
- return (
7
- <div className={styles.normal}>
8
- <div className={styles.welcome} />
9
- <ul className={styles.list}>
10
- <li>To get started, edit <code>src/pages/index.js</code> and save to reload.</li>
11
- <li>
12
- <a href="https://umijs.org/guide/getting-started.html">
13
- <% if (reactFeatures.includes('locale')) { %>{formatMessage({ id: 'index.start' })}<% } else { %>Getting Started<% } %>
14
- </a>
15
- </li>
16
- </ul>
17
- </div>
18
- );
19
- }
@@ -1,18 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "esnext",
4
- "module": "esnext",
5
- "moduleResolution": "node",
6
- "importHelpers": true,
7
- "jsx": "react",
8
- "esModuleInterop": true,
9
- "sourceMap": true,
10
- "baseUrl": ".",
11
- "strict": true,
12
- "paths": {
13
- "@/*": ["src/*"],
14
- "@tmp/*": ["src/pages/.umi/*"]
15
- },
16
- "allowSyntheticDefaultImports": true
17
- }
18
- }
@@ -1,2 +0,0 @@
1
- declare module '*.css';
2
- declare module "*.png";
@@ -1,12 +0,0 @@
1
- /**
2
- * 不是真实的 webpack 配置,仅为兼容 webstorm 和 intellij idea 代码跳转
3
- * ref: https://github.com/umijs/umi/issues/1109#issuecomment-423380125
4
- */
5
-
6
- module.exports = {
7
- resolve: {
8
- alias: {
9
- '@': require('path').resolve(__dirname, 'src'),
10
- },
11
- },
12
- };
@@ -1,56 +0,0 @@
1
- const BasicGenerator = require('../../BasicGenerator');
2
-
3
- class Generator extends BasicGenerator {
4
- prompting() {
5
- const prompts = [
6
- {
7
- name: 'name',
8
- message: `What's the block name?`,
9
- default: this.name,
10
- },
11
- {
12
- name: 'description',
13
- message: `What's your block description?`,
14
- },
15
- {
16
- name: 'mail',
17
- message: `What's your email?`,
18
- },
19
- {
20
- name: 'author',
21
- message: `What's your name?`,
22
- },
23
- {
24
- name: 'repo',
25
- message: `Which repo is your block stored under github?`,
26
- default: 'umijs/umi-blocks',
27
- },
28
- {
29
- name: 'isTypeScript',
30
- type: 'confirm',
31
- message: 'Do you want to use typescript?',
32
- default: false,
33
- },
34
- ];
35
- return this.prompt(prompts).then(props => {
36
- this.prompts = props;
37
- });
38
- }
39
-
40
- writing() {
41
- this.writeFiles({
42
- context: this.prompts,
43
- filterFiles: f => {
44
- const { isTypeScript } = this.prompts;
45
- if (isTypeScript) {
46
- if (f.endsWith('.js')) return false;
47
- } else {
48
- if (this.isTsFile(f)) return false;
49
- }
50
- return true;
51
- },
52
- });
53
- }
54
- }
55
-
56
- module.exports = Generator;
@@ -1,3 +0,0 @@
1
- {
2
- "description": "Create a umi block."
3
- }
@@ -1,7 +0,0 @@
1
- **/*.md
2
- **/*.svg
3
- **/*.ejs
4
- **/*.html
5
- package.json
6
- .umi
7
- .umi-production
@@ -1,11 +0,0 @@
1
- {
2
- "singleQuote": true,
3
- "trailingComma": "all",
4
- "printWidth": 100,
5
- "overrides": [
6
- {
7
- "files": ".prettierrc",
8
- "options": { "parser": "json" }
9
- }
10
- ]
11
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- plugins: [
3
- ['umi-plugin-block-dev', {}],
4
- ],
5
- }
@@ -1,9 +0,0 @@
1
- import { IConfig } from 'umi-types';
2
-
3
- const config: IConfig = {
4
- plugins: [
5
- ['umi-plugin-block-dev', {}],
6
- ],
7
- }
8
-
9
- export default config;
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2019-present <%= author %> (<%= mail %>)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
@@ -1,13 +0,0 @@
1
- # @umi-material/<%= name %>
2
-
3
- <%= description %>
4
-
5
- ## Usage
6
-
7
- ```sh
8
- umi block https://github.com/<%= repo %>/tree/master/<%= name %>
9
- ```
10
-
11
- ## LICENSE
12
-
13
- MIT
@@ -1,7 +0,0 @@
1
- /yarn.lock
2
- /package-lock.json
3
- /dist
4
- /node_modules
5
- /pages
6
- .umi
7
- .umi-production
@@ -1,27 +0,0 @@
1
- {
2
- "name": "@umi-block/<%= name %>",
3
- "version": "0.0.1",
4
- "description": "<%= description %>",
5
- "main": "src/index.js",
6
- "authors": {
7
- "name": "<%= author %>",
8
- "email": "<%= mail %>"
9
- },
10
- "repository": "<%= repo %>/<%= name %>",
11
- "scripts": {
12
- "dev": "umi dev"
13
- },
14
- "dependencies": {
15
- "react": ">=16.0.0"
16
- },
17
- "devDependencies": {
18
- "umi": "^2.9.0",
19
- <% if (isTypeScript) { -%>
20
- "umi-plugin-block-dev": "^2.0.0",
21
- "umi-types": "^0.3.0"
22
- <% } else { -%>
23
- "umi-plugin-block-dev": "^2.0.0"
24
- <% } -%>
25
- },
26
- "license": "MIT"
27
- }
@@ -1,3 +0,0 @@
1
- .normal {
2
- background: #79F2AA;
3
- }
@@ -1,9 +0,0 @@
1
- import styles from './index.css';
2
-
3
- export default function() {
4
- return (
5
- <div className={styles.normal}>
6
- <h1>I am a umi block!</h1>
7
- </div>
8
- );
9
- }
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import styles from './index.css';
3
-
4
- const Block: React.FC = () => {
5
- return (
6
- <div className={styles.normal}>
7
- <h1>I am a umi block!</h1>
8
- </div>
9
- );
10
- }
11
-
12
- export default Block;
@@ -1,18 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "esnext",
4
- "module": "esnext",
5
- "moduleResolution": "node",
6
- "importHelpers": true,
7
- "jsx": "react",
8
- "esModuleInterop": true,
9
- "sourceMap": true,
10
- "baseUrl": ".",
11
- "strict": true,
12
- "paths": {
13
- "@/*": ["src/*"],
14
- "@tmp/*": ["src/pages/.umi/*"]
15
- },
16
- "allowSyntheticDefaultImports": true
17
- }
18
- }
@@ -1,2 +0,0 @@
1
- declare module '*.css';
2
- declare module "*.png";
@@ -1,55 +0,0 @@
1
- const BasicGenerator = require('../../BasicGenerator');
2
-
3
- class Generator extends BasicGenerator {
4
- prompting() {
5
- const prompts = [
6
- {
7
- name: 'name',
8
- message: `What's the library name?`,
9
- default: this.name,
10
- },
11
- {
12
- name: 'description',
13
- message: `What's your library description?`,
14
- },
15
- {
16
- name: 'mail',
17
- message: `What's your email?`,
18
- },
19
- {
20
- name: 'author',
21
- message: `What's your name?`,
22
- },
23
- {
24
- name: 'repo',
25
- message: `Which repo is your library stored under github?`,
26
- },
27
- {
28
- name: 'isTypeScript',
29
- type: 'confirm',
30
- message: 'Do you want to use typescript?',
31
- default: false,
32
- },
33
- ];
34
- return this.prompt(prompts).then(props => {
35
- this.prompts = props;
36
- });
37
- }
38
-
39
- writing() {
40
- this.writeFiles({
41
- context: this.prompts,
42
- filterFiles: f => {
43
- const { isTypeScript } = this.prompts;
44
- if (isTypeScript) {
45
- if (f.endsWith('.js')) return false;
46
- } else {
47
- if (this.isTsFile(f)) return false;
48
- }
49
- return true;
50
- },
51
- });
52
- }
53
- }
54
-
55
- module.exports = Generator;
@@ -1,3 +0,0 @@
1
- {
2
- "description": "Create a library with umi."
3
- }
@@ -1,4 +0,0 @@
1
- export default {
2
- cjs: 'rollup',
3
- esm: 'rollup',
4
- }
@@ -1,9 +0,0 @@
1
- import { IBundleOptions } from 'father';
2
-
3
- const options: IBundleOptions = {
4
- cjs: 'rollup',
5
- esm: 'rollup',
6
- doc: { typescript: true },
7
- };
8
-
9
- export default options;
@@ -1,5 +0,0 @@
1
- **/*.md
2
- **/*.mdx
3
- package.json
4
- .umi
5
- .umi-production
@@ -1,11 +0,0 @@
1
- {
2
- "singleQuote": true,
3
- "trailingComma": "all",
4
- "printWidth": 100,
5
- "overrides": [
6
- {
7
- "files": ".prettierrc",
8
- "options": { "parser": "json" }
9
- }
10
- ]
11
- }
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2019-present <%= author %> (<%= mail %>)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
@@ -1,13 +0,0 @@
1
- # @umi-material/<%= name %>
2
-
3
- <%= description %>
4
-
5
- ## Usage
6
-
7
- ```sh
8
- umi block https://github.com/<%= repo %>/tree/master/<%= name %>
9
- ```
10
-
11
- ## LICENSE
12
-
13
- MIT
@@ -1,5 +0,0 @@
1
- /yarn.lock
2
- /package-lock.json
3
- /dist
4
- /.docz
5
- /node_modules
@@ -1,28 +0,0 @@
1
- {
2
- "name": "<%= name %>",
3
- "version": "0.0.1",
4
- "description": "<%= description %>",
5
- "main": "dist/index.js",
6
- "module": "dist/index.esm.js",
7
- "authors": {
8
- "name": "<%= author %>",
9
- "email": "<%= mail %>"
10
- },
11
- "repository": "<%= repo %>/<%= name %>",
12
- "scripts": {
13
- "dev": "father doc dev",
14
- "build": "father build"
15
- },
16
- "peerDependencies": {
17
- "react": "16.x"
18
- },
19
- "devDependencies": {
20
- <% if (isTypeScript) { -%>
21
- "father": "^2.16.0",
22
- "typescript": "^3.3.3"
23
- <% } else { -%>
24
- "father": "^2.16.0"
25
- <% } -%>
26
- },
27
- "license": "MIT"
28
- }
@@ -1,4 +0,0 @@
1
-
2
- .button {
3
- color: red;
4
- }
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import styles from './index.css';
3
-
4
- export default function(props) {
5
- return (
6
- <button
7
- className={styles.button}
8
- style={{
9
- fontSize: props.size === 'large' ? 40 : 20,
10
- }}
11
- >
12
- { props.children }
13
- </button>
14
- );
15
- }
@@ -1,18 +0,0 @@
1
- ---
2
- name: Home
3
- route: /
4
- order: -1
5
- sidebar: true
6
- ---
7
-
8
- import Button from './';
9
-
10
- # Button Component
11
-
12
- ## Normal Button
13
-
14
- <Button>Hi</Button>
15
-
16
- ## Large Button
17
-
18
- <Button size="large">Hi</Button>
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import styles from './index.css';
3
-
4
- export interface ButtonProps {
5
- size?: 'large' | 'default';
6
- }
7
-
8
- const Button: React.FC<ButtonProps> = function(props) {
9
- return (
10
- <button
11
- className={styles.button}
12
- style={{
13
- fontSize: props.size === 'large' ? 40 : 20,
14
- }}
15
- >
16
- {props.children}
17
- </button>
18
- );
19
- };
20
-
21
- export default Button;