@travetto/schema 3.4.3 → 4.0.0-rc.0
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 +1 -1
- package/__index__.ts +1 -1
- package/package.json +3 -3
- package/src/{typings.d.ts → global.d.ts} +2 -2
- package/src/name.ts +2 -2
- package/src/service/changes.ts +1 -1
- package/src/service/registry.ts +2 -2
package/README.md
CHANGED
package/__index__.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/schema",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-rc.0",
|
|
4
4
|
"description": "Data type registry for runtime validation, reflection and binding.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"schema",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"directory": "module/schema"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@travetto/registry": "^
|
|
30
|
+
"@travetto/registry": "^4.0.0-rc.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@travetto/transformer": "^
|
|
33
|
+
"@travetto/transformer": "^4.0.0-rc.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependenciesMeta": {
|
|
36
36
|
"@travetto/transformer": {
|
|
@@ -13,7 +13,7 @@ declare global {
|
|
|
13
13
|
|
|
14
14
|
namespace NodeJS {
|
|
15
15
|
/**
|
|
16
|
-
* @concrete stream
|
|
16
|
+
* @concrete node:stream#Readable
|
|
17
17
|
*/
|
|
18
18
|
interface ReadableStream { }
|
|
19
19
|
}
|
|
@@ -21,7 +21,7 @@ declare global {
|
|
|
21
21
|
|
|
22
22
|
declare module 'stream' {
|
|
23
23
|
/**
|
|
24
|
-
* @concrete stream
|
|
24
|
+
* @concrete node:stream#Readable
|
|
25
25
|
*/
|
|
26
26
|
interface Readable { }
|
|
27
27
|
}
|
package/src/name.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RuntimeIndex } from '@travetto/manifest';
|
|
2
2
|
import { ClassConfig } from './service/types';
|
|
3
3
|
|
|
4
4
|
const SYN_RE = /(__)(\d+)Ⲑsyn$/;
|
|
@@ -19,7 +19,7 @@ export class SchemaNameResolver {
|
|
|
19
19
|
|
|
20
20
|
getName(schema: ClassConfig): string {
|
|
21
21
|
const id = schema.class.Ⲑid;
|
|
22
|
-
if (
|
|
22
|
+
if (RuntimeIndex.getFunctionMetadataFromClass(schema.class)?.synthetic && SYN_RE.test(schema.class.name)) {
|
|
23
23
|
if (!this.#schemaIdToName.has(id)) {
|
|
24
24
|
const name = schema.class.name.replace(SYN_RE, (_, pref, uid) => `__${(+uid % this.#base).toString().padStart(this.#digits, '0')}`);
|
|
25
25
|
this.#schemaIdToName.set(id, name);
|
package/src/service/changes.ts
CHANGED
package/src/service/registry.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RuntimeIndex } from '@travetto/manifest';
|
|
2
2
|
import { Class, AppError } from '@travetto/base';
|
|
3
3
|
import { MetadataRegistry, RootRegistry, ChangeEvent } from '@travetto/registry';
|
|
4
4
|
|
|
@@ -186,7 +186,7 @@ class $SchemaRegistry extends MetadataRegistry<ClassConfig, FieldConfig> {
|
|
|
186
186
|
class: cls,
|
|
187
187
|
validators: [],
|
|
188
188
|
subTypeField: 'type',
|
|
189
|
-
baseType:
|
|
189
|
+
baseType: RuntimeIndex.getFunctionMetadata(cls)?.abstract,
|
|
190
190
|
metadata: {},
|
|
191
191
|
methods: {},
|
|
192
192
|
views: {
|