create-expo-stack 2.20.0-next.ff2bed4 → 2.21.0-next.0cb36d0

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.
Files changed (90) hide show
  1. package/README.md +18 -20
  2. package/build/cli.js +3 -2
  3. package/build/commands/create-expo-stack.js +9 -30
  4. package/build/constants.js +4 -4
  5. package/build/templates/base/App.tsx.ejs +12 -51
  6. package/build/templates/base/app.json.ejs +1 -0
  7. package/build/templates/base/babel.config.js.ejs +5 -15
  8. package/build/templates/base/components/Button.tsx.ejs +1 -0
  9. package/build/templates/base/components/Container.tsx.ejs +1 -0
  10. package/build/templates/base/package.json.ejs +38 -63
  11. package/build/templates/base/tsconfig.json.ejs +12 -7
  12. package/build/templates/packages/expo-router/drawer/app/+not-found.tsx.ejs +19 -60
  13. package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +2 -41
  14. package/build/templates/packages/expo-router/metro.config.js.ejs +3 -3
  15. package/build/templates/packages/expo-router/stack/app/+not-found.tsx.ejs +42 -68
  16. package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +20 -51
  17. package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +39 -8
  18. package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +69 -21
  19. package/build/templates/packages/expo-router/tabs/app/+not-found.tsx.ejs +21 -60
  20. package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +8 -48
  21. package/build/templates/packages/firebase/metro.config.js.ejs +3 -3
  22. package/build/templates/packages/nativewind/components/Button.tsx.ejs +1 -1
  23. package/build/templates/packages/nativewind/components/ScreenContent.tsx.ejs +3 -2
  24. package/build/templates/packages/nativewind/global.css +4 -1
  25. package/build/templates/packages/nativewind/postcss.config.mjs +2 -2
  26. package/build/templates/packages/nativewind/prettier.config.js +10 -0
  27. package/build/templates/packages/nativewindui/components/Container.tsx.ejs +1 -0
  28. package/build/templates/packages/nativewindui/components/EditScreenInfo.tsx.ejs +1 -1
  29. package/build/templates/packages/nativewindui/components/ScreenContent.tsx.ejs +1 -1
  30. package/build/templates/packages/nativewindui/components/nativewindui/Icon/Icon.ios.tsx.ejs +52 -0
  31. package/build/templates/packages/nativewindui/components/nativewindui/Icon/Icon.tsx.ejs +58 -0
  32. package/build/templates/packages/nativewindui/components/nativewindui/Icon/index.ts.ejs +16 -0
  33. package/build/templates/packages/nativewindui/components/nativewindui/Icon/types.ts.ejs +18 -0
  34. package/build/templates/packages/nativewindui/components/{ThemeToggle.tsx.ejs → nativewindui/ThemeToggle.tsx.ejs} +8 -10
  35. package/build/templates/packages/nativewindui/drawer/app/(drawer)/index.tsx.ejs +17 -19
  36. package/build/templates/packages/nativewindui/drawer/app/+not-found.tsx.ejs +4 -44
  37. package/build/templates/packages/nativewindui/drawer/app/_layout.tsx.ejs +2 -2
  38. package/build/templates/packages/nativewindui/drawer/app/modal.tsx.ejs +4 -4
  39. package/build/templates/packages/nativewindui/lib/useColorScheme.tsx.ejs +3 -37
  40. package/build/templates/packages/nativewindui/stack/app/+not-found.tsx.ejs +1 -1
  41. package/build/templates/packages/nativewindui/stack/app/_layout.tsx.ejs +17 -34
  42. package/build/templates/packages/nativewindui/stack/app/index.tsx.ejs +230 -275
  43. package/build/templates/packages/nativewindui/stack/app/modal.tsx.ejs +7 -7
  44. package/build/templates/packages/nativewindui/tabs/app/(tabs)/index.tsx.ejs +6 -7
  45. package/build/templates/packages/nativewindui/tabs/app/+not-found.tsx.ejs +0 -40
  46. package/build/templates/packages/nativewindui/theme/colors.ts.ejs +52 -0
  47. package/build/templates/packages/nativewindui/theme/index.ts.ejs +2 -2
  48. package/build/templates/packages/nativewindui/theme/with-opacity.ts.ejs +155 -0
  49. package/build/templates/packages/react-navigation/App.tsx.ejs +2 -42
  50. package/build/types/constants.d.ts +1 -1
  51. package/build/types/types.d.ts +3 -3
  52. package/build/types/utilities/configAnalytics.d.ts +2 -2
  53. package/build/types.js +1 -3
  54. package/build/utilities/clearNavigationPackages.js +2 -2
  55. package/build/utilities/clearStylingPackages.js +2 -2
  56. package/build/utilities/configAnalytics.js +5 -4
  57. package/build/utilities/configureProjectFiles.js +32 -69
  58. package/build/utilities/copyBaseAssets.js +3 -2
  59. package/build/utilities/generateNWUI.js +8 -7
  60. package/build/utilities/generateProjectFiles.js +4 -9
  61. package/build/utilities/getPackageManager.js +6 -5
  62. package/build/utilities/printOutput.js +5 -16
  63. package/build/utilities/renderTitle.js +3 -2
  64. package/build/utilities/runCLI.js +19 -27
  65. package/build/utilities/runEasConfigure.js +3 -2
  66. package/build/utilities/runIgnite.js +3 -2
  67. package/build/utilities/showHelp.js +4 -5
  68. package/build/utilities/systemCommand.js +3 -3
  69. package/build/utilities/usePackage.js +3 -2
  70. package/build/utilities/validateProjectName.js +3 -2
  71. package/package.json +6 -4
  72. package/build/templates/packages/nativewind/components/Container.tsx.ejs +0 -9
  73. package/build/templates/packages/nativewindui/components/BackButton.tsx.ejs +0 -23
  74. package/build/templates/packages/nativewindui/components/Button.tsx.ejs +0 -41
  75. package/build/templates/packages/nativewindui/lib/useHeaderSearchBar.tsx.ejs +0 -31
  76. package/build/templates/packages/restyle/components/BackButton.tsx.ejs +0 -15
  77. package/build/templates/packages/restyle/components/Button.tsx.ejs +0 -40
  78. package/build/templates/packages/restyle/components/Container.tsx.ejs +0 -6
  79. package/build/templates/packages/restyle/components/EditScreenInfo.tsx.ejs +0 -29
  80. package/build/templates/packages/restyle/components/ScreenContent.tsx.ejs +0 -21
  81. package/build/templates/packages/restyle/theme/Box.tsx.ejs +0 -6
  82. package/build/templates/packages/restyle/theme/Text.tsx.ejs +0 -6
  83. package/build/templates/packages/restyle/theme/index.ts.ejs +0 -6
  84. package/build/templates/packages/restyle/theme/theme.ts.ejs +0 -67
  85. package/build/templates/packages/tamagui/components/BackButton.tsx.ejs +0 -19
  86. package/build/templates/packages/tamagui/components/Button.tsx.ejs +0 -18
  87. package/build/templates/packages/tamagui/components/Container.tsx.ejs +0 -6
  88. package/build/templates/packages/tamagui/components/EditScreenInfo.tsx.ejs +0 -29
  89. package/build/templates/packages/tamagui/components/ScreenContent.tsx.ejs +0 -23
  90. package/build/templates/packages/tamagui/tamagui.config.ts.ejs +0 -130
@@ -1,67 +0,0 @@
1
- import { createTheme, useTheme as useRestyleTheme } from '@shopify/restyle';
2
- import { ImageStyle, TextStyle, ViewStyle } from 'react-native';
3
-
4
- type NamedStyles<T> = {
5
- [P in keyof T]: ViewStyle | TextStyle | ImageStyle;
6
- };
7
-
8
- const palette = {
9
- gray: '#808080',
10
- blue: '#007AFF',
11
- darkGray: '#38434D',
12
- white: '#FFFFFF',
13
- black: '#000000',
14
- purple: '#6366F1',
15
- };
16
-
17
- const theme = createTheme({
18
- colors: {
19
- ...palette
20
- },
21
- spacing: {
22
- xs_4: 4,
23
- s_8: 8,
24
- sm_12: 12,
25
- m_16: 16,
26
- ml_24: 24,
27
- l_32: 32,
28
- xl_64: 64,
29
- },
30
- borderRadii: {
31
- s_3: 3,
32
- m_6: 6,
33
- l_12: 12,
34
- xl_24: 24,
35
- },
36
- textVariants: {
37
- body: {
38
- fontSize: 16,
39
- },
40
- title: { fontSize: 20, fontWeight: 'bold' },
41
- large: {
42
- fontSize: 36,
43
- },
44
- extra_large: {
45
- fontSize: 64,
46
- fontWeight: 'bold',
47
- },
48
- defaults: {
49
- // We can define a default text variant here.
50
- }
51
- }
52
- });
53
-
54
- export const useTheme = () => {
55
- return useRestyleTheme<Theme>();
56
- };
57
-
58
- export const makeStyles = <T extends NamedStyles<T> | NamedStyles<unknown>>(
59
- styles: (theme: Theme) => T,
60
- ) => {
61
- return () => {
62
- return styles(theme);
63
- };
64
- };
65
-
66
- export type Theme = typeof theme;
67
- export default theme;
@@ -1,19 +0,0 @@
1
- import { Feather } from '@expo/vector-icons';
2
- import { Button, Text } from 'tamagui';
3
-
4
- export const BackButton = ({ onPress }: { onPress: () => void }) => {
5
- return (
6
- <Button
7
- unstyled
8
- flexDirection="row"
9
- backgroundColor="transparent"
10
- pressStyle={{
11
- opacity: 0.5,
12
- }}
13
- paddingLeft={20}
14
- onPress={onPress}
15
- icon={<Feather name="chevron-left" size={16} color="#007AFF" />}>
16
- <Text color="#007AFF">Back</Text>
17
- </Button>
18
- );
19
- };
@@ -1,18 +0,0 @@
1
- import { ComponentProps, forwardRef } from 'react';
2
- import { TamaguiElement } from 'tamagui';
3
-
4
- import { Button as TButton } from '../tamagui.config';
5
-
6
- type ButtonProps = {
7
- title: string;
8
- } & ComponentProps<typeof TButton>;
9
-
10
- export const Button = forwardRef<TamaguiElement, ButtonProps>(({ title, ...tButtonProps }, ref) => {
11
- return (
12
- <TButton {...tButtonProps} ref={ref}>
13
- {title}
14
- </TButton>
15
- );
16
- });
17
-
18
- Button.displayName = 'Button';
@@ -1,6 +0,0 @@
1
- import { YStack } from 'tamagui';
2
-
3
- export const Container = ({ children }: { children: React.ReactNode }) => {
4
- return <YStack flex={1} padding="$6">{children}</YStack>;
5
- };
6
-
@@ -1,29 +0,0 @@
1
- import { YStack, H4, Paragraph } from 'tamagui';
2
-
3
- <% if (props.internalizationPackage?.name === "i18next") { %>
4
- import { useTranslation } from 'react-i18next';
5
- <% } %>
6
-
7
- export const EditScreenInfo = ({ path }: { path: string }) => {
8
- <% if (props.internalizationPackage?.name === "i18next") { %>
9
- const { t } = useTranslation();
10
- const title = t('getStarted');
11
- const description = t('changeCode')
12
- <% } else { %>
13
- const title = "Open up the code for this screen:"
14
- const description = "Change any of the text, save the file, and your app will automatically update."
15
- <% } %>
16
- return (
17
- <YStack>
18
- <YStack alignItems="center" marginHorizontal="$6">
19
- <H4>{title}</H4>
20
- <YStack borderRadius="$3" marginVertical="$1">
21
- <Paragraph>{path}</Paragraph>
22
- </YStack>
23
- <Paragraph>
24
- {description}
25
- </Paragraph>
26
- </YStack>
27
- </YStack>
28
- );
29
- };
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import { YStack, H2, Separator, Theme } from 'tamagui';
3
-
4
- import { EditScreenInfo } from './EditScreenInfo';
5
-
6
- type ScreenContentProps = {
7
- title: string;
8
- path: string;
9
- children?: React.ReactNode;
10
- };
11
-
12
- export const ScreenContent = ({ title, path, children}: ScreenContentProps) => {
13
- return (
14
- <Theme name="light">
15
- <YStack flex={1} alignItems="center" justifyContent="center" backgroundColor="white">
16
- <H2>{title}</H2>
17
- <Separator />
18
- <EditScreenInfo path={path} />
19
- {children}
20
- </YStack>
21
- </Theme>
22
- );
23
- };
@@ -1,130 +0,0 @@
1
- import { createAnimations } from "@tamagui/animations-react-native";
2
- import { createInterFont } from "@tamagui/font-inter";
3
- import { createMedia } from "@tamagui/react-native-media-driver";
4
- import { shorthands } from "@tamagui/shorthands";
5
- import { themes, tokens } from "@tamagui/themes";
6
- <% if (props.navigationPackage?.type === "navigation") { %>
7
- import { createTamagui, styled, SizableText, H1, YStack, Button as ButtonTamagui } from "tamagui";
8
- <% } else { %>
9
- import { createTamagui } from "tamagui";
10
- <% } %>
11
-
12
- const animations = createAnimations({
13
- bouncy: {
14
- damping: 10,
15
- mass: 0.9,
16
- stiffness: 100,
17
- type: 'spring',
18
- },
19
- lazy: {
20
- damping: 20,
21
- type: 'spring',
22
- stiffness: 60,
23
- },
24
- quick: {
25
- damping: 20,
26
- mass: 1.2,
27
- stiffness: 250,
28
- type: 'spring',
29
- },
30
- });
31
-
32
- const headingFont = createInterFont();
33
-
34
- const bodyFont = createInterFont();
35
-
36
- <% if (props.navigationPackage?.type === "navigation") { %>
37
- export const Container = styled(YStack, {
38
- flex: 1,
39
- padding: 24,
40
- });
41
-
42
- export const Main = styled(YStack, {
43
- flex: 1,
44
- justifyContent: 'space-between',
45
- maxWidth: 960,
46
- });
47
-
48
- export const Title = styled(H1, {
49
- color: '#000',
50
- size: '$12',
51
- });
52
-
53
- export const Subtitle = styled(SizableText, {
54
- color: '#38434D',
55
- size: '$9',
56
- });
57
-
58
- export const Button = styled(ButtonTamagui, {
59
- backgroundColor: '#6366F1',
60
- borderRadius: 28,
61
- hoverStyle: {
62
- backgroundColor: '#5a5fcf',
63
- },
64
- pressStyle: {
65
- backgroundColor: '#5a5fcf',
66
- },
67
- maxWidth: 500,
68
-
69
- // Shaddows
70
- shadowColor: '#000',
71
- shadowOffset: {
72
- height: 2,
73
- width: 0,
74
- },
75
- shadowOpacity: 0.25,
76
- shadowRadius: 3.84,
77
-
78
- // Button text
79
- color: '#FFFFFF',
80
- fontWeight: '600', // Is not passed down to the text. Probably a bug in Tamagui: https://github.com/tamagui/tamagui/issues/1156#issuecomment-1802594930
81
- fontSize: 16,
82
- });
83
- <% } %>
84
-
85
- const config = createTamagui({
86
- light: {
87
- color: {
88
- background: "gray",
89
- text: "black",
90
- }
91
- },
92
- defaultFont: "body",
93
- animations,
94
- shouldAddPrefersColorThemes: true,
95
- themeClassNameOnRoot: true,
96
- shorthands,
97
- fonts: {
98
- body: bodyFont,
99
- heading: headingFont,
100
- },
101
- themes,
102
- tokens,
103
- media: createMedia({
104
- xs: { maxWidth: 660 },
105
- sm: { maxWidth: 800 },
106
- md: { maxWidth: 1020 },
107
- lg: { maxWidth: 1280 },
108
- xl: { maxWidth: 1420 },
109
- xxl: { maxWidth: 1600 },
110
- gtXs: { minWidth: 660 + 1 },
111
- gtSm: { minWidth: 800 + 1 },
112
- gtMd: { minWidth: 1020 + 1 },
113
- gtLg: { minWidth: 1280 + 1 },
114
- short: { maxHeight: 820 },
115
- tall: { minHeight: 820 },
116
- hoverNone: { hover: "none" },
117
- pointerCoarse: { pointer: "coarse" },
118
- }),
119
- });
120
-
121
- type AppConfig = typeof config;
122
-
123
- // Enable auto-completion of props shorthand (ex: jc="center") for Tamagui templates.
124
- // Docs: https://tamagui.dev/docs/core/configuration
125
-
126
- declare module "tamagui" {
127
- interface TamaguiCustomConfig extends AppConfig {}
128
- }
129
-
130
- export default config;