create-packer 1.37.2 → 1.38.2
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 -2
- package/template/cli/.prettierignore +6 -0
- package/template/cli/.prettierrc +18 -0
- package/template/cli/bin/createTemp.d.ts +1 -0
- package/template/cli/bin/createTemp.js +54 -0
- package/template/cli/bin/index.d.ts +2 -0
- package/template/cli/bin/index.js +4 -0
- package/template/cli/bin/utils/index.d.ts +10 -0
- package/template/cli/bin/utils/index.js +44 -0
- package/template/cli/package.json +53 -47
- package/template/docusaurus/.prettierignore +2 -0
- package/template/docusaurus/src/components/HomepageFeatures/index.tsx +70 -70
- package/template/docusaurus/src/components/HomepageFeatures/styles.module.css +11 -11
- package/template/docusaurus/src/css/custom.css +30 -30
- package/template/docusaurus/src/pages/index.module.css +23 -23
- package/template/docusaurus/src/pages/index.tsx +40 -40
- package/template/lib/workspace/.prettierignore +6 -0
- package/template/lib/workspace/.prettierrc +18 -0
- package/template/lib/workspace/package.json +73 -72
- package/template/lib/workspace/packages/react/package.json +41 -40
- package/template/lib/workspace/packages/ts/package.json +29 -28
- package/template/nest/package.json +84 -84
- package/template/nest/src/app.controller.spec.ts +22 -22
- package/template/nest/src/app.controller.ts +12 -12
- package/template/nest/src/app.module.ts +10 -10
- package/template/nest/src/app.service.ts +8 -8
- package/template/nest/src/main.ts +10 -10
- package/template/nest/src/utils/transform.interceptor.ts +26 -26
- package/template/nest/test/app.e2e-spec.ts +24 -24
- package/template/web-app/next/app/globals.css +22 -22
- package/template/web-app/next/app/layout.tsx +18 -18
- package/template/web-app/next/app/page.tsx +113 -113
- package/template/web-app/next/package.json +47 -47
- package/template/web-app/react-rsbuild/.prettierignore +6 -0
- package/template/web-app/react-rsbuild/.prettierrc +18 -0
- package/template/web-app/react-rsbuild/.vscode/extensions.json +8 -8
- package/template/web-app/react-rsbuild/.vscode/settings.json +4 -18
- package/template/web-app/react-rsbuild/domain/app/app.model.ts +7 -7
- package/template/web-app/react-rsbuild/domain/app/app.styled.ts +3 -3
- package/template/web-app/react-rsbuild/domain/app/components/app-context.tsx +17 -17
- package/template/web-app/react-rsbuild/domain/app/components/app.tsx +24 -24
- package/template/web-app/react-rsbuild/domain/app/components/index.ts +1 -1
- package/template/web-app/react-rsbuild/domain/app/index.ts +2 -2
- package/template/web-app/react-rsbuild/domain/router/home/ids.ts +3 -3
- package/template/web-app/react-rsbuild/domain/router/home/index.ts +2 -2
- package/template/web-app/react-rsbuild/domain/router/home/routes.tsx +13 -13
- package/template/web-app/react-rsbuild/domain/router/ids.ts +6 -6
- package/template/web-app/react-rsbuild/domain/router/index.ts +3 -3
- package/template/web-app/react-rsbuild/domain/router/router.tsx +28 -28
- package/template/web-app/react-rsbuild/domain/router/router.types.ts +3 -3
- package/template/web-app/react-rsbuild/env.d.ts +28 -28
- package/template/web-app/react-rsbuild/main.tsx +4 -4
- package/template/web-app/react-rsbuild/package.json +10 -11
- package/template/web-app/react-rsbuild/pages/home/home.styled.ts +7 -7
- package/template/web-app/react-rsbuild/pages/home/home.tsx +10 -10
- package/template/web-app/react-rsbuild/pages/home/index.ts +1 -1
- package/template/web-app/react-rsbuild/pages/index.tsx +18 -18
- package/template/web-app/react-rsbuild/pages/not-found.tsx +3 -3
- package/template/web-app/react-rsbuild/rsbuild.config.ts +78 -85
- package/template/web-app/react-rsbuild/scripts/createChunks.ts +26 -26
- package/template/web-app/react-rsbuild/scripts/index.ts +1 -1
- package/template/web-app/react-rsbuild/shared/hooks/defineRouter/defineRouter.types.ts +33 -33
- package/template/web-app/react-rsbuild/shared/hooks/defineRouter/index.ts +2 -2
- package/template/web-app/react-rsbuild/shared/hooks/index.ts +6 -6
- package/template/web-app/react-rsbuild/shared/hooks/useInterval.ts +26 -26
- package/template/web-app/react-rsbuild/shared/hooks/useLoadingAction.ts +27 -27
- package/template/web-app/react-rsbuild/shared/hooks/useLowPriorityState.ts +26 -26
- package/template/web-app/react-rsbuild/shared/hooks/useSyncState.ts +15 -15
- package/template/web-app/react-rsbuild/shared/hooks/useVisible.ts +27 -27
- package/template/web-app/react-rsbuild/shared/service/api.ts +1 -1
- package/template/web-app/react-rsbuild/shared/service/home.ts +8 -8
- package/template/web-app/react-rsbuild/shared/service/index.ts +3 -3
- package/template/web-app/react-rsbuild/shared/service/request.ts +5 -5
- package/template/web-app/react-rsbuild/shared/theme/index.ts +1 -1
- package/template/web-app/react-rsbuild/shared/theme/theme.styled.ts +56 -56
- package/template/web-app/react-rsbuild/shared/tools/componentInstance.tsx +80 -80
- package/template/web-app/react-rsbuild/shared/tools/index.ts +1 -1
- package/template/web-app/react-rsbuild/shared/types/index.ts +1 -1
- package/template/web-app/react-rsbuild/shared/types/utils.ts +2 -2
- package/template/web-app/react-rsbuild/tsconfig.json +32 -44
- package/template/web-app/react-rsbuild/tsconfig.node.json +10 -14
- package/template/web-app/react-vite/.prettierignore +6 -0
- package/template/web-app/react-vite/.prettierrc +18 -0
- package/template/web-app/react-vite/.vscode/extensions.json +1 -1
- package/template/web-app/react-vite/package.json +4 -4
- package/template/web-app/react-webpack/.prettierignore +6 -0
- package/template/web-app/react-webpack/.prettierrc +18 -0
- package/template/web-app/react-webpack/.vscode/extensions.json +8 -8
- package/template/web-app/react-webpack/.vscode/settings.json +4 -18
- package/template/web-app/react-webpack/commitlint.config.js +1 -1
- package/template/web-app/react-webpack/domain/app/app.model.ts +7 -7
- package/template/web-app/react-webpack/domain/app/app.styled.ts +3 -3
- package/template/web-app/react-webpack/domain/app/components/app-context.tsx +17 -17
- package/template/web-app/react-webpack/domain/app/components/app.tsx +24 -24
- package/template/web-app/react-webpack/domain/app/components/index.ts +1 -1
- package/template/web-app/react-webpack/domain/app/index.ts +2 -2
- package/template/web-app/react-webpack/domain/router/home/ids.ts +3 -3
- package/template/web-app/react-webpack/domain/router/home/index.ts +2 -2
- package/template/web-app/react-webpack/domain/router/home/routes.tsx +13 -13
- package/template/web-app/react-webpack/domain/router/ids.ts +6 -6
- package/template/web-app/react-webpack/domain/router/index.ts +3 -3
- package/template/web-app/react-webpack/domain/router/router.tsx +28 -28
- package/template/web-app/react-webpack/domain/router/router.types.ts +3 -3
- package/template/web-app/react-webpack/global.d.ts +26 -26
- package/template/web-app/react-webpack/index.css +3 -3
- package/template/web-app/react-webpack/main.tsx +4 -4
- package/template/web-app/react-webpack/package.json +87 -87
- package/template/web-app/react-webpack/pages/home/home.styled.ts +7 -7
- package/template/web-app/react-webpack/pages/home/home.tsx +10 -10
- package/template/web-app/react-webpack/pages/home/index.ts +1 -1
- package/template/web-app/react-webpack/pages/index.tsx +18 -18
- package/template/web-app/react-webpack/pages/not-found.tsx +3 -3
- package/template/web-app/react-webpack/postcss.config.js +7 -7
- package/template/web-app/react-webpack/shared/hooks/defineRouter/defineRouter.types.ts +33 -33
- package/template/web-app/react-webpack/shared/hooks/defineRouter/index.ts +2 -2
- package/template/web-app/react-webpack/shared/hooks/index.ts +6 -6
- package/template/web-app/react-webpack/shared/hooks/useInterval.ts +26 -26
- package/template/web-app/react-webpack/shared/hooks/useLoadingAction.ts +27 -27
- package/template/web-app/react-webpack/shared/hooks/useLowPriorityState.ts +26 -26
- package/template/web-app/react-webpack/shared/hooks/useSyncState.ts +15 -15
- package/template/web-app/react-webpack/shared/hooks/useVisible.ts +27 -27
- package/template/web-app/react-webpack/shared/service/home.ts +8 -8
- package/template/web-app/react-webpack/shared/service/index.ts +2 -2
- package/template/web-app/react-webpack/shared/service/request.ts +5 -5
- package/template/web-app/react-webpack/shared/theme/index.ts +1 -1
- package/template/web-app/react-webpack/shared/theme/theme.styled.ts +56 -56
- package/template/web-app/react-webpack/shared/tools/componentInstance.tsx +78 -78
- package/template/web-app/react-webpack/shared/tools/index.ts +1 -1
- package/template/web-app/react-webpack/shared/types/index.ts +1 -1
- package/template/web-app/react-webpack/shared/types/utils.ts +2 -2
- package/template/web-app/react-webpack/tsconfig.json +27 -38
- package/template/web-app/react-webpack/tsconfig.node.json +9 -9
- package/template/web-app/solid/package.json +51 -51
- package/template/web-app/solid/src/app.container.tsx +12 -12
- package/template/web-app/solid/src/index.css +15 -15
- package/template/web-app/solid/src/index.tsx +15 -15
- package/template/web-app/solid/src/layout/index.ts +1 -1
- package/template/web-app/solid/src/layout/layout.container.tsx +5 -5
- package/template/web-app/solid/src/pages/home/home.container.tsx +5 -5
- package/template/web-app/solid/src/pages/home/index.ts +1 -1
- package/template/web-app/solid/src/pages/notFound/index.ts +1 -1
- package/template/web-app/solid/src/pages/notFound/notFound.container.tsx +3 -3
- package/template/web-app/solid/src/router/home/index.ts +2 -2
- package/template/web-app/solid/src/router/home/paths.ts +3 -3
- package/template/web-app/solid/src/router/home/routes.tsx +12 -12
- package/template/web-app/solid/src/router/index.ts +2 -2
- package/template/web-app/solid/src/router/paths.ts +5 -5
- package/template/web-app/solid/src/router/routes.ts +16 -16
- package/template/web-app/svelte/.prettierignore +2 -0
- package/template/web-app/svelte/.prettierrc +14 -14
- package/template/web-app/svelte/.svelte-kit/ambient.d.ts +177 -153
- package/template/web-app/svelte/.svelte-kit/generated/client/app.js +23 -19
- package/template/web-app/svelte/.svelte-kit/generated/client/matchers.js +1 -1
- package/template/web-app/svelte/.svelte-kit/generated/client/nodes/0.js +1 -1
- package/template/web-app/svelte/.svelte-kit/generated/client/nodes/1.js +1 -1
- package/template/web-app/svelte/.svelte-kit/generated/client/nodes/2.js +1 -1
- package/template/web-app/svelte/.svelte-kit/generated/root.svelte +62 -56
- package/template/web-app/svelte/.svelte-kit/generated/server/internal.js +61 -30
- package/template/web-app/svelte/.svelte-kit/non-ambient.d.ts +23 -0
- package/template/web-app/svelte/.svelte-kit/tsconfig.json +32 -39
- package/template/web-app/svelte/.svelte-kit/types/route_meta_data.json +3 -3
- package/template/web-app/svelte/.svelte-kit/types/src/routes/$types.d.ts +35 -20
- package/template/web-app/svelte/.vscode/extensions.json +8 -8
- package/template/web-app/svelte/commitlint.config.cjs +1 -1
- package/template/web-app/svelte/package.json +55 -55
- package/template/web-app/svelte/scripts/createChunks.ts +26 -26
- package/template/web-app/svelte/scripts/index.ts +1 -1
- package/template/web-app/svelte/src/app.d.ts +12 -12
- package/template/web-app/svelte/src/routes/+page.svelte +2 -2
- package/template/web-app/svelte/svelte.config.js +17 -17
- package/template/web-app/svelte/tsconfig.json +21 -21
- package/template/web-app/svelte/vite-env.d.ts +11 -11
- package/template/web-app/svelte/vite.config.ts +55 -55
- package/template/web-app/vue/.prettierignore +6 -0
- package/template/web-app/vue/.prettierrc +18 -0
- package/template/web-app/vue/.vscode/extensions.json +1 -1
- package/template/web-app/vue/domain/app/components/app.vue +18 -18
- package/template/web-app/vue/package.json +4 -4
- package/template/web-app/vue/pages/home/home.vue +16 -16
- package/template/web-app/vue/pages/index.vue +3 -3
- package/template/web-app/vue/pages/not-found.vue +3 -3
- package/template/web-extension/.prettierignore +6 -0
- package/template/web-extension/.prettierrc +18 -0
- package/template/web-extension/.vscode/extensions.json +8 -8
- package/template/web-extension/.vscode/settings.json +4 -18
- package/template/web-extension/.wxt/eslintrc-auto-import.json +19 -19
- package/template/web-extension/.wxt/tsconfig.json +24 -27
- package/template/web-extension/.wxt/types/globals.d.ts +10 -10
- package/template/web-extension/.wxt/types/i18n.d.ts +80 -74
- package/template/web-extension/.wxt/types/imports.d.ts +17 -17
- package/template/web-extension/.wxt/types/paths.d.ts +12 -12
- package/template/web-extension/entrypoints/background/index.ts +1 -1
- package/template/web-extension/entrypoints/content/constants/base.ts +1 -1
- package/template/web-extension/entrypoints/content/constants/index.ts +1 -1
- package/template/web-extension/entrypoints/content/domain/app/index.ts +1 -1
- package/template/web-extension/entrypoints/content/domain/app/tools/index.ts +1 -1
- package/template/web-extension/entrypoints/content/domain/app/tools/insertApp.tsx +59 -55
- package/template/web-extension/entrypoints/content/index.tsx +12 -12
- package/template/web-extension/entrypoints/content/modules/common/common.tsx +10 -10
- package/template/web-extension/entrypoints/content/modules/common/index.ts +2 -2
- package/template/web-extension/entrypoints/content/modules/common/insert.tsx +9 -9
- package/template/web-extension/entrypoints/content/modules/index.ts +1 -1
- package/template/web-extension/entrypoints/popup/index.html +0 -1
- package/template/web-extension/entrypoints/popup/main.tsx +14 -14
- package/template/web-extension/entrypoints/popup/popup.container.tsx +3 -3
- package/template/web-extension/package.json +86 -86
- package/template/web-extension/shared/background/index.ts +1 -1
- package/template/web-extension/shared/background/message.ts +11 -11
- package/template/web-extension/shared/components/app-context.tsx +14 -14
- package/template/web-extension/shared/components/index.ts +1 -1
- package/template/web-extension/shared/content/index.ts +1 -1
- package/template/web-extension/shared/content/message.ts +15 -15
- package/template/web-extension/shared/hooks/index.ts +2 -2
- package/template/web-extension/shared/hooks/useSyncState.ts +15 -15
- package/template/web-extension/shared/hooks/useVisible.ts +27 -27
- package/template/web-extension/shared/popup/index.ts +1 -1
- package/template/web-extension/shared/popup/message.ts +12 -12
- package/template/web-extension/shared/service/index.ts +1 -1
- package/template/web-extension/shared/service/request.ts +5 -5
- package/template/web-extension/shared/styles/global.styled.ts +8 -8
- package/template/web-extension/shared/styles/index.ts +2 -2
- package/template/web-extension/shared/styles/theme.styled.ts +56 -56
- package/template/web-extension/shared/tools/index.ts +1 -1
- package/template/web-extension/shared/tools/message.ts +80 -80
- package/template/web-extension/shared/types/index.ts +1 -1
- package/template/web-extension/shared/types/utils.ts +3 -3
- package/template/web-extension/tsconfig.json +32 -32
- package/template/web-extension/tsconfig.node.json +10 -10
- package/template/web-extension/vite-env.d.ts +19 -19
- package/template/web-extension/wxt.config.ts +50 -46
- package/template/cli/biome.json +0 -40
- package/template/lib/workspace/biome.json +0 -40
- package/template/web-app/react-rsbuild/biome.json +0 -40
- package/template/web-app/react-vite/biome.json +0 -40
- package/template/web-app/react-webpack/biome.json +0 -40
- package/template/web-app/vue/biome.json +0 -40
- package/template/web-extension/biome.json +0 -40
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
// Generated by wxt
|
|
2
2
|
export {}
|
|
3
3
|
declare global {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
const ContentScriptContext: (typeof import('wxt/client'))['ContentScriptContext']
|
|
5
|
+
const InvalidMatchPattern: (typeof import('wxt/sandbox'))['InvalidMatchPattern']
|
|
6
|
+
const MatchPattern: (typeof import('wxt/sandbox'))['MatchPattern']
|
|
7
|
+
const browser: (typeof import('wxt/browser'))['browser']
|
|
8
|
+
const createIframeUi: (typeof import('wxt/client'))['createIframeUi']
|
|
9
|
+
const createIntegratedUi: (typeof import('wxt/client'))['createIntegratedUi']
|
|
10
|
+
const createShadowRootUi: (typeof import('wxt/client'))['createShadowRootUi']
|
|
11
|
+
const defineAppConfig: (typeof import('wxt/sandbox'))['defineAppConfig']
|
|
12
|
+
const defineBackground: (typeof import('wxt/sandbox'))['defineBackground']
|
|
13
|
+
const defineConfig: (typeof import('wxt'))['defineConfig']
|
|
14
|
+
const defineContentScript: (typeof import('wxt/sandbox'))['defineContentScript']
|
|
15
|
+
const defineUnlistedScript: (typeof import('wxt/sandbox'))['defineUnlistedScript']
|
|
16
|
+
const defineWxtPlugin: (typeof import('wxt/sandbox'))['defineWxtPlugin']
|
|
17
|
+
const fakeBrowser: (typeof import('wxt/testing'))['fakeBrowser']
|
|
18
|
+
const injectScript: (typeof import('wxt/client'))['injectScript']
|
|
19
|
+
const storage: (typeof import('wxt/storage'))['storage']
|
|
20
|
+
const useAppConfig: (typeof import('wxt/client'))['useAppConfig']
|
|
21
21
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// Generated by wxt
|
|
2
|
-
import
|
|
2
|
+
import 'wxt/browser'
|
|
3
3
|
|
|
4
|
-
declare module
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
declare module 'wxt/browser' {
|
|
5
|
+
export type PublicPath =
|
|
6
|
+
| '/background.js'
|
|
7
|
+
| '/content-scripts/content.js'
|
|
8
|
+
| '/popup.html'
|
|
9
|
+
| '/vite.svg'
|
|
10
|
+
type HtmlPublicPath = Extract<PublicPath, `${string}.html`>
|
|
11
|
+
export interface WxtRuntime {
|
|
12
|
+
getURL(path: PublicPath): string
|
|
13
|
+
getURL(path: `${HtmlPublicPath}${string}`): string
|
|
14
|
+
}
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default defineBackground(() => {})
|
|
1
|
+
export default defineBackground(() => {})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const classNameSpace = import.meta.env.VITE_APP_ID
|
|
1
|
+
export const classNameSpace = import.meta.env.VITE_APP_ID
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './base'
|
|
1
|
+
export * from './base'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './tools'
|
|
1
|
+
export * from './tools'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './insertApp'
|
|
1
|
+
export * from './insertApp'
|
|
@@ -1,55 +1,59 @@
|
|
|
1
|
-
import { ReactNode } from 'react'
|
|
2
|
-
import { createRoot } from 'react-dom/client'
|
|
3
|
-
import { isFunction } from 'lodash-es'
|
|
4
|
-
import { Nullable } from '1k-types'
|
|
5
|
-
import { AppContext } from '@/shared/components'
|
|
6
|
-
import { classNameSpace } from '@/entrypoints/content/constants'
|
|
7
|
-
|
|
8
|
-
export enum insertAppStatus {
|
|
9
|
-
success,
|
|
10
|
-
target_not_exist,
|
|
11
|
-
root_existed
|
|
12
|
-
}
|
|
13
|
-
export interface insertAppResultType {
|
|
14
|
-
rootEle: Nullable<HTMLElement>
|
|
15
|
-
result: boolean
|
|
16
|
-
status: insertAppStatus
|
|
17
|
-
}
|
|
18
|
-
export function insertApp<T extends HTMLElement>(
|
|
19
|
-
target: Nullable<T>,
|
|
20
|
-
option: {
|
|
21
|
-
insert?: (rootEle: HTMLElement, target: T) => void
|
|
22
|
-
reactNode: ReactNode
|
|
23
|
-
isReplace?: boolean
|
|
24
|
-
rootId: string
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
result.rootEle
|
|
39
|
-
result.rootEle.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
result.
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
oldRootEle
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react'
|
|
2
|
+
import { createRoot } from 'react-dom/client'
|
|
3
|
+
import { forEach, isFunction } from 'lodash-es'
|
|
4
|
+
import { Nullable } from '1k-types'
|
|
5
|
+
import { AppContext } from '@/shared/components'
|
|
6
|
+
import { classNameSpace } from '@/entrypoints/content/constants'
|
|
7
|
+
|
|
8
|
+
export enum insertAppStatus {
|
|
9
|
+
success,
|
|
10
|
+
target_not_exist,
|
|
11
|
+
root_existed
|
|
12
|
+
}
|
|
13
|
+
export interface insertAppResultType {
|
|
14
|
+
rootEle: Nullable<HTMLElement>
|
|
15
|
+
result: boolean
|
|
16
|
+
status: insertAppStatus
|
|
17
|
+
}
|
|
18
|
+
export function insertApp<T extends HTMLElement>(
|
|
19
|
+
target: Nullable<T>,
|
|
20
|
+
option: {
|
|
21
|
+
insert?: (rootEle: HTMLElement, target: T) => void
|
|
22
|
+
reactNode: ReactNode
|
|
23
|
+
isReplace?: boolean
|
|
24
|
+
rootId: string
|
|
25
|
+
rootStyle?: CSSProperties
|
|
26
|
+
}
|
|
27
|
+
) {
|
|
28
|
+
const result: insertAppResultType = {
|
|
29
|
+
result: false,
|
|
30
|
+
rootEle: void 0,
|
|
31
|
+
status: insertAppStatus.success
|
|
32
|
+
}
|
|
33
|
+
const rootId = `${import.meta.env.VITE_APP_ID}_${option.rootId}`
|
|
34
|
+
if (!target) {
|
|
35
|
+
result.status = insertAppStatus.target_not_exist
|
|
36
|
+
return result
|
|
37
|
+
}
|
|
38
|
+
result.rootEle = document.createElement('div')
|
|
39
|
+
result.rootEle.className = classNameSpace
|
|
40
|
+
result.rootEle.id = rootId
|
|
41
|
+
forEach(option.rootStyle, (value, key) => {
|
|
42
|
+
result.rootEle!.style[key as any] = value as never
|
|
43
|
+
})
|
|
44
|
+
const oldRootEle = target.querySelector?.(`#${rootId}`)
|
|
45
|
+
if (!option.isReplace && oldRootEle) {
|
|
46
|
+
result.status = insertAppStatus.root_existed
|
|
47
|
+
return result
|
|
48
|
+
}
|
|
49
|
+
oldRootEle?.remove()
|
|
50
|
+
if (isFunction(option.insert)) {
|
|
51
|
+
option.insert(result.rootEle, target)
|
|
52
|
+
} else {
|
|
53
|
+
target.appendChild(result.rootEle)
|
|
54
|
+
}
|
|
55
|
+
const root = createRoot(result.rootEle)
|
|
56
|
+
root.render(<AppContext>{option.reactNode}</AppContext>)
|
|
57
|
+
result.result = true
|
|
58
|
+
return result
|
|
59
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Common } from './modules'
|
|
2
|
-
|
|
3
|
-
export default defineContentScript({
|
|
4
|
-
run_at: 'document_start',
|
|
5
|
-
matches: [
|
|
6
|
-
'https://developer.chrome.com/docs/extensions/*',
|
|
7
|
-
'https://developer.chrome.com/docs/webstore/*'
|
|
8
|
-
],
|
|
9
|
-
main: () => {
|
|
10
|
-
Common.insert()
|
|
11
|
-
}
|
|
12
|
-
})
|
|
1
|
+
import { Common } from './modules'
|
|
2
|
+
|
|
3
|
+
export default defineContentScript({
|
|
4
|
+
run_at: 'document_start',
|
|
5
|
+
matches: [
|
|
6
|
+
'https://developer.chrome.com/docs/extensions/*',
|
|
7
|
+
'https://developer.chrome.com/docs/webstore/*'
|
|
8
|
+
],
|
|
9
|
+
main: () => {
|
|
10
|
+
Common.insert()
|
|
11
|
+
}
|
|
12
|
+
})
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { GlobalStyle } from '@/shared/styles'
|
|
2
|
-
import { classNameSpace } from '@/entrypoints/content/constants'
|
|
3
|
-
|
|
4
|
-
export default function Home() {
|
|
5
|
-
return (
|
|
6
|
-
<>
|
|
7
|
-
<GlobalStyle nameSpace={classNameSpace} />
|
|
8
|
-
</>
|
|
9
|
-
)
|
|
10
|
-
}
|
|
1
|
+
import { GlobalStyle } from '@/shared/styles'
|
|
2
|
+
import { classNameSpace } from '@/entrypoints/content/constants'
|
|
3
|
+
|
|
4
|
+
export default function Home() {
|
|
5
|
+
return (
|
|
6
|
+
<>
|
|
7
|
+
<GlobalStyle nameSpace={classNameSpace} />
|
|
8
|
+
</>
|
|
9
|
+
)
|
|
10
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as Root } from './common'
|
|
2
|
-
export * from './insert'
|
|
1
|
+
export { default as Root } from './common'
|
|
2
|
+
export * from './insert'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { insertApp } from '@/entrypoints/content/domain/app'
|
|
2
|
-
import Common from './common'
|
|
3
|
-
|
|
4
|
-
export function insert() {
|
|
5
|
-
insertApp(document.body, {
|
|
6
|
-
reactNode: <Common />,
|
|
7
|
-
rootId: 'COMMON'
|
|
8
|
-
})
|
|
9
|
-
}
|
|
1
|
+
import { insertApp } from '@/entrypoints/content/domain/app'
|
|
2
|
+
import Common from './common'
|
|
3
|
+
|
|
4
|
+
export function insert() {
|
|
5
|
+
insertApp(document.body, {
|
|
6
|
+
reactNode: <Common />,
|
|
7
|
+
rootId: 'COMMON'
|
|
8
|
+
})
|
|
9
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as Common from './common'
|
|
1
|
+
export * as Common from './common'
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { StrictMode } from 'react'
|
|
2
|
-
import { createRoot } from 'react-dom/client'
|
|
3
|
-
import { AppContext } from '@/shared/components'
|
|
4
|
-
import { GlobalStyle } from '@/shared/styles'
|
|
5
|
-
import Popup from './popup.container'
|
|
6
|
-
|
|
7
|
-
createRoot(document.getElementById('root') as HTMLElement).render(
|
|
8
|
-
<StrictMode>
|
|
9
|
-
<AppContext>
|
|
10
|
-
<GlobalStyle />
|
|
11
|
-
<Popup />
|
|
12
|
-
</AppContext>
|
|
13
|
-
</StrictMode>
|
|
14
|
-
)
|
|
1
|
+
import { StrictMode } from 'react'
|
|
2
|
+
import { createRoot } from 'react-dom/client'
|
|
3
|
+
import { AppContext } from '@/shared/components'
|
|
4
|
+
import { GlobalStyle } from '@/shared/styles'
|
|
5
|
+
import Popup from './popup.container'
|
|
6
|
+
|
|
7
|
+
createRoot(document.getElementById('root') as HTMLElement).render(
|
|
8
|
+
<StrictMode>
|
|
9
|
+
<AppContext>
|
|
10
|
+
<GlobalStyle />
|
|
11
|
+
<Popup />
|
|
12
|
+
</AppContext>
|
|
13
|
+
</StrictMode>
|
|
14
|
+
)
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default function Home() {
|
|
2
|
-
return <div>home</div>
|
|
3
|
-
}
|
|
1
|
+
export default function Home() {
|
|
2
|
+
return <div>home</div>
|
|
3
|
+
}
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "web-extension",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"prepare": "husky install",
|
|
8
|
-
"dev": "wxt",
|
|
9
|
-
"dev:firefox": "wxt -b firefox",
|
|
10
|
-
"build": "wxt build",
|
|
11
|
-
"build_dev": "wxt build --mode dev",
|
|
12
|
-
"build:firefox": "wxt build -b firefox",
|
|
13
|
-
"build_dev:firefox": "wxt build -b firefox --mode dev",
|
|
14
|
-
"zip": "wxt zip",
|
|
15
|
-
"zip_dev": "wxt zip --mode dev",
|
|
16
|
-
"zip:firefox": "wxt zip -b firefox",
|
|
17
|
-
"zip_dev:firefox": "wxt zip -b firefox --mode dev",
|
|
18
|
-
"postinstall": "wxt prepare",
|
|
19
|
-
"up:vite": "pnpm up vite @vitejs/* -L",
|
|
20
|
-
"format": "
|
|
21
|
-
"lint": "tsc --noEmit && eslint **/*.{tsx,ts} && stylelint **/*.{css,scss,less}",
|
|
22
|
-
"lint:fix": "eslint **/*.{tsx,ts} --fix && stylelint **/*.{css,scss,less} --fix",
|
|
23
|
-
"cz": "cz",
|
|
24
|
-
"push": "npm run commit && git push",
|
|
25
|
-
"commit": "git add . && npm run cz"
|
|
26
|
-
},
|
|
27
|
-
"dependencies": {
|
|
28
|
-
"@tanstack/react-query": "5.51.15",
|
|
29
|
-
"axios": "^1.7.2",
|
|
30
|
-
"define-zustand": "3.1.1",
|
|
31
|
-
"immer": "10.0.1",
|
|
32
|
-
"lodash-es": "4.17.21",
|
|
33
|
-
"qs": "6.11.2",
|
|
34
|
-
"react": "18.3.1",
|
|
35
|
-
"react-dom": "18.3.1",
|
|
36
|
-
"styled-components": "6.1.11",
|
|
37
|
-
"zustand": "4.4.1"
|
|
38
|
-
},
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"1k-types": "1.2.0",
|
|
41
|
-
"@
|
|
42
|
-
"@commitlint/
|
|
43
|
-
"@commitlint/
|
|
44
|
-
"@
|
|
45
|
-
"@
|
|
46
|
-
"@types/
|
|
47
|
-
"@types/
|
|
48
|
-
"@types/
|
|
49
|
-
"@types/
|
|
50
|
-
"@types/react": "18.3.
|
|
51
|
-
"@
|
|
52
|
-
"@typescript-eslint/
|
|
53
|
-
"@
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"eslint": "
|
|
60
|
-
"eslint-import
|
|
61
|
-
"eslint-plugin-
|
|
62
|
-
"eslint-plugin-react": "
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"postcss": "
|
|
67
|
-
"postcss-
|
|
68
|
-
"postcss-
|
|
69
|
-
"postcss-
|
|
70
|
-
"
|
|
71
|
-
"rimraf": "5.0.1",
|
|
72
|
-
"sass": "1.63.4",
|
|
73
|
-
"stylelint": "16.
|
|
74
|
-
"stylelint-config-standard": "36.0.1",
|
|
75
|
-
"typescript": "5.5.2",
|
|
76
|
-
"vite": "5.3.3",
|
|
77
|
-
"vite-plugin-stylelint": "5.3.1",
|
|
78
|
-
"vite-plugin-svgr": "4.2.0",
|
|
79
|
-
"wxt": "0.19.11"
|
|
80
|
-
},
|
|
81
|
-
"config": {
|
|
82
|
-
"commitizen": {
|
|
83
|
-
"path": "@commitlint/cz-commitlint"
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "web-extension",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"prepare": "husky install",
|
|
8
|
+
"dev": "wxt",
|
|
9
|
+
"dev:firefox": "wxt -b firefox",
|
|
10
|
+
"build": "wxt build",
|
|
11
|
+
"build_dev": "wxt build --mode dev",
|
|
12
|
+
"build:firefox": "wxt build -b firefox",
|
|
13
|
+
"build_dev:firefox": "wxt build -b firefox --mode dev",
|
|
14
|
+
"zip": "wxt zip",
|
|
15
|
+
"zip_dev": "wxt zip --mode dev",
|
|
16
|
+
"zip:firefox": "wxt zip -b firefox",
|
|
17
|
+
"zip_dev:firefox": "wxt zip -b firefox --mode dev",
|
|
18
|
+
"postinstall": "wxt prepare",
|
|
19
|
+
"up:vite": "pnpm up vite @vitejs/* -L",
|
|
20
|
+
"format": "prettier --write \"**/*.{ts,js,tsx,jsx,json,css,scss,less}\"",
|
|
21
|
+
"lint": "tsc --noEmit && eslint **/*.{tsx,ts} && stylelint **/*.{css,scss,less}",
|
|
22
|
+
"lint:fix": "eslint **/*.{tsx,ts} --fix && stylelint **/*.{css,scss,less} --fix",
|
|
23
|
+
"cz": "cz",
|
|
24
|
+
"push": "npm run commit && git push",
|
|
25
|
+
"commit": "git add . && npm run cz"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@tanstack/react-query": "5.51.15",
|
|
29
|
+
"axios": "^1.7.2",
|
|
30
|
+
"define-zustand": "3.1.1",
|
|
31
|
+
"immer": "10.0.1",
|
|
32
|
+
"lodash-es": "4.17.21",
|
|
33
|
+
"qs": "6.11.2",
|
|
34
|
+
"react": "18.3.1",
|
|
35
|
+
"react-dom": "18.3.1",
|
|
36
|
+
"styled-components": "6.1.11",
|
|
37
|
+
"zustand": "4.4.1"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"1k-types": "1.2.0",
|
|
41
|
+
"@commitlint/cli": "17.6.1",
|
|
42
|
+
"@commitlint/config-conventional": "17.6.1",
|
|
43
|
+
"@commitlint/cz-commitlint": "17.5.0",
|
|
44
|
+
"@rollup/plugin-eslint": "9.0.5",
|
|
45
|
+
"@types/chrome": "0.0.254",
|
|
46
|
+
"@types/lodash-es": "4.17.7",
|
|
47
|
+
"@types/node": "18.16.0",
|
|
48
|
+
"@types/qs": "6.9.7",
|
|
49
|
+
"@types/react": "18.3.3",
|
|
50
|
+
"@types/react-dom": "18.3.0",
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "7.0.2",
|
|
52
|
+
"@typescript-eslint/parser": "7.0.2",
|
|
53
|
+
"@vitejs/plugin-react": "4.3.1",
|
|
54
|
+
"autoprefixer": "10.4.14",
|
|
55
|
+
"babel-plugin-styled-components": "2.1.4",
|
|
56
|
+
"commitizen": "4.3.0",
|
|
57
|
+
"cssnano": "6.0.0",
|
|
58
|
+
"eslint": "8.56.0",
|
|
59
|
+
"eslint-import-resolver-typescript": "3.6.1",
|
|
60
|
+
"eslint-plugin-import": "2.29.1",
|
|
61
|
+
"eslint-plugin-react": "7.33.2",
|
|
62
|
+
"eslint-plugin-react-hooks": "4.6.0",
|
|
63
|
+
"husky": "9.1.6",
|
|
64
|
+
"inquirer": "^8.1.2",
|
|
65
|
+
"postcss": "8.4.31",
|
|
66
|
+
"postcss-import": "15.1.0",
|
|
67
|
+
"postcss-nesting": "11.2.2",
|
|
68
|
+
"postcss-scss": "4.0.9",
|
|
69
|
+
"postcss-styled-syntax": "0.6.4",
|
|
70
|
+
"prettier": "3.2.5",
|
|
71
|
+
"rimraf": "5.0.1",
|
|
72
|
+
"sass": "1.63.4",
|
|
73
|
+
"stylelint": "16.10.0",
|
|
74
|
+
"stylelint-config-standard": "36.0.1",
|
|
75
|
+
"typescript": "5.5.2",
|
|
76
|
+
"vite": "5.3.3",
|
|
77
|
+
"vite-plugin-stylelint": "5.3.1",
|
|
78
|
+
"vite-plugin-svgr": "4.2.0",
|
|
79
|
+
"wxt": "0.19.11"
|
|
80
|
+
},
|
|
81
|
+
"config": {
|
|
82
|
+
"commitizen": {
|
|
83
|
+
"path": "@commitlint/cz-commitlint"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as backgroundMessage from './message'
|
|
1
|
+
export * as backgroundMessage from './message'
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { message } from '@/shared/tools'
|
|
2
|
-
export enum ACTIONS {
|
|
3
|
-
TEST = 'TEST'
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export interface messageType {
|
|
7
|
-
[ACTIONS.TEST]: object
|
|
8
|
-
}
|
|
9
|
-
export interface responseType {}
|
|
10
|
-
|
|
11
|
-
export const action = message.create<ACTIONS, messageType, responseType>()
|
|
1
|
+
import { message } from '@/shared/tools'
|
|
2
|
+
export enum ACTIONS {
|
|
3
|
+
TEST = 'TEST'
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface messageType {
|
|
7
|
+
[ACTIONS.TEST]: object
|
|
8
|
+
}
|
|
9
|
+
export interface responseType {}
|
|
10
|
+
|
|
11
|
+
export const action = message.create<ACTIONS, messageType, responseType>()
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { FunctionComponent, ReactNode } from 'react'
|
|
2
|
-
import { ThemeProvider } from 'styled-components'
|
|
3
|
-
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
4
|
-
import { theme } from '@/shared/styles'
|
|
5
|
-
|
|
6
|
-
const queryClient = new QueryClient()
|
|
7
|
-
|
|
8
|
-
export const AppContext: FunctionComponent<{ children: ReactNode }> = props => {
|
|
9
|
-
return (
|
|
10
|
-
<QueryClientProvider client={queryClient}>
|
|
11
|
-
<ThemeProvider theme={theme}>{props.children}</ThemeProvider>
|
|
12
|
-
</QueryClientProvider>
|
|
13
|
-
)
|
|
14
|
-
}
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react'
|
|
2
|
+
import { ThemeProvider } from 'styled-components'
|
|
3
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
4
|
+
import { theme } from '@/shared/styles'
|
|
5
|
+
|
|
6
|
+
const queryClient = new QueryClient()
|
|
7
|
+
|
|
8
|
+
export const AppContext: FunctionComponent<{ children: ReactNode }> = props => {
|
|
9
|
+
return (
|
|
10
|
+
<QueryClientProvider client={queryClient}>
|
|
11
|
+
<ThemeProvider theme={theme}>{props.children}</ThemeProvider>
|
|
12
|
+
</QueryClientProvider>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './app-context'
|
|
1
|
+
export * from './app-context'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as contentMessage from './message'
|
|
1
|
+
export * as contentMessage from './message'
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { message } from '@/shared/tools'
|
|
2
|
-
export enum ACTIONS {
|
|
3
|
-
TEST = 'TEST'
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export interface messageType {
|
|
7
|
-
[ACTIONS.TEST]: object
|
|
8
|
-
}
|
|
9
|
-
export interface responseType {}
|
|
10
|
-
|
|
11
|
-
export const action = message.create<ACTIONS, messageType, responseType>()
|
|
12
|
-
|
|
13
|
-
export function batchSend<A extends ACTIONS>(message: { action: A } & messageType[A]) {
|
|
14
|
-
return action.batchSendToContent(message, { active: true, url: '*://*.tiktok.com/*' })
|
|
15
|
-
}
|
|
1
|
+
import { message } from '@/shared/tools'
|
|
2
|
+
export enum ACTIONS {
|
|
3
|
+
TEST = 'TEST'
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface messageType {
|
|
7
|
+
[ACTIONS.TEST]: object
|
|
8
|
+
}
|
|
9
|
+
export interface responseType {}
|
|
10
|
+
|
|
11
|
+
export const action = message.create<ACTIONS, messageType, responseType>()
|
|
12
|
+
|
|
13
|
+
export function batchSend<A extends ACTIONS>(message: { action: A } & messageType[A]) {
|
|
14
|
+
return action.batchSendToContent(message, { active: true, url: '*://*.tiktok.com/*' })
|
|
15
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as useVisible } from './useVisible'
|
|
2
|
-
export * from './useSyncState'
|
|
1
|
+
export { default as useVisible } from './useVisible'
|
|
2
|
+
export * from './useSyncState'
|