@teardown/cli 2.0.69 → 2.0.71
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/package.json +2 -2
- package/templates/metro.config.js +1 -1
- package/templates/src/components/ui/card.tsx +21 -37
- package/templates/src/navigation/index.ts +0 -1
- package/templates/src/navigation/router.tsx +37 -39
- package/templates/src/providers/app.provider.tsx +1 -4
- package/templates/src/navigation/navigation-provider.tsx +0 -27
- /package/templates/src/{routes → _routes}/_layout.tsx +0 -0
- /package/templates/src/{routes → _routes}/home.tsx +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teardown/cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.71",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@biomejs/biome": "2.3.11",
|
|
79
|
-
"@teardown/tsconfig": "2.0.
|
|
79
|
+
"@teardown/tsconfig": "2.0.71",
|
|
80
80
|
"@types/bun": "1.3.5",
|
|
81
81
|
"@types/ejs": "^3.1.5",
|
|
82
82
|
"typescript": "5.9.3"
|
|
@@ -30,7 +30,7 @@ const config = {};
|
|
|
30
30
|
const teardownConfig = withTeardown(mergeConfig(getDefaultConfig(__dirname), config));
|
|
31
31
|
|
|
32
32
|
const navigationConfig = withTeardownNavigation(teardownConfig, {
|
|
33
|
-
routesDir: "./src/
|
|
33
|
+
routesDir: "./src/_routes",
|
|
34
34
|
generatedDir: "./.teardown",
|
|
35
35
|
verbose: false,
|
|
36
36
|
});
|
|
@@ -71,58 +71,50 @@
|
|
|
71
71
|
*/
|
|
72
72
|
|
|
73
73
|
import type {
|
|
74
|
-
CardBodyProps
|
|
75
|
-
CardDescriptionProps
|
|
76
|
-
CardFooterProps
|
|
77
|
-
CardHeaderProps
|
|
78
|
-
|
|
79
|
-
CardTitleProps
|
|
80
|
-
} from "heroui-native";
|
|
81
|
-
import {
|
|
82
|
-
Card as HeroCard,
|
|
83
|
-
CardBody as HeroCardBody,
|
|
84
|
-
CardDescription as HeroCardDescription,
|
|
85
|
-
CardFooter as HeroCardFooter,
|
|
86
|
-
CardHeader as HeroCardHeader,
|
|
87
|
-
CardTitle as HeroCardTitle,
|
|
74
|
+
CardBodyProps,
|
|
75
|
+
CardDescriptionProps,
|
|
76
|
+
CardFooterProps,
|
|
77
|
+
CardHeaderProps,
|
|
78
|
+
CardRootProps as CardProps,
|
|
79
|
+
CardTitleProps,
|
|
88
80
|
} from "heroui-native";
|
|
81
|
+
import { Card as HeroCard } from "heroui-native";
|
|
89
82
|
import { forwardRef } from "react";
|
|
90
|
-
import type { View as ViewRef } from "react-native";
|
|
91
|
-
import type { Text as TextRef } from "react-native";
|
|
83
|
+
import type { Text as TextRef, View as ViewRef } from "react-native";
|
|
92
84
|
|
|
93
85
|
// Card Root component
|
|
94
|
-
const CardRoot = forwardRef<ViewRef,
|
|
86
|
+
const CardRoot = forwardRef<ViewRef, CardProps>((props, ref) => {
|
|
95
87
|
return <HeroCard ref={ref} {...props} />;
|
|
96
88
|
});
|
|
97
89
|
CardRoot.displayName = "Card";
|
|
98
90
|
|
|
99
91
|
// Card Header component
|
|
100
|
-
const CardHeader = forwardRef<ViewRef,
|
|
101
|
-
return <
|
|
92
|
+
const CardHeader = forwardRef<ViewRef, CardHeaderProps>((props, ref) => {
|
|
93
|
+
return <HeroCard.Header ref={ref} {...props} />;
|
|
102
94
|
});
|
|
103
95
|
CardHeader.displayName = "Card.Header";
|
|
104
96
|
|
|
105
97
|
// Card Body component
|
|
106
|
-
const CardBody = forwardRef<ViewRef,
|
|
107
|
-
return <
|
|
98
|
+
const CardBody = forwardRef<ViewRef, CardBodyProps>((props, ref) => {
|
|
99
|
+
return <HeroCard.Body ref={ref} {...props} />;
|
|
108
100
|
});
|
|
109
101
|
CardBody.displayName = "Card.Body";
|
|
110
102
|
|
|
111
|
-
// Card Footer
|
|
112
|
-
const CardFooter = forwardRef<ViewRef,
|
|
113
|
-
return <
|
|
103
|
+
// Card Footer component
|
|
104
|
+
const CardFooter = forwardRef<ViewRef, CardFooterProps>((props, ref) => {
|
|
105
|
+
return <HeroCard.Footer ref={ref} {...props} />;
|
|
114
106
|
});
|
|
115
107
|
CardFooter.displayName = "Card.Footer";
|
|
116
108
|
|
|
117
109
|
// Card Title component
|
|
118
|
-
const CardTitle = forwardRef<TextRef,
|
|
119
|
-
return <
|
|
110
|
+
const CardTitle = forwardRef<TextRef, CardTitleProps>((props, ref) => {
|
|
111
|
+
return <HeroCard.Title ref={ref} {...props} />;
|
|
120
112
|
});
|
|
121
113
|
CardTitle.displayName = "Card.Title";
|
|
122
114
|
|
|
123
115
|
// Card Description component
|
|
124
|
-
const CardDescription = forwardRef<TextRef,
|
|
125
|
-
return <
|
|
116
|
+
const CardDescription = forwardRef<TextRef, CardDescriptionProps>((props, ref) => {
|
|
117
|
+
return <HeroCard.Description ref={ref} {...props} />;
|
|
126
118
|
});
|
|
127
119
|
CardDescription.displayName = "Card.Description";
|
|
128
120
|
|
|
@@ -135,12 +127,4 @@ export const Card = Object.assign(CardRoot, {
|
|
|
135
127
|
Description: CardDescription,
|
|
136
128
|
});
|
|
137
129
|
|
|
138
|
-
|
|
139
|
-
export type {
|
|
140
|
-
HeroCardProps as CardProps,
|
|
141
|
-
HeroCardHeaderProps as CardHeaderProps,
|
|
142
|
-
HeroCardBodyProps as CardBodyProps,
|
|
143
|
-
HeroCardFooterProps as CardFooterProps,
|
|
144
|
-
HeroCardTitleProps as CardTitleProps,
|
|
145
|
-
HeroCardDescriptionProps as CardDescriptionProps,
|
|
146
|
-
};
|
|
130
|
+
export type { CardProps, CardHeaderProps, CardBodyProps, CardFooterProps, CardTitleProps, CardDescriptionProps };
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Router Component
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Creates a type-safe router from the generated route tree.
|
|
5
|
+
* Routes are automatically generated from files in src/_routes/
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
8
|
+
import { createTeardownRouter } from "@teardown/navigation";
|
|
9
|
+
import { routeTree } from "../../.teardown/routeTree.generated";
|
|
10
|
+
import { generatedLinkingConfig, defaultPrefixes } from "../../.teardown/linking.generated";
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// Create navigator
|
|
15
|
-
const Stack = createNativeStackNavigator();
|
|
16
|
-
|
|
17
|
-
// Theme colors using CSS variable-friendly values
|
|
12
|
+
/**
|
|
13
|
+
* Theme colors for navigation styling
|
|
14
|
+
*/
|
|
18
15
|
const theme = {
|
|
19
16
|
background: "hsl(0, 0%, 100%)",
|
|
20
17
|
foreground: "hsl(224, 71%, 4%)",
|
|
@@ -23,32 +20,33 @@ const theme = {
|
|
|
23
20
|
/**
|
|
24
21
|
* Root Router
|
|
25
22
|
*
|
|
26
|
-
*
|
|
23
|
+
* Auto-generated from file-based routes in src/_routes/
|
|
24
|
+
* Add new screens by creating files in the _routes directory.
|
|
27
25
|
*/
|
|
28
|
-
export
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
26
|
+
export const Router = createTeardownRouter({
|
|
27
|
+
routeTree,
|
|
28
|
+
initialRouteName: "home",
|
|
29
|
+
linking: {
|
|
30
|
+
prefixes: defaultPrefixes,
|
|
31
|
+
config: generatedLinkingConfig,
|
|
32
|
+
},
|
|
33
|
+
navigationContainerProps: {
|
|
34
|
+
theme: {
|
|
35
|
+
dark: false,
|
|
36
|
+
colors: {
|
|
37
|
+
primary: theme.foreground,
|
|
38
|
+
background: theme.background,
|
|
39
|
+
card: theme.background,
|
|
40
|
+
text: theme.foreground,
|
|
41
|
+
border: "hsl(214, 32%, 91%)",
|
|
42
|
+
notification: "hsl(0, 84%, 60%)",
|
|
43
|
+
},
|
|
44
|
+
fonts: {
|
|
45
|
+
regular: { fontFamily: "System", fontWeight: "400" },
|
|
46
|
+
medium: { fontFamily: "System", fontWeight: "500" },
|
|
47
|
+
bold: { fontFamily: "System", fontWeight: "700" },
|
|
48
|
+
heavy: { fontFamily: "System", fontWeight: "900" },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
});
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
import { HeroUINativeProvider } from "heroui-native";
|
|
9
9
|
import type React from "react";
|
|
10
10
|
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
11
|
-
import { NavigationProvider } from "@/navigation";
|
|
12
11
|
|
|
13
12
|
interface AppProvidersProps {
|
|
14
13
|
children: React.ReactNode;
|
|
@@ -17,9 +16,7 @@ interface AppProvidersProps {
|
|
|
17
16
|
export function AppProviders({ children }: AppProvidersProps): React.JSX.Element {
|
|
18
17
|
return (
|
|
19
18
|
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
20
|
-
<HeroUINativeProvider>
|
|
21
|
-
<NavigationProvider>{children}</NavigationProvider>
|
|
22
|
-
</HeroUINativeProvider>
|
|
19
|
+
<HeroUINativeProvider>{children}</HeroUINativeProvider>
|
|
23
20
|
</GestureHandlerRootView>
|
|
24
21
|
);
|
|
25
22
|
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Navigation Provider
|
|
3
|
-
*
|
|
4
|
-
* Wraps the app with NavigationContainer and linking configuration.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type { LinkingOptions } from "@react-navigation/native";
|
|
8
|
-
import { NavigationContainer } from "@react-navigation/native";
|
|
9
|
-
import type React from "react";
|
|
10
|
-
import { defaultPrefixes, generatedLinkingConfig } from "@/.teardown/linking.generated";
|
|
11
|
-
|
|
12
|
-
interface NavigationProviderProps {
|
|
13
|
-
children: React.ReactNode;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Linking configuration for deep links.
|
|
18
|
-
* Routes are automatically generated by @teardown/navigation-metro.
|
|
19
|
-
*/
|
|
20
|
-
const linking: LinkingOptions<object> = {
|
|
21
|
-
prefixes: defaultPrefixes,
|
|
22
|
-
config: generatedLinkingConfig,
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export function NavigationProvider({ children }: NavigationProviderProps): React.JSX.Element {
|
|
26
|
-
return <NavigationContainer linking={linking}>{children}</NavigationContainer>;
|
|
27
|
-
}
|
|
File without changes
|
|
File without changes
|