create-umi 0.25.1 → 0.27.1

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 (40) hide show
  1. package/README.md +4 -12
  2. package/lib/BasicGenerator.js +2 -2
  3. package/lib/generators/ant-design-pro/index.js +7 -54
  4. package/lib/generators/plugin/templates/package.json +1 -0
  5. package/lib/run.js +4 -4
  6. package/package.json +3 -3
  7. package/CHANGELOG.md +0 -44
  8. package/lib/generators/block/index.js +0 -56
  9. package/lib/generators/block/meta.json +0 -3
  10. package/lib/generators/block/templates/.prettierignore +0 -7
  11. package/lib/generators/block/templates/.prettierrc +0 -11
  12. package/lib/generators/block/templates/.umirc.js +0 -5
  13. package/lib/generators/block/templates/.umirc.ts +0 -9
  14. package/lib/generators/block/templates/LICENSE +0 -21
  15. package/lib/generators/block/templates/README.md +0 -13
  16. package/lib/generators/block/templates/_gitignore +0 -7
  17. package/lib/generators/block/templates/package.json +0 -27
  18. package/lib/generators/block/templates/src/index.css +0 -3
  19. package/lib/generators/block/templates/src/index.js +0 -9
  20. package/lib/generators/block/templates/src/index.tsx +0 -12
  21. package/lib/generators/block/templates/tsconfig.json +0 -18
  22. package/lib/generators/block/templates/typings.d.ts +0 -2
  23. package/lib/generators/library/index.js +0 -55
  24. package/lib/generators/library/meta.json +0 -3
  25. package/lib/generators/library/templates/.fatherrc.js +0 -4
  26. package/lib/generators/library/templates/.fatherrc.ts +0 -9
  27. package/lib/generators/library/templates/.prettierignore +0 -5
  28. package/lib/generators/library/templates/.prettierrc +0 -11
  29. package/lib/generators/library/templates/LICENSE +0 -21
  30. package/lib/generators/library/templates/README.md +0 -13
  31. package/lib/generators/library/templates/_gitignore +0 -5
  32. package/lib/generators/library/templates/package.json +0 -28
  33. package/lib/generators/library/templates/src/index.css +0 -4
  34. package/lib/generators/library/templates/src/index.js +0 -15
  35. package/lib/generators/library/templates/src/index.mdx +0 -18
  36. package/lib/generators/library/templates/src/index.tsx +0 -21
  37. package/lib/generators/library/templates/tsconfig.json +0 -17
  38. package/lib/generators/library/templates/typings.d.ts +0 -2
  39. package/lib/generators/plugin/templates/.gitignore +0 -8
  40. package/lib/generators/plugin/templates/example/.gitignore +0 -5
package/README.md CHANGED
@@ -2,11 +2,7 @@
2
2
 
3
3
  Creates a UmiJS application/plugin/block/library using the command line.
4
4
 
5
- [![codecov](https://codecov.io/gh/umijs/create-umi/branch/master/graph/badge.svg)](https://codecov.io/gh/umijs/create-umi)
6
- [![NPM version](https://img.shields.io/npm/v/create-umi.svg?style=flat)](https://npmjs.org/package/create-umi)
7
- [![CircleCI](https://circleci.com/gh/umijs/create-umi/tree/master.svg?style=svg)](https://circleci.com/gh/umijs/create-umi/tree/master)
8
- [![NPM downloads](http://img.shields.io/npm/dm/create-umi.svg?style=flat)](https://npmjs.org/package/create-umi)
9
- [![GitHub Actions status](https://github.com/umijs/create-umi/workflows/Node%20CI/badge.svg)](https://github.com/umijs/create-umi)
5
+ [![codecov](https://codecov.io/gh/umijs/create-umi/branch/master/graph/badge.svg)](https://codecov.io/gh/umijs/create-umi) [![NPM version](https://img.shields.io/npm/v/create-umi.svg?style=flat)](https://npmjs.org/package/create-umi) [![CircleCI](https://circleci.com/gh/umijs/create-umi/tree/master.svg?style=svg)](https://circleci.com/gh/umijs/create-umi/tree/master) [![NPM downloads](http://img.shields.io/npm/dm/create-umi.svg?style=flat)](https://npmjs.org/package/create-umi) [![GitHub Actions status](https://github.com/umijs/create-umi/workflows/Node%20CI/badge.svg)](https://github.com/umijs/create-umi)
10
6
 
11
7
  ## Usage
12
8
 
@@ -16,11 +12,9 @@ $ yarn create umi [appName]
16
12
 
17
13
  ## Boilerplates
18
14
 
19
- * `ant-design-pro` - Create project with a layout-only ant-design-pro boilerplate, use together with umi block.
20
- * `app ` - Create project with a simple boilerplate, support typescript.
21
- * `block ` - Create a umi block.
22
- * `library ` - Create a library with umi.
23
- * `plugin ` - Create a umi plugin.
15
+ - `ant-design-pro` - Create project with a layout-only ant-design-pro boilerplate, use together with umi block.
16
+ - `app` - Create project with a simple boilerplate, support typescript.
17
+ - `plugin` - Create a umi plugin.
24
18
 
25
19
  ## Usage Example
26
20
 
@@ -30,8 +24,6 @@ $ yarn create umi
30
24
  ? Select the boilerplate type (Use arrow keys)
31
25
  ant-design-pro - Create project with a layout-only ant-design-pro boilerplate, use together with umi block.
32
26
  ❯ app - Create project with a simple boilerplate, support typescript.
33
- block - Create a umi block.
34
- library - Create a library with umi.
35
27
  plugin - Create a umi plugin.
36
28
 
37
29
  ? Do you want to use typescript? (y/N)
@@ -46,8 +46,8 @@ class BasicGenerator extends Generator {
46
46
  dot: true,
47
47
  })
48
48
  .filter(filterFiles)
49
- .filter(file => !file.includes('welcomeImgs'))
50
- .forEach(file => {
49
+ .filter((file) => !file.includes('welcomeImgs'))
50
+ .forEach((file) => {
51
51
  debug(`copy ${file}`);
52
52
  const filePath = this.templatePath(file);
53
53
  if (statSync(filePath).isFile()) {
@@ -17,7 +17,7 @@ function log(...args) {
17
17
 
18
18
  function globList(patternList, options) {
19
19
  let fileList = [];
20
- patternList.forEach(pattern => {
20
+ patternList.forEach((pattern) => {
21
21
  fileList = [...fileList, ...glob.sync(pattern, options)];
22
22
  });
23
23
 
@@ -40,30 +40,12 @@ class AntDesignProGenerator extends BasicGenerator {
40
40
  };
41
41
  } else {
42
42
  const prompts = [
43
- {
44
- name: 'nextPro',
45
- type: 'list',
46
- choices: ['Pro V5', 'Pro V4'],
47
- message: '🧙 Be the first to experience the new umi@3 ?',
48
- default: 'Pro V4',
49
- when: () => {
50
- // 为了测试,没有任何用处
51
- process.send && process.send({ type: 'prompt' });
52
- process.emit('message', { type: 'prompt' });
53
- return true;
54
- },
55
- },
56
43
  {
57
44
  name: 'language',
58
45
  type: 'list',
59
46
  message: '🤓 Which language do you want to use?',
60
47
  choices: ['TypeScript', 'JavaScript'],
61
48
  default: 'TypeScript',
62
- when: ({ nextPro }) => {
63
- process.send && process.send({ type: 'prompt' });
64
- process.emit('message', { type: 'prompt' });
65
- return nextPro === 'Pro V4';
66
- },
67
49
  },
68
50
  {
69
51
  name: 'allBlocks',
@@ -71,33 +53,16 @@ class AntDesignProGenerator extends BasicGenerator {
71
53
  message: '🚀 Do you need all the blocks or a simple scaffold?',
72
54
  choices: ['simple', 'complete'],
73
55
  default: 'simple',
74
- when: ({ nextPro }) => {
75
- process.send && process.send({ type: 'prompt' });
76
- process.emit('message', { type: 'prompt' });
77
- return nextPro === 'Pro V4';
78
- },
79
- },
80
- {
81
- name: 'nextAntd',
82
- type: 'list',
83
- choices: ['antd@4', 'antd@3'],
84
- when: ({ allBlocks, nextPro }) => {
85
- process.send && process.send({ type: 'prompt' });
86
- process.emit('message', { type: 'prompt' });
87
- return allBlocks === 'simple' && nextPro === 'Pro V4';
88
- },
89
- message: '🦄 Time to use better, faster and latest antd@4!',
90
- default: 'antd@4',
91
56
  },
92
57
  ];
93
- return this.prompt(prompts).then(props => {
58
+ return this.prompt(prompts).then((props) => {
94
59
  this.prompts = props;
95
60
  });
96
61
  }
97
62
  }
98
63
 
99
64
  async writing() {
100
- const { language = 'TypeScript', allBlocks, nextPro, nextAntd } = this.prompts;
65
+ const { language = 'TypeScript', allBlocks } = this.prompts;
101
66
 
102
67
  const isTypeScript = language === 'TypeScript';
103
68
  const projectName = this.opts.name || this.opts.env.cwd;
@@ -110,24 +75,12 @@ class AntDesignProGenerator extends BasicGenerator {
110
75
  const githubUrl = await getGithubUrl();
111
76
  const gitArgs = [`clone`, githubUrl, `--depth=1`];
112
77
 
113
- // 如果想要使用旧的 antd,使用 antd@3 分支
114
- if (nextAntd === 'antd@3' && allBlocks === 'simple') {
115
- gitArgs.push('--branch', 'antd@3');
116
- }
117
-
118
- if (nextPro === 'Pro V5') {
119
- gitArgs.push('--branch', 'v5');
120
- }
121
-
122
78
  // all-blocks 分支上包含了所有的区块
123
79
  if (allBlocks === 'complete') {
124
80
  log(`🙈 complete mode can only use the version of antd@4`);
125
81
  gitArgs.push('--branch', 'all-blocks');
126
- }
127
-
128
- // Set branch if provided
129
- if (this.opts.args.branch && !nextPro) {
130
- gitArgs.push('--branch', this.opts.args.branch);
82
+ } else {
83
+ gitArgs.push('--branch', 'umi@3');
131
84
  }
132
85
 
133
86
  gitArgs.push(projectName);
@@ -184,7 +137,7 @@ class AntDesignProGenerator extends BasicGenerator {
184
137
 
185
138
  log('[JS] Clean up...');
186
139
  const removeTsFiles = globList(['tsconfig.json', '**/*.d.ts'], envOptions);
187
- removeTsFiles.forEach(filePath => {
140
+ removeTsFiles.forEach((filePath) => {
188
141
  const targetPath = path.resolve(projectPath, filePath);
189
142
  fs.removeSync(targetPath);
190
143
  });
@@ -221,7 +174,7 @@ class AntDesignProGenerator extends BasicGenerator {
221
174
  const ignoreFiles = pkg['create-umi'].ignore;
222
175
  const fileList = globList(ignoreFiles, envOptions);
223
176
 
224
- fileList.forEach(filePath => {
177
+ fileList.forEach((filePath) => {
225
178
  const targetPath = path.resolve(projectPath, filePath);
226
179
  fs.removeSync(targetPath);
227
180
  });
@@ -35,6 +35,7 @@
35
35
  <% } -%>
36
36
  "@umijs/test": "^3.0.10",
37
37
  "@umijs/test-utils": "^1.0.0",
38
+ "babel-plugin-import": "^1.13.3",
38
39
  "body-parser": "^1.18.2",
39
40
  "cross-env": "^6.0.3",
40
41
  "express": "^4.15.3",
package/lib/run.js CHANGED
@@ -8,8 +8,8 @@ const yeoman = require('yeoman-environment');
8
8
 
9
9
  const generators = fs
10
10
  .readdirSync(`${__dirname}/generators`)
11
- .filter(f => !f.startsWith('.'))
12
- .map(f => {
11
+ .filter((f) => !f.startsWith('.'))
12
+ .map((f) => {
13
13
  return {
14
14
  name: `${f.padEnd(15)} - ${chalk.gray(require(`./generators/${f}/meta.json`).description)}`,
15
15
  value: f,
@@ -18,7 +18,7 @@ const generators = fs
18
18
  });
19
19
 
20
20
  const runGenerator = async (generatorPath, { name = '', cwd = process.cwd(), args = {} }) => {
21
- return new Promise(resolve => {
21
+ return new Promise((resolve) => {
22
22
  if (name) {
23
23
  mkdirp.sync(name);
24
24
  cwd = path.join(cwd, name);
@@ -48,7 +48,7 @@ const runGenerator = async (generatorPath, { name = '', cwd = process.cwd(), arg
48
48
  });
49
49
  };
50
50
 
51
- const run = async config => {
51
+ const run = async (config) => {
52
52
  process.send && process.send({ type: 'prompt' });
53
53
  process.emit('message', { type: 'prompt' });
54
54
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-umi",
3
- "version": "0.25.1",
3
+ "version": "0.27.1",
4
4
  "description": "Creates a UmiJS application using the command line.",
5
5
  "homepage": "https://github.com/umijs/create-umi",
6
6
  "bugs": {
@@ -34,11 +34,11 @@
34
34
  "glob": "^7.1.4",
35
35
  "inquirer": "^6.4.1",
36
36
  "mkdirp": "^0.5.1",
37
- "prettier": "^1.17.0",
37
+ "prettier": "^2.0.0",
38
38
  "semver": "^6.1.0",
39
39
  "sort-package-json": "^1.22.1",
40
40
  "sylvanas": "^0.6.1",
41
- "typescript": "^3.8.3",
41
+ "typescript": "^4.0.0",
42
42
  "umi-utils": "^1.5.2",
43
43
  "yargs-parser": "^13.1.1",
44
44
  "yeoman-environment": "^2.8.0",
package/CHANGELOG.md DELETED
@@ -1,44 +0,0 @@
1
-
2
- ## The new CHNAGELOG will be updated on the [Release page](https://github.com/umijs/create-umi/releases).
3
-
4
- 0.9.5 / 2019-01-14
5
- ==================
6
-
7
- * enhance: add tests files (#32)
8
-
9
- 0.9.4 / 2019-01-14
10
- ==================
11
-
12
- * fix: create with typescript (#31)
13
- * fix: 少了一个分号 (#30)
14
-
15
- 0.9.3 / 2019-01-13
16
- ==================
17
-
18
- * yarn create umi时报错 (#29)
19
-
20
- 0.9.2 / 2019-01-12
21
- ==================
22
-
23
- * fix: create-umi not found, Close #26, Close #27
24
- * fix: create-umi -v
25
-
26
- 0.9.1 / 2019-01-12
27
- ==================
28
-
29
- * enable treeShaking by default
30
-
31
- 0.9.0 / 2019-01-12
32
- ==================
33
-
34
- * refact: improve create-umi (#25)
35
- * 重构一遍,结构清晰一些
36
- * app 支持 TypeScript,Close #22, Close #17
37
- * app 添加 ESLint 校验、treeShaking 配置
38
- * 优化 ant-design-pro 仓库 clone 时间问题,Close #20
39
- * 优化选择界面的提示文案,Close #24
40
-
41
- 0.8.1 / 2019-01-05
42
- ==================
43
-
44
- * fix: update umi-plugin-library to ^1.0.1-0
@@ -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;
@@ -1,17 +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
- },
15
- "allowSyntheticDefaultImports": true
16
- }
17
- }
@@ -1,2 +0,0 @@
1
- declare module '*.css';
2
- declare module "*.png";
@@ -1,8 +0,0 @@
1
- node_modules
2
- .changelog
3
- .umi
4
- .umi-test
5
- .umi-production
6
- .DS_Store
7
- /lib
8
- dist
@@ -1,5 +0,0 @@
1
- /.umi
2
- /.umi-production
3
- /dist
4
- /node_modules
5
- /yarn.lock