@teardown/cli 2.0.70 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teardown/cli",
3
- "version": "2.0.70",
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.70",
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/routes",
33
+ routesDir: "./src/_routes",
34
34
  generatedDir: "./.teardown",
35
35
  verbose: false,
36
36
  });
@@ -5,5 +5,4 @@
5
5
  */
6
6
 
7
7
  export { useTypedNavigation, useTypedParams, useTypedRoute } from "./hooks";
8
- export { NavigationProvider } from "./navigation-provider";
9
8
  export { Router } from "./router";
@@ -1,20 +1,17 @@
1
1
  /**
2
2
  * Router Component
3
3
  *
4
- * Renders the navigation structure based on the file-based routes.
5
- * Uses a simple stack navigator with Home as the initial route.
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 React from "react";
9
- import { createNativeStackNavigator } from "@react-navigation/native-stack";
8
+ import { createTeardownRouter } from "@teardown/navigation";
9
+ import { routeTree } from "../../.teardown/routeTree.generated";
10
+ import { generatedLinkingConfig, defaultPrefixes } from "../../.teardown/linking.generated";
10
11
 
11
- // Import screen definitions
12
- import HomeScreen from "@/routes/home";
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
- * Stack navigator with Home as the initial route.
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 function Router(): React.JSX.Element {
29
- return (
30
- <Stack.Navigator
31
- initialRouteName="home"
32
- screenOptions={{
33
- headerShown: true,
34
- animation: "slide_from_right",
35
- contentStyle: {
36
- backgroundColor: theme.background,
37
- },
38
- headerStyle: {
39
- backgroundColor: theme.background,
40
- },
41
- headerTitleStyle: {
42
- color: theme.foreground,
43
- fontWeight: "600",
44
- },
45
- }}
46
- >
47
- <Stack.Screen
48
- name="home"
49
- component={HomeScreen.component}
50
- options={HomeScreen.options}
51
- />
52
- </Stack.Navigator>
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