create-jsview 2.0.1197-next-vue.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/common.mjs +223 -0
  2. package/index.mjs +25 -0
  3. package/package.json +35 -0
  4. package/project-creator.mjs +54 -0
  5. package/project-upgrader.mjs +193 -0
  6. package/template-react-webpack/README.md +16 -0
  7. package/template-react-webpack/_gitignore +23 -0
  8. package/template-react-webpack/package-lock-json +27673 -0
  9. package/template-react-webpack/package.json +32 -0
  10. package/template-react-webpack/public/index.html +12 -0
  11. package/template-react-webpack/src/App.css +38 -0
  12. package/template-react-webpack/src/App.js +18 -0
  13. package/template-react-webpack/src/appConfig/HOW_TO_CONFIG.md +20 -0
  14. package/template-react-webpack/src/appConfig/app.config.mjs +7 -0
  15. package/template-react-webpack/src/appConfig/app_sign_private_key_sample.crt +28 -0
  16. package/template-react-webpack/src/appConfig/app_sign_public_key_sample.pem +9 -0
  17. package/template-react-webpack/src/appConfig/jsview.config.mjs +41 -0
  18. package/template-react-webpack/src/logo.png +0 -0
  19. package/template-react-webpack/src/main.tsx +19 -0
  20. package/template-react-webpack/tsconfig.json +9 -0
  21. package/template-vue-vite/.vscode/extensions.json +3 -0
  22. package/template-vue-vite/README.md +16 -0
  23. package/template-vue-vite/_gitignore +24 -0
  24. package/template-vue-vite/index.html +13 -0
  25. package/template-vue-vite/package-lock-json +1978 -0
  26. package/template-vue-vite/package.json +33 -0
  27. package/template-vue-vite/src/App.vue +25 -0
  28. package/template-vue-vite/src/appConfig/HOW_TO_CONFIG.md +15 -0
  29. package/template-vue-vite/src/appConfig/app.config.mjs +16 -0
  30. package/template-vue-vite/src/appConfig/jsview.config.mjs +43 -0
  31. package/template-vue-vite/src/appConfig/permission.js +1 -0
  32. package/template-vue-vite/src/assets/logo.png +0 -0
  33. package/template-vue-vite/src/components/HelloWorld.vue +19 -0
  34. package/template-vue-vite/src/env.d.ts +8 -0
  35. package/template-vue-vite/src/main.tsx +21 -0
  36. package/template-vue-vite/tsconfig.json +27 -0
  37. package/template-vue-vite/tsconfig.node.json +8 -0
  38. package/template-vue-vite/vite.config.ts +9 -0
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "jsview-vue-test",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "android": "node node_modules/@shijiu/jsview/tools/jsview-run-android.mjs --framework=vue",
8
+ "build": "vue-tsc && vite build && node node_modules/@shijiu/jsview/tools/jsview-post-build.mjs --framework=vue",
9
+ "dev": "vite",
10
+ "postinstall": "node node_modules/@shijiu/jsview/tools/jsview-post-install.mjs --framework=vue",
11
+ "preview": "vite preview",
12
+ "start": "vite"
13
+ },
14
+ "dependencies": {
15
+ "@shijiu/jsview": "2.0.1197-next-vue.0",
16
+ "@shijiu/jsview-vue": "2.0.1197-next-vue.0",
17
+ "vue": "3.2.45",
18
+ "vue-router": "4.1.6"
19
+ },
20
+ "devDependencies": {
21
+ "@vitejs/plugin-vue": "4.0.0",
22
+ "typescript": "4.9.3",
23
+ "vite": "4.0.0",
24
+ "vue-tsc": "1.0.11"
25
+ },
26
+ "browserslist": [
27
+ "chrome 102",
28
+ "not dead"
29
+ ],
30
+ "engines": {
31
+ "node": ">=16.0.0"
32
+ }
33
+ }
@@ -0,0 +1,25 @@
1
+ <template>
2
+ <div>
3
+ <img src="./assets/logo.png" class="logo-size">
4
+ <HelloWorld msg="Hello JsView-Vue + Vite App" :style="{top: 50, width:220}"/>
5
+ </div>
6
+ </template>
7
+
8
+ <script setup>
9
+ import { onMounted } from "vue"
10
+ import { jJsvRuntimeBridge } from "jsview";
11
+ import HelloWorld from './components/HelloWorld.vue';
12
+
13
+ onMounted(()=>{
14
+ /* apk到收到此调用后才会结束启动过程,去掉启动图(否则会显示加载超时的界面) */
15
+ jJsvRuntimeBridge.notifyPageLoaded();
16
+ });
17
+
18
+ </script>
19
+
20
+ <style scoped>
21
+ .logo-size {
22
+ width: 200;
23
+ height: 200;
24
+ }
25
+ </style>
@@ -0,0 +1,15 @@
1
+ app_data文件夹用来记录APP的设定信息,包括APP的全球唯一标识,签名信息
2
+
3
+ 1. 全球唯一标识AppName设定方法:
4
+ 修改app.config.js文件中的AppName信息,一般命名方法为 domain/子应用名
5
+
6
+ 2. 签名信息,使用RSA签名,设定方法:
7
+ 执行:node ./node_modules/@shijiu/jsview/tools/jsview-generate-keypair.mjs
8
+
9
+ 将生成公钥文件app_sign_public_key.pem和私钥文件app_sign_private_key.crt。
10
+
11
+ JsView签名原理说明:
12
+ 在进行js build时,会将 main.jsv.xxxx.js (包含AppName具体值)文件的md5值用私钥进行编码,编码出的内容和公钥一起写入到该文件的文件头中,JsView加载后用公钥反编码出该md5值,和文件的md5进行比对,若md5一致则认为此公钥合法,然后此公钥会和AppName进行映射,作为设定快捷访问地址等权限控制的调用作为参考,以防止其他APP对本APP(以AppName为查询键)的私有内容进行非法访问和破坏。
13
+
14
+ 注意: 私钥(app_sign_private_key.crt)不要被泄漏,私钥若泄漏,则其他APP可以伪装AppName,查询本APP的私有内容,覆盖本APP设定的快捷访问地址。
15
+
@@ -0,0 +1,16 @@
1
+ export default {
2
+ // uuid, 和其他小程序区分的标识, 格式要求为 公司domain/产品,例如 "xxxx.domain.cn/XXXX", domain中不要有字符/
3
+ AppName: "",
4
+
5
+ // 显示在桌面系统上的名称,可以有特殊字符和中文,要求UTF8格式
6
+ AppTitle: "",
7
+
8
+ // 应用版本信息,只是用于显示,引擎不会拿其作为版本判断依据
9
+ AppVersion: "1.00",
10
+
11
+ // 上线前请更换, 此为小程序之家APK上线后的图标规范
12
+ AppIcon: "https://oss.image.qcast.cn/JsViewVideo/ImageTestSample/JsvMiniAppIcon300x160.png",
13
+
14
+ // 上线前请更换, 此为小程序之家APK上线后的图标规范
15
+ AppRectIcon: "https://oss.image.qcast.cn/JsViewVideo/ImageTestSample/JsvMiniAppIcon256x256.png",
16
+ }
@@ -0,0 +1,43 @@
1
+ export default {
2
+ jsviewConfig: {
3
+ // (可选配置)remote loader
4
+ remoteLoader: null,
5
+
6
+ // (可选配置)localStorage支持
7
+ // presetKeys为预置key,可以直接使用localStorage.xxx的形式,避免undefined错误
8
+ localStorage: {
9
+ domain: null, // 默认自动使用app.config.mjs的AppName作为domain, 可以设置为其他值
10
+ presetKeys: [
11
+ 'value1',
12
+ 'value3'
13
+ ]
14
+ },
15
+
16
+ cookies: {
17
+ domain: '' // 当非null非空时,激活cookie功能,使ajax请求时自动带上cookies,并且document.cookie的get/set可用
18
+ },
19
+
20
+ // (可选配置)填写main.js或者bundle.js相对于index.html的相对位置,
21
+ // 用于image/import.then的相对寻址, vue3默认值是/js/
22
+ jsSubPath: '/js/'
23
+ },
24
+
25
+ vendorConfig: {
26
+ // (可选配置)设置屏幕坐标映射值,screenWidth为屏幕画布定义的宽度,displayScale为清晰度,
27
+ // 默认值是画布宽度1280px, 清晰度为1.0
28
+ designedMap: {
29
+ screenWidth: 1280,
30
+ displayScale: 1.5
31
+ },
32
+
33
+ // (可选配置)按键接受的扩展,例如将静音按键(JAVA键值为164)映射为JS键值20001,
34
+ // PS:注意'164'的引号
35
+ bindKeys: {
36
+ keys: {
37
+ 164: 20001
38
+ },
39
+ syncKeys: {
40
+ }
41
+ }
42
+ }
43
+ }
@@ -0,0 +1 @@
1
+ export const PERMISSION = {}
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <div class="msg">{{ msg }}</div>
3
+ </template>
4
+
5
+ <script lang="ts">
6
+ export default {
7
+ props: {
8
+ msg: String
9
+ }
10
+ }
11
+ </script>
12
+
13
+ <!-- Add "scoped" attribute to limit CSS to this component only -->
14
+ <style scoped>
15
+ .msg {
16
+ font-size: 16px;
17
+ color: #00FFFF;
18
+ }
19
+ </style>
@@ -0,0 +1,8 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ declare module '*.vue' {
4
+ import type { DefineComponent } from 'vue'
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
6
+ const component: DefineComponent<{}, {}, any>
7
+ export default component
8
+ }
@@ -0,0 +1,21 @@
1
+ import { createApp } from 'vue'
2
+ import { jsvCreateFocusManager } from 'jsview'
3
+ import App from './App.vue'
4
+
5
+ const app = createApp(App)
6
+
7
+ /* 注册 App Plugin。如果项目中未使用,可以忽略或删除 */
8
+
9
+ // 注册vue-router插件, 请自行修改到正确的router
10
+ // 注册vue-router插件, 如果没有挂在App中,请自行修改到正确的router
11
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
+ if ((App as any).Router) app.use((App as any).Router)
13
+ // 注册JsView定制的焦点控制插件
14
+ app.use(jsvCreateFocusManager(), '#app')
15
+
16
+ app.mount('#app')
17
+
18
+ /* 备注: */
19
+ // 1. App.vue是一个最简的 Vue3 样例(参考`npm init vite`),可在此基础上进行二次开发。
20
+ // 2. 参考 http://jsview-dev.shijiutv.com/tour/1.js-develop/1.1.basic-js-tour.html
21
+ // 的'示例代码以及其源代码' 栏目进行samples代码安装和使用
@@ -0,0 +1,27 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "esnext",
4
+ "useDefineForClassFields": true,
5
+ "module": "esnext",
6
+ "moduleResolution": "node",
7
+ "strict": true,
8
+ "jsx": "preserve",
9
+ "resolveJsonModule": true,
10
+ "isolatedModules": true,
11
+ "esModuleInterop": true,
12
+ "lib": ["esnext", "dom"],
13
+ "skipLibCheck": true,
14
+ "noEmit": true,
15
+ "allowJs": true,
16
+ "experimentalDecorators": true,
17
+ "paths": {
18
+ "jsview": [ "./node_modules/@shijiu/jsview-vue" ],
19
+ "jsview-vue-samples/*": [ "./node_modules/@shijiu/jsview-vue-samples/*" ]
20
+ }
21
+ },
22
+ "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue",
23
+ "node_modules/@shijiu/jsview-vue/**/*.vue",
24
+ "node_modules/@shijiu/jsview-vue-samples/**/*.vue",
25
+ ],
26
+ "references": [{ "path": "./tsconfig.node.json" }]
27
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "module": "esnext",
5
+ "moduleResolution": "node"
6
+ },
7
+ "include": ["vite.config.ts"]
8
+ }
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from 'vite'
2
+ import vue from '@vitejs/plugin-vue'
3
+
4
+ // https://vitejs.dev/config/
5
+ export default defineConfig({
6
+ plugins: [
7
+ vue()
8
+ ]
9
+ })