This commit is contained in:
wataru okada 2023-01-28 05:26:52 +09:00
parent 009b142fc0
commit 5f885d9e21
5 changed files with 6184 additions and 0 deletions

View File

@ -0,0 +1,6 @@
{
"tabWidth": 4,
"useTabs": false,
"semi": true,
"printWidth": 360
}

View File

@ -0,0 +1,22 @@
module.exports = {
packagerConfig: {},
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {},
},
{
name: '@electron-forge/maker-zip',
platforms: ['darwin'],
},
{
name: '@electron-forge/maker-deb',
config: {},
},
{
name: '@electron-forge/maker-rpm',
config: {},
},
],
};

54
client/native/main.js Normal file
View File

@ -0,0 +1,54 @@
const { app, dialog, BrowserWindow } = require('electron')
const parseArgs = require('electron-args');
const cli = parseArgs(`
voice-changer-native-client
Usage
$ <command> <url>
Options
--help show help
--version show version
--url,-u open client
Examples
$ voice-changer-native-client http://localhost:18888/
`, {
alias: {
u: 'url'
},
default: {
url: "http://localhost:18888/"
}
});
console.log(cli.flags);
console.log(cli.flags["url"]);
const url = cli.flags["url"]
const createWindow = () => {
const win = new BrowserWindow({
width: 800,
height: 600
})
app.on('certificate-error', function (event, webContents, url, error, certificate, callback) {
event.preventDefault();
callback(true);
});
win.loadURL(url)
}
app.whenReady().then(() => {
createWindow()
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit()
})

6073
client/native/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,29 @@
{
"name": "voice-changer-native-client",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"start": "electron-forge start",
"test": "echo \"Error: no test specified\" && exit 1",
"package": "electron-forge package",
"make": "electron-forge make"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@electron-forge/cli": "^6.0.4",
"@electron-forge/maker-deb": "^6.0.4",
"@electron-forge/maker-rpm": "^6.0.4",
"@electron-forge/maker-squirrel": "^6.0.4",
"@electron-forge/maker-zip": "^6.0.4",
"electron": "^22.1.0",
"prettier": "^2.8.3",
"rimraf": "^4.1.1",
"typescript": "^4.9.4"
},
"dependencies": {
"electron-args": "^0.1.0",
"electron-squirrel-startup": "^1.0.0"
}
}