This repository has been archived by the owner on Sep 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: experimental elctron desktop app (windows), release v0.6.0.beta
- Loading branch information
1 parent
45b9ed2
commit a93c074
Showing
19 changed files
with
2,286 additions
and
68 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
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,13 +1,26 @@ | ||
{ | ||
"name": "noter", | ||
"version": "0.1.0", | ||
"version": "0.5.0", | ||
"private": true, | ||
"author": "soulsam480", | ||
"author": { | ||
"email": "[email protected]", | ||
"name": "soulsam480", | ||
"url": "https://sambitsahoo.com" | ||
}, | ||
"description": "Noter is a collaborative note-taking platform built for simplicity and productivity. It's free fast and open source.", | ||
"homepage": "https://noter.sambitsahoo.com", | ||
"repository": "https://github.com/soulsam480/noter", | ||
"scripts": { | ||
"serve": "vue-cli-service serve", | ||
"build": "vue-cli-service build", | ||
"lint": "vue-cli-service lint" | ||
"lint": "vue-cli-service lint", | ||
"electron:build": "vue-cli-service electron:build", | ||
"electron:serve": "vue-cli-service electron:serve --no-sandbox", | ||
"electron:generate-icons": "electron-icon-builder --input=./public/icon.png --output=build --flatten", | ||
"postinstall": "electron-builder install-app-deps", | ||
"postuninstall": "electron-builder install-app-deps" | ||
}, | ||
"main": "background.js", | ||
"dependencies": { | ||
"@editorjs/checklist": "^1.1.0", | ||
"@editorjs/code": "^2.5.0", | ||
|
@@ -40,6 +53,7 @@ | |
"devDependencies": { | ||
"@types/bootstrap": "^4.5.0", | ||
"@types/core-js": "^2.5.4", | ||
"@types/electron-devtools-installer": "^2.2.0", | ||
"@types/eslint": "^6.8.1", | ||
"@types/eslint-plugin-prettier": "^3.1.0", | ||
"@types/jquery": "^3.5.1", | ||
|
@@ -58,6 +72,9 @@ | |
"@vue/eslint-config-typescript": "^5.0.2", | ||
"@vue/runtime-dom": "^3.0.2", | ||
"babel-eslint": "^10.1.0", | ||
"electron": "^9.0.0", | ||
"electron-devtools-installer": "^3.1.0", | ||
"electron-icon-builder": "^2.0.1", | ||
"eslint": "^6.7.2", | ||
"eslint-plugin-prettier": "^3.1.3", | ||
"eslint-plugin-vue": "^6.2.2", | ||
|
@@ -66,6 +83,7 @@ | |
"sass-loader": "^8.0.2", | ||
"typescript": "~3.9.3", | ||
"typesync": "^0.7.0", | ||
"vue-cli-plugin-electron-builder": "~2.0.0-rc.5", | ||
"vue-template-compiler": "^2.6.11" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,81 @@ | ||
'use strict'; | ||
/* global __static */ | ||
import { app, protocol, BrowserWindow } from 'electron'; | ||
import { createProtocol } from 'vue-cli-plugin-electron-builder/lib'; | ||
import installExtension, { VUEJS_DEVTOOLS } from 'electron-devtools-installer'; | ||
const isDevelopment = process.env.NODE_ENV !== 'production'; | ||
import path from 'path'; | ||
// Scheme must be registered before the app is ready | ||
protocol.registerSchemesAsPrivileged([ | ||
{ scheme: 'app', privileges: { secure: true, standard: true } }, | ||
]); | ||
|
||
async function createWindow() { | ||
// Create the browser window. | ||
const win = new BrowserWindow({ | ||
width: 800, | ||
height: 600, | ||
webPreferences: { | ||
// Use pluginOptions.nodeIntegration, leave this alone | ||
// See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info | ||
nodeIntegration: (process.env | ||
.ELECTRON_NODE_INTEGRATION as unknown) as boolean, | ||
}, //@ts-ignore | ||
icon: path.join(__static, 'icon.png'), | ||
}); | ||
|
||
if (process.env.WEBPACK_DEV_SERVER_URL) { | ||
// Load the url of the dev server if in development mode | ||
await win.loadURL(process.env.WEBPACK_DEV_SERVER_URL as string); | ||
if (!process.env.IS_TEST) win.webContents.openDevTools(); | ||
} else { | ||
createProtocol('app'); | ||
// Load the index.html when not in development | ||
win.loadURL('app://./index.html'); | ||
} | ||
} | ||
|
||
// Quit when all windows are closed. | ||
app.on('window-all-closed', () => { | ||
// On macOS it is common for applications and their menu bar | ||
// to stay active until the user quits explicitly with Cmd + Q | ||
if (process.platform !== 'darwin') { | ||
app.quit(); | ||
} | ||
}); | ||
|
||
app.on('activate', () => { | ||
// On macOS it's common to re-create a window in the app when the | ||
// dock icon is clicked and there are no other windows open. | ||
if (BrowserWindow.getAllWindows().length === 0) createWindow(); | ||
}); | ||
|
||
// This method will be called when Electron has finished | ||
// initialization and is ready to create browser windows. | ||
// Some APIs can only be used after this event occurs. | ||
app.on('ready', async () => { | ||
if (isDevelopment && !process.env.IS_TEST) { | ||
// Install Vue Devtools | ||
try { | ||
await installExtension(VUEJS_DEVTOOLS); | ||
} catch (e) { | ||
console.error('Vue Devtools failed to install:', e.toString()); | ||
} | ||
} | ||
createWindow(); | ||
}); | ||
|
||
// Exit cleanly on request from parent process in development mode. | ||
if (isDevelopment) { | ||
if (process.platform === 'win32') { | ||
process.on('message', (data) => { | ||
if (data === 'graceful-exit') { | ||
app.quit(); | ||
} | ||
}); | ||
} else { | ||
process.on('SIGTERM', () => { | ||
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
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 |
---|---|---|
|
@@ -33,4 +33,28 @@ module.exports = { | |
}, | ||
}, | ||
}, | ||
pluginOptions: { | ||
electronBuilder: { | ||
builderOptions: { | ||
// name: 'Noter', | ||
// description: | ||
// "Noter is a collaborative note-taking platform built for simplicity and productivity. It's free fast and open source.", | ||
// homepage: 'https://noter.sambitsahoo.com', | ||
// author: { | ||
// name: 'sambit Sahoo', | ||
// email: '[email protected]', | ||
// }, | ||
// repository: 'https://github.com/soulsam480/noter', | ||
// build: { | ||
appId: 'com.sambitsahoo.noter', | ||
productName: 'Noter', | ||
copyright: 'Copyright © 2021 Sambit Sahoo', | ||
buildVersion: '0.5.0', | ||
nsis: { | ||
oneClick: false, | ||
}, | ||
// }, | ||
}, | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.