From c1dd28c2ee1dcdd1cc19f72d3e89ba6233e83063 Mon Sep 17 00:00:00 2001 From: Geoff McIntyre Date: Wed, 24 Jun 2026 16:36:23 -0600 Subject: [PATCH] Update to v0.1.1 --- package.json | 2 +- src/renderer/src/commands/fileCommands.ts | 17 ++++++++++++++++- src/renderer/src/components/StatusBar.tsx | 2 +- .../services/arduino/WebSocketArduinoService.ts | 12 ++++++++++++ 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7a7baa7..9409132 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tinystudio", - "version": "0.1.0", + "version": "0.1.1", "description": "An open-source desktop + web IDE for building, wiring, simulating, and flashing tiny hardware projects — code, circuit, and visual views in one place.", "main": "./out/main/index.js", "author": "MR.INDUSTRIES", diff --git a/src/renderer/src/commands/fileCommands.ts b/src/renderer/src/commands/fileCommands.ts index c1a786a..b7d97f4 100644 --- a/src/renderer/src/commands/fileCommands.ts +++ b/src/renderer/src/commands/fileCommands.ts @@ -281,6 +281,22 @@ export class LoadGitHubProjectCommand implements Command { ) } + const name = this.path ? this.path.split('/').pop()! : this.repo + + // Desktop: materialize the project to a real folder so arduino-cli (via + // tinyService) can read it from disk. The in-memory `mem://` path is not a + // real file path and can't be compiled/uploaded. The browser has no disk to + // write to, so it falls back to the virtual workspace (view/edit only; the + // Arduino service guards mem:// compile/upload with a clear message). + if (fileSystem.isElectron()) { + const dir = `${await window.api.app.getExamplesDir()}/${name}` + for (const [rel, content] of Object.entries(files)) { + await fileSystem.writeFile(`${dir}/${rel}`, content) + } + await new OpenWorkspaceCommand(dir).execute() + return + } + const root = `${VIRTUAL_PREFIX}${this.owner}/${this.repo}${this.path ? '/' + this.path : ''}` virtualFileSystem.clear(root) await virtualFileSystem.seed(root, files) @@ -291,7 +307,6 @@ export class LoadGitHubProjectCommand implements Command { const fsItems = await fileSystem.readDirectory(root, true) const fileItems = buildNestedStructure(fsItems) - const name = this.path ? this.path.split('/').pop()! : this.repo const workspace: Workspace = { id: crypto.randomUUID(), name, diff --git a/src/renderer/src/components/StatusBar.tsx b/src/renderer/src/components/StatusBar.tsx index deb05af..8ff98a1 100644 --- a/src/renderer/src/components/StatusBar.tsx +++ b/src/renderer/src/components/StatusBar.tsx @@ -85,7 +85,7 @@ export function StatusBar(): React.JSX.Element {

UTF-8

Arduino (C++)

-

tinyStudio 0.1.0 · alpha

+

tinyStudio 0.1.1 · alpha

) diff --git a/src/renderer/src/services/arduino/WebSocketArduinoService.ts b/src/renderer/src/services/arduino/WebSocketArduinoService.ts index ea963f9..7161c16 100644 --- a/src/renderer/src/services/arduino/WebSocketArduinoService.ts +++ b/src/renderer/src/services/arduino/WebSocketArduinoService.ts @@ -435,6 +435,12 @@ export class WebSocketArduinoService implements ArduinoService { throw new Error('Arduino client not initialized') } + if (workspacePath.startsWith('mem://')) { + const msg = + 'This example is open in the browser (in-memory) and has no folder on disk for the compiler. Open it in the desktop app, or save it to a local folder, to compile and upload.' + return { success: false, output: msg, errors: [{ message: msg, severity: 'fatal' }] } + } + // Compile the sketch console.log( `Starting compile operation for workspace: ${workspacePath}, FQBN: ${boardConfig.fqbn}` @@ -474,6 +480,12 @@ export class WebSocketArduinoService implements ArduinoService { throw new Error('Arduino client not initialized') } + if ((workspacePathOrBinary || '').startsWith('mem://')) { + const msg = + 'This example is open in the browser (in-memory) and has no folder on disk for the compiler. Open it in the desktop app, or save it to a local folder, to compile and upload.' + return { success: false, output: msg, error: msg } + } + // Upload the sketch console.log( `Starting upload operation to port: ${port}, FQBN: ${boardConfig.fqbn}, workspace: ${workspacePathOrBinary}`