From e9b65f6af842f8171fb79afbf7dc0c9163a51f54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Kerti?= <47832952+kkerti@users.noreply.github.com> Date: Wed, 24 Jun 2026 20:46:32 +0200 Subject: [PATCH 1/5] kk added files to schema, file save preparation looks fine --- package-lock.json | 42 ---------------------------------- src/lib/schemas.ts | 9 ++++++++ src/routes/EditorLayout.svelte | 2 ++ vite.postbuild.ts | 2 ++ 4 files changed, 13 insertions(+), 42 deletions(-) diff --git a/package-lock.json b/package-lock.json index 545122e..d8c305c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3263,18 +3263,6 @@ "dev": true, "license": "ISC" }, - "node_modules/jiti": { - "version": "1.21.7", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz", - "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "bin": { - "jiti": "bin/jiti.js" - } - }, "node_modules/js-yaml": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", @@ -4240,21 +4228,6 @@ } } }, - "node_modules/svelte-check/node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/svelte-check/node_modules/readdirp": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", @@ -4825,21 +4798,6 @@ "node": ">=10" } }, - "node_modules/yaml": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", - "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", - "dev": true, - "license": "ISC", - "optional": true, - "peer": true, - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14.6" - } - }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", diff --git a/src/lib/schemas.ts b/src/lib/schemas.ts index f58dae3..cd1b652 100644 --- a/src/lib/schemas.ts +++ b/src/lib/schemas.ts @@ -2,6 +2,14 @@ import { ElementType, ModuleType } from "@intechstudio/grid-protocol"; import { Timestamp } from "firebase/firestore"; import { z } from "zod"; +export const ConfigFileSchema = z.object({ + name: z.string(), + content: z.string(), + mimeType: z.string().optional(), +}); + +export type ConfigFile = z.infer; + export const BaseConfigSchema = z.object({ id: z.string(), modifiedAt: z.coerce.date().default(new Date()), @@ -27,6 +35,7 @@ export const BaseConfigSchema = z.object({ virtualPath: z.string().optional(), temporaryGraphPath: z.string().optional(), displayName: z.string().optional(), + files: z.array(ConfigFileSchema).optional(), }); export type BaseConfig = z.infer; diff --git a/src/routes/EditorLayout.svelte b/src/routes/EditorLayout.svelte index 9208e5c..b9b9f01 100644 --- a/src/routes/EditorLayout.svelte +++ b/src/routes/EditorLayout.svelte @@ -154,6 +154,8 @@ }); configResponse.data.name = name; + console.log("[WCPC] This is what we got from editor", configResponse.data) + const config = BaseConfigSchema.parse(configResponse.data); config.createdAt = new Date(); const cm = get(config_manager); diff --git a/vite.postbuild.ts b/vite.postbuild.ts index c862716..c3084a0 100644 --- a/vite.postbuild.ts +++ b/vite.postbuild.ts @@ -6,6 +6,7 @@ export function notifyEditorAfterBuildPlugin(): PluginOption { name: "postbuild-notify-editor", closeBundle: () => new Promise((resolve) => { + console.log("notify start") if ( process.env.WEB_COMPONENT_NAME && process.env.WEB_COMPONENT_NAME != "profile-cloud-dev" @@ -19,6 +20,7 @@ export function notifyEditorAfterBuildPlugin(): PluginOption { }, 3000); let ws = new WebSocket("ws://localhost:9000"); ws.on("open", () => { + console.log("Websocket message sent!") ws.send( JSON.stringify({ type: "developer-package", From a25d8ebcb363ac08e6ac49c75a75a98f039b869d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Kerti?= <47832952+kkerti@users.noreply.github.com> Date: Wed, 24 Jun 2026 20:50:43 +0200 Subject: [PATCH 2/5] kk query only fields requested by workflows site, avoid excessive network requests with files --- functions/src/publicCloudQueries.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/functions/src/publicCloudQueries.ts b/functions/src/publicCloudQueries.ts index 3dc9b66..1179362 100644 --- a/functions/src/publicCloudQueries.ts +++ b/functions/src/publicCloudQueries.ts @@ -7,6 +7,24 @@ const intechstudioApiKey = defineSecret("X_INTECHSTUDIO_KEY"); admin.initializeApp(); const db = admin.firestore(); +const publicProfileFields = [ + "id", + "modifiedAt", + "createdAt", + "name", + "description", + "type", + "version", + "configType", + "configs", + "owner", + "virtualPath", + "temporaryGraphPath", + "displayName", + "access", + "public", +] as const; + // Helper function to validate API key function validateApiKey( req: Request, @@ -40,6 +58,7 @@ export const readAllProfiles = onRequest( } db.collection("configs") + .select(...publicProfileFields) .where("public", "==", true) .get() .then((snapshot) => { @@ -66,6 +85,7 @@ export const readUserProfiles = onRequest( } db.collection("configs") + .select(...publicProfileFields) .where("owner", "==", userId) .where("public", "==", true) .get() @@ -91,6 +111,7 @@ export const readSingleProfile = onRequest( console.log(profileId); db.collection("configs") + .select(...publicProfileFields) .where("id", "==", profileId) .where("public", "==", true) .get() From c3a4a4ca4ee3dc4f688afd31a0966795ffca1334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Kerti?= <47832952+kkerti@users.noreply.github.com> Date: Fri, 26 Jun 2026 15:36:40 +0200 Subject: [PATCH 3/5] kk prototype for listing files on product card --- package-lock.json | 8 ++++---- package.json | 2 +- src/routes/ConfigCardDisplay.svelte | 25 ++++++++++++++++++++++++- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index d8c305c..3387218 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.1", "dependencies": { "@intechstudio/grid-protocol": "1.20250305.1735", - "@intechstudio/grid-uikit": "^1.20260206.1447", + "@intechstudio/grid-uikit": "^1.20260626.1305", "@melt-ui/svelte": "^0.86.6", "firebase": "^12.2.1", "marked": "^12.0.2", @@ -1252,9 +1252,9 @@ "integrity": "sha512-pAnLVlkiAk8zz+yBc99TdeUiH2wXPuNwWb0ZBgqcqtcIT8bUh7zMY2s7ll0KQsI9HsVP/3IwB2htNHCyNIWCsg==" }, "node_modules/@intechstudio/grid-uikit": { - "version": "1.20260206.1447", - "resolved": "https://registry.npmjs.org/@intechstudio/grid-uikit/-/grid-uikit-1.20260206.1447.tgz", - "integrity": "sha512-nYBE1IvL0ZnlMMsdc5WEtKWX5d0gdS9G64t4bPVqxk90Lv4tMLipPQaJNNeM02MEEYz2U5jQOImzTPpHfsDxJw==", + "version": "1.20260626.1305", + "resolved": "https://registry.npmjs.org/@intechstudio/grid-uikit/-/grid-uikit-1.20260626.1305.tgz", + "integrity": "sha512-obTptIp9E87S02LyK76VGf2vusiWg1ZxxxfD5XPfEwoXt0fpzd+mMmlK4LtKaTciDmakq+Mofb45biRkslkHYA==", "dependencies": { "@melt-ui/svelte": "^0.86.6", "color-convert": "^2.0.1", diff --git a/package.json b/package.json index d8bf74a..33a1976 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "type": "module", "dependencies": { "@intechstudio/grid-protocol": "1.20250305.1735", - "@intechstudio/grid-uikit": "^1.20260206.1447", + "@intechstudio/grid-uikit": "^1.20260626.1305", "@melt-ui/svelte": "^0.86.6", "firebase": "^12.2.1", "marked": "^12.0.2", diff --git a/src/routes/ConfigCardDisplay.svelte b/src/routes/ConfigCardDisplay.svelte index 5bec184..d99c8a9 100644 --- a/src/routes/ConfigCardDisplay.svelte +++ b/src/routes/ConfigCardDisplay.svelte @@ -165,7 +165,6 @@ }); }} /> - Folder: + {#if data.files && data.files.length > 0} + Files: + +
+ {#each data.files as file} +
+
+ + {file.name} +
+
+ {new TextEncoder().encode(file.content).length}b +
+
+ {/each} +
+
+ {/if}
diff --git a/src/routes/EditorLayout.svelte b/src/routes/EditorLayout.svelte index b9b9f01..2f5d374 100644 --- a/src/routes/EditorLayout.svelte +++ b/src/routes/EditorLayout.svelte @@ -154,7 +154,10 @@ }); configResponse.data.name = name; - console.log("[WCPC] This is what we got from editor", configResponse.data) + console.log( + "[WCPC] This is what we got from editor", + configResponse.data, + ); const config = BaseConfigSchema.parse(configResponse.data); config.createdAt = new Date(); diff --git a/vite.postbuild.ts b/vite.postbuild.ts index c3084a0..c0b81c4 100644 --- a/vite.postbuild.ts +++ b/vite.postbuild.ts @@ -6,7 +6,7 @@ export function notifyEditorAfterBuildPlugin(): PluginOption { name: "postbuild-notify-editor", closeBundle: () => new Promise((resolve) => { - console.log("notify start") + console.log("notify start"); if ( process.env.WEB_COMPONENT_NAME && process.env.WEB_COMPONENT_NAME != "profile-cloud-dev" @@ -20,7 +20,7 @@ export function notifyEditorAfterBuildPlugin(): PluginOption { }, 3000); let ws = new WebSocket("ws://localhost:9000"); ws.on("open", () => { - console.log("Websocket message sent!") + console.log("Websocket message sent!"); ws.send( JSON.stringify({ type: "developer-package", From 7ae8a301a0470713d49389df636bfdb59145c055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Kerti?= <47832952+kkerti@users.noreply.github.com> Date: Tue, 7 Jul 2026 17:42:54 +0200 Subject: [PATCH 5/5] kk update wording and profile overwrite to support files --- src/routes/ConfigCardDisplay.svelte | 2 +- src/routes/EditorLayout.svelte | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/ConfigCardDisplay.svelte b/src/routes/ConfigCardDisplay.svelte index c4776ef..1366237 100644 --- a/src/routes/ConfigCardDisplay.svelte +++ b/src/routes/ConfigCardDisplay.svelte @@ -185,7 +185,7 @@ - + diff --git a/src/routes/EditorLayout.svelte b/src/routes/EditorLayout.svelte index 2f5d374..b872bfd 100644 --- a/src/routes/EditorLayout.svelte +++ b/src/routes/EditorLayout.svelte @@ -212,6 +212,7 @@ type: editorConfig.type, version: editorConfig.version, configType: editorConfig.configType, + files: editorConfig?.files, }; if (newConfig.type !== config.type) {
FilesPage files for File Manager Size