@travetto/registry 4.0.0-rc.0 → 4.0.0-rc.1
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": "@travetto/registry",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.1",
|
|
4
4
|
"description": "Patterns and utilities for handling registration of metadata and functionality for run-time use",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ast-transformations",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"directory": "module/registry"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@travetto/base": "^4.0.0-rc.
|
|
30
|
+
"@travetto/base": "^4.0.0-rc.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@travetto/cli": "^4.0.0-rc.
|
|
34
|
-
"@travetto/transformer": "^4.0.0-rc.
|
|
33
|
+
"@travetto/cli": "^4.0.0-rc.1",
|
|
34
|
+
"@travetto/transformer": "^4.0.0-rc.1"
|
|
35
35
|
},
|
|
36
36
|
"peerDependenciesMeta": {
|
|
37
37
|
"@travetto/transformer": {
|
|
@@ -43,8 +43,8 @@ export class DynamicCommonjsLoader {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
const fileName = Module._resolveFilename!(request, parent);
|
|
46
|
-
// Only proxy
|
|
47
|
-
if (RuntimeIndex.getModuleFromSource(fileName)?.
|
|
46
|
+
// Only proxy workspace modules
|
|
47
|
+
if (RuntimeIndex.getModuleFromSource(fileName)?.workspace) {
|
|
48
48
|
return proxyModuleLoad ? proxyModuleLoad(fileName, mod) : mod;
|
|
49
49
|
} else {
|
|
50
50
|
return mod;
|
|
@@ -65,11 +65,13 @@ class $DynamicFileLoader {
|
|
|
65
65
|
.on('uncaughtException', handle);
|
|
66
66
|
|
|
67
67
|
// Fire off, and let it run in the bg. Restart on exit
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
(async (): Promise<void> => {
|
|
69
|
+
for await (const ev of watchCompiler<FullWatchEvent>({ restartOnExit: true })) {
|
|
70
|
+
if (ev.file && RuntimeIndex.hasModule(ev.module) && VALID_FILE_TYPES.has(ManifestModuleUtil.getFileType(ev.file))) {
|
|
71
|
+
await this.dispatch(ev);
|
|
72
|
+
}
|
|
71
73
|
}
|
|
72
|
-
}
|
|
74
|
+
})();
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
|
package/src/service/metadata.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Class
|
|
1
|
+
import { Class } from '@travetto/base';
|
|
2
2
|
|
|
3
3
|
import { Registry } from '../registry';
|
|
4
4
|
import { ChangeEvent } from '../types';
|
|
@@ -13,7 +13,6 @@ function id(cls: string | Class): string {
|
|
|
13
13
|
export abstract class MetadataRegistry<C extends { class: Class }, M = unknown, F = Function> extends Registry {
|
|
14
14
|
|
|
15
15
|
static id = id;
|
|
16
|
-
|
|
17
16
|
/**
|
|
18
17
|
* Classes pending removal
|
|
19
18
|
*/
|
|
@@ -142,7 +141,7 @@ export abstract class MetadataRegistry<C extends { class: Class }, M = unknown,
|
|
|
142
141
|
*/
|
|
143
142
|
register(cls: Class, pConfig: Partial<C> = {}): void {
|
|
144
143
|
const conf = this.getOrCreatePending(cls);
|
|
145
|
-
|
|
144
|
+
Object.assign(conf, pConfig);
|
|
146
145
|
}
|
|
147
146
|
|
|
148
147
|
/**
|
|
@@ -150,7 +149,7 @@ export abstract class MetadataRegistry<C extends { class: Class }, M = unknown,
|
|
|
150
149
|
*/
|
|
151
150
|
registerField(cls: Class, field: F, pConfig: Partial<M>): void {
|
|
152
151
|
const conf = this.getOrCreatePendingField(cls, field);
|
|
153
|
-
|
|
152
|
+
Object.assign(conf, pConfig);
|
|
154
153
|
}
|
|
155
154
|
|
|
156
155
|
/**
|