Skip to content

Commit

Permalink
feat: upgrade taro to 2.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Miaonster committed Mar 23, 2020
1 parent a5a2f70 commit c3fd489
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dist/
node_modules/
.DS_Store
yarn-error.log
lib/
2 changes: 1 addition & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const config = {
'828': 1.81 / 2
},
sourceRoot: 'src',
outputRoot: 'dist',
outputRoot: 'lib',
alias: {
'@': path.resolve(__dirname, '..', 'src'),
},
Expand Down
7 changes: 7 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"outDir": "./lib",
"baseUrl": "."
},
"include": ["src/**/*"]
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
"license": "MIT",
"author": "miaonster <[email protected]>",
"files": [
"dist"
"lib",
"types"
],
"type": "module",
"main": "dist/index.js",
"main": "lib/index.js",
"scripts": {
"build": "export TARO_BUILD_TYPE=ui && taro build --ui",
"dev:alipay": "taro build --type alipay --watch",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Barcode/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Barcode test Barcode test suites 1`] = `"<div class=\\"taro-img\\" style=\\"width:300px;height:60px;\\"><img class=\\"taro-img__mode-scaletofill\\" src=\\"\\"/></div>"`;
exports[`Barcode test Barcode test suites 1`] = `"<div class=\\"taro-img\\" style=\\"width:300px;height:60px;\\"><img class=\\"taro-img__mode-scaletofill\\" src=\\"data:image/bmp;base64,Qk2GBwAAAAAAADYAAAAoAAAAcAIAAAEAAAABABgAAAAAAFAHAAATCwAAEwsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAA////////////////////////////////AAAAAAAAAAAAAAAA////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAA////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////AAAAAAAAAAAAAAAA////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////AAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAA////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////AAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAA////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAA////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////AAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAA////////////////////////////////AAAAAAAAAAAAAAAA////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAA////////////////////////////////AAAAAAAAAAAAAAAA////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////AAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAA////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAA////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAA////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAA////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\"/></div>"`;
2 changes: 1 addition & 1 deletion src/components/Barcode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BarCode.defaultProps = {
}

BarCode.propTypes = {
text: PropTypes.string,
text: PropTypes.string.isRequired,
scale: PropTypes.number,
width: PropTypes.number,
height: PropTypes.number,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Qrcode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ QRCode.defaultProps = {
}

QRCode.propTypes = {
text: PropTypes.string.isRequired,
size: PropTypes.number,
scale: PropTypes.number,
text: PropTypes.string,
errorCorrectLevel: PropTypes.string,
typeNumber: PropTypes.number,
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as Barcode } from './components/Barcode'
export { default as QRCode } from './components/Qrcode'
export { default as QRCode } from './components/QRCode'
2 changes: 1 addition & 1 deletion src/pages/index/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import Barcode from '../../components/Barcode'
import QRCode from '../../components/Qrcode'
import QRCode from '../../components/QRCode'
import './index.css'

export default class Index extends Component {
Expand Down
10 changes: 10 additions & 0 deletions types/barcode.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react'

export interface BarcodeProps {
text: string
scale?: number
width?: number
height?: number
}

declare const Barcode: React.SFC<BarcodeProps>
16 changes: 16 additions & 0 deletions types/qrcode.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react'

export interface QRCodeProps {
text: string
scale?: number
size?: number
/**
* version
* @default 2
* @see https://www.qrcode.com/zh/about/version.html
*/
typeNumber?: number
errorCorrectLevel?: 'L' | 'M' | 'Q' | 'H'
}

declare const QRCode: React.SFC<QRCodeProps>

0 comments on commit c3fd489

Please sign in to comment.