@fibery/schema 8.0.6 → 8.1.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/lib/index.js +37 -0
- package/package.json +6 -6
- package/types.d.ts +2 -1
package/lib/index.js
CHANGED
|
@@ -111,7 +111,43 @@ const traceError = external_memoize_one_default()(function traceError(...args) {
|
|
|
111
111
|
traceErrorSubscribers.forEach(fn => {
|
|
112
112
|
fn(...args);
|
|
113
113
|
});
|
|
114
|
+
}); // eslint-disable-next-line no-console
|
|
115
|
+
|
|
116
|
+
let captureMessageSubscribers = [console.info.bind(console)];
|
|
117
|
+
function subscribeOnCaptureMessage(fn) {
|
|
118
|
+
captureMessageSubscribers.push(fn);
|
|
119
|
+
let unsubscribed = false;
|
|
120
|
+
return function unsubscribe() {
|
|
121
|
+
assert(!unsubscribed, "Cannot unsubscribe more than once");
|
|
122
|
+
unsubscribed = true;
|
|
123
|
+
captureMessageSubscribers = captureMessageSubscribers.filter(x => x !== fn);
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
const captureMessage = external_memoize_one_default()(function captureMessage(...args) {
|
|
127
|
+
captureMessageSubscribers.forEach(fn => {
|
|
128
|
+
fn(...args);
|
|
129
|
+
});
|
|
114
130
|
});
|
|
131
|
+
const tracedErrorTracker = {};
|
|
132
|
+
const traceErrorOncePerSession = (seed, err) => {
|
|
133
|
+
if (tracedErrorTracker[seed]) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
tracedErrorTracker[seed] = true;
|
|
138
|
+
const message = [seed, err].filter(Boolean).join(": ");
|
|
139
|
+
traceError(message);
|
|
140
|
+
};
|
|
141
|
+
const capturedMessageTracker = {};
|
|
142
|
+
const captureMessageOncePerSession = (seed, err) => {
|
|
143
|
+
if (capturedMessageTracker[seed]) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
capturedMessageTracker[seed] = true;
|
|
148
|
+
const message = [seed, err].filter(Boolean).join(": ");
|
|
149
|
+
captureMessage(message);
|
|
150
|
+
};
|
|
115
151
|
function withErrorTrace(f) {
|
|
116
152
|
return async function (...args) {
|
|
117
153
|
try {
|
|
@@ -280,6 +316,7 @@ class FieldObject {
|
|
|
280
316
|
}
|
|
281
317
|
|
|
282
318
|
this.name = rawFieldObject["fibery/name"];
|
|
319
|
+
this.description = rawFieldObject["fibery/description"] || null;
|
|
283
320
|
this.id = rawFieldObject["fibery/id"];
|
|
284
321
|
this.type = rawFieldObject["fibery/type"];
|
|
285
322
|
const rawMeta = rawFieldObject["fibery/meta"] || {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fibery/schema",
|
|
3
|
-
"version": "8.0
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"description": "utils for working with fibery schema",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"browser": "./index.js",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"babel-jest": "27.5.1",
|
|
21
21
|
"babel-loader": "8.2.5",
|
|
22
22
|
"@fibery/babel-preset": "7.2.0",
|
|
23
|
-
"@fibery/eslint-config": "
|
|
24
|
-
"@fibery/helpers": "
|
|
23
|
+
"@fibery/eslint-config": "8.1.0",
|
|
24
|
+
"@fibery/helpers": "1.0.2",
|
|
25
25
|
"jest": "27.5.1",
|
|
26
26
|
"jest-junit": "13.0.0",
|
|
27
|
-
"webpack": "5.
|
|
28
|
-
"webpack-cli": "4.
|
|
27
|
+
"webpack": "5.74.0",
|
|
28
|
+
"webpack-cli": "4.10.0"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"build": "BABEL_ENV=production webpack",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"<rootDir>[/\\\\](build|docs|node_modules|scripts)[/\\\\]"
|
|
51
51
|
],
|
|
52
52
|
"transform": {
|
|
53
|
-
"^.+\\.(js|jsx|ts|tsx)$": "
|
|
53
|
+
"^.+\\.(js|jsx|ts|tsx)$": "../../fibery-ui/config/jest/babel.js"
|
|
54
54
|
},
|
|
55
55
|
"testURL": "http://localhost"
|
|
56
56
|
}
|
package/types.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ type Cardinality =
|
|
|
5
5
|
| ":cardinality/many-to-one";
|
|
6
6
|
export type FieldObject = {
|
|
7
7
|
name: string;
|
|
8
|
+
description: string | null;
|
|
8
9
|
id: string;
|
|
9
10
|
type: string;
|
|
10
11
|
rawMeta: unknown;
|
|
@@ -62,7 +63,7 @@ export type TypeObject = {
|
|
|
62
63
|
color: string;
|
|
63
64
|
units: unknown | null;
|
|
64
65
|
installedMixins: unknown | null;
|
|
65
|
-
syncSource:
|
|
66
|
+
syncSource: {appId: string} | null;
|
|
66
67
|
version: string;
|
|
67
68
|
installedMixinTypeObjects: unknown;
|
|
68
69
|
title: string;
|