-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
459 additions
and
605 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@cyn/app': patch | ||
--- | ||
|
||
feat(electron): add custom main code support | ||
feat(electron): add "configure" action | ||
feat: improve display strings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,15 @@ | ||
// See the Electron documentation for details on how to use preload scripts: | ||
// https://www.electronjs.org/docs/latest/tutorial/process-model#preload-scripts | ||
const { contextBridge, ipcRenderer } = require('electron') | ||
|
||
// Expose a limited API to the renderer process | ||
contextBridge.exposeInMainWorld('electronAPI', { | ||
invoke: async (channel, data) => { | ||
try { | ||
return await ipcRenderer.invoke(channel, data) | ||
} catch (error) { | ||
console.error('IPC invocation error:', error) | ||
throw error | ||
} | ||
} | ||
}) | ||
|
||
console.log('Preload script loaded') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { createAction, createActionRunner } from '@cyn/plugin-core' | ||
import { ElectronConfiguration } from './model' | ||
|
||
export const props = createAction({ | ||
id: 'electron:configure', | ||
description: 'Configure electron', | ||
displayString: "'Configure Electron'", | ||
icon: '', | ||
meta: {}, | ||
name: 'Configure Electron', | ||
outputs: { | ||
configuration: { | ||
label: 'Configuration', | ||
value: {} as ElectronConfiguration | ||
} | ||
}, | ||
params: { | ||
electronVersion: { | ||
value: '', | ||
label: 'Electron version', | ||
description: 'The version of Electron to use', | ||
required: false, | ||
control: { | ||
type: 'input', | ||
options: { | ||
kind: 'text' | ||
} | ||
} | ||
}, | ||
customMainCode: { | ||
required: false, | ||
label: 'Custom main code', | ||
value: '', | ||
control: { | ||
type: 'path', | ||
options: { | ||
filters: [{ name: 'JavaScript', extensions: ['js'] }] | ||
}, | ||
label: 'Path to a file containing custom main code' | ||
} | ||
}, | ||
enableSteamSupport: { | ||
required: false, | ||
label: 'Enable steam support', | ||
value: false, | ||
control: { | ||
type: 'boolean' | ||
} | ||
} | ||
} | ||
}) | ||
|
||
export const configureRunner = createActionRunner<typeof props>(async ({ setOutput, inputs }) => { | ||
setOutput('configuration', { | ||
electronVersion: inputs.electronVersion, | ||
steamSupport: inputs.enableSteamSupport, | ||
customMainCode: inputs.customMainCode, | ||
}) | ||
}) |
Oops, something went wrong.