diff --git a/.npmignore b/.npmignore index b06b2a2..5027c6e 100644 --- a/.npmignore +++ b/.npmignore @@ -1,6 +1,6 @@ .vscode -dist/ -src/ +/dist +/src /docs /preview /tests diff --git a/package.json b/package.json index 17dfdbc..f7cbec3 100644 --- a/package.json +++ b/package.json @@ -119,7 +119,6 @@ "@ngx-formly/material": "6.1.8", "@ngx-translate/core": "15.0.0", "@ngx-translate/http-loader": "8.0.0", - "@parcel/watcher": "2.3.0", "@sweetalert2/ngx-sweetalert2": "12.1.0", "@testdeck/jest": "0.3.3", "@testdeck/mocha": "0.3.3", @@ -212,7 +211,7 @@ "firedev-storage": "~16.5.19", "firedev-type-sql": "~16.5.19", "firedev-typeorm": "~16.5.21", - "firedev-ui": "~16.5.19", + "firedev-ui": "~16.5.20", "fkill": "6.1.0", "font-awesome": "4.7.0", "form-data": "4.0.0", @@ -229,7 +228,7 @@ "image-focus": "1.2.1", "immer": "10.0.2", "immutable": "4.3.0", - "incremental-compiler": "~16.5.37", + "incremental-compiler": "~16.5.38", "inquirer": "7.3.3", "inquirer-autocomplete-prompt": "1.3.0", "is-elevated": "3.0.0", @@ -244,7 +243,7 @@ "joi": "17.9.2", "jscodeshift": "0.6.3", "json-stringify-safe": "5.0.1", - "json10": "~16.5.18", + "json10": "~16.5.19", "json10-writer": "~16.5.28", "json5": "2.2.1", "json5-writer": "0.2.0", @@ -254,7 +253,7 @@ "localforage": "1.10.0", "lockfile": "1.0.4", "lodash": "4.17.20", - "lodash-walk-object": "~16.5.18", + "lodash-walk-object": "~16.5.19", "lowdb": "1.0.0", "magic-renamer": "~16.5.20", "material-design-icons": "3.0.1", @@ -268,9 +267,9 @@ "ng-in-viewport": "15.0.2", "ng-lock": "16.0.1", "ng-packagr": "16.0.1", - "ng-talkback": "~16.5.19", + "ng-talkback": "~16.5.20", "ng2-logger": "~16.5.30", - "ng2-rest": "~16.5.18", + "ng2-rest": "~16.5.19", "ngx-ace-wrapper": "14.0.0", "ngx-editor": "15.3.0", "ngx-highlightjs": "9.0.0", @@ -283,7 +282,7 @@ "ngx-scrolltop": "6.0.0", "ngx-store": "3.1.1", "ngx-typed-js": "2.1.1", - "node-cli-tester": "~16.5.19", + "node-cli-tester": "~16.5.20", "node-localstorage": "2.1.6", "node-notifier": "6.0.0", "node-polyfill-webpack-plugin": "2.0.1", @@ -310,7 +309,7 @@ "q": "1.5.1", "rallax.js": "2.0.4", "randomcolor": "0.5.3", - "record-replay-req-res-scenario": "~16.5.18", + "record-replay-req-res-scenario": "~16.5.19", "reflect-metadata": "0.1.10", "rimraf": "2.6.2", "rxjs": "~7.8.0", @@ -329,7 +328,7 @@ "systeminformation": "3.45.7", "task.js": "0.1.5", "threads": "1.7.0", - "tnp-cli": "~16.5.18", + "tnp-cli": "~16.5.19", "tnp-config": "~16.5.39", "tnp-core": "~16.6.36", "tnp-db": "~16.5.20", @@ -348,7 +347,7 @@ "uuid": "8.3.2", "validator": "9.2.0", "video.js": "8.3.0", - "vpn-split": "~16.5.21", + "vpn-split": "~16.5.22", "watch": "1.0.2", "webpack": "~5.80", "webpack-dev-middleware": "~6.0.2", diff --git a/src/app.electron.ts b/src/app.electron.ts index b5f8be4..7638252 100644 --- a/src/app.electron.ts +++ b/src/app.electron.ts @@ -8,6 +8,7 @@ fse } from 'tnp-core'; //#region @backend import { app, BrowserWindow, screen } from 'electron'; +import start from './app'; let win: BrowserWindow | null = null; const args = process.argv.slice(1); @@ -23,8 +24,8 @@ win = new BrowserWindow({ x: 0, y: 0, autoHideMenuBar: true, - width: size.width / 1.5, - height: size.height / 1.5, + width: size.width * (3/4), + height: size.height * (3/4), webPreferences: { nodeIntegration: true, allowRunningInsecureContent: (serve), @@ -32,12 +33,11 @@ win = new BrowserWindow({ }, }); - win.webContents.openDevTools(); - if (serve) { const debug = require('electron-debug'); debug(); + require('electron-reloader')(module); win.loadURL('http://localhost:' + (websql ? CLIENT_DEV_WEBSQL_APP_PORT : CLIENT_DEV_NORMAL_APP_PORT)); } else { @@ -53,6 +53,8 @@ if (serve) { win.loadURL(url.href); } +win.webContents.openDevTools(); + // Emitted when the window is closed. win.on('closed', () => { // Dereference the window object, usually you would store window @@ -65,34 +67,36 @@ return win; } async function startElectron() { -try { - // 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. - // Added 400 ms to fix the black background issue while using transparent window. More detais at https://github.com/electron/electron/issues/15947 - app.on('ready', () => setTimeout(createWindow, 400)); - - // Quit when all windows are closed. - app.on('window-all-closed', () => { - // On OS X it is common for applications and their menu bar - // to stay active until the user quits explicitly with Cmd + Q - 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 (win === null) { - createWindow(); - } - }); - -} catch (e) { - // Catch Error - // throw e; -} + await start(); + try { + // 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. + // Added 400 ms to fix the black background issue while using transparent window. More detais at https://github.com/electron/electron/issues/15947 + // app.on('ready', () => setTimeout(createWindow, 400)); + setTimeout(createWindow, 400) + + // Quit when all windows are closed. + app.on('window-all-closed', () => { + // On OS X it is common for applications and their menu bar + // to stay active until the user quits explicitly with Cmd + Q + 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 (win === null) { + createWindow(); + } + }); + + } catch (e) { + // Catch Error + throw e; + } } startElectron(); diff --git a/src/app.ts b/src/app.ts index 4984510..c430af6 100644 --- a/src/app.ts +++ b/src/app.ts @@ -76,11 +76,11 @@ async function start() { //#endregion }); //#region @backend - if (Firedev.isNode) { - context.node.app.get('/hello', (req, res) => { - res.send('Hello static-columns') - }) - } + // if (Firedev.isNode) { + // context.node.app.get('/hello', (req, res) => { + // res.send('Hello static-columns') + // }) + // } //#endregion } //#endregion diff --git a/src/app/preview/preview.component.html b/src/app/preview/preview.component.html index 4a21454..f9f4642 100644 --- a/src/app/preview/preview.component.html +++ b/src/app/preview/preview.component.html @@ -5,7 +5,7 @@ - This is a demo of static-columns angular component.