-
Notifications
You must be signed in to change notification settings - Fork 1
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
6 changed files
with
609 additions
and
0 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/_build* | ||
/node_modules | ||
*-dev*.wasm |
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,32 @@ | ||
{ | ||
"version": "0.2.0", | ||
"compounds": [ | ||
{ | ||
"name": "Main + renderer", | ||
"configurations": ["Main", "Renderer"], | ||
"stopAll": true | ||
} | ||
], | ||
"configurations": [ | ||
{ | ||
"name": "Renderer", | ||
"port": 9222, | ||
"request": "attach", | ||
"type": "chrome", | ||
"webRoot": "${workspaceFolder}" | ||
}, | ||
{ | ||
"name": "Main", | ||
"type": "node", | ||
"request": "launch", | ||
"cwd": "${workspaceFolder}", | ||
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron", | ||
"windows": { | ||
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd" | ||
}, | ||
"args": [".", "--remote-debugging-port=9222"], | ||
"outputCapture": "std", | ||
"console": "integratedTerminal" | ||
} | ||
] | ||
} |
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,32 @@ | ||
// 版权 @2024 凹语言 作者。保留所有权利。 | ||
|
||
const { app, BrowserWindow } = require('electron/main') | ||
const path = require('node:path') | ||
|
||
const createWindow = () => { | ||
const win = new BrowserWindow({ | ||
width: 800, | ||
height: 600, | ||
webPreferences: { | ||
preload: path.join(__dirname, 'preload.js') | ||
} | ||
}) | ||
|
||
win.loadFile('index.html') | ||
} | ||
|
||
app.whenReady().then(() => { | ||
createWindow() | ||
|
||
app.on('activate', () => { | ||
if (BrowserWindow.getAllWindows().length === 0) { | ||
createWindow() | ||
} | ||
}) | ||
}) | ||
|
||
app.on('window-all-closed', () => { | ||
if (process.platform !== 'darwin') { | ||
app.quit() | ||
} | ||
}) |
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,15 @@ | ||
{ | ||
"name": "wa-playground-app", | ||
"version": "1.0.0", | ||
"description": "凹语言 Playground!", | ||
"main": "main.js", | ||
"scripts": { | ||
"start": "electron . --disable-gpu", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "凹语言开发组", | ||
"license": "AGPL-3.0-only", | ||
"devDependencies": { | ||
"electron": "^32.0.1" | ||
} | ||
} |
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,11 @@ | ||
// 版权 @2024 凹语言 作者。保留所有权利。 | ||
|
||
const { contextBridge } = require('electron') | ||
|
||
contextBridge.exposeInMainWorld('versions', { | ||
node: () => process.versions.node, | ||
chrome: () => process.versions.chrome, | ||
electron: () => process.versions.electron, | ||
waWasmZipUrl: () => 'https://wa-lang.org/wa/wa-js/wa.wasm.zip' | ||
// we can also expose variables, not just functions | ||
}) |
Oops, something went wrong.