added web app as submodule

This commit is contained in:
Abhinav 2022-07-13 12:51:37 +05:30
parent 47e7a9eccf
commit 8b85ed506b
7 changed files with 461 additions and 347 deletions

1
.gitignore vendored
View file

@ -1,5 +1,6 @@
node_modules
app
.next/
dist
.vscode
buildingSteps.md

4
.gitmodules vendored Normal file
View file

@ -0,0 +1,4 @@
[submodule "bada-frame"]
path = bada-frame
url = https://github.com/ente-io/bada-frame
branch = desktop-app

1
bada-frame Submodule

@ -0,0 +1 @@
Subproject commit 0457c3c530dec04a52cdd8fb5a6c927535c7ce24

View file

@ -40,7 +40,7 @@
"build": "tsc",
"watch": "tsc -w",
"lint": "eslint -c .eslintrc --ext .ts ./src",
"start": "yarn build && electron ./app/main.js",
"start": "concurrently \"yarn build && electron ./app/main.js\" \"cd bada-frame && yarn dev\"",
"test-release": "yarn build && electron-builder",
"prepare": "husky install"
},
@ -49,6 +49,7 @@
"@sentry/cli": "^1.68.0",
"@typescript-eslint/eslint-plugin": "^5.28.0",
"@typescript-eslint/parser": "^5.28.0",
"concurrently": "^7.0.0",
"electron": "^15.3.0",
"electron-builder": "^23.0.3",
"electron-builder-notarize": "^1.2.0",
@ -70,6 +71,7 @@
"electron-store": "^8.0.1",
"electron-updater": "^4.3.8",
"node-stream-zip": "^1.15.0",
"next-electron-server": "^0.0.8",
"promise-fs": "^2.1.1"
},
"standard": {

View file

@ -35,10 +35,15 @@ export const setIsUpdateAvailable = (value: boolean): void => {
updateIsAvailable = value;
};
const serveNextAt = require('next-electron-server');
serveNextAt('next://app', {
outputDir: './bada-frame/out',
});
const gotTheLock = app.requestSingleInstanceLock();
if (!gotTheLock) {
app.quit();
} else {
app.commandLine.appendSwitch('enable-features', 'SharedArrayBuffer');
app.on('second-instance', () => {
// Someone tried to run a second instance, we should focus our window.
if (mainWindow) {

View file

@ -1,7 +1,6 @@
import { app, BrowserWindow, nativeImage } from 'electron';
import * as path from 'path';
import { isDev } from './common';
import { PROD_HOST_URL } from '../config';
import { isAppQuitting } from '../main';
export function createWindow(): BrowserWindow {
@ -31,14 +30,14 @@ export function createWindow(): BrowserWindow {
if (isDev) {
splash.loadFile(`../build/splash.html`);
mainWindow.loadURL('http://localhost:3000');
mainWindow.loadURL('next://app');
// Open the DevTools.
mainWindow.webContents.openDevTools();
} else {
splash.loadURL(
`file://${path.join(process.resourcesPath, 'splash.html')}`
);
mainWindow.loadURL(PROD_HOST_URL);
mainWindow.loadURL('next://app');
}
mainWindow.webContents.on('did-fail-load', () => {
splash.close();

788
yarn.lock

File diff suppressed because it is too large Load diff