Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 9 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ const isInVsCode = process.env.NODE_ENV === undefined

module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
useJSXTextNode: true,
project: './tsconfig.json',
},
extends: [
'airbnb-base',
'@zaihui/base',
Expand All @@ -24,6 +17,13 @@ module.exports = {
node: false,
browser: false,
},
settings: {
'import/resolver': {
typescript: {
project: ['packages/**/tsconfig.json'],
},
},
},
globals: {
// 小程序本质不是运行在浏览器下,所以不能启用browser的env
// 但有一些类似浏览器下的全局变量需要能够访问,所以在这里启用这些全局变量
Expand All @@ -49,12 +49,14 @@ module.exports = {
'no-debugger': isInVsCode ? 'warn' : 'error',
'no-console': isInVsCode ? 'warn' : 'error',
// 禁止一行以上的连续空行
'react/no-find-dom-node': 'off',
'no-multiple-empty-lines': [
'error',
{
max: 1,
},
],
'import/no-unresolved': 'off',
// 关闭对象花括号换行一致性规则
'object-curly-newline': 'off',
// 关闭禁止在else前有return规则
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: install
uses: pnpm/action-setup@v2.2.4
with:
version: 7
# Bootstrap project
- name: deps-init
run: npm run setup
run: pnpm run setup
- name: lint
run: npm run lint
run: pnpm run lint
- name: build-ci
run: npm run build:ci
run: pnpm run build:ci
env:
CI: true
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/node_modules
/dist
/es
/lib
node_modules
dist
lib
yarn-error.log
.DS_Store
.temp
Expand Down
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
package-lock=false
registry=https://registry.yarnpkg.com/
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,27 @@ npm install @zaihui/hui-design

hui-design 使用 conventional-commit 生态对 commit 规范化并基于此自动生成 changelog。

```bash
// node version 大于14
pnpm i
```

开发组件

```bash
cd packages/weapp-components

// ...do something
```

启动 demo 小程序

```bash
cd packages/demo

pnpm run dev
```

### commit

commit 需遵循[@commitlint/config-conventional](https://www.npmjs.com/package/@commitlint/config-conventional)规范,也可以通过`npm run commit`在交互式界面完成 commit,这一功能由[commitizen](https://github.com/commitizen/cz-cli)提供。
Expand Down
89 changes: 0 additions & 89 deletions config/dist/index.dev.js

This file was deleted.

5 changes: 4 additions & 1 deletion docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ const navBar = [

module.exports = {
title: 'hui-design-文档',
base: process.env.BUILD_ENV === 'prod' ? '/docs/hui-design/' : '/docs/hui-design-alpha/',
base:
process.env.BUILD_ENV === 'prod'
? '/docs/hui-design/'
: '/docs/hui-design-alpha/',
description: 'hui-design文档系统',
// dev时使用的端口
port: '8088',
Expand Down
78 changes: 24 additions & 54 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,23 @@
{
"name": "@zaihui/hui-design",
"version": "0.0.1-beta.43",
"description": "小程序组件库",
"templateInfo": {
"name": "mobx",
"typescript": true,
"css": "sass"
},
"files": [
"lib/*"
],
"types": "lib/types/index.d.ts",
"main": "lib/index.js",
"module": "lib/index.js",
"name": "hui-design",
"version": "0.0.2",
"description": "再惠组件库",
"scripts": {
"setup": "yarn install --frozen-lockfile",
"depup": "yarn upgrade-interactive --latest",
"lint:style": "stylelint 'src/**/*.scss' --syntax scss",
"lint:style:fix": "prettier --check --write src/**/*.scss && npm run lint:style -- --fix",
"setup": "pnpm i",
"lint:style": "stylelint 'packages/**/*.scss' --syntax scss",
"lint:style:fix": "prettier --check --write packages/**/*.scss && npm run lint:style -- --fix",
"lint:format": "eslint --ext .js,.ts,.tsx ./",
"lint:format:fix": "prettier --check --write src/**/*.{ts,tsx} && npm run lint:format -- --fix",
"lint:format:fix": "prettier --check --write packages/**/*.{ts,tsx} && npm run lint:format -- --fix",
"lint": "npm run type-check && npm run lint:format && npm run lint:style",
"type-check": "tsc --noEmit",
"type-check": "pnpm --filter './packages/**' type-check",
"build:ci": "pnpm --filter './packages/weapp-components' build:ci",
"test": "jest",
"test:ci": "jest --coverage",
"build:weapp": "taro build --type weapp",
"dev": "concurrently \"npm run build:weapp -- --watch\" \"npm run watch:fix\"",
"dev:weapp": "npm run build:weapp -- --watch",
"watch:fix": "onchange src/**/*.{js,ts,tsx,scss} -- prettier --write '{{file}}' --ignore-unknown",
"build:h5": "taro build --type h5",
"build:h5:alpha": "cross-env BUILD_ENV=alpha npm run build:h5",
"build:h5:prod": "cross-env BUILD_ENV=prod npm run build:h5",
"dev:h5": "npm run build:h5 -- --watch",
"build:ci": "rimraf ./lib && tsc -p ./tsconfig.build.json && node ./scripts/copy-files.js src/ lib/ png scss",
"docs:start": "concurrently -k -p \"[{name}]\" -n \"dev:h5,docs:dev\" -c \"yellow.bold,cyan.bold,green.bold\" \"npm run dev:h5\" \"npm run docs:dev\"",
"docs:dev": "vuepress dev docs --open",
"docs:build": "vuepress build docs",
"docs:build:alpha": "cross-env BUILD_ENV=alpha npm run docs:build",
"docs:build:prod": "cross-env BUILD_ENV=prod npm run docs:build",
"icon:sync": "node scripts/syncIcon.mjs",
"commit": "npx git-cz",
"release": "standard-version --commit-all",
"stylelint-check": "stylelint-config-prettier-check",
Expand All @@ -51,6 +30,9 @@
},
"homepage": "https://github.com/zaihui/hui-design",
"license": "ISC",
"engines": {
"node": ">=14.0.0"
},
"dependencies": {
"classnames": "^2.2.6",
"dayjs": "^1.10.6",
Expand All @@ -69,23 +51,22 @@
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
"@tarojs/cli": "^3.5.8",
"@tarojs/components": "^3.5.8",
"@tarojs/mini-runner": "^3.5.8",
"@tarojs/plugin-framework-react": "^3.5.8",
"@tarojs/plugin-platform-weapp": "^3.5.8",
"@tarojs/react": "^3.5.8",
"@tarojs/runtime": "^3.5.8",
"@tarojs/taro": "^3.5.8",
"@tarojs/taro-h5": "^3.5.8",
"@tarojs/webpack-runner": "^3.5.8",
"@tarojs/cli": ">=3.0.1",
"@tarojs/components": ">=3.0.1",
"@tarojs/mini-runner": ">=3.0.1",
"@tarojs/plugin-framework-react": ">=3.0.1",
"@tarojs/plugin-platform-weapp": ">=3.0.1",
"@tarojs/react": ">=3.0.1",
"@tarojs/runtime": ">=3.0.1",
"@tarojs/taro": ">=3.0.1",
"@tarojs/taro-h5": ">=3.0.1",
"@tarojs/webpack-runner": ">=3.0.1",
"@types/jest": "^26.0.0",
"@types/node": "^14.0.13",
"@types/react": "^18.0.25",
"@types/webpack-env": "^1.13.6",
"@typescript-eslint/eslint-plugin": "^5.45.1",
"@typescript-eslint/parser": "^5.45.1",
"@vuepress/plugin-active-header-links": "^1.5.2",
"@zaihui/eslint-config-base": "^2.0.7",
"@zaihui/eslint-plugin-react": "^2.1.2",
"babel-core": "^7.0.0-bridge.0",
Expand All @@ -98,9 +79,7 @@
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.1",
"babel-preset-taro": "^3.5.8",
"babel-runtime": "^6.26.0",
"commander": "^10.0.1",
"commitizen": "^4.2.1",
"concurrently": "^5.3.0",
"cross-env": "^7.0.2",
Expand All @@ -120,14 +99,10 @@
"husky": "^8.0.1",
"jest": "^26.0.1",
"lint-staged": "^13.2.1",
"mini-css-extract-plugin": "^2.7.2",
"mobx": "^6.7.0",
"mobx-react": "^7.6.0",
"nerv-devtools": "^1.5.7",
"nerv-server": "^1.5.7",
"nerv-test-utils": "^1.5.7",
"nervjs": "^1.5.7",
"node-fetch": "^2.6.0",
"node-sass": "^4.14.1",
"prettier": "^2.8.8",
"pretty-quick": "^3.1.3",
Expand All @@ -136,7 +111,6 @@
"react-dom": "^18.2.0",
"react-refresh": "^0.14.0",
"regenerator-runtime": "0.11.1",
"rimraf": "^3.0.2",
"sass-loader": "^10.1.0",
"standard-version": "^9.0.0",
"stylelint": "^13.6.1",
Expand All @@ -147,12 +121,8 @@
"stylelint-declaration-use-variable": "^1.7.2",
"stylelint-scss": "^3.18.0",
"stylelint-use-nesting": "^3.0.0",
"typescript": "^3.9.5",
"vuepress": "^1.5.2"
},
"peerDependencies": {
"react": ">=18.2.0",
"react-dom": ">=18.2.0"
"webpack": ">=4.43.0",
"typescript": "^3.9.5"
},
"lint-staged": {
"**/*.scss": "npm run lint:style",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "demo-mini-program",
"private": true,
"version": "0.0.1",
"description": "示例小程序",
"templateInfo": {
"name": "mobx",
"typescript": true,
"css": "sass"
},
"scripts": {
"type-check": "tsc --noEmit",
"build:weapp": "taro build --type weapp",
"dev": "concurrently \"npm run build:weapp -- --watch\" \"npm run watch:fix\"",
"dev:weapp": "npm run build:weapp -- --watch",
"watch:fix": "onchange src/**/*.{js,ts,tsx,scss} -- prettier --write '{{file}}' --ignore-unknown",
"build:h5": "taro build --type h5",
"build:h5:alpha": "cross-env BUILD_ENV=alpha npm run build:h5",
"build:h5:prod": "cross-env BUILD_ENV=prod npm run build:h5",
"dev:h5": "npm run build:h5 -- --watch"
},
"license": "ISC",
"devDependencies": {
"@zaihui/hui-design": "workspace:*",
"mini-css-extract-plugin": "^2.7.2",
"mobx": "^6.7.0",
"babel-preset-taro": ">=3.0.1",
"mobx-react": "^7.6.0"
}
}
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/app.scss → packages/demo/src/app.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '@/styles/index.scss';
@import '@zaihui/hui-design/src/styles/index.scss';

page {
display: block;
Expand Down
Loading