mirror of https://github.com/msgbyte/tailchat
refactor: init plugin and inject script
parent
65d1e916f8
commit
e92d921164
@ -0,0 +1,9 @@
|
||||
{
|
||||
"label": "ReactNative支持",
|
||||
"name": "com.msgbyte.env.rn",
|
||||
"url": "/plugins/com.msgbyte.env.rn/index.js",
|
||||
"version": "0.0.0",
|
||||
"author": "moonrailgun",
|
||||
"description": "在Tailchat添加对ReactNative环境的支持",
|
||||
"requireRestart": true
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "@plugins/com.msgbyte.env.rn",
|
||||
"main": "src/index.tsx",
|
||||
"version": "0.0.0",
|
||||
"description": "在Tailchat添加对ReactNative环境的支持",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"sync:declaration": "tailchat declaration github"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@types/styled-components": "^5.1.26",
|
||||
"react": "18.2.0",
|
||||
"styled-components": "^5.3.6"
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
const PLUGIN_NAME = 'ReactNative支持';
|
||||
|
||||
console.log(`Plugin ${PLUGIN_NAME} is loaded`);
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"esModuleInterop": true,
|
||||
"jsx": "react",
|
||||
"importsNotUsedAsValues": "error"
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
declare module '@capital/common';
|
||||
declare module '@capital/component';
|
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* 生成注入到Webview中的js代码
|
||||
*/
|
||||
export function generateInjectScript() {
|
||||
// console.log(require('../../../dist/plugins/com.msgbyte.env.rn/index.js'));
|
||||
|
||||
return `alert(JSON.stringify(window.tailchat))`;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue