assemblerjs 1.1.13 → 1.1.15
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/dist/index13.js +1 -1
- package/dist/index13.mjs +1 -1
- package/dist/index27.js +1 -1
- package/dist/index27.mjs +1 -1
- package/dist/index32.js +142 -93
- package/dist/index32.mjs +142 -93
- package/dist/index33.js +45 -23
- package/dist/index33.mjs +45 -23
- package/dist/index34.js +66 -127
- package/dist/index34.mjs +67 -128
- package/dist/index35.js +40 -46
- package/dist/index35.mjs +40 -46
- package/dist/index36.js +28 -76
- package/dist/index36.mjs +28 -76
- package/dist/index37.js +159 -41
- package/dist/index37.mjs +159 -41
- package/dist/index38.js +102 -28
- package/dist/index38.mjs +102 -28
- package/dist/index39.js +22 -156
- package/dist/index39.mjs +22 -156
- package/dist/index4.js +6 -6
- package/dist/index4.mjs +6 -6
- package/dist/index43.js +28 -941
- package/dist/index43.mjs +27 -941
- package/dist/index44.js +194 -2
- package/dist/index44.mjs +194 -2
- package/dist/index45.js +942 -2
- package/dist/index45.mjs +942 -2
- package/dist/index46.js +2 -29
- package/dist/index46.mjs +2 -28
- package/dist/index47.js +2 -194
- package/dist/index47.mjs +2 -194
- package/dist/index49.js +1 -1
- package/dist/index49.mjs +1 -1
- package/dist/index50.js +5 -1
- package/dist/index50.mjs +5 -1
- package/package.json +1 -1
package/dist/index39.mjs
CHANGED
|
@@ -1,164 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (o.constructor?.name && o.constructor.name !== 'Function') {
|
|
7
|
-
return o.constructor.name;
|
|
1
|
+
class PointcutMatcher {
|
|
2
|
+
static parse(t) {
|
|
3
|
+
const e = t.match(/^execution\(([^.]+)\.([^)]+)\)$/);
|
|
4
|
+
if (!e) {
|
|
5
|
+
throw new Error(`Invalid pointcut expression: ${t}`);
|
|
8
6
|
}
|
|
9
|
-
|
|
7
|
+
const [, c, r] = e;
|
|
8
|
+
return new ExecutionPointcutMatcher(c, r);
|
|
10
9
|
}
|
|
11
|
-
if (typeof o === 'object') {
|
|
12
|
-
if (o.name && typeof o.name === 'string') {
|
|
13
|
-
return o.name;
|
|
14
|
-
}
|
|
15
|
-
const e = o.constructor?.name;
|
|
16
|
-
if (e && e !== 'Object') {
|
|
17
|
-
return e;
|
|
18
|
-
}
|
|
19
|
-
return '[Object]';
|
|
20
|
-
}
|
|
21
|
-
return String(o);
|
|
22
10
|
}
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
logResolution(o, e, t) {}
|
|
33
|
-
logConstruction(o) {}
|
|
34
|
-
};
|
|
35
|
-
let ActiveDebugLogger = class ActiveDebugLogger {
|
|
36
|
-
configure(o) {
|
|
37
|
-
this.options = {
|
|
38
|
-
...this.options,
|
|
39
|
-
...o,
|
|
40
|
-
logPhases: {
|
|
41
|
-
...this.options.logPhases,
|
|
42
|
-
...o.logPhases || {}
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
logBuildStart(o) {
|
|
47
|
-
this.log('info', 'Build started', {
|
|
48
|
-
entry: o.name
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
logBuildEnd(o, e) {
|
|
52
|
-
const t = {
|
|
53
|
-
entry: o.name
|
|
54
|
-
};
|
|
55
|
-
if (e !== undefined) t.duration = `${e.toFixed(2)}ms`;
|
|
56
|
-
this.log('info', 'Build completed', t);
|
|
57
|
-
}
|
|
58
|
-
logRegistration(e) {
|
|
59
|
-
if (!this.shouldLog('registration')) return;
|
|
60
|
-
this.log('info', 'Registration', {
|
|
61
|
-
identifier: o(e.identifier),
|
|
62
|
-
isSingleton: e.isSingleton,
|
|
63
|
-
dependencies: e.dependencies.map((e)=>o(e)),
|
|
64
|
-
tags: e.tags
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
logHook(e, t, n) {
|
|
68
|
-
if (!this.shouldLog('hooks')) return;
|
|
69
|
-
const s = this.options.logTimings ? performance.now() : 0;
|
|
70
|
-
this.log('info', `Hook: ${e}`, {
|
|
71
|
-
target: o(t),
|
|
72
|
-
config: n
|
|
73
|
-
});
|
|
74
|
-
if (this.options.logTimings) {
|
|
75
|
-
return ()=>{
|
|
76
|
-
const o = performance.now() - s;
|
|
77
|
-
this.log('info', `Hook: ${e} completed`, {
|
|
78
|
-
duration: `${o.toFixed(2)}ms`
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
logPhaseStart(o, e) {
|
|
84
|
-
this.log('info', `Phase: ${o} started`, e);
|
|
85
|
-
}
|
|
86
|
-
logPhaseEnd(o, e, t) {
|
|
87
|
-
const n = e !== undefined ? {
|
|
88
|
-
duration: `${e.toFixed(2)}ms`
|
|
89
|
-
} : {};
|
|
90
|
-
if (t) {
|
|
91
|
-
Object.assign(n, t);
|
|
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 /.*/;
|
|
92
20
|
}
|
|
93
|
-
|
|
21
|
+
const e = t.replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*');
|
|
22
|
+
return new RegExp(`^${e}$`);
|
|
94
23
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
this.
|
|
98
|
-
strategy: `${e} strategy`,
|
|
99
|
-
cache: t ? 'hit' : 'miss'
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
logConstruction(o) {
|
|
103
|
-
if (!this.shouldLog('construction')) return;
|
|
104
|
-
this.log('info', `Constructing: ${o}`);
|
|
105
|
-
}
|
|
106
|
-
shouldLog(o) {
|
|
107
|
-
return !this.options.logPhases || this.options.logPhases[o] !== false;
|
|
108
|
-
}
|
|
109
|
-
log(o, e, t) {
|
|
110
|
-
if (this.options.logger) {
|
|
111
|
-
this.options.logger(o, e, t);
|
|
112
|
-
} else {
|
|
113
|
-
const n = `[Assembler:${o}]`;
|
|
114
|
-
const s = this.options.useColors !== false ? this.colorize(o, n) : n;
|
|
115
|
-
if (t) {
|
|
116
|
-
console.log(`${s} ${e}`, t);
|
|
117
|
-
} else {
|
|
118
|
-
console.log(`${s} ${e}`);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
colorize(o, e) {
|
|
123
|
-
const t = {
|
|
124
|
-
info: '\x1b[36m',
|
|
125
|
-
warn: '\x1b[33m',
|
|
126
|
-
error: '\x1b[31m',
|
|
127
|
-
reset: '\x1b[0m'
|
|
128
|
-
};
|
|
129
|
-
const n = t[o] || t.info;
|
|
130
|
-
return `${n}${e}${t.reset}`;
|
|
131
|
-
}
|
|
132
|
-
constructor(){
|
|
133
|
-
this.options = {
|
|
134
|
-
enabled: true,
|
|
135
|
-
logPhases: {
|
|
136
|
-
registration: true,
|
|
137
|
-
resolution: true,
|
|
138
|
-
construction: true,
|
|
139
|
-
hooks: true,
|
|
140
|
-
cache: true
|
|
141
|
-
},
|
|
142
|
-
logTimings: false,
|
|
143
|
-
logDependencyTree: true,
|
|
144
|
-
useColors: true
|
|
145
|
-
};
|
|
24
|
+
constructor(t, e){
|
|
25
|
+
this.classRegex = this.patternToRegex(t);
|
|
26
|
+
this.methodRegex = this.patternToRegex(e);
|
|
146
27
|
}
|
|
147
28
|
};
|
|
148
|
-
class DebugLogger {
|
|
149
|
-
static getInstance() {
|
|
150
|
-
return DebugLogger.instance;
|
|
151
|
-
}
|
|
152
|
-
static enable(o) {
|
|
153
|
-
DebugLogger.instance = new ActiveDebugLogger();
|
|
154
|
-
if (o) {
|
|
155
|
-
DebugLogger.instance.configure(o);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
static disable() {
|
|
159
|
-
DebugLogger.instance = new NoOpDebugLogger();
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
DebugLogger.instance = new NoOpDebugLogger();
|
|
163
29
|
|
|
164
|
-
export {
|
|
30
|
+
export { PointcutMatcher };
|
package/dist/index4.js
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
5
|
const core = require('@assemblerjs/core');
|
|
6
|
-
const injectableManager = require('./
|
|
7
|
-
const objectManager = require('./
|
|
8
|
-
const hookManager = require('./
|
|
9
|
-
const assemblerBuilder = require('./
|
|
10
|
-
const contextProvider = require('./
|
|
11
|
-
const debugLogger = require('./
|
|
6
|
+
const injectableManager = require('./index32.js');
|
|
7
|
+
const objectManager = require('./index33.js');
|
|
8
|
+
const hookManager = require('./index34.js');
|
|
9
|
+
const assemblerBuilder = require('./index35.js');
|
|
10
|
+
const contextProvider = require('./index36.js');
|
|
11
|
+
const debugLogger = require('./index37.js');
|
|
12
12
|
const eventManager = require('./index6.js');
|
|
13
13
|
|
|
14
14
|
class Assembler extends eventManager.EventManager {
|
package/dist/index4.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { clearInstance } from '@assemblerjs/core';
|
|
2
|
-
import { InjectableManager } from './
|
|
3
|
-
import { ObjectManager } from './
|
|
4
|
-
import { HookManager } from './
|
|
5
|
-
import { AssemblerBuilder } from './
|
|
6
|
-
import { ContextProvider } from './
|
|
7
|
-
import { DebugLogger } from './
|
|
2
|
+
import { InjectableManager } from './index32.mjs';
|
|
3
|
+
import { ObjectManager } from './index33.mjs';
|
|
4
|
+
import { HookManager } from './index34.mjs';
|
|
5
|
+
import { AssemblerBuilder } from './index35.mjs';
|
|
6
|
+
import { ContextProvider } from './index36.mjs';
|
|
7
|
+
import { DebugLogger } from './index37.mjs';
|
|
8
8
|
import { EventManager } from './index6.mjs';
|
|
9
9
|
|
|
10
10
|
class Assembler extends EventManager {
|