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,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stylesheet migration for rbx apps.
|
|
3
|
+
*
|
|
4
|
+
* Same shared factory as every other source — the Bulma 0.9 → v1 rewriting is
|
|
5
|
+
* identical.
|
|
6
|
+
*
|
|
7
|
+
* Note what it does NOT do: a `bulma-*` extension import in Sass is left in
|
|
8
|
+
* place with a TODO, not removed. The JS/CSS-import side in transform.ts does
|
|
9
|
+
* the same for `bulma-badge`/`bulma-divider`/`bulma-pageloader`/`bulma-tooltip`
|
|
10
|
+
* (kept, with a TODO), and the manifest pass reports rather than removes the
|
|
11
|
+
* packages, since markup outside rbx may still use the extension's classes. A
|
|
12
|
+
* Sass `@import` of one may be pulling in customisation the codemod cannot see,
|
|
13
|
+
* so it is flagged for a human instead.
|
|
14
|
+
*
|
|
15
|
+
* rbx's own stylesheet is `rbx/rbx` (its Sass entry, usually imported as
|
|
16
|
+
* `~rbx/rbx` after `~bulma/bulma`) or the prebuilt `rbx/index.css`. Both
|
|
17
|
+
* carry rbx's fixes on top of a full Bulma root, so they are replaced with a
|
|
18
|
+
* Bulma v1 root rather than dropped.
|
|
19
|
+
*/
|
|
20
|
+
export declare const transformStyles: import("../../types.js").StylesTransform;
|
|
21
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/sources/rbx/styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,eAAO,MAAM,eAAe,0CAQ1B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stylesheet migration for rbx apps.
|
|
3
|
+
*
|
|
4
|
+
* Same shared factory as every other source — the Bulma 0.9 → v1 rewriting is
|
|
5
|
+
* identical.
|
|
6
|
+
*
|
|
7
|
+
* Note what it does NOT do: a `bulma-*` extension import in Sass is left in
|
|
8
|
+
* place with a TODO, not removed. The JS/CSS-import side in transform.ts does
|
|
9
|
+
* the same for `bulma-badge`/`bulma-divider`/`bulma-pageloader`/`bulma-tooltip`
|
|
10
|
+
* (kept, with a TODO), and the manifest pass reports rather than removes the
|
|
11
|
+
* packages, since markup outside rbx may still use the extension's classes. A
|
|
12
|
+
* Sass `@import` of one may be pulling in customisation the codemod cannot see,
|
|
13
|
+
* so it is flagged for a human instead.
|
|
14
|
+
*
|
|
15
|
+
* rbx's own stylesheet is `rbx/rbx` (its Sass entry, usually imported as
|
|
16
|
+
* `~rbx/rbx` after `~bulma/bulma`) or the prebuilt `rbx/index.css`. Both
|
|
17
|
+
* carry rbx's fixes on top of a full Bulma root, so they are replaced with a
|
|
18
|
+
* Bulma v1 root rather than dropped.
|
|
19
|
+
*/
|
|
20
|
+
import { makeStylesTransform } from '../_shared/make-styles-transform.js';
|
|
21
|
+
export const transformStyles = makeStylesTransform({
|
|
22
|
+
packageName: 'rbx',
|
|
23
|
+
guideUrl: 'https://bestax.io/docs/guides/getting-started/migration/rbx',
|
|
24
|
+
rootStylesheetSuffixes: [
|
|
25
|
+
'/rbx(?:\\.s[ac]ss)?',
|
|
26
|
+
'/index(?:\\.min)?\\.css',
|
|
27
|
+
'/dist/rbx(?:\\.min)?\\.css',
|
|
28
|
+
],
|
|
29
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The rbx (v2) → @allxsmith/bestax-bulma transform.
|
|
3
|
+
*
|
|
4
|
+
* Passes, in order:
|
|
5
|
+
* 1. resolve imports (named/namespace) and `const { Item } = Card`-style
|
|
6
|
+
* destructuring into canonical rbx component paths
|
|
7
|
+
* 2. per-element: structural special → rename → responsive flattening →
|
|
8
|
+
* component prop map → universal helper props → badge/tooltip wrapping
|
|
9
|
+
* 3. rewrite imports: drop rbx, add one merged bestax-bulma import; keep a
|
|
10
|
+
* trimmed rbx import (with a TODO) only for components that have no
|
|
11
|
+
* bestax equivalent (Generic, Tile, List, …)
|
|
12
|
+
*
|
|
13
|
+
* Anything unsafe gets a `// TODO(bestax-migrate)` comment on the enclosing
|
|
14
|
+
* statement plus an entry in the run report.
|
|
15
|
+
*
|
|
16
|
+
* The pass that has no react-bulma-components counterpart is the last one.
|
|
17
|
+
* rbx exposes badges and tooltips as *helper props on any element*, backed by
|
|
18
|
+
* the bulma-badge / bulma-tooltip extensions; bestax has real `Badge` and
|
|
19
|
+
* `Tooltip` components. So `<Button tooltip="hi" />` is a wrapping rewrite,
|
|
20
|
+
* not a rename.
|
|
21
|
+
*/
|
|
22
|
+
import type { API, FileInfo } from 'jscodeshift';
|
|
23
|
+
import type { TransformOptions } from '../../types.js';
|
|
24
|
+
export default function transform(fileInfo: FileInfo, api: API, options?: TransformOptions): string | undefined;
|
|
25
|
+
//# sourceMappingURL=transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/sources/rbx/transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AA0DvD,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,GAAG,EACR,OAAO,GAAE,gBAAqB,GAC7B,MAAM,GAAG,SAAS,CAu/BpB"}
|