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 dc94e49 commit bbf7cea
Show file tree
Hide file tree
Showing 30 changed files with 1,391 additions and 744 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": "Debug/Start Server",
"name": "Launch Server standalone",
"program": "${workspaceFolder}/run.js",
"args": [
"port=4504",
Expand All @@ -18,7 +18,7 @@
]
},
{
"name": "Debug/Start Electron",
"name": "Start electron app debug",
"type": "node",
"request": "launch",
"protocol": "inspector",
Expand Down Expand Up @@ -46,10 +46,10 @@
],
"compounds": [
{
"name": "Debug/Start (Server + Electron)",
"name": "Debug Server + Electron App",
"configurations": [
"Debug/Start Server",
"Debug/Start Electron"
"Launch Server standalone",
"Start electron app debug"
]
}
]
Expand Down
66 changes: 34 additions & 32 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.41"
"tnp": "~16.5.30"
},
"license": "MIT",
"private": false,
Expand Down Expand Up @@ -110,6 +110,7 @@
"@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 @@ -147,12 +148,12 @@
"angular-material-css-vars": "5.0.2",
"angular-resize-event": "3.2.0",
"animate.css": "4.1.1 ",
"any-project-cli": "~16.5.28",
"any-project-cli": "~16.5.27",
"axios": "1.3.5",
"background-worker-process": "~16.5.23",
"background-worker-process": "~16.5.22",
"base32": "0.0.7",
"bcryptjs": "2.4.3",
"better-sqlite3": "9.5.0",
"better-sqlite3": "7.6.2",
"body-parser": "1.18.2",
"bootstrap": "4.6.2",
"buffer-shims": "1.0.0",
Expand Down Expand Up @@ -196,13 +197,13 @@
"file-saver": "2.0.5",
"file-type": "18.5.0",
"firedev": "^16",
"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",
"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",
"fkill": "6.1.0",
"font-awesome": "4.7.0",
"form-data": "4.0.0",
Expand All @@ -219,11 +220,11 @@
"image-focus": "1.2.1",
"immer": "10.0.2",
"immutable": "4.3.0",
"incremental-compiler": "~16.5.38",
"incremental-compiler": "~16.5.36",
"inquirer": "7.3.3",
"inquirer-autocomplete-prompt": "1.3.0",
"is-elevated": "3.0.0",
"isomorphic-region-loader": "~16.5.21",
"isomorphic-region-loader": "~16.5.20",
"istanbul-instrumenter-loader": "2.0.0",
"jest": "29.5.0",
"jest-date-mock": "1.0.8",
Expand All @@ -234,8 +235,8 @@
"joi": "17.9.2",
"jscodeshift": "0.6.3",
"json-stringify-safe": "5.0.1",
"json10": "~16.5.19",
"json10-writer": "~16.5.28",
"json10": "~16.5.18",
"json10-writer": "~16.5.27",
"json5": "2.2.1",
"json5-writer": "0.2.0",
"jszip": "3.10.1",
Expand All @@ -244,9 +245,9 @@
"localforage": "1.10.0",
"lockfile": "1.0.4",
"lodash": "4.17.20",
"lodash-walk-object": "~16.5.19",
"lodash-walk-object": "~16.5.18",
"lowdb": "1.0.0",
"magic-renamer": "~16.5.20",
"magic-renamer": "~16.5.19",
"material-design-icons": "3.0.1",
"method-override": "2.3.10",
"minimist": "1.2.0",
Expand All @@ -258,9 +259,9 @@
"ng-in-viewport": "15.0.2",
"ng-lock": "16.0.1",
"ng-packagr": "16.0.1",
"ng-talkback": "~16.5.20",
"ng2-logger": "~16.5.30",
"ng2-rest": "~16.5.19",
"ng-talkback": "~16.5.19",
"ng2-logger": "~16.5.29",
"ng2-rest": "~16.5.18",
"ngx-ace-wrapper": "14.0.0",
"ngx-editor": "15.3.0",
"ngx-highlightjs": "9.0.0",
Expand All @@ -273,7 +274,7 @@
"ngx-scrolltop": "6.0.0",
"ngx-store": "3.1.1",
"ngx-typed-js": "2.1.1",
"node-cli-tester": "~16.5.20",
"node-cli-tester": "~16.5.19",
"node-localstorage": "2.1.6",
"node-notifier": "6.0.0",
"node-polyfill-webpack-plugin": "2.0.1",
Expand All @@ -299,7 +300,7 @@
"q": "1.5.1",
"rallax.js": "2.0.4",
"randomcolor": "0.5.3",
"record-replay-req-res-scenario": "~16.5.19",
"record-replay-req-res-scenario": "~16.5.18",
"reflect-metadata": "0.1.10",
"rimraf": "2.6.2",
"rxjs": "~7.8.0",
Expand All @@ -309,33 +310,34 @@
"sloc": "0.2.0",
"sort-package-json": "1.11.0",
"sql.js": "1.8.0",
"static-columns": "~16.5.23",
"static-columns": "~16.5.22",
"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.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",
"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",
"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.29",
"typescript-class-helpers": "~16.5.28",
"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.22",
"vpn-split": "~16.5.21",
"watch": "1.0.2",
"webpack": "~5.80",
"webpack-dev-middleware": "~6.0.2",
Expand All @@ -349,4 +351,4 @@
"firedev-debug": "bin/firedev-debug",
"firedev-debug-brk": "bin/firedev-debug-brk"
}
}
}
4 changes: 2 additions & 2 deletions src/app/example/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { SessionController } from "./session.controller";
import { User } from "./user";
import { TypecodesController } from "./typecode.controller";

// @Firedev.Controller({ className: 'UserController', entity: User })
export class UserController extends Firedev.BaseController<any> {
@Firedev.Controller({ className: 'UserController', entity: User })
export class UserController extends Firedev.Base.Controller<any> {
session: SessionController;
typecodesController: TypecodesController = this.inject(TypecodesController);

Expand Down
11 changes: 11 additions & 0 deletions src/lib/base-classes/base-abstract-entity.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { EndpointContext } from "../endpoint-context";
import { Symbols } from "../symbols";
import { BaseEntity } from "./base-entity";


export class BaseAbstractEntity extends BaseEntity {

id: string;

version: number;
}
15 changes: 15 additions & 0 deletions src/lib/base-classes/base-class.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { EndpointContext } from "../endpoint-context";
import { Symbols } from "../symbols";


export class BaseClass {
inject<T>(ctor: new (...args: any[]) => T): T {
return new Proxy({}, {
get: (_, propName) => {
const res = this[Symbols.ctxInClassOrClassObj] as EndpointContext;
let instance: T = res.inject(ctor);
return typeof instance[propName] === 'function' ? instance[propName].bind(instance) : instance[propName];
},
}) as T;
}
}
9 changes: 9 additions & 0 deletions src/lib/base-classes/base-controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { EndpointContext } from "../endpoint-context";
import { Symbols } from "../symbols";
import { BaseClass } from "./base-class";


export class BaseController extends BaseClass {

}

10 changes: 10 additions & 0 deletions src/lib/base-classes/base-crud-controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { EndpointContext } from "../endpoint-context";
import { Symbols } from "../symbols";
import { BaseController } from "./base-controller";


export class BaseCrudController extends BaseController {
constructor(__entity: Function) {
super();
}
}
8 changes: 8 additions & 0 deletions src/lib/base-classes/base-entity.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { EndpointContext } from "../endpoint-context";
import { Symbols } from "../symbols";
import { BaseClass } from "./base-class";


export class BaseEntity extends BaseClass {

}
8 changes: 8 additions & 0 deletions src/lib/base-classes/base-provider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { EndpointContext } from "../endpoint-context";
import { Symbols } from "../symbols";
import { BaseClass } from "./base-class";


export class BaseProvider extends BaseClass {

}
14 changes: 14 additions & 0 deletions src/lib/base-classes/base-repository.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//#region @websql
import { ObjectLiteral, Repository } from "firedev-typeorm/lib";
//#endregion
import { EndpointContext } from "../endpoint-context";
import { Symbols } from "../symbols";

export class BaseRepository
//#region @websql
<Entity extends ObjectLiteral>
extends Repository<Entity>
//#endregion
{

}
17 changes: 17 additions & 0 deletions src/lib/base-classes/base.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import * as controller from './base-controller';
import * as crudController from './base-crud-controller';
import * as entity from './base-entity';
import * as abstractEntity from './base-abstract-entity';
import * as repository from './base-repository';
import * as provider from './base-provider';

export namespace Base {
export import Controller = controller;
export import CrudController = crudController;
export import Entity = entity;
export import AbstractEntity = abstractEntity;
export import Provider = provider;
//#region @websql
export import Repository = repository;
//#endregion
}
Loading

0 comments on commit bbf7cea

Please sign in to comment.