-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2185 from XiaoMi/develop
Publish HiUI v4.
- Loading branch information
Showing
3,719 changed files
with
139,182 additions
and
140,710 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# MIFE dotfiles | ||
|
||
root = true | ||
|
||
[*] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,44 @@ | ||
// MIFE dotfiles | ||
|
||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
root: true, | ||
env: { | ||
browser: true, | ||
es2021: true | ||
es2021: true, | ||
'jest/globals': true, | ||
}, | ||
parser: 'babel-eslint', | ||
extends: ['plugin:react/recommended', 'standard', 'prettier'], | ||
extends: ['plugin:react/recommended', 'standard', 'prettier', 'prettier/@typescript-eslint'], | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true | ||
jsx: true, | ||
}, | ||
ecmaVersion: 12, | ||
sourceType: 'module' | ||
sourceType: 'module', | ||
}, | ||
plugins: ['@typescript-eslint', 'react', 'react-hooks', 'prettier', 'jest'], | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
plugins: ['react', 'prettier'], | ||
rules: { | ||
'prettier/prettier': ['error', { singleQuote: true, semi: false, printWidth: 120, trailingComma: 'none' }], | ||
'prettier/prettier': [ | ||
'error', | ||
{ | ||
singleQuote: true, | ||
semi: false, | ||
printWidth: 100, | ||
trailingComma: 'es5', | ||
}, | ||
], | ||
'no-use-before-define': 0, | ||
'@typescript-eslint/no-use-before-define': 0, | ||
'react/prop-types': 0, | ||
'react/no-children-prop': 0, | ||
'react/display-name': 0 | ||
} | ||
'react-hooks/rules-of-hooks': 2, // check Hook rules | ||
'react-hooks/exhaustive-deps': 1, // check effect deps | ||
'no-case-declarations': 0, | ||
}, | ||
ignorePatterns: ['*.d.ts', 'lib'], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
const Path = require('path') | ||
|
||
const PROJ_ROOT = __dirname | ||
const resolveApp = (...paths) => Path.resolve(PROJ_ROOT, ...paths) | ||
|
||
module.exports = { | ||
templates: resolveApp('.hygen'), | ||
helpers: { | ||
root: () => __dirname, | ||
uiDir: (to) => resolveApp('packages/ui', to), | ||
utilsDir: (to) => resolveApp('packages/utils', to), | ||
hooksDir: (to) => resolveApp('packages/hooks', to), | ||
camelCase: (function () { | ||
const cache = {} | ||
return function (str) { | ||
if (!str) return '' | ||
if (cache[str]) return cache[str] | ||
|
||
return (cache[str] = str | ||
.replace(/-([a-z])/g, (_, i) => i.toUpperCase()) | ||
.replace(/^([a-z])/, (_, i) => i.toUpperCase()) | ||
) | ||
} | ||
})(), | ||
hump: (function () { | ||
const cache = {} | ||
return function (str) { | ||
if (!str) return '' | ||
if (cache[str]) return cache[str] | ||
|
||
return (cache[str] = str | ||
.replace(/-([a-z])/g, (_, i) => i.toUpperCase()) | ||
) | ||
} | ||
})(), | ||
capt: (function () { | ||
const cache = {} | ||
return function (str) { | ||
if (!str) return '' | ||
if (cache[str]) return cache[str] | ||
|
||
return (cache[str] = str | ||
.replace(/-/g, '_') | ||
.replace(/([a-z])/g, (_, i) => i.toUpperCase()) | ||
) | ||
} | ||
})(), | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
to: <%= h.hooksDir(`${name}/README.md`) %> | ||
--- | ||
# `@hi-ui/<%= name %>` | ||
|
||
> TODO: description | ||
|
||
## Usage | ||
|
||
``` | ||
const <%= h.hump(name) %> = require('@hi-ui/<%= name %>'); | ||
|
||
// TODO: DEMONSTRATE API | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
to: <%= h.hooksDir(`${name}/__tests__/${name}.test.js`) %> | ||
--- | ||
const <%= h.hump(name) %> = require('../src') | ||
|
||
describe('@hi-ui/<%= name %>', () => { | ||
it('needs tests', () => {}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
to: <%= h.hooksDir(`${name}/jest.config.js`) %> | ||
--- | ||
module.exports = require('../../../jest.config') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
to: <%= h.hooksDir(`${name}/package.json`) %> | ||
--- | ||
{ | ||
"name": "@hi-ui/<%= name %>", | ||
"version": "4.0.0-beta.0", | ||
"description": "A sub-package for @hi-ui/hooks.", | ||
"keywords": [], | ||
"author": "HIUI <mi-hiui@xiaomi.com>", | ||
"homepage": "https://github.com/XiaoMi/hiui/tree/master/packages/hooks/<%= name %>#readme", | ||
"license": "MIT", | ||
"directories": { | ||
"lib": "lib", | ||
"test": "__tests__" | ||
}, | ||
"files": [ | ||
"lib" | ||
], | ||
"main": "lib/cjs/index.js", | ||
"module": "lib/esm/index.js", | ||
"types": "lib/types/index.d.ts", | ||
"typings": "lib/types/index.d.ts", | ||
"exports": { | ||
".": { | ||
"require": "./lib/cjs/index.js", | ||
"default": "./lib/esm/index.js" | ||
} | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/XiaoMi/hiui.git" | ||
}, | ||
"scripts": { | ||
"test": "jest", | ||
"clean": "rimraf lib", | ||
"prebuild": "yarn clean", | ||
"build:esm": "hi-build ./src/index.ts --format esm -d ./lib/esm", | ||
"build:cjs": "hi-build ./src/index.ts --format cjs -d ./lib/cjs", | ||
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir lib/types", | ||
"build": "concurrently yarn:build:*" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/XiaoMi/hiui/issues" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=16.8.6" | ||
}, | ||
"devDependencies": { | ||
"@hi-ui/hi-build": "^4.0.0-beta.0", | ||
"react": "^17.0.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
to: <%= h.hooksDir(`${name}/src/index.ts`) %> | ||
--- | ||
import { } from 'react' | ||
|
||
/** | ||
* TODO: What is <%= h.hump(name) %> | ||
*/ | ||
export const <%= h.hump(name) %> = ({}: <%= h.camelCase(name) %>Props) => { | ||
|
||
} | ||
|
||
export interface <%= h.camelCase(name) %>Props { | ||
} | ||
|
||
export type <%= h.camelCase(name) %>Return = ReturnType<typeof <%= h.hump(name) %>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
to: <%= h.hooksDir(`${name}/tsconfig.json`) %> | ||
--- | ||
{ | ||
"extends": "../../../tsconfig.json", | ||
"include": ["./src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
to: <%= h.uiDir(`${name}/README.md`) %> | ||
--- | ||
# `@hi-ui/<%= name %>` | ||
|
||
> TODO: description | ||
|
||
## Usage | ||
|
||
``` | ||
const <%= h.camelCase(name) %> = require('@hi-ui/<%= name %>'); | ||
|
||
// TODO: DEMONSTRATE API | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
to: <%= h.uiDir(`${name}/__tests__/${name}.test.js`) %> | ||
--- | ||
const <%= h.camelCase(name) %> = require('../src') | ||
|
||
describe('@hi-ui/<%= name %>', () => { | ||
it('needs tests', () => {}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# <%= h.camelCase(name) %> 组件中文名 | ||
|
||
组件一句话介绍 | ||
|
||
## 何时使用 | ||
|
||
何时使用介绍 | ||
|
||
## 使用示例 | ||
|
||
<!-- Inject Stories --> | ||
|
||
## Props | ||
|
||
<!-- Inject Props --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
to: <%= h.uiDir(`${name}/jest.config.js`) %> | ||
--- | ||
module.exports = require('../../../jest.config') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
to: <%= h.uiDir(`${name}/package.json`) %> | ||
--- | ||
{ | ||
"name": "@hi-ui/<%= name %>", | ||
"version": "4.0.0-beta.0", | ||
"description": "A sub-package for @hi-ui/hiui.", | ||
"keywords": [], | ||
"author": "HIUI <mi-hiui@xiaomi.com>", | ||
"homepage": "https://github.com/XiaoMi/hiui/tree/master/packages/ui/<%= name %>#readme", | ||
"license": "MIT", | ||
"directories": { | ||
"lib": "lib", | ||
"test": "__tests__" | ||
}, | ||
"files": [ | ||
"lib" | ||
], | ||
"main": "lib/cjs/index.js", | ||
"module": "lib/esm/index.js", | ||
"types": "lib/types/index.d.ts", | ||
"typings": "lib/types/index.d.ts", | ||
"exports": { | ||
".": { | ||
"require": "./lib/cjs/index.js", | ||
"default": "./lib/esm/index.js" | ||
} | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/XiaoMi/hiui.git" | ||
}, | ||
"scripts": { | ||
"test": "jest", | ||
"clean": "rimraf lib", | ||
"prebuild": "yarn clean", | ||
"build:esm": "hi-build ./src/index.ts --format esm -d ./lib/esm", | ||
"build:cjs": "hi-build ./src/index.ts --format cjs -d ./lib/cjs", | ||
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir lib/types", | ||
"build": "concurrently yarn:build:*" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/XiaoMi/hiui/issues" | ||
}, | ||
"dependencies": { | ||
"@hi-ui/classname": "^4.0.0-beta.0", | ||
"@hi-ui/core": "^4.0.0-beta.0", | ||
"@hi-ui/core-css": "^4.0.0-beta.0", | ||
"@hi-ui/env": "^4.0.0-beta.0" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=16.8.6" | ||
}, | ||
"devDependencies": { | ||
"@hi-ui/hi-build": "^4.0.0-beta.1", | ||
"react": "^17.0.1" | ||
} | ||
} |
Oops, something went wrong.