Skip to content

Commit

Permalink
Merge pull request #188 from kne-union/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
zhipenglin authored Apr 16, 2024
2 parents bd3c25e + 4fc6583 commit 1a052b2
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 82 deletions.
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
npm run build:md
npm run lint-staged
16 changes: 16 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"arrowParens": "avoid",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": true,
"jsxSingleQuote": false,
"printWidth": 240,
"proseWrap": "preserve",
"requirePragma": false,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"useTabs": false,
"tabWidth": 2
}
44 changes: 7 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ npm i --save @kne/mini-core

### 概述

<img title="" src="https://www.kne-union.top/static-data/mini-core/index.jpg" alt="" style="margin: 2em auto;display: block; width: 200px; height: 200px">

***mini-core*** 是一个Taro的高级组件库,它有别于 ***@kne/antd-taro*** 只提供简单的UI交互组件,它旨在解决toB类小程序应用中的复杂场景问题,例如:

1. 主题色问题
Expand All @@ -32,52 +34,20 @@ npm i --save @kne/mini-core

#### 使用脚手架

你可以使用Taro官方提供的脚手架初始化项目

```shell
npm install -g @tarojs/cli
```

```shell
taro init myApp
```

或者使用npx执行
1. 执行初始化命令

```shell
npx @tarojs/cli init myApp
npx @kne/npm-tools init [project-name]
```

初始化完成之后安装***mini-core***
2. 选择 WeChat Miniprogram Project 模板

```shell
npm i --save @kne/mini-core
```

然后安装example演示程序及components所需包
3. 执行启动命令

```shell
npm i --save-dev @kne/mini-example @kne/md-doc
npm run start
```

package.json的scripts中添加对应的启动命令

```json
{
"init": "mini-example install && create-md && mini-example build",
"start": "npm run build:md &&npm run build:doc && run-p dev:weapp start:md start:doc start:example",
"build": "run-s build:weapp build:md build:doc build:example",
"build:weapp": "taro build --type weapp",
"dev:weapp": "cross-env NODE_ENV=production npm run build:weapp -- --watch",
"build:md": "create-md",
"start:md": "create-md --watch",
"build:doc": "mini-example build",
"start:doc": "mini-example start",
"build:example": "cd example && npm run build:weapp",
"build:example:dd": "cd example && npm run build:dd",
"start:example": "cd example && cross-env NODE_ENV=production npm run build:weapp -- --watch"
}
```

#### 示例程序的使用

Expand Down
44 changes: 7 additions & 37 deletions doc/summary.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<img title="" src="https://www.kne-union.top/static-data/mini-core/index.jpg" alt="" style="margin: 2em auto;display: block; width: 200px; height: 200px">

***mini-core*** 是一个Taro的高级组件库,它有别于 ***@kne/antd-taro*** 只提供简单的UI交互组件,它旨在解决toB类小程序应用中的复杂场景问题,例如:

1. 主题色问题
Expand All @@ -19,52 +21,20 @@

#### 使用脚手架

你可以使用Taro官方提供的脚手架初始化项目

```shell
npm install -g @tarojs/cli
```

```shell
taro init myApp
```

或者使用npx执行
1. 执行初始化命令

```shell
npx @tarojs/cli init myApp
npx @kne/npm-tools init [project-name]
```

初始化完成之后安装***mini-core***

```shell
npm i --save @kne/mini-core
```
2. 选择 WeChat Miniprogram Project 模板

然后安装example演示程序及components所需包
3. 执行启动命令

```shell
npm i --save-dev @kne/mini-example @kne/md-doc
npm run start
```

package.json的scripts中添加对应的启动命令

```json
{
"init": "mini-example install && create-md && mini-example build",
"start": "npm run build:md &&npm run build:doc && run-p dev:weapp start:md start:doc start:example",
"build": "run-s build:weapp build:md build:doc build:example",
"build:weapp": "taro build --type weapp",
"dev:weapp": "cross-env NODE_ENV=production npm run build:weapp -- --watch",
"build:md": "create-md",
"start:md": "create-md --watch",
"build:doc": "mini-example build",
"start:doc": "mini-example start",
"build:example": "cd example && npm run build:weapp",
"build:example:dd": "cd example && npm run build:dd",
"start:example": "cd example && cross-env NODE_ENV=production npm run build:weapp -- --watch"
}
```

#### 示例程序的使用

Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kne/mini-core",
"version": "2.1.0",
"version": "2.1.1",
"dependencies": {
"@kne/antd-taro": "^1.0.35",
"@kne/compose": "^0.1.0",
Expand All @@ -26,7 +26,8 @@
"build": "run-s build:lib build:md build:doc build:example",
"test": "run-s test:unit test:lint test:build",
"eject": "react-scripts eject",
"init": "mini-example install && create-md && mini-example build",
"init": "husky && npm run init-example",
"init-example": "mini-example install && create-md && mini-example build",
"build:lib": "microbundle --no-compress --format modern,cjs --jsx React.createElement --jsxFragment React.Fragment --alias lodash=@kne/lodash-wechat --assertType inline",
"build:md": "create-md",
"start:md": "create-md --watch",
Expand All @@ -39,8 +40,8 @@
"build:doc": "mini-example build",
"build:example": "cd example && npm run build:weapp",
"start:example": "cd example && cross-env NODE_ENV=production npm run build:weapp -- --watch",
"deploy": "gh-pages -d example/build",
"prettier": "prettier --config .prettierrc --write 'src/**/*.{js,jsx,ts,tsx,json,css,scss}'"
"prettier": "prettier --config .prettierrc --write 'src/**/*.{js,jsx,ts,tsx,json,css,scss}'",
"lint-staged": "npx lint-staged"
},
"browserslist": [
"last 3 versions",
Expand Down Expand Up @@ -77,8 +78,8 @@
"@babel/runtime": "^7.7.7",
"@kne/md-doc": "^0.1.8",
"@kne/microbundle": "^0.15.5",
"@kne/mini-example": "^0.1.11",
"@kne/modules-dev": "^2.0.6",
"@kne/mini-example": "^0.1.12",
"@kne/modules-dev": "^2.0.20",
"@tarojs/components": "3.6.23",
"@tarojs/helper": "3.6.23",
"@tarojs/plugin-framework-react": "3.6.23",
Expand All @@ -88,8 +89,7 @@
"@tarojs/shared": "3.6.23",
"@tarojs/taro": "3.6.23",
"cross-env": "^7.0.3",
"gh-pages": "^3.2.3",
"husky": "^7.0.4",
"husky": "^9.0.11",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"react": "^18.2.0",
Expand Down

0 comments on commit 1a052b2

Please sign in to comment.