fubi 1.0.0-beta.2 → 1.0.0-beta.3

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/demo/index.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1">
7
7
  <title>Document</title>
8
8
  <script type="module">
9
- import { fubi } from "fubi";
9
+ import fubi from "fubi";
10
10
  fubi("lqwmo71n75ihvyj");
11
11
  </script>
12
12
  <style>
package/package.json CHANGED
@@ -2,20 +2,20 @@
2
2
  "name": "fubi",
3
3
  "description": "A lightweight, universal in-page feedback and collaboration tool for web applications. ",
4
4
  "author": "Wonder Makers",
5
- "version": "1.0.0-beta.2",
5
+ "version": "1.0.0-beta.3",
6
6
  "homepage": "https://fubi.dev",
7
7
  "type": "module",
8
- "main": "./dist/index.js",
9
- "module": "./dist/index.js",
10
8
  "types": "./dist/index.d.ts",
9
+ "main": "./dist/index.es.js",
10
+ "module": "./dist/index.es.js",
11
11
  "exports": {
12
12
  ".": {
13
13
  "types": "./dist/index.d.ts",
14
- "import": "./dist/index.js"
14
+ "import": "./dist/index.es.js"
15
15
  }
16
16
  },
17
17
  "scripts": {
18
- "dev": "concurrently \"vite build --watch\" \"wait-on dist/index.js && cd demo && vite --host\"",
18
+ "dev": "concurrently \"vite build --watch\" \"wait-on dist/index.es.js && cd demo && vite --host\"",
19
19
  "build": "tsc && vite build",
20
20
  "typecheck": "tsc --noEmit",
21
21
  "pub": "bun run publish.js",
@@ -23,22 +23,23 @@
23
23
  "lint": "prettier --check ."
24
24
  },
25
25
  "devDependencies": {
26
+ "@hugeicons-pro/core-bulk-rounded": "^1.0.17",
27
+ "@hugeicons-pro/core-duotone-rounded": "^1.1.0",
28
+ "@hugeicons-pro/core-solid-rounded": "^1.0.17",
29
+ "@hugeicons-pro/core-stroke-rounded": "^1.0.17",
30
+ "@hugeicons-pro/core-stroke-standard": "^1.0.17",
26
31
  "@sveltejs/vite-plugin-svelte": "^4.0.4",
32
+ "@tailwindcss/vite": "^4.1.13",
27
33
  "@types/node": "^20.19.17",
28
34
  "astro": "^4.16.19",
29
35
  "concurrently": "^9.2.1",
30
36
  "prettier": "^3.4.2",
31
37
  "prettier-plugin-svelte": "^3.3.3",
32
38
  "svelte": "^5.39.6",
39
+ "tailwindcss": "^4.1.13",
40
+ "terser": "^5.44.0",
33
41
  "typescript": "^5.9.2",
34
42
  "vite": "^5.4.20",
35
- "@hugeicons-pro/core-bulk-rounded": "^1.0.17",
36
- "@hugeicons-pro/core-duotone-rounded": "^1.1.0",
37
- "@hugeicons-pro/core-solid-rounded": "^1.0.17",
38
- "@hugeicons-pro/core-stroke-rounded": "^1.0.17",
39
- "@hugeicons-pro/core-stroke-standard": "^1.0.17",
40
- "@tailwindcss/vite": "^4.1.13",
41
- "tailwindcss": "^4.1.13",
42
43
  "wait-on": "^8.0.5"
43
44
  },
44
45
  "dependencies": {
@@ -50,9 +51,6 @@
50
51
  "runed": "^0.34.0",
51
52
  "tailwindcss-animate": "^1.0.7"
52
53
  },
53
- "bin": {
54
- "fubi": "./dist/index.js"
55
- },
56
54
  "keywords": [
57
55
  "feedback",
58
56
  "collaboration",
package/src/index.ts CHANGED
@@ -5,7 +5,7 @@ import App from "./components/App.svelte";
5
5
  import styles from "./styles/styles.css?inline";
6
6
  import stylesGlobal from "./styles/global.css?inline";
7
7
 
8
- export const fubi = (projectId: string) => {
8
+ export default function fubi(projectId: string) {
9
9
  // check if projectId provided if not throw error
10
10
  if (!projectId) {
11
11
  throw new Error("Please provide a projectId");
@@ -25,4 +25,4 @@ export const fubi = (projectId: string) => {
25
25
  document.head.insertAdjacentHTML("beforeend", `<style id="fubi-global-styles">${stylesGlobal}</style>`);
26
26
 
27
27
  mount(App, { target: wrapper, props: { projectId, wrapper } });
28
- };
28
+ }
package/vite.config.ts CHANGED
@@ -14,13 +14,34 @@ export default defineConfig({
14
14
  },
15
15
  build: {
16
16
  lib: {
17
- entry: {
18
- index: resolve(__dirname, "src/index.ts"),
17
+ entry: resolve(__dirname, "src/index.ts"),
18
+ name: "fubi",
19
+ formats: ["es", "iife"],
20
+ fileName: (format) => `index.${format}.js`,
21
+ },
22
+ minify: "terser",
23
+ terserOptions: {
24
+ compress: {
25
+ drop_console: true,
26
+ drop_debugger: true,
27
+ pure_funcs: ["console.log"],
28
+ passes: 2,
29
+ },
30
+ mangle: {
31
+ toplevel: true,
19
32
  },
20
- formats: ["es"],
21
33
  },
22
34
  rollupOptions: {
23
35
  external: ["vite", "pocketbase"],
36
+ output: {
37
+ inlineDynamicImports: true,
38
+ exports: "default",
39
+ manualChunks: undefined,
40
+ },
41
+ treeshake: {
42
+ preset: "smallest",
43
+ moduleSideEffects: false,
44
+ },
24
45
  },
25
46
  },
26
47
  resolve: {