@tomjs/create-app 5.4.0 → 5.6.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.
- package/README.md +2 -0
- package/README.zh_CN.md +2 -0
- package/dist/index.mjs +1 -1
- package/package.json +13 -13
- package/templates/config/base/package.json +2 -2
- package/templates/config/package.json +27 -27
- package/templates/config/react/pnpm-workspace.yaml +5 -0
- package/templates/config/vscode/_.gitignore +4 -0
- package/templates/config/vue/_.gitignore +63 -0
- package/templates/config/vue/package.json +1 -1
- package/templates/config/vue/pnpm-workspace.yaml +4 -0
- package/templates/config/vue/tsconfig.app.json +0 -1
- package/templates/config/vue/uno.config.ts +2 -2
- package/templates/crx-react/manifest.config.ts +28 -0
- package/templates/crx-react/package.json +14 -0
- package/templates/crx-react/public/logo.png +0 -0
- package/templates/crx-react/src/assets/crx.svg +4 -0
- package/templates/crx-react/src/assets/react.svg +1 -0
- package/templates/crx-react/src/assets/vite.svg +1 -0
- package/templates/crx-react/src/components/HelloWorld.tsx +35 -0
- package/templates/crx-react/src/content/main.tsx +14 -0
- package/templates/crx-react/src/content/views/App.css +56 -0
- package/templates/crx-react/src/content/views/App.tsx +23 -0
- package/templates/crx-react/src/popup/App.css +49 -0
- package/templates/crx-react/src/popup/App.tsx +22 -0
- package/templates/crx-react/src/popup/index.css +84 -0
- package/templates/crx-react/src/popup/index.html +10 -0
- package/templates/crx-react/src/popup/main.tsx +10 -0
- package/templates/crx-react/src/sidepanel/App.css +49 -0
- package/templates/crx-react/src/sidepanel/App.tsx +22 -0
- package/templates/crx-react/src/sidepanel/index.css +83 -0
- package/templates/crx-react/src/sidepanel/index.html +10 -0
- package/templates/crx-react/src/sidepanel/main.tsx +10 -0
- package/templates/crx-react/vite.config.ts +28 -0
- package/templates/crx-vue/README.md +1 -0
- package/templates/crx-vue/manifest.config.ts +28 -0
- package/templates/crx-vue/package.json +14 -0
- package/templates/crx-vue/pnpm-workspace.yaml +4 -0
- package/templates/crx-vue/public/logo.png +0 -0
- package/templates/crx-vue/src/assets/crx.svg +4 -0
- package/templates/crx-vue/src/assets/vite.svg +1 -0
- package/templates/crx-vue/src/assets/vue.svg +1 -0
- package/templates/crx-vue/src/components/HelloWorld.vue +38 -0
- package/templates/crx-vue/src/content/main.ts +17 -0
- package/templates/crx-vue/src/content/views/App.vue +76 -0
- package/templates/crx-vue/src/env.d.ts +3 -0
- package/templates/crx-vue/src/popup/App.vue +39 -0
- package/templates/crx-vue/src/popup/index.html +10 -0
- package/templates/crx-vue/src/popup/main.ts +5 -0
- package/templates/crx-vue/src/popup/style.css +84 -0
- package/templates/crx-vue/src/sidepanel/App.vue +39 -0
- package/templates/crx-vue/src/sidepanel/index.html +10 -0
- package/templates/crx-vue/src/sidepanel/main.ts +5 -0
- package/templates/crx-vue/src/sidepanel/style.css +83 -0
- package/templates/crx-vue/vite.config.ts +38 -0
- package/templates/electron-vue/package.json +1 -1
- package/templates/electron-vue/src/components/HelloWorld.vue +0 -1
- package/templates/electron-vue/src/main.ts +2 -2
- package/templates/electron-vue/tsconfig.app.json +5 -8
- package/templates/electron-vue/tsconfig.node.json +1 -1
- package/templates/electron-vue/vite.config.ts +5 -2
- package/templates/hbuilderx-vue/src/components/HelloWorld.vue +0 -2
- package/templates/hbuilderx-vue/src/main.ts +3 -2
- package/templates/hbuilderx-vue/tsconfig.app.json +0 -1
- package/templates/hbuilderx-vue/vite.config.ts +5 -2
- package/templates/vscode-vue/src/App.vue +0 -1
- package/templates/vscode-vue/src/main.ts +3 -1
- package/templates/vscode-vue/src/style.scss +0 -0
- package/templates/vscode-vue/vite.config.ts +5 -2
- package/templates/web-vue/README.md +1 -1
- package/templates/web-vue/src/components/HelloWorld.vue +0 -2
- package/templates/web-vue/src/main.ts +2 -1
- package/templates/web-vue/vite.config.ts +5 -2
- package/templates/electron-vue/src/vite-env.d.ts +0 -1
- /package/templates/config/vue/{env.d.ts → src/env.d.ts} +0 -0
- /package/templates/electron-vue/src/{style.css → style.scss} +0 -0
- /package/templates/hbuilderx-vue/src/{style.css → style.scss} +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import HelloWorld from '@/components/HelloWorld.vue';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<div>
|
|
7
|
+
<a href="https://vite.dev" target="_blank">
|
|
8
|
+
<img src="@/assets/vite.svg" class="logo" alt="Vite logo">
|
|
9
|
+
</a>
|
|
10
|
+
<a href="https://vuejs.org/" target="_blank">
|
|
11
|
+
<img src="@/assets/vue.svg" class="logo vue" alt="Vue logo">
|
|
12
|
+
</a>
|
|
13
|
+
<a href="https://crxjs.dev/vite-plugin" target="_blank">
|
|
14
|
+
<img src="@/assets/crx.svg" class="logo crx" alt="crx logo">
|
|
15
|
+
</a>
|
|
16
|
+
</div>
|
|
17
|
+
<HelloWorld msg="Vite + Vue + CRXJS" />
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<style scoped>
|
|
21
|
+
.logo {
|
|
22
|
+
height: 6em;
|
|
23
|
+
padding: 1.5em;
|
|
24
|
+
transition: filter 300ms;
|
|
25
|
+
will-change: filter;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.logo:hover {
|
|
29
|
+
filter: drop-shadow(0 0 2em #646cffaa);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.logo.vue:hover {
|
|
33
|
+
filter: drop-shadow(0 0 2em #42b883aa);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.logo.crx:hover {
|
|
37
|
+
filter: drop-shadow(0 0 2em #f2bae4aa);
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
3
|
+
font-weight: 400;
|
|
4
|
+
|
|
5
|
+
font-synthesis: none;
|
|
6
|
+
line-height: 1.5;
|
|
7
|
+
color: rgba(255, 255, 255, 0.87);
|
|
8
|
+
|
|
9
|
+
color-scheme: light dark;
|
|
10
|
+
background-color: #242424;
|
|
11
|
+
text-rendering: optimizeLegibility;
|
|
12
|
+
-webkit-font-smoothing: antialiased;
|
|
13
|
+
-moz-osx-font-smoothing: grayscale;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
a {
|
|
17
|
+
font-weight: 500;
|
|
18
|
+
color: #646cff;
|
|
19
|
+
text-decoration: inherit;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
a:hover {
|
|
23
|
+
color: #535bf2;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
body {
|
|
27
|
+
display: flex;
|
|
28
|
+
place-items: center;
|
|
29
|
+
min-height: 100vh;
|
|
30
|
+
margin: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
h1 {
|
|
34
|
+
font-size: 3.2em;
|
|
35
|
+
line-height: 1.1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
button {
|
|
39
|
+
padding: 0.6em 1.2em;
|
|
40
|
+
font-family: inherit;
|
|
41
|
+
font-size: 1em;
|
|
42
|
+
font-weight: 500;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
background-color: #1a1a1a;
|
|
45
|
+
border: 1px solid transparent;
|
|
46
|
+
border-radius: 8px;
|
|
47
|
+
transition: border-color 0.25s;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
button:hover {
|
|
51
|
+
border-color: #646cff;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
button:focus,
|
|
55
|
+
button:focus-visible {
|
|
56
|
+
outline: 4px auto -webkit-focus-ring-color;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.card {
|
|
60
|
+
padding: 2em;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
#app {
|
|
64
|
+
max-width: 1280px;
|
|
65
|
+
padding: 2rem;
|
|
66
|
+
margin: 0 auto;
|
|
67
|
+
text-align: center;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@media (prefers-color-scheme: light) {
|
|
71
|
+
:root {
|
|
72
|
+
color: #213547;
|
|
73
|
+
background-color: #ffffff;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
a:hover {
|
|
77
|
+
color: #747bff;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
button {
|
|
81
|
+
background-color: #f9f9f9;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { fileURLToPath, URL } from 'node:url';
|
|
2
|
+
import { crx } from '@crxjs/vite-plugin';
|
|
3
|
+
import vue from '@vitejs/plugin-vue';
|
|
4
|
+
import UnoCSS from 'unocss/vite';
|
|
5
|
+
import AutoImport from 'unplugin-auto-import/vite';
|
|
6
|
+
import Components from 'unplugin-vue-components/vite';
|
|
7
|
+
import { defineConfig } from 'vite';
|
|
8
|
+
import devtools from 'vite-plugin-vue-devtools';
|
|
9
|
+
import manifest from './manifest.config.ts';
|
|
10
|
+
|
|
11
|
+
// https://vite.dev/config/
|
|
12
|
+
export default defineConfig({
|
|
13
|
+
resolve: {
|
|
14
|
+
alias: {
|
|
15
|
+
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
server: {
|
|
19
|
+
cors: {
|
|
20
|
+
origin: [
|
|
21
|
+
/chrome-extension:\/\//,
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
plugins: [
|
|
26
|
+
vue(),
|
|
27
|
+
AutoImport({
|
|
28
|
+
dts: './src/auto-imports.d.ts',
|
|
29
|
+
imports: ['vue', 'vue-router', '@vueuse/core'],
|
|
30
|
+
}),
|
|
31
|
+
Components({
|
|
32
|
+
dts: './src/components.d.ts',
|
|
33
|
+
}),
|
|
34
|
+
crx({ manifest }),
|
|
35
|
+
UnoCSS(),
|
|
36
|
+
devtools(),
|
|
37
|
+
],
|
|
38
|
+
});
|
|
@@ -2,15 +2,12 @@
|
|
|
2
2
|
"extends": "@tomjs/tsconfig/vue.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
]
|
|
5
|
+
"paths": {
|
|
6
|
+
"@/*": ["./src/*"]
|
|
7
|
+
}
|
|
9
8
|
},
|
|
10
9
|
"include": [
|
|
11
|
-
"src
|
|
12
|
-
"src/**/*.
|
|
13
|
-
"src/**/*.vue",
|
|
14
|
-
"src/**/*.d.ts"
|
|
10
|
+
"src/**/*",
|
|
11
|
+
"src/**/*.vue"
|
|
15
12
|
]
|
|
16
13
|
}
|
|
@@ -17,9 +17,12 @@ export default defineConfig({
|
|
|
17
17
|
plugins: [
|
|
18
18
|
vue(),
|
|
19
19
|
AutoImport({
|
|
20
|
-
|
|
20
|
+
dts: './src/auto-imports.d.ts',
|
|
21
|
+
imports: ['vue', 'vue-router', '@vueuse/core'],
|
|
22
|
+
}),
|
|
23
|
+
Components({
|
|
24
|
+
dts: './src/components.d.ts',
|
|
21
25
|
}),
|
|
22
|
-
Components(),
|
|
23
26
|
UnoCSS(),
|
|
24
27
|
renderer(),
|
|
25
28
|
electron({ builder: true }),
|
|
@@ -21,9 +21,12 @@ export default defineConfig({
|
|
|
21
21
|
plugins: [
|
|
22
22
|
vue(),
|
|
23
23
|
AutoImport({
|
|
24
|
-
|
|
24
|
+
dts: './src/auto-imports.d.ts',
|
|
25
|
+
imports: ['vue', '@vueuse/core'],
|
|
26
|
+
}),
|
|
27
|
+
Components({
|
|
28
|
+
dts: './src/components.d.ts',
|
|
25
29
|
}),
|
|
26
|
-
Components(),
|
|
27
30
|
hbuilderx(),
|
|
28
31
|
UnoCSS(),
|
|
29
32
|
devtools(),
|
|
File without changes
|
|
@@ -28,9 +28,12 @@ export default defineConfig(() => {
|
|
|
28
28
|
},
|
|
29
29
|
}),
|
|
30
30
|
AutoImport({
|
|
31
|
-
|
|
31
|
+
dts: './src/auto-imports.d.ts',
|
|
32
|
+
imports: ['vue', '@vueuse/core'],
|
|
33
|
+
}),
|
|
34
|
+
Components({
|
|
35
|
+
dts: './src/components.d.ts',
|
|
32
36
|
}),
|
|
33
|
-
Components(),
|
|
34
37
|
UnoCSS(),
|
|
35
38
|
vscode(),
|
|
36
39
|
devtools(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
# vue example
|
|
1
|
+
# crx vue example
|
|
@@ -16,9 +16,12 @@ export default defineConfig({
|
|
|
16
16
|
plugins: [
|
|
17
17
|
vue(),
|
|
18
18
|
AutoImport({
|
|
19
|
-
|
|
19
|
+
dts: './src/auto-imports.d.ts',
|
|
20
|
+
imports: ['vue', 'vue-router', '@vueuse/core'],
|
|
21
|
+
}),
|
|
22
|
+
Components({
|
|
23
|
+
dts: './src/components.d.ts',
|
|
20
24
|
}),
|
|
21
|
-
Components(),
|
|
22
25
|
UnoCSS(),
|
|
23
26
|
devtools(),
|
|
24
27
|
],
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
File without changes
|
|
File without changes
|
|
File without changes
|