Adding electron-builder; fixing indent levels

This commit is contained in:
itdominator 2025-06-08 15:09:51 -05:00
parent 5b62163c4e
commit b11e8bb74a
10 changed files with 90 additions and 63 deletions

View File

@ -15,7 +15,7 @@
"build":{ "build":{
"builder":"@angular-devkit/build-angular:browser", "builder":"@angular-devkit/build-angular:browser",
"options":{ "options":{
"outputPath":"dist/app", "outputPath":"build/app",
"index":"src/index.html", "index":"src/index.html",
"main":"src/main.ts", "main":"src/main.ts",
"polyfills":[ "polyfills":[
@ -113,4 +113,4 @@
} }
} }
} }
} }

BIN
icos/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
icos/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

View File

@ -6,7 +6,7 @@ const { settingsManager } = require('./settings-manager');
const { newtonFs } = require('./fs'); const { newtonFs } = require('./fs');
const BASE_PATH = '../dist/app'; const BASE_PATH = '../build/app';
const ICON_PATH = `${BASE_PATH}/resources/newton.png`; const ICON_PATH = `${BASE_PATH}/resources/newton.png`;
let args = []; let args = [];
@ -31,6 +31,7 @@ const createWindow = (startType = "build", debug = false, args = []) => {
icon: settingsManager.getIconPath(), icon: settingsManager.getIconPath(),
webPreferences: { webPreferences: {
preload: path.join(__dirname, 'preload.js'), preload: path.join(__dirname, 'preload.js'),
nodeIntegration: false,
contextIsolation: true, contextIsolation: true,
enableRemoteModule: false, enableRemoteModule: false,
plugins: true, plugins: true,

View File

@ -6,7 +6,7 @@ const os = require('os')
const HOME_DIR = os.homedir(); const HOME_DIR = os.homedir();
const BASE_PATH = '../dist/app'; const BASE_PATH = '../build/app';
const CONFIG_PATH = path.join(HOME_DIR, "/.config/newton/"); const CONFIG_PATH = path.join(HOME_DIR, "/.config/newton/");
const SETTINGS_CONFIG_PATH = path.join(CONFIG_PATH, "/settings.json"); const SETTINGS_CONFIG_PATH = path.join(CONFIG_PATH, "/settings.json");
const LSP_CONFIG_PATH = path.join(BASE_PATH, "/resources/lsp-servers-config.json") const LSP_CONFIG_PATH = path.join(BASE_PATH, "/resources/lsp-servers-config.json")

View File

@ -35,8 +35,9 @@ const loadArgs = () => {
args = process.argv.slice(4); // remove up to --start-as ... args = process.argv.slice(4); // remove up to --start-as ...
args.forEach((val, index, array) => { args.forEach((val, index, array) => {
console.log(index + ': ' + val); console.log(index + ': ' + val);
console.log();
}); });
console.log("\n\n");
} }
const loadHandlers = () => { const loadHandlers = () => {
@ -89,4 +90,4 @@ process.on('unhandledRejection', function(error = {}) {
if (error.stack != null) { if (error.stack != null) {
console.log(error.stack); console.log(error.stack);
} }
}); });

View File

@ -1,11 +1,17 @@
{ {
"name": "Newton Editor", "name": "Newton",
"version": "0.0.1",
"description": "A uniquly simple quasi-IDE for hardcore developers.", "description": "A uniquly simple quasi-IDE for hardcore developers.",
"version": "0.0.1",
"author": "ITDominator",
"license": "GPL-2.0-only",
"main": "newton/main.js", "main": "newton/main.js",
"private": true,
"scripts": { "scripts": {
"app": "ng build --base-href ./ && electron . --trace-warnings --start-as=build", "app": "ng build --base-href ./ && electron . --trace-warnings --start-as=build",
"electron-start": "electron . --trace-warnings --start-as=build", "electron-start": "electron . --trace-warnings --start-as=build",
"electron-pack": "electron-builder --dir",
"electron-dist": "electron-builder",
"electron-dist-all": "electron-builder -mwl",
"electron-concurrently": "concurrently 'ng serve' 'electron . --trace-warnings --start-as=ng-serve'", "electron-concurrently": "concurrently 'ng serve' 'electron . --trace-warnings --start-as=ng-serve'",
"ng-serve": "ng serve", "ng-serve": "ng serve",
"ng-build": "ng build", "ng-build": "ng build",
@ -13,15 +19,31 @@
"ng-test": "ng test", "ng-test": "ng test",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"private": true, "build": {
"author": "ITDominator", "appId": "newton",
"license": "GPL-2.0-only", "icon": "./icos/",
"files": [
"newton/",
"build/"
],
"mac": {
"category": "public.app-category.developer-tools"
},
"win": {
"target": "portable"
},
"linux": {
"target": "AppImage",
"category": "Development"
}
},
"postinstall": "electron-builder install-app-deps",
"dependencies": { "dependencies": {
"@angular/cdk": "19.2.0",
"@angular/cli": "19.2.9", "@angular/cli": "19.2.9",
"@angular/common": "19.2.0", "@angular/common": "19.2.0",
"@angular/compiler": "19.2.0", "@angular/compiler": "19.2.0",
"@angular/core": "19.2.0", "@angular/core": "19.2.0",
"@angular/cdk": "19.2.0",
"@angular/forms": "19.2.0", "@angular/forms": "19.2.0",
"@angular/platform-browser": "19.2.0", "@angular/platform-browser": "19.2.0",
"@angular/platform-browser-dynamic": "19.2.0", "@angular/platform-browser-dynamic": "19.2.0",
@ -45,6 +67,7 @@
"@types/jasmine": "5.1.0", "@types/jasmine": "5.1.0",
"@types/node": "18.18.0", "@types/node": "18.18.0",
"concurrently": "9.1.2", "concurrently": "9.1.2",
"electron-builder": "26.0.12",
"electron": "36.2.0", "electron": "36.2.0",
"electron-reloader": "1.2.3", "electron-reloader": "1.2.3",
"jasmine-core": "5.6.0", "jasmine-core": "5.6.0",

View File

@ -1,15 +1,16 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */ /* To learn more about this file see: https://angular.io/config/tsconfig. */
{ {
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "./out-tsc/app", "outDir": "./build/app",
"types": [] "types": []
}, },
"files": [ "files": [
"src/main.ts" "src/main.ts"
], ],
"include": [ "include": [
"src/polyfills.ts", "src/polyfills.ts",
"src/**/*.d.ts" "src/**/*.d.ts"
] ]
} }

View File

@ -25,35 +25,35 @@
/* /*
{ {
"compileOnSave": false, "compileOnSave": false,
"compilerOptions": { "compilerOptions": {
"outDir": "./dist/out-tsc", "outDir": "./build/app",
"strict": true, "strict": true,
"noImplicitOverride": true, "noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true, "noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true, "noImplicitReturns": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"skipLibCheck": true, "skipLibCheck": true,
"esModuleInterop": true, "esModuleInterop": true,
"sourceMap": true, "sourceMap": true,
"declaration": false, "declaration": false,
"experimentalDecorators": true, "experimentalDecorators": true,
"moduleResolution": "bundler", "moduleResolution": "bundler",
"importHelpers": true, "importHelpers": true,
"target": "ES2022", "target": "ES2022",
"module": "ES2022", "module": "ES2022",
"useDefineForClassFields": false, "useDefineForClassFields": false,
"lib": [ "lib": [
"ES2022", "ES2022",
"dom" "dom"
] ]
}, },
"angularCompilerOptions": { "angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false, "enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true, "strictInjectionParameters": true,
"strictInputAccessModifiers": true, "strictInputAccessModifiers": true,
"strictTemplates": true "strictTemplates": true
} }
} }
*/ */

View File

@ -1,14 +1,15 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */ /* To learn more about this file see: https://angular.io/config/tsconfig. */
{ {
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "./out-tsc/spec", "outDir": "./build/spec",
"types": [ "types": [
"jasmine" "jasmine"
]
},
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
] ]
},
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
} }