Skip to content

Commit

Permalink
bug fixes & improvements
Browse files Browse the repository at this point in the history
c3: add custom timeout option for export
c3: improve error handling
c3: handle deprecated features
c3: disable offline support

electron: fix binaries not running when asar packaging disabled
electron: add native fullscreen toggle
electron: add ProjectFiles direct path ("ProjectFilesFolder" expression)
  • Loading branch information
Armaldio committed Jan 10, 2025
1 parent f79738e commit 5dab2f0
Show file tree
Hide file tree
Showing 12 changed files with 2,806 additions and 2,475 deletions.
16 changes: 16 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,19 @@ Tests:
☐ handle pipeline error gracefully
☐ display what happened in dialog
☐ process quickjs in webworker

New version of the c3 export addons for improved version selection
Edge case: old version of the app vs new version of c3p
Activate save only when needed
Active cancel button to not be locked out
Simple mode: also allow to pick variables & such
QuickJS: memory leak, open close action
Add own timers for electorn export & such
si tu appuies sur New Project, puis que tu selectionne direct le dropdown pour choisir Local/Cloud, ça ferme le popup et c'est impossible de rappuyer sur New Project
C3 Preview ne fonctionne pas
Steam achievement test c3 example
Itch plugin
Filesystem plugin: overwrite parameter + better sentences/descriptions

Convert dektop app to web app + node backend
Communication via rest api (for now) or websocket
5 changes: 3 additions & 2 deletions assets/electron/template/app/forge.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ module.exports = {
[FuseV1Options.EnableCookieEncryption]: true,
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
[FuseV1Options.EnableNodeCliInspectArguments]: false,
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
[FuseV1Options.OnlyLoadAppFromAsar]: true
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]:
config.disableAsarPackaging === true ? false : true,
[FuseV1Options.OnlyLoadAppFromAsar]: config.disableAsarPackaging === true ? false : true
}),
new PipelabPlugin()
]
Expand Down
2 changes: 1 addition & 1 deletion assets/electron/template/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@electron-forge/plugin-auto-unpack-natives": "7.4.0",
"@electron-forge/plugin-fuses": "7.4.0",
"@electron/fuses": "1.8.0",
"@pipelab/core": "1.3.2",
"@pipelab/core": "1.3.3",
"electron": "32.1.2"
},
"keywords": [],
Expand Down
642 changes: 259 additions & 383 deletions assets/electron/template/app/pnpm-lock.yaml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions assets/electron/template/app/src/handlers/user/folder.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { app } from 'electron'
import { join } from 'path';

/**
* @param {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessagePaths, 'input'>} json
Expand All @@ -14,6 +15,8 @@ export default (json, ws, mainWindow) => {

if (name === 'app') {
folder = app.getAppPath();
} else if (name === 'project') {
folder = join(app.getAppPath(), 'src', 'app'); // path to construct files
} else {
folder = app.getPath(name);
}
Expand Down
27 changes: 27 additions & 0 deletions assets/electron/template/app/src/handlers/window/set-fullscreen.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* @param {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageSetFullscreen, 'input'>} json
* @param {import('ws').WebSocket} ws
* @param {import('electron').BrowserWindow} mainWindow
*/
export default async (json, ws, mainWindow) => {
if (json.body.value === 'fullscreen') {
mainWindow.setFullScreen(true)
} else if (json.body.value === 'normal') {
mainWindow.setFullScreen(false)
} else {
throw new Error('Unsupported value ')
}

/**
* @type {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageSetFullscreen, 'output'>}
*/
const showsetFullscreenResult = {
correlationId: json.correlationId,
url: json.url,
body: {
success: true
}
}
console.log('result', showsetFullscreenResult)
ws.send(JSON.stringify(showsetFullscreenResult));
}
23 changes: 14 additions & 9 deletions assets/electron/template/app/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-check

import { app, BrowserWindow, ipcMain, session } from 'electron'
import { app, BrowserWindow, ipcMain } from 'electron'
import { join } from 'node:path'
// @ts-expect-error no types
import serve from 'serve-handler'
Expand Down Expand Up @@ -38,6 +38,7 @@ import windowSetX from './handlers/window/set-x.js'
import windowSetY from './handlers/window/set-y.js'
import windowShowDevTools from './handlers/window/show-dev-tools.js'
import windowUnmaximize from './handlers/window/unmaximize.js'
import windowSetFullscreen from './handlers/window/set-fullscreen.js'

// dialog
import dialogFolder from './handlers/dialog/folder.js'
Expand Down Expand Up @@ -216,6 +217,9 @@ const createAppServer = (mainWindow) => {
case '/window/unmaximize':
await windowUnmaximize(json, ws, mainWindow)
break
case '/window/set-fullscreen':
await windowSetFullscreen(json, ws, mainWindow)
break
case '/engine':
await engine(json, ws, mainWindow)
break
Expand Down Expand Up @@ -299,14 +303,15 @@ const createWindow = async () => {
mainWindow.setMenu(null)
}

try {
// Clear service workers to prevent old versions of the app
await session.defaultSession.clearStorageData({
storages: ['serviceworkers']
})
} catch (e) {
console.error('Error clearing service workers', e)
}
// It's better to export apps without service worker support
// try {
// // Clear service workers to prevent old versions of the app
// await session.defaultSession.clearStorageData({
// storages: ['serviceworkers']
// })
// } catch (e) {
// console.error('Error clearing service workers', e)
// }

if (argUrl) {
console.log('argUrl', argUrl)
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"url": "https://github.com/CynToolkit/pipelab.git"
},
"homepage": "https://pipelayn.com",
"packageManager": "pnpm@9.12.0",
"packageManager": "pnpm@9.15.3",
"scripts": {
"format": "prettier --write .",
"lint": "eslint .",
Expand Down Expand Up @@ -38,7 +38,7 @@
"migrate-file": "pnpm tsx scripts/migrate-file.mts"
},
"dependencies": {
"@changesets/cli": "2.27.9",
"@changesets/cli": "2.27.11",
"@codemirror/autocomplete": "6.18.1",
"@codemirror/commands": "6.6.2",
"@codemirror/lang-liquid": "6.2.1",
Expand All @@ -49,7 +49,7 @@
"@electron-toolkit/utils": "3.0.0",
"@floating-ui/vue": "1.1.5",
"@jitl/quickjs-wasmfile-release-sync": "0.31.0",
"@pipelab/core": "1.3.2",
"@pipelab/core": "1.3.3",
"@primevue/themes": "4.1.1",
"@sentry/electron": "5.4.0",
"@sentry/vue": "8.32.0",
Expand Down
Loading

0 comments on commit 5dab2f0

Please sign in to comment.