From dd2f96291e13dbd1e09cbf91d89233ff7310639e Mon Sep 17 00:00:00 2001 From: suanmei Date: Tue, 30 Jun 2020 22:06:59 +0800 Subject: [PATCH] =?UTF-8?q?build(root):=20browser=20=E6=8C=87=E5=AE=9A=20u?= =?UTF-8?q?md=20=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .npmignore | 4 +-- example/package.json | 1 + example/src/App.tsx | 38 +++++++++++++++++++++- example/yarn.lock | 5 +++ exxxxxxx/index.html | 77 -------------------------------------------- package.json | 4 +-- rollup.config.js | 2 +- 7 files changed, 47 insertions(+), 84 deletions(-) delete mode 100644 exxxxxxx/index.html diff --git a/.npmignore b/.npmignore index 65ad7d2..8a446d1 100644 --- a/.npmignore +++ b/.npmignore @@ -3,6 +3,4 @@ node_modules .eslintcache example -screenshots -sources -index.js \ No newline at end of file +src \ No newline at end of file diff --git a/example/package.json b/example/package.json index 9517a20..8402b35 100644 --- a/example/package.json +++ b/example/package.json @@ -10,6 +10,7 @@ "@types/node": "^12.0.0", "@types/react": "^16.9.0", "@types/react-dom": "^16.9.0", + "callapp-lib": "^3.0.0", "react": "^16.13.1", "react-dom": "^16.13.1", "react-scripts": "3.4.1", diff --git a/example/src/App.tsx b/example/src/App.tsx index 1ab540a..24b3cb2 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -1,8 +1,44 @@ import React from 'react'; +import CallApp from 'callapp-lib'; import './App.css'; +const option = { + scheme: { + protocol: 'ykshortvideo', + }, + outChain: { + protocol: 'ykshortvideo', + path: 'temporary', + key: 'url', + }, + intent: { + package: 'com.youku.shortvideo', + scheme: 'ykshortvideo', + }, + universal: { + host: 'flash-link.youku.com', + pathKey: 'action', + }, + appstore: 'https://itunes.apple.com/cn/app/id1383186862', + yingyongbao: '//a.app.qq.com/o/simple.jsp?pkgname=com.youku.shortvideo', + fallback: 'https://dianliu.youku.com/service/download', + timeout: 2000, +}; + +const lib = new CallApp(option); + function App() { - return
333
; + return ( +
+ +
+ ); } export default App; diff --git a/example/yarn.lock b/example/yarn.lock index 9c74bd8..6aa8f88 100644 --- a/example/yarn.lock +++ b/example/yarn.lock @@ -2703,6 +2703,11 @@ call-me-maybe@^1.0.1: resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" integrity sha1-JtII6onje1y95gJQoV8DHBak1ms= +callapp-lib@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/callapp-lib/-/callapp-lib-3.0.0.tgz#16d8b54505c7a1075014454b6156d8070e214f7c" + integrity sha512-PCgIns+bpcbby5PtCVIpJqDnHpdccGVtwgJO0gPM6+jnWgTDQ3MXb5vhwviVakYJvtifqLfYPebMcvAMQl4BWA== + caller-callsite@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" diff --git a/exxxxxxx/index.html b/exxxxxxx/index.html deleted file mode 100644 index b3cceec..0000000 --- a/exxxxxxx/index.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - callapp-lib示例 - - - -
点击唤起电流App个人页
- - - - - \ No newline at end of file diff --git a/package.json b/package.json index f56492c..7f81b14 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "callapp-lib", - "version": "2.1.8", + "version": "3.0.0", "description": "call native webview from webpage", "main": "dist/index.cjs.js", "module": "dist/index.esm.js", - "browser": "dist/index.iife.js", + "browser": "dist/index.umd.js", "types": "dist/type/index.d.ts", "directories": { "dist": "dist" diff --git a/rollup.config.js b/rollup.config.js index 64b81e7..de7bd89 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -19,7 +19,7 @@ export default { }, { file: pkg.browser, - format: 'iife', + format: 'umd', name: 'CallApp', }, ],