Skip to content

Commit

Permalink
feat: add foregroundColor, backgroundColor (#37)
Browse files Browse the repository at this point in the history
* feat: add foregroundColor, backgroundColor

* fix: fix package name

* fix: fix taro-code path

* fix: fix taro-code name

* fix: fix lint error
  • Loading branch information
Miaonster authored Jun 22, 2021
1 parent 9ee66f1 commit f0ced87
Show file tree
Hide file tree
Showing 38 changed files with 7,562 additions and 10,286 deletions.
44 changes: 31 additions & 13 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
{
"extends": ["taro/react", "standard"],
"plugins": ["prettier"],
"settings": {
"react": {
"version": "detect"
}
"extends": [
"taro/react",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"standard-with-typescript",
"plugin:jest/recommended"
],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {},
"globals": {
"describe": true,
"beforeEach": true,
"it": true,
"expect": true
"env": {
"jest/globals": true
},
"parser": "babel-eslint"
"overrides": [
{
"files": [
"packages/**/*.test.tsx",
"packages/**/*.test.js"
],
"rules": {
"taro/no-stateless-component": "off",
"react/react-in-jsx-scope": "off",
"react/no-find-dom-node": "off",
"no-unused-vars": [
"error",
{
"varsIgnorePattern": "Nerv"
}
]
}
}
]
}
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ npm install taro-code

### Usage

```jsx
```tsx
import Taro from '@tarojs/taro'
import { Barcode, QRCode } from 'taro-code'

Expand All @@ -42,25 +42,26 @@ class Code extends Taro.Component {

### Barcode

| Prop | Type | Default |
| -------- | -------- | ------- |
| `text` | `string` | `''` |
| `width` | `number` | `300` |
| `height` | `number` | `80` |
| `scale` | `number` | `4` |
| `style` | `object` | `{}` |
| Prop | Type | Default |
| ----------- | -------- | ------- |
| `text` | `string` | `''` |
| `width` | `number` | `300` |
| `height` | `number` | `80` |
| `scale` | `number` | `4` |
| `style` | `object` | `{}` |
| `className` | `string` | |

### QRCode

| Prop | Type | Default |
| ------------------- | -------- | ------- |
| `text` | `string` | `''` |
| `size` | `number` | `300` |
| `scale` | `number` | `4` |
| `typeNumber` | `number` | `2` |
| `errorCorrectLevel` | `string` | `'M'` |
| `style` | `object` | `{}` |

| Prop | Type | Default |
| ------------------- | -------------------------- | ------- |
| `text` | `string` | `''` |
| `size` | `number` | `300` |
| `scale` | `number` | `4` |
| `typeNumber` | `number` | `2` |
| `errorCorrectLevel` | `'L' \| 'M' \| 'Q' \| 'H'` | `'M'` |
| `style` | `object` | `{}` |
| `className` | `string` | |

## Screenshot

Expand Down
4 changes: 0 additions & 4 deletions babel.config.js

This file was deleted.

20 changes: 0 additions & 20 deletions jest.config.js

This file was deleted.

14 changes: 14 additions & 0 deletions lerna-debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
0 silly argv {
0 silly argv _: [ 'add' ],
0 silly argv scope: 'taro-code',
0 silly argv dev: true,
0 silly argv D: true,
0 silly argv globs: [],
0 silly argv lernaVersion: '3.22.1',
0 silly argv '$0': '/Users/miaonster/code/mine/taro-code/node_modules/.bin/lerna',
0 silly argv pkg: '@types/nervjs'
0 silly argv }
1 notice cli v3.22.1
2 verbose rootPath /Users/miaonster/code/mine/taro-code
3 error Error: 404 Not Found - GET https://registry.yarnpkg.com/@types%2fnervjs - Not found
3 error at /Users/miaonster/code/mine/taro-code/node_modules/@evocateur/npm-registry-fetch/check-response.js:104:15
63 changes: 22 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"name": "taro-code",
"name": "taro-code-root",
"description": "Taro.js barcode & qrcode",
"homepage": "https://github.com/miaonster/taro-code",
"license": "MIT",
Expand Down Expand Up @@ -37,49 +37,30 @@
}
},
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.7.5",
"@babel/preset-env": "^7.7.6",
"@tarojs/cli": "3.0.7",
"@tarojs/components": "3.0.7",
"@tarojs/mini-runner": "^3.0.7",
"@tarojs/react": "^3.0.7",
"@tarojs/router": "3.0.7",
"@tarojs/taro": "3.0.7",
"@tarojs/taro-h5": "^3.0.7",
"@tarojs/webpack-runner": "3.0.7",
"@types/react": "^16.4.6",
"@types/webpack-env": "^1.13.6",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.1.0",
"babel-jest": "23.6.0",
"babel-preset-taro": "^3.0.7",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "4",
"@typescript-eslint/parser": "^4.15.1",
"babel-preset-taro": "3.2.13",
"cross-env": "^7.0.2",
"cz-conventional-changelog": "^3.0.2",
"eslint": "^7.7.0",
"eslint-config-standard": "^14.1.1",
"eslint-config-taro": "^3.0.7",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": "^4.2.1",
"eslint": "7",
"eslint-config-prettier": "^8.1.0",
"eslint-config-standard": "^16.0.2",
"eslint-config-standard-with-typescript": "^20.0.0",
"eslint-config-taro": "3.2.13",
"eslint-import-resolver-typescript": "^2.4.0",
"eslint-plugin-import": "2",
"eslint-plugin-jest": "^24.3.6",
"eslint-plugin-node": "11",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-promise": "4",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-react-hooks": "^2.3.0",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-taro": "^3.0.7",
"husky": ">=1",
"jest": "23.6.0",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-standard": "^5.0.0",
"eslint-plugin-taro": "3.2.13",
"husky": "^6.0.0",
"lerna": "^3.22.1",
"lint-staged": ">=8",
"miniprogram-automator": "^0.8.0",
"nerv-devtools": "^1.5.7",
"nerv-server": "^1.5.6",
"nervjs": "^1.5.7",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"rollup": "^2.26.4",
"rollup-plugin-copy": "^3.3.0",
"rollup-plugin-typescript2": "^0.27.2",
"rollup-plugin-visualizer": "^4.1.0"
"lint-staged": "^10.5.4",
"prettier": "^2.2.1"
}
}
31 changes: 15 additions & 16 deletions packages/taro-code-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,25 @@
],
"dependencies": {
"@babel/runtime": "^7.7.7",
"@tarojs/components": "~3.0.2",
"@tarojs/react": "~3.0.2",
"@tarojs/runtime": "~3.0.2",
"@tarojs/taro": "~3.0.2",
"react": "^16.13.0",
"react-dom": "^16.13.0",
"@tarojs/components": "3.2.13",
"@tarojs/react": "3.2.13",
"@tarojs/runtime": "3.2.13",
"@tarojs/taro": "3.2.13",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"react-test-renderer": "^16.13.1",
"taro-code": "file:../taro-code"
},
"devDependencies": {
"@babel/core": "^7.8.0",
"@tarojs/cli": "~3.0.2",
"@tarojs/mini-runner": "~3.0.2",
"@tarojs/webpack-runner": "~3.0.2",
"@types/react": "^16.0.0",
"@types/webpack-env": "^1.13.6",
"@typescript-eslint/eslint-plugin": "^3.9.1",
"babel-preset-taro": "~3.0.2",
"eslint": "^7.7.0",
"eslint-config-taro": "~3.0.2",
"@tarojs/cli": "3.2.13",
"@tarojs/mini-runner": "3.2.13",
"@tarojs/webpack-runner": "3.2.13",
"@types/jest": "^26.0.23",
"babel-plugin-istanbul": "^6.0.0",
"babel-preset-taro": "3.2.13",
"nervjs": "^1.5.7",
"rimraf": "^3.0.2",
"typescript": "^3.8.3"
"typescript": "4.3.2"
}
}
72 changes: 36 additions & 36 deletions packages/taro-code-demo/project.config.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
{
"miniprogramRoot": "lib/",
"projectname": "taro-code",
"description": "Taro.js barcode & qrcode",
"appid": "touristappid",
"setting": {
"urlCheck": true,
"es6": false,
"enhance": false,
"postcss": false,
"preloadBackgroundData": false,
"minified": false,
"newFeature": true,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useIsolateContext": true,
"useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false
},
"compileType": "miniprogram",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {}
}
"miniprogramRoot": "lib/",
"projectname": "taro-code",
"description": "Taro.js barcode & qrcode",
"appid": "touristappid",
"setting": {
"urlCheck": true,
"es6": false,
"enhance": false,
"postcss": false,
"preloadBackgroundData": false,
"minified": false,
"newFeature": true,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useIsolateContext": true,
"useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false
},
"compileType": "miniprogram",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {}
}
Empty file.
1 change: 0 additions & 1 deletion packages/taro-code-demo/src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react'
import './app.css'

class App extends React.Component {
render (): React.ReactNode {
Expand Down
Loading

0 comments on commit f0ced87

Please sign in to comment.