diff --git a/angular.json b/angular.json index 5c29c9f..649466e 100644 --- a/angular.json +++ b/angular.json @@ -15,7 +15,7 @@ "build":{ "builder":"@angular-devkit/build-angular:browser", "options":{ - "outputPath":"dist/app", + "outputPath":"build/app", "index":"src/index.html", "main":"src/main.ts", "polyfills":[ @@ -113,4 +113,4 @@ } } } -} \ No newline at end of file +} diff --git a/icos/icon.ico b/icos/icon.ico new file mode 100644 index 0000000..e9af9a8 Binary files /dev/null and b/icos/icon.ico differ diff --git a/icos/icon.png b/icos/icon.png new file mode 100644 index 0000000..af1c97d Binary files /dev/null and b/icos/icon.png differ diff --git a/newton/app.js b/newton/app.js index 5053fa4..0ff65c0 100644 --- a/newton/app.js +++ b/newton/app.js @@ -6,7 +6,7 @@ const { settingsManager } = require('./settings-manager'); const { newtonFs } = require('./fs'); -const BASE_PATH = '../dist/app'; +const BASE_PATH = '../build/app'; const ICON_PATH = `${BASE_PATH}/resources/newton.png`; let args = []; @@ -31,6 +31,7 @@ const createWindow = (startType = "build", debug = false, args = []) => { icon: settingsManager.getIconPath(), webPreferences: { preload: path.join(__dirname, 'preload.js'), + nodeIntegration: false, contextIsolation: true, enableRemoteModule: false, plugins: true, diff --git a/newton/fs.js b/newton/fs.js index e731f4f..7eefacb 100644 --- a/newton/fs.js +++ b/newton/fs.js @@ -6,7 +6,7 @@ const os = require('os') 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 SETTINGS_CONFIG_PATH = path.join(CONFIG_PATH, "/settings.json"); const LSP_CONFIG_PATH = path.join(BASE_PATH, "/resources/lsp-servers-config.json") diff --git a/newton/main.js b/newton/main.js index fe95813..64e1462 100644 --- a/newton/main.js +++ b/newton/main.js @@ -35,8 +35,9 @@ const loadArgs = () => { args = process.argv.slice(4); // remove up to --start-as ... args.forEach((val, index, array) => { console.log(index + ': ' + val); - console.log(); }); + + console.log("\n\n"); } const loadHandlers = () => { @@ -89,4 +90,4 @@ process.on('unhandledRejection', function(error = {}) { if (error.stack != null) { console.log(error.stack); } -}); +}); \ No newline at end of file diff --git a/package.json b/package.json index dce925b..f208f3e 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,17 @@ { - "name": "Newton Editor", - "version": "0.0.1", + "name": "Newton", "description": "A uniquly simple quasi-IDE for hardcore developers.", + "version": "0.0.1", + "author": "ITDominator", + "license": "GPL-2.0-only", "main": "newton/main.js", + "private": true, "scripts": { "app": "ng build --base-href ./ && 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'", "ng-serve": "ng serve", "ng-build": "ng build", @@ -13,15 +19,31 @@ "ng-test": "ng test", "test": "echo \"Error: no test specified\" && exit 1" }, - "private": true, - "author": "ITDominator", - "license": "GPL-2.0-only", + "build": { + "appId": "newton", + "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": { + "@angular/cdk": "19.2.0", "@angular/cli": "19.2.9", "@angular/common": "19.2.0", "@angular/compiler": "19.2.0", "@angular/core": "19.2.0", - "@angular/cdk": "19.2.0", "@angular/forms": "19.2.0", "@angular/platform-browser": "19.2.0", "@angular/platform-browser-dynamic": "19.2.0", @@ -45,6 +67,7 @@ "@types/jasmine": "5.1.0", "@types/node": "18.18.0", "concurrently": "9.1.2", + "electron-builder": "26.0.12", "electron": "36.2.0", "electron-reloader": "1.2.3", "jasmine-core": "5.6.0", diff --git a/tsconfig.app.json b/tsconfig.app.json index b37faad..73890e0 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -1,15 +1,16 @@ /* To learn more about this file see: https://angular.io/config/tsconfig. */ + { - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "./out-tsc/app", - "types": [] - }, - "files": [ - "src/main.ts" - ], - "include": [ - "src/polyfills.ts", - "src/**/*.d.ts" - ] + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./build/app", + "types": [] + }, + "files": [ + "src/main.ts" + ], + "include": [ + "src/polyfills.ts", + "src/**/*.d.ts" + ] } diff --git a/tsconfig.json b/tsconfig.json index bb36a82..5d8d822 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,35 +25,35 @@ /* { - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist/out-tsc", - "strict": true, - "noImplicitOverride": true, - "noPropertyAccessFromIndexSignature": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "skipLibCheck": true, - "esModuleInterop": true, - "sourceMap": true, - "declaration": false, - "experimentalDecorators": true, - "moduleResolution": "bundler", - "importHelpers": true, - "target": "ES2022", - "module": "ES2022", - "useDefineForClassFields": false, - "lib": [ - "ES2022", - "dom" - ] - }, - "angularCompilerOptions": { - "enableI18nLegacyMessageIdFormat": false, - "strictInjectionParameters": true, - "strictInputAccessModifiers": true, - "strictTemplates": true - } + "compileOnSave": false, + "compilerOptions": { + "outDir": "./build/app", + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "skipLibCheck": true, + "esModuleInterop": true, + "sourceMap": true, + "declaration": false, + "experimentalDecorators": true, + "moduleResolution": "bundler", + "importHelpers": true, + "target": "ES2022", + "module": "ES2022", + "useDefineForClassFields": false, + "lib": [ + "ES2022", + "dom" + ] + }, + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true + } } */ \ No newline at end of file diff --git a/tsconfig.spec.json b/tsconfig.spec.json index be7e9da..2f3c047 100644 --- a/tsconfig.spec.json +++ b/tsconfig.spec.json @@ -1,14 +1,15 @@ /* To learn more about this file see: https://angular.io/config/tsconfig. */ + { - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "./out-tsc/spec", - "types": [ - "jasmine" + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./build/spec", + "types": [ + "jasmine" + ] + }, + "include": [ + "src/**/*.spec.ts", + "src/**/*.d.ts" ] - }, - "include": [ - "src/**/*.spec.ts", - "src/**/*.d.ts" - ] }