Default product.json for enabling Electron builds (#323)
This commit is contained in:
parent
300a98b858
commit
fa3e33dab9
2
clients/electron/.gitignore
vendored
2
clients/electron/.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
node_modules
|
||||
projects
|
@ -1,5 +0,0 @@
|
||||
# PXT micro:bit Electron app
|
||||
|
||||
A very basic wrapper around the web app. To install, copy the contents of this
|
||||
directory to somewhere outside the main `pxt-microbit` repository. Then run `npm
|
||||
install && npm start`.
|
@ -1,15 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>code the micro:bit</title>
|
||||
</head>
|
||||
<body>
|
||||
<webview id="webview" style="position:absolute; left:0; top:0; right:0; bottom:0"/>
|
||||
<script>
|
||||
const webview = document.getElementById("webview")
|
||||
const url = `http://localhost:3232/${window.location.hash}`
|
||||
webview.src = url
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,39 +0,0 @@
|
||||
const {app, BrowserWindow, Menu} = require('electron')
|
||||
const pxt = require('pxt-core')
|
||||
const path = require('path')
|
||||
|
||||
let win
|
||||
|
||||
const cliPath = path.join(process.cwd(), "node_modules/pxt-microbit")
|
||||
|
||||
function startServerAndCreateWindow() {
|
||||
pxt.mainCli(cliPath, ["serve", "-no-browser"])
|
||||
createWindow()
|
||||
}
|
||||
|
||||
function createWindow () {
|
||||
win = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
title: "code the micro:bit"
|
||||
})
|
||||
Menu.setApplicationMenu(null)
|
||||
win.loadURL(`file://${__dirname}/index.html#local_token=${pxt.globalConfig.localToken}`)
|
||||
win.on('closed', () => {
|
||||
win = null
|
||||
})
|
||||
}
|
||||
|
||||
app.on('ready', startServerAndCreateWindow)
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', () => {
|
||||
if (win === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
@ -1,14 +0,0 @@
|
||||
{
|
||||
"name" : "code-the-microbit",
|
||||
"version" : "1.0.0",
|
||||
"description": "Blocks / Javascript editor",
|
||||
"author": "Microsoft",
|
||||
"main" : "main.js",
|
||||
"scripts": {
|
||||
"start": "node_modules/.bin/electron ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "*",
|
||||
"pxt-microbit": "*"
|
||||
}
|
||||
}
|
14
electron/product.json
Normal file
14
electron/product.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"applicationName": "pxt-microbit-oss",
|
||||
"dataFolderName": ".pxt-microbit-oss",
|
||||
"darwinBundleIdentifier": "com.microsoft.pxtoss",
|
||||
"nameShort": "PXT Microbit - OSS",
|
||||
"nameLong": "PXT Microbit - OSS",
|
||||
"targetId": "pxt-microbit",
|
||||
"win32AppId": "{{92db071a-6f58-4938-8c97-13c873f4da13}",
|
||||
"win32AppUserModelId": "Microsoft.PXTMicrobitOss",
|
||||
"win32DirName": "Microsoft PXT-Microbit - OSS",
|
||||
"win32MutexName": "pxtmicrobitoss",
|
||||
"win32NameVersion": "Microsoft PXT-Microbit-OSS",
|
||||
"win32RegValueName": "PXTMicrobitOss"
|
||||
}
|
Loading…
Reference in New Issue
Block a user