create-packer 1.45.7 → 1.45.9

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 (26) hide show
  1. package/package.json +1 -1
  2. package/template/lib/workspace/eslint.config.mjs +1 -0
  3. package/template/lib/workspace/tsconfig.node.json +1 -1
  4. package/template/web-app/react-rsbuild/eslint.config.js +1 -0
  5. package/template/web-app/react-rsbuild/shared/styles/index.ts +1 -1
  6. package/template/web-app/react-rsbuild/shared/styles/theme.css.ts +1 -1
  7. package/template/web-app/react-vite/eslint.config.js +1 -0
  8. package/template/web-app/react-vite/shared/styles/index.ts +1 -1
  9. package/template/web-app/react-vite/shared/styles/theme.css.ts +1 -1
  10. package/template/web-app/svelte/eslint.config.js +1 -0
  11. package/template/web-app/vue/eslint.config.js +1 -0
  12. package/template/web-app/vue-rsbuild/eslint.config.js +1 -0
  13. package/template/web-extension/entrypoints/content/global.css.ts +5 -0
  14. package/template/web-extension/entrypoints/content/modules/common/common.tsx +2 -7
  15. package/template/web-extension/entrypoints/popup/global.css.ts +4 -0
  16. package/template/web-extension/entrypoints/popup/main.tsx +1 -2
  17. package/template/web-extension/eslint.config.js +1 -0
  18. package/template/web-extension/package.json +2 -2
  19. package/template/web-extension/shared/components/app-context/view.tsx +1 -7
  20. package/template/web-extension/shared/styles/global.css.ts +7 -0
  21. package/template/web-extension/shared/styles/index.ts +2 -2
  22. package/template/web-extension/shared/styles/theme.css.ts +3 -0
  23. package/template/web-extension/vite-env.d.ts +0 -7
  24. package/template/web-extension/wxt.config.ts +2 -18
  25. package/template/web-extension/shared/styles/global-style.ts +0 -9
  26. package/template/web-extension/shared/styles/theme.styled.ts +0 -47
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-packer",
3
- "version": "1.45.7",
3
+ "version": "1.45.9",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/kevily/create-packer",
6
6
  "author": "1k <bug_zero@163.com>",
@@ -106,6 +106,7 @@ export default tseslint.config([
106
106
  '@typescript-eslint/explicit-module-boundary-types': 'off',
107
107
  '@typescript-eslint/ban-ts-comment': 'off',
108
108
  '@typescript-eslint/no-empty-interface': 'off',
109
+ '@typescript-eslint/triple-slash-reference': 'off',
109
110
  'react/prop-types': 'off',
110
111
  'react/no-find-dom-node': 'off',
111
112
  'react-hooks/exhaustive-deps': 'off',
@@ -8,7 +8,7 @@
8
8
  "strictNullChecks": true,
9
9
  "target": "ESNext",
10
10
  "noImplicitAny": false,
11
- "moduleResolution": "bundler",
11
+ "moduleResolution": "node",
12
12
  "sourceMap": false,
13
13
  "declaration": true,
14
14
  "outDir": "lib",
@@ -95,6 +95,7 @@ export default tseslint.config([
95
95
  '@typescript-eslint/explicit-module-boundary-types': 'off',
96
96
  '@typescript-eslint/ban-ts-comment': 'off',
97
97
  '@typescript-eslint/no-empty-interface': 'off',
98
+ '@typescript-eslint/triple-slash-reference': 'off',
98
99
  'react/prop-types': 'off',
99
100
  'react/no-find-dom-node': 'off',
100
101
  'react-hooks/exhaustive-deps': 'off',
@@ -1 +1 @@
1
- export * as theme from './theme.css'
1
+ export * from './theme.css'
@@ -1,3 +1,3 @@
1
1
  import { createTheme } from '@vanilla-extract/css'
2
2
 
3
- export const [classes, vars] = createTheme({})
3
+ export const [themeClass, themeVars] = createTheme({})
@@ -102,6 +102,7 @@ export default tseslint.config([
102
102
  '@typescript-eslint/explicit-module-boundary-types': 'off',
103
103
  '@typescript-eslint/ban-ts-comment': 'off',
104
104
  '@typescript-eslint/no-empty-interface': 'off',
105
+ '@typescript-eslint/triple-slash-reference': 'off',
105
106
  'react/prop-types': 'off',
106
107
  'react/no-find-dom-node': 'off',
107
108
  'react-hooks/exhaustive-deps': 'off',
@@ -1 +1 @@
1
- export * as theme from './theme.css'
1
+ export * from './theme.css'
@@ -1,3 +1,3 @@
1
1
  import { createTheme } from '@vanilla-extract/css'
2
2
 
3
- export const [classes, vars] = createTheme({})
3
+ export const [themeClass, themeVars] = createTheme({})
@@ -91,6 +91,7 @@ export default tseslint.config([
91
91
  '@typescript-eslint/explicit-module-boundary-types': 'off',
92
92
  '@typescript-eslint/ban-ts-comment': 'off',
93
93
  '@typescript-eslint/no-empty-interface': 'off',
94
+ '@typescript-eslint/triple-slash-reference': 'off',
94
95
  'no-constant-condition': 'off'
95
96
  }
96
97
  }
@@ -97,6 +97,7 @@ export default tseslint.config([
97
97
  '@typescript-eslint/explicit-module-boundary-types': 'off',
98
98
  '@typescript-eslint/ban-ts-comment': 'off',
99
99
  '@typescript-eslint/no-empty-interface': 'off',
100
+ '@typescript-eslint/triple-slash-reference': 'off',
100
101
  'vue/multi-word-component-names': 0,
101
102
  'vue/html-indent': ['error', 4],
102
103
  'vue/require-default-prop': 'off',
@@ -88,6 +88,7 @@ export default tseslint.config([
88
88
  '@typescript-eslint/explicit-module-boundary-types': 'off',
89
89
  '@typescript-eslint/ban-ts-comment': 'off',
90
90
  '@typescript-eslint/no-empty-interface': 'off',
91
+ '@typescript-eslint/triple-slash-reference': 'off',
91
92
  'vue/multi-word-component-names': 0,
92
93
  'vue/html-indent': ['error', 4],
93
94
  'vue/require-default-prop': 'off',
@@ -0,0 +1,5 @@
1
+ import { globalStyle } from '@vanilla-extract/css'
2
+ import { createGlobalStyle } from '@/shared/styles'
3
+ import { classNameSpace } from './constants'
4
+
5
+ globalStyle(classNameSpace, createGlobalStyle())
@@ -1,10 +1,5 @@
1
- import { GlobalStyle } from '@/shared/styles'
2
- import { classNameSpace } from '@/entrypoints/content/constants'
1
+ import '@/entrypoints/content/global.css'
3
2
 
4
3
  export default function Home() {
5
- return (
6
- <>
7
- <GlobalStyle nameSpace={classNameSpace} />
8
- </>
9
- )
4
+ return <></>
10
5
  }
@@ -0,0 +1,4 @@
1
+ import { globalStyle } from '@vanilla-extract/css'
2
+ import { createGlobalStyle } from '@/shared/styles'
3
+
4
+ globalStyle('body', createGlobalStyle())
@@ -1,13 +1,12 @@
1
1
  import { StrictMode } from 'react'
2
2
  import { createRoot } from 'react-dom/client'
3
3
  import { AppContext } from '@/shared/components'
4
- import { GlobalStyle } from '@/shared/styles'
5
4
  import Popup from './popup'
5
+ import './global.css'
6
6
 
7
7
  createRoot(document.getElementById('root') as HTMLElement).render(
8
8
  <StrictMode>
9
9
  <AppContext.Root>
10
- <GlobalStyle />
11
10
  <Popup />
12
11
  </AppContext.Root>
13
12
  </StrictMode>
@@ -96,6 +96,7 @@ export default tseslint.config([
96
96
  '@typescript-eslint/ban-ts-comment': 'off',
97
97
  '@typescript-eslint/no-empty-interface': 'off',
98
98
  '@typescript-eslint/triple-slash-reference': 'off',
99
+ '@typescript-eslint/triple-slash-reference': 'off',
99
100
  'react/prop-types': 'off',
100
101
  'react/no-find-dom-node': 'off',
101
102
  'react-hooks/exhaustive-deps': 'off',
@@ -26,6 +26,7 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@tanstack/react-query": "5.51.15",
29
+ "@vanilla-extract/css": "1.17.4",
29
30
  "@webext-core/messaging": "2.2.0",
30
31
  "axios": "1.7.9",
31
32
  "define-zustand": "3.4.0",
@@ -34,7 +35,6 @@
34
35
  "qs": "6.11.2",
35
36
  "react": "18.3.1",
36
37
  "react-dom": "18.3.1",
37
- "styled-components": "^6.1.17",
38
38
  "type-fest": "4.33.0",
39
39
  "zustand": "5.0.3"
40
40
  },
@@ -48,9 +48,9 @@
48
48
  "@types/qs": "6.9.7",
49
49
  "@types/react": "18.3.3",
50
50
  "@types/react-dom": "18.3.0",
51
+ "@vanilla-extract/vite-plugin": "5.1.1",
51
52
  "@vitejs/plugin-react": "4.3.4",
52
53
  "autoprefixer": "10.4.14",
53
- "babel-plugin-styled-components": "2.1.4",
54
54
  "commitizen": "4.3.0",
55
55
  "cssnano": "6.0.0",
56
56
  "eslint": "9.17.0",
@@ -1,16 +1,10 @@
1
1
  import { FunctionComponent, ReactNode } from 'react'
2
- import { ThemeProvider } from 'styled-components'
3
2
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
4
- import { theme } from '@/shared/styles'
5
3
 
6
4
  const queryClient = new QueryClient()
7
5
 
8
6
  const AppContext: FunctionComponent<{ children: ReactNode }> = props => {
9
- return (
10
- <QueryClientProvider client={queryClient}>
11
- <ThemeProvider theme={theme}>{props.children}</ThemeProvider>
12
- </QueryClientProvider>
13
- )
7
+ return <QueryClientProvider client={queryClient}>{props.children}</QueryClientProvider>
14
8
  }
15
9
 
16
10
  export default AppContext
@@ -0,0 +1,7 @@
1
+ import { GlobalStyleRule } from '@vanilla-extract/css'
2
+
3
+ export function createGlobalStyle(): GlobalStyleRule {
4
+ return {
5
+ margin: 0
6
+ }
7
+ }
@@ -1,2 +1,2 @@
1
- export * from './theme.styled'
2
- export * from './global-style'
1
+ export * from './global.css'
2
+ export * from './theme.css'
@@ -0,0 +1,3 @@
1
+ import { createTheme } from '@vanilla-extract/css'
2
+
3
+ export const [themeClass, themeVars] = createTheme({})
@@ -1,9 +1,6 @@
1
1
  /// <reference types="vite/client" />
2
2
  /// <reference types="./.wxt/wxt.d.ts" />
3
3
 
4
- import 'styled-components'
5
- import { themeType } from './shared/styles'
6
-
7
4
  declare global {
8
5
  interface ImportMetaEnv {
9
6
  readonly VITE_API_HOST: string
@@ -15,7 +12,3 @@ declare global {
15
12
  readonly env: ImportMetaEnv
16
13
  }
17
14
  }
18
-
19
- declare module 'styled-components' {
20
- export interface DefaultTheme extends themeType {}
21
- }
@@ -1,6 +1,7 @@
1
1
  import { defineConfig, UserManifestFn } from 'wxt'
2
2
  import react from '@vitejs/plugin-react'
3
3
  import svgr from 'vite-plugin-svgr'
4
+ import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin'
4
5
  import pkgJson from './package.json'
5
6
 
6
7
  const manifest: UserManifestFn = () => {
@@ -29,24 +30,7 @@ export default defineConfig({
29
30
  runner: { disabled: true },
30
31
  imports: { eslintrc: { enabled: 9 } },
31
32
  vite: ({ mode }) => ({
32
- plugins: [
33
- svgr(),
34
- react({
35
- babel: {
36
- plugins: [
37
- [
38
- 'babel-plugin-styled-components',
39
- {
40
- ssr: false,
41
- displayName: false,
42
- fileName: false,
43
- transpileTemplateLiterals: false
44
- }
45
- ]
46
- ]
47
- }
48
- })
49
- ] as any,
33
+ plugins: [vanillaExtractPlugin(), svgr(), react()] as any,
50
34
  resolve: {
51
35
  alias: {
52
36
  '@': __dirname
@@ -1,9 +0,0 @@
1
- import { createGlobalStyle, css } from 'styled-components'
2
-
3
- export const GlobalStyle = createGlobalStyle<{ nameSpace?: string }>(props => {
4
- return css`
5
- .${props.nameSpace || 'body'} {
6
- margin: 0;
7
- }
8
- `
9
- })
@@ -1,47 +0,0 @@
1
- import { CSSProperties } from 'react'
2
- import { isString } from 'es-toolkit'
3
-
4
- export const theme = {
5
- tools: {
6
- ellipsis: () => ({
7
- overflow: 'hidden',
8
- textOverflow: 'ellipsis',
9
- whiteSpace: 'nowrap'
10
- }),
11
- lineClamp: (n: number) => {
12
- return {
13
- WebkitLineClamp: `${n}`,
14
- WebkitBoxOrient: 'vertical',
15
- overflow: 'hidden',
16
- display: '-webkit-box'
17
- } satisfies CSSProperties
18
- },
19
- size: (s: string) => ({ width: s, height: s }),
20
- py: (s: string) => ({ paddingTop: s, paddingBottom: s }),
21
- px: (s: string) => ({ paddingLeft: s, paddingRight: s }),
22
- my: (s: string) => ({ marginTop: s, marginBottom: s }),
23
- mx: (s: string) => ({ marginLeft: s, marginRight: s }),
24
- flex: (
25
- align: CSSProperties['alignItems'],
26
- justify: CSSProperties['justifyContent'],
27
- vertical?: boolean
28
- ) => {
29
- return {
30
- display: 'flex',
31
- alignItems: align,
32
- justifyContent: justify,
33
- flexDirection: vertical ? 'column' : 'row'
34
- } satisfies CSSProperties
35
- },
36
- /** 数字为元素数量,字符串为对应css的值 */
37
- grid: (rows: number | string, cols: number | string, gap?: number) => {
38
- return {
39
- display: 'grid',
40
- gridTemplateRows: isString(rows) ? rows : `repeat(${rows}, minmax(0, 1fr))`,
41
- gridTemplateColumns: isString(cols) ? cols : `repeat(${cols}, minmax(0, 1fr))`,
42
- gap: gap ? `${gap}px` : void 0
43
- } satisfies CSSProperties
44
- }
45
- }
46
- }
47
- export type themeType = typeof theme