nwui-cli 0.4.1 → 0.4.3
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/.turbo/turbo-build.log +2 -1
- package/build/index.js +33 -17
- package/build/install-component.js +105 -48
- package/build/login.js +14 -11
- package/build/utils/env.js +1 -1
- package/package.json +2 -1
- package/build/cli/src/index.js +0 -41
- package/build/cli/src/install-component.js +0 -42
- package/build/cli/src/login.js +0 -77
- package/build/cli/src/net.js +0 -12
- package/build/cli/src/project-setup.js +0 -1
- package/build/cli/src/prompts.js +0 -119
- package/build/cli/src/utils/local-storage.js +0 -19
- package/build/docs/app/data.js +0 -1380
- package/build/log/index.js +0 -81
- package/build/prompts.js +0 -119
- package/my-expo-app-2/app/+html.tsx +0 -46
- package/my-expo-app-2/app/+not-found.tsx +0 -33
- package/my-expo-app-2/app/_layout.tsx +0 -22
- package/my-expo-app-2/app/details.tsx +0 -17
- package/my-expo-app-2/app/index.tsx +0 -23
- package/my-expo-app-2/app-env.d.ts +0 -2
- package/my-expo-app-2/app.json +0 -48
- package/my-expo-app-2/assets/adaptive-icon.png +0 -0
- package/my-expo-app-2/assets/favicon.png +0 -0
- package/my-expo-app-2/assets/icon.png +0 -0
- package/my-expo-app-2/assets/splash.png +0 -0
- package/my-expo-app-2/babel.config.js +0 -18
- package/my-expo-app-2/cesconfig.json +0 -35
- package/my-expo-app-2/components/Button.tsx +0 -19
- package/my-expo-app-2/components/Container.tsx +0 -9
- package/my-expo-app-2/components/EditScreenInfo.tsx +0 -34
- package/my-expo-app-2/components/ScreenContent.tsx +0 -25
- package/my-expo-app-2/components/nativewindui/ActivityIndicator.tsx +0 -13
- package/my-expo-app-2/components/nativewindui/AdaptiveSearchHeader/AdaptiveSearchHeader.ios.tsx +0 -97
- package/my-expo-app-2/components/nativewindui/AdaptiveSearchHeader/AdaptiveSearchHeader.tsx +0 -264
- package/my-expo-app-2/components/nativewindui/AdaptiveSearchHeader/index.ts +0 -1
- package/my-expo-app-2/components/nativewindui/AdaptiveSearchHeader/types.ts +0 -95
- package/my-expo-app-2/components/nativewindui/Alert/Alert.ios.tsx +0 -65
- package/my-expo-app-2/components/nativewindui/Alert/Alert.tsx +0 -291
- package/my-expo-app-2/components/nativewindui/Alert/index.ts +0 -1
- package/my-expo-app-2/components/nativewindui/Alert/types.ts +0 -27
- package/my-expo-app-2/components/nativewindui/Badge.tsx +0 -84
- package/my-expo-app-2/components/nativewindui/Button.tsx +0 -156
- package/my-expo-app-2/components/nativewindui/Checkbox.tsx +0 -61
- package/my-expo-app-2/components/nativewindui/ContextMenu/ContextMenu.ios.tsx +0 -221
- package/my-expo-app-2/components/nativewindui/ContextMenu/ContextMenu.tsx +0 -420
- package/my-expo-app-2/components/nativewindui/ContextMenu/index.ts +0 -1
- package/my-expo-app-2/components/nativewindui/ContextMenu/types.ts +0 -91
- package/my-expo-app-2/components/nativewindui/ContextMenu/utils.ts +0 -14
- package/my-expo-app-2/components/nativewindui/DrawerContent.tsx +0 -145
- package/my-expo-app-2/components/nativewindui/DropdownMenu/DropdownMenu.ios.tsx +0 -168
- package/my-expo-app-2/components/nativewindui/DropdownMenu/DropdownMenu.tsx +0 -330
- package/my-expo-app-2/components/nativewindui/DropdownMenu/index.ts +0 -1
- package/my-expo-app-2/components/nativewindui/DropdownMenu/types.ts +0 -93
- package/my-expo-app-2/components/nativewindui/DropdownMenu/utils.ts +0 -14
- package/my-expo-app-2/components/nativewindui/Form.tsx +0 -125
- package/my-expo-app-2/components/nativewindui/LargeTitleHeader/LargeTitleHeader.ios.tsx +0 -99
- package/my-expo-app-2/components/nativewindui/LargeTitleHeader/LargeTitleHeader.tsx +0 -288
- package/my-expo-app-2/components/nativewindui/LargeTitleHeader/index.ts +0 -1
- package/my-expo-app-2/components/nativewindui/LargeTitleHeader/types.ts +0 -89
- package/my-expo-app-2/components/nativewindui/List.tsx +0 -433
- package/my-expo-app-2/components/nativewindui/SearchInput/SearchInput.ios.tsx +0 -177
- package/my-expo-app-2/components/nativewindui/SearchInput/SearchInput.tsx +0 -86
- package/my-expo-app-2/components/nativewindui/SearchInput/index.tsx +0 -1
- package/my-expo-app-2/components/nativewindui/SearchInput/types.ts +0 -12
- package/my-expo-app-2/components/nativewindui/SegmentedControl/SegmentedControl.ios.tsx +0 -31
- package/my-expo-app-2/components/nativewindui/SegmentedControl/SegmentedControl.tsx +0 -55
- package/my-expo-app-2/components/nativewindui/SegmentedControl/index.ts +0 -1
- package/my-expo-app-2/components/nativewindui/SegmentedControl/types.ts +0 -15
- package/my-expo-app-2/components/nativewindui/Stepper.tsx +0 -62
- package/my-expo-app-2/components/nativewindui/Text.tsx +0 -55
- package/my-expo-app-2/components/nativewindui/TextField/TextField.ios.tsx +0 -85
- package/my-expo-app-2/components/nativewindui/TextField/TextField.tsx +0 -326
- package/my-expo-app-2/components/nativewindui/TextField/index.tsx +0 -1
- package/my-expo-app-2/components/nativewindui/TextField/types.ts +0 -26
- package/my-expo-app-2/components/nativewindui/Toolbar.tsx +0 -116
- package/my-expo-app-2/global.css +0 -3
- package/my-expo-app-2/metro.config.js +0 -12
- package/my-expo-app-2/package-lock.json +0 -19162
- package/my-expo-app-2/package.json +0 -74
- package/my-expo-app-2/prettier.config.js +0 -11
- package/my-expo-app-2/tailwind.config.js +0 -11
- package/my-expo-app-3/app/+html.tsx +0 -46
- package/my-expo-app-3/app/+not-found.tsx +0 -33
- package/my-expo-app-3/app/_layout.tsx +0 -22
- package/my-expo-app-3/app/details.tsx +0 -17
- package/my-expo-app-3/app/index.tsx +0 -23
- package/my-expo-app-3/app-env.d.ts +0 -2
- package/my-expo-app-3/app.json +0 -48
- package/my-expo-app-3/assets/adaptive-icon.png +0 -0
- package/my-expo-app-3/assets/favicon.png +0 -0
- package/my-expo-app-3/assets/icon.png +0 -0
- package/my-expo-app-3/assets/splash.png +0 -0
- package/my-expo-app-3/babel.config.js +0 -18
- package/my-expo-app-3/cesconfig.json +0 -35
- package/my-expo-app-3/components/Button.tsx +0 -19
- package/my-expo-app-3/components/Container.tsx +0 -9
- package/my-expo-app-3/components/EditScreenInfo.tsx +0 -34
- package/my-expo-app-3/components/ScreenContent.tsx +0 -25
- package/my-expo-app-3/components/nativewindui/ActivityIndicator.tsx +0 -13
- package/my-expo-app-3/components/nativewindui/AdaptiveSearchHeader/AdaptiveSearchHeader.ios.tsx +0 -97
- package/my-expo-app-3/components/nativewindui/AdaptiveSearchHeader/AdaptiveSearchHeader.tsx +0 -264
- package/my-expo-app-3/components/nativewindui/AdaptiveSearchHeader/index.ts +0 -1
- package/my-expo-app-3/components/nativewindui/AdaptiveSearchHeader/types.ts +0 -95
- package/my-expo-app-3/components/nativewindui/Alert/Alert.ios.tsx +0 -65
- package/my-expo-app-3/components/nativewindui/Alert/Alert.tsx +0 -291
- package/my-expo-app-3/components/nativewindui/Alert/index.ts +0 -1
- package/my-expo-app-3/components/nativewindui/Alert/types.ts +0 -27
- package/my-expo-app-3/components/nativewindui/Badge.tsx +0 -84
- package/my-expo-app-3/components/nativewindui/Button.tsx +0 -156
- package/my-expo-app-3/components/nativewindui/Checkbox.tsx +0 -61
- package/my-expo-app-3/components/nativewindui/ContextMenu/ContextMenu.ios.tsx +0 -221
- package/my-expo-app-3/components/nativewindui/ContextMenu/ContextMenu.tsx +0 -420
- package/my-expo-app-3/components/nativewindui/ContextMenu/index.ts +0 -1
- package/my-expo-app-3/components/nativewindui/ContextMenu/types.ts +0 -91
- package/my-expo-app-3/components/nativewindui/ContextMenu/utils.ts +0 -14
- package/my-expo-app-3/components/nativewindui/DrawerContent.tsx +0 -145
- package/my-expo-app-3/components/nativewindui/DropdownMenu/DropdownMenu.ios.tsx +0 -168
- package/my-expo-app-3/components/nativewindui/DropdownMenu/DropdownMenu.tsx +0 -330
- package/my-expo-app-3/components/nativewindui/DropdownMenu/index.ts +0 -1
- package/my-expo-app-3/components/nativewindui/DropdownMenu/types.ts +0 -93
- package/my-expo-app-3/components/nativewindui/DropdownMenu/utils.ts +0 -14
- package/my-expo-app-3/components/nativewindui/Form.tsx +0 -125
- package/my-expo-app-3/components/nativewindui/LargeTitleHeader/LargeTitleHeader.ios.tsx +0 -99
- package/my-expo-app-3/components/nativewindui/LargeTitleHeader/LargeTitleHeader.tsx +0 -288
- package/my-expo-app-3/components/nativewindui/LargeTitleHeader/index.ts +0 -1
- package/my-expo-app-3/components/nativewindui/LargeTitleHeader/types.ts +0 -89
- package/my-expo-app-3/components/nativewindui/List.tsx +0 -433
- package/my-expo-app-3/components/nativewindui/SearchInput/SearchInput.ios.tsx +0 -177
- package/my-expo-app-3/components/nativewindui/SearchInput/SearchInput.tsx +0 -86
- package/my-expo-app-3/components/nativewindui/SearchInput/index.tsx +0 -1
- package/my-expo-app-3/components/nativewindui/SearchInput/types.ts +0 -12
- package/my-expo-app-3/components/nativewindui/SegmentedControl/SegmentedControl.ios.tsx +0 -31
- package/my-expo-app-3/components/nativewindui/SegmentedControl/SegmentedControl.tsx +0 -55
- package/my-expo-app-3/components/nativewindui/SegmentedControl/index.ts +0 -1
- package/my-expo-app-3/components/nativewindui/SegmentedControl/types.ts +0 -15
- package/my-expo-app-3/components/nativewindui/Stepper.tsx +0 -62
- package/my-expo-app-3/components/nativewindui/Text.tsx +0 -55
- package/my-expo-app-3/components/nativewindui/TextField/TextField.ios.tsx +0 -85
- package/my-expo-app-3/components/nativewindui/TextField/TextField.tsx +0 -326
- package/my-expo-app-3/components/nativewindui/TextField/index.tsx +0 -1
- package/my-expo-app-3/components/nativewindui/TextField/types.ts +0 -26
- package/my-expo-app-3/components/nativewindui/Toolbar.tsx +0 -116
- package/my-expo-app-3/components/nativewindui/examples/selectable-text.tsx +0 -43
- package/my-expo-app-3/components/nativewindui/examples/text.tsx +0 -43
- package/my-expo-app-3/global.css +0 -3
- package/my-expo-app-3/metro.config.js +0 -12
- package/my-expo-app-3/package-lock.json +0 -19141
- package/my-expo-app-3/package.json +0 -73
- package/my-expo-app-3/prettier.config.js +0 -11
- package/my-expo-app-3/tailwind.config.js +0 -11
- package/my-expo-app-test-case/app/+html.tsx +0 -46
- package/my-expo-app-test-case/app/+not-found.tsx +0 -33
- package/my-expo-app-test-case/app/_layout.tsx +0 -22
- package/my-expo-app-test-case/app/details.tsx +0 -17
- package/my-expo-app-test-case/app/index.tsx +0 -23
- package/my-expo-app-test-case/app-env.d.ts +0 -2
- package/my-expo-app-test-case/app.json +0 -48
- package/my-expo-app-test-case/assets/adaptive-icon.png +0 -0
- package/my-expo-app-test-case/assets/favicon.png +0 -0
- package/my-expo-app-test-case/assets/icon.png +0 -0
- package/my-expo-app-test-case/assets/splash.png +0 -0
- package/my-expo-app-test-case/babel.config.js +0 -18
- package/my-expo-app-test-case/cesconfig.json +0 -35
- package/my-expo-app-test-case/components/Button.tsx +0 -19
- package/my-expo-app-test-case/components/Container.tsx +0 -9
- package/my-expo-app-test-case/components/EditScreenInfo.tsx +0 -34
- package/my-expo-app-test-case/components/ScreenContent.tsx +0 -25
- package/my-expo-app-test-case/components/nativewindui/ActivityIndicator.tsx +0 -13
- package/my-expo-app-test-case/components/nativewindui/AdaptiveSearchHeader/AdaptiveSearchHeader.ios.tsx +0 -97
- package/my-expo-app-test-case/components/nativewindui/AdaptiveSearchHeader/AdaptiveSearchHeader.tsx +0 -264
- package/my-expo-app-test-case/components/nativewindui/AdaptiveSearchHeader/index.ts +0 -1
- package/my-expo-app-test-case/components/nativewindui/AdaptiveSearchHeader/types.ts +0 -95
- package/my-expo-app-test-case/components/nativewindui/Alert/Alert.ios.tsx +0 -65
- package/my-expo-app-test-case/components/nativewindui/Alert/Alert.tsx +0 -291
- package/my-expo-app-test-case/components/nativewindui/Alert/index.ts +0 -1
- package/my-expo-app-test-case/components/nativewindui/Alert/types.ts +0 -27
- package/my-expo-app-test-case/components/nativewindui/Badge.tsx +0 -84
- package/my-expo-app-test-case/components/nativewindui/Button.tsx +0 -156
- package/my-expo-app-test-case/components/nativewindui/Checkbox.tsx +0 -61
- package/my-expo-app-test-case/components/nativewindui/ContextMenu/ContextMenu.ios.tsx +0 -221
- package/my-expo-app-test-case/components/nativewindui/ContextMenu/ContextMenu.tsx +0 -420
- package/my-expo-app-test-case/components/nativewindui/ContextMenu/index.ts +0 -1
- package/my-expo-app-test-case/components/nativewindui/ContextMenu/types.ts +0 -91
- package/my-expo-app-test-case/components/nativewindui/ContextMenu/utils.ts +0 -14
- package/my-expo-app-test-case/components/nativewindui/DrawerContent.tsx +0 -145
- package/my-expo-app-test-case/components/nativewindui/DropdownMenu/DropdownMenu.ios.tsx +0 -168
- package/my-expo-app-test-case/components/nativewindui/DropdownMenu/DropdownMenu.tsx +0 -330
- package/my-expo-app-test-case/components/nativewindui/DropdownMenu/index.ts +0 -1
- package/my-expo-app-test-case/components/nativewindui/DropdownMenu/types.ts +0 -93
- package/my-expo-app-test-case/components/nativewindui/DropdownMenu/utils.ts +0 -14
- package/my-expo-app-test-case/components/nativewindui/Form.tsx +0 -125
- package/my-expo-app-test-case/components/nativewindui/LargeTitleHeader/LargeTitleHeader.ios.tsx +0 -99
- package/my-expo-app-test-case/components/nativewindui/LargeTitleHeader/LargeTitleHeader.tsx +0 -288
- package/my-expo-app-test-case/components/nativewindui/LargeTitleHeader/index.ts +0 -1
- package/my-expo-app-test-case/components/nativewindui/LargeTitleHeader/types.ts +0 -89
- package/my-expo-app-test-case/components/nativewindui/List.tsx +0 -433
- package/my-expo-app-test-case/components/nativewindui/SearchInput/SearchInput.ios.tsx +0 -177
- package/my-expo-app-test-case/components/nativewindui/SearchInput/SearchInput.tsx +0 -86
- package/my-expo-app-test-case/components/nativewindui/SearchInput/index.tsx +0 -1
- package/my-expo-app-test-case/components/nativewindui/SearchInput/types.ts +0 -12
- package/my-expo-app-test-case/components/nativewindui/SegmentedControl/SegmentedControl.ios.tsx +0 -31
- package/my-expo-app-test-case/components/nativewindui/SegmentedControl/SegmentedControl.tsx +0 -55
- package/my-expo-app-test-case/components/nativewindui/SegmentedControl/index.ts +0 -1
- package/my-expo-app-test-case/components/nativewindui/SegmentedControl/types.ts +0 -15
- package/my-expo-app-test-case/components/nativewindui/Stepper.tsx +0 -62
- package/my-expo-app-test-case/components/nativewindui/Text.tsx +0 -55
- package/my-expo-app-test-case/components/nativewindui/TextField/TextField.ios.tsx +0 -85
- package/my-expo-app-test-case/components/nativewindui/TextField/TextField.tsx +0 -326
- package/my-expo-app-test-case/components/nativewindui/TextField/index.tsx +0 -1
- package/my-expo-app-test-case/components/nativewindui/TextField/types.ts +0 -26
- package/my-expo-app-test-case/components/nativewindui/Toolbar.tsx +0 -116
- package/my-expo-app-test-case/components/nativewindui/examples/a-user-created-file.tsx +0 -0
- package/my-expo-app-test-case/components/nativewindui/examples/selectable-text.tsx +0 -43
- package/my-expo-app-test-case/components/nativewindui/examples/text.tsx +0 -43
- package/my-expo-app-test-case/global.css +0 -3
- package/my-expo-app-test-case/metro.config.js +0 -12
- package/my-expo-app-test-case/package-lock.json +0 -19141
- package/my-expo-app-test-case/package.json +0 -73
- package/my-expo-app-test-case/prettier.config.js +0 -11
- package/my-expo-app-test-case/tailwind.config.js +0 -11
- package/no-install/app/+html.tsx +0 -46
- package/no-install/app/+not-found.tsx +0 -25
- package/no-install/app/_layout.tsx +0 -7
- package/no-install/app/details.tsx +0 -20
- package/no-install/app/index.tsx +0 -19
- package/no-install/app-env.d.ts +0 -2
- package/no-install/app.json +0 -41
- package/no-install/assets/adaptive-icon.png +0 -0
- package/no-install/assets/favicon.png +0 -0
- package/no-install/assets/icon.png +0 -0
- package/no-install/assets/splash.png +0 -0
- package/no-install/babel.config.js +0 -13
- package/no-install/cesconfig.json +0 -35
- package/no-install/components/Button.tsx +0 -25
- package/no-install/components/Container.tsx +0 -9
- package/no-install/components/EditScreenInfo.tsx +0 -31
- package/no-install/components/ScreenContent.tsx +0 -29
- package/no-install/components/nativewindui/Slider.tsx +0 -26
- package/no-install/global.css +0 -3
- package/no-install/metro.config.js +0 -10
- package/no-install/package-lock.json +0 -17505
- package/no-install/package.json +0 -59
- package/no-install/prettier.config.js +0 -10
- package/no-install/tailwind.config.js +0 -14
- package/test-app/app/+html.tsx +0 -46
- package/test-app/app/+not-found.tsx +0 -25
- package/test-app/app/_layout.tsx +0 -7
- package/test-app/app/details.tsx +0 -20
- package/test-app/app/index.tsx +0 -19
- package/test-app/app-env.d.ts +0 -2
- package/test-app/app.json +0 -41
- package/test-app/assets/adaptive-icon.png +0 -0
- package/test-app/assets/favicon.png +0 -0
- package/test-app/assets/icon.png +0 -0
- package/test-app/assets/splash.png +0 -0
- package/test-app/babel.config.js +0 -13
- package/test-app/cesconfig.json +0 -35
- package/test-app/components/Button.tsx +0 -25
- package/test-app/components/Container.tsx +0 -9
- package/test-app/components/EditScreenInfo.tsx +0 -31
- package/test-app/components/ScreenContent.tsx +0 -29
- package/test-app/components/nativewindui/ActivityIndicator.tsx +0 -13
- package/test-app/components/nativewindui/Avatar.tsx +0 -133
- package/test-app/components/nativewindui/DatePicker/DatePicker.android.tsx +0 -72
- package/test-app/components/nativewindui/DatePicker/DatePicker.tsx +0 -23
- package/test-app/components/nativewindui/DatePicker/index.ts +0 -1
- package/test-app/components/nativewindui/Picker.tsx +0 -42
- package/test-app/components/nativewindui/ProgressIndicator.tsx +0 -78
- package/test-app/components/nativewindui/Sheet.tsx +0 -52
- package/test-app/components/nativewindui/Slider.tsx +0 -26
- package/test-app/components/nativewindui/Text.tsx +0 -55
- package/test-app/components/nativewindui/Toggle.tsx +0 -20
- package/test-app/global.css +0 -3
- package/test-app/metro.config.js +0 -10
- package/test-app/package.json +0 -64
- package/test-app/prettier.config.js +0 -10
- package/test-app/tailwind.config.js +0 -14
- package/test-no-install/app/+html.tsx +0 -46
- package/test-no-install/app/+not-found.tsx +0 -25
- package/test-no-install/app/_layout.tsx +0 -7
- package/test-no-install/app/details.tsx +0 -20
- package/test-no-install/app/index.tsx +0 -19
- package/test-no-install/app-env.d.ts +0 -2
- package/test-no-install/app.json +0 -41
- package/test-no-install/assets/adaptive-icon.png +0 -0
- package/test-no-install/assets/favicon.png +0 -0
- package/test-no-install/assets/icon.png +0 -0
- package/test-no-install/assets/splash.png +0 -0
- package/test-no-install/babel.config.js +0 -13
- package/test-no-install/cesconfig.json +0 -35
- package/test-no-install/components/Button.tsx +0 -25
- package/test-no-install/components/Container.tsx +0 -9
- package/test-no-install/components/EditScreenInfo.tsx +0 -31
- package/test-no-install/components/ScreenContent.tsx +0 -29
- package/test-no-install/components/nativewindui/ActivityIndicator.tsx +0 -13
- package/test-no-install/components/nativewindui/Avatar.tsx +0 -133
- package/test-no-install/components/nativewindui/DatePicker/DatePicker.android.tsx +0 -72
- package/test-no-install/components/nativewindui/DatePicker/DatePicker.tsx +0 -23
- package/test-no-install/components/nativewindui/DatePicker/index.ts +0 -1
- package/test-no-install/components/nativewindui/Picker.tsx +0 -42
- package/test-no-install/components/nativewindui/ProgressIndicator.tsx +0 -78
- package/test-no-install/components/nativewindui/Sheet.tsx +0 -52
- package/test-no-install/components/nativewindui/Slider.tsx +0 -26
- package/test-no-install/components/nativewindui/Text.tsx +0 -55
- package/test-no-install/components/nativewindui/Toggle.tsx +0 -20
- package/test-no-install/global.css +0 -3
- package/test-no-install/metro.config.js +0 -10
- package/test-no-install/package.json +0 -64
- package/test-no-install/prettier.config.js +0 -10
- package/test-no-install/tailwind.config.js +0 -14
package/.turbo/turbo-build.log
CHANGED
package/build/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { isLoggedIn, login } from './login.js';
|
|
|
9
9
|
import { installComponent } from './install-component.js';
|
|
10
10
|
import { renderTitle } from './utils/opening.js';
|
|
11
11
|
const main = async () => {
|
|
12
|
+
let quiet = false;
|
|
12
13
|
try {
|
|
13
14
|
await renderTitle();
|
|
14
15
|
}
|
|
@@ -24,8 +25,13 @@ const main = async () => {
|
|
|
24
25
|
let overwrite = false;
|
|
25
26
|
let ignoreExpoRouterMissing = false;
|
|
26
27
|
let directory = undefined;
|
|
27
|
-
while (['--big-examples-with-deps', '--overwrite', '--yes', '-d', '--no-install'].includes(args[0])) {
|
|
28
|
+
while (['--big-examples-with-deps', '--overwrite', '--yes', '-d', '--no-install', '--quiet', '-q'].includes(args[0])) {
|
|
28
29
|
switch (args[0]) {
|
|
30
|
+
case '--quiet':
|
|
31
|
+
case '-q':
|
|
32
|
+
quiet = true;
|
|
33
|
+
args.shift();
|
|
34
|
+
break;
|
|
29
35
|
case '--big-examples-with-deps':
|
|
30
36
|
bigExamplesWithDependencies = true;
|
|
31
37
|
args.shift();
|
|
@@ -44,6 +50,7 @@ const main = async () => {
|
|
|
44
50
|
env.EXPO_NO_GIT_STATUS = true;
|
|
45
51
|
args.shift();
|
|
46
52
|
break;
|
|
53
|
+
case '--directory':
|
|
47
54
|
case '-d':
|
|
48
55
|
args.shift();
|
|
49
56
|
const exists = await fs.access(path.resolve(args[0]))
|
|
@@ -60,37 +67,46 @@ const main = async () => {
|
|
|
60
67
|
}
|
|
61
68
|
}
|
|
62
69
|
// remaining args are components
|
|
63
|
-
await installComponent(args, overwrite, directory, bigExamplesWithDependencies, ignoreExpoRouterMissing, noInstall);
|
|
70
|
+
await installComponent(args, overwrite, directory, bigExamplesWithDependencies, ignoreExpoRouterMissing, noInstall, quiet);
|
|
64
71
|
break;
|
|
65
72
|
case 'init':
|
|
66
73
|
const manualInstallationURL = `${env.API_BASE_URL}/installation/manual`;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
74
|
+
if (!quiet) {
|
|
75
|
+
console.log(`To setup NativeWind UI, follow the instructions at ${manualInstallationURL}`);
|
|
76
|
+
const goThereNow = await confirm({ message: 'Go there now?' });
|
|
77
|
+
if (goThereNow) {
|
|
78
|
+
open(manualInstallationURL);
|
|
79
|
+
}
|
|
71
80
|
}
|
|
72
81
|
break;
|
|
73
82
|
case 'login':
|
|
74
|
-
if (
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
if (!quiet) {
|
|
84
|
+
if (await isLoggedIn()) {
|
|
85
|
+
const shouldLoginAgain = await confirm({ message: "You are already logged in. Login again?" });
|
|
86
|
+
if (!shouldLoginAgain) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
78
89
|
}
|
|
79
90
|
}
|
|
80
|
-
await login();
|
|
91
|
+
await login(quiet);
|
|
81
92
|
break;
|
|
82
93
|
default:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
94
|
+
if (!quiet) {
|
|
95
|
+
console.log('Usage:');
|
|
96
|
+
console.log("\tadd [--overwrite] [-d directory] [--yes] [--no-install] [--quiet | -q] [componentName | 'all' | 'free' | 'paid' | 'screens' [...]]");
|
|
97
|
+
console.log("\tinit [--quiet | -q]");
|
|
98
|
+
console.log("\tlogin [--quiet | -q]");
|
|
99
|
+
console.log("");
|
|
100
|
+
}
|
|
101
|
+
break;
|
|
88
102
|
}
|
|
89
103
|
process.exit(0);
|
|
90
104
|
}
|
|
91
105
|
catch (err) {
|
|
92
106
|
if (typeof err === 'string') {
|
|
93
|
-
|
|
107
|
+
if (!quiet) {
|
|
108
|
+
console.error(err);
|
|
109
|
+
}
|
|
94
110
|
}
|
|
95
111
|
else {
|
|
96
112
|
throw err;
|
|
@@ -8,10 +8,11 @@ import { env } from './utils/env.js';
|
|
|
8
8
|
import * as git from './utils/git.js';
|
|
9
9
|
import { isLoggedIn, login } from './login.js';
|
|
10
10
|
import { confirmAsync } from './utils/prompts.js';
|
|
11
|
-
export const installComponent = async (slugs, overwrite = false, directory = `.${path.sep}`, bigExamplesWithDependencies = false, ignoreExpoRouterMissing = false, noInstall = false) => {
|
|
11
|
+
export const installComponent = async (slugs, overwrite = false, directory = `.${path.sep}`, bigExamplesWithDependencies = false, ignoreExpoRouterMissing = false, noInstall = false, quiet = false) => {
|
|
12
12
|
const cwd = path.resolve(directory);
|
|
13
|
-
let spinner = ora({ text: 'Fetching component metadata...' });
|
|
14
|
-
|
|
13
|
+
let spinner = ora({ text: 'Fetching component metadata...', isSilent: quiet });
|
|
14
|
+
if (!quiet)
|
|
15
|
+
spinner.start();
|
|
15
16
|
const componentsListing = await fetchComponentsListing();
|
|
16
17
|
const paidComponentSlugs = componentsListing
|
|
17
18
|
.filter(component => !component.free)
|
|
@@ -33,23 +34,28 @@ export const installComponent = async (slugs, overwrite = false, directory = `.$
|
|
|
33
34
|
return [slug];
|
|
34
35
|
}))).flat());
|
|
35
36
|
if (Array.from(componentSlugs).some(slug => paidComponentSlugs.includes(slug)) && !(await isLoggedIn())) {
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
if (!quiet)
|
|
38
|
+
spinner.stop();
|
|
39
|
+
if (!(await askAndLogin(quiet))) {
|
|
38
40
|
throw 'unauthenticated';
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
spinner
|
|
43
|
+
if (!quiet)
|
|
44
|
+
spinner.stopAndPersist({ text: 'Received component metadata.' });
|
|
45
|
+
spinner = ora({ text: 'Checking for expo-router...', isSilent: quiet });
|
|
46
|
+
if (!quiet)
|
|
47
|
+
spinner.start();
|
|
44
48
|
// ensure expo router
|
|
45
49
|
try {
|
|
46
50
|
await execa('npm', ['ls', 'expo-router'], { cwd });
|
|
47
51
|
// in a monorepo, we may have expo-router in scope but no app/ directory.
|
|
48
52
|
await fs.access(path.join(cwd, `app${path.sep}`));
|
|
49
|
-
|
|
53
|
+
if (!quiet)
|
|
54
|
+
spinner.stopAndPersist({ text: "Found expo-router." });
|
|
50
55
|
}
|
|
51
56
|
catch (err) {
|
|
52
|
-
|
|
57
|
+
if (!quiet)
|
|
58
|
+
spinner.stop();
|
|
53
59
|
if (err?.code === 'ENOENT' || err?.exitCode === 1) {
|
|
54
60
|
if (!ignoreExpoRouterMissing) {
|
|
55
61
|
const confirmation = await confirmAsync({
|
|
@@ -59,10 +65,12 @@ export const installComponent = async (slugs, overwrite = false, directory = `.$
|
|
|
59
65
|
throw 'aborted';
|
|
60
66
|
}
|
|
61
67
|
}
|
|
62
|
-
|
|
68
|
+
if (!quiet)
|
|
69
|
+
spinner.stopAndPersist({ text: "Ignored expo-router." });
|
|
63
70
|
}
|
|
64
71
|
else {
|
|
65
|
-
|
|
72
|
+
if (!quiet)
|
|
73
|
+
console.error('error:', err);
|
|
66
74
|
throw err;
|
|
67
75
|
}
|
|
68
76
|
}
|
|
@@ -73,7 +81,8 @@ export const installComponent = async (slugs, overwrite = false, directory = `.$
|
|
|
73
81
|
}
|
|
74
82
|
}
|
|
75
83
|
catch (err) {
|
|
76
|
-
|
|
84
|
+
if (!quiet)
|
|
85
|
+
console.error('error checking git:', err);
|
|
77
86
|
return;
|
|
78
87
|
}
|
|
79
88
|
const resolved = await getRecursiveComponentDependencies(componentSlugs, bigExamplesWithDependencies);
|
|
@@ -82,24 +91,25 @@ export const installComponent = async (slugs, overwrite = false, directory = `.$
|
|
|
82
91
|
console.log('resolution:', resolved);
|
|
83
92
|
}
|
|
84
93
|
// install primitives && libraries via `npx expo install`
|
|
85
|
-
spinner = ora({ text: 'Installing libraries and primitives...' });
|
|
86
|
-
|
|
94
|
+
spinner = ora({ text: 'Installing libraries and primitives...', isSilent: quiet });
|
|
95
|
+
if (!quiet)
|
|
96
|
+
spinner.start();
|
|
87
97
|
const libs = Array.from(resolved.libraries).concat(Array.from(resolved.primitives));
|
|
88
98
|
if (libs.length > 0) {
|
|
89
99
|
try {
|
|
90
100
|
const npxArgs = ['expo', 'install'];
|
|
101
|
+
// speed up invocation
|
|
102
|
+
const fastNpmInstallArgs = ['--silent', '--no-audit', '--progress=false'];
|
|
91
103
|
// conditionally for --no-install (see below)
|
|
92
104
|
let removePackageLock = false;
|
|
105
|
+
let removeNodeModules = false;
|
|
93
106
|
if (noInstall) {
|
|
94
107
|
npxArgs.push('--npm', ...libs, ...[
|
|
95
108
|
'--',
|
|
96
109
|
// prevent downloading & writing node_modules
|
|
97
110
|
'--package-lock-only',
|
|
98
111
|
'--no-package-lock',
|
|
99
|
-
|
|
100
|
-
'--silent',
|
|
101
|
-
'--no-audit',
|
|
102
|
-
'--progress=false',
|
|
112
|
+
...fastNpmInstallArgs
|
|
103
113
|
]);
|
|
104
114
|
if (env.NODE_ENV === 'development') {
|
|
105
115
|
console.log('lockfile:', resolveNormalizedPath(cwd, 'package-lock.json'));
|
|
@@ -113,6 +123,27 @@ export const installComponent = async (slugs, overwrite = false, directory = `.$
|
|
|
113
123
|
if (!packageLockExists) {
|
|
114
124
|
removePackageLock = true;
|
|
115
125
|
}
|
|
126
|
+
// `expo install` will complain that `expo` isn't installed, so we need to install it first.
|
|
127
|
+
// Note: this seems to not happen always in testing because we generate projects in
|
|
128
|
+
// subdirectories of other projects (like CES and NWUI) that have Expo installed.
|
|
129
|
+
const nodeModulesExists = await fs.access(resolveNormalizedPath(cwd, 'node_modules'))
|
|
130
|
+
.then(() => true)
|
|
131
|
+
.catch(() => false);
|
|
132
|
+
// assume if `node_modules` exists and we've already verified this is an Expo Router project
|
|
133
|
+
// that we don't need to install Expo; otherwise, we will install it and remove when done.
|
|
134
|
+
if (!nodeModulesExists) {
|
|
135
|
+
removeNodeModules = true;
|
|
136
|
+
const install = await execa('npm', ['install', ...fastNpmInstallArgs], { cwd });
|
|
137
|
+
if (install.exitCode !== 0) {
|
|
138
|
+
if (!quiet)
|
|
139
|
+
spinner.stop();
|
|
140
|
+
if (!quiet)
|
|
141
|
+
console.log(install.all);
|
|
142
|
+
if (!quiet)
|
|
143
|
+
console.error('command:', install.command);
|
|
144
|
+
throw `npx expo install failed with exit code ${install.exitCode}`;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
116
147
|
}
|
|
117
148
|
else {
|
|
118
149
|
npxArgs.push(...libs);
|
|
@@ -121,9 +152,12 @@ export const installComponent = async (slugs, overwrite = false, directory = `.$
|
|
|
121
152
|
console.log('> npx', npxArgs);
|
|
122
153
|
const install = await execa('npx', npxArgs, { cwd });
|
|
123
154
|
if (install.exitCode !== 0) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
155
|
+
if (!quiet)
|
|
156
|
+
spinner.stop();
|
|
157
|
+
if (!quiet)
|
|
158
|
+
console.log(install.all);
|
|
159
|
+
if (!quiet)
|
|
160
|
+
console.error('command:', install.command);
|
|
127
161
|
throw `npx expo install failed with exit code ${install.exitCode}`;
|
|
128
162
|
}
|
|
129
163
|
if (removePackageLock) {
|
|
@@ -133,17 +167,26 @@ export const installComponent = async (slugs, overwrite = false, directory = `.$
|
|
|
133
167
|
if (env.NODE_ENV === 'development')
|
|
134
168
|
console.log('deleted package-lock.json');
|
|
135
169
|
}
|
|
170
|
+
if (removeNodeModules) {
|
|
171
|
+
// we installed Expo earlier when `node_modules` didn't exist, and `--no-install` was used.
|
|
172
|
+
await fs.rm(resolveNormalizedPath(cwd, 'node_modules'), { recursive: true, force: true });
|
|
173
|
+
if (env.NODE_ENV === 'development')
|
|
174
|
+
console.log('deleted node_modules');
|
|
175
|
+
}
|
|
136
176
|
}
|
|
137
177
|
catch (err) {
|
|
138
178
|
if (err) {
|
|
139
|
-
|
|
179
|
+
if (!quiet)
|
|
180
|
+
console.error(err);
|
|
140
181
|
throw 'npx expo install failed';
|
|
141
182
|
}
|
|
142
183
|
}
|
|
143
184
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
spinner
|
|
185
|
+
if (!quiet)
|
|
186
|
+
spinner.stopAndPersist({ text: 'Libraries and primitives successfully installed.' });
|
|
187
|
+
spinner = ora({ text: 'Installing component files...', isSilent: quiet });
|
|
188
|
+
if (!quiet)
|
|
189
|
+
spinner.start();
|
|
147
190
|
const additionalFiles = Array.from(resolved.components.entries())
|
|
148
191
|
.flatMap(([_slug, component]) => component.additionalFiles || []);
|
|
149
192
|
const dirs = new Set(
|
|
@@ -178,13 +221,16 @@ export const installComponent = async (slugs, overwrite = false, directory = `.$
|
|
|
178
221
|
}
|
|
179
222
|
catch (err) {
|
|
180
223
|
if (err === 'file exists') {
|
|
181
|
-
|
|
224
|
+
if (!quiet)
|
|
225
|
+
spinner.stop();
|
|
182
226
|
const confirmation = await confirmAsync({
|
|
183
227
|
message: `File at path ${additionalFile.path} already exists, overwrite it?`
|
|
184
228
|
});
|
|
185
229
|
if (!confirmation) {
|
|
186
|
-
|
|
187
|
-
|
|
230
|
+
if (!quiet)
|
|
231
|
+
console.log('Skipped file', additionalFile.path);
|
|
232
|
+
if (!quiet)
|
|
233
|
+
spinner.start();
|
|
188
234
|
continue;
|
|
189
235
|
}
|
|
190
236
|
}
|
|
@@ -197,12 +243,14 @@ export const installComponent = async (slugs, overwrite = false, directory = `.$
|
|
|
197
243
|
throw err;
|
|
198
244
|
}
|
|
199
245
|
}
|
|
200
|
-
|
|
201
|
-
|
|
246
|
+
if (!quiet)
|
|
247
|
+
spinner.stopAndPersist({ text: 'Component files installed.' });
|
|
248
|
+
await deleteDeprecatedFiles(resolved, cwd, quiet);
|
|
202
249
|
if (bigExamplesWithDependencies) {
|
|
203
|
-
await installExamples(resolved, cwd, overwrite);
|
|
250
|
+
await installExamples(resolved, cwd, overwrite, quiet);
|
|
204
251
|
}
|
|
205
|
-
|
|
252
|
+
if (!quiet)
|
|
253
|
+
console.log("");
|
|
206
254
|
};
|
|
207
255
|
const resolveNormalizedPath = (cwd, filePath) => {
|
|
208
256
|
return path.join(cwd, ...filePath.replace(/^[~][/]/, '').split('/'));
|
|
@@ -210,9 +258,10 @@ const resolveNormalizedPath = (cwd, filePath) => {
|
|
|
210
258
|
const deletedComponentSlugsWithReplacements = [
|
|
211
259
|
['selectable-text', 'text']
|
|
212
260
|
];
|
|
213
|
-
async function deleteDeprecatedFiles(resolved, cwd) {
|
|
214
|
-
let spinner = ora({ text: 'Cleaning up old files...' });
|
|
215
|
-
|
|
261
|
+
async function deleteDeprecatedFiles(resolved, cwd, quiet = false) {
|
|
262
|
+
let spinner = ora({ text: 'Cleaning up old files...', isSilent: quiet });
|
|
263
|
+
if (!quiet)
|
|
264
|
+
spinner.start();
|
|
216
265
|
// old examples directory
|
|
217
266
|
// to be as unintrusive as possible, we:
|
|
218
267
|
// - only delete example files associated with components requested for installation
|
|
@@ -252,15 +301,18 @@ async function deleteDeprecatedFiles(resolved, cwd) {
|
|
|
252
301
|
}
|
|
253
302
|
catch (err) {
|
|
254
303
|
if (err !== 'examples not found') {
|
|
255
|
-
|
|
304
|
+
if (!quiet)
|
|
305
|
+
console.error('error cleaning up depreated files:', err ? (err.message || err) : 'unknown');
|
|
256
306
|
// do not re-throw, clean up is not required
|
|
257
307
|
}
|
|
258
308
|
}
|
|
259
|
-
|
|
309
|
+
if (!quiet)
|
|
310
|
+
spinner.stopAndPersist({ text: 'Cleaned up old files.' });
|
|
260
311
|
}
|
|
261
|
-
async function installExamples(resolved, cwd, overwrite) {
|
|
262
|
-
let spinner = ora({ text: 'Installing example files...' });
|
|
263
|
-
|
|
312
|
+
async function installExamples(resolved, cwd, overwrite, quiet = false) {
|
|
313
|
+
let spinner = ora({ text: 'Installing example files...', isSilent: quiet });
|
|
314
|
+
if (!quiet)
|
|
315
|
+
spinner.start();
|
|
264
316
|
// create example usage file
|
|
265
317
|
const examplesDir = '~/components/nativewindui-examples';
|
|
266
318
|
try {
|
|
@@ -292,13 +344,16 @@ async function installExamples(resolved, cwd, overwrite) {
|
|
|
292
344
|
}
|
|
293
345
|
catch (err) {
|
|
294
346
|
if (err === 'file exists') {
|
|
295
|
-
|
|
347
|
+
if (!quiet)
|
|
348
|
+
spinner.stop();
|
|
296
349
|
const confirmation = await confirmAsync({
|
|
297
350
|
message: `File at path ${exampleFilePath} already exists, overwrite it?`
|
|
298
351
|
});
|
|
299
352
|
if (!confirmation) {
|
|
300
|
-
|
|
301
|
-
|
|
353
|
+
if (!quiet)
|
|
354
|
+
console.log('Skipped file', exampleFilePath);
|
|
355
|
+
if (!quiet)
|
|
356
|
+
spinner.start();
|
|
302
357
|
continue;
|
|
303
358
|
}
|
|
304
359
|
}
|
|
@@ -311,7 +366,8 @@ async function installExamples(resolved, cwd, overwrite) {
|
|
|
311
366
|
throw err;
|
|
312
367
|
}
|
|
313
368
|
}
|
|
314
|
-
|
|
369
|
+
if (!quiet)
|
|
370
|
+
spinner.stopAndPersist({ text: `Example usage files installed to ${examplesDir}` });
|
|
315
371
|
}
|
|
316
372
|
async function getRecursiveComponentDependencies(componentSlugs,
|
|
317
373
|
// install components, primitives and libraries for the example usages if true.
|
|
@@ -416,18 +472,19 @@ var fetchComponentsListing = memoizee(async () => {
|
|
|
416
472
|
/**
|
|
417
473
|
* Ask the user if they want to login, and proceeds to login if so. Returns whether the user logged in.
|
|
418
474
|
*/
|
|
419
|
-
async function askAndLogin() {
|
|
475
|
+
async function askAndLogin(quiet = false) {
|
|
420
476
|
const shouldSignIn = await confirmAsync({
|
|
421
477
|
message: 'To download paid components, you need to sign in to a paid account. Sign in now?',
|
|
422
478
|
});
|
|
423
479
|
if (shouldSignIn) {
|
|
424
480
|
try {
|
|
425
|
-
const success = await login();
|
|
481
|
+
const success = await login(quiet);
|
|
426
482
|
if (success)
|
|
427
483
|
return true;
|
|
428
484
|
}
|
|
429
485
|
catch (err) {
|
|
430
|
-
|
|
486
|
+
if (!quiet)
|
|
487
|
+
console.error('error logging in:');
|
|
431
488
|
}
|
|
432
489
|
}
|
|
433
490
|
return false;
|
package/build/login.js
CHANGED
|
@@ -40,7 +40,7 @@ export const isLoggedIn = async () => {
|
|
|
40
40
|
*
|
|
41
41
|
* Returns whether login was successful/completed, but also may throw for some login failures.
|
|
42
42
|
*/
|
|
43
|
-
export const login = async (secondAttempt = false) => {
|
|
43
|
+
export const login = async (quiet = false, secondAttempt = false) => {
|
|
44
44
|
let { user, session } = await checkAndRefreshSession() || { user: null, session: null };
|
|
45
45
|
if (!user || !session) {
|
|
46
46
|
const { data, error } = await supabase.auth.signInAnonymously();
|
|
@@ -48,11 +48,11 @@ export const login = async (secondAttempt = false) => {
|
|
|
48
48
|
if (!secondAttempt && error === null && user === null && session === null) {
|
|
49
49
|
// likely supabase/localStorage emulation layer having a weird incompatibility
|
|
50
50
|
// occurs when the localStorage has not yet been persisted to disk
|
|
51
|
-
if (process.env
|
|
51
|
+
if (process.env['NODE_ENV'] === 'development') {
|
|
52
52
|
console.error('failure to do signInAnonymously (maybe storage issue?), retrying...');
|
|
53
53
|
}
|
|
54
54
|
// after the error occurs, an empty localStorage has been persisted on disk, so retry once
|
|
55
|
-
return login(true);
|
|
55
|
+
return login(quiet, true);
|
|
56
56
|
}
|
|
57
57
|
throw error;
|
|
58
58
|
}
|
|
@@ -61,22 +61,23 @@ export const login = async (secondAttempt = false) => {
|
|
|
61
61
|
}
|
|
62
62
|
const { access_token, refresh_token } = session;
|
|
63
63
|
await open(`/cli?access_token=${access_token}&refresh_token=${refresh_token}`);
|
|
64
|
-
const spinner = ora({ text: "Waiting for you to authenticate in the browser..." });
|
|
65
|
-
|
|
64
|
+
const spinner = ora({ text: "Waiting for you to authenticate in the browser...", isSilent: quiet });
|
|
65
|
+
if (!quiet)
|
|
66
|
+
spinner.start();
|
|
66
67
|
supabase.realtime.setAuth(access_token);
|
|
67
|
-
const channel = supabase.channel(user.id);
|
|
68
|
+
const channel = supabase.channel(user.id, { config: { broadcast: { self: true }, private: true } });
|
|
68
69
|
const failed = !(await new Promise((resolve, reject) => {
|
|
69
|
-
if (process.env
|
|
70
|
+
if (process.env['NODE_ENV'] === 'development')
|
|
70
71
|
console.log('user id:', user.id);
|
|
71
72
|
const subscription = channel
|
|
72
73
|
.on('broadcast', { event: 'session-created' }, (_payload) => {
|
|
73
|
-
if (process.env
|
|
74
|
+
if (process.env['NODE_ENV'] === 'development')
|
|
74
75
|
console.log('payload:', _payload);
|
|
75
76
|
subscription.unsubscribe();
|
|
76
77
|
resolve(true);
|
|
77
78
|
})
|
|
78
79
|
.subscribe((_status, err) => {
|
|
79
|
-
if (process.env
|
|
80
|
+
if (process.env['NODE_ENV'] === 'development') {
|
|
80
81
|
console.log('status:', _status);
|
|
81
82
|
console.error('err:', err);
|
|
82
83
|
}
|
|
@@ -91,10 +92,12 @@ export const login = async (secondAttempt = false) => {
|
|
|
91
92
|
}));
|
|
92
93
|
channel.unsubscribe();
|
|
93
94
|
if (failed) {
|
|
94
|
-
|
|
95
|
+
if (!quiet)
|
|
96
|
+
spinner.stop();
|
|
95
97
|
}
|
|
96
98
|
else {
|
|
97
|
-
|
|
99
|
+
if (!quiet)
|
|
100
|
+
spinner.stopAndPersist({ text: "Successfully logged in." });
|
|
98
101
|
}
|
|
99
102
|
return !failed;
|
|
100
103
|
};
|
package/build/utils/env.js
CHANGED
|
@@ -19,7 +19,7 @@ class Env extends ExpoEnv {
|
|
|
19
19
|
: 'https://nativewindui.com');
|
|
20
20
|
}
|
|
21
21
|
get NODE_ENV() {
|
|
22
|
-
return process.env
|
|
22
|
+
return process.env["NODE_ENV"] || "production";
|
|
23
23
|
}
|
|
24
24
|
get SUPABASE_ANON_KEY() {
|
|
25
25
|
return process.env["SUPABASE_ANON_KEY"] || 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im5xdHlobWlvanZ0bGV1cGtkZWxnIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MTU5MDc2MDIsImV4cCI6MjAzMTQ4MzYwMn0.7tRFhmjngUKXQxiNKPPWfsjWrUB515PHtQzBSM-vN88';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nwui-cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "NativeWindUI CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/index.js",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@clack/core": "~0.3.4",
|
|
29
29
|
"@supabase/supabase-js": "~2.44.2",
|
|
30
|
+
"@ronin/supabase": "git+https://sammoore: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@github.com/ronintechnologies/ronin.git#193f86cc0bdc71c11852a33df27ede591ed75d4a",
|
|
30
31
|
"execa": "8.x",
|
|
31
32
|
"figlet": "^1.7.0",
|
|
32
33
|
"gradient-string": "^2.0.2",
|
package/build/cli/src/index.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import open from 'open';
|
|
3
|
-
import color from 'picocolors';
|
|
4
|
-
import { API_BASE_URL } from './net.js';
|
|
5
|
-
import { confirm } from './prompts.js';
|
|
6
|
-
import { isLoggedIn, login } from './login.js';
|
|
7
|
-
import { installComponent } from './install-component.js';
|
|
8
|
-
const main = async () => {
|
|
9
|
-
console.log(`\n${color.blue('welcome to the')} ${color.cyan('nativewindui cli')}`);
|
|
10
|
-
switch (process.argv[2]) {
|
|
11
|
-
case 'add':
|
|
12
|
-
const shouldSignIn = !(await isLoggedIn()) && await confirm({
|
|
13
|
-
message: 'To download paid components, you need to sign in to a paid account. Sign in now?',
|
|
14
|
-
});
|
|
15
|
-
if (shouldSignIn) {
|
|
16
|
-
await login();
|
|
17
|
-
}
|
|
18
|
-
installComponent(process.argv[3]);
|
|
19
|
-
break;
|
|
20
|
-
case 'init':
|
|
21
|
-
const manualInstallationURL = `${API_BASE_URL}/installation/manual`;
|
|
22
|
-
console.log(`To setup NativeWind UI, follow the instructions at ${manualInstallationURL}`);
|
|
23
|
-
const goThereNow = await confirm({ message: 'Go there now?' });
|
|
24
|
-
if (goThereNow) {
|
|
25
|
-
open(manualInstallationURL);
|
|
26
|
-
}
|
|
27
|
-
break;
|
|
28
|
-
default:
|
|
29
|
-
console.log('Valid sub-commands are: add [componentName], init');
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
main().catch((error) => {
|
|
33
|
-
if (error instanceof Error || (typeof error == 'string' && error !== '')) {
|
|
34
|
-
console.error(`${color.red(color.bold('error:'))}`, error);
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
console.error(`${color.red(color.bold('error:'))} an unknown error occurred`);
|
|
38
|
-
}
|
|
39
|
-
console.error(`\nIf you believe this is a bug, please open a ticket at https://github.com/ronintechnologies/nativewindui/issues`);
|
|
40
|
-
console.error(`\nIf you need assistance, join the Ronin discord: https://discord.gg/xeCrcU98\n`);
|
|
41
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { API_BASE_URL } from './net.js';
|
|
2
|
-
export const installComponent = async (slug) => {
|
|
3
|
-
const component = await fetchComponent(slug);
|
|
4
|
-
console.log('component:', component.slug);
|
|
5
|
-
console.log('resolution:', await getRecursiveComponentDependencies(component));
|
|
6
|
-
};
|
|
7
|
-
async function getRecursiveComponentDependencies(component) {
|
|
8
|
-
const resolved = {
|
|
9
|
-
libraries: new Set(),
|
|
10
|
-
primitives: new Set(),
|
|
11
|
-
components: new Map(),
|
|
12
|
-
};
|
|
13
|
-
resolved.components.set(component.slug, component);
|
|
14
|
-
// recursively (in case of nwui components, not libraries or primitives) adds deps to resolved
|
|
15
|
-
async function applyDependenciesToResolved(component) {
|
|
16
|
-
await Promise.all((component.dependencies || []).map(async (dependency) => {
|
|
17
|
-
switch (dependency.type) {
|
|
18
|
-
case 'library':
|
|
19
|
-
resolved.libraries.add(dependency.name);
|
|
20
|
-
break;
|
|
21
|
-
case 'primitive':
|
|
22
|
-
resolved.primitives.add(dependency.name);
|
|
23
|
-
break;
|
|
24
|
-
case 'component':
|
|
25
|
-
const slug = dependency.url.replace('/component/', '');
|
|
26
|
-
// do not fetch a component if we already have done so
|
|
27
|
-
// TODO: memoize fetchComponent to remove this logic here; seems necessary for installing multiple components
|
|
28
|
-
const subcomponent = resolved.components.get(slug) || await fetchComponent(slug);
|
|
29
|
-
resolved.components.set(slug, subcomponent);
|
|
30
|
-
// recurse
|
|
31
|
-
await applyDependenciesToResolved(subcomponent);
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
applyDependenciesToResolved(component);
|
|
37
|
-
return resolved;
|
|
38
|
-
}
|
|
39
|
-
async function fetchComponent(slug) {
|
|
40
|
-
const response = await fetch(`${API_BASE_URL}/api/components/${slug}`);
|
|
41
|
-
return await response.json();
|
|
42
|
-
}
|