create-packer 1.45.9 → 1.45.11
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/package.json +3 -3
- package/template/web-app/react-rsbuild/package.json +6 -6
- package/template/web-app/react-vite/package.json +5 -5
- package/template/web-app/svelte/package.json +2 -2
- package/template/web-app/vue/package.json +9 -9
- package/template/web-app/vue-rsbuild/package.json +9 -9
- package/template/web-extension/entrypoints/content/index.tsx +2 -1
- package/template/web-extension/package.json +3 -3
- package/template/web-extension/shared/content/message.ts +40 -13
- package/template/web-extension/shared/popup/index.ts +0 -1
- package/template/web-extension/shared/popup/message.ts +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-packer",
|
|
3
|
-
"version": "1.45.
|
|
3
|
+
"version": "1.45.11",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": "https://github.com/kevily/create-packer",
|
|
6
6
|
"author": "1k <bug_zero@163.com>",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"clean:pkg": "pnpm -r exec rimraf node_modules",
|
|
54
54
|
"commit": "git add . && cz",
|
|
55
55
|
"push": "pnpm run commit && git push",
|
|
56
|
-
"up:rsbuild": "pnpm -r up @rsbuild/* -L",
|
|
57
|
-
"up:vite": "pnpm -r up vite @vitejs/* vite
|
|
56
|
+
"up:rsbuild": "pnpm -r up @rsbuild/* @rsdoctor/* -L",
|
|
57
|
+
"up:vite": "pnpm -r up vite @vitejs/* vite-* -L"
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"@commitlint/config-conventional": "17.6.1",
|
|
39
39
|
"@commitlint/cz-commitlint": "17.5.0",
|
|
40
40
|
"@eslint/js": "9.15.0",
|
|
41
|
-
"@rsbuild/core": "1.
|
|
42
|
-
"@rsbuild/plugin-eslint": "1.1.
|
|
43
|
-
"@rsbuild/plugin-react": "1.
|
|
44
|
-
"@rsbuild/plugin-svgr": "1.2.
|
|
45
|
-
"@rsbuild/plugin-type-check": "1.2.
|
|
46
|
-
"@rsdoctor/rspack-plugin": "
|
|
41
|
+
"@rsbuild/core": "1.5.2",
|
|
42
|
+
"@rsbuild/plugin-eslint": "1.1.2",
|
|
43
|
+
"@rsbuild/plugin-react": "1.4.0",
|
|
44
|
+
"@rsbuild/plugin-svgr": "1.2.2",
|
|
45
|
+
"@rsbuild/plugin-type-check": "1.2.4",
|
|
46
|
+
"@rsdoctor/rspack-plugin": "1.2.3",
|
|
47
47
|
"@types/node": "18.16.0",
|
|
48
48
|
"@types/qs": "6.9.7",
|
|
49
49
|
"@types/react": "18.3.3",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@types/react": "18.3.3",
|
|
45
45
|
"@types/react-dom": "18.3.0",
|
|
46
46
|
"@vanilla-extract/vite-plugin": "5.1.1",
|
|
47
|
-
"@vitejs/plugin-react": "
|
|
47
|
+
"@vitejs/plugin-react": "5.0.1",
|
|
48
48
|
"autoprefixer": "10.4.14",
|
|
49
49
|
"commitizen": "4.3.0",
|
|
50
50
|
"cssnano": "6.0.0",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"stylelint-config-standard": "36.0.1",
|
|
66
66
|
"typescript": "5.8.2",
|
|
67
67
|
"typescript-eslint": "8.15.0",
|
|
68
|
-
"vite": "
|
|
69
|
-
"vite-plugin-checker": "0.
|
|
70
|
-
"vite-plugin-mock-dev-server": "1.
|
|
71
|
-
"vite-plugin-svgr": "4.
|
|
68
|
+
"vite": "7.1.3",
|
|
69
|
+
"vite-plugin-checker": "0.10.2",
|
|
70
|
+
"vite-plugin-mock-dev-server": "1.9.3",
|
|
71
|
+
"vite-plugin-svgr": "4.5.0"
|
|
72
72
|
},
|
|
73
73
|
"config": {
|
|
74
74
|
"commitizen": {
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"axios": "1.7.9",
|
|
23
23
|
"es-toolkit": "1.39.8",
|
|
24
|
-
"pinia": "
|
|
24
|
+
"pinia": "3.0.3",
|
|
25
25
|
"tailwindcss": "4.1.4",
|
|
26
26
|
"type-fest": "4.33.0",
|
|
27
|
-
"vue": "3.5.
|
|
28
|
-
"vue-router": "4.5.
|
|
27
|
+
"vue": "3.5.20",
|
|
28
|
+
"vue-router": "4.5.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@commitlint/cli": "17.6.1",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@faker-js/faker": "8.4.1",
|
|
36
36
|
"@tailwindcss/vite": "4.1.4",
|
|
37
37
|
"@types/mockjs": "1.0.10",
|
|
38
|
-
"@vitejs/plugin-vue": "
|
|
39
|
-
"@vitejs/plugin-vue-jsx": "
|
|
38
|
+
"@vitejs/plugin-vue": "6.0.1",
|
|
39
|
+
"@vitejs/plugin-vue-jsx": "5.0.1",
|
|
40
40
|
"autoprefixer": "10.4.14",
|
|
41
41
|
"commitizen": "4.3.0",
|
|
42
42
|
"cssnano": "6.0.0",
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
"stylelint-config-standard-scss": "13.1.0",
|
|
58
58
|
"typescript": "5.8.2",
|
|
59
59
|
"typescript-eslint": "8.15.0",
|
|
60
|
-
"vite": "
|
|
61
|
-
"vite-plugin-checker": "0.
|
|
62
|
-
"vite-plugin-mock-dev-server": "1.
|
|
60
|
+
"vite": "7.1.3",
|
|
61
|
+
"vite-plugin-checker": "0.10.2",
|
|
62
|
+
"vite-plugin-mock-dev-server": "1.9.3",
|
|
63
63
|
"vite-svg-loader": "5.1.0",
|
|
64
|
-
"vue-tsc": "
|
|
64
|
+
"vue-tsc": "3.0.6"
|
|
65
65
|
},
|
|
66
66
|
"config": {
|
|
67
67
|
"commitizen": {
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"axios": "1.7.9",
|
|
24
24
|
"es-toolkit": "1.39.8",
|
|
25
|
-
"pinia": "
|
|
25
|
+
"pinia": "3.0.3",
|
|
26
26
|
"tailwindcss": "4.1.4",
|
|
27
27
|
"type-fest": "4.33.0",
|
|
28
|
-
"vue": "3.5.
|
|
29
|
-
"vue-router": "4.5.
|
|
28
|
+
"vue": "3.5.20",
|
|
29
|
+
"vue-router": "4.5.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@commitlint/cli": "17.6.1",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"@commitlint/cz-commitlint": "17.5.0",
|
|
35
35
|
"@eslint/js": "9.15.0",
|
|
36
36
|
"@faker-js/faker": "8.4.1",
|
|
37
|
-
"@rsbuild/core": "1.2
|
|
38
|
-
"@rsbuild/plugin-eslint": "1.1.
|
|
39
|
-
"@rsbuild/plugin-type-check": "1.2.
|
|
40
|
-
"@rsbuild/plugin-vue": "1.
|
|
41
|
-
"@rsdoctor/rspack-plugin": "
|
|
37
|
+
"@rsbuild/core": "1.5.2",
|
|
38
|
+
"@rsbuild/plugin-eslint": "1.1.2",
|
|
39
|
+
"@rsbuild/plugin-type-check": "1.2.4",
|
|
40
|
+
"@rsbuild/plugin-vue": "1.1.2",
|
|
41
|
+
"@rsdoctor/rspack-plugin": "1.2.3",
|
|
42
42
|
"@tailwindcss/postcss": "4.1.4",
|
|
43
43
|
"@types/mockjs": "1.0.10",
|
|
44
44
|
"autoprefixer": "10.4.14",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"stylelint-webpack-plugin": "5.0.0",
|
|
64
64
|
"typescript": "5.8.2",
|
|
65
65
|
"typescript-eslint": "8.15.0",
|
|
66
|
-
"vue-tsc": "
|
|
66
|
+
"vue-tsc": "3.0.6"
|
|
67
67
|
},
|
|
68
68
|
"config": {
|
|
69
69
|
"commitizen": {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { CONTENT_MATCHES } from '@/shared/content'
|
|
1
|
+
import { CONTENT_MATCHES, contentMessage } from '@/shared/content'
|
|
2
2
|
import { Common } from './modules'
|
|
3
3
|
|
|
4
4
|
export default defineContentScript({
|
|
5
5
|
runAt: 'document_idle',
|
|
6
6
|
matches: CONTENT_MATCHES,
|
|
7
7
|
main: () => {
|
|
8
|
+
contentMessage.onMessage('CONNECT', () => true)
|
|
8
9
|
Common.insert()
|
|
9
10
|
}
|
|
10
11
|
})
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@types/react": "18.3.3",
|
|
50
50
|
"@types/react-dom": "18.3.0",
|
|
51
51
|
"@vanilla-extract/vite-plugin": "5.1.1",
|
|
52
|
-
"@vitejs/plugin-react": "
|
|
52
|
+
"@vitejs/plugin-react": "5.0.1",
|
|
53
53
|
"autoprefixer": "10.4.14",
|
|
54
54
|
"commitizen": "4.3.0",
|
|
55
55
|
"cssnano": "6.0.0",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"stylelint-config-standard": "36.0.1",
|
|
74
74
|
"typescript": "5.8.2",
|
|
75
75
|
"typescript-eslint": "8.28.0",
|
|
76
|
-
"vite": "
|
|
77
|
-
"vite-plugin-svgr": "4.
|
|
76
|
+
"vite": "7.1.3",
|
|
77
|
+
"vite-plugin-svgr": "4.5.0",
|
|
78
78
|
"wxt": "0.20.5"
|
|
79
79
|
},
|
|
80
80
|
"config": {
|
|
@@ -2,28 +2,55 @@ import { defineExtensionMessaging } from '@webext-core/messaging'
|
|
|
2
2
|
import { CONTENT_MATCHES } from './constant'
|
|
3
3
|
|
|
4
4
|
export type messageType = {
|
|
5
|
-
|
|
5
|
+
CONNECT: () => true
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export const { sendMessage, onMessage } = defineExtensionMessaging<messageType>()
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
|
|
10
|
+
export async function connectableTabs(tabQueryInfo?: chrome.tabs.QueryInfo) {
|
|
11
|
+
const tabs = await chrome.tabs.query({
|
|
12
|
+
...tabQueryInfo,
|
|
13
|
+
url: tabQueryInfo?.url || CONTENT_MATCHES
|
|
14
|
+
})
|
|
15
|
+
const result = await Promise.allSettled(
|
|
15
16
|
tabs.map(tab => {
|
|
16
|
-
return sendMessage(
|
|
17
|
+
return sendMessage('CONNECT', void 0, { tabId: tab.id! }).then(res => ({
|
|
18
|
+
data: res,
|
|
19
|
+
tab
|
|
20
|
+
}))
|
|
17
21
|
})
|
|
18
22
|
)
|
|
19
|
-
return result
|
|
23
|
+
return result?.filter(o => o.status === 'fulfilled').map(o => o.value.tab)
|
|
20
24
|
}
|
|
21
25
|
|
|
22
|
-
export async function
|
|
26
|
+
export async function sendToContent<A extends keyof messageType>(
|
|
23
27
|
action: A,
|
|
24
|
-
|
|
28
|
+
options: {
|
|
29
|
+
data?: Parameters<messageType[A]>[0]
|
|
30
|
+
url?: string[]
|
|
31
|
+
target: 'first' | 'last' | 'all' | 'current'
|
|
32
|
+
}
|
|
25
33
|
) {
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
let tabs = await connectableTabs({ url: options?.url })
|
|
35
|
+
switch (options.target) {
|
|
36
|
+
case 'current':
|
|
37
|
+
tabs = tabs.filter(tab => tab.active)
|
|
38
|
+
break
|
|
39
|
+
case 'first':
|
|
40
|
+
tabs = tabs.slice(0, 1)
|
|
41
|
+
break
|
|
42
|
+
case 'last':
|
|
43
|
+
tabs = tabs.slice(-1)
|
|
44
|
+
break
|
|
45
|
+
default:
|
|
46
|
+
break
|
|
47
|
+
}
|
|
48
|
+
const result = await Promise.all(
|
|
49
|
+
tabs.map(tab => {
|
|
50
|
+
return sendMessage(action, options.data as never, { tabId: tab.id! }).catch(
|
|
51
|
+
() => void 0
|
|
52
|
+
)
|
|
53
|
+
})
|
|
54
|
+
)
|
|
28
55
|
return result
|
|
29
56
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * as popupMessage from './message'
|