@oxy.so/bloom-language-codemod 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/LICENSE +673 -0
- package/README.md +42 -2
- package/lib/cli.d.ts +2 -0
- package/lib/cli.js +140 -0
- package/lib/components.d.ts +207 -0
- package/lib/components.js +824 -0
- package/lib/corpus.d.ts +10 -0
- package/lib/corpus.js +193 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.js +18 -0
- package/lib/overrides.d.ts +7 -0
- package/lib/overrides.js +98 -0
- package/lib/report.d.ts +41 -0
- package/lib/report.js +88 -0
- package/lib/resolve.d.ts +60 -0
- package/lib/resolve.js +483 -0
- package/lib/style.d.ts +68 -0
- package/lib/style.js +475 -0
- package/lib/table.d.ts +41 -0
- package/lib/table.js +96 -0
- package/lib/tailwind.d.ts +24 -0
- package/lib/tailwind.js +112 -0
- package/lib/transform.d.ts +61 -0
- package/lib/transform.js +4454 -0
- package/package.json +62 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Compatibility
|
|
6
|
+
|
|
7
|
+
- Its peer is `@oxy.so/bloom-language` 1.1.0 or newer, the language it writes.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Converts more of an app: `TouchableOpacity` as `.pressFade()`, the accessibility state, value and live region, auto margins, a gap per axis and border lines, a style's radius, stacking level and aspect ratio by value, inset as its edges, a hit slop per side, a ref and a layout handler.
|
|
12
|
+
- Bloom components: a `Button`'s runtime look, glyph size, press, spinner, open state, inks and static style; a `Card`'s and a `Tabs`' style; a `Chip`'s variant, accent colour and views beside its label; a `Field` of several controls; a `DropdownMenu` tree as `Menu(trigger, ...rows).menuStyle('dropdown')`; `Fab` as `FAB(...).glass(identity)`; `PageFooter`; a `Dialog`'s `onDismissed`; a `VirtualList`'s content style, refreshing and `onRefresh`, and a `RefreshControl`, as one refresh.
|
|
13
|
+
- `screen()` wraps a component whose every return is a `Screen`; a padding by `useSafeAreaInsets()` as `.safeAreaPadding()`; `useColorTokens()` reads, style constants, flex triples, a `Pressable`'s pressed style as `.when('pressed')`, `StyleSheet.absoluteFill`, a text's `fontSize`, `lineHeight` and `fontWeight`, geometry computed at render as points, and React Native's edge precedence.
|
|
14
|
+
|
|
15
|
+
## 0.1.0
|
|
16
|
+
|
|
17
|
+
First release. Moves an app's NativeWind `className` JSX and Bloom JSX to the Bloom language only where the rendered result stays the same, keeps everything else as JSX with its reason, and writes a report. See `docs/bloom-language-codemod.mdx` in the Bloom repository.
|
|
18
|
+
|
|
19
|
+
It is 0.x on purpose: the Bloom components it maps grow with each release, and a minor release may convert more or change a report's reasons.
|
|
20
|
+
|
|
21
|
+
### Compatibility
|
|
22
|
+
|
|
23
|
+
- Runs on Node 20.19 or newer: `npx bloom-language-codemod <app dir>` (`--help` for the options).
|
|
24
|
+
- Reads the language it writes for from the app's install: `@oxy.so/bloom-language` 1.0.0 or newer is its peer (the spec, the className table and the exports it ships).
|
|
25
|
+
- Compiles the app's NativeWind entry with Tailwind 4 from the app's own install (`tailwindcss`, `nativewind`, `@oxy.so/bloom`, `@oxy.so/app-preset`); `--package <name>=<dir>` reads one from a checkout instead.
|
|
26
|
+
- The parity proof (`--fixtures` and the parity suites) runs from a Bloom checkout: it renders each region with Bloom's Jest environment, the before side with Bloom 22 where the app hands a Bloom component a class.
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- The CLI, `bloom-language-codemod`: the report (`report.md`, `report.generated.json`), the converted files (`--write` in place) and the parity corpus (`--fixtures`).
|
|
31
|
+
- A README for the npm page.
|
|
32
|
+
- The library entry: `transformSource`, `report`, `loadTable`, `overriddenClasses` and `tailwind`.
|