1
Fork 0

Init Pluto

This commit is contained in:
Korbs 2023-08-30 01:46:33 -04:00
parent ec710e6121
commit 342956509c
No known key found for this signature in database
24 changed files with 360 additions and 1 deletions

View file

@ -0,0 +1,12 @@
{
"extends": "./tsconfig.json",
"include": [
"../../electron/main/index.ts",
"../../electron/windows/primary.ts"
],
"exclude": [
"../../.build",
"../../astro",
"../../configuration",
]
}

View file

@ -0,0 +1,12 @@
{
"compilerOptions": {
"rootDir": "../../",
"target": "es2016",
"module": "commonjs",
"outDir": "../output/electron",
"removeComments": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
}

View file

@ -0,0 +1,92 @@
import { Configuration } from 'electron-builder'
import {meta} from '../configuration/app'
import {splash} from '../configuration/theme'
import {update, macos, linux, windows} from '../configuration/electron-builder'
///////////////////////////////////////////////////////////////
// Please configure the "configuration/app.ts" file instead. //
///////////////////////////////////////////////////////////////
const config: Configuration = {
directories: {output: ".build/output/distribution/${platform}/${arch}"},
productName: meta.name,
appId: meta.id,
// Auto Update
publish: {
provider: "generic",
url: update.url,
channel: update.channel
},
// Operating Systems
/// macOS
mac: {
icon: ".build/assets/icons/macOS.icns",
target: "dmg",
darkModeSupport: true,
category: macos.category
},
dmg: {
background: ".build/assets/backgrounds/DMG-Background.png",
icon: ".build/assets/icons/macos/icon.icns"
},
/// Windows
win: {
icon: ".build/assets/icons/windows/icon.png",
target: [
{target: "appx", arch: "x64"},
{target: "nsis", arch: "x64"},
{target: "nsis", arch: "arm64"}
]
},
appx: {
backgroundColor: splash.backgroundColor,
applicationId: meta.id,
identityName: windows.identityName,
publisher: windows.publisher,
publisherDisplayName: meta.company
},
nsis: {
installerSidebar: ".build/assets/backgrounds/NSIS-Sidebar.bmp",
uninstallDisplayName: meta.name + ' - Uninstall.exe',
artifactName: meta.name + ' - Install.exe',
shortcutName: meta.name,
allowElevation: windows.requireAdmin,
oneClick: windows.silent,
allowToChangeInstallationDirectory: windows.allowToChangeInstallationDirectory,
displayLanguageSelector: windows.displayLanguageSelector,
createDesktopShortcut: windows.createDesktopShortcut,
deleteAppDataOnUninstall: windows.deleteAppDataOnUninstall
},
/// Linux
linux: {
icon: ".build/assets/icons/linux/icon.png",
category: linux.category,
maintainer: meta.id,
vendor: meta.company,
description: meta.description,
target: [
{ target: 'AppImage', arch: 'x64' }, // Universal - x86_64
{ target: 'AppImage', arch: 'arm64' }, // Universal - arm64
{ target: 'snap', arch: 'x64' }, // Snap Store - x86_64
{ target: 'deb', arch: 'x64' }, // Debian/Ubuntu - x86_64
{ target: 'deb', arch: 'arm64' }, // Debian/Ubuntu - arm64
{ target: 'rpm', arch: 'x64' }, // RHEL/Fedora - x86_64
{ target: 'rpm', arch: 'arm64' }, // RHEL/Fedora - arm64
{ target: 'freebsd', arch: 'x64' }, // BSD - x86_64
{ target: 'freebsd', arch: 'arm64' }, // BSD - arm64
{ target: 'pacman', arch: 'x64' }, // Arch - x86_64
{ target: 'pacman', arch: 'arm64' }, // Arch - arm64
]
},
snap: {
title: meta.name,
allowNativeWayland: true,
confinement: "strict"
}
}
export default config

43
.gitignore vendored Normal file
View file

@ -0,0 +1,43 @@
# build output
.build/output/
# generated types
.astro/
# dependencies
node_modules/
Astro/node_modules
# logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# locks
pnpm-lock.yaml
# environment variables
.env
# Linux-specific files
.fuse_hidden*
.directory
.Trash-*
.nfs*
# macOS-specific files
.DS_Store
.AppleDouble
.LSOverride
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# Windows-specific files
*.lnk
[Dd]esktop.ini

3
.npmrc Normal file
View file

@ -0,0 +1,3 @@
# This is to allow Electron Builder to work nicely with PNPM
# https://github.com/electron-userland/electron-builder/issues/6289#issuecomment-1042620422
node-linker=hoisted

View file

@ -1,8 +1,10 @@
> You are currently viewing the "Pluto" branch, currently the template is blank in this branch. View "main" branch to see previous development.
<a href="https://opencollective.com/nexus-polestar/tiers/badge.svg"><img src="https://opencollective.com/nexus-polestar/tiers/badge.svg"></a> [![Build Status](https://automation.sudovanilla.com/api/badges/Korbs/nexus-polestar/status.svg)](https://automation.sudovanilla.com/Korbs/nexus-polestar)
![Nexus Polestar](https://sudovanilla.com/content/images/Nexus-Polestar-COMP.png)
Nexus Polestar is an Electron component-based template made using Astro that allows you to adjust the layout, configure the options presented, customize the code to your liking, and much more. Other technologies, like as Font Awesome and Astro plugins like i18n, are also integrated. Other stuff about the template has been done for you such as operating system integration, automation, and more.
Nexus Polestar is an Electron component-based template made using Astro that allows you to adjust the layout, configure the options presented, customize the code to your liking, and much more. Other technologies, like as TypeScript, Font Awesome, and Astro plugins like i18n, are also integrated. Other stuff about the template has been done for you such as operating system integration, automation, and more.
___

18
astro/astro.config.ts Normal file
View file

@ -0,0 +1,18 @@
import { defineConfig } from 'astro/config'
export default defineConfig({
compressHTML: true,
publicDir: "./src/public",
outDir: "../.build/output/astro",
cacheDir: "../build/output/astro-cache/",
server: {
host: false,
port: 2023
},
build: {
format: 'file'
},
experimental: {
assets: true,
}
})

View file

@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 128 128">
<path d="M50.4 78.5a75.1 75.1 0 0 0-28.5 6.9l24.2-65.7c.7-2 1.9-3.2 3.4-3.2h29c1.5 0 2.7 1.2 3.4 3.2l24.2 65.7s-11.6-7-28.5-7L67 45.5c-.4-1.7-1.6-2.8-2.9-2.8-1.3 0-2.5 1.1-2.9 2.7L50.4 78.5Zm-1.1 28.2Zm-4.2-20.2c-2 6.6-.6 15.8 4.2 20.2a17.5 17.5 0 0 1 .2-.7 5.5 5.5 0 0 1 5.7-4.5c2.8.1 4.3 1.5 4.7 4.7.2 1.1.2 2.3.2 3.5v.4c0 2.7.7 5.2 2.2 7.4a13 13 0 0 0 5.7 4.9v-.3l-.2-.3c-1.8-5.6-.5-9.5 4.4-12.8l1.5-1a73 73 0 0 0 3.2-2.2 16 16 0 0 0 6.8-11.4c.3-2 .1-4-.6-6l-.8.6-1.6 1a37 37 0 0 1-22.4 2.7c-5-.7-9.7-2-13.2-6.2Z" />
<style>
path { fill: #000; }
@media (prefers-color-scheme: dark) {
path { fill: #FFF; }
}
</style>
</svg>

After

Width:  |  Height:  |  Size: 749 B

View file

1
astro/src/env.d.ts vendored Normal file
View file

@ -0,0 +1 @@
/// <reference types="astro/client-image" />

View file

@ -0,0 +1,6 @@
---
import App from '../structure/app.astro'
---
<App>
</App>

View file

@ -0,0 +1,9 @@
<html>
<head>
<meta charset="utf-8" />
<title>DESKTOP_APP_NAME</title>
</head>
<body>
<slot />
</body>
</html>

28
configuration/app.ts Normal file
View file

@ -0,0 +1,28 @@
///////////////////////
// Metadata //
///////////////////////
export const meta = {
name: 'App Name Here',
company: 'Company Name',
description: '',
id: 'org.company-name.app-name-here', // extension.domain.appname
// Sources
website: "https://mywebsite.net/",
support: "https://mywebsite.net/help/",
source_code: "https://github.com/user/repo"
}
////////////////////////////////
// App Configuration //
////////////////////////////////
export const config = {
// Notifications
notificationType: "Native", // "Custom" "Native"
// Pushy Notifications
pushyAppId: "63e9212d7446e48a2a0e8ec0",
// Crash Reporter
crashReportServer: "https://nexuspolestar.bugsplat.com/post/electron/crash.php"
}

View file

@ -0,0 +1,26 @@
export const update = {
channel: "latest", // Branch: "latest" "beta" "alpha"
url: '' // Point to url where build files will be stored on your server.
}
export const macos = {
category: 'public.app-category.utilities' // https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8
}
export const linux = {
category: 'Utilities', // https://specifications.freedesktop.org/menu-spec/menu-spec-1.0.html/category-registry
}
export const windows = {
// NSIS (.exe setup)
requireAdmin: false, // If you app needs to run admin tasks, which is shouldn't need to, set this to "true"
silent: false, // Ignore NSIS options below if "true"
allowToChangeInstallationDirectory: true, // Allow users to install your app anywhere
displayLanguageSelector: true,
createDesktopShortcut: false,
deleteAppDataOnUninstall: true,
// Microsoft Store
identityName: '00000Company.AppName',
publisher: 'CN=000A00A0-A00A-0A00-AAA0-0AAA00A000AA'
}

30
configuration/sidebar.ts Normal file
View file

@ -0,0 +1,30 @@
export const SIDEBARTOP = [
{
text: "Dashboard",
icon: "wand-magic-sparkles",
default: true
},
{
text: "Files",
icon: "folder-tree"
},
{
text: "Webview Demo",
icon: "globe"
},
{
text: "Webview Demo 2",
icon: "globe"
},
{
text: "iFrame Demo",
icon: "eye"
},
]
export const SIDEBARBOTTOM = [
{
text: "Settings",
icon: "sliders"
}
]

14
configuration/theme.ts Normal file
View file

@ -0,0 +1,14 @@
export const sidebar = {
headerFontSize: "14px",
tabFontSize: "16px",
tabHeight: "24px",
tabPositions: "normal", // "normal" "centered"
size: "normal", // "normal" "compact"
enableToggle: false,
enableSearch: false,
}
export const splash = {
loadingIndicator: "Spinner", // "Spinner" "ProgressBar" "JumpingBalls" "GlowingBars"
backgroundColor: "#232323",
}

View file

View file

View file

View file

View file

3
electron/main/index.ts Normal file
View file

@ -0,0 +1,3 @@
import {app, BrowserWindow} from "electron"
let mainWindow = require('../windows/primary')
app.whenReady().then(() => {mainWindow.launch()})

View file

@ -0,0 +1,24 @@
import {BrowserWindow} from "electron"
import {meta} from '../../configuration/app'
let mainWindow : BrowserWindow
module.exports = {
launch: function() {
mainWindow = new BrowserWindow({
title: meta.name,
width: 500,
height: 500,
webPreferences: {
webviewTag: true,
nodeIntegration: false,
contextIsolation: true
}
})
// Load Content
if (process.env.NODE_ENV === "development") {
mainWindow.loadURL('http://localhost:2023')
} else if (process.env.NODE_ENV === 'production') {
mainWindow.loadFile('.build/output/astro/index.html')
}
}
}

27
package.json Normal file
View file

@ -0,0 +1,27 @@
{
"name": "nexus-polestar",
"version": "0.0.1",
"license": "AGPL-3.0-or-later",
"main": ".build/output/electron/electron/main/index.js",
"scripts": {
"start": "concurrently \"npm run tsc\" \"npm run astro:start\" \"wait-on http://localhost:2023 && npm run electron:start\"",
"build": "npm run tsc && npm run astro:build && npm run electron:build",
"tsc": "tsc -p .build/devlopment/tsconfig-build.json",
"astro:start": "astro dev --silent --root ./astro/",
"astro:build": "astro build --silent --root ./astro/",
"electron:start": "NODE_ENV=development electron .",
"electron:build": "electron-builder --config ./.build/electron-builder.ts"
},
"dependencies": {
"astro": "^2.10.14",
"astro-color-scheme": "^1.1.2",
"typescript": "^5.2.2"
},
"devDependencies": {
"@types/electron": "^1.6.10",
"concurrently": "^8.2.1",
"electron": "^26.1.0",
"electron-builder": "^24.6.3",
"wait-on": "^7.0.1"
}
}