@travetto/registry 7.0.4 → 7.0.6
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/README.md +3 -3
- package/package.json +2 -2
- package/src/registry.ts +5 -5
- package/src/store.ts +1 -1
package/README.md
CHANGED
|
@@ -28,8 +28,8 @@ This flow ensures all files are loaded and processed before application starts.
|
|
|
28
28
|
|
|
29
29
|
**Code: Sample Registry**
|
|
30
30
|
```typescript
|
|
31
|
-
import { Class } from '@travetto/runtime';
|
|
32
|
-
import {
|
|
31
|
+
import type { Class } from '@travetto/runtime';
|
|
32
|
+
import { type RegistryAdapter, type RegistryIndex, RegistryIndexStore, Registry } from '@travetto/registry';
|
|
33
33
|
|
|
34
34
|
interface Group {
|
|
35
35
|
class: Class;
|
|
@@ -92,7 +92,7 @@ export class SampleRegistryIndex implements RegistryIndex {
|
|
|
92
92
|
|
|
93
93
|
store = new RegistryIndexStore(SampleRegistryAdapter);
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
onCreate(cls: Class): void {
|
|
96
96
|
// Nothing to do
|
|
97
97
|
}
|
|
98
98
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/registry",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Patterns and utilities for handling registration of metadata and functionality for run-time use",
|
|
6
6
|
"keywords": [
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"directory": "module/registry"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@travetto/runtime": "^7.0.
|
|
31
|
+
"@travetto/runtime": "^7.0.5"
|
|
32
32
|
},
|
|
33
33
|
"travetto": {
|
|
34
34
|
"displayName": "Registry"
|
package/src/registry.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppError, castTo, type Class, Env, flushPendingFunctions, isClass, Runtime, RuntimeIndex } from '@travetto/runtime';
|
|
2
2
|
|
|
3
|
-
import type { RegistryIndex, RegistryIndexClass } from './types';
|
|
3
|
+
import type { RegistryIndex, RegistryIndexClass } from './types.ts';
|
|
4
4
|
|
|
5
5
|
class $Registry {
|
|
6
6
|
|
|
@@ -73,13 +73,13 @@ class $Registry {
|
|
|
73
73
|
|
|
74
74
|
// Ensure everything is loaded
|
|
75
75
|
for (const entry of RuntimeIndex.find({
|
|
76
|
-
module: (
|
|
76
|
+
module: (module) => {
|
|
77
77
|
const role = Env.TRV_ROLE.value;
|
|
78
78
|
return role !== 'test' && // Skip all modules when in test
|
|
79
|
-
|
|
79
|
+
module.roles.includes('std') &&
|
|
80
80
|
(
|
|
81
|
-
!Runtime.production ||
|
|
82
|
-
(role === 'doc' &&
|
|
81
|
+
!Runtime.production || module.prod ||
|
|
82
|
+
(role === 'doc' && module.roles.includes(role))
|
|
83
83
|
);
|
|
84
84
|
},
|
|
85
85
|
folder: folder => folder === 'src' || folder === '$index'
|
package/src/store.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppError, castTo, type Class, getParentClass } from '@travetto/runtime';
|
|
2
2
|
|
|
3
|
-
import type { RegistrationMethods, RegistryAdapter, RegistrySimpleStore } from './types';
|
|
3
|
+
import type { RegistrationMethods, RegistryAdapter, RegistrySimpleStore } from './types.ts';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Base registry index implementation
|