Skip to content

Commit

Permalink
$$$ update $$$
Browse files Browse the repository at this point in the history
  • Loading branch information
darekf77 committed Apr 27, 2024
1 parent bbf7cea commit cb65a6d
Show file tree
Hide file tree
Showing 34 changed files with 299 additions and 380 deletions.
4 changes: 2 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.vscode
dist/
src/
/dist
/src
/docs
/preview
/tests
Expand Down
10 changes: 5 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"type": "node",
"request": "launch",
"name": "Launch Server standalone",
"name": "Debug/Start Server",
"program": "${workspaceFolder}/run.js",
"args": [
"port=4504",
Expand All @@ -18,7 +18,7 @@
]
},
{
"name": "Start electron app debug",
"name": "Debug/Start Electron",
"type": "node",
"request": "launch",
"protocol": "inspector",
Expand Down Expand Up @@ -46,10 +46,10 @@
],
"compounds": [
{
"name": "Debug Server + Electron App",
"name": "Debug/Start (Server + Electron)",
"configurations": [
"Launch Server standalone",
"Start electron app debug"
"Debug/Start Server",
"Debug/Start Electron"
]
}
]
Expand Down
64 changes: 31 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"ora": "3.4.0",
"socket.io": "2.4.1",
"tslib": "~2.3.0",
"tnp": "~16.5.30"
"tnp": "~16.5.41"
},
"license": "MIT",
"private": false,
Expand Down Expand Up @@ -110,7 +110,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",
Expand Down Expand Up @@ -148,12 +147,12 @@
"angular-material-css-vars": "5.0.2",
"angular-resize-event": "3.2.0",
"animate.css": "4.1.1 ",
"any-project-cli": "~16.5.27",
"any-project-cli": "~16.5.28",
"axios": "1.3.5",
"background-worker-process": "~16.5.22",
"background-worker-process": "~16.5.23",
"base32": "0.0.7",
"bcryptjs": "2.4.3",
"better-sqlite3": "7.6.2",
"better-sqlite3": "9.5.0",
"body-parser": "1.18.2",
"bootstrap": "4.6.2",
"buffer-shims": "1.0.0",
Expand Down Expand Up @@ -197,13 +196,13 @@
"file-saver": "2.0.5",
"file-type": "18.5.0",
"firedev": "^16",
"firedev-crud": "~16.5.66",
"firedev-crud-deamon": "~16.5.20",
"firedev-ports": "~16.5.22",
"firedev-storage": "~16.5.18",
"firedev-type-sql": "~16.5.18",
"firedev-typeorm": "~16.5.20",
"firedev-ui": "~16.5.19",
"firedev-crud": "~16.5.67",
"firedev-crud-deamon": "~16.5.21",
"firedev-ports": "~16.5.23",
"firedev-storage": "~16.5.19",
"firedev-type-sql": "~16.5.19",
"firedev-typeorm": "~16.5.21",
"firedev-ui": "~16.5.20",
"fkill": "6.1.0",
"font-awesome": "4.7.0",
"form-data": "4.0.0",
Expand All @@ -220,11 +219,11 @@
"image-focus": "1.2.1",
"immer": "10.0.2",
"immutable": "4.3.0",
"incremental-compiler": "~16.5.36",
"incremental-compiler": "~16.5.38",
"inquirer": "7.3.3",
"inquirer-autocomplete-prompt": "1.3.0",
"is-elevated": "3.0.0",
"isomorphic-region-loader": "~16.5.20",
"isomorphic-region-loader": "~16.5.21",
"istanbul-instrumenter-loader": "2.0.0",
"jest": "29.5.0",
"jest-date-mock": "1.0.8",
Expand All @@ -235,8 +234,8 @@
"joi": "17.9.2",
"jscodeshift": "0.6.3",
"json-stringify-safe": "5.0.1",
"json10": "~16.5.18",
"json10-writer": "~16.5.27",
"json10": "~16.5.19",
"json10-writer": "~16.5.28",
"json5": "2.2.1",
"json5-writer": "0.2.0",
"jszip": "3.10.1",
Expand All @@ -245,9 +244,9 @@
"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.19",
"magic-renamer": "~16.5.20",
"material-design-icons": "3.0.1",
"method-override": "2.3.10",
"minimist": "1.2.0",
Expand All @@ -259,9 +258,9 @@
"ng-in-viewport": "15.0.2",
"ng-lock": "16.0.1",
"ng-packagr": "16.0.1",
"ng-talkback": "~16.5.19",
"ng2-logger": "~16.5.29",
"ng2-rest": "~16.5.18",
"ng-talkback": "~16.5.20",
"ng2-logger": "~16.5.30",
"ng2-rest": "~16.5.19",
"ngx-ace-wrapper": "14.0.0",
"ngx-editor": "15.3.0",
"ngx-highlightjs": "9.0.0",
Expand All @@ -274,7 +273,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",
Expand All @@ -300,7 +299,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",
Expand All @@ -310,34 +309,33 @@
"sloc": "0.2.0",
"sort-package-json": "1.11.0",
"sql.js": "1.8.0",
"static-columns": "~16.5.22",
"static-columns": "~16.5.23",
"string-similarity": "4.0.2",
"sudo-block": "3.0.0",
"supertest": "6.3.3",
"sweetalert2": "11.7.12",
"systeminformation": "3.45.7",
"task.js": "0.1.5",
"threads": "1.7.0",
"tnp-cli": "~16.5.18",
"tnp-config": "~16.5.38",
"tnp-core": "~16.6.35",
"tnp-db": "~16.5.19",
"tnp-helpers": "~16.5.29",
"tnp-models": "~16.5.27",
"tnp-cli": "~16.5.19",
"tnp-config": "~16.5.39",
"tnp-core": "~16.6.36",
"tnp-db": "~16.5.20",
"tnp-helpers": "~16.5.30",
"tnp-models": "~16.5.28",
"ts-debug": "1.3.0",
"ts-loader": "2.3.1",
"ts-node": "10.9.1",
"tslint": "5.9.1",
"turndown": "7.1.2",
"typeorm": "~0.3.10",
"typescript": "~5.0.2",
"typescript-class-helpers": "~16.5.28",
"typescript-class-helpers": "~16.5.29",
"typescript-formatter": "~7.2.2",
"underscore": "1.9.1",
"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",
Expand Down
79 changes: 63 additions & 16 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
//#region @notForNpm

//#region imports
import { Firedev } from 'firedev/src';
import { Firedev } from './lib/index';
import { EMPTY, Observable, catchError, map, of, startWith } from 'rxjs';
import { Helpers, _ } from 'tnp-core/src';

import { HOST_BACKEND_PORT } from './app.hosts';

//#region @browser
import { NgModule } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';
//#endregion
import { SessionController } from './app/example/session.controller';
import { Session } from './app/example/session';
import { UserController } from './app/example/user.controller';
import { User } from './app/example/user';
import { SessionContext, UserContext } from './app/example/app.context';

//#endregion

//#region @browser
Expand Down Expand Up @@ -52,17 +43,73 @@ export class FiredevComponent implements OnInit {
export class FiredevModule { }
//#endregion

//#region user entity
//#region user
@Firedev.Entity({
className: 'User',
createTable: false
})
class User extends Firedev.Base.AbstractEntity {

//#endregion
//#region @websql
@Firedev.Orm.Column.String()
//#endregion
firstName: string;
}

@Firedev.Controller({
className: 'UserController',
path: 'users',
})
class UserController extends Firedev.Base.CrudController<User> {
provider = this.inject(UserProvider);

async initExampleDbData(): Promise<void> {
// console.log({ 'this.provider': this.provider });
// console.log(this.provider.helloFromUserProvier());
}


@Firedev.Http.GET()
hello(@Firedev.Http.Param.Query('user') user: string): Firedev.Response<string> {
return async (req, res) => {
return 'hello from user controller my dear ' + user;
}
}

async function start(portForBackend?: string) {
// console.log({ portForBackend })

// console.log('Helpers.isElectron', Helpers.isElectron)
// console.log('Your server will start on port ' + HOST_BACKEND_PORT);
}

@Firedev.Provider({
className: 'UserProvider',
})
class UserProvider extends Firedev.Base.Provider {

helloFromUserProvier() {
return 'hello from user provider';
}

}

const UserContext = Firedev.createContext({
host: `http://localhost:${HOST_BACKEND_PORT}`,
entities: {
User,
},
controllers: {
UserController,
},
providers: {
UserProvider,
}
});
//#endregion


async function start(portForBackend?: string) {
console.log({ portForBackend })
console.log('Helpers.isElectron', Helpers.isElectron)
console.log('Your server will start on port ' + HOST_BACKEND_PORT);
console.log(UserContext.ref.allInstances);

await UserContext.initialize({

Expand Down
Empty file added src/app/app.ts
Empty file.
54 changes: 0 additions & 54 deletions src/app/example/app.context.ts

This file was deleted.

25 changes: 0 additions & 25 deletions src/app/example/session.controller.ts

This file was deleted.

Loading

0 comments on commit cb65a6d

Please sign in to comment.