assemblerjs 1.1.2 → 1.1.3

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.
Files changed (80) hide show
  1. package/dist/index.d.ts +26 -0
  2. package/dist/index11.js +2 -2
  3. package/dist/index11.mjs +2 -2
  4. package/dist/index13.js +2 -2
  5. package/dist/index13.mjs +2 -2
  6. package/dist/index16.js +1 -1
  7. package/dist/index16.mjs +1 -1
  8. package/dist/index17.js +1 -1
  9. package/dist/index17.mjs +1 -1
  10. package/dist/index18.js +1 -1
  11. package/dist/index18.mjs +1 -1
  12. package/dist/index19.js +1 -1
  13. package/dist/index19.mjs +1 -1
  14. package/dist/index2.js +2 -2
  15. package/dist/index2.mjs +2 -2
  16. package/dist/index20.js +1 -1
  17. package/dist/index20.mjs +1 -1
  18. package/dist/index21.js +1 -1
  19. package/dist/index21.mjs +1 -1
  20. package/dist/index22.js +2 -2
  21. package/dist/index22.mjs +2 -2
  22. package/dist/index23.js +2 -2
  23. package/dist/index23.mjs +2 -2
  24. package/dist/index24.js +2 -2
  25. package/dist/index24.mjs +2 -2
  26. package/dist/index25.js +1 -1
  27. package/dist/index25.mjs +1 -1
  28. package/dist/index26.js +1 -1
  29. package/dist/index26.mjs +1 -1
  30. package/dist/index27.js +1 -1
  31. package/dist/index27.mjs +1 -1
  32. package/dist/index29.js +15 -38
  33. package/dist/index29.mjs +12 -37
  34. package/dist/index3.js +1 -1
  35. package/dist/index3.mjs +1 -1
  36. package/dist/index30.js +100 -58
  37. package/dist/index30.mjs +98 -58
  38. package/dist/index31.js +36 -27
  39. package/dist/index31.mjs +35 -27
  40. package/dist/index32.js +16 -59
  41. package/dist/index32.mjs +16 -59
  42. package/dist/index33.js +65 -28
  43. package/dist/index33.mjs +65 -28
  44. package/dist/index34.js +28 -28
  45. package/dist/index34.mjs +28 -28
  46. package/dist/index35.js +77 -15
  47. package/dist/index35.mjs +77 -12
  48. package/dist/index36.js +38 -104
  49. package/dist/index36.mjs +38 -102
  50. package/dist/index37.js +28 -102
  51. package/dist/index37.mjs +28 -102
  52. package/dist/index38.js +128 -23
  53. package/dist/index38.mjs +128 -23
  54. package/dist/index39.js +101 -18
  55. package/dist/index39.mjs +101 -18
  56. package/dist/index4.js +21 -8
  57. package/dist/index4.mjs +21 -8
  58. package/dist/index40.js +25 -25
  59. package/dist/index40.mjs +25 -24
  60. package/dist/index41.js +44 -18
  61. package/dist/index41.mjs +44 -17
  62. package/dist/index42.js +18 -44
  63. package/dist/index42.mjs +17 -44
  64. package/dist/index43.js +26 -191
  65. package/dist/index43.mjs +25 -191
  66. package/dist/index44.js +192 -940
  67. package/dist/index44.mjs +192 -940
  68. package/dist/index45.js +942 -2
  69. package/dist/index45.mjs +942 -2
  70. package/dist/index46.js +2 -2
  71. package/dist/index46.mjs +2 -2
  72. package/dist/index47.js +2 -14
  73. package/dist/index47.mjs +2 -14
  74. package/dist/index48.js +9 -34
  75. package/dist/index48.mjs +9 -34
  76. package/dist/index49.js +32 -55
  77. package/dist/index49.mjs +32 -54
  78. package/dist/index50.js +67 -0
  79. package/dist/index50.mjs +62 -0
  80. package/package.json +1 -1
package/dist/index38.js CHANGED
@@ -2,33 +2,138 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- class PointcutMatcher {
6
- static parse(t) {
7
- const e = t.match(/^execution\(([^.]+)\.([^)]+)\)$/);
8
- if (!e) {
9
- throw new Error(`Invalid pointcut expression: ${t}`);
5
+ let NoOpDebugLogger = class NoOpDebugLogger {
6
+ configure(o) {}
7
+ logBuildStart(o) {}
8
+ logBuildEnd(o, e) {}
9
+ logRegistration(o) {}
10
+ logHook(o, e, t) {}
11
+ logPhaseStart(o, e) {}
12
+ logPhaseEnd(o, e) {}
13
+ logResolution(o, e, t) {}
14
+ logConstruction(o) {}
15
+ };
16
+ let ActiveDebugLogger = class ActiveDebugLogger {
17
+ configure(o) {
18
+ this.options = {
19
+ ...this.options,
20
+ ...o,
21
+ logPhases: {
22
+ ...this.options.logPhases,
23
+ ...o.logPhases || {}
24
+ }
25
+ };
26
+ }
27
+ logBuildStart(o) {
28
+ this.log('info', 'Build started', {
29
+ entry: o.name
30
+ });
31
+ }
32
+ logBuildEnd(o, e) {
33
+ const t = {
34
+ entry: o.name
35
+ };
36
+ if (e !== undefined) t.duration = `${e.toFixed(2)}ms`;
37
+ this.log('info', 'Build completed', t);
38
+ }
39
+ logRegistration(o) {
40
+ if (!this.shouldLog('registration')) return;
41
+ this.log('info', 'Registration', {
42
+ identifier: o.identifier?.name || String(o.identifier),
43
+ isSingleton: o.isSingleton,
44
+ dependencies: o.dependencies.map((o)=>o?.name || String(o)),
45
+ tags: o.tags
46
+ });
47
+ }
48
+ logHook(o, e, t) {
49
+ if (!this.shouldLog('hooks')) return;
50
+ const s = this.options.logTimings ? performance.now() : 0;
51
+ this.log('info', `Hook: ${o}`, {
52
+ target: e.constructor?.name || e.name,
53
+ config: t
54
+ });
55
+ if (this.options.logTimings) {
56
+ return ()=>{
57
+ const e = performance.now() - s;
58
+ this.log('info', `Hook: ${o} completed`, {
59
+ duration: `${e.toFixed(2)}ms`
60
+ });
61
+ };
10
62
  }
11
- const [, c, r] = e;
12
- return new ExecutionPointcutMatcher(c, r);
13
63
  }
14
- }
15
- let ExecutionPointcutMatcher = class ExecutionPointcutMatcher {
16
- matches(t) {
17
- const e = t.target.constructor.name;
18
- const c = t.methodName;
19
- return this.classRegex.test(e) && this.methodRegex.test(c);
20
- }
21
- patternToRegex(t) {
22
- if (t === '*') {
23
- return /.*/;
64
+ logPhaseStart(o, e) {
65
+ this.log('info', `Phase: ${o} started`, e);
66
+ }
67
+ logPhaseEnd(o, e) {
68
+ const t = e !== undefined ? {
69
+ duration: `${e.toFixed(2)}ms`
70
+ } : undefined;
71
+ this.log('info', `Phase: ${o} ended`, t);
72
+ }
73
+ logResolution(o, e, t) {
74
+ if (!this.shouldLog('resolution')) return;
75
+ this.log('info', `Resolving: ${o}`, {
76
+ strategy: `${e} strategy`,
77
+ cache: t ? 'hit' : 'miss'
78
+ });
79
+ }
80
+ logConstruction(o) {
81
+ if (!this.shouldLog('construction')) return;
82
+ this.log('info', `Constructing: ${o}`);
83
+ }
84
+ shouldLog(o) {
85
+ return !this.options.logPhases || this.options.logPhases[o] !== false;
86
+ }
87
+ log(o, e, t) {
88
+ if (this.options.logger) {
89
+ this.options.logger(o, e, t);
90
+ } else {
91
+ const s = `[Assembler:${o}]`;
92
+ const i = this.options.useColors !== false ? this.colorize(o, s) : s;
93
+ const n = t ? ` ${JSON.stringify(t)}` : '';
94
+ console.log(`${i} ${e}${n}`);
24
95
  }
25
- const e = t.replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*');
26
- return new RegExp(`^${e}$`);
27
96
  }
28
- constructor(t, e){
29
- this.classRegex = this.patternToRegex(t);
30
- this.methodRegex = this.patternToRegex(e);
97
+ colorize(o, e) {
98
+ const t = {
99
+ info: '\x1b[36m',
100
+ warn: '\x1b[33m',
101
+ error: '\x1b[31m',
102
+ reset: '\x1b[0m'
103
+ };
104
+ const s = t[o] || t.info;
105
+ return `${s}${e}${t.reset}`;
106
+ }
107
+ constructor(){
108
+ this.options = {
109
+ enabled: true,
110
+ logPhases: {
111
+ registration: true,
112
+ resolution: true,
113
+ construction: true,
114
+ hooks: true,
115
+ cache: true
116
+ },
117
+ logTimings: false,
118
+ logDependencyTree: true,
119
+ useColors: true
120
+ };
31
121
  }
32
122
  };
123
+ class DebugLogger {
124
+ static getInstance() {
125
+ return DebugLogger.instance;
126
+ }
127
+ static enable(o) {
128
+ DebugLogger.instance = new ActiveDebugLogger();
129
+ if (o) {
130
+ DebugLogger.instance.configure(o);
131
+ }
132
+ }
133
+ static disable() {
134
+ DebugLogger.instance = new NoOpDebugLogger();
135
+ }
136
+ }
137
+ DebugLogger.instance = new NoOpDebugLogger();
33
138
 
34
- exports.PointcutMatcher = PointcutMatcher;
139
+ exports.DebugLogger = DebugLogger;
package/dist/index38.mjs CHANGED
@@ -1,30 +1,135 @@
1
- class PointcutMatcher {
2
- static parse(t) {
3
- const e = t.match(/^execution\(([^.]+)\.([^)]+)\)$/);
4
- if (!e) {
5
- throw new Error(`Invalid pointcut expression: ${t}`);
1
+ let NoOpDebugLogger = class NoOpDebugLogger {
2
+ configure(o) {}
3
+ logBuildStart(o) {}
4
+ logBuildEnd(o, e) {}
5
+ logRegistration(o) {}
6
+ logHook(o, e, t) {}
7
+ logPhaseStart(o, e) {}
8
+ logPhaseEnd(o, e) {}
9
+ logResolution(o, e, t) {}
10
+ logConstruction(o) {}
11
+ };
12
+ let ActiveDebugLogger = class ActiveDebugLogger {
13
+ configure(o) {
14
+ this.options = {
15
+ ...this.options,
16
+ ...o,
17
+ logPhases: {
18
+ ...this.options.logPhases,
19
+ ...o.logPhases || {}
20
+ }
21
+ };
22
+ }
23
+ logBuildStart(o) {
24
+ this.log('info', 'Build started', {
25
+ entry: o.name
26
+ });
27
+ }
28
+ logBuildEnd(o, e) {
29
+ const t = {
30
+ entry: o.name
31
+ };
32
+ if (e !== undefined) t.duration = `${e.toFixed(2)}ms`;
33
+ this.log('info', 'Build completed', t);
34
+ }
35
+ logRegistration(o) {
36
+ if (!this.shouldLog('registration')) return;
37
+ this.log('info', 'Registration', {
38
+ identifier: o.identifier?.name || String(o.identifier),
39
+ isSingleton: o.isSingleton,
40
+ dependencies: o.dependencies.map((o)=>o?.name || String(o)),
41
+ tags: o.tags
42
+ });
43
+ }
44
+ logHook(o, e, t) {
45
+ if (!this.shouldLog('hooks')) return;
46
+ const s = this.options.logTimings ? performance.now() : 0;
47
+ this.log('info', `Hook: ${o}`, {
48
+ target: e.constructor?.name || e.name,
49
+ config: t
50
+ });
51
+ if (this.options.logTimings) {
52
+ return ()=>{
53
+ const e = performance.now() - s;
54
+ this.log('info', `Hook: ${o} completed`, {
55
+ duration: `${e.toFixed(2)}ms`
56
+ });
57
+ };
6
58
  }
7
- const [, c, r] = e;
8
- return new ExecutionPointcutMatcher(c, r);
9
59
  }
10
- }
11
- let ExecutionPointcutMatcher = class ExecutionPointcutMatcher {
12
- matches(t) {
13
- const e = t.target.constructor.name;
14
- const c = t.methodName;
15
- return this.classRegex.test(e) && this.methodRegex.test(c);
16
- }
17
- patternToRegex(t) {
18
- if (t === '*') {
19
- return /.*/;
60
+ logPhaseStart(o, e) {
61
+ this.log('info', `Phase: ${o} started`, e);
62
+ }
63
+ logPhaseEnd(o, e) {
64
+ const t = e !== undefined ? {
65
+ duration: `${e.toFixed(2)}ms`
66
+ } : undefined;
67
+ this.log('info', `Phase: ${o} ended`, t);
68
+ }
69
+ logResolution(o, e, t) {
70
+ if (!this.shouldLog('resolution')) return;
71
+ this.log('info', `Resolving: ${o}`, {
72
+ strategy: `${e} strategy`,
73
+ cache: t ? 'hit' : 'miss'
74
+ });
75
+ }
76
+ logConstruction(o) {
77
+ if (!this.shouldLog('construction')) return;
78
+ this.log('info', `Constructing: ${o}`);
79
+ }
80
+ shouldLog(o) {
81
+ return !this.options.logPhases || this.options.logPhases[o] !== false;
82
+ }
83
+ log(o, e, t) {
84
+ if (this.options.logger) {
85
+ this.options.logger(o, e, t);
86
+ } else {
87
+ const s = `[Assembler:${o}]`;
88
+ const i = this.options.useColors !== false ? this.colorize(o, s) : s;
89
+ const n = t ? ` ${JSON.stringify(t)}` : '';
90
+ console.log(`${i} ${e}${n}`);
20
91
  }
21
- const e = t.replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*');
22
- return new RegExp(`^${e}$`);
23
92
  }
24
- constructor(t, e){
25
- this.classRegex = this.patternToRegex(t);
26
- this.methodRegex = this.patternToRegex(e);
93
+ colorize(o, e) {
94
+ const t = {
95
+ info: '\x1b[36m',
96
+ warn: '\x1b[33m',
97
+ error: '\x1b[31m',
98
+ reset: '\x1b[0m'
99
+ };
100
+ const s = t[o] || t.info;
101
+ return `${s}${e}${t.reset}`;
102
+ }
103
+ constructor(){
104
+ this.options = {
105
+ enabled: true,
106
+ logPhases: {
107
+ registration: true,
108
+ resolution: true,
109
+ construction: true,
110
+ hooks: true,
111
+ cache: true
112
+ },
113
+ logTimings: false,
114
+ logDependencyTree: true,
115
+ useColors: true
116
+ };
27
117
  }
28
118
  };
119
+ class DebugLogger {
120
+ static getInstance() {
121
+ return DebugLogger.instance;
122
+ }
123
+ static enable(o) {
124
+ DebugLogger.instance = new ActiveDebugLogger();
125
+ if (o) {
126
+ DebugLogger.instance.configure(o);
127
+ }
128
+ }
129
+ static disable() {
130
+ DebugLogger.instance = new NoOpDebugLogger();
131
+ }
132
+ }
133
+ DebugLogger.instance = new NoOpDebugLogger();
29
134
 
30
- export { PointcutMatcher };
135
+ export { DebugLogger };
package/dist/index39.js CHANGED
@@ -2,27 +2,110 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- class ResolverStore {
6
- static register(e, r) {
7
- this.resolvers.set(e, r);
8
- }
9
- static getResolver(e) {
10
- const r = this.resolvers.get(e);
11
- if (!r) {
12
- throw new Error(`No resolver found for decorator type: ${e}`);
5
+ const transversalManager = require('./index13.js');
6
+ const affect = require('./index12.js');
7
+
8
+ class TransversalWeaver {
9
+ static weave(n, r, o) {
10
+ const c = transversalManager.TransversalManager.getInstance(o);
11
+ const s = c.getAspectsForTarget(r);
12
+ const a = Object.getPrototypeOf(n);
13
+ const f = Object.getOwnPropertyNames(a).some((t)=>{
14
+ if (t === 'constructor') return false;
15
+ const n = Object.getOwnPropertyDescriptor(a, t);
16
+ if (!n) return false;
17
+ const r = n.value && typeof n.value === 'function';
18
+ const o = n.get && typeof n.get === 'function';
19
+ if (!r && !o) return false;
20
+ const c = affect.getAffectedMethods(a, t);
21
+ return c.length > 0;
22
+ });
23
+ if (s.length === 0 && !f) {
24
+ return n;
13
25
  }
14
- return new r();
26
+ return new Proxy(n, {
27
+ get (t, e, n) {
28
+ const r = Reflect.get(t, e, n);
29
+ if (typeof r !== 'function') {
30
+ return r;
31
+ }
32
+ return function(...n) {
33
+ const o = String(e);
34
+ const a = {
35
+ target: t,
36
+ methodName: o,
37
+ args: n
38
+ };
39
+ const f = c.getAdvicesForJoinPoint(a, s, t, e);
40
+ return TransversalWeaver.executeAdviceChain(f, r, t, n, a);
41
+ };
42
+ }
43
+ });
15
44
  }
16
- static hasResolver(e) {
17
- return this.resolvers.has(e);
18
- }
19
- static getRegisteredTypes() {
20
- return Array.from(this.resolvers.keys());
45
+ static executeAdviceChain(t, e, n, r, o) {
46
+ const c = t.filter((t)=>t.type === 'before');
47
+ const s = t.filter((t)=>t.type === 'around');
48
+ const a = t.filter((t)=>t.type === 'after');
49
+ try {
50
+ for (const t of c){
51
+ const e = {
52
+ ...o,
53
+ config: t.config
54
+ };
55
+ t.method.call(t.transversalInstance, e);
56
+ }
57
+ let t;
58
+ if (s.length > 0) {
59
+ t = this.buildAroundChain(s, e, n, r, o);
60
+ } else {
61
+ t = e.apply(n, r);
62
+ }
63
+ if (t instanceof Promise) {
64
+ return t.then((t)=>{
65
+ for (const e of a){
66
+ const n = {
67
+ ...o,
68
+ result: t
69
+ };
70
+ e.method.call(e.transversalInstance, n);
71
+ }
72
+ return t;
73
+ }).catch((t)=>{
74
+ o.error = t;
75
+ throw t;
76
+ });
77
+ }
78
+ for (const e of a){
79
+ const n = {
80
+ ...o,
81
+ result: t,
82
+ config: e.config
83
+ };
84
+ e.method.call(e.transversalInstance, n);
85
+ }
86
+ return t;
87
+ } catch (t) {
88
+ o.error = t;
89
+ throw t;
90
+ }
21
91
  }
22
- static clear() {
23
- this.resolvers.clear();
92
+ static buildAroundChain(t, e, n, r, o) {
93
+ let c = 0;
94
+ const s = ()=>{
95
+ if (c < t.length) {
96
+ const e = t[c++];
97
+ const n = {
98
+ ...o,
99
+ proceed: s,
100
+ config: e.config
101
+ };
102
+ return e.method.call(e.transversalInstance, n);
103
+ } else {
104
+ return e.apply(n, r);
105
+ }
106
+ };
107
+ return s();
24
108
  }
25
109
  }
26
- ResolverStore.resolvers = new Map();
27
110
 
28
- exports.ResolverStore = ResolverStore;
111
+ exports.TransversalWeaver = TransversalWeaver;
package/dist/index39.mjs CHANGED
@@ -1,24 +1,107 @@
1
- class ResolverStore {
2
- static register(e, r) {
3
- this.resolvers.set(e, r);
4
- }
5
- static getResolver(e) {
6
- const r = this.resolvers.get(e);
7
- if (!r) {
8
- throw new Error(`No resolver found for decorator type: ${e}`);
1
+ import { TransversalManager } from './index13.mjs';
2
+ import { getAffectedMethods } from './index12.mjs';
3
+
4
+ class TransversalWeaver {
5
+ static weave(n, r, o) {
6
+ const c = TransversalManager.getInstance(o);
7
+ const s = c.getAspectsForTarget(r);
8
+ const a = Object.getPrototypeOf(n);
9
+ const f = Object.getOwnPropertyNames(a).some((t)=>{
10
+ if (t === 'constructor') return false;
11
+ const n = Object.getOwnPropertyDescriptor(a, t);
12
+ if (!n) return false;
13
+ const r = n.value && typeof n.value === 'function';
14
+ const o = n.get && typeof n.get === 'function';
15
+ if (!r && !o) return false;
16
+ const c = getAffectedMethods(a, t);
17
+ return c.length > 0;
18
+ });
19
+ if (s.length === 0 && !f) {
20
+ return n;
9
21
  }
10
- return new r();
22
+ return new Proxy(n, {
23
+ get (t, e, n) {
24
+ const r = Reflect.get(t, e, n);
25
+ if (typeof r !== 'function') {
26
+ return r;
27
+ }
28
+ return function(...n) {
29
+ const o = String(e);
30
+ const a = {
31
+ target: t,
32
+ methodName: o,
33
+ args: n
34
+ };
35
+ const f = c.getAdvicesForJoinPoint(a, s, t, e);
36
+ return TransversalWeaver.executeAdviceChain(f, r, t, n, a);
37
+ };
38
+ }
39
+ });
11
40
  }
12
- static hasResolver(e) {
13
- return this.resolvers.has(e);
14
- }
15
- static getRegisteredTypes() {
16
- return Array.from(this.resolvers.keys());
41
+ static executeAdviceChain(t, e, n, r, o) {
42
+ const c = t.filter((t)=>t.type === 'before');
43
+ const s = t.filter((t)=>t.type === 'around');
44
+ const a = t.filter((t)=>t.type === 'after');
45
+ try {
46
+ for (const t of c){
47
+ const e = {
48
+ ...o,
49
+ config: t.config
50
+ };
51
+ t.method.call(t.transversalInstance, e);
52
+ }
53
+ let t;
54
+ if (s.length > 0) {
55
+ t = this.buildAroundChain(s, e, n, r, o);
56
+ } else {
57
+ t = e.apply(n, r);
58
+ }
59
+ if (t instanceof Promise) {
60
+ return t.then((t)=>{
61
+ for (const e of a){
62
+ const n = {
63
+ ...o,
64
+ result: t
65
+ };
66
+ e.method.call(e.transversalInstance, n);
67
+ }
68
+ return t;
69
+ }).catch((t)=>{
70
+ o.error = t;
71
+ throw t;
72
+ });
73
+ }
74
+ for (const e of a){
75
+ const n = {
76
+ ...o,
77
+ result: t,
78
+ config: e.config
79
+ };
80
+ e.method.call(e.transversalInstance, n);
81
+ }
82
+ return t;
83
+ } catch (t) {
84
+ o.error = t;
85
+ throw t;
86
+ }
17
87
  }
18
- static clear() {
19
- this.resolvers.clear();
88
+ static buildAroundChain(t, e, n, r, o) {
89
+ let c = 0;
90
+ const s = ()=>{
91
+ if (c < t.length) {
92
+ const e = t[c++];
93
+ const n = {
94
+ ...o,
95
+ proceed: s,
96
+ config: e.config
97
+ };
98
+ return e.method.call(e.transversalInstance, n);
99
+ } else {
100
+ return e.apply(n, r);
101
+ }
102
+ };
103
+ return s();
20
104
  }
21
105
  }
22
- ResolverStore.resolvers = new Map();
23
106
 
24
- export { ResolverStore };
107
+ export { TransversalWeaver };
package/dist/index4.js CHANGED
@@ -3,18 +3,31 @@
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
5
  const core = require('@assemblerjs/core');
6
- const injectableManager = require('./index30.js');
7
- const objectManager = require('./index31.js');
8
- const hookManager = require('./index32.js');
9
- const assemblerBuilder = require('./index33.js');
10
- const contextProvider = require('./index34.js');
6
+ const injectableManager = require('./index33.js');
7
+ const objectManager = require('./index34.js');
8
+ const hookManager = require('./index35.js');
9
+ const assemblerBuilder = require('./index36.js');
10
+ const contextProvider = require('./index37.js');
11
+ const debugLogger = require('./index38.js');
11
12
  const eventManager = require('./index6.js');
12
13
 
13
14
  class Assembler extends eventManager.EventManager {
15
+ static enableDebug(e) {
16
+ debugLogger.DebugLogger.enable(e);
17
+ }
18
+ static disableDebug() {
19
+ debugLogger.DebugLogger.disable();
20
+ }
14
21
  static build(e, t) {
15
- const r = new Assembler();
16
- const a = new assemblerBuilder.AssemblerBuilder(r);
17
- return a.build(e, t);
22
+ const r = debugLogger.DebugLogger.getInstance();
23
+ const a = performance.now();
24
+ r.logBuildStart(e);
25
+ const n = new Assembler();
26
+ const o = new assemblerBuilder.AssemblerBuilder(n);
27
+ const c = o.build(e, t);
28
+ const l = performance.now() - a;
29
+ r.logBuildEnd(e, l);
30
+ return c;
18
31
  }
19
32
  get hookManager() {
20
33
  return this._hookManager;
package/dist/index4.mjs CHANGED
@@ -1,16 +1,29 @@
1
1
  import { clearInstance } from '@assemblerjs/core';
2
- import { InjectableManager } from './index30.mjs';
3
- import { ObjectManager } from './index31.mjs';
4
- import { HookManager } from './index32.mjs';
5
- import { AssemblerBuilder } from './index33.mjs';
6
- import { ContextProvider } from './index34.mjs';
2
+ import { InjectableManager } from './index33.mjs';
3
+ import { ObjectManager } from './index34.mjs';
4
+ import { HookManager } from './index35.mjs';
5
+ import { AssemblerBuilder } from './index36.mjs';
6
+ import { ContextProvider } from './index37.mjs';
7
+ import { DebugLogger } from './index38.mjs';
7
8
  import { EventManager } from './index6.mjs';
8
9
 
9
10
  class Assembler extends EventManager {
11
+ static enableDebug(e) {
12
+ DebugLogger.enable(e);
13
+ }
14
+ static disableDebug() {
15
+ DebugLogger.disable();
16
+ }
10
17
  static build(e, t) {
11
- const r = new Assembler();
12
- const a = new AssemblerBuilder(r);
13
- return a.build(e, t);
18
+ const r = DebugLogger.getInstance();
19
+ const a = performance.now();
20
+ r.logBuildStart(e);
21
+ const n = new Assembler();
22
+ const o = new AssemblerBuilder(n);
23
+ const c = o.build(e, t);
24
+ const l = performance.now() - a;
25
+ r.logBuildEnd(e, l);
26
+ return c;
14
27
  }
15
28
  get hookManager() {
16
29
  return this._hookManager;