bestax-migrate 2.24.0 → 2.25.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 -0
- package/dist/sources/_shared/polymorphic.d.ts.map +1 -1
- package/dist/sources/_shared/polymorphic.js +54 -0
- package/dist/sources/bulma-classes/class-map.d.ts +37 -3
- package/dist/sources/bulma-classes/class-map.d.ts.map +1 -1
- package/dist/sources/bulma-classes/class-map.js +115 -18
- package/dist/sources/bulma-classes/plan.d.ts.map +1 -1
- package/dist/sources/bulma-classes/plan.js +54 -5
- package/dist/sources/bulma-classes/rules.d.ts.map +1 -1
- package/dist/sources/bulma-classes/rules.js +2 -0
- package/dist/sources/bulma-classes/transform.d.ts.map +1 -1
- package/dist/sources/bulma-classes/transform.js +3 -2
- package/dist/sources/rbx/mapping.js +1 -1
- package/dist/sources/react-bulma-components/mapping.d.ts.map +1 -1
- package/dist/sources/react-bulma-components/mapping.js +4 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -64,6 +64,19 @@ Anything without a safe automatic conversion is left in place with a `// TODO(be
|
|
|
64
64
|
npx skills add https://github.com/allxsmith/bestax --skill bestax-migrate
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
+
### Through the Codemod Registry
|
|
68
|
+
|
|
69
|
+
bestax-migrate is also in the [Codemod Registry](https://app.codemod.com/registry) as `bestax-migrate`, for teams that run their migrations through Codemod. That package runs this CLI from npm at a pinned release, which can trail the newest one:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Preview (no writes)
|
|
73
|
+
npx codemod bestax-migrate --workflow preview --param source=react-bulma-components
|
|
74
|
+
# Apply
|
|
75
|
+
npx codemod bestax-migrate --param source=react-bulma-components
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Run it from your app root. `--param paths="src lib"` (default `src`) and `--param options="--css keep"` pass through to the CLI. Codemod's own `--dry-run` skips the shell step this package runs, so use the `preview` workflow for a dry run.
|
|
79
|
+
|
|
67
80
|
## Options
|
|
68
81
|
|
|
69
82
|
| Flag | Description |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polymorphic.d.ts","sourceRoot":"","sources":["../../../src/sources/_shared/polymorphic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAML,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAC;AA0BxB,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAkB,CAAC;AAmK3E;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,WAAW,GACtB,UAAU,MAAM,GAAG,SAAS,EAC5B,eAAa,KACZ,MAmBF,CAAC;AAMF,oDAAoD;AACpD,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAElD;AAQD,mDAAmD;AACnD,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAW,CAAC;AAC1D,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAAuB,CAAC;AAkEpE;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,MAAM,EAAkC,CAAC;AAE9E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAwH5C,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEnD;AASD,sFAAsF;AACtF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAG3E;AAED,0DAA0D;AAC1D,eAAO,MAAM,UAAU,EAAE,SAAS,MAAM,EAAoC,CAAC;AAE7E,6CAA6C;AAC7C,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAA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AGG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,EAClB,OAAO,EAAE,GAAG,EACZ,MAAM,EAAE,MAAM;AACd;;;;;;;;;GASG;AACH,gBAAgB,UAAQ,GACvB,IAAI,CAuEN"}
|
|
@@ -592,6 +592,59 @@ function dropInertLinkAttrs(ctx, path, element, target, rendered) {
|
|
|
592
592
|
ctx.dirty = true;
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
|
+
/**
|
|
596
|
+
* The targets that write `type="button"` on the <button> an `as` makes them
|
|
597
|
+
* render, in place of a missing `type` or one HTML does not define
|
|
598
|
+
* (`buttonType` in bulma-ui). A plain <button> with neither submits the form
|
|
599
|
+
* around it, and every source here rendered the tag it was given, so a source
|
|
600
|
+
* element asking for a <button> with no usable `type` was a submit button that
|
|
601
|
+
* the migrated one no longer is.
|
|
602
|
+
*
|
|
603
|
+
* `Button` is not here: bestax leaves its `type` to the caller, as the sources
|
|
604
|
+
* did. Nor are `Card.Header.Icon`, `Delete` and the other targets that always
|
|
605
|
+
* render a <button>. The author never asked for a <button> there, so what the
|
|
606
|
+
* source rendered is a question about the source library, not this element.
|
|
607
|
+
*/
|
|
608
|
+
const TYPES_ITS_BUTTON = new Set([
|
|
609
|
+
'Dropdown.Item',
|
|
610
|
+
'Menu.Item',
|
|
611
|
+
'Navbar.Item',
|
|
612
|
+
'Navbar.Link',
|
|
613
|
+
]);
|
|
614
|
+
/** The `type` values a <button> keeps under `buttonType`. */
|
|
615
|
+
const BUTTON_TYPES = ['button', 'submit', 'reset'];
|
|
616
|
+
/**
|
|
617
|
+
* Flag a <button> that submitted its form in the source and will not once
|
|
618
|
+
* migrated. Only where the element is known to be a <button> and its `type`
|
|
619
|
+
* is known: a dynamic `type` may hold any value, and a spread may carry one,
|
|
620
|
+
* and either is the author's to know. A spread decides only when nothing
|
|
621
|
+
* literal follows it, since JSX applies attributes last-write-wins, so a
|
|
622
|
+
* literal `type` written after every spread is the one that renders.
|
|
623
|
+
*/
|
|
624
|
+
function flagButtonType(ctx, path, element, target, rendered) {
|
|
625
|
+
if (rendered !== 'button' || !TYPES_ITS_BUTTON.has(target))
|
|
626
|
+
return;
|
|
627
|
+
let attr;
|
|
628
|
+
let spreadWins = false;
|
|
629
|
+
for (const a of element.openingElement.attributes) {
|
|
630
|
+
if (a.type === 'JSXSpreadAttribute')
|
|
631
|
+
spreadWins = true;
|
|
632
|
+
else if (a.name.name === 'type') {
|
|
633
|
+
attr = a;
|
|
634
|
+
spreadWins = false;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
if (spreadWins)
|
|
638
|
+
return;
|
|
639
|
+
if (attr) {
|
|
640
|
+
const literal = literalValueOf(attr);
|
|
641
|
+
if (literal.kind !== 'string' || BUTTON_TYPES.includes(literal.value)) {
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
addTodo(ctx, path, 'prop:type', `bestax \`${target}\` writes \`type="button"\` on its <button> ${attr ? 'in place of a `type` HTML does not define' : 'when none is given'}, so it no longer submits the form around it the way a plain <button> does -- add \`type="submit"\` if this one should`);
|
|
646
|
+
ctx.dirty = true;
|
|
647
|
+
}
|
|
595
648
|
/**
|
|
596
649
|
* The `as` attribute only if no spread can overwrite it. `findAttr` reads by
|
|
597
650
|
* name and knows nothing about `{...rest}`, which JSX applies last-write-wins.
|
|
@@ -677,6 +730,7 @@ spreadCanCarryAs = false) {
|
|
|
677
730
|
? undefined
|
|
678
731
|
: HREF_OK[target];
|
|
679
732
|
dropInertLinkAttrs(ctx, path, element, target, rendered);
|
|
733
|
+
flagButtonType(ctx, path, element, target, rendered);
|
|
680
734
|
restrictAsValue(ctx, path, element, target, attr, literal);
|
|
681
735
|
// Only now, and only if something element-dependent actually survived. The
|
|
682
736
|
// first version fired on every `as` beside a spread -- `<Title as="h2"
|
|
@@ -49,7 +49,7 @@ export interface Modifier {
|
|
|
49
49
|
* - `mapped`: converts to `target`.
|
|
50
50
|
* - `todo`: bestax has a component, but the markup does not map element by
|
|
51
51
|
* element yet; the family's outermost class gets a TODO.
|
|
52
|
-
* - `plain`: valid Bulma
|
|
52
|
+
* - `plain`: valid Bulma, left alone with no TODO.
|
|
53
53
|
* - `fold`: a wrapper the `target` renders itself from a prop, so the element
|
|
54
54
|
* folds into the one `target` inside it (`.table-container` into
|
|
55
55
|
* `Table isResponsive`).
|
|
@@ -139,6 +139,23 @@ export interface RootEntry {
|
|
|
139
139
|
readonly bgColor?: 'bgColor' | 'backgroundColor' | null;
|
|
140
140
|
/** Attributes the target renders when the element does not set them. */
|
|
141
141
|
readonly defaults?: Readonly<Record<string, string>>;
|
|
142
|
+
/**
|
|
143
|
+
* What the target renders in place of `defaults` once the element names
|
|
144
|
+
* itself through one of `by`, set to anything but an empty string (`Icon`
|
|
145
|
+
* makes a named icon an image and hides any other). A name given as an
|
|
146
|
+
* expression may render as none, so the element then sets both.
|
|
147
|
+
*/
|
|
148
|
+
readonly namedDefaults?: {
|
|
149
|
+
readonly by: readonly string[];
|
|
150
|
+
readonly defaults: Readonly<Record<string, string>>;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Attributes that stop the target rendering `defaults` when the element sets
|
|
154
|
+
* one to a value written out (`Icon` hides an unnamed icon only when it has
|
|
155
|
+
* no `role` or `tabIndex` of its own). An expression may render as nothing,
|
|
156
|
+
* so it stops nothing.
|
|
157
|
+
*/
|
|
158
|
+
readonly defaultsUnless?: readonly string[];
|
|
142
159
|
/**
|
|
143
160
|
* An attribute the target always writes on the tags in `on`: `fallback`
|
|
144
161
|
* when the element sets none, or sets it to anything but one of `keeps`
|
|
@@ -259,6 +276,13 @@ export interface RootEntry {
|
|
|
259
276
|
readonly buildsFile?: boolean;
|
|
260
277
|
/** The target takes no helper props, so every helper class stays a class. */
|
|
261
278
|
readonly noHelpers?: boolean;
|
|
279
|
+
/**
|
|
280
|
+
* Helper props the target does not take as helpers, each with why, so their
|
|
281
|
+
* classes stay classes: its props type leaves the helper out, or a prop of
|
|
282
|
+
* its own by that name renders something else (`Columns`' `gap` is its
|
|
283
|
+
* gutter). The reason is for the MCP lookup.
|
|
284
|
+
*/
|
|
285
|
+
readonly helpersLeftOut?: Readonly<Record<string, string>>;
|
|
262
286
|
/**
|
|
263
287
|
* Tags the target doesn't render, on which the element is valid Bulma that
|
|
264
288
|
* bestax renders some other way, so it stays markup with no `tag` TODO
|
|
@@ -312,6 +336,13 @@ export declare const ALIGN_CONTENTS: readonly ["flex-start", "flex-end", "center
|
|
|
312
336
|
export declare const ALIGN_ITEMS: readonly ["stretch", "flex-start", "flex-end", "center", "baseline", "start", "end"];
|
|
313
337
|
export declare const ALIGN_SELFS: readonly ["auto", "flex-start", "flex-end", "center", "baseline", "stretch"];
|
|
314
338
|
export declare const FLEX_GROW_SHRINK: readonly ["0", "1", "2", "3", "4", "5"];
|
|
339
|
+
/** Bulma's gap scale, whole and half steps, as the gap props take it. */
|
|
340
|
+
export declare const GAPS: readonly ["0", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4", "4.5", "5", "5.5", "6", "6.5", "7", "7.5", "8"];
|
|
341
|
+
export declare const POSITIONS: readonly ["absolute", "fixed", "relative", "static", "sticky"];
|
|
342
|
+
/** The CSS keywords `overflow`, `overflowX` and `overflowY` take. */
|
|
343
|
+
export declare const AXIS_OVERFLOWS: readonly ["auto", "clip", "hidden", "scroll", "visible"];
|
|
344
|
+
export declare const RADII: readonly ["radiusless", "small", "normal", "large", "rounded"];
|
|
345
|
+
export declare const ASPECT_RATIOS: readonly ["1by1", "5by4", "4by3", "3by2", "5by3", "16by9", "2by1", "3by1", "4by5", "3by4", "2by3", "3by5", "9by16", "1by2", "1by3"];
|
|
315
346
|
export declare const VIEWPORTS: readonly ["mobile", "tablet", "tablet-only", "touch", "desktop", "desktop-only", "widescreen", "widescreen-only", "fullhd"];
|
|
316
347
|
/** `tablet-only` → `TabletOnly`: the suffix bestax puts on per-viewport props. */
|
|
317
348
|
export declare function viewportSuffix(viewport: string): string;
|
|
@@ -349,9 +380,12 @@ export declare const LEGACY_09: Readonly<Record<string, string>>;
|
|
|
349
380
|
/**
|
|
350
381
|
* `text-color` and `background` resolve to a per-target prop (`RootEntry`'s
|
|
351
382
|
* `textColor`/`bgColor`); `flex-container` only renders beside a flex
|
|
352
|
-
* `display`; `display` cannot mix a base value with per-viewport ones.
|
|
383
|
+
* `display`; `display` cannot mix a base value with per-viewport ones. In
|
|
384
|
+
* `gap`, `position` and `overflow`, one prop decides what another renders:
|
|
385
|
+
* a `gap` drops `gapless`, a `pos` drops `relative`, and beside an axis prop
|
|
386
|
+
* `overflow` is written per axis.
|
|
353
387
|
*/
|
|
354
|
-
export type HelperGroup = 'text-color' | 'background' | 'spacing' | 'typography' | 'display' | 'visibility' | 'flex-container' | 'flex-item' | 'other';
|
|
388
|
+
export type HelperGroup = 'text-color' | 'background' | 'spacing' | 'gap' | 'typography' | 'display' | 'visibility' | 'flex-container' | 'flex-item' | 'position' | 'overflow' | 'other';
|
|
355
389
|
export interface HelperToken {
|
|
356
390
|
readonly group: HelperGroup;
|
|
357
391
|
readonly write: PropWrite;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-map.d.ts","sourceRoot":"","sources":["../../../src/sources/bulma-classes/class-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,qEAAqE;IACrE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,MAAM,MAAM,GAChB;IAAE,QAAQ,CAAC,EAAE,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;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AAW,CAAC,MAAM,EAAE,WAAW,CAqHzD,CAAC;AAEH,iEAAiE;AACjE,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,CAS3C,CAAC;AAIH;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAyCA,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEnE;AAiBD,qCAAqC;AACrC,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAE5D;AAED,wEAAwE;AACxE,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAE7D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAGlE;AAED,qCAAqC;AACrC,wBAAgB,WAAW,CACzB,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,MAAM,GACZ,QAAQ,GAAG,SAAS,CAEtB;AAED,kDAAkD;AAClD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE5D;AAED,0CAA0C;AAC1C,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE1D"}
|
|
@@ -114,6 +114,65 @@ export const ALIGN_SELFS = [
|
|
|
114
114
|
'stretch',
|
|
115
115
|
];
|
|
116
116
|
export const FLEX_GROW_SHRINK = ['0', '1', '2', '3', '4', '5'];
|
|
117
|
+
/** Bulma's gap scale, whole and half steps, as the gap props take it. */
|
|
118
|
+
export const GAPS = [
|
|
119
|
+
'0',
|
|
120
|
+
'0.5',
|
|
121
|
+
'1',
|
|
122
|
+
'1.5',
|
|
123
|
+
'2',
|
|
124
|
+
'2.5',
|
|
125
|
+
'3',
|
|
126
|
+
'3.5',
|
|
127
|
+
'4',
|
|
128
|
+
'4.5',
|
|
129
|
+
'5',
|
|
130
|
+
'5.5',
|
|
131
|
+
'6',
|
|
132
|
+
'6.5',
|
|
133
|
+
'7',
|
|
134
|
+
'7.5',
|
|
135
|
+
'8',
|
|
136
|
+
];
|
|
137
|
+
export const POSITIONS = [
|
|
138
|
+
'absolute',
|
|
139
|
+
'fixed',
|
|
140
|
+
'relative',
|
|
141
|
+
'static',
|
|
142
|
+
'sticky',
|
|
143
|
+
];
|
|
144
|
+
/** The CSS keywords `overflow`, `overflowX` and `overflowY` take. */
|
|
145
|
+
export const AXIS_OVERFLOWS = [
|
|
146
|
+
'auto',
|
|
147
|
+
'clip',
|
|
148
|
+
'hidden',
|
|
149
|
+
'scroll',
|
|
150
|
+
'visible',
|
|
151
|
+
];
|
|
152
|
+
export const RADII = [
|
|
153
|
+
'radiusless',
|
|
154
|
+
'small',
|
|
155
|
+
'normal',
|
|
156
|
+
'large',
|
|
157
|
+
'rounded',
|
|
158
|
+
];
|
|
159
|
+
export const ASPECT_RATIOS = [
|
|
160
|
+
'1by1',
|
|
161
|
+
'5by4',
|
|
162
|
+
'4by3',
|
|
163
|
+
'3by2',
|
|
164
|
+
'5by3',
|
|
165
|
+
'16by9',
|
|
166
|
+
'2by1',
|
|
167
|
+
'3by1',
|
|
168
|
+
'4by5',
|
|
169
|
+
'3by4',
|
|
170
|
+
'2by3',
|
|
171
|
+
'3by5',
|
|
172
|
+
'9by16',
|
|
173
|
+
'1by2',
|
|
174
|
+
'1by3',
|
|
175
|
+
];
|
|
117
176
|
export const VIEWPORTS = [
|
|
118
177
|
'mobile',
|
|
119
178
|
'tablet',
|
|
@@ -146,8 +205,6 @@ const COMPONENT_COLORS = [
|
|
|
146
205
|
'light',
|
|
147
206
|
'dark',
|
|
148
207
|
];
|
|
149
|
-
/** Bulma's whole-step spacing scale, as `Grid`'s gap props take it. */
|
|
150
|
-
const GAPS = ['0', '1', '2', '3', '4', '5', '6', '7', '8'];
|
|
151
208
|
const COLUMN_SIZES = [
|
|
152
209
|
'1',
|
|
153
210
|
'2',
|
|
@@ -211,6 +268,8 @@ const BASE = {
|
|
|
211
268
|
textColor: 'textColor',
|
|
212
269
|
bgColor: 'bgColor',
|
|
213
270
|
};
|
|
271
|
+
/** Why the column and row gap helpers stay classes on a `.columns`. */
|
|
272
|
+
const COLUMNS_AXIS_GAPS = 'bestax `Columns` leaves the column and row gap helpers out: the gutter is padding inside each column, which CSS `gap` would add to';
|
|
214
273
|
// ---- Roots ------------------------------------------------------------------
|
|
215
274
|
export const ROOTS = {
|
|
216
275
|
block: {
|
|
@@ -387,6 +446,13 @@ export const ROOTS = {
|
|
|
387
446
|
target: 'Card.Header.Icon',
|
|
388
447
|
tag: 'button',
|
|
389
448
|
defaults: { 'aria-label': 'more options' },
|
|
449
|
+
writesAttr: {
|
|
450
|
+
type: {
|
|
451
|
+
on: ['button'],
|
|
452
|
+
fallback: 'button',
|
|
453
|
+
keeps: ['button', 'submit', 'reset'],
|
|
454
|
+
},
|
|
455
|
+
},
|
|
390
456
|
ownProps: ['color', 'bgColor', 'textColor'],
|
|
391
457
|
},
|
|
392
458
|
'card-image': {
|
|
@@ -486,6 +552,11 @@ export const ROOTS = {
|
|
|
486
552
|
'gapSizeWidescreen',
|
|
487
553
|
'gapSizeFullhd',
|
|
488
554
|
],
|
|
555
|
+
helpersLeftOut: {
|
|
556
|
+
gap: "bestax `Columns`' own `gap` is the columns gutter (`is-<value>`), not the gap helper",
|
|
557
|
+
columnGap: COLUMNS_AXIS_GAPS,
|
|
558
|
+
rowGap: COLUMNS_AXIS_GAPS,
|
|
559
|
+
},
|
|
489
560
|
},
|
|
490
561
|
column: {
|
|
491
562
|
...BASE,
|
|
@@ -528,8 +599,9 @@ export const ROOTS = {
|
|
|
528
599
|
'isNarrowFullhd',
|
|
529
600
|
],
|
|
530
601
|
},
|
|
531
|
-
// Grid's gaps take a numeric string, but its column
|
|
532
|
-
// placement are typed as numbers.
|
|
602
|
+
// Grid's gaps take a numeric string, half steps included, but its column
|
|
603
|
+
// minimum and every Cell placement are typed as numbers. Its gap props are
|
|
604
|
+
// its own, and render the same classes as the gap helpers.
|
|
533
605
|
grid: {
|
|
534
606
|
...BASE,
|
|
535
607
|
target: 'Grid',
|
|
@@ -1021,6 +1093,13 @@ export const ROOTS = {
|
|
|
1021
1093
|
tag: 'a',
|
|
1022
1094
|
as: 'any',
|
|
1023
1095
|
modifiers: flags({ 'is-active': 'active' }),
|
|
1096
|
+
writesAttr: {
|
|
1097
|
+
type: {
|
|
1098
|
+
on: ['button'],
|
|
1099
|
+
fallback: 'button',
|
|
1100
|
+
keeps: ['button', 'submit', 'reset'],
|
|
1101
|
+
},
|
|
1102
|
+
},
|
|
1024
1103
|
ownProps: ['as', 'active', 'textColor', 'bgColor'],
|
|
1025
1104
|
},
|
|
1026
1105
|
'navbar-dropdown': {
|
|
@@ -1235,8 +1314,8 @@ export const ROOTS = {
|
|
|
1235
1314
|
'is-fullwidth': 'isFullwidth',
|
|
1236
1315
|
'is-right': 'isRight',
|
|
1237
1316
|
}),
|
|
1238
|
-
// `File` renders `
|
|
1239
|
-
// it as it is would render a falsy number (`0`) as text.
|
|
1317
|
+
// `File` renders its name area behind `hasName && …`, so a condition
|
|
1318
|
+
// handed to it as it is would render a falsy number (`0`) as text.
|
|
1240
1319
|
'has-name': { writes: [{ prop: 'hasName' }], onlyTrue: true },
|
|
1241
1320
|
},
|
|
1242
1321
|
omits: {
|
|
@@ -1268,6 +1347,7 @@ export const ROOTS = {
|
|
|
1268
1347
|
'iconRight',
|
|
1269
1348
|
'inputClassName',
|
|
1270
1349
|
'fileName',
|
|
1350
|
+
'pickedFilesLabel',
|
|
1271
1351
|
],
|
|
1272
1352
|
passThrough: ['ref'],
|
|
1273
1353
|
},
|
|
@@ -1281,14 +1361,20 @@ export const ROOTS = {
|
|
|
1281
1361
|
'dropdown-content': part(),
|
|
1282
1362
|
'dropdown-item': part(),
|
|
1283
1363
|
'dropdown-divider': part(),
|
|
1284
|
-
// With children, `Icon` renders `.icon` around them as given
|
|
1285
|
-
// `
|
|
1364
|
+
// With children, `Icon` renders `.icon` around them as given. It hides an
|
|
1365
|
+
// icon with no name, no `role` and no `tabIndex`, and makes one named by
|
|
1366
|
+
// `aria-label` or `aria-labelledby` an image.
|
|
1286
1367
|
icon: {
|
|
1287
1368
|
...BASE,
|
|
1288
1369
|
target: 'Icon',
|
|
1289
1370
|
tag: 'span',
|
|
1290
1371
|
modifiers: tokens('is-', ['small', 'medium', 'large'], 'size'),
|
|
1291
|
-
defaults: { 'aria-
|
|
1372
|
+
defaults: { 'aria-hidden': 'true' },
|
|
1373
|
+
namedDefaults: {
|
|
1374
|
+
by: ['aria-label', 'aria-labelledby'],
|
|
1375
|
+
defaults: { role: 'img' },
|
|
1376
|
+
},
|
|
1377
|
+
defaultsUnless: ['role', 'tabIndex'],
|
|
1292
1378
|
requiresChildren: true,
|
|
1293
1379
|
needsElementChildren: true,
|
|
1294
1380
|
ownProps: [
|
|
@@ -1706,12 +1792,12 @@ export const ROOTS = {
|
|
|
1706
1792
|
'has-auto-count': set('fixedCols', 'auto'),
|
|
1707
1793
|
},
|
|
1708
1794
|
},
|
|
1709
|
-
// ---- Valid Bulma,
|
|
1710
|
-
// The other sources emit these on purpose
|
|
1795
|
+
// ---- Valid Bulma, left as markup ---------------------------------------------
|
|
1796
|
+
// The other sources emit these on purpose.
|
|
1711
1797
|
help: plain('bestax renders `.help` only inside its form controls'),
|
|
1712
1798
|
'panel-list': plain('nothing in bestax renders `.panel-list`'),
|
|
1713
1799
|
label: plain('bestax renders `.label` only inside its form controls'),
|
|
1714
|
-
loader: plain("bestax `
|
|
1800
|
+
loader: plain("bestax's `Loader` draws the same ring; swap it in by hand for its progressbar role and accessible name"),
|
|
1715
1801
|
'hero-buttons': plain('a layout class inside `.hero`; bestax has no part for it'),
|
|
1716
1802
|
'hero-video': plain('a layout class inside `.hero`; bestax has no part for it'),
|
|
1717
1803
|
'navbar-content': plain('a layout class inside `.navbar`; bestax has no part for it'),
|
|
@@ -1933,11 +2019,20 @@ export const HELPER_TOKENS = new Map([
|
|
|
1933
2019
|
...helperTokens('flex-item', 'is-align-self-', ALIGN_SELFS, 'alignSelf'),
|
|
1934
2020
|
...helperTokens('flex-item', 'is-flex-grow-', FLEX_GROW_SHRINK, 'flexGrow'),
|
|
1935
2021
|
...helperTokens('flex-item', 'is-flex-shrink-', FLEX_GROW_SHRINK, 'flexShrink'),
|
|
1936
|
-
...helperTokens('
|
|
2022
|
+
...helperTokens('gap', 'is-gap-', GAPS, 'gap'),
|
|
2023
|
+
...helperTokens('gap', 'is-column-gap-', GAPS, 'columnGap'),
|
|
2024
|
+
...helperTokens('gap', 'is-row-gap-', GAPS, 'rowGap'),
|
|
2025
|
+
helperFlag('gap', 'is-gapless', 'gapless'),
|
|
2026
|
+
...helperTokens('position', 'is-position-', POSITIONS, 'pos'),
|
|
2027
|
+
helperFlag('position', 'is-relative', 'relative'),
|
|
1937
2028
|
[
|
|
1938
2029
|
'is-clipped',
|
|
1939
|
-
{ group: '
|
|
2030
|
+
{ group: 'overflow', write: { prop: 'overflow', value: 'clipped' } },
|
|
1940
2031
|
],
|
|
2032
|
+
...helperTokens('overflow', 'is-overflow-', AXIS_OVERFLOWS, 'overflow'),
|
|
2033
|
+
...helperTokens('overflow', 'is-overflow-x-', AXIS_OVERFLOWS, 'overflowX'),
|
|
2034
|
+
...helperTokens('overflow', 'is-overflow-y-', AXIS_OVERFLOWS, 'overflowY'),
|
|
2035
|
+
...helperTokens('other', 'is-pulled-', ['left', 'right'], 'float'),
|
|
1941
2036
|
helperFlag('other', 'is-overlay', 'overlay'),
|
|
1942
2037
|
[
|
|
1943
2038
|
'is-unselectable',
|
|
@@ -1951,6 +2046,7 @@ export const HELPER_TOKENS = new Map([
|
|
|
1951
2046
|
'is-radiusless',
|
|
1952
2047
|
{ group: 'other', write: { prop: 'radius', value: 'radiusless' } },
|
|
1953
2048
|
],
|
|
2049
|
+
...helperTokens('other', 'has-radius-', RADII.filter(radius => radius !== 'radiusless'), 'radius'),
|
|
1954
2050
|
[
|
|
1955
2051
|
'is-shadowless',
|
|
1956
2052
|
{ group: 'other', write: { prop: 'shadow', value: 'shadowless' } },
|
|
@@ -1958,7 +2054,7 @@ export const HELPER_TOKENS = new Map([
|
|
|
1958
2054
|
...helperTokens('other', 'is-', ['mobile', 'narrow'], 'responsive'),
|
|
1959
2055
|
helperFlag('other', 'is-skeleton', 'skeleton'),
|
|
1960
2056
|
helperFlag('other', 'is-clearfix', 'clearfix'),
|
|
1961
|
-
|
|
2057
|
+
...helperTokens('other', 'is-aspect-ratio-', ASPECT_RATIOS, 'aspectRatio'),
|
|
1962
2058
|
]);
|
|
1963
2059
|
/** Every helper prop name, for the attribute-collision check. */
|
|
1964
2060
|
export const HELPER_PROPS = new Set([
|
|
@@ -1989,7 +2085,8 @@ export const PASSTHROUGH = [
|
|
|
1989
2085
|
},
|
|
1990
2086
|
{
|
|
1991
2087
|
why: 'a Grid or Cell class, which converts only on its own `.grid` or `.cell`, and only where bestax has a prop for it',
|
|
1992
|
-
|
|
2088
|
+
// `is-row-gap-*` is a gap helper.
|
|
2089
|
+
match: /^(?:is-(?:col|row)-(?!gap-).+|is-auto-fill)$/,
|
|
1993
2090
|
},
|
|
1994
2091
|
{
|
|
1995
2092
|
why: 'a `.fixed-grid` column count, which converts only on its own `.fixed-grid`',
|
|
@@ -1997,11 +2094,11 @@ export const PASSTHROUGH = [
|
|
|
1997
2094
|
},
|
|
1998
2095
|
{
|
|
1999
2096
|
why: 'an `.image` modifier, which converts only on its own `.image`, and only where bestax has a prop for it',
|
|
2000
|
-
match: /^(?:is-\d+by\d+|is-\d+x\d+|is-square|
|
|
2097
|
+
match: /^(?:is-\d+by\d+|is-\d+x\d+|is-square|has-ratio)$/,
|
|
2001
2098
|
},
|
|
2002
2099
|
{
|
|
2003
2100
|
why: 'a Bulma helper with no bestax prop',
|
|
2004
|
-
match: /^(?:is-display-.+|is-visibility-.+|is-
|
|
2101
|
+
match: /^(?:is-display-.+|is-visibility-.+|is-float-.+|is-clear-.+|has-text-weight-extrabold|is-align-content-(?:baseline|start|end)|is-align-items-self-(?:start|end)|is-offset-0(?:-[a-z]+)?)$/,
|
|
2005
2102
|
},
|
|
2006
2103
|
{
|
|
2007
2104
|
why: 'a `.breadcrumb` separator, which converts only on its own `.breadcrumb`',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/sources/bulma-classes/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAoBH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,2DAA2D;IAC3D,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC;IAC7C;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B;;;OAGG;IACH,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;IACtD,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,4EAA4E;IAC5E,WAAW,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB;;;;OAIG;IACH,aAAa,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IACtC,qEAAqE;IACrE,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,qEAAqE;IACrE,YAAY,CAAC,EAAE,SA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K,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;QACnD,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;IACF,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AA+BD,wBAAgB,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAyhB9C"}
|
|
@@ -213,16 +213,27 @@ export function plan(facts) {
|
|
|
213
213
|
const written = Object.entries(entry.writesAttr ?? {})
|
|
214
214
|
.filter(([, rule]) => rule.on.includes(tag))
|
|
215
215
|
.map(([name, rule]) => [name, rule.fallback]);
|
|
216
|
-
const
|
|
216
|
+
const naming = namingOf(entry, attributes);
|
|
217
|
+
// An attribute written out that stops the target's defaults, such as
|
|
218
|
+
// `Icon`'s own `role` or `tabIndex`, leaves an unnamed element nothing to
|
|
219
|
+
// add.
|
|
220
|
+
const stopped = entry.defaultsUnless?.some(name => attributes.has(name) && attributes.get(name) !== null);
|
|
221
|
+
const unnamed = stopped ? {} : (entry.defaults ?? {});
|
|
222
|
+
const defaults = naming === 'named'
|
|
223
|
+
? entry.namedDefaults.defaults
|
|
224
|
+
: naming === 'unsure'
|
|
225
|
+
? { ...unnamed, ...entry.namedDefaults.defaults }
|
|
226
|
+
: unnamed;
|
|
227
|
+
const missing = [...Object.entries(defaults), ...written].filter(([name]) => !attributes.has(name));
|
|
217
228
|
const drop = [];
|
|
218
229
|
for (const name of entry.untypedAttrs ?? []) {
|
|
219
230
|
if (!attributes.has(name))
|
|
220
231
|
continue;
|
|
221
|
-
if (
|
|
232
|
+
if (defaults[name] === attributes.get(name)) {
|
|
222
233
|
drop.push(name);
|
|
223
234
|
continue;
|
|
224
235
|
}
|
|
225
|
-
return refuse('attr', name, `bestax \`${target}\`'s props take no \`${name}\`${
|
|
236
|
+
return refuse('attr', name, `bestax \`${target}\`'s props take no \`${name}\`${defaults[name] ? `, and it renders \`${name}="${defaults[name]}"\` when none is given` : ''}; keep this element as markup`);
|
|
226
237
|
}
|
|
227
238
|
const numbers = [];
|
|
228
239
|
for (const name of numberAttrsOf(entry)) {
|
|
@@ -292,6 +303,14 @@ export function plan(facts) {
|
|
|
292
303
|
if (counts && !counted) {
|
|
293
304
|
return refuse('children', target, `bestax \`${target}\` renders this element's children itself, \`${counts.prop}\` bare, empty <${counts.tag}>s, so it converts only when its children are just that; keep it as markup`);
|
|
294
305
|
}
|
|
306
|
+
if (missing.length > 0 && naming === 'unsure') {
|
|
307
|
+
const list = (set = {}) => Object.entries(set)
|
|
308
|
+
.map(([name, value]) => `\`${name}="${value}"\``)
|
|
309
|
+
.join(' and ');
|
|
310
|
+
const by = entry.namedDefaults.by.find(name => attributes.has(name));
|
|
311
|
+
const add = missing.map(([name]) => `\`${name}\``).join(' and ');
|
|
312
|
+
return refuse('defaults', target, `bestax \`${target}\` renders ${list(entry.namedDefaults.defaults)} when it has a name and ${list(entry.defaults)} when it has none, and this element's \`${by}\` is an expression that may render as either; set ${add} here to what you want, then re-run`);
|
|
313
|
+
}
|
|
295
314
|
if (missing.length > 0) {
|
|
296
315
|
const list = missing.map(([name, value]) => `\`${name}="${value}"\``);
|
|
297
316
|
return refuse('defaults', target, `bestax \`${target}\` renders ${list.join(' and ')} when the element does not set ${missing.length === 1 ? 'it' : 'them'}; add ${missing.length === 1 ? 'it' : 'them'} here if that is what you want, then re-run`);
|
|
@@ -504,6 +523,21 @@ function buildFile(children, entry, hasName) {
|
|
|
504
523
|
numbers,
|
|
505
524
|
};
|
|
506
525
|
}
|
|
526
|
+
/**
|
|
527
|
+
* Whether the element names itself through one of `entry.namedDefaults.by`,
|
|
528
|
+
* which picks the defaults its target renders: a string written out names
|
|
529
|
+
* it unless empty, as a bare attribute does, and an expression may or may
|
|
530
|
+
* not. An entry with no `namedDefaults` is never named.
|
|
531
|
+
*/
|
|
532
|
+
function namingOf(entry, attributes) {
|
|
533
|
+
const given = (entry.namedDefaults?.by ?? [])
|
|
534
|
+
.filter(name => attributes.has(name))
|
|
535
|
+
.map(name => attributes.get(name));
|
|
536
|
+
if (given.some(value => value === true || (value !== '' && value !== null))) {
|
|
537
|
+
return 'named';
|
|
538
|
+
}
|
|
539
|
+
return given.includes(null) ? 'unsure' : 'unnamed';
|
|
540
|
+
}
|
|
507
541
|
/**
|
|
508
542
|
* The icons a target that `buildsIcons` builds from an element's children:
|
|
509
543
|
* each `.icon` that converts to `Icon` on its own and holds a glyph `Icon`
|
|
@@ -576,8 +610,8 @@ function buildIcons(children, target) {
|
|
|
576
610
|
* write, the classes that leave `className`, and the props written as
|
|
577
611
|
* numbers. The group rules apply, so a helper the target would drop (a
|
|
578
612
|
* base `display` beside a per-viewport one, a flex-container helper with no
|
|
579
|
-
* flex `display`) stays a class,
|
|
580
|
-
* attribute it needs.
|
|
613
|
+
* flex `display`, `gapless` beside a `gap`) stays a class, as does one it
|
|
614
|
+
* leaves out, and so does a modifier missing the attribute it needs.
|
|
581
615
|
*/
|
|
582
616
|
function propsFrom(entry, tokens, tag, root, attributes) {
|
|
583
617
|
const numbers = [];
|
|
@@ -618,6 +652,9 @@ function propsFrom(entry, tokens, tag, root, attributes) {
|
|
|
618
652
|
: helper.write.prop;
|
|
619
653
|
if (!prop || writes.has(prop))
|
|
620
654
|
continue;
|
|
655
|
+
if (entry.helpersLeftOut && Object.hasOwn(entry.helpersLeftOut, prop)) {
|
|
656
|
+
continue;
|
|
657
|
+
}
|
|
621
658
|
writes.set(prop, helper.write.value ?? true);
|
|
622
659
|
sourceOf.set(prop, token);
|
|
623
660
|
groupOf.set(prop, helper.group);
|
|
@@ -641,6 +678,18 @@ function propsFrom(entry, tokens, tag, root, attributes) {
|
|
|
641
678
|
undo(prop);
|
|
642
679
|
}
|
|
643
680
|
}
|
|
681
|
+
// Props one helper wrote that another drops (`groupOf` holds only what
|
|
682
|
+
// helpers wrote). A `gap` drops `gapless`, though `Grid`'s own `gap`, a
|
|
683
|
+
// modifier, does not; `pos` drops `relative`; and beside an axis prop,
|
|
684
|
+
// `overflow` is written per axis instead of as its own class.
|
|
685
|
+
if (groupOf.has('gap') && groupOf.has('gapless'))
|
|
686
|
+
undo('gapless');
|
|
687
|
+
if (groupOf.has('pos') && groupOf.has('relative'))
|
|
688
|
+
undo('relative');
|
|
689
|
+
if (groupOf.has('overflow') &&
|
|
690
|
+
(groupOf.has('overflowX') || groupOf.has('overflowY'))) {
|
|
691
|
+
undo('overflow');
|
|
692
|
+
}
|
|
644
693
|
return { writes, converted, numbers };
|
|
645
694
|
}
|
|
646
695
|
/** `a`, `a or b`, `a, b or c`, each in backticks. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../src/sources/bulma-classes/rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAYH,eAAO,MAAM,KAAK,EAAE,WAAW,CAAC,MAAM,CAapC,CAAC;
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../src/sources/bulma-classes/rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAYH,eAAO,MAAM,KAAK,EAAE,WAAW,CAAC,MAAM,CAapC,CAAC;AA8BH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAK1D"}
|
|
@@ -35,6 +35,8 @@ const VOCABULARY = new Set([
|
|
|
35
35
|
...(entry.untypedAttrs ?? []),
|
|
36
36
|
...(entry.numberAttrs ?? []),
|
|
37
37
|
...Object.keys(entry.defaults ?? {}),
|
|
38
|
+
...Object.keys(entry.namedDefaults?.defaults ?? {}),
|
|
39
|
+
...(entry.defaultsUnless ?? []),
|
|
38
40
|
...Object.keys(entry.dropsAttr ?? {}),
|
|
39
41
|
...Object.keys(entry.writesAttr ?? {}),
|
|
40
42
|
]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/sources/bulma-classes/transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAW,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/sources/bulma-classes/transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAW,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AA26BvD,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,GAAG,EACR,OAAO,GAAE,gBAAqB,GAC7B,MAAM,GAAG,SAAS,CA02BpB"}
|
|
@@ -681,7 +681,8 @@ function propValue(j, value, number) {
|
|
|
681
681
|
/**
|
|
682
682
|
* The props one built icon is given, as an object: its glyph's and its
|
|
683
683
|
* classes' first, then its `.icon`'s attributes, as `Icon` would have been
|
|
684
|
-
* given them
|
|
684
|
+
* given them. `aria-label` keeps its own name: `Icon` reads an empty
|
|
685
|
+
* `ariaLabel` as no name and renders no `aria-label` for it at all.
|
|
685
686
|
*/
|
|
686
687
|
function iconObject(j, icon, built) {
|
|
687
688
|
const properties = built.props.map(([name, value]) => j.objectProperty(propKey(j, name), propValue(j, value, built.numbers.includes(name))));
|
|
@@ -698,7 +699,7 @@ function iconObject(j, icon, built) {
|
|
|
698
699
|
: given.type === 'JSXExpressionContainer'
|
|
699
700
|
? given.expression
|
|
700
701
|
: propValue(j, given.value, built.numbers.includes(name));
|
|
701
|
-
properties.push(j.objectProperty(propKey(j, name
|
|
702
|
+
properties.push(j.objectProperty(propKey(j, name), value));
|
|
702
703
|
}
|
|
703
704
|
return j.objectExpression(properties);
|
|
704
705
|
}
|
|
@@ -128,7 +128,7 @@ export const MAPPING = {
|
|
|
128
128
|
},
|
|
129
129
|
forwardRefAs: {
|
|
130
130
|
status: 'todo',
|
|
131
|
-
todo: '`forwardRefAs` is rbx-internal and has no counterpart. bestax forwards a ref from the form controls, plus `Avatar`, `Button`, `Carousel`, `CarouselItem`, `Dialog`, `Dropdown`, `Link`, `LinkButton`, `Menu.Item`, `Modal`, `Navbar`, `Navbar.Burger`, `Navbar.Dropdown`, `Navbar.Item`, `Navbar.Link`, `Sidebar` and `Toast` — pass `ref` directly on those, though not on the `Field`, `Field.Label`, `Field.Body`, `Checkboxes` and `Radios` wrappers, which forward none. Mind the `Navbar.Dropdown` collision: your rbx `Navbar.Dropdown` is the menu and becomes `Navbar.DropdownMenu`, which forwards no ref, while bestax `Navbar.Dropdown` — the container your `<Navbar.Item dropdown>` becomes — does. The rest, `Box` included, forward no ref: React 18 drops it with a warning, React 19 leaves it wherever the rest props go, so put the ref on a wrapping element you control',
|
|
131
|
+
todo: '`forwardRefAs` is rbx-internal and has no counterpart. bestax forwards a ref from the form controls, plus `Avatar`, `Button`, `Carousel`, `CarouselItem`, `Dialog`, `Dropdown`, `Link`, `LinkButton`, `Loader`, `Menu.Item`, `Modal`, `Navbar`, `Navbar.Burger`, `Navbar.Dropdown`, `Navbar.Item`, `Navbar.Link`, `Sidebar` and `Toast` — pass `ref` directly on those, though not on the `Field`, `Field.Label`, `Field.Body`, `Checkboxes` and `Radios` wrappers, which forward none. Mind the `Navbar.Dropdown` collision: your rbx `Navbar.Dropdown` is the menu and becomes `Navbar.DropdownMenu`, which forwards no ref, while bestax `Navbar.Dropdown` — the container your `<Navbar.Item dropdown>` becomes — does. The rest, `Box` included, forward no ref: React 18 drops it with a warning, React 19 leaves it wherever the rest props go, so put the ref on a wrapping element you control',
|
|
132
132
|
},
|
|
133
133
|
// ---- elements -----------------------------------------------------------
|
|
134
134
|
Block: { status: 'mapped', target: 'Block' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../../src/sources/react-bulma-components/mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAOnE;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAgFtD,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAUhE,CAAC;AAIF,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../../src/sources/react-bulma-components/mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAOnE;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAgFtD,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAUhE,CAAC;AAIF,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAuqBpD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAsEhD,CAAC;AAEF,6EAA6E;AAC7E,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAgB,GAAG,SAAS,CAM3E"}
|
|
@@ -26,7 +26,7 @@ export const UNIVERSAL_PROPS = {
|
|
|
26
26
|
todo: 'this bestax component has no `as` prop; restructure the element instead',
|
|
27
27
|
},
|
|
28
28
|
domRef: {
|
|
29
|
-
todo: 'bestax-bulma has no `domRef`. The form controls, plus `Avatar`, `Button`, `Carousel`, `CarouselItem`, `Dialog`, `Dropdown`, `Link`, `LinkButton`, `Menu.Item`, `Modal`, `Navbar`, `Navbar.Burger`, `Navbar.Dropdown`, `Navbar.Item`, `Navbar.Link`, `Sidebar` and `Toast` forward a ref — on those, rename `domRef` to `ref`, though not on the `Field`, `Field.Label`, `Field.Body`, `Checkboxes` and `Radios` wrappers, which forward none. Mind the `Navbar.Dropdown` collision: the `Navbar.Item` that wrapped your dropdown became bestax `Navbar.Dropdown` and forwards one, while your `Navbar.Dropdown` became `Navbar.DropdownMenu` and does not. The rest forward no ref: React 18 drops it with a warning, React 19 leaves it wherever the rest props go, so put the ref on a DOM child or wrap the component',
|
|
29
|
+
todo: 'bestax-bulma has no `domRef`. The form controls, plus `Avatar`, `Button`, `Carousel`, `CarouselItem`, `Dialog`, `Dropdown`, `Link`, `LinkButton`, `Loader`, `Menu.Item`, `Modal`, `Navbar`, `Navbar.Burger`, `Navbar.Dropdown`, `Navbar.Item`, `Navbar.Link`, `Sidebar` and `Toast` forward a ref — on those, rename `domRef` to `ref`, though not on the `Field`, `Field.Label`, `Field.Body`, `Checkboxes` and `Radios` wrappers, which forward none. Mind the `Navbar.Dropdown` collision: the `Navbar.Item` that wrapped your dropdown became bestax `Navbar.Dropdown` and forwards one, while your `Navbar.Dropdown` became `Navbar.DropdownMenu` and does not. The rest forward no ref: React 18 drops it with a warning, React 19 leaves it wherever the rest props go, so put the ref on a DOM child or wrap the component',
|
|
30
30
|
},
|
|
31
31
|
// ColorProps
|
|
32
32
|
backgroundColor: { rename: 'bgColor' },
|
|
@@ -506,8 +506,9 @@ export const MAPPING = {
|
|
|
506
506
|
},
|
|
507
507
|
Loader: {
|
|
508
508
|
// RBC Loader is literally <div class="loader"> and Bulma v1 still ships
|
|
509
|
-
// that class
|
|
510
|
-
//
|
|
509
|
+
// that class, so a plain element is the faithful conversion. bestax's
|
|
510
|
+
// Loader draws the same ring on a span with a progressbar role and an
|
|
511
|
+
// accessible name; swapping it in is left to the user.
|
|
511
512
|
status: 'mapped',
|
|
512
513
|
special: 'plain-loader',
|
|
513
514
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bestax-migrate",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.25.1",
|
|
4
4
|
"description": "Codemods for migrating existing React apps from other Bulma libraries to @allxsmith/bestax-bulma",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"chalk": "^6.0.0",
|
|
39
39
|
"commander": "^15.0.0",
|
|
40
40
|
"jscodeshift": "^17.3.0",
|
|
41
|
-
"@allxsmith/bestax-bulma": "^5.
|
|
41
|
+
"@allxsmith/bestax-bulma": "^5.27.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@jest/globals": "^30.0.0",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"clean": "rimraf dist",
|
|
76
76
|
"release": "npx semantic-release"
|
|
77
77
|
},
|
|
78
|
-
"readme": "# bestax-migrate\n\n[](https://www.npmjs.com/package/bestax-migrate)\n[](https://www.npmjs.com/package/bestax-migrate)\n[](https://opensource.org/licenses/MIT)\n[](https://socket.dev/npm/package/bestax-migrate/overview)\n[](https://scorecard.dev/viewer/?uri=github.com/allxsmith/bestax)\n[](https://www.bestpractices.dev/projects/14361)\n[](https://www.npmjs.com/package/bestax-migrate#provenance)\n[](https://github.com/allxsmith/bestax/blob/main/SECURITY.md)\n\nCodemods that migrate existing React apps to [`@allxsmith/bestax-bulma`](https://www.npmjs.com/package/@allxsmith/bestax-bulma) — the actively maintained React component library for **Bulma v1**.\n\nCurrently supported sources:\n\n| Source | Status |\n| -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |\n| [`react-bulma-components`](https://github.com/couds/react-bulma-components) (v4) | ✅ All 32 components mapped (a few patterns are flagged as TODOs) |\n| [`rbx`](https://github.com/dfee/rbx) (v2) | ✅ Full export surface mapped (a few patterns are flagged as TODOs) |\n| [`bloomer`](https://github.com/AlgusDark/bloomer) (0.6) | ✅ All 108 exports mapped (Font Awesome 4 icons and Bulma 0.4's `Nav` are flagged) |\n| `bulma-classes`: Bulma's classes on plain JSX, no library | ✅ Converts an element only when bestax renders the same markup; the rest is flagged |\n\nPass the source as the first argument: `bestax-migrate <source> <paths…>`.\n\n## Requirements\n\n**Node.js 22 or newer.** Node 18 and 20 are both past end-of-life. On an older runtime the CLI\nexits immediately with an explicit upgrade message.\n\nThis applies only to the Node version the codemod itself runs on. It places no requirement on\nthe app being migrated — the source is read as text and is never executed.\n\n## Usage\n\n```bash\n# Preview what would change (no writes)\npnpm dlx bestax-migrate react-bulma-components src/ --dry\n# …or, for an rbx or bloomer app\npnpm dlx bestax-migrate rbx src/ --dry\npnpm dlx bestax-migrate bloomer src/ --dry\n# …or, for an app that writes Bulma's classes on plain JSX\npnpm dlx bestax-migrate bulma-classes src/ --dry\n\n# Apply the migration\npnpm dlx bestax-migrate react-bulma-components src/\n```\n\nnpm and yarn work too: `npx bestax-migrate …` / `yarn dlx bestax-migrate …`.\n\nThe codemod uses [jscodeshift](https://github.com/facebook/jscodeshift) to:\n\n- rewrite the source library's imports to `@allxsmith/bestax-bulma` (including destructuring and namespace imports)\n- rename components and compound sub-components (`Form.Textarea` → `TextArea`, `Card.Footer.Item` → `Card.FooterItem`, `Hero.Footer` → `Hero.Foot`, …) — and, for bloomer, its flat names onto bestax's compounds (`CardHeaderTitle` → `Card.Header.Title`)\n- convert props (`renderAs` → `as`, `loading` → `isLoading`, numeric spacing/text sizes → string unions, `textAlign=\"center\"` → `textAlign=\"centered\"`, …)\n- flatten responsive breakpoint objects (`mobile={{ size: 4 }}` → `sizeMobile={4}`) and bloomer's `isDisplay`/`isHidden` strings, arrays and objects (`isHidden=\"touch\"` → `visibilityTouch=\"hidden\"`)\n- for `bulma-classes`, turn raw Bulma markup into components and props (`<a className=\"button is-primary\">` → `<Button as=\"a\" color=\"primary\">`, `<p className=\"has-text-centered mt-4\">` → `<Paragraph textAlign=\"centered\" mt=\"4\">`), converting an element only when bestax renders exactly the same markup\n- restructure patterns bestax models differently (`Table.Container`, Navbar dropdowns, `Form.Help`, icon-font children → `<Icon name=…>`)\n- migrate stylesheets: CSS imports converge on `@allxsmith/bestax-bulma/bestax.css`, and SCSS files move from Bulma 0.9's `@import` + `$var !default` overrides to `@use 'bulma/sass' with (…)` plus `@use '@allxsmith/bestax-bulma/scss/extras'`\n- update `package.json`: remove the source library, add `@allxsmith/bestax-bulma`, raise a declared pre-1.0 `bulma` to `^1` (adding it only when your sources import `bulma/…` directly — otherwise it arrives transitively), and swap the dead `node-sass` for dart `sass` (no install is ever run). Migrating **rbx** is what frees an app from Bulma 0.7.5: rbx pinned it as a _direct_ dependency, so the app could not choose its own Bulma version at all. The four Bulma extensions rbx also pulled in (`bulma-badge`, `bulma-divider`, `bulma-pageloader`, `bulma-tooltip`) are **reported rather than removed** — bestax replaces all four, but a manifest entry is a deliberate declaration and your own Sass may import them. A **bloomer** app declared its own Bulma 0.6, which is what gets bumped. For **bulma-classes** there is no library to remove, and by default (`--css keep`) the app's Bulma version, Sass and stylesheet imports all stay: its own Bulma already styles every class a converted element renders. `--css bestax` or `--css bulma` moves it to Bulma v1 like the other sources\n\nAnything without a safe automatic conversion is left in place with a `// TODO(bestax-migrate): …` comment, and the run ends with a report of every TODO by file and line. TODOs are expected output, not errors — resolve them with the migration guide ([react-bulma-components](https://bestax.io/docs/guides/getting-started/migration/react-bulma-components), [rbx](https://bestax.io/docs/guides/getting-started/migration/rbx), [bloomer](https://bestax.io/docs/guides/getting-started/migration/bloomer), [Bulma classes](https://bestax.io/docs/guides/getting-started/migration/bulma-classes)), or let the [`bestax-migrate` Agent Skill](https://bestax.io/docs/skills/intro) walk them for you:\n\n```bash\nnpx skills add https://github.com/allxsmith/bestax --skill bestax-migrate\n```\n\n## Options\n\n| Flag | Description |\n| -------------------- | ---------------------------------------------------------------------------------------------- |\n| `--dry`, `-d` | Report what would change without writing files |\n| `--print`, `-p` | Print transformed sources to stdout |\n| `--extensions`, `-e` | File extensions to include (default `js,jsx,ts,tsx,scss,sass`) |\n| `--css <mode>` | Stylesheet target: `bestax`, `bulma`, or `keep` (default `bestax`; `keep` for `bulma-classes`) |\n| `--no-deps` | Skip updating package.json dependencies |\n\n## After the codemod\n\n1. Run your package manager's install (the codemod rewrote `package.json` but never installs)\n2. Search for `TODO(bestax-migrate)` and resolve each comment\n3. Typecheck/build and review the rendered app\n\nFull walkthrough: [react-bulma-components migration guide](https://bestax.io/docs/guides/getting-started/migration/react-bulma-components) · [rbx migration guide](https://bestax.io/docs/guides/getting-started/migration/rbx) · [bloomer migration guide](https://bestax.io/docs/guides/getting-started/migration/bloomer) · [Bulma classes migration guide](https://bestax.io/docs/guides/getting-started/migration/bulma-classes).\n\n## Hardened by default\n\nA codemod rewrites your source in place, so how it is built and published matters:\n\n- **Signed provenance** — every release carries a sigstore attestation linking the tarball to the exact commit and CI run that built it. Check the **Provenance** section on the [npm page](https://www.npmjs.com/package/bestax-migrate#provenance), or run `npm audit signatures`.\n- **npm OIDC trusted publishing** — short-lived, per-run credentials; no long-lived `NPM_TOKEN` exists to be stolen. Release commits and tags are GPG-signed.\n- **Socket.dev scans every PR** for malware, install scripts, obfuscated code, and privilege escalation before it can reach `main`.\n- **The libraries this tool migrates away from are never installed here** — source fixtures are read as text only, so no unmaintained third-party package enters the dependency tree.\n- **Dependencies are a deliberate act** — install scripts are blocked unless individually allow-listed, freshly published versions are refused for 3 days, and CI installs only what the reviewed lockfile resolves.\n- **Every GitHub Action is pinned to a full commit SHA**, and CodeQL, Dependency Review, and Dependabot run continuously alongside a high-severity `pnpm audit` gate.\n- **Layered AI review before merge** — [CodeRabbit](https://coderabbit.ai) plus an independent adversarial Claude review (a different model from the one writing AI-authored changes), on top of required green CI, an approving review, and a human merge.\n\nFull detail: [`SECURITY.md`](https://github.com/allxsmith/bestax/blob/main/SECURITY.md) · [Security guide](https://bestax.io/docs/guides/security)\n\n## Telemetry\n\n`bestax-migrate` can send one **anonymous** usage event after a successful\nrun — only if you opt in when asked (once, on an interactive terminal). The\nevent is just the run's shape — source library, CSS mode, the dry/deps flags, a\ncapped changed-file count, and per-rule TODO counts — plus the CLI version,\nNode major version, and OS platform name. Never file paths, file contents,\ncode, names, IPs, or machine IDs, and no identifier exists that could link two\nevents together. Opt out any time with `--no-telemetry`,\n`BESTAX_TELEMETRY=0`, or `DO_NOT_TRACK=1`.\n\nFull disclosure of every field and control: [Telemetry guide](https://bestax.io/docs/guides/telemetry)\n\n## License\n\nSource code licensed MIT\n"
|
|
78
|
+
"readme": "# bestax-migrate\n\n[](https://www.npmjs.com/package/bestax-migrate)\n[](https://www.npmjs.com/package/bestax-migrate)\n[](https://opensource.org/licenses/MIT)\n[](https://socket.dev/npm/package/bestax-migrate/overview)\n[](https://scorecard.dev/viewer/?uri=github.com/allxsmith/bestax)\n[](https://www.bestpractices.dev/projects/14361)\n[](https://www.npmjs.com/package/bestax-migrate#provenance)\n[](https://github.com/allxsmith/bestax/blob/main/SECURITY.md)\n\nCodemods that migrate existing React apps to [`@allxsmith/bestax-bulma`](https://www.npmjs.com/package/@allxsmith/bestax-bulma) — the actively maintained React component library for **Bulma v1**.\n\nCurrently supported sources:\n\n| Source | Status |\n| -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |\n| [`react-bulma-components`](https://github.com/couds/react-bulma-components) (v4) | ✅ All 32 components mapped (a few patterns are flagged as TODOs) |\n| [`rbx`](https://github.com/dfee/rbx) (v2) | ✅ Full export surface mapped (a few patterns are flagged as TODOs) |\n| [`bloomer`](https://github.com/AlgusDark/bloomer) (0.6) | ✅ All 108 exports mapped (Font Awesome 4 icons and Bulma 0.4's `Nav` are flagged) |\n| `bulma-classes`: Bulma's classes on plain JSX, no library | ✅ Converts an element only when bestax renders the same markup; the rest is flagged |\n\nPass the source as the first argument: `bestax-migrate <source> <paths…>`.\n\n## Requirements\n\n**Node.js 22 or newer.** Node 18 and 20 are both past end-of-life. On an older runtime the CLI\nexits immediately with an explicit upgrade message.\n\nThis applies only to the Node version the codemod itself runs on. It places no requirement on\nthe app being migrated — the source is read as text and is never executed.\n\n## Usage\n\n```bash\n# Preview what would change (no writes)\npnpm dlx bestax-migrate react-bulma-components src/ --dry\n# …or, for an rbx or bloomer app\npnpm dlx bestax-migrate rbx src/ --dry\npnpm dlx bestax-migrate bloomer src/ --dry\n# …or, for an app that writes Bulma's classes on plain JSX\npnpm dlx bestax-migrate bulma-classes src/ --dry\n\n# Apply the migration\npnpm dlx bestax-migrate react-bulma-components src/\n```\n\nnpm and yarn work too: `npx bestax-migrate …` / `yarn dlx bestax-migrate …`.\n\nThe codemod uses [jscodeshift](https://github.com/facebook/jscodeshift) to:\n\n- rewrite the source library's imports to `@allxsmith/bestax-bulma` (including destructuring and namespace imports)\n- rename components and compound sub-components (`Form.Textarea` → `TextArea`, `Card.Footer.Item` → `Card.FooterItem`, `Hero.Footer` → `Hero.Foot`, …) — and, for bloomer, its flat names onto bestax's compounds (`CardHeaderTitle` → `Card.Header.Title`)\n- convert props (`renderAs` → `as`, `loading` → `isLoading`, numeric spacing/text sizes → string unions, `textAlign=\"center\"` → `textAlign=\"centered\"`, …)\n- flatten responsive breakpoint objects (`mobile={{ size: 4 }}` → `sizeMobile={4}`) and bloomer's `isDisplay`/`isHidden` strings, arrays and objects (`isHidden=\"touch\"` → `visibilityTouch=\"hidden\"`)\n- for `bulma-classes`, turn raw Bulma markup into components and props (`<a className=\"button is-primary\">` → `<Button as=\"a\" color=\"primary\">`, `<p className=\"has-text-centered mt-4\">` → `<Paragraph textAlign=\"centered\" mt=\"4\">`), converting an element only when bestax renders exactly the same markup\n- restructure patterns bestax models differently (`Table.Container`, Navbar dropdowns, `Form.Help`, icon-font children → `<Icon name=…>`)\n- migrate stylesheets: CSS imports converge on `@allxsmith/bestax-bulma/bestax.css`, and SCSS files move from Bulma 0.9's `@import` + `$var !default` overrides to `@use 'bulma/sass' with (…)` plus `@use '@allxsmith/bestax-bulma/scss/extras'`\n- update `package.json`: remove the source library, add `@allxsmith/bestax-bulma`, raise a declared pre-1.0 `bulma` to `^1` (adding it only when your sources import `bulma/…` directly — otherwise it arrives transitively), and swap the dead `node-sass` for dart `sass` (no install is ever run). Migrating **rbx** is what frees an app from Bulma 0.7.5: rbx pinned it as a _direct_ dependency, so the app could not choose its own Bulma version at all. The four Bulma extensions rbx also pulled in (`bulma-badge`, `bulma-divider`, `bulma-pageloader`, `bulma-tooltip`) are **reported rather than removed** — bestax replaces all four, but a manifest entry is a deliberate declaration and your own Sass may import them. A **bloomer** app declared its own Bulma 0.6, which is what gets bumped. For **bulma-classes** there is no library to remove, and by default (`--css keep`) the app's Bulma version, Sass and stylesheet imports all stay: its own Bulma already styles every class a converted element renders. `--css bestax` or `--css bulma` moves it to Bulma v1 like the other sources\n\nAnything without a safe automatic conversion is left in place with a `// TODO(bestax-migrate): …` comment, and the run ends with a report of every TODO by file and line. TODOs are expected output, not errors — resolve them with the migration guide ([react-bulma-components](https://bestax.io/docs/guides/getting-started/migration/react-bulma-components), [rbx](https://bestax.io/docs/guides/getting-started/migration/rbx), [bloomer](https://bestax.io/docs/guides/getting-started/migration/bloomer), [Bulma classes](https://bestax.io/docs/guides/getting-started/migration/bulma-classes)), or let the [`bestax-migrate` Agent Skill](https://bestax.io/docs/skills/intro) walk them for you:\n\n```bash\nnpx skills add https://github.com/allxsmith/bestax --skill bestax-migrate\n```\n\n### Through the Codemod Registry\n\nbestax-migrate is also in the [Codemod Registry](https://app.codemod.com/registry) as `bestax-migrate`, for teams that run their migrations through Codemod. That package runs this CLI from npm at a pinned release, which can trail the newest one:\n\n```bash\n# Preview (no writes)\nnpx codemod bestax-migrate --workflow preview --param source=react-bulma-components\n# Apply\nnpx codemod bestax-migrate --param source=react-bulma-components\n```\n\nRun it from your app root. `--param paths=\"src lib\"` (default `src`) and `--param options=\"--css keep\"` pass through to the CLI. Codemod's own `--dry-run` skips the shell step this package runs, so use the `preview` workflow for a dry run.\n\n## Options\n\n| Flag | Description |\n| -------------------- | ---------------------------------------------------------------------------------------------- |\n| `--dry`, `-d` | Report what would change without writing files |\n| `--print`, `-p` | Print transformed sources to stdout |\n| `--extensions`, `-e` | File extensions to include (default `js,jsx,ts,tsx,scss,sass`) |\n| `--css <mode>` | Stylesheet target: `bestax`, `bulma`, or `keep` (default `bestax`; `keep` for `bulma-classes`) |\n| `--no-deps` | Skip updating package.json dependencies |\n\n## After the codemod\n\n1. Run your package manager's install (the codemod rewrote `package.json` but never installs)\n2. Search for `TODO(bestax-migrate)` and resolve each comment\n3. Typecheck/build and review the rendered app\n\nFull walkthrough: [react-bulma-components migration guide](https://bestax.io/docs/guides/getting-started/migration/react-bulma-components) · [rbx migration guide](https://bestax.io/docs/guides/getting-started/migration/rbx) · [bloomer migration guide](https://bestax.io/docs/guides/getting-started/migration/bloomer) · [Bulma classes migration guide](https://bestax.io/docs/guides/getting-started/migration/bulma-classes).\n\n## Hardened by default\n\nA codemod rewrites your source in place, so how it is built and published matters:\n\n- **Signed provenance** — every release carries a sigstore attestation linking the tarball to the exact commit and CI run that built it. Check the **Provenance** section on the [npm page](https://www.npmjs.com/package/bestax-migrate#provenance), or run `npm audit signatures`.\n- **npm OIDC trusted publishing** — short-lived, per-run credentials; no long-lived `NPM_TOKEN` exists to be stolen. Release commits and tags are GPG-signed.\n- **Socket.dev scans every PR** for malware, install scripts, obfuscated code, and privilege escalation before it can reach `main`.\n- **The libraries this tool migrates away from are never installed here** — source fixtures are read as text only, so no unmaintained third-party package enters the dependency tree.\n- **Dependencies are a deliberate act** — install scripts are blocked unless individually allow-listed, freshly published versions are refused for 3 days, and CI installs only what the reviewed lockfile resolves.\n- **Every GitHub Action is pinned to a full commit SHA**, and CodeQL, Dependency Review, and Dependabot run continuously alongside a high-severity `pnpm audit` gate.\n- **Layered AI review before merge** — [CodeRabbit](https://coderabbit.ai) plus an independent adversarial Claude review (a different model from the one writing AI-authored changes), on top of required green CI, an approving review, and a human merge.\n\nFull detail: [`SECURITY.md`](https://github.com/allxsmith/bestax/blob/main/SECURITY.md) · [Security guide](https://bestax.io/docs/guides/security)\n\n## Telemetry\n\n`bestax-migrate` can send one **anonymous** usage event after a successful\nrun — only if you opt in when asked (once, on an interactive terminal). The\nevent is just the run's shape — source library, CSS mode, the dry/deps flags, a\ncapped changed-file count, and per-rule TODO counts — plus the CLI version,\nNode major version, and OS platform name. Never file paths, file contents,\ncode, names, IPs, or machine IDs, and no identifier exists that could link two\nevents together. Opt out any time with `--no-telemetry`,\n`BESTAX_TELEMETRY=0`, or `DO_NOT_TRACK=1`.\n\nFull disclosure of every field and control: [Telemetry guide](https://bestax.io/docs/guides/telemetry)\n\n## License\n\nSource code licensed MIT\n"
|
|
79
79
|
}
|