-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit 37cc97d
Showing
10 changed files
with
1,831 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
*.tgz | ||
yarn-error.log | ||
node_modules | ||
build.sh | ||
cert.p12 | ||
dist/ |
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,55 @@ | ||
const { app, BrowserWindow } = require('electron'); | ||
|
||
const isLocal = process.env.JUSTO_ENV === 'local'; | ||
|
||
const url = isLocal | ||
? 'http://crisp.internal:5140' | ||
: 'https://crisp.getjusto.com'; | ||
|
||
const createWindow = () => { | ||
// Create the browser window. | ||
const mainWindow = new BrowserWindow({ | ||
width: 1100, | ||
height: 750, | ||
center: true, | ||
titleBarStyle: 'hidden', | ||
trafficLightPosition: { x: 10, y: 10 }, | ||
webPreferences: { | ||
devTools: true, | ||
autoplayPolicy: 'no-user-gesture-required', | ||
allowRunningInsecureContent: true, | ||
}, | ||
autoHideMenuBar: true, | ||
}); | ||
|
||
// and load the index.html of the app. | ||
mainWindow.loadURL(url); | ||
|
||
// Open the DevTools. | ||
// mainWindow.webContents.openDevTools(); | ||
}; | ||
|
||
// 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', createWindow); | ||
|
||
// Quit when all windows are closed, except on macOS. There, it's common | ||
// for applications and their menu bar to stay active until the user quits | ||
// explicitly with Cmd + Q. | ||
app.on('window-all-closed', () => { | ||
if (process.platform !== 'darwin') { | ||
app.quit(); | ||
} | ||
}); | ||
|
||
app.on('activate', () => { | ||
// On OS X 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(); | ||
} | ||
}); | ||
|
||
// In this file you can include the rest of your app's specific main process | ||
// code. You can also put them in separate files and import them here. |
Binary file not shown.
Binary file not shown.
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.
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,40 @@ | ||
{ | ||
"name": "justo-crisp", | ||
"version": "0.0.1", | ||
"license": "MIT", | ||
"description": "Crisp POS", | ||
"author": "nicolaslopezj", | ||
"main": "./app/index.js", | ||
"repository": "https://github.com/getjusto/tabs-electron", | ||
"scripts": { | ||
"postinstall": "electron-builder install-app-deps", | ||
"start": "JUSTO_ENV=local yarn install && electron ./app", | ||
"pack": "electron-builder --dir", | ||
"release": "electron-builder --win --mac", | ||
"afterSign": "scripts/notarize.js" | ||
}, | ||
"build": { | ||
"productName": "Crisp", | ||
"appId": "com.getjusto.crisp", | ||
"dmg": { | ||
"icon": "build/icon.icns", | ||
"internetEnabled": true | ||
}, | ||
"win": { | ||
"publish": [ | ||
"github" | ||
], | ||
"target": "nsis", | ||
"icon": "build/icon.ico" | ||
} | ||
}, | ||
"dependencies": { | ||
"electron-updater": "^5.3.0" | ||
}, | ||
"devDependencies": { | ||
"@electron/notarize": "^1.2.3", | ||
"dotenv": "^16.0.3", | ||
"electron": "latest", | ||
"electron-builder": "latest" | ||
} | ||
} |
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,20 @@ | ||
const { notarize } = require('electron-notarize'); | ||
require('dotenv').config(); | ||
|
||
exports.default = async function notarizing(context) { | ||
const { electronPlatformName, appOutDir } = context; | ||
if (electronPlatformName !== 'darwin') { | ||
return; | ||
} | ||
|
||
const appName = context.packager.appInfo.productFilename; | ||
|
||
// Package your app here, and code sign with hardened runtime | ||
await notarize({ | ||
tool: 'notarytool', | ||
appPath: `${appOutDir}/${appName}.app`, | ||
appleId: process.env.APPLE_ID, | ||
appleIdPassword: process.env.APPLE_PASSWORD, | ||
teamId: process.env.APPLE_TEAM_ID, | ||
}); | ||
}; |
Oops, something went wrong.