@chatsystem/client 1.1.15 → 1.1.16

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatsystem/client",
3
- "version": "1.1.15",
3
+ "version": "1.1.16",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -19,7 +19,7 @@
19
19
  "react-markdown": "^9.0.1",
20
20
  "react-transition-group": "^4.4.5",
21
21
  "rehype-raw": "^7.0.0",
22
- "vite-plugin-css-injected-by-js": "^3.4.0"
22
+ "vite-plugin-css-injected-by-js": "^3.5.2"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/node": "^20.11.20",
@@ -28,7 +28,7 @@
28
28
  "@types/react-transition-group": "^4.4.10",
29
29
  "@typescript-eslint/eslint-plugin": "^6.21.0",
30
30
  "@typescript-eslint/parser": "^6.21.0",
31
- "@vitejs/plugin-react-swc": "^3.7.0",
31
+ "@vitejs/plugin-react-swc": "^4.0.1",
32
32
  "eslint": "^8.56.0",
33
33
  "eslint-plugin-react-hooks": "^4.6.0",
34
34
  "eslint-plugin-react-refresh": "^0.4.5",
@@ -36,9 +36,9 @@
36
36
  "react-dom": "^18.2.0",
37
37
  "tailwindcss": "^3.4.17",
38
38
  "typescript": "^5.6.3",
39
- "vite": "^5.4.1",
40
- "vite-plugin-dts": "^4.0.3",
41
- "vite-plugin-svgr": "^4.2.0"
39
+ "vite": "^7.1.3",
40
+ "vite-plugin-dts": "^4.5.4",
41
+ "vite-plugin-svgr": "^4.3.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": "^18.2.0",
package/tsconfig.json CHANGED
@@ -1,5 +1,4 @@
1
1
  {
2
-
3
2
  "compilerOptions": {
4
3
  "target": "ES2020",
5
4
  "useDefineForClassFields": true,
@@ -8,25 +7,19 @@
8
7
  "skipLibCheck": true,
9
8
  "types": ["node"],
10
9
  "noImplicitAny": false,
11
-
12
- /* Bundler mode */
13
10
  "moduleResolution": "bundler",
14
11
  "allowImportingTsExtensions": true,
15
12
  "resolveJsonModule": true,
16
13
  "isolatedModules": true,
17
14
  "noEmit": true,
18
15
  "jsx": "react-jsx",
19
-
20
- /* Linting */
21
16
  "strict": true,
22
17
  "noUnusedLocals": true,
23
18
  "noUnusedParameters": true,
24
19
  "noFallthroughCasesInSwitch": true,
25
- "paths": {
26
- "@/*" : ["./src/*"]
27
- }
20
+ "paths": { "@/*": ["./src/*"] }
28
21
  },
29
- "include": ["./src", "tailwind.config.ts", "vite.config.ts"],
22
+ "include": ["./src"],
30
23
  "exclude": ["node_modules"],
31
24
  "references": [{ "path": "./tsconfig.node.json" }]
32
25
  }
@@ -1,12 +1,10 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "composite": true,
4
- "skipLibCheck": true,
5
- "module": "ESNext",
6
- "moduleResolution": "bundler",
7
- "allowSyntheticDefaultImports": true,
4
+ "module": "nodenext",
5
+ "moduleResolution": "nodenext",
6
+ "types": ["node"],
8
7
  "strict": true
9
8
  },
10
-
11
- "include": ["vite.config.ts"]
9
+ "include": ["vite.config.ts", "tailwind.config.ts", "vitest.config.ts"]
12
10
  }
package/vite.config.ts CHANGED
@@ -1,21 +1,36 @@
1
+ // vite.config.ts
1
2
  import { defineConfig } from "vite";
2
3
  import react from "@vitejs/plugin-react-swc";
3
4
  import path from "path";
4
5
  import dts from "vite-plugin-dts";
5
6
  import svgr from "vite-plugin-svgr";
6
- // Takes all css file and add it into js to get one single file
7
7
  import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
8
8
 
9
- // https://vitejs.dev/config/
10
9
  export default defineConfig({
11
10
  plugins: [
12
11
  react(),
13
12
  svgr(),
14
13
  cssInjectedByJsPlugin(),
15
14
  dts({
15
+ // good defaults for packages
16
+ insertTypesEntry: true,
16
17
  rollupTypes: true,
17
18
  }),
19
+ {
20
+ name: "debug-lottie-emit",
21
+ generateBundle(_, bundle) {
22
+ for (const [fileName, chunk] of Object.entries(bundle)) {
23
+ if (chunk.type === "asset" && fileName.endsWith(".lottie")) {
24
+ console.log(`[lottie] emitted -> ${fileName}`);
25
+ }
26
+ }
27
+ },
28
+ },
18
29
  ],
30
+
31
+ // allow importing .lottie as assets (you already import with ?url)
32
+ assetsInclude: ["**/*.lottie"],
33
+
19
34
  resolve: {
20
35
  alias: {
21
36
  "@": path.resolve(__dirname, "./src"),
@@ -23,18 +38,37 @@ export default defineConfig({
23
38
  },
24
39
 
25
40
  build: {
26
- manifest: true,
27
- minify: true,
28
- reportCompressedSize: true,
41
+ // Build the PACKAGE from the barrel (not main.tsx)
29
42
  lib: {
30
- entry: path.resolve(__dirname, "src/main.tsx"),
31
- fileName: "index",
43
+ entry: path.resolve(__dirname, "src/index.ts"),
32
44
  name: "bubbleChat",
33
- formats: ["es"],
45
+ // file name for each format
46
+ fileName: (format) =>
47
+ format === "es" ? "index.js" : `index.${format}.js`,
48
+ formats: ["es"], // add "iife" below if you also want a <script> build
34
49
  },
50
+ emitAssets: true,
51
+ sourcemap: true,
52
+ minify: true,
53
+ reportCompressedSize: true,
54
+ manifest: false, // usually not needed for a package
55
+ assetsInlineLimit: 0,
56
+
35
57
  rollupOptions: {
58
+ // keep React external for npm packages
36
59
  external: ["react", "react-dom"],
37
- plugins: [],
60
+ output: {
61
+ // place emitted assets; .lottie in its own folder
62
+ assetFileNames: (info) =>
63
+ info.name?.endsWith(".lottie")
64
+ ? "assets/lottie/[name].[hash][extname]"
65
+ : "assets/[name].[hash][extname]",
66
+ // used only if you also build iife/umd
67
+ globals: {
68
+ react: "React",
69
+ "react-dom": "ReactDOM",
70
+ },
71
+ },
38
72
  },
39
73
  },
40
74
  });
@@ -1,8 +0,0 @@
1
- {
2
- "src/main.tsx": {
3
- "file": "index.js",
4
- "name": "main",
5
- "src": "src/main.tsx",
6
- "isEntry": true
7
- }
8
- }
package/vite.config.d.ts DELETED
@@ -1,2 +0,0 @@
1
- declare const _default: import("vite").UserConfig;
2
- export default _default;
package/vite.config.js DELETED
@@ -1,38 +0,0 @@
1
- import { defineConfig } from "vite";
2
- import react from "@vitejs/plugin-react-swc";
3
- import path from "path";
4
- import dts from "vite-plugin-dts";
5
- import svgr from "vite-plugin-svgr";
6
- // Takes all css file and add it into js to get one single file
7
- import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
8
- // https://vitejs.dev/config/
9
- export default defineConfig({
10
- plugins: [
11
- react(),
12
- svgr(),
13
- cssInjectedByJsPlugin(),
14
- dts({
15
- rollupTypes: true,
16
- }),
17
- ],
18
- resolve: {
19
- alias: {
20
- "@": path.resolve(__dirname, "./src"),
21
- },
22
- },
23
- build: {
24
- manifest: true,
25
- minify: true,
26
- reportCompressedSize: true,
27
- lib: {
28
- entry: path.resolve(__dirname, "src/main.tsx"),
29
- fileName: "index",
30
- name: "bubbleChat",
31
- formats: ["es"],
32
- },
33
- rollupOptions: {
34
- external: ["react", "react-dom"],
35
- plugins: [],
36
- },
37
- },
38
- });