@travetto/schema 5.0.0-rc.1 → 5.0.0-rc.2
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/package.json +3 -3
- package/src/bind-util.ts +1 -1
- package/src/data.ts +1 -1
- package/src/decorator/common.ts +1 -1
- package/src/decorator/field.ts +1 -1
- package/src/decorator/schema.ts +1 -1
- package/src/global.d.ts +1 -1
- package/src/name.ts +2 -2
- package/src/service/changes.ts +1 -1
- package/src/service/registry.ts +2 -3
- package/src/service/types.ts +1 -1
- package/src/validate/error.ts +1 -1
- package/src/validate/regexp.ts +1 -1
- package/src/validate/validator.ts +1 -1
package/README.md
CHANGED
|
@@ -313,7 +313,7 @@ This feature is meant to allow for simple Typescript types to be able to be back
|
|
|
313
313
|
|
|
314
314
|
**Code: Simple Custom Type**
|
|
315
315
|
```typescript
|
|
316
|
-
import { DataUtil } from '@travetto/
|
|
316
|
+
import { DataUtil } from '@travetto/runtime';
|
|
317
317
|
|
|
318
318
|
/**
|
|
319
319
|
* @concrete #PointImpl
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/schema",
|
|
3
|
-
"version": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.2",
|
|
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": "^5.0.0-rc.
|
|
30
|
+
"@travetto/registry": "^5.0.0-rc.2"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@travetto/transformer": "^5.0.0-rc.
|
|
33
|
+
"@travetto/transformer": "^5.0.0-rc.2"
|
|
34
34
|
},
|
|
35
35
|
"peerDependenciesMeta": {
|
|
36
36
|
"@travetto/transformer": {
|
package/src/bind-util.ts
CHANGED
package/src/data.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isNumberObject as isNum, isBooleanObject as isBool, isStringObject as isStr } from 'node:util/types';
|
|
2
2
|
|
|
3
|
-
import { Class, ClassInstance, TypedObject } from '@travetto/
|
|
3
|
+
import { Class, ClassInstance, TypedObject } from '@travetto/runtime';
|
|
4
4
|
|
|
5
5
|
const REGEX_PAT = /[\/](.*)[\/](i|g|m|s)?/;
|
|
6
6
|
|
package/src/decorator/common.ts
CHANGED
package/src/decorator/field.ts
CHANGED
package/src/decorator/schema.ts
CHANGED
package/src/global.d.ts
CHANGED
package/src/name.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { describeFunction } from '@travetto/runtime';
|
|
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 (describeFunction(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,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Class, AppError } from '@travetto/base';
|
|
1
|
+
import { Class, AppError, describeFunction } from '@travetto/runtime';
|
|
3
2
|
import { MetadataRegistry, RootRegistry, ChangeEvent } from '@travetto/registry';
|
|
4
3
|
|
|
5
4
|
import { ClassList, FieldConfig, ClassConfig, SchemaConfig, ViewFieldsConfig, ViewConfig } from './types';
|
|
@@ -188,7 +187,7 @@ class $SchemaRegistry extends MetadataRegistry<ClassConfig, FieldConfig> {
|
|
|
188
187
|
class: cls,
|
|
189
188
|
validators: [],
|
|
190
189
|
subTypeField: 'type',
|
|
191
|
-
baseType:
|
|
190
|
+
baseType: describeFunction(cls)?.abstract,
|
|
192
191
|
metadata: {},
|
|
193
192
|
methods: {},
|
|
194
193
|
views: {
|
package/src/service/types.ts
CHANGED
package/src/validate/error.ts
CHANGED
package/src/validate/regexp.ts
CHANGED