From d063598ba4205b00c19fe0c11dd3b9aa9eafcf4c Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Wed, 29 Jul 2026 09:24:09 +0530 Subject: [PATCH 1/2] refactor: Cleaner frontend packaging Instead of having separate JS package (repo/frontend/package.json) that is only ever consumed by this app's main package (repo/package.json) just merge them into main package. Feels like this structure is just copied since very early frappe-ui apps, but there's no need to do it? What am I missing? --- flow/hooks.py | 4 ++-- frontend/package.json | 24 ------------------- package.json | 21 +++++++++++++--- .../postcss.config.js => postcss.config.js | 0 .../tailwind.config.js => tailwind.config.js | 3 +-- frontend/vite.config.js => vite.config.js | 6 ++--- frontend/yarn.lock => yarn.lock | 0 7 files changed, 24 insertions(+), 34 deletions(-) delete mode 100644 frontend/package.json rename frontend/postcss.config.js => postcss.config.js (100%) rename frontend/tailwind.config.js => tailwind.config.js (97%) rename frontend/vite.config.js => vite.config.js (83%) rename frontend/yarn.lock => yarn.lock (100%) diff --git a/flow/hooks.py b/flow/hooks.py index 2049122..20cab37 100644 --- a/flow/hooks.py +++ b/flow/hooks.py @@ -7,8 +7,8 @@ export_python_type_annotations = True -# Vite-built (frontend/) AI panel bundle. Served directly from public/ — the -# /assets path bypasses the desk's esbuild pipeline. Run `yarn build` in frontend/. +# Vite-built (frontend/src) AI panel bundle. Served directly from public/ — the +# /assets path bypasses the desk's esbuild pipeline. Run `yarn build` in the app root. # /assets URLs get no cache-busting query from Frappe, so append ?v=: # the stable filename keeps the hook simple while a rebuild invalidates the cache. import os as _os diff --git a/frontend/package.json b/frontend/package.json deleted file mode 100644 index 3d2dacc..0000000 --- a/frontend/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "flow-panel", - "private": true, - "type": "module", - "version": "0.0.0", - "description": "AI assistant slide-in panel for the Frappe desk (frappe-ui)", - "scripts": { - "dev": "vite build --watch", - "build": "vite build" - }, - "dependencies": { - "frappe-ui": "1.0.0-beta.3", - "vue": "^3.5.13", - "vue-router": "^4.4.5" - }, - "devDependencies": { - "@vitejs/plugin-vue": "^5.2.1", - "autoprefixer": "^10.4.20", - "postcss": "^8.4.49", - "postcss-prefix-selector": "^2.1.1", - "tailwindcss": "^3.4.17", - "vite": "^5.4.11" - } -} diff --git a/package.json b/package.json index 006eb5b..cd38945 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,23 @@ { + "name": "flow", "private": true, + "type": "module", + "description": "AI assistant slide-in panel for the Frappe desk (frappe-ui)", "scripts": { - "postinstall": "cd frontend && yarn install", - "dev": "cd frontend && yarn dev", - "build": "cd frontend && yarn build" + "dev": "vite build --watch", + "build": "vite build" + }, + "dependencies": { + "frappe-ui": "1.0.0-beta.3", + "vue": "^3.5.13", + "vue-router": "^4.4.5" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^5.2.1", + "autoprefixer": "^10.4.20", + "postcss": "^8.4.49", + "postcss-prefix-selector": "^2.1.1", + "tailwindcss": "^3.4.17", + "vite": "^5.4.11" } } diff --git a/frontend/postcss.config.js b/postcss.config.js similarity index 100% rename from frontend/postcss.config.js rename to postcss.config.js diff --git a/frontend/tailwind.config.js b/tailwind.config.js similarity index 97% rename from frontend/tailwind.config.js rename to tailwind.config.js index db7fa3d..3306b9b 100644 --- a/frontend/tailwind.config.js +++ b/tailwind.config.js @@ -9,8 +9,7 @@ export default { // Tailwind v3 ignores `content` declared inside presets, so the frappe-ui // source globs must be listed here for its component classes to be emitted. content: [ - "./index.html", - "./src/**/*.{vue,js}", + "./frontend/src/**/*.{vue,js}", "./node_modules/frappe-ui/src/components/**/*.{vue,js,ts}", "./node_modules/frappe-ui/src/composables/**/*.{vue,js,ts}", "./node_modules/frappe-ui/src/utils/**/*.{vue,js,ts}", diff --git a/frontend/vite.config.js b/vite.config.js similarity index 83% rename from frontend/vite.config.js rename to vite.config.js index c934ba1..d2d3682 100644 --- a/frontend/vite.config.js +++ b/vite.config.js @@ -16,7 +16,7 @@ export default defineConfig({ plugins: [vue()], resolve: { alias: [ - { find: "@", replacement: fileURLToPath(new URL("./src", import.meta.url)) }, + { find: "@", replacement: fileURLToPath(new URL("./frontend/src", import.meta.url)) }, // frappe-ui's package `exports` map hides its source; alias it so we can import // individual components without dragging in the whole index (tiptap, echarts, …). { @@ -28,13 +28,13 @@ export default defineConfig({ ], }, build: { - outDir: fileURLToPath(new URL("../flow/public/flow_panel", import.meta.url)), + outDir: fileURLToPath(new URL("./flow/public/flow_panel", import.meta.url)), emptyOutDir: true, cssCodeSplit: false, sourcemap: false, target: "es2017", lib: { - entry: fileURLToPath(new URL("./src/main.js", import.meta.url)), + entry: fileURLToPath(new URL("./frontend/src/main.js", import.meta.url)), formats: ["iife"], name: "FlowPanel", fileName: () => "flow_panel.js", diff --git a/frontend/yarn.lock b/yarn.lock similarity index 100% rename from frontend/yarn.lock rename to yarn.lock From d2e0f1405b8ce3ef1e29a1cc60d893d80457cee1 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Wed, 29 Jul 2026 09:40:42 +0530 Subject: [PATCH 2/2] ci: fix commitlint conf --- commitlint.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commitlint.config.js b/commitlint.config.js index 0c582f5..2b23e6a 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1,4 +1,4 @@ -module.exports = { +export default { parserPreset: "conventional-changelog-conventionalcommits", rules: { "subject-empty": [2, "never"],