gemini-uis 0.1.0 → 0.1.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/src/libs/index.ts DELETED
@@ -1,10 +0,0 @@
1
- import './styles.css'
2
- // 导出组件
3
- export { default as Button } from './Button'
4
- export type {
5
- ButtonProps,
6
- ButtonRef,
7
- ButtonType,
8
- ButtonSize,
9
- } from './Button'
10
-
@@ -1,2 +0,0 @@
1
- @import "tailwindcss";
2
-
package/src/utils/cn.ts DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * 合并 CSS 类名
3
- */
4
- function cn(...classes: (string | undefined | null | false)[]): string {
5
- return classes.filter(Boolean).join(' ')
6
- }
7
-
8
- export default cn
@@ -1 +0,0 @@
1
- export { default as cn } from './cn'
package/src/vite-env.d.ts DELETED
@@ -1,7 +0,0 @@
1
- /// <reference types="vite/client" />
2
-
3
- declare module '*.css' {
4
- const content: string
5
- export default content
6
- }
7
-
package/tsconfig.app.json DELETED
@@ -1,34 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4
- "target": "ES2022",
5
- "useDefineForClassFields": true,
6
- "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
- "module": "ESNext",
8
- "types": ["vite/client"],
9
- "skipLibCheck": true,
10
-
11
- /* Bundler mode */
12
- "moduleResolution": "bundler",
13
- "allowImportingTsExtensions": true,
14
- "verbatimModuleSyntax": true,
15
- "moduleDetection": "force",
16
- "noEmit": true,
17
- "jsx": "react-jsx",
18
-
19
- /* Path Aliases */
20
- "baseUrl": ".",
21
- "paths": {
22
- "@/*": ["./src/*"]
23
- },
24
-
25
- /* Linting */
26
- "strict": true,
27
- "noUnusedLocals": true,
28
- "noUnusedParameters": true,
29
- "erasableSyntaxOnly": true,
30
- "noFallthroughCasesInSwitch": true,
31
- "noUncheckedSideEffectImports": true
32
- },
33
- "include": ["src"]
34
- }
@@ -1,20 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "lib": ["ES2022", "DOM", "DOM.Iterable"],
5
- "module": "ESNext",
6
- "jsx": "react-jsx",
7
- "moduleResolution": "bundler",
8
- "skipLibCheck": true,
9
- "strict": true,
10
- "noEmit": false,
11
- "declaration": true,
12
- "emitDeclarationOnly": true,
13
- "baseUrl": ".",
14
- "paths": {
15
- "@/*": ["./src/*"]
16
- }
17
- },
18
- "include": ["src/libs", "src/utils", "src/icons"]
19
- }
20
-
package/tsconfig.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "files": [],
3
- "references": [
4
- { "path": "./tsconfig.app.json" },
5
- { "path": "./tsconfig.node.json" }
6
- ]
7
- }
@@ -1,26 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
- "target": "ES2023",
5
- "lib": ["ES2023"],
6
- "module": "ESNext",
7
- "types": ["node"],
8
- "skipLibCheck": true,
9
-
10
- /* Bundler mode */
11
- "moduleResolution": "bundler",
12
- "allowImportingTsExtensions": true,
13
- "verbatimModuleSyntax": true,
14
- "moduleDetection": "force",
15
- "noEmit": true,
16
-
17
- /* Linting */
18
- "strict": true,
19
- "noUnusedLocals": true,
20
- "noUnusedParameters": true,
21
- "erasableSyntaxOnly": true,
22
- "noFallthroughCasesInSwitch": true,
23
- "noUncheckedSideEffectImports": true
24
- },
25
- "include": ["vite.config.ts"]
26
- }
package/vite.config.ts DELETED
@@ -1,103 +0,0 @@
1
- /// <reference types="vitest/config" />
2
- import { defineConfig } from 'vite';
3
- import react from '@vitejs/plugin-react';
4
- import dts from 'vite-plugin-dts';
5
- import tailwindcss from '@tailwindcss/vite';
6
-
7
- import path from 'node:path';
8
- import { fileURLToPath } from 'node:url';
9
-
10
- import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
11
- import { playwright } from '@vitest/browser-playwright';
12
-
13
- const dirname =
14
- typeof __dirname !== 'undefined'
15
- ? __dirname
16
- : path.dirname(fileURLToPath(import.meta.url));
17
-
18
- export default defineConfig(({ command }) => {
19
- // 在构建时禁用 React Compiler,避免运行时注入 require 导致的 ES 模块兼容性问题
20
- // React Compiler 应该在最终使用库的应用中运行
21
- const enableReactCompiler = command !== 'build';
22
- const isLibBuild = process.env.BUILD_LIB === 'true';
23
-
24
- return {
25
- plugins: [
26
- react({
27
- babel: {
28
- plugins: enableReactCompiler ? [['babel-plugin-react-compiler']] : [],
29
- },
30
- }),
31
-
32
- // ✅ 只在 dev / storybook 启用
33
- !isLibBuild && tailwindcss(),
34
-
35
- dts({
36
- entryRoot: './src/libs',
37
- tsconfigPath: './tsconfig.build.json',
38
- insertTypesEntry: true,
39
- rollupTypes: true,
40
- exclude: ['**/*.css', '**/style-entry.ts', '**/*.stories.tsx', '**/*.test.ts', '**/*.test.tsx'],
41
- }),
42
- ].filter(Boolean),
43
-
44
-
45
- resolve: {
46
- alias: {
47
- '@': path.resolve(dirname, './src'),
48
- },
49
- },
50
-
51
- build: {
52
- lib: {
53
- entry: {
54
- index: path.resolve(dirname, './src/libs/index.ts')
55
- },
56
- name: 'gemini-uis',
57
- formats: ['es'],
58
- fileName: () => 'index.js',
59
- },
60
- rollupOptions: {
61
- external: [
62
- 'react',
63
- 'react-dom',
64
- 'react/jsx-runtime',
65
- 'react/jsx-dev-runtime',
66
- ],
67
- output: {
68
- assetFileNames: (assetInfo) => {
69
- // 将所有 CSS 文件命名为 style.css
70
- if (assetInfo.name && assetInfo.name.endsWith('.css')) {
71
- return 'style.css';
72
- }
73
- return assetInfo.name || 'assets/[name]-[hash].[ext]';
74
- },
75
- },
76
- },
77
- cssCodeSplit: false,
78
- },
79
-
80
- test: {
81
- projects: [
82
- {
83
- extends: true,
84
- plugins: [
85
- storybookTest({
86
- configDir: path.join(dirname, '.storybook'),
87
- }),
88
- ],
89
- test: {
90
- name: 'storybook',
91
- browser: {
92
- enabled: true,
93
- headless: true,
94
- provider: playwright({}),
95
- instances: [{ browser: 'chromium' }],
96
- },
97
- setupFiles: ['.storybook/vitest.setup.ts'],
98
- },
99
- },
100
- ],
101
- },
102
- };
103
- });
package/vitest.shims.d.ts DELETED
@@ -1 +0,0 @@
1
- /// <reference types="@vitest/browser-playwright" />
File without changes