@wix/zero-config-implementation 1.82.0 → 1.83.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/dist/{index-C-TJl-9-.js → index-BpfsusxK.js} +1 -1
- package/dist/{index-tAvBvLbA.js → index-nLqobONA.js} +8371 -8362
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/converters/data-item-builder.ts +4 -1
- package/src/information-extractors/ts/components.ts +10 -0
- package/src/information-extractors/ts/types.ts +3 -0
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as t, D as e, E as o, I as n, N as c, P as l, R as i, a as p, V as E, b as m, c as x, d as f, e as d, f as u, h as C, i as I, j as k, k as y, l as A, m as D, n as P, o as R, p as h, q as B, r as M, s as T, t as b, w } from "./index-
|
|
1
|
+
import { B as t, D as e, E as o, I as n, N as c, P as l, R as i, a as p, V as E, b as m, c as x, d as f, e as d, f as u, h as C, i as I, j as k, k as y, l as A, m as D, n as P, o as R, p as h, q as B, r as M, s as T, t as b, w } from "./index-nLqobONA.js";
|
|
2
2
|
import "react";
|
|
3
3
|
export {
|
|
4
4
|
t as BaseError,
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"registry": "https://registry.npmjs.org/",
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.
|
|
7
|
+
"version": "1.83.0",
|
|
8
8
|
"description": "Core library for extracting component manifests from JS and CSS files",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"main": "dist/index.js",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
]
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
-
"falconPackageHash": "
|
|
85
|
+
"falconPackageHash": "f80ca8596a9188b6f45fa139c17ea7ed3637fceffaddcb566b22d2db"
|
|
86
86
|
}
|
|
@@ -169,7 +169,10 @@ function handlePrimitiveType(
|
|
|
169
169
|
}
|
|
170
170
|
} else if (typeValue.includes('number')) {
|
|
171
171
|
dataItem.dataType = DATA_TYPE.number
|
|
172
|
-
dataItem.number =
|
|
172
|
+
dataItem.number =
|
|
173
|
+
propInfo.min != null || propInfo.max != null
|
|
174
|
+
? { ...(propInfo.min != null && { min: propInfo.min }), ...(propInfo.max != null && { max: propInfo.max }) }
|
|
175
|
+
: {}
|
|
173
176
|
} else if (typeValue.includes('boolean')) {
|
|
174
177
|
dataItem.dataType = DATA_TYPE.booleanValue
|
|
175
178
|
} else {
|
|
@@ -252,6 +252,8 @@ function convertComponentDoc(doc: ComponentDoc, program: ts.Program, checker: ts
|
|
|
252
252
|
resolvedType,
|
|
253
253
|
description: propItem.description || undefined,
|
|
254
254
|
deprecated: tags?.deprecated !== undefined ? true : undefined,
|
|
255
|
+
min: parseNumericTag(tags?.min, propName, 'min'),
|
|
256
|
+
max: parseNumericTag(tags?.max, propName, 'max'),
|
|
255
257
|
isStateTrigger: stateTrigger ? true : undefined,
|
|
256
258
|
}
|
|
257
259
|
}
|
|
@@ -335,6 +337,14 @@ function findPropsType(
|
|
|
335
337
|
// Default value conversion
|
|
336
338
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
337
339
|
|
|
340
|
+
function parseNumericTag(value: string | undefined, propName: string, tag: string): string | undefined {
|
|
341
|
+
if (value !== undefined && Number.isNaN(Number(value))) {
|
|
342
|
+
console.warn(`@${tag} on prop "${propName}" is not a valid number ("${value}") — ignoring`)
|
|
343
|
+
return undefined
|
|
344
|
+
}
|
|
345
|
+
return value
|
|
346
|
+
}
|
|
347
|
+
|
|
338
348
|
function convertDefaultValue(rdtDefault: { value: unknown } | null): DefaultValue | undefined {
|
|
339
349
|
if (!rdtDefault || rdtDefault.value == null) return undefined
|
|
340
350
|
|
|
@@ -51,6 +51,9 @@ export interface PropInfo {
|
|
|
51
51
|
description?: string
|
|
52
52
|
// Whether the prop is marked as deprecated via @deprecated JSDoc tag
|
|
53
53
|
deprecated?: boolean
|
|
54
|
+
// Numeric range constraints extracted from @min / @max JSDoc tags (decimal strings)
|
|
55
|
+
min?: string
|
|
56
|
+
max?: string
|
|
54
57
|
// True when the prop is wrapped in the `ElementState<>` marker type from
|
|
55
58
|
// @wix/react-component-utils, declaring it as the trigger for a custom design
|
|
56
59
|
// state. `type` and `resolvedType` reflect the unwrapped inner type, so the prop
|