diff --git a/.build/devlopment/tsconfig-build.json b/.build/devlopment/tsconfig-build.json new file mode 100644 index 0000000..ee3fea6 --- /dev/null +++ b/.build/devlopment/tsconfig-build.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.json", + "include": [ + "../../electron/main/index.ts", + "../../electron/windows/primary.ts" + ], + "exclude": [ + "../../.build", + "../../astro", + "../../configuration", + ] +} \ No newline at end of file diff --git a/.build/devlopment/tsconfig.json b/.build/devlopment/tsconfig.json new file mode 100644 index 0000000..1297dcf --- /dev/null +++ b/.build/devlopment/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "rootDir": "../../", + "target": "es2016", + "module": "commonjs", + "outDir": "../output/electron", + "removeComments": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true + } +} diff --git a/.build/electron-builder.ts b/.build/electron-builder.ts new file mode 100644 index 0000000..1ee3850 --- /dev/null +++ b/.build/electron-builder.ts @@ -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 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..26b2e05 --- /dev/null +++ b/.gitignore @@ -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 diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..484df0f --- /dev/null +++ b/.npmrc @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index e75b951..ceecd1d 100755 --- a/README.md +++ b/README.md @@ -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. + [![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. ___ diff --git a/astro/astro.config.ts b/astro/astro.config.ts new file mode 100644 index 0000000..9195e5d --- /dev/null +++ b/astro/astro.config.ts @@ -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, + } +}) \ No newline at end of file diff --git a/astro/src/assets/favicon.svg b/astro/src/assets/favicon.svg new file mode 100644 index 0000000..f157bd1 --- /dev/null +++ b/astro/src/assets/favicon.svg @@ -0,0 +1,9 @@ + + + + diff --git a/astro/src/components/sidebar.astro b/astro/src/components/sidebar.astro new file mode 100644 index 0000000..e69de29 diff --git a/astro/src/env.d.ts b/astro/src/env.d.ts new file mode 100644 index 0000000..48bd230 --- /dev/null +++ b/astro/src/env.d.ts @@ -0,0 +1 @@ +/// \ No newline at end of file diff --git a/astro/src/pages/index.astro b/astro/src/pages/index.astro new file mode 100644 index 0000000..2b3c1e9 --- /dev/null +++ b/astro/src/pages/index.astro @@ -0,0 +1,6 @@ +--- +import App from '../structure/app.astro' +--- + + + \ No newline at end of file diff --git a/astro/src/structure/app.astro b/astro/src/structure/app.astro new file mode 100644 index 0000000..07af9d3 --- /dev/null +++ b/astro/src/structure/app.astro @@ -0,0 +1,9 @@ + + + + DESKTOP_APP_NAME + + + + + diff --git a/configuration/app.ts b/configuration/app.ts new file mode 100644 index 0000000..2ea7af5 --- /dev/null +++ b/configuration/app.ts @@ -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" +} \ No newline at end of file diff --git a/configuration/electron-builder.ts b/configuration/electron-builder.ts new file mode 100644 index 0000000..b209037 --- /dev/null +++ b/configuration/electron-builder.ts @@ -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' +} \ No newline at end of file diff --git a/configuration/sidebar.ts b/configuration/sidebar.ts new file mode 100644 index 0000000..f37d047 --- /dev/null +++ b/configuration/sidebar.ts @@ -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" + } +] \ No newline at end of file diff --git a/configuration/theme.ts b/configuration/theme.ts new file mode 100644 index 0000000..1cce8c6 --- /dev/null +++ b/configuration/theme.ts @@ -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", +} \ No newline at end of file diff --git a/electron/functions/crash-reporter.js b/electron/functions/crash-reporter.js new file mode 100644 index 0000000..e69de29 diff --git a/electron/functions/css.js b/electron/functions/css.js new file mode 100644 index 0000000..e69de29 diff --git a/electron/functions/global.js b/electron/functions/global.js new file mode 100644 index 0000000..e69de29 diff --git a/electron/functions/menu.js b/electron/functions/menu.js new file mode 100644 index 0000000..e69de29 diff --git a/electron/functions/notifications.js b/electron/functions/notifications.js new file mode 100644 index 0000000..e69de29 diff --git a/electron/main/index.ts b/electron/main/index.ts new file mode 100644 index 0000000..36cca84 --- /dev/null +++ b/electron/main/index.ts @@ -0,0 +1,3 @@ +import {app, BrowserWindow} from "electron" +let mainWindow = require('../windows/primary') +app.whenReady().then(() => {mainWindow.launch()}) \ No newline at end of file diff --git a/electron/windows/primary.ts b/electron/windows/primary.ts new file mode 100644 index 0000000..0b8e154 --- /dev/null +++ b/electron/windows/primary.ts @@ -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') + } + } +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..c2c8498 --- /dev/null +++ b/package.json @@ -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" + } +} \ No newline at end of file