@flipova/foundation 2.4.4 → 3.0.0-beta.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/CHANGES.md +66 -0
- package/COMPONENTS.md +102 -0
- package/DOCS.md +261 -0
- package/LICENSE +1 -1
- package/README.md +169 -118
- package/components/contract/index.ts +3 -0
- package/components/contract/recipes/accordion.ts +42 -0
- package/components/contract/recipes/avatar.ts +41 -0
- package/components/contract/recipes/badge.ts +46 -0
- package/components/contract/recipes/button.ts +58 -0
- package/components/contract/recipes/calendar.ts +118 -0
- package/components/contract/recipes/card.ts +21 -0
- package/components/contract/recipes/checkbox.ts +33 -0
- package/components/contract/recipes/divider.ts +9 -0
- package/components/contract/recipes/fab.ts +31 -0
- package/components/contract/recipes/feedback.ts +66 -0
- package/components/contract/recipes/formcontrol.ts +16 -0
- package/components/contract/recipes/heading.ts +16 -0
- package/components/contract/recipes/icon.ts +40 -0
- package/components/contract/recipes/index.ts +30 -0
- package/components/contract/recipes/input.ts +39 -0
- package/components/contract/recipes/layout.ts +44 -0
- package/components/contract/recipes/link.ts +6 -0
- package/components/contract/recipes/modal.ts +40 -0
- package/components/contract/recipes/overlay.ts +250 -0
- package/components/contract/recipes/progress.ts +27 -0
- package/components/contract/recipes/radio.ts +39 -0
- package/components/contract/recipes/select.ts +63 -0
- package/components/contract/recipes/skeleton.ts +25 -0
- package/components/contract/recipes/slider.ts +50 -0
- package/components/contract/recipes/spinner.ts +12 -0
- package/components/contract/recipes/switch.ts +26 -0
- package/components/contract/recipes/table.ts +37 -0
- package/components/contract/recipes/tabs.ts +31 -0
- package/components/contract/recipes/text.ts +12 -0
- package/components/contract/recipes/textarea.ts +37 -0
- package/components/contract/recipes/util.ts +15 -0
- package/components/contract/theme.ts +116 -0
- package/components/contract/types.ts +598 -0
- package/components/providers/css-vars.ts +43 -0
- package/components/providers/flipova/components/Accordion.tsx +41 -0
- package/components/providers/flipova/components/ActionSheet.tsx +34 -0
- package/components/providers/flipova/components/Alert.tsx +15 -0
- package/components/providers/flipova/components/AlertDialog.tsx +31 -0
- package/components/providers/flipova/components/Avatar.tsx +30 -0
- package/components/providers/flipova/components/Badge.tsx +14 -0
- package/components/providers/flipova/components/BottomSheet.tsx +24 -0
- package/components/providers/flipova/components/Box.tsx +1 -0
- package/components/providers/flipova/components/Button.tsx +31 -0
- package/components/providers/flipova/components/Calendar.tsx +85 -0
- package/components/providers/flipova/components/Card.tsx +13 -0
- package/components/providers/flipova/components/Center.tsx +11 -0
- package/components/providers/flipova/components/Checkbox.tsx +24 -0
- package/components/providers/flipova/components/DateTimePicker.tsx +45 -0
- package/components/providers/flipova/components/Divider.tsx +9 -0
- package/components/providers/flipova/components/Drawer.tsx +18 -0
- package/components/providers/flipova/components/Fab.tsx +22 -0
- package/components/providers/flipova/components/FlatList.tsx +1 -0
- package/components/providers/flipova/components/FormControl.tsx +27 -0
- package/components/providers/flipova/components/Grid.tsx +18 -0
- package/components/providers/flipova/components/HStack.tsx +13 -0
- package/components/providers/flipova/components/Heading.tsx +19 -0
- package/components/providers/flipova/components/Icon.tsx +20 -0
- package/components/providers/flipova/components/Image.tsx +1 -0
- package/components/providers/flipova/components/ImageBackground.tsx +1 -0
- package/components/providers/flipova/components/ImageViewer.tsx +25 -0
- package/components/providers/flipova/components/Input.tsx +29 -0
- package/components/providers/flipova/components/InputAccessoryView.tsx +1 -0
- package/components/providers/flipova/components/KeyboardAvoidingView.tsx +1 -0
- package/components/providers/flipova/components/Link.tsx +21 -0
- package/components/providers/flipova/components/LiquidGlass.tsx +13 -0
- package/components/providers/flipova/components/Menu.tsx +43 -0
- package/components/providers/flipova/components/Modal.tsx +24 -0
- package/components/providers/flipova/components/Popover.tsx +23 -0
- package/components/providers/flipova/components/Portal.tsx +42 -0
- package/components/providers/flipova/components/Pressable.tsx +1 -0
- package/components/providers/flipova/components/Progress.tsx +22 -0
- package/components/providers/flipova/components/RadioGroup.tsx +36 -0
- package/components/providers/flipova/components/RefreshControl.tsx +1 -0
- package/components/providers/flipova/components/SafeAreaView.tsx +1 -0
- package/components/providers/flipova/components/ScrollView.tsx +1 -0
- package/components/providers/flipova/components/SectionList.tsx +1 -0
- package/components/providers/flipova/components/Select.tsx +61 -0
- package/components/providers/flipova/components/Skeleton.tsx +25 -0
- package/components/providers/flipova/components/Slider.tsx +52 -0
- package/components/providers/flipova/components/Spinner.tsx +19 -0
- package/components/providers/flipova/components/StatusBar.tsx +1 -0
- package/components/providers/flipova/components/Switch.tsx +21 -0
- package/components/providers/flipova/components/Table.tsx +33 -0
- package/components/providers/flipova/components/Tabs.tsx +39 -0
- package/components/providers/flipova/components/Text.tsx +13 -0
- package/components/providers/flipova/components/Textarea.tsx +28 -0
- package/components/providers/flipova/components/Toast.tsx +28 -0
- package/components/providers/flipova/components/Tooltip.tsx +34 -0
- package/components/providers/flipova/components/VStack.tsx +13 -0
- package/components/providers/flipova/components/View.tsx +1 -0
- package/components/providers/flipova/components/VirtualizedList.tsx +1 -0
- package/components/providers/flipova/index.tsx +189 -0
- package/components/providers/gluestack/index.tsx +226 -0
- package/components/providers/gluestack/more.tsx +151 -0
- package/components/{ui → providers/gluestack/ui}/accordion/index.tsx +2 -2
- package/components/{ui → providers/gluestack/ui}/actionsheet/index.tsx +15 -15
- package/components/{ui → providers/gluestack/ui}/alert/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/alert-dialog/index.tsx +3 -3
- package/components/{ui → providers/gluestack/ui}/badge/index.tsx +2 -2
- package/components/{ui → providers/gluestack/ui}/bottomsheet/index.tsx +11 -10
- package/components/{ui → providers/gluestack/ui}/box/index.tsx +4 -1
- package/components/{ui → providers/gluestack/ui}/button/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/calendar/index.tsx +4 -4
- package/components/{ui → providers/gluestack/ui}/card/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/center/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/checkbox/index.tsx +9 -8
- package/components/{ui → providers/gluestack/ui}/date-time-picker/index.tsx +4 -4
- package/components/providers/gluestack/ui/date-time-picker/index.web.tsx +197 -0
- package/components/{ui → providers/gluestack/ui}/divider/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/drawer/index.tsx +2 -2
- package/components/{ui → providers/gluestack/ui}/fab/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/form-control/index.tsx +3 -3
- package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/config.ts +1 -62
- package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/tokens.js +1 -1
- package/components/{ui → providers/gluestack/ui}/grid/index.tsx +3 -3
- package/components/{ui → providers/gluestack/ui}/heading/index.tsx +7 -7
- package/components/{ui → providers/gluestack/ui}/hstack/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/icon/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/image/index.tsx +0 -1
- package/components/{ui → providers/gluestack/ui}/image-viewer/index.tsx +96 -99
- package/components/providers/gluestack/ui/index.ts +58 -0
- package/components/{ui → providers/gluestack/ui}/input/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/link/index.tsx +2 -2
- package/components/{ui → providers/gluestack/ui}/liquid-glass/index.tsx +2 -2
- package/components/{ui → providers/gluestack/ui}/menu/index.tsx +5 -4
- package/components/{ui → providers/gluestack/ui}/modal/index.tsx +19 -17
- package/components/{ui → providers/gluestack/ui}/popover/index.tsx +4 -4
- package/components/{ui → providers/gluestack/ui}/portal/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/progress/index.tsx +2 -2
- package/components/{ui → providers/gluestack/ui}/radio/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/select/index.tsx +8 -12
- package/components/{ui → providers/gluestack/ui}/select/select-actionsheet.tsx +13 -13
- package/components/{ui → providers/gluestack/ui}/skeleton/index.tsx +2 -2
- package/components/{ui → providers/gluestack/ui}/slider/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/spinner/index.tsx +2 -2
- package/components/{ui → providers/gluestack/ui}/table/index.tsx +33 -33
- package/components/{ui → providers/gluestack/ui}/tabs/TabsAnimatedIndicator.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/tabs/index.tsx +2 -2
- package/components/{ui → providers/gluestack/ui}/text/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/toast/index.tsx +4 -4
- package/components/{ui → providers/gluestack/ui}/tooltip/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/vstack/index.tsx +1 -1
- package/components/providers/index.ts +2 -0
- package/components/providers/paper/index.tsx +449 -0
- package/components/providers/provider.tsx +80 -0
- package/components/providers/reusables/classes.ts +163 -0
- package/components/providers/reusables/index.tsx +289 -0
- package/components/providers/rn-base/Box.tsx +7 -0
- package/components/providers/rn-base/FlatList.tsx +16 -0
- package/components/providers/rn-base/Image.tsx +18 -0
- package/components/providers/rn-base/ImageBackground.tsx +11 -0
- package/components/providers/rn-base/InputAccessoryView.tsx +9 -0
- package/components/providers/rn-base/KeyboardAvoidingView.tsx +15 -0
- package/components/providers/rn-base/Pressable.tsx +19 -0
- package/components/providers/rn-base/RefreshControl.tsx +16 -0
- package/components/providers/rn-base/SafeAreaView.tsx +11 -0
- package/components/providers/rn-base/ScrollView.tsx +11 -0
- package/components/providers/rn-base/SectionList.tsx +22 -0
- package/components/providers/rn-base/StatusBar.tsx +17 -0
- package/components/providers/rn-base/View.tsx +7 -0
- package/components/providers/rn-base/VirtualizedList.tsx +18 -0
- package/components/providers/rn-base/index.tsx +64 -0
- package/components/providers/tamagui/index.tsx +375 -0
- package/components/providers/types.ts +17 -0
- package/components/theme/design-theme.ts +230 -0
- package/components/ui/create.tsx +14 -0
- package/components/ui/index.ts +68 -58
- package/components/ui/resolve.ts +40 -0
- package/design/canonical.index.txt +2 -16
- package/design/manifest.xml +4 -3
- package/design/schema.xsd +44 -434
- package/design/themes.xml +7 -177
- package/design/tools/{npm.js → cli.js} +173 -73
- package/design/tools/gui/index.html +998 -0
- package/design/tools/lib/check.js +533 -0
- package/design/tools/lib/contract.js +23 -0
- package/design/tools/lib/edit.js +166 -0
- package/design/tools/lib/generate.js +465 -0
- package/design/tools/lib/gui.js +614 -0
- package/design/tools/lib/lint.js +139 -0
- package/design/tools/lib/registry.js +135 -0
- package/design/tools/lib/util.js +53 -0
- package/design/tools/lib/xml.js +257 -0
- package/design/tools/lib/xsd.js +408 -0
- package/dist/chunk-2QM2ZUDS.mjs +1308 -0
- package/dist/chunk-2QM2ZUDS.mjs.map +1 -0
- package/dist/chunk-2T2TCUYF.js +1371 -0
- package/dist/chunk-2T2TCUYF.js.map +1 -0
- package/dist/chunk-6UKTC4KF.js +43 -0
- package/dist/chunk-6UKTC4KF.js.map +1 -0
- package/dist/chunk-6Z4WRTI4.mjs +37 -0
- package/dist/chunk-6Z4WRTI4.mjs.map +1 -0
- package/dist/chunk-G3K6J5KY.js +157 -0
- package/dist/chunk-G3K6J5KY.js.map +1 -0
- package/dist/chunk-GM45RCSI.mjs +96 -0
- package/dist/chunk-GM45RCSI.mjs.map +1 -0
- package/dist/chunk-GQJLHH2P.mjs +3 -0
- package/dist/chunk-GQJLHH2P.mjs.map +1 -0
- package/dist/chunk-ICNR56VP.js +1653 -0
- package/dist/chunk-ICNR56VP.js.map +1 -0
- package/dist/chunk-J5LGTIGS.mjs +9 -0
- package/dist/chunk-J5LGTIGS.mjs.map +1 -0
- package/dist/chunk-LRPZLF2K.mjs +30 -0
- package/dist/chunk-LRPZLF2K.mjs.map +1 -0
- package/dist/chunk-OC4MXNXU.js +32 -0
- package/dist/chunk-OC4MXNXU.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +11 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/chunk-RWVTZUEG.js +161 -0
- package/dist/chunk-RWVTZUEG.js.map +1 -0
- package/dist/chunk-V473I5XQ.js +4 -0
- package/dist/chunk-V473I5XQ.js.map +1 -0
- package/dist/chunk-V4ULAISZ.js +915 -0
- package/dist/chunk-V4ULAISZ.js.map +1 -0
- package/dist/chunk-WRJERTJS.mjs +145 -0
- package/dist/chunk-WRJERTJS.mjs.map +1 -0
- package/dist/chunk-YIBPE3KQ.mjs +864 -0
- package/dist/chunk-YIBPE3KQ.mjs.map +1 -0
- package/dist/chunk-YUAQIZPN.mjs +1556 -0
- package/dist/chunk-YUAQIZPN.mjs.map +1 -0
- package/dist/contract/index.d.mts +304 -0
- package/dist/contract/index.d.ts +304 -0
- package/dist/contract/index.js +256 -0
- package/dist/contract/index.js.map +1 -0
- package/dist/contract/index.mjs +3 -0
- package/dist/contract/index.mjs.map +1 -0
- package/dist/index.d.mts +4 -40
- package/dist/index.d.ts +4 -40
- package/dist/index.js +73 -992
- package/dist/index.mjs +2 -1
- package/dist/providers/flipova/index.d.mts +133 -0
- package/dist/providers/flipova/index.d.ts +133 -0
- package/dist/providers/flipova/index.js +249 -0
- package/dist/providers/flipova/index.js.map +1 -0
- package/dist/providers/flipova/index.mjs +4 -0
- package/dist/providers/flipova/index.mjs.map +1 -0
- package/dist/providers/gluestack/index.d.mts +7 -0
- package/dist/providers/gluestack/index.d.ts +7 -0
- package/dist/providers/gluestack/index.js +240 -0
- package/dist/providers/gluestack/index.js.map +1 -0
- package/dist/providers/gluestack/index.mjs +238 -0
- package/dist/providers/gluestack/index.mjs.map +1 -0
- package/dist/providers/gluestack/ui/index.d.mts +3472 -0
- package/dist/providers/gluestack/ui/index.d.ts +3472 -0
- package/dist/{chunk-LCTFQJZM.js → providers/gluestack/ui/index.js} +860 -2297
- package/dist/providers/gluestack/ui/index.js.map +1 -0
- package/dist/{chunk-2R66P5X5.mjs → providers/gluestack/ui/index.mjs} +468 -2062
- package/dist/providers/gluestack/ui/index.mjs.map +1 -0
- package/dist/providers/index.d.mts +37 -0
- package/dist/providers/index.d.ts +37 -0
- package/dist/providers/index.js +28 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/index.mjs +3 -0
- package/dist/providers/index.mjs.map +1 -0
- package/dist/providers/paper/index.d.mts +30 -0
- package/dist/providers/paper/index.d.ts +30 -0
- package/dist/providers/paper/index.js +362 -0
- package/dist/providers/paper/index.js.map +1 -0
- package/dist/providers/paper/index.mjs +353 -0
- package/dist/providers/paper/index.mjs.map +1 -0
- package/dist/providers/reusables/index.d.mts +60 -0
- package/dist/providers/reusables/index.d.ts +60 -0
- package/dist/providers/reusables/index.js +348 -0
- package/dist/providers/reusables/index.js.map +1 -0
- package/dist/providers/reusables/index.mjs +311 -0
- package/dist/providers/reusables/index.mjs.map +1 -0
- package/dist/providers/tamagui/index.d.mts +15 -0
- package/dist/providers/tamagui/index.d.ts +15 -0
- package/dist/providers/tamagui/index.js +275 -0
- package/dist/providers/tamagui/index.js.map +1 -0
- package/dist/providers/tamagui/index.mjs +270 -0
- package/dist/providers/tamagui/index.mjs.map +1 -0
- package/dist/theme-BznFrVT1.d.mts +566 -0
- package/dist/theme-BznFrVT1.d.ts +566 -0
- package/dist/types-C7P80VKR.d.ts +22 -0
- package/dist/types-Tspvmask.d.mts +22 -0
- package/dist/ui/index.d.mts +190 -7017
- package/dist/ui/index.d.ts +190 -7017
- package/dist/ui/index.js +73 -992
- package/dist/ui/index.mjs +2 -1
- package/package.json +136 -35
- package/components/ui/date-time-picker/index.web.tsx +0 -195
- package/design/documentation.xml +0 -607
- package/design/tools/design.js +0 -188
- package/design/tools/requirements.txt +0 -35
- package/design/tools/sources/.checker/__init__.py +0 -81
- package/design/tools/sources/.checker/checks.py +0 -198
- package/design/tools/sources/.checker/cli.py +0 -154
- package/design/tools/sources/.checker/io.py +0 -242
- package/design/tools/sources/.checker/model.py +0 -144
- package/design/tools/sources/.checker/registry.py +0 -115
- package/design/tools/sources/.checker/report.py +0 -21
- package/design/tools/sources/.docgen/__init__.py +0 -45
- package/design/tools/sources/.docgen/cli.py +0 -101
- package/design/tools/sources/.docgen/model.py +0 -147
- package/design/tools/sources/.docgen/reference.py +0 -97
- package/design/tools/sources/.docgen/site.py +0 -145
- package/design/tools/sources/.docgen/xsddoc.py +0 -329
- package/design/tools/sources/.generate/__init__.py +0 -35
- package/design/tools/sources/.generate/cli.py +0 -76
- package/design/tools/sources/.generate/common.py +0 -33
- package/design/tools/sources/.generate/config.py +0 -177
- package/design/tools/sources/.generate/model.py +0 -51
- package/design/tools/sources/.generate/tokens.py +0 -141
- package/design/tools/sources/.linter/__init__.py +0 -9
- package/design/tools/sources/.linter/cli.py +0 -44
- package/design/tools/sources/.linter/discovery.py +0 -30
- package/design/tools/sources/.linter/errors.py +0 -45
- package/design/tools/sources/.linter/linter.py +0 -68
- package/design/tools/sources/.xmleditor/__init__.py +0 -74
- package/design/tools/sources/.xmleditor/blocks.py +0 -185
- package/design/tools/sources/.xmleditor/cli.py +0 -141
- package/design/tools/sources/.xmleditor/editor.py +0 -906
- package/design/tools/sources/.xmleditor/model.py +0 -708
- package/design/tools/sources/.xmleditor/widgets.py +0 -1832
- package/design/tools/sources/.xmleditor/xsdmodel.py +0 -753
- package/design/tools/sources/checker.py +0 -55
- package/design/tools/sources/docgen.py +0 -66
- package/design/tools/sources/generate.py +0 -48
- package/design/tools/sources/linter.py +0 -54
- package/design/tools/sources/ruff.toml +0 -12
- package/design/tools/sources/xmleditor.py +0 -62
- package/design/tools/unix/_venv_python.sh +0 -16
- package/design/tools/unix/check.sh +0 -13
- package/design/tools/unix/doc.sh +0 -14
- package/design/tools/unix/gen.sh +0 -14
- package/design/tools/unix/lint.sh +0 -10
- package/design/tools/unix/run.sh +0 -20
- package/design/tools/unix/verify.sh +0 -12
- package/design/tools/unix/xmledit.sh +0 -12
- package/design/tools/windows/check.cmd +0 -12
- package/design/tools/windows/doc.cmd +0 -12
- package/design/tools/windows/gen.cmd +0 -11
- package/design/tools/windows/lint.cmd +0 -9
- package/design/tools/windows/run.cmd +0 -26
- package/design/tools/windows/verify.cmd +0 -10
- package/design/tools/windows/xmledit.cmd +0 -10
- package/dist/chunk-2R66P5X5.mjs.map +0 -1
- package/dist/chunk-LCTFQJZM.js.map +0 -1
- /package/components/{ui → providers/gluestack/ui}/accordion/ANIMATION_CUSTOMIZATION.md +0 -0
- /package/components/{ui → providers/gluestack/ui}/accordion/AccordionAnimatedHeight.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/accordion/AccordionAnimatedIcon.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/accordion/AnimatedHeight.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/accordion/AnimatedIcon.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/accordion/MIGRATION_SUMMARY.md +0 -0
- /package/components/{ui → providers/gluestack/ui}/accordion/USAGE_EXAMPLE.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/accordion/animation-config.ts +0 -0
- /package/components/{ui → providers/gluestack/ui}/avatar/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/box/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/box/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/calendar/creator.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/calendar/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/card/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/card/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/center/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/center/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/date-time-picker/creator.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/date-time-picker/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/flat-list/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/script.ts +0 -0
- /package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/theme-context.ts +0 -0
- /package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/tokens.d.ts +0 -0
- /package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/useGluestackColors.ts +0 -0
- /package/components/{ui → providers/gluestack/ui}/grid/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/grid/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/heading/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/heading/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/hstack/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/hstack/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/icon/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/image-background/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/image-viewer/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/input-accessory-view/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/keyboard-avoiding-view/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/pressable/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/refresh-control/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/safe-area-view/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/scroll-view/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/section-list/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/skeleton/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/skeleton/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/status-bar/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/switch/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/table/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/table/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/tabs/animation-config.ts +0 -0
- /package/components/{ui → providers/gluestack/ui}/tabs/creator.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/text/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/text/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/textarea/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/view/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/virtualized-list/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/vstack/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/vstack/styles.tsx +0 -0
package/design/tools/design.js
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* design/tools/design.js — cross-platform npm entry point for the design
|
|
4
|
-
* toolchain (mirrors design/tools/windows/*.cmd and design/tools/unix/*.sh).
|
|
5
|
-
*
|
|
6
|
-
* Usage:
|
|
7
|
-
* node design/tools/design.js <target> [extra args...]
|
|
8
|
-
*
|
|
9
|
-
* Targets (same semantics as the .cmd/.sh wrappers):
|
|
10
|
-
* gen generate.py — compile tokens/themes into the gluestack config
|
|
11
|
-
* check checker.py — determinism rules + XSD pass + ruff lint of sources/
|
|
12
|
-
* verify checker.py — verify committed canonical index
|
|
13
|
-
* canonical checker.py — re-emit design/canonical.index.txt
|
|
14
|
-
* lint linter.py — XSD-validate every design XML
|
|
15
|
-
* doc docgen.py — regenerate docs/generated from documentation.xml
|
|
16
|
-
* edit xmleditor.py — visual, XSD-driven XML block editor (GUI by default)
|
|
17
|
-
* run passthrough — run any sources/*.py with the resolved python
|
|
18
|
-
*
|
|
19
|
-
* Python resolution order:
|
|
20
|
-
* 1. $FOUNDATION_PYTHON (explicit override)
|
|
21
|
-
* 2. $FOUNDATION_VENV, else design/tools/.venv
|
|
22
|
-
* (Scripts/python.exe on Windows, bin/python otherwise)
|
|
23
|
-
* 3. `python3` then `python` on PATH, when `lxml` is importable
|
|
24
|
-
*
|
|
25
|
-
* Environment:
|
|
26
|
-
* FOUNDATION_DESIGN_DIR registry root (defaults to design/ next to tools/)
|
|
27
|
-
* FOUNDATION_PROJECT_ROOT output root for the generated artifacts
|
|
28
|
-
* FOUNDATION_DOCS_OUT docs output root (defaults to <root>/docs/generated)
|
|
29
|
-
* FOUNDATION_VENV venv directory holding the design dependencies
|
|
30
|
-
*
|
|
31
|
-
* Examples:
|
|
32
|
-
* node design/tools/design.js gen --check
|
|
33
|
-
* node design/tools/design.js gen --element Button
|
|
34
|
-
* node design/tools/design.js run checker.py --list-rules -m design/manifest.xml
|
|
35
|
-
*/
|
|
36
|
-
'use strict';
|
|
37
|
-
|
|
38
|
-
const { spawnSync } = require('child_process');
|
|
39
|
-
const fs = require('fs');
|
|
40
|
-
const path = require('path');
|
|
41
|
-
|
|
42
|
-
const TOOLS_DIR = __dirname;
|
|
43
|
-
const DESIGN_DIR = process.env.FOUNDATION_DESIGN_DIR
|
|
44
|
-
? path.resolve(process.env.FOUNDATION_DESIGN_DIR)
|
|
45
|
-
: path.join(TOOLS_DIR, '..');
|
|
46
|
-
// The tools always come from the package that runs them. `DESIGN_DIR` is the
|
|
47
|
-
// registry root, and an app that adopts the registries owns them without owning
|
|
48
|
-
// the toolchain: deriving the sources from it meant `sources/` had to be copied
|
|
49
|
-
// too, which is the duplication the CLI exists to avoid - and a copy without
|
|
50
|
-
// `tools/` simply had no generator to run.
|
|
51
|
-
const SOURCES_DIR = path.join(TOOLS_DIR, 'sources');
|
|
52
|
-
const REPO_ROOT = process.env.FOUNDATION_PROJECT_ROOT
|
|
53
|
-
? path.resolve(process.env.FOUNDATION_PROJECT_ROOT)
|
|
54
|
-
: path.join(DESIGN_DIR, '..');
|
|
55
|
-
|
|
56
|
-
const MANIFEST = path.join(DESIGN_DIR, 'manifest.xml');
|
|
57
|
-
const SCHEMA = path.join(DESIGN_DIR, 'schema.xsd');
|
|
58
|
-
const DOCUMENTATION = path.join(DESIGN_DIR, 'documentation.xml');
|
|
59
|
-
const DOCS_OUT = process.env.FOUNDATION_DOCS_OUT
|
|
60
|
-
? path.resolve(process.env.FOUNDATION_DOCS_OUT)
|
|
61
|
-
: path.join(REPO_ROOT, 'docs', 'generated');
|
|
62
|
-
|
|
63
|
-
const TARGETS = {
|
|
64
|
-
gen: {
|
|
65
|
-
script: 'generate.py',
|
|
66
|
-
args: ['--manifest', MANIFEST, '--root', REPO_ROOT],
|
|
67
|
-
},
|
|
68
|
-
check: {
|
|
69
|
-
script: 'checker.py',
|
|
70
|
-
args: ['--manifest', MANIFEST, '--root', REPO_ROOT, '--schema', SCHEMA, '--check'],
|
|
71
|
-
},
|
|
72
|
-
verify: {
|
|
73
|
-
script: 'checker.py',
|
|
74
|
-
args: ['--manifest', MANIFEST, '--root', REPO_ROOT, '--verify-canonical'],
|
|
75
|
-
},
|
|
76
|
-
canonical: {
|
|
77
|
-
script: 'checker.py',
|
|
78
|
-
args: ['--manifest', MANIFEST, '--root', REPO_ROOT, '--emit-canonical'],
|
|
79
|
-
},
|
|
80
|
-
lint: {
|
|
81
|
-
script: 'linter.py',
|
|
82
|
-
args: ['--schema', SCHEMA, '--manifest', MANIFEST, '--dir', DESIGN_DIR],
|
|
83
|
-
},
|
|
84
|
-
doc: {
|
|
85
|
-
script: 'docgen.py',
|
|
86
|
-
args: ['--manifest', MANIFEST, '--documentation', DOCUMENTATION, '--root', REPO_ROOT, '--out', DOCS_OUT],
|
|
87
|
-
},
|
|
88
|
-
pipeline: {
|
|
89
|
-
script: null,
|
|
90
|
-
args: [],
|
|
91
|
-
},
|
|
92
|
-
edit: {
|
|
93
|
-
script: 'xmleditor.py',
|
|
94
|
-
// No default args: an optional positional XML file and every CLI flag
|
|
95
|
-
// (--list-roots, --validate, --new, ...) pass through untouched.
|
|
96
|
-
args: [],
|
|
97
|
-
},
|
|
98
|
-
run: {
|
|
99
|
-
script: null, // passthrough: first extra arg is the script name
|
|
100
|
-
args: [],
|
|
101
|
-
},
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
function findPython() {
|
|
105
|
-
if (process.env.FOUNDATION_PYTHON) return process.env.FOUNDATION_PYTHON;
|
|
106
|
-
|
|
107
|
-
const venvDirs = [];
|
|
108
|
-
if (process.env.FOUNDATION_VENV) venvDirs.push(path.resolve(process.env.FOUNDATION_VENV));
|
|
109
|
-
venvDirs.push(path.join(TOOLS_DIR, '.venv'));
|
|
110
|
-
if (REPO_ROOT !== DESIGN_DIR) venvDirs.push(path.join(REPO_ROOT, 'design', 'tools', '.venv'));
|
|
111
|
-
|
|
112
|
-
for (const dir of venvDirs) {
|
|
113
|
-
const candidates =
|
|
114
|
-
process.platform === 'win32'
|
|
115
|
-
? [path.join(dir, 'Scripts', 'python.exe')]
|
|
116
|
-
: [path.join(dir, 'bin', 'python3'), path.join(dir, 'bin', 'python')];
|
|
117
|
-
for (const candidate of candidates) {
|
|
118
|
-
if (fs.existsSync(candidate)) return candidate;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const pathExes = process.platform === 'win32' ? ['python.exe', 'python3.exe'] : ['python3', 'python'];
|
|
123
|
-
for (const exe of pathExes) {
|
|
124
|
-
try {
|
|
125
|
-
const probe = spawnSync(exe, ['-c', 'import lxml.etree'], { stdio: 'ignore' });
|
|
126
|
-
if (probe.status === 0) return exe;
|
|
127
|
-
} catch (_) {
|
|
128
|
-
/* not on PATH */
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return null;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function main() {
|
|
135
|
-
const [target, ...extra] = process.argv.slice(2);
|
|
136
|
-
const spec = TARGETS[target];
|
|
137
|
-
if (!spec) {
|
|
138
|
-
process.stderr.write(
|
|
139
|
-
'Unknown target: %s\nAvailable targets: %s\n'
|
|
140
|
-
.replace('%s', String(target))
|
|
141
|
-
.replace('%s', Object.keys(TARGETS).join(', ')),
|
|
142
|
-
);
|
|
143
|
-
process.exit(2);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
let scriptPath;
|
|
147
|
-
let args;
|
|
148
|
-
if (target === 'pipeline') {
|
|
149
|
-
for (const step of ['gen', 'check', 'verify', 'lint', 'doc']) {
|
|
150
|
-
const result = spawnSync(process.execPath, [__filename, step, ...extra], {
|
|
151
|
-
stdio: 'inherit',
|
|
152
|
-
env: process.env,
|
|
153
|
-
});
|
|
154
|
-
if (result.status !== 0) process.exit(result.status == null ? 1 : result.status);
|
|
155
|
-
}
|
|
156
|
-
process.exit(0);
|
|
157
|
-
}
|
|
158
|
-
if (target === 'run') {
|
|
159
|
-
const scriptName = extra.shift();
|
|
160
|
-
if (!scriptName) {
|
|
161
|
-
process.stderr.write('Usage: node design/tools/design.js run <script.py> [args...]\n');
|
|
162
|
-
process.exit(2);
|
|
163
|
-
}
|
|
164
|
-
scriptPath = path.join(SOURCES_DIR, scriptName);
|
|
165
|
-
args = extra;
|
|
166
|
-
} else {
|
|
167
|
-
scriptPath = path.join(SOURCES_DIR, spec.script);
|
|
168
|
-
args = spec.args.concat(extra);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const python = findPython();
|
|
172
|
-
if (!python) {
|
|
173
|
-
process.stderr.write(
|
|
174
|
-
'No suitable Python found. Create the project venv or set FOUNDATION_PYTHON.\n' +
|
|
175
|
-
' C:/opt/Python38-32/python3.exe -m venv --without-pip --system-site-packages design/tools/.venv\n',
|
|
176
|
-
);
|
|
177
|
-
process.exit(2);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
const result = spawnSync(python, [scriptPath].concat(args), { stdio: 'inherit' });
|
|
181
|
-
if (result.error) {
|
|
182
|
-
process.stderr.write(String(result.error) + '\n');
|
|
183
|
-
process.exit(1);
|
|
184
|
-
}
|
|
185
|
-
process.exit(result.status == null ? 1 : result.status);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
main();
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Python runtime requirements for the design-system toolchain
|
|
2
|
-
# design/tools/sources/linter.py (agnostic XML <-> XSD validator)
|
|
3
|
-
# design/tools/sources/checker.py (manifest determinism rules + XSD pass
|
|
4
|
-
# + ruff lint of design/tools/sources)
|
|
5
|
-
# design/tools/sources/generate.py (tokens/themes -> gluestack config)
|
|
6
|
-
# design/tools/sources/docgen.py (documentation site generator)
|
|
7
|
-
# design/tools/sources/xmleditor.py (visual XSD-driven XML block editor:
|
|
8
|
-
# tkinter GUI + headless CLI)
|
|
9
|
-
#
|
|
10
|
-
# All tools require Python 3.8+.
|
|
11
|
-
#
|
|
12
|
-
# In CI the tooling is installed on a pinned interpreter (3.12) with
|
|
13
|
-
# `pip install --only-binary=:all:`. Wheels are mandatory here: `lxml < 6` has
|
|
14
|
-
# no wheel for the newest CPython, and building it from source needs the
|
|
15
|
-
# libxml2/libxslt development headers that the runners do not provide. Pinning
|
|
16
|
-
# the interpreter in the workflows keeps this a fast, deterministic install.
|
|
17
|
-
# Third-party dependencies:
|
|
18
|
-
# lxml ElementTree / XMLSchema backend — used by every tool
|
|
19
|
-
# ruff Python linter — run automatically by checker.py --check
|
|
20
|
-
# (i.e. by npm run design:check / design:pipeline)
|
|
21
|
-
#
|
|
22
|
-
# tkinter (the XML editor's GUI) ships with the standard library; headless
|
|
23
|
-
# CLI modes of xmleditor.py do not need it. On minimal Linux images install
|
|
24
|
-
# it with your package manager (e.g. apt install python3-tk).
|
|
25
|
-
#
|
|
26
|
-
# Install with:
|
|
27
|
-
# python3 -m pip install -r design/tools/requirements.txt
|
|
28
|
-
# or
|
|
29
|
-
# pip install -r design/tools/requirements.txt
|
|
30
|
-
|
|
31
|
-
lxml>=4.7,<6
|
|
32
|
-
# Floor at 0.16.9: EXE001 (shebang without the executable bit) only exists on
|
|
33
|
-
# POSIX, so a Windows developer must run the same linter version as CI to see
|
|
34
|
-
# what CI sees. Bump this floor whenever a newer ruff adds a rule.
|
|
35
|
-
ruff>=0.16.9,<1
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"""Flipova Foundation determinism checker (implementation package).
|
|
2
|
-
|
|
3
|
-
Split out of the historical ``checker.py`` monolith for modularity:
|
|
4
|
-
|
|
5
|
-
- ``model.py`` : Rule/Diagnostic/RegistryModel, reference resolution
|
|
6
|
-
- ``registry.py`` : handler registry, target expansion, ordering checks
|
|
7
|
-
- ``checks.py`` : one handler per rule kind (ids, ordering, references,
|
|
8
|
-
timestamps, locale, style, sync)
|
|
9
|
-
- ``io.py`` : build_model, canonical index, sync-version, XSD pass
|
|
10
|
-
- ``cli.py`` : argument parsing & dispatch (``main``)
|
|
11
|
-
- ``report.py`` : Report (diagnostics collector)
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
from __future__ import annotations
|
|
15
|
-
|
|
16
|
-
from .checks import (
|
|
17
|
-
handler_ids,
|
|
18
|
-
handler_locale,
|
|
19
|
-
handler_ordering,
|
|
20
|
-
handler_references,
|
|
21
|
-
handler_sync,
|
|
22
|
-
handler_timestamps,
|
|
23
|
-
)
|
|
24
|
-
from .cli import main
|
|
25
|
-
from .io import (
|
|
26
|
-
build_model,
|
|
27
|
-
canonical_document,
|
|
28
|
-
canonical_payload,
|
|
29
|
-
resolve_reference_value,
|
|
30
|
-
sync_versions,
|
|
31
|
-
validate_xsd,
|
|
32
|
-
)
|
|
33
|
-
from .model import (
|
|
34
|
-
Diagnostic,
|
|
35
|
-
RegistryModel,
|
|
36
|
-
Rule,
|
|
37
|
-
cap,
|
|
38
|
-
localname,
|
|
39
|
-
natural_key,
|
|
40
|
-
q,
|
|
41
|
-
resolve_reference,
|
|
42
|
-
slug,
|
|
43
|
-
)
|
|
44
|
-
from .registry import HANDLERS, expand_targets, iter_files, register
|
|
45
|
-
from .report import Report
|
|
46
|
-
|
|
47
|
-
__all__ = [
|
|
48
|
-
# registry
|
|
49
|
-
"HANDLERS",
|
|
50
|
-
# model
|
|
51
|
-
"Diagnostic",
|
|
52
|
-
"RegistryModel",
|
|
53
|
-
# report
|
|
54
|
-
"Report",
|
|
55
|
-
"Rule",
|
|
56
|
-
# io
|
|
57
|
-
"build_model",
|
|
58
|
-
"canonical_document",
|
|
59
|
-
"canonical_payload",
|
|
60
|
-
"cap",
|
|
61
|
-
"expand_targets",
|
|
62
|
-
# checks
|
|
63
|
-
"handler_ids",
|
|
64
|
-
"handler_locale",
|
|
65
|
-
"handler_ordering",
|
|
66
|
-
"handler_references",
|
|
67
|
-
"handler_sync",
|
|
68
|
-
"handler_timestamps",
|
|
69
|
-
"iter_files",
|
|
70
|
-
"localname",
|
|
71
|
-
# cli
|
|
72
|
-
"main",
|
|
73
|
-
"natural_key",
|
|
74
|
-
"q",
|
|
75
|
-
"register",
|
|
76
|
-
"resolve_reference",
|
|
77
|
-
"resolve_reference_value",
|
|
78
|
-
"slug",
|
|
79
|
-
"sync_versions",
|
|
80
|
-
"validate_xsd",
|
|
81
|
-
]
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import re
|
|
4
|
-
from pathlib import Path
|
|
5
|
-
|
|
6
|
-
from lxml import etree
|
|
7
|
-
|
|
8
|
-
from .model import RegistryModel, Rule, localname
|
|
9
|
-
from .registry import register
|
|
10
|
-
from .report import Report
|
|
11
|
-
|
|
12
|
-
# ---------------------------------------------------------------------------
|
|
13
|
-
# kind: ids
|
|
14
|
-
# ---------------------------------------------------------------------------
|
|
15
|
-
|
|
16
|
-
NON_ASCII_RE = re.compile(r"[^\x00-\x7F]")
|
|
17
|
-
TIMESTAMP_RE = re.compile(
|
|
18
|
-
r"\b\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2})?(?:Zz|[+-]\d{2}:?\d{2})?"
|
|
19
|
-
r"|\b\d{4}-\d{2}-\d{2}\b"
|
|
20
|
-
r"|\b1[5-9]\d{8}\b"
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@register("ids")
|
|
25
|
-
def handler_ids(ctx: RegistryModel, rule: Rule, targets: list[Path], report: Report) -> None:
|
|
26
|
-
pattern = rule.get("pattern") or r"^[A-Za-z][A-Za-z0-9]*$"
|
|
27
|
-
selectors = set(rule.get_list("selectors", ["token", "theme", "role", "item", "register"]))
|
|
28
|
-
regex = re.compile(pattern)
|
|
29
|
-
for path in targets:
|
|
30
|
-
doc = etree.parse(str(path))
|
|
31
|
-
for elem in doc.iter():
|
|
32
|
-
name = localname(elem.tag)
|
|
33
|
-
if name not in selectors:
|
|
34
|
-
continue
|
|
35
|
-
ident = elem.get("id")
|
|
36
|
-
if ident is None:
|
|
37
|
-
ident = elem.get("register") or elem.get("name")
|
|
38
|
-
if ident is None and name in ("item", "field", "key", "register"):
|
|
39
|
-
ident = (elem.text or "").strip()
|
|
40
|
-
if not ident:
|
|
41
|
-
continue
|
|
42
|
-
if not regex.fullmatch(ident):
|
|
43
|
-
report.add(rule, str(path), elem.sourceline,
|
|
44
|
-
f"id {ident!r} violates stable-slug pattern {pattern!r} (explicit uid, otherwise stable slug)")
|
|
45
|
-
if ident in ctx.reserves:
|
|
46
|
-
report.add(rule, str(path), elem.sourceline,
|
|
47
|
-
"id {!r} is a reserved word ({})".format(ident, ", ".join(ctx.reserves)))
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
# ---------------------------------------------------------------------------
|
|
51
|
-
# kind: ordering
|
|
52
|
-
# ---------------------------------------------------------------------------
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
@register("ordering")
|
|
56
|
-
def handler_ordering(ctx: RegistryModel, rule: Rule, targets: list[Path], report: Report) -> None:
|
|
57
|
-
mode = rule.get("mode") or "registers"
|
|
58
|
-
if mode == "registers":
|
|
59
|
-
_check_register_order(ctx, rule, report)
|
|
60
|
-
elif mode == "siblings":
|
|
61
|
-
selectors = rule.get_list("selectors", [])
|
|
62
|
-
for path in targets:
|
|
63
|
-
_check_sibling_order(path, rule, selectors, report)
|
|
64
|
-
else:
|
|
65
|
-
report.add(rule, ctx.manifest_path.name, None,
|
|
66
|
-
f"unknown ordering mode {mode!r} (expected 'registers' or 'siblings')")
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
def _check_register_order(ctx: RegistryModel, rule: Rule, report: Report) -> None:
|
|
70
|
-
from .registry import _check_register_order as impl
|
|
71
|
-
|
|
72
|
-
impl(ctx, rule, report)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
def _check_sibling_order(path: Path, rule: Rule, selectors: list[str], report: Report) -> None:
|
|
76
|
-
from .registry import _check_sibling_order as impl
|
|
77
|
-
|
|
78
|
-
impl(path, rule, selectors, report)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
# ---------------------------------------------------------------------------
|
|
82
|
-
# kind: references
|
|
83
|
-
# ---------------------------------------------------------------------------
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
@register("references")
|
|
87
|
-
def handler_references(ctx: RegistryModel, rule: Rule, targets: list[Path], report: Report) -> None:
|
|
88
|
-
from .model import resolve_reference
|
|
89
|
-
|
|
90
|
-
pattern = rule.get("pattern")
|
|
91
|
-
regex = re.compile(pattern) if pattern else None
|
|
92
|
-
for path in targets:
|
|
93
|
-
doc = etree.parse(str(path))
|
|
94
|
-
for elem in doc.iter():
|
|
95
|
-
if localname(elem.tag) != "ref":
|
|
96
|
-
continue
|
|
97
|
-
ref = (elem.text or "").strip()
|
|
98
|
-
if not ref:
|
|
99
|
-
continue
|
|
100
|
-
if regex and not regex.fullmatch(ref):
|
|
101
|
-
report.add(rule, str(path), elem.sourceline,
|
|
102
|
-
f"reference {ref!r} violates format pattern {pattern!r} (expected $ref.<register>.<id>.<path> or <id>.<path>)")
|
|
103
|
-
if not resolve_reference(ctx, ref):
|
|
104
|
-
report.add(rule, str(path), elem.sourceline,
|
|
105
|
-
f"dangling reference {ref!r}: no token value matches (never implicit links)")
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
# ---------------------------------------------------------------------------
|
|
109
|
-
# kind: timestamps
|
|
110
|
-
# ---------------------------------------------------------------------------
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
@register("timestamps")
|
|
114
|
-
def handler_timestamps(ctx: RegistryModel, rule: Rule, targets: list[Path], report: Report) -> None:
|
|
115
|
-
for path in targets:
|
|
116
|
-
doc = etree.parse(str(path))
|
|
117
|
-
for elem in doc.iter():
|
|
118
|
-
values = []
|
|
119
|
-
if elem.text and elem.text.strip():
|
|
120
|
-
values.append(elem.text)
|
|
121
|
-
values.extend(attr for attr in elem.attrib.values() if attr and attr.strip())
|
|
122
|
-
for value in values:
|
|
123
|
-
match = TIMESTAMP_RE.search(value)
|
|
124
|
-
if match:
|
|
125
|
-
report.add(rule, str(path), elem.sourceline,
|
|
126
|
-
f"timestamp forbidden: found {match.group(0)!r} (bit-identical rebuilds require no date/time literal)")
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
# ---------------------------------------------------------------------------
|
|
130
|
-
# kind: locale
|
|
131
|
-
# ---------------------------------------------------------------------------
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
@register("locale")
|
|
135
|
-
def handler_locale(ctx: RegistryModel, rule: Rule, targets: list[Path], report: Report) -> None:
|
|
136
|
-
# Free-text elements are documentation/labels, not identifiers or design
|
|
137
|
-
# values: they may be localized/prose and are exempt (manifest-declared).
|
|
138
|
-
exempt_tags = set(rule.get_list("exemptTags", ["label", "description", "content"]))
|
|
139
|
-
# Optional manifest-declared exempt subtrees (none by default).
|
|
140
|
-
exempt_subtrees = set(rule.get_list("exemptSubtrees", []))
|
|
141
|
-
# Prose attribute names (example/showcase titles & descriptions).
|
|
142
|
-
exempt_attrs = set(rule.get_list("exemptAttrs", ["title", "description"]))
|
|
143
|
-
for path in targets:
|
|
144
|
-
doc = etree.parse(str(path))
|
|
145
|
-
for elem in doc.iter():
|
|
146
|
-
if localname(elem.tag) in exempt_tags:
|
|
147
|
-
continue
|
|
148
|
-
parent = elem.getparent()
|
|
149
|
-
in_subtree = False
|
|
150
|
-
while parent is not None:
|
|
151
|
-
if localname(parent.tag) in exempt_subtrees:
|
|
152
|
-
in_subtree = True
|
|
153
|
-
break
|
|
154
|
-
parent = parent.getparent()
|
|
155
|
-
if in_subtree:
|
|
156
|
-
continue
|
|
157
|
-
values = []
|
|
158
|
-
if elem.text and elem.text.strip():
|
|
159
|
-
values.append(elem.text)
|
|
160
|
-
for attr_name, attr in elem.attrib.items():
|
|
161
|
-
if not attr or not attr.strip():
|
|
162
|
-
continue
|
|
163
|
-
if localname(attr_name) in exempt_attrs:
|
|
164
|
-
continue
|
|
165
|
-
# static:<payload> binds are display literals, not identifiers.
|
|
166
|
-
if attr.startswith("static:"):
|
|
167
|
-
attr = "static:"
|
|
168
|
-
values.append(attr)
|
|
169
|
-
for value in values:
|
|
170
|
-
match = NON_ASCII_RE.search(value)
|
|
171
|
-
if match:
|
|
172
|
-
report.add(rule, str(path), elem.sourceline,
|
|
173
|
-
f"locale forbidden in values: non-ASCII {match.group(0)!r} in {value.strip()!r} (allowed only in labels/comments)")
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
# --- kind: sync (manifest version / schema propagation) ---------------------
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
@register("sync")
|
|
180
|
-
def handler_sync(ctx: RegistryModel, rule: Rule, targets: list[Path], report: Report) -> None:
|
|
181
|
-
"""The manifest owns the registry namespace (@schema): every root that
|
|
182
|
-
declares it must carry the manifest value (run `checker.py --sync-version`
|
|
183
|
-
to fix drifted files in place).
|
|
184
|
-
|
|
185
|
-
The project version is NOT part of this: it lives in the root package.json
|
|
186
|
-
and is never duplicated in the XML, so it cannot drift.
|
|
187
|
-
"""
|
|
188
|
-
for path in targets:
|
|
189
|
-
try:
|
|
190
|
-
doc = etree.parse(str(path))
|
|
191
|
-
except etree.XMLSyntaxError as exc:
|
|
192
|
-
report.add(rule, str(path), exc.lineno, f"malformed XML: {exc.msg}")
|
|
193
|
-
continue
|
|
194
|
-
root = doc.getroot()
|
|
195
|
-
schema = root.get("schema")
|
|
196
|
-
if ctx.schema_id and schema is not None and schema != ctx.schema_id:
|
|
197
|
-
report.add(rule, str(path), 1,
|
|
198
|
-
f"root @schema {schema!r} != manifest @schema {ctx.schema_id!r} -- run `checker.py --sync-version`")
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import argparse
|
|
4
|
-
import re
|
|
5
|
-
import subprocess
|
|
6
|
-
import sys
|
|
7
|
-
from pathlib import Path
|
|
8
|
-
|
|
9
|
-
from .io import build_model, canonical_document, sync_versions, validate_xsd
|
|
10
|
-
from .model import Diagnostic
|
|
11
|
-
from .registry import HANDLERS, expand_targets
|
|
12
|
-
from .report import Report
|
|
13
|
-
|
|
14
|
-
# design/tools/sources/.checker/cli.py -> design/tools/sources
|
|
15
|
-
SOURCES_DIR = Path(__file__).resolve().parents[1]
|
|
16
|
-
RUFF_CONFIG = SOURCES_DIR / "ruff.toml"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def run_ruff(report: Report, verbose: bool) -> None:
|
|
20
|
-
"""Lint the toolchain's Python sources with ruff (part of ``--check``).
|
|
21
|
-
|
|
22
|
-
Runs the project's interpreter (``python -m ruff``) over every script and
|
|
23
|
-
dot-package under ``design/tools/sources`` with the same ``ruff.toml`` the
|
|
24
|
-
editors use, so ``npm run design:check`` gates Python style next to the
|
|
25
|
-
manifest determinism rules.
|
|
26
|
-
"""
|
|
27
|
-
cmd = [sys.executable, "-m", "ruff", "check",
|
|
28
|
-
"--config", str(RUFF_CONFIG),
|
|
29
|
-
"--output-format", "concise", "--quiet", "."]
|
|
30
|
-
if verbose:
|
|
31
|
-
print(f"ruff: {' '.join(cmd)} (cwd={SOURCES_DIR})")
|
|
32
|
-
try:
|
|
33
|
-
proc = subprocess.run(cmd, capture_output=True, text=True, cwd=str(SOURCES_DIR),
|
|
34
|
-
check=False)
|
|
35
|
-
except OSError as exc:
|
|
36
|
-
report.diagnostics.append(Diagnostic(
|
|
37
|
-
"ruff", "error", str(RUFF_CONFIG), None, f"cannot run ruff: {exc}"))
|
|
38
|
-
return
|
|
39
|
-
stderr = (proc.stderr or "").strip()
|
|
40
|
-
if proc.returncode not in (0, 1):
|
|
41
|
-
# Not lint results: ruff is missing or the invocation failed.
|
|
42
|
-
first = stderr.splitlines()[0] if stderr else f"exit code {proc.returncode}"
|
|
43
|
-
report.diagnostics.append(Diagnostic(
|
|
44
|
-
"ruff", "error", str(RUFF_CONFIG), None,
|
|
45
|
-
f"ruff failed to run ({first}); install it with: "
|
|
46
|
-
"pip install -r design/tools/requirements.txt"))
|
|
47
|
-
return
|
|
48
|
-
seen = 0
|
|
49
|
-
for line in (proc.stdout or "").splitlines():
|
|
50
|
-
line = line.strip()
|
|
51
|
-
if not line:
|
|
52
|
-
continue
|
|
53
|
-
seen += 1
|
|
54
|
-
match = re.match(r"^(?P<file>.+?):(?P<line>\d+):\d+: (?P<code>\S+) (?P<msg>.+)$", line)
|
|
55
|
-
if match is None:
|
|
56
|
-
report.diagnostics.append(Diagnostic(
|
|
57
|
-
"ruff", "error", str(SOURCES_DIR), None, line))
|
|
58
|
-
continue
|
|
59
|
-
report.diagnostics.append(Diagnostic(
|
|
60
|
-
"ruff", "error", match.group("file"), int(match.group("line")),
|
|
61
|
-
f"{match.group('code')}: {match.group('msg')}"))
|
|
62
|
-
if seen:
|
|
63
|
-
print(f"ruff: {seen} violation(s) ({SOURCES_DIR})")
|
|
64
|
-
elif verbose:
|
|
65
|
-
print(f"ruff: clean ({SOURCES_DIR})")
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
def main() -> int:
|
|
69
|
-
parser = argparse.ArgumentParser(
|
|
70
|
-
description="Manifest-driven determinism checker (rules declared in the manifest, not in code)."
|
|
71
|
-
)
|
|
72
|
-
parser.add_argument("--manifest", "-m", required=True, help="Path to manifest.xml")
|
|
73
|
-
parser.add_argument("--root", "-r", default=".", help="Repository root for applyTo globs (default: cwd)")
|
|
74
|
-
parser.add_argument("--schema", "-s", help="Optional XSD schema: validates every XML via linter.py first")
|
|
75
|
-
parser.add_argument("--check", action="store_true",
|
|
76
|
-
help="Run the declared determinism rules + the ruff lint of design/tools/sources (default)")
|
|
77
|
-
parser.add_argument("--list-rules", action="store_true", help="Print the rules declared in the manifest")
|
|
78
|
-
parser.add_argument("--emit-canonical", action="store_true", help="Write the deterministic canonical index")
|
|
79
|
-
parser.add_argument("--out", default=None, help="Output path for --emit-canonical (default: design/canonical.index.txt)")
|
|
80
|
-
parser.add_argument("--verify-canonical", action="store_true", help="Compare committed canonical index with the registry")
|
|
81
|
-
parser.add_argument("--sync-version", action="store_true",
|
|
82
|
-
help="Rewrite @version/@schema on every XML root tag to the manifest values")
|
|
83
|
-
parser.add_argument("--no-ruff", action="store_true",
|
|
84
|
-
help="Skip the ruff lint of design/tools/sources during --check")
|
|
85
|
-
parser.add_argument("--verbose", "-v", action="store_true")
|
|
86
|
-
args = parser.parse_args()
|
|
87
|
-
|
|
88
|
-
root = Path(args.root).resolve()
|
|
89
|
-
manifest_path = Path(args.manifest).resolve()
|
|
90
|
-
ctx = build_model(root, manifest_path)
|
|
91
|
-
|
|
92
|
-
if args.list_rules:
|
|
93
|
-
print("Determinism rules declared in {} (handlers: {}):".format(manifest_path.relative_to(root), ", ".join(sorted(HANDLERS))))
|
|
94
|
-
for rule in ctx.rules:
|
|
95
|
-
status = "registered" if rule.kind in HANDLERS else "NO HANDLER (warning)"
|
|
96
|
-
print(f" - {rule.id} kind={rule.kind} severity={rule.severity} applyTo={rule.apply_to} [{status}]")
|
|
97
|
-
print(f" {rule.description}")
|
|
98
|
-
return 0
|
|
99
|
-
|
|
100
|
-
report = Report()
|
|
101
|
-
|
|
102
|
-
if args.schema:
|
|
103
|
-
xsd_report = validate_xsd(ctx, Path(args.schema), args.verbose)
|
|
104
|
-
report.diagnostics.extend(xsd_report.diagnostics)
|
|
105
|
-
|
|
106
|
-
if args.check:
|
|
107
|
-
for rule in ctx.rules:
|
|
108
|
-
if rule.kind not in HANDLERS:
|
|
109
|
-
report.add(rule, manifest_path.name, None,
|
|
110
|
-
f"no handler registered for kind={rule.kind!r}; rule declared but not enforced yet")
|
|
111
|
-
continue
|
|
112
|
-
targets = expand_targets(root, rule.apply_to)
|
|
113
|
-
HANDLERS[rule.kind](ctx, rule, targets, report)
|
|
114
|
-
if args.verbose:
|
|
115
|
-
print(f"rule {rule.id} [{rule.kind}]: {len(targets)} file(s), "
|
|
116
|
-
f"{sum(1 for d in report.diagnostics if d.rule_id == rule.id)} diagnostic(s)")
|
|
117
|
-
if not args.no_ruff:
|
|
118
|
-
run_ruff(report, args.verbose)
|
|
119
|
-
|
|
120
|
-
if args.emit_canonical:
|
|
121
|
-
out = Path(args.out) if args.out else root / "design" / "canonical.index.txt"
|
|
122
|
-
out.parent.mkdir(parents=True, exist_ok=True)
|
|
123
|
-
out.write_text(canonical_document(ctx), encoding="utf-8")
|
|
124
|
-
print(f"canonical index written to {out}")
|
|
125
|
-
|
|
126
|
-
if args.verify_canonical:
|
|
127
|
-
canonical_path = Path(args.out) if args.out else root / "design" / "canonical.index.txt"
|
|
128
|
-
if not canonical_path.exists():
|
|
129
|
-
report.diagnostics.append(Diagnostic(
|
|
130
|
-
"canonical", "error", str(canonical_path), None,
|
|
131
|
-
"canonical index file missing; run --emit-canonical"
|
|
132
|
-
))
|
|
133
|
-
else:
|
|
134
|
-
committed = canonical_path.read_text(encoding="utf-8").strip()
|
|
135
|
-
expected = canonical_document(ctx).strip()
|
|
136
|
-
if committed != expected:
|
|
137
|
-
report.diagnostics.append(Diagnostic(
|
|
138
|
-
"canonical", "error", str(canonical_path), None,
|
|
139
|
-
"canonical index drifted from the registry; run --emit-canonical and commit the new file"
|
|
140
|
-
))
|
|
141
|
-
|
|
142
|
-
if args.sync_version:
|
|
143
|
-
synced = sync_versions(ctx)
|
|
144
|
-
print(f"sync-version: {synced} file(s) updated (version={ctx.version!r} schema={ctx.schema_id!r})")
|
|
145
|
-
|
|
146
|
-
for diag in report.diagnostics:
|
|
147
|
-
print(f" {diag}")
|
|
148
|
-
errors = report.errors
|
|
149
|
-
print(f"checker: {len(errors)} error(s), {len(report.warnings)} warning(s)")
|
|
150
|
-
return 1 if errors else 0
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
if __name__ == "__main__":
|
|
154
|
-
sys.exit(main())
|