bestax-migrate 2.1.6 → 2.2.1
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 +13 -8
- package/dist/cli.d.ts +53 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +159 -9
- package/dist/sources/_shared/imports.d.ts +46 -0
- package/dist/sources/_shared/imports.d.ts.map +1 -0
- package/dist/sources/_shared/imports.js +152 -0
- package/dist/sources/{react-bulma-components → _shared}/jsx-utils.d.ts +20 -12
- package/dist/sources/_shared/jsx-utils.d.ts.map +1 -0
- package/dist/sources/{react-bulma-components → _shared}/jsx-utils.js +15 -10
- package/dist/sources/_shared/make-styles-transform.d.ts +37 -0
- package/dist/sources/_shared/make-styles-transform.d.ts.map +1 -0
- package/dist/sources/_shared/make-styles-transform.js +440 -0
- package/dist/sources/_shared/props.d.ts +20 -0
- package/dist/sources/_shared/props.d.ts.map +1 -0
- package/dist/sources/{react-bulma-components → _shared}/props.js +11 -7
- package/dist/sources/_shared/semver-range.d.ts +31 -0
- package/dist/sources/_shared/semver-range.d.ts.map +1 -0
- package/dist/sources/_shared/semver-range.js +186 -0
- package/dist/sources/_shared/specials-utils.d.ts +45 -0
- package/dist/sources/_shared/specials-utils.d.ts.map +1 -0
- package/dist/sources/_shared/specials-utils.js +124 -0
- package/dist/sources/rbx/deps.d.ts +18 -0
- package/dist/sources/rbx/deps.d.ts.map +1 -0
- package/dist/sources/rbx/deps.js +192 -0
- package/dist/sources/rbx/index.d.ts +3 -0
- package/dist/sources/rbx/index.d.ts.map +1 -0
- package/dist/sources/rbx/index.js +10 -0
- package/dist/sources/rbx/mapping.d.ts +49 -0
- package/dist/sources/rbx/mapping.d.ts.map +1 -0
- package/dist/sources/rbx/mapping.js +924 -0
- package/dist/sources/rbx/responsive.d.ts +30 -0
- package/dist/sources/rbx/responsive.d.ts.map +1 -0
- package/dist/sources/rbx/responsive.js +279 -0
- package/dist/sources/rbx/specials.d.ts +21 -0
- package/dist/sources/rbx/specials.d.ts.map +1 -0
- package/dist/sources/rbx/specials.js +706 -0
- package/dist/sources/rbx/styles.d.ts +21 -0
- package/dist/sources/rbx/styles.d.ts.map +1 -0
- package/dist/sources/rbx/styles.js +29 -0
- package/dist/sources/rbx/transform.d.ts +25 -0
- package/dist/sources/rbx/transform.d.ts.map +1 -0
- package/dist/sources/rbx/transform.js +911 -0
- package/dist/sources/react-bulma-components/deps.d.ts.map +1 -1
- package/dist/sources/react-bulma-components/deps.js +17 -3
- package/dist/sources/react-bulma-components/responsive.d.ts +1 -1
- package/dist/sources/react-bulma-components/responsive.d.ts.map +1 -1
- package/dist/sources/react-bulma-components/responsive.js +1 -1
- package/dist/sources/react-bulma-components/specials.d.ts +3 -9
- package/dist/sources/react-bulma-components/specials.d.ts.map +1 -1
- package/dist/sources/react-bulma-components/specials.js +4 -91
- package/dist/sources/react-bulma-components/styles.d.ts +9 -9
- package/dist/sources/react-bulma-components/styles.d.ts.map +1 -1
- package/dist/sources/react-bulma-components/styles.js +17 -389
- package/dist/sources/react-bulma-components/transform.d.ts.map +1 -1
- package/dist/sources/react-bulma-components/transform.js +378 -101
- package/dist/sources/registry.d.ts.map +1 -1
- package/dist/sources/registry.js +2 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -7
- package/dist/sources/react-bulma-components/jsx-utils.d.ts.map +0 -1
- package/dist/sources/react-bulma-components/props.d.ts +0 -15
- package/dist/sources/react-bulma-components/props.d.ts.map +0 -1
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal semver-range reading for the manifest passes, shared by every source.
|
|
3
|
+
*
|
|
4
|
+
* Not a semver implementation: the workspace deliberately carries no `semver`
|
|
5
|
+
* dependency for this, and the two questions the passes ask are narrow. Both
|
|
6
|
+
* are answered conservatively, so an unrecognised shape is left alone rather
|
|
7
|
+
* than guessed at. The one thing this file must never do is rewrite a value it
|
|
8
|
+
* does not understand, so every accepting path below goes through one grammar.
|
|
9
|
+
*/
|
|
10
|
+
const NUMERIC = String.raw `(?:0|[1-9]\d*)`;
|
|
11
|
+
const WILD = String.raw `(?:x|X|\*)`;
|
|
12
|
+
// SemVer's own identifier grammar: dot-separated, non-empty, no leading zero on
|
|
13
|
+
// a numeric prerelease identifier. Looser fragments accepted `0.9.0-alpha..1`,
|
|
14
|
+
// `0.9.0-01` and `0.9.0+foo..bar` as complete versions and overwrote them.
|
|
15
|
+
const PRE_ID = String.raw `(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)`;
|
|
16
|
+
const PRERELEASE = String.raw `-${PRE_ID}(?:\.${PRE_ID})*`;
|
|
17
|
+
const BUILD = String.raw `\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*`;
|
|
18
|
+
/**
|
|
19
|
+
* An exclusive upper bound that sits exactly at 1.0.0: `1`, `1.0`, `1.0.0`,
|
|
20
|
+
* and the x-ranges that desugar to it (`1.x`, `1.0.x`, `1.*`), optionally with
|
|
21
|
+
* build metadata, which carries no precedence. `1.1.x` desugars to 1.1.0 and
|
|
22
|
+
* still admits 1.0.x, so it is deliberately not here.
|
|
23
|
+
*/
|
|
24
|
+
const STABLE_ONE_BOUND = new RegExp(`^1(?:\\.(?:0|${WILD}))?(?:\\.(?:0|${WILD}))?(?:${BUILD})?$`);
|
|
25
|
+
/**
|
|
26
|
+
* A plain version or x-range: `N`, `N.N`, `N.N.N[-pre][+build]`, `N.x`,
|
|
27
|
+
* `N.x.x`, `N.N.x`. SemVer forbids leading zeros in numeric parts, and once a
|
|
28
|
+
* component is a wildcard everything after it must be a wildcard or omitted.
|
|
29
|
+
*/
|
|
30
|
+
const VERSION = new RegExp(`^(${NUMERIC})(?:\\.(?:${NUMERIC}(?:\\.(?:${WILD}|${NUMERIC}(?:${PRERELEASE})?(?:${BUILD})?))?|${WILD}(?:\\.${WILD})?))?$`);
|
|
31
|
+
/**
|
|
32
|
+
* True only when `range` PROVABLY admits no version >= 1.0.0.
|
|
33
|
+
*
|
|
34
|
+
* The first version of this matched a leading `0` and nothing else, so a range
|
|
35
|
+
* written as comparators (`>=0.7 <1`) was left on 0.x and then reported as
|
|
36
|
+
* already v1. It lived in the rbx source only; the react-bulma-components
|
|
37
|
+
* manifest pass kept the regex until review found the unported half.
|
|
38
|
+
* This walks each `||` alternative and its comparators: a set is pre-v1 when
|
|
39
|
+
* some comparator caps it below 1.0.0 and none of them opens it at 1 or above.
|
|
40
|
+
*
|
|
41
|
+
* Conservative by design: an unrecognised shape returns false and the range is
|
|
42
|
+
* left alone (and reported as such). Bumping a range that might already admit
|
|
43
|
+
* v1 would be the best-guess rewrite this package refuses to make.
|
|
44
|
+
*/
|
|
45
|
+
export function isPreV1(range) {
|
|
46
|
+
const alternatives = range.trim().split(/\s*\|\|\s*/);
|
|
47
|
+
return alternatives.length > 0 && alternatives.every(setIsPreV1);
|
|
48
|
+
}
|
|
49
|
+
function setIsPreV1(set) {
|
|
50
|
+
// npm accepts whitespace between an operator and its version
|
|
51
|
+
// (`>= 0.7.0 < 1.0.0`); splitting on whitespace first made the operator a
|
|
52
|
+
// token of its own, so the range parsed as unrecognised and was left alone.
|
|
53
|
+
const text = glueOperators(set);
|
|
54
|
+
if (text === '' || /^(\*|x|X|latest)$/.test(text))
|
|
55
|
+
return false;
|
|
56
|
+
const hyphen = text.match(/^(\S+)\s+-\s+(\S+)$/);
|
|
57
|
+
if (hyphen) {
|
|
58
|
+
// Both endpoints must be plain versions; `not-a-range - 0.9.4` was
|
|
59
|
+
// accepted on its upper bound alone and overwritten.
|
|
60
|
+
const lower = versionMajor(hyphen[1]);
|
|
61
|
+
const upper = versionMajor(hyphen[2]);
|
|
62
|
+
if (lower === null || upper === null)
|
|
63
|
+
return false;
|
|
64
|
+
return upper === 0 || (upper === 1 && isPrereleaseOfOne(hyphen[2]));
|
|
65
|
+
}
|
|
66
|
+
let cappedBelowOne = false;
|
|
67
|
+
for (const token of text.split(/\s+/)) {
|
|
68
|
+
const match = token.match(/^(>=|<=|>|<|=)?(.*)$/);
|
|
69
|
+
if (!match)
|
|
70
|
+
return false;
|
|
71
|
+
const [, op = '', version] = match;
|
|
72
|
+
// After a comparator only a plain version may follow: `==0.9.4` and
|
|
73
|
+
// `<^0.9` were each read by stripping a second operator, then overwritten.
|
|
74
|
+
const major = op ? versionMajor(version) : majorOf(version);
|
|
75
|
+
if (major === null)
|
|
76
|
+
return false;
|
|
77
|
+
const plain = version.replace(/^v/, '');
|
|
78
|
+
switch (op) {
|
|
79
|
+
case '>':
|
|
80
|
+
case '>=':
|
|
81
|
+
// A lower bound on a 1.0.0 prerelease (`>=1.0.0-rc.1`) does not open
|
|
82
|
+
// the range at a stable v1; keep scanning for an upper cap.
|
|
83
|
+
if (major >= 1 && !isPrereleaseOfOne(version))
|
|
84
|
+
return false;
|
|
85
|
+
break;
|
|
86
|
+
case '<':
|
|
87
|
+
// `<1`, `<1.0`, `<1.0.0` (build metadata carries no precedence, so
|
|
88
|
+
// `<1.0.0+build.1` is the same) exclude every stable v1, as does a
|
|
89
|
+
// prerelease of 1.0.0 (`<1.0.0-0`, `<1.0.0-rc.1`); `<0.9` does too.
|
|
90
|
+
// A higher upper bound (`<2` in `<1 <2`) never widens the set, so it
|
|
91
|
+
// is neutral rather than disqualifying; the result still needs some
|
|
92
|
+
// other comparator to cap it. Alone, `<2` therefore stays unbumped.
|
|
93
|
+
if (major === 0 ||
|
|
94
|
+
(major === 1 && STABLE_ONE_BOUND.test(plain)) ||
|
|
95
|
+
isPrereleaseOfOne(version)) {
|
|
96
|
+
cappedBelowOne = true;
|
|
97
|
+
}
|
|
98
|
+
break;
|
|
99
|
+
case '<=':
|
|
100
|
+
// `<=1.0.0-0` caps at the lowest 1.0.0 prerelease, so it excludes
|
|
101
|
+
// every stable v1 just as `<1.0.0-0` does. A higher inclusive bound
|
|
102
|
+
// is neutral for the same reason as above.
|
|
103
|
+
if (major === 0 || isPrereleaseOfOne(version)) {
|
|
104
|
+
cappedBelowOne = true;
|
|
105
|
+
}
|
|
106
|
+
break;
|
|
107
|
+
default:
|
|
108
|
+
// `0.9.4`, `=0.9.4`, `^0.9`, `~0.7.5`, `0.x`: caret and tilde never
|
|
109
|
+
// cross a major, so major 0 stays below 1. An exact `1.0.0-rc.1` pins
|
|
110
|
+
// a prerelease and admits no stable v1 either; `^1.0.0-rc.1` does.
|
|
111
|
+
if (major === 0) {
|
|
112
|
+
cappedBelowOne = true;
|
|
113
|
+
}
|
|
114
|
+
else if (!/^[~^]/.test(version) &&
|
|
115
|
+
isPrereleaseOfOne(version.replace(/^=/, ''))) {
|
|
116
|
+
cappedBelowOne = true;
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return cappedBelowOne;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* `1.0.0-0`, `1.0.0-rc.1`: a prerelease of exactly 1.0.0 orders below every
|
|
127
|
+
* stable 1.x, so as an upper bound or an exact pin it admits no usable v1.
|
|
128
|
+
* Three numeric parts only, matching semver; `1.0-beta` is not a token this
|
|
129
|
+
* parser reads and is left alone. A caret or tilde on one is different
|
|
130
|
+
* (`^1.0.0-rc.1` admits 1.0.4), which is why the callers check the operator.
|
|
131
|
+
* Accepts the same optional `v` that the version grammar does.
|
|
132
|
+
*/
|
|
133
|
+
function isPrereleaseOfOne(version) {
|
|
134
|
+
return /^v?1\.0\.0-/.test(version);
|
|
135
|
+
}
|
|
136
|
+
function glueOperators(set) {
|
|
137
|
+
// Only when what follows starts a plain version. Gluing unconditionally
|
|
138
|
+
// turned the invalid `> =0.7` into a valid `>=0.7`, which was then bumped.
|
|
139
|
+
// node-semver normalises a spaced tilde or caret (`~ 0.7.5`) the same way.
|
|
140
|
+
return set.trim().replace(/(>=|<=|>|<|=|~|\^)\s+(?=[0-9vxX*])/g, '$1');
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* True when every comparator in every alternative parses to a semver major,
|
|
144
|
+
* so the headline can tell "already v1" apart from "not a version range at
|
|
145
|
+
* all" (`latest`, a git URL) rather than calling both v1.
|
|
146
|
+
*/
|
|
147
|
+
export function isRecognisedRange(range) {
|
|
148
|
+
return range
|
|
149
|
+
.trim()
|
|
150
|
+
.split(/\s*\|\|\s*/)
|
|
151
|
+
.every(alt => {
|
|
152
|
+
const text = glueOperators(alt);
|
|
153
|
+
if (/^(\*|x|X)$/.test(text))
|
|
154
|
+
return true;
|
|
155
|
+
const hyphen = text.match(/^(\S+)\s+-\s+(\S+)$/);
|
|
156
|
+
if (hyphen) {
|
|
157
|
+
return (versionMajor(hyphen[1]) !== null && versionMajor(hyphen[2]) !== null);
|
|
158
|
+
}
|
|
159
|
+
return text.split(/\s+/).every(tok => {
|
|
160
|
+
const m = tok.match(/^(>=|<=|>|<|=)?(.*)$/);
|
|
161
|
+
if (!m)
|
|
162
|
+
return false;
|
|
163
|
+
const [, op = '', v] = m;
|
|
164
|
+
return (op ? versionMajor(v) : majorOf(v)) !== null;
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* The major of a COMPLETE plain version or x-range, or null. npm's optional
|
|
170
|
+
* leading `v` is the only prefix allowed here. Reading a numeric prefix alone
|
|
171
|
+
* accepted a dist-tag like `0.next` as major 0, and the manifest was then
|
|
172
|
+
* overwritten with `^1.0.4`, which is the one thing this parser must never do
|
|
173
|
+
* to a value it does not understand.
|
|
174
|
+
*/
|
|
175
|
+
function versionMajor(version) {
|
|
176
|
+
const m = version.replace(/^v/, '').match(VERSION);
|
|
177
|
+
return m ? Number(m[1]) : null;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* The major of a BARE token, which may carry exactly one range prefix (`^`,
|
|
181
|
+
* `~`, `=`) before the version. Stripping any run of prefix characters
|
|
182
|
+
* accepted `^^0.9.4` and `vv0.9.4` as major 0 and overwrote them.
|
|
183
|
+
*/
|
|
184
|
+
function majorOf(token) {
|
|
185
|
+
return versionMajor(token.replace(/^[~^=]/, ''));
|
|
186
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Building blocks shared by every source's structural handlers: picking a
|
|
3
|
+
* target from an align-style prop, stripping Bulma modifier props off an
|
|
4
|
+
* element on its way to becoming plain HTML, merging a consumed `className`,
|
|
5
|
+
* and reading an icon-font class string.
|
|
6
|
+
*
|
|
7
|
+
* Source-agnostic. `makeStripModifierProps` is a factory precisely because
|
|
8
|
+
* the modifier vocabulary is the one thing here that differs per source.
|
|
9
|
+
*/
|
|
10
|
+
import type { ASTPath } from 'jscodeshift';
|
|
11
|
+
import type { PropAction } from '../../types.js';
|
|
12
|
+
import { type TransformContext } from './jsx-utils.js';
|
|
13
|
+
export interface SpecialResult {
|
|
14
|
+
/** Override the mapping's `target` for the rename step. */
|
|
15
|
+
target?: string;
|
|
16
|
+
/** The node was replaced outright — skip rename and prop passes. */
|
|
17
|
+
replaced?: boolean;
|
|
18
|
+
/** Prop names the handler consumed; skipped by the later prop passes. */
|
|
19
|
+
handledProps?: string[];
|
|
20
|
+
}
|
|
21
|
+
export type SpecialHandler = (ctx: TransformContext, path: ASTPath<any>, element: any) => SpecialResult;
|
|
22
|
+
/** Pick a target based on a literal align-style prop, removing the prop. */
|
|
23
|
+
export declare function alignTarget(ctx: TransformContext, path: ASTPath<any>, element: any, prop: string, targets: Record<string, string>, fallback: string): SpecialResult;
|
|
24
|
+
/**
|
|
25
|
+
* Build the modifier-prop filter for one source: it needs that source's own
|
|
26
|
+
* universal-prop and breakpoint tables to know what counts as a modifier.
|
|
27
|
+
*
|
|
28
|
+
* The returned function filters Bulma modifier props out of an attribute list
|
|
29
|
+
* bound for a plain HTML element (they only exist on bestax components),
|
|
30
|
+
* leaving a TODO when any were dropped.
|
|
31
|
+
*/
|
|
32
|
+
export declare function makeStripModifierProps(universalProps: Record<string, PropAction>, responsiveBreakpoints: Record<string, string | null>): (ctx: TransformContext, path: ASTPath<any>, attrs: any[], where: string) => any[];
|
|
33
|
+
/**
|
|
34
|
+
* Consume the element's `className` so a plain-element rewrite can merge it
|
|
35
|
+
* with its hard-coded Bulma class instead of dropping it. A dynamic value
|
|
36
|
+
* can't be merged safely — keep the base class and leave a TODO.
|
|
37
|
+
*/
|
|
38
|
+
export declare function mergeClassName(ctx: TransformContext, path: ASTPath<any>, element: any, base: string | undefined, where: string): string | undefined;
|
|
39
|
+
/** Parse an icon-font <i className="..."> into bestax Icon name/library/variant. */
|
|
40
|
+
export declare function parseIconClasses(className: string): {
|
|
41
|
+
name: string;
|
|
42
|
+
library?: string;
|
|
43
|
+
variant?: string;
|
|
44
|
+
} | null;
|
|
45
|
+
//# sourceMappingURL=specials-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specials-utils.d.ts","sourceRoot":"","sources":["../../../src/sources/_shared/specials-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,aAAa;IAC5B,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yEAAyE;IACzE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,MAAM,cAAc,GAAG,CAC3B,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,EAClB,OAAO,EAAE,GAAG,KACT,aAAa,CAAC;AAEnB,4EAA4E;AAC5E,wBAAgB,WAAW,CACzB,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,EAClB,OAAO,EAAE,GAAG,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,QAAQ,EAAE,MAAM,GACf,aAAa,CAuBf;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAC1C,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,IAGlD,KAAK,gBAAgB,EACrB,MAAM,OAAO,CAAC,GAAG,CAAC,EAClB,OAAO,GAAG,EAAE,EACZ,OAAO,MAAM,KACZ,GAAG,EAAE,CAuBT;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,EAClB,OAAO,EAAE,GAAG,EACZ,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,KAAK,EAAE,MAAM,GACZ,MAAM,GAAG,SAAS,CAiBpB;AAED,oFAAoF;AACpF,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,GAChB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA2C7D"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Building blocks shared by every source's structural handlers: picking a
|
|
3
|
+
* target from an align-style prop, stripping Bulma modifier props off an
|
|
4
|
+
* element on its way to becoming plain HTML, merging a consumed `className`,
|
|
5
|
+
* and reading an icon-font class string.
|
|
6
|
+
*
|
|
7
|
+
* Source-agnostic. `makeStripModifierProps` is a factory precisely because
|
|
8
|
+
* the modifier vocabulary is the one thing here that differs per source.
|
|
9
|
+
*/
|
|
10
|
+
import { addTodo, findAttr, literalValueOf, removeAttr, } from './jsx-utils.js';
|
|
11
|
+
/** Pick a target based on a literal align-style prop, removing the prop. */
|
|
12
|
+
export function alignTarget(ctx, path, element, prop, targets, fallback) {
|
|
13
|
+
const attr = findAttr(element, prop);
|
|
14
|
+
if (!attr)
|
|
15
|
+
return { target: fallback };
|
|
16
|
+
const literal = literalValueOf(attr);
|
|
17
|
+
if (literal.kind === 'string' && targets[literal.value]) {
|
|
18
|
+
removeAttr(element, attr);
|
|
19
|
+
ctx.dirty = true;
|
|
20
|
+
return { target: targets[literal.value] };
|
|
21
|
+
}
|
|
22
|
+
if (literal.kind === 'string') {
|
|
23
|
+
removeAttr(element, attr);
|
|
24
|
+
ctx.dirty = true;
|
|
25
|
+
return { target: fallback };
|
|
26
|
+
}
|
|
27
|
+
addTodo(ctx, path, `prop:${prop}`, `\`${prop}\` has a dynamic value; pick between ${Object.values(targets).join(' / ')} by hand`);
|
|
28
|
+
removeAttr(element, attr);
|
|
29
|
+
ctx.dirty = true;
|
|
30
|
+
return { target: fallback };
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Build the modifier-prop filter for one source: it needs that source's own
|
|
34
|
+
* universal-prop and breakpoint tables to know what counts as a modifier.
|
|
35
|
+
*
|
|
36
|
+
* The returned function filters Bulma modifier props out of an attribute list
|
|
37
|
+
* bound for a plain HTML element (they only exist on bestax components),
|
|
38
|
+
* leaving a TODO when any were dropped.
|
|
39
|
+
*/
|
|
40
|
+
export function makeStripModifierProps(universalProps, responsiveBreakpoints) {
|
|
41
|
+
return function stripModifierProps(ctx, path, attrs, where) {
|
|
42
|
+
const kept = [];
|
|
43
|
+
const dropped = [];
|
|
44
|
+
for (const attr of attrs) {
|
|
45
|
+
const name = attr?.name?.name;
|
|
46
|
+
if (name && (universalProps[name] || name in responsiveBreakpoints)) {
|
|
47
|
+
dropped.push(name);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
kept.push(attr);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (dropped.length > 0) {
|
|
54
|
+
addTodo(ctx, path, 'plain-element', `${where} became a plain element; the Bulma helper prop(s) ${dropped
|
|
55
|
+
.map(d => `\`${d}\``)
|
|
56
|
+
.join(', ')} were dropped — restyle with classes`);
|
|
57
|
+
}
|
|
58
|
+
return kept;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Consume the element's `className` so a plain-element rewrite can merge it
|
|
63
|
+
* with its hard-coded Bulma class instead of dropping it. A dynamic value
|
|
64
|
+
* can't be merged safely — keep the base class and leave a TODO.
|
|
65
|
+
*/
|
|
66
|
+
export function mergeClassName(ctx, path, element, base, where) {
|
|
67
|
+
const attr = findAttr(element, 'className');
|
|
68
|
+
if (!attr)
|
|
69
|
+
return base;
|
|
70
|
+
const literal = literalValueOf(attr);
|
|
71
|
+
removeAttr(element, attr);
|
|
72
|
+
if (literal.kind === 'string') {
|
|
73
|
+
return base ? `${base} ${literal.value}` : literal.value;
|
|
74
|
+
}
|
|
75
|
+
addTodo(ctx, path, 'prop:className', base
|
|
76
|
+
? `dynamic ${where} className; merge it with the \`${base}\` class by hand`
|
|
77
|
+
: `dynamic ${where} className; re-apply it to the emitted element by hand`);
|
|
78
|
+
return base;
|
|
79
|
+
}
|
|
80
|
+
/** Parse an icon-font <i className="..."> into bestax Icon name/library/variant. */
|
|
81
|
+
export function parseIconClasses(className) {
|
|
82
|
+
const tokens = className.trim().split(/\s+/);
|
|
83
|
+
const faVariant = {
|
|
84
|
+
fas: 'solid',
|
|
85
|
+
far: 'regular',
|
|
86
|
+
fab: 'brands',
|
|
87
|
+
fal: 'light',
|
|
88
|
+
fad: 'duotone',
|
|
89
|
+
fat: 'thin',
|
|
90
|
+
// Font Awesome 6 spells the style out, and has been the default since
|
|
91
|
+
// 2022 — matching only the v5 short forms meant the common case fell
|
|
92
|
+
// through to the "migrate this icon by hand" TODO.
|
|
93
|
+
'fa-solid': 'solid',
|
|
94
|
+
'fa-regular': 'regular',
|
|
95
|
+
'fa-brands': 'brands',
|
|
96
|
+
'fa-light': 'light',
|
|
97
|
+
'fa-duotone': 'duotone',
|
|
98
|
+
'fa-thin': 'thin',
|
|
99
|
+
};
|
|
100
|
+
const faStyle = tokens.find(t => faVariant[t]);
|
|
101
|
+
// Every `fa-*` that is a MODIFIER rather than an icon name — including
|
|
102
|
+
// v6's spelled-out style and family words, which are `fa-` prefixed and
|
|
103
|
+
// would otherwise be read as the icon (`fa-solid fa-home` → name="solid").
|
|
104
|
+
// The old list
|
|
105
|
+
// covered only sizing and spin, so a class string that puts a modifier
|
|
106
|
+
// first — `fas fa-rotate-90 fa-home`, which Font Awesome's own docs show —
|
|
107
|
+
// yielded name="rotate-90". Ordering is not guaranteed, so the filter has
|
|
108
|
+
// to be exhaustive rather than positional.
|
|
109
|
+
const FA_MODIFIER = /^fa-(?:solid|regular|brands|light|duotone|thin|sharp|classic|2xs|xs|sm|lg|xl|2xl|\d{1,2}x|fw|ul|li|border|inverse|stack|stack-1x|stack-2x|pull-(?:left|right)|spin|spin-pulse|spin-reverse|pulse|beat|fade|beat-fade|bounce|flash|shake|swap-opacity|rotate-(?:90|180|270|by)|flip-(?:horizontal|vertical|both))$/;
|
|
110
|
+
const faName = tokens.find(t => /^fa-/.test(t) && !FA_MODIFIER.test(t));
|
|
111
|
+
if (faStyle && faName) {
|
|
112
|
+
return {
|
|
113
|
+
name: faName.replace(/^fa-/, ''),
|
|
114
|
+
library: 'fa',
|
|
115
|
+
variant: faVariant[faStyle],
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
if (tokens.includes('mdi')) {
|
|
119
|
+
const mdiName = tokens.find(t => /^mdi-/.test(t) && t !== 'mdi');
|
|
120
|
+
if (mdiName)
|
|
121
|
+
return { name: mdiName.replace(/^mdi-/, ''), library: 'mdi' };
|
|
122
|
+
}
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* package.json migration: swap rbx for @allxsmith/bestax-bulma and clear out
|
|
3
|
+
* the stylesheet dependencies rbx dragged in with it. Pure data-in/data-out —
|
|
4
|
+
* the CLI owns file IO, and no package manager is ever invoked (the report
|
|
5
|
+
* tells the user to install).
|
|
6
|
+
*
|
|
7
|
+
* This is the step with the biggest visible payoff for an rbx app. Unlike
|
|
8
|
+
* react-bulma-components, which peer-depends on Bulma and lets the app pick a
|
|
9
|
+
* version, rbx ships `bulma@0.7.5` as a *direct* dependency plus four Bulma
|
|
10
|
+
* extensions — so an rbx app cannot move to Bulma v1 at all while rbx is
|
|
11
|
+
* installed. Removing rbx is what frees that, and the report says so; its
|
|
12
|
+
* four Bulma extensions are reported for the user to remove, not deleted —
|
|
13
|
+
* see the note on that below.
|
|
14
|
+
* says so by name.
|
|
15
|
+
*/
|
|
16
|
+
import type { DependenciesUpdate } from '../../types.js';
|
|
17
|
+
export declare const updateDependencies: DependenciesUpdate;
|
|
18
|
+
//# sourceMappingURL=deps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../../../src/sources/rbx/deps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAsBzD,eAAO,MAAM,kBAAkB,EAAE,kBAqLhC,CAAC"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* package.json migration: swap rbx for @allxsmith/bestax-bulma and clear out
|
|
3
|
+
* the stylesheet dependencies rbx dragged in with it. Pure data-in/data-out —
|
|
4
|
+
* the CLI owns file IO, and no package manager is ever invoked (the report
|
|
5
|
+
* tells the user to install).
|
|
6
|
+
*
|
|
7
|
+
* This is the step with the biggest visible payoff for an rbx app. Unlike
|
|
8
|
+
* react-bulma-components, which peer-depends on Bulma and lets the app pick a
|
|
9
|
+
* version, rbx ships `bulma@0.7.5` as a *direct* dependency plus four Bulma
|
|
10
|
+
* extensions — so an rbx app cannot move to Bulma v1 at all while rbx is
|
|
11
|
+
* installed. Removing rbx is what frees that, and the report says so; its
|
|
12
|
+
* four Bulma extensions are reported for the user to remove, not deleted —
|
|
13
|
+
* see the note on that below.
|
|
14
|
+
* says so by name.
|
|
15
|
+
*/
|
|
16
|
+
import { isPreV1, isRecognisedRange } from '../_shared/semver-range.js';
|
|
17
|
+
const BESTAX_RANGE = '^5';
|
|
18
|
+
const BULMA_RANGE = '^1.0.4';
|
|
19
|
+
// Bulma v1's sass tree uses `color.channel(…)` — needs dart-sass ≥ 1.79.
|
|
20
|
+
const SASS_RANGE = '^1.79.0';
|
|
21
|
+
/**
|
|
22
|
+
* The Bulma extensions rbx depends on directly. Bulma v1 and bestax cover all
|
|
23
|
+
* four: badge and tooltip became bestax components, the page loader became
|
|
24
|
+
* `Loading`, and the divider became `Divider`.
|
|
25
|
+
*/
|
|
26
|
+
const RBX_STYLE_DEPS = [
|
|
27
|
+
'bulma-badge',
|
|
28
|
+
'bulma-divider',
|
|
29
|
+
'bulma-pageloader',
|
|
30
|
+
'bulma-tooltip',
|
|
31
|
+
];
|
|
32
|
+
const DEP_SECTIONS = ['dependencies', 'devDependencies'];
|
|
33
|
+
export const updateDependencies = (filePath, pkg, collector, options) => {
|
|
34
|
+
const changes = [];
|
|
35
|
+
const next = pkg;
|
|
36
|
+
const section = (name) => (next[name] ?? undefined);
|
|
37
|
+
const note = (message) => {
|
|
38
|
+
changes.push(message);
|
|
39
|
+
collector?.add({ file: filePath, line: null, rule: 'deps', message });
|
|
40
|
+
};
|
|
41
|
+
// rbx goes away entirely.
|
|
42
|
+
const removed = [];
|
|
43
|
+
for (const name of DEP_SECTIONS) {
|
|
44
|
+
const deps = section(name);
|
|
45
|
+
if (deps && 'rbx' in deps) {
|
|
46
|
+
delete deps.rbx;
|
|
47
|
+
removed.push('rbx');
|
|
48
|
+
note(`removed rbx from ${name}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// The four Bulma extensions are REPORTED, not removed.
|
|
52
|
+
//
|
|
53
|
+
// rbx declares them as its own dependencies, so an app gets them
|
|
54
|
+
// transitively through the lockfile — they do not appear in the app's
|
|
55
|
+
// manifest unless the author put them there deliberately. A manifest entry
|
|
56
|
+
// is therefore a direct declaration, and an app may well be importing
|
|
57
|
+
// `bulma-tooltip`'s Sass on its own, outside anything rbx rendered.
|
|
58
|
+
// Deleting it because rbx happens to be present is precisely the
|
|
59
|
+
// best-guess rewrite this package refuses to make.
|
|
60
|
+
const extensions = [];
|
|
61
|
+
if (removed.includes('rbx')) {
|
|
62
|
+
for (const name of DEP_SECTIONS) {
|
|
63
|
+
const deps = section(name);
|
|
64
|
+
if (!deps)
|
|
65
|
+
continue;
|
|
66
|
+
for (const extension of RBX_STYLE_DEPS) {
|
|
67
|
+
if (extension in deps)
|
|
68
|
+
extensions.push(extension);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (extensions.length > 0) {
|
|
73
|
+
collector?.add({
|
|
74
|
+
file: filePath,
|
|
75
|
+
line: null,
|
|
76
|
+
rule: 'deps',
|
|
77
|
+
message: `${extensions.join(', ')} ${extensions.length === 1 ? 'is a Bulma extension' : 'are Bulma extensions'} rbx depended on, and bestax ships ${extensions.length === 1 ? 'its' : 'their'} equivalent${extensions.length === 1 ? '' : 's'} (Badge, Divider, Loading, Tooltip). Declared in this manifest, so removing ${extensions.length === 1 ? 'it' : 'them'} is your call — drop ${extensions.length === 1 ? 'it' : 'them'} unless your own Sass imports ${extensions.length === 1 ? 'it' : 'them'} directly`,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
// @allxsmith/bestax-bulma comes in (runtime dependency).
|
|
81
|
+
const dependencies = (next.dependencies ??= {});
|
|
82
|
+
if (!dependencies['@allxsmith/bestax-bulma'] &&
|
|
83
|
+
!section('devDependencies')?.['@allxsmith/bestax-bulma']) {
|
|
84
|
+
dependencies['@allxsmith/bestax-bulma'] = BESTAX_RANGE;
|
|
85
|
+
note(`added @allxsmith/bestax-bulma ${BESTAX_RANGE} to dependencies`);
|
|
86
|
+
}
|
|
87
|
+
// Bulma: rbx pinned 0.7.5 as a direct dependency, so this almost always
|
|
88
|
+
// fires. Add it back only when sources still reference bulma/… directly —
|
|
89
|
+
// otherwise it arrives transitively via bestax-bulma.
|
|
90
|
+
let bulmaDeclared = false;
|
|
91
|
+
let declaredBulma = '';
|
|
92
|
+
let bulmaBumped = false;
|
|
93
|
+
let bulmaAdded = false;
|
|
94
|
+
for (const name of DEP_SECTIONS) {
|
|
95
|
+
const deps = section(name);
|
|
96
|
+
if (deps?.bulma) {
|
|
97
|
+
bulmaDeclared = true;
|
|
98
|
+
declaredBulma = deps.bulma;
|
|
99
|
+
if (isPreV1(deps.bulma)) {
|
|
100
|
+
deps.bulma = BULMA_RANGE;
|
|
101
|
+
bulmaBumped = true;
|
|
102
|
+
note(`bumped bulma to ${BULMA_RANGE} in ${name} (was pre-1.0)`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (!bulmaDeclared && options.bulmaReferenced) {
|
|
107
|
+
dependencies.bulma = BULMA_RANGE;
|
|
108
|
+
bulmaAdded = true;
|
|
109
|
+
note(`added bulma ${BULMA_RANGE} to dependencies (sources import bulma/… directly)`);
|
|
110
|
+
}
|
|
111
|
+
// The transform deliberately keeps a trimmed rbx import for components
|
|
112
|
+
// with no bestax equivalent (Tile, Generic, List, …) so a partially
|
|
113
|
+
// migrated app still runs. Removing the package from the manifest strands
|
|
114
|
+
// exactly those imports once the user runs the install the report asks for,
|
|
115
|
+
// so say so rather than letting them find out at build time.
|
|
116
|
+
if (removed.includes('rbx') && options.sourceStillImported) {
|
|
117
|
+
collector?.add({
|
|
118
|
+
file: filePath,
|
|
119
|
+
line: null,
|
|
120
|
+
rule: 'deps',
|
|
121
|
+
message: 'rbx was removed from package.json, but some files still import it for components with no bestax equivalent — resolve those `TODO(bestax-migrate)` imports before installing, or re-add rbx until you have',
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
// The headline result: rbx pinned Bulma 0.7.5 as a DIRECT dependency, so
|
|
125
|
+
// removing rbx is what frees the app to choose its own Bulma version.
|
|
126
|
+
//
|
|
127
|
+
// What it must NOT claim is a manifest change that did not happen. In the
|
|
128
|
+
// common rbx-app shape — `{ "dependencies": { "rbx": "^2.2.0" } }` with no
|
|
129
|
+
// direct `bulma/…` imports — bulma is neither bumped nor added, because it
|
|
130
|
+
// arrives transitively via bestax-bulma. Saying "bumped bulma" there
|
|
131
|
+
// described a pin the user would not find in their manifest.
|
|
132
|
+
if (removed.includes('rbx')) {
|
|
133
|
+
collector?.add({
|
|
134
|
+
file: filePath,
|
|
135
|
+
line: null,
|
|
136
|
+
rule: 'deps',
|
|
137
|
+
message: `removed rbx ${bulmaBumped
|
|
138
|
+
? `and bumped bulma to ${BULMA_RANGE}`
|
|
139
|
+
: bulmaAdded
|
|
140
|
+
? `and added bulma ${BULMA_RANGE}`
|
|
141
|
+
: bulmaDeclared
|
|
142
|
+
? isRecognisedRange(declaredBulma)
|
|
143
|
+
? 'and left your declared bulma range alone (already v1)'
|
|
144
|
+
: `and left your declared bulma specifier alone (${JSON.stringify(declaredBulma)} is not a version range this tool can read; make sure it resolves to Bulma 1.x)`
|
|
145
|
+
: '— bulma now arrives transitively via @allxsmith/bestax-bulma'} — rbx pinned Bulma 0.7.5 as a direct dependency, so the app can now choose its own Bulma version${extensions.length > 0 ? `; ${extensions.length} Bulma extension(s) are reported above for you to remove` : ''}`,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
// bestax-bulma requires React 18/19; rbx peer-depends on ^16.8.6, and React
|
|
149
|
+
// 19 removed the `defaultProps` its forwardRefAs base is built on — so this
|
|
150
|
+
// is the other half of why an rbx app is stuck. Report only: a React major
|
|
151
|
+
// upgrade is the app's own migration step.
|
|
152
|
+
for (const name of DEP_SECTIONS) {
|
|
153
|
+
const range = section(name)?.react;
|
|
154
|
+
if (range && /^[~^]?(?:[0-9]|1[0-7])(?:[.x]|$)/.test(range.trim())) {
|
|
155
|
+
collector?.add({
|
|
156
|
+
file: filePath,
|
|
157
|
+
line: null,
|
|
158
|
+
rule: 'peer-deps',
|
|
159
|
+
message: `react ${range} predates bestax-bulma's peer range (^18 || ^19) — upgrade react and react-dom to 18 or 19 before installing`,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
// Font Awesome older than 6 conflicts with bestax-bulma's optional peer
|
|
164
|
+
// range and makes `npm install` fail with ERESOLVE. Report only — icon
|
|
165
|
+
// names change across FA majors, so upgrading is the app's decision.
|
|
166
|
+
for (const name of DEP_SECTIONS) {
|
|
167
|
+
const range = section(name)?.['@fortawesome/fontawesome-free'];
|
|
168
|
+
if (range && /^[~^]?[0-5](?:[.x]|$)/.test(range.trim())) {
|
|
169
|
+
collector?.add({
|
|
170
|
+
file: filePath,
|
|
171
|
+
line: null,
|
|
172
|
+
rule: 'peer-deps',
|
|
173
|
+
message: `@fortawesome/fontawesome-free ${range} predates bestax-bulma's optional peer range (^6.7.2 || ^7.0.0) — upgrade it, or install with \`npm install --legacy-peer-deps\``,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
// node-sass is dead; dart-sass replaces it in the same section. rbx's own
|
|
178
|
+
// customisation guide told people to install node-sass, so this is common.
|
|
179
|
+
for (const name of DEP_SECTIONS) {
|
|
180
|
+
const deps = section(name);
|
|
181
|
+
if (deps && 'node-sass' in deps) {
|
|
182
|
+
delete deps['node-sass'];
|
|
183
|
+
note(`removed node-sass from ${name}`);
|
|
184
|
+
const sassDeclared = DEP_SECTIONS.some(s => section(s)?.sass);
|
|
185
|
+
if (!sassDeclared) {
|
|
186
|
+
deps.sass = SASS_RANGE;
|
|
187
|
+
note(`added sass ${SASS_RANGE} to ${name} (replaces node-sass)`);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return changes.length > 0 ? next : null;
|
|
192
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sources/rbx/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAKtD,eAAO,MAAM,GAAG,EAAE,eAMjB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import transform from './transform.js';
|
|
2
|
+
import { transformStyles } from './styles.js';
|
|
3
|
+
import { updateDependencies } from './deps.js';
|
|
4
|
+
export const rbx = {
|
|
5
|
+
name: 'rbx',
|
|
6
|
+
label: 'rbx (v2) → @allxsmith/bestax-bulma',
|
|
7
|
+
transform,
|
|
8
|
+
transformStyles,
|
|
9
|
+
updateDependencies,
|
|
10
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* rbx (v2) → @allxsmith/bestax-bulma mapping tables.
|
|
3
|
+
*
|
|
4
|
+
* Data only — no AST work. `MAPPING` is the single source of truth for what
|
|
5
|
+
* the transform does with each rbx export; `RBX_EXPORTS` vendors rbx's public
|
|
6
|
+
* surface so `mapping-coverage.test.ts` can close it in both directions.
|
|
7
|
+
*
|
|
8
|
+
* rbx and bestax both target Bulma, and rbx's helper vocabulary lines up with
|
|
9
|
+
* `useBulmaClasses` far more closely than react-bulma-components' did — most
|
|
10
|
+
* of the value unions below are identical on both sides, so they pass through
|
|
11
|
+
* rather than being value-mapped. Where they diverge it is because Bulma v1
|
|
12
|
+
* itself changed (`is-marginless` became `m-0`), and those are recorded as
|
|
13
|
+
* explicit conversions rather than guesses.
|
|
14
|
+
*/
|
|
15
|
+
import type { ComponentMapping, PropAction } from '../../types.js';
|
|
16
|
+
/**
|
|
17
|
+
* Helper props rbx mixes into every component via `HelpersProps`. Applied
|
|
18
|
+
* after each component's own prop map, to whatever attributes are left.
|
|
19
|
+
*
|
|
20
|
+
* `badge*`, `tooltip*` and `responsive` are deliberately absent: they are
|
|
21
|
+
* consumed structurally (see specials.ts / responsive.ts) before this pass
|
|
22
|
+
* runs, and letting them fall through here would be wrong — bestax has its
|
|
23
|
+
* own unrelated `responsive` prop (`'mobile' | 'narrow'`), so a pass-through
|
|
24
|
+
* would silently produce a type error rather than a TODO.
|
|
25
|
+
*/
|
|
26
|
+
export declare const UNIVERSAL_PROPS: Record<string, PropAction>;
|
|
27
|
+
/** rbx badge helper props → bestax `<Badge>` props. */
|
|
28
|
+
export declare const BADGE_PROPS: Record<string, string | null>;
|
|
29
|
+
/** rbx tooltip helper props → bestax `<Tooltip>` props. */
|
|
30
|
+
export declare const TOOLTIP_PROPS: Record<string, string | null>;
|
|
31
|
+
/**
|
|
32
|
+
* rbx breakpoints → the suffix bestax uses on its viewport-aware helper props
|
|
33
|
+
* (`displayTablet`, `textSizeDesktop`, …). `null` means bestax has no
|
|
34
|
+
* equivalent viewport, so the value becomes a TODO rather than a guess.
|
|
35
|
+
*/
|
|
36
|
+
export declare const RESPONSIVE_BREAKPOINTS: Record<string, string | null>;
|
|
37
|
+
export declare const MAPPING: Record<string, ComponentMapping>;
|
|
38
|
+
/**
|
|
39
|
+
* rbx's public export surface, vendored from its five `index.ts` barrels at
|
|
40
|
+
* the pinned SHA. Values are the dot-notation sub-paths each export carries.
|
|
41
|
+
*
|
|
42
|
+
* `mapping-coverage.test.ts` walks this against `MAPPING` in both directions,
|
|
43
|
+
* so rbx coverage cannot silently regress and `MAPPING` cannot grow an entry
|
|
44
|
+
* for something rbx never exported.
|
|
45
|
+
*/
|
|
46
|
+
export declare const RBX_EXPORTS: Record<string, string[]>;
|
|
47
|
+
/** Walk a dotted component path through `MAPPING`. */
|
|
48
|
+
export declare function resolveMapping(path: string[]): ComponentMapping | undefined;
|
|
49
|
+
//# sourceMappingURL=mapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../../src/sources/rbx/mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAuCnE;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAiCtD,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAOrD,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAQvD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAShE,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAosBpD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CA2FhD,CAAC;AAEF,sDAAsD;AACtD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAgB,GAAG,SAAS,CAM3E"}
|