Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 0155d34
Author: Quentin Goinaud <[email protected]>
Date:   Thu Nov 7 08:46:55 2024 +0100

    improvements
    add log support
    fix config loading
    fix step placeholder in parameter editor

commit fe3c8ce
Merge: 981ae15 79b1c37
Author: Quentin Goinaud <[email protected]>
Date:   Mon Oct 28 18:06:41 2024 +0100

    Merge branch 'main' into develop

commit 981ae15
Author: Quentin Goinaud <[email protected]>
Date:   Mon Oct 28 11:53:16 2024 +0100

    fix construct export multiple webgl errors

commit aa8659d
Author: Quentin Goinaud <[email protected]>
Date:   Mon Oct 28 11:42:13 2024 +0100

    fix tests

commit 49bdfd7
Author: Armaldio <[email protected]>
Date:   Sun Oct 27 11:33:54 2024 +0100

    bug fixes and improvements
    project validation
    add migrate file script
    remove logs

commit 6816c5e
Author: Quentin Goinaud <[email protected]>
Date:   Thu Oct 24 12:26:17 2024 +0200

    fix migration

commit 31241a3
Author: Quentin Goinaud <[email protected]>
Date:   Thu Oct 24 08:22:21 2024 +0200

    improve parameters edition

commit ad14c6a
Author: Armaldio <[email protected]>
Date:   Sun Oct 20 12:09:16 2024 +0200

    add more handlers
    improve editor

commit 1f0cf84
Author: Quentin Goinaud <[email protected]>
Date:   Sun Oct 20 08:21:39 2024 +0200

    improvements

commit ba0180d
Author: Quentin Goinaud <[email protected]>
Date:   Fri Oct 11 08:03:27 2024 +0200

    improvements

commit 7337cb5
Author: Quentin Goinaud <[email protected]>
Date:   Wed Oct 9 11:53:35 2024 +0200

    fixes

commit 93cf1ce
Author: Quentin Goinaud <[email protected]>
Date:   Mon Oct 7 08:13:33 2024 +0200

    bug fixes

commit 549ddec
Author: Quentin Goinaud <[email protected]>
Date:   Mon Oct 7 07:51:23 2024 +0200

    prompt improvements

commit b096da6
Author: Armaldio <[email protected]>
Date:   Sun Oct 6 12:09:05 2024 +0200

    param editor improvements
  • Loading branch information
Armaldio committed Nov 7, 2024
1 parent 79b1c37 commit 8945abe
Show file tree
Hide file tree
Showing 19 changed files with 524 additions and 129 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @pipelab/app

## 1.4.3

### Patch Changes

- improvements
add log support
fix config loading
fix step placeholder in parameter editor

## 1.4.1

### Patch Changes
Expand Down
17 changes: 8 additions & 9 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,13 @@ https://remixicon.com/
---

Tests:
✔ Switch securely from "editor" to "simple" + remember last editor @started(24-10-10 07:40) @done(24-10-24 07:33) @lasted(1w6d23h53m36s)
- View logs in realtime
- env (= copy variables)
- handle pipeline error gracefully
- display what happened in dialog
- handle steamworks

- prepare electron + install package
- process quickjs in webworker
☐ View logs in realtime: started
☐ env (= copy variables)
☐ handle pipeline error gracefully
☐ display what happened in dialog
☐ handle steamworks

☐ prepare electron + install package
☐ process quickjs in webworker


2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipelab/app",
"version": "1.4.2",
"version": "1.4.3",
"description": "-",
"main": ".vite/build/main.js",
"author": "Armaldio",
Expand Down
12 changes: 9 additions & 3 deletions src/main/handler-func.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { useLogger } from '@@/logger'
import { BrowserWindow } from 'electron'
import { usePluginAPI } from './api'
import { BlockCondition } from '@@/model'
import { HandleListenerSendFn } from './handlers'

const checkParams = (definitionParams: InputsDefinition, elementParams: Record<string, string>) => {
// get a list of all required params
Expand Down Expand Up @@ -46,7 +47,7 @@ const checkParams = (definitionParams: InputsDefinition, elementParams: Record<s
export const handleConditionExecute = async (
nodeId: string,
pluginId: string,
params: BlockCondition['params'],
params: BlockCondition['params']
// { send }: { send: HandleListenerSendFn<'condition:execute'> }
): Promise<End<'condition:execute'>> => {
const { plugins } = usePlugins()
Expand Down Expand Up @@ -116,7 +117,7 @@ export const handleActionExecute = async (
pluginId: string,
params: Record<string, string>,
mainWindow: BrowserWindow | undefined,
// { send }: { send: HandleListenerSendFn<'action:execute'> }
send: HandleListenerSendFn<'action:execute'>
): Promise<End<'action:execute'>> => {
const { plugins } = usePlugins()
const { logger } = useLogger()
Expand Down Expand Up @@ -160,7 +161,12 @@ export const handleActionExecute = async (
await node.runner({
inputs: resolvedInputs,
log: (...args) => {
logger().info(`[${node.node.name}]`, ...args)
const logArgs = [`[${node.node.name}]`, ...args]
logger().info(...logArgs)
send({
type: 'log',
data: logArgs
})
},
setOutput: (key, value) => {
outputs[key] = value
Expand Down
35 changes: 22 additions & 13 deletions src/main/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ export const registerIPCHandlers = () => {

const { canceled, filePath } = await dialog.showSaveDialog(mainWindow, value)

console.log('canceled', canceled)
console.log('filePath', filePath)

send({
type: 'end',
data: {
Expand Down Expand Up @@ -207,7 +210,7 @@ export const registerIPCHandlers = () => {

const mainWindow = BrowserWindow.fromWebContents(event.sender)

const result = await handleActionExecute(nodeId, pluginId, params, mainWindow)
const result = await handleActionExecute(nodeId, pluginId, params, mainWindow, send)

await send({
data: result,
Expand All @@ -231,13 +234,30 @@ export const registerIPCHandlers = () => {
})
})

const ensure = async (filesPath: string) => {
// create parent folder
await mkdir(dirname(filesPath), {
recursive: true
})

// ensure file exist
try {
await access(filesPath)
} catch {
// File doesn't exist, create it
await writeFile(filesPath, '{}') // json
}
}

handle('config:load', async (_, { send, value }) => {
const { config } = value

const userData = app.getPath('userData')

const filesPath = join(userData, 'config', config + '.json')

await ensure(filesPath)

let content = '{}'
try {
content = await readFile(filesPath, 'utf8')
Expand Down Expand Up @@ -265,18 +285,7 @@ export const registerIPCHandlers = () => {

const filesPath = join(userData, 'config', config + '.json')

// create parent folder
await mkdir(dirname(filesPath), {
recursive: true
})

// ensure file exist
try {
await access(filesPath)
} catch {
// File doesn't exist, create it
await writeFile(filesPath, '{}') // json
}
await ensure(filesPath)

await writeFile(filesPath, data, 'utf8')

Expand Down
Loading

0 comments on commit 8945abe

Please sign in to comment.