@fastcar/core 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fastcar/core",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "homepage": "https://github.com/williamDazhangyu/fast-car",
5
5
  "main": "target/index.js",
6
6
  "author": "william_zhong",
@@ -5,11 +5,11 @@ import TypeUtil from "../utils/TypeUtil";
5
5
  //基础服务的应用
6
6
  export default function Application(target: any) {
7
7
  return new Proxy(target, {
8
- construct: (target: ClassConstructor<Object>, args: any) => {
8
+ construct: (target: ClassConstructor<Object>, args: any, newTarget?: any) => {
9
9
  const FastCarApplication = require("../FastCarApplication").default;
10
10
 
11
11
  let app = new FastCarApplication();
12
- let appProxy = new target(...args);
12
+ let appProxy = Reflect.construct(target, args, newTarget);
13
13
  Reflect.set(appProxy, "app", app);
14
14
 
15
15
  let keys = ClassUtils.getProtoType(target);
@@ -4,8 +4,8 @@ import { ClassConstructor } from "../../type/ClassConstructor";
4
4
 
5
5
  export default function DemandInjection(Target: ClassConstructor<any>) {
6
6
  return new Proxy(Target, {
7
- construct: (Target: ClassConstructor<any>, args: any) => {
8
- let c = new Target(...args);
7
+ construct: (Target: ClassConstructor<any>, args: any, newTarget?: any) => {
8
+ let c = Reflect.construct(Target, args, newTarget);
9
9
  let app: any = Reflect.get(global, CommonConstant.FastcarApp);
10
10
 
11
11
  app?.loadInjectionService(c);
@@ -6,10 +6,10 @@ const TypeUtil_1 = require("../utils/TypeUtil");
6
6
  //基础服务的应用
7
7
  function Application(target) {
8
8
  return new Proxy(target, {
9
- construct: (target, args) => {
9
+ construct: (target, args, newTarget) => {
10
10
  const FastCarApplication = require("../FastCarApplication").default;
11
11
  let app = new FastCarApplication();
12
- let appProxy = new target(...args);
12
+ let appProxy = Reflect.construct(target, args, newTarget);
13
13
  Reflect.set(appProxy, "app", app);
14
14
  let keys = ClassUtils_1.default.getProtoType(target);
15
15
  for (let key of keys) {
@@ -5,8 +5,8 @@ exports.default = DemandInjection;
5
5
  const CommonConstant_1 = require("../../constant/CommonConstant");
6
6
  function DemandInjection(Target) {
7
7
  return new Proxy(Target, {
8
- construct: (Target, args) => {
9
- let c = new Target(...args);
8
+ construct: (Target, args, newTarget) => {
9
+ let c = Reflect.construct(Target, args, newTarget);
10
10
  let app = Reflect.get(global, CommonConstant_1.CommonConstant.FastcarApp);
11
11
  app?.loadInjectionService(c);
12
12
  app?.loadLoggerIOC(c);
@@ -0,0 +1,3 @@
1
+ {"timestamp":"2024-12-10 12:19:26.805","level":"INFO","label":"fastcar-server.logger","message":"自定义的日志输出"}
2
+ {"timestamp":"2024-12-10 12:19:26.806","level":"WARN","label":"fastcar-server.logger","message":"自定义警告"}
3
+ {"timestamp":"2024-12-10 12:19:26.806","level":"ERROR","label":"fastcar-server.logger","message":"自定义报错"}
@@ -0,0 +1,5 @@
1
+ {"timestamp":"2024-12-10 12:19:26.598","level":"INFO","label":"fastcar-server.sys","message":"Start scanning component"}
2
+ {"timestamp":"2024-12-10 12:19:26.795","level":"INFO","label":"fastcar-server.sys","message":"Complete component scan"}
3
+ {"timestamp":"2024-12-10 12:19:26.796","level":"INFO","label":"fastcar-server.sys","message":"Call application initialization method"}
4
+ {"timestamp":"2024-12-10 12:19:26.798","level":"INFO","label":"fastcar-server.sys","message":"start server app is run"}
5
+ {"timestamp":"2024-12-10 12:19:26.799","level":"INFO","label":"fastcar-server.sys","message":"version 1.0.0"}
File without changes
File without changes