@teardown/cli 2.0.72 → 2.0.73

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.72",
3
+ "version": "2.0.73",
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.72",
79
+ "@teardown/tsconfig": "2.0.73",
80
80
  "@types/bun": "1.3.5",
81
81
  "@types/ejs": "^3.1.5",
82
82
  "typescript": "5.9.3"
@@ -85,7 +85,7 @@ export function startBundlerBackground(options: StartBundlerOptions = {}): Child
85
85
  const proc = spawn("npx", args, {
86
86
  cwd,
87
87
  shell: true,
88
- stdio: ["ignore", "pipe", "pipe"],
88
+ stdio: ["pipe", "pipe", "pipe"],
89
89
  detached: false,
90
90
  env: {
91
91
  ...process.env,
@@ -239,16 +239,41 @@ export async function killBundler(proc: ChildProcess, timeoutMs = 5000): Promise
239
239
  }
240
240
 
241
241
  /**
242
- * Attach bundler process to foreground (pipe stdout/stderr)
242
+ * Attach bundler process to foreground (pipe stdin/stdout/stderr)
243
+ *
244
+ * Enables keyboard shortcuts like 'r' for reload and 'j' for debugger.
243
245
  *
244
246
  * @param proc - Metro process
245
247
  */
246
248
  export function attachBundlerToForeground(proc: ChildProcess): void {
249
+ // Pipe output
247
250
  proc.stdout?.pipe(process.stdout);
248
251
  proc.stderr?.pipe(process.stderr);
249
252
 
253
+ // Connect stdin for keyboard shortcuts (r, j, d, etc.)
254
+ if (proc.stdin && process.stdin.isTTY) {
255
+ // Set raw mode to capture single keypresses
256
+ process.stdin.setRawMode(true);
257
+ process.stdin.resume();
258
+ process.stdin.pipe(proc.stdin);
259
+
260
+ // Handle Ctrl+C to exit gracefully
261
+ process.stdin.on("data", (data) => {
262
+ // Check for Ctrl+C (0x03)
263
+ if (data[0] === 0x03) {
264
+ proc.kill("SIGTERM");
265
+ process.exit(0);
266
+ }
267
+ });
268
+ }
269
+
250
270
  // Handle process exit
251
271
  proc.on("close", (code) => {
272
+ // Restore terminal settings
273
+ if (process.stdin.isTTY) {
274
+ process.stdin.setRawMode(false);
275
+ }
276
+
252
277
  if (code !== 0 && code !== null) {
253
278
  console.error(chalk.red(`Metro bundler exited with code ${code}`));
254
279
  }
@@ -5,13 +5,12 @@
5
5
  */
6
6
 
7
7
  import { defineScreen } from "@teardown/navigation/primitives";
8
- import type React from "react";
9
8
  import { ScrollView, Text, View } from "react-native";
10
9
  import { Button } from "@/components/ui/button";
11
10
  import { Card } from "@/components/ui/card";
12
11
  import { APP_NAME } from "@/core/constants";
13
12
 
14
- function HomeScreen(): React.JSX.Element {
13
+ function HomeScreen() {
15
14
  return (
16
15
  <ScrollView className="flex-1 bg-background" contentContainerClassName="p-6 gap-6">
17
16
  {/* Hero Section */}
@@ -20,12 +19,8 @@ function HomeScreen(): React.JSX.Element {
20
19
  <Text className="text-3xl font-bold text-primary-foreground">T</Text>
21
20
  </View>
22
21
  <View className="items-center gap-2">
23
- <Text className="text-2xl font-bold text-foreground text-center">
24
- Welcome to {APP_NAME}
25
- </Text>
26
- <Text className="text-base text-muted-foreground text-center">
27
- Your React Native app is ready to go
28
- </Text>
22
+ <Text className="text-2xl font-bold text-foreground text-center">Welcome to {APP_NAME}</Text>
23
+ <Text className="text-base text-muted-foreground text-center">Your React Native app is ready to go</Text>
29
24
  </View>
30
25
  </View>
31
26
 
@@ -45,21 +40,9 @@ function HomeScreen(): React.JSX.Element {
45
40
  {/* Features */}
46
41
  <View className="gap-4">
47
42
  <Text className="text-lg font-semibold text-foreground">Features</Text>
48
- <FeatureCard
49
- icon="🔒"
50
- title="Type-Safe Navigation"
51
- description="Routes are fully typed with TypeScript"
52
- />
53
- <FeatureCard
54
- icon="📁"
55
- title="File-Based Routing"
56
- description="Routes generated from file structure"
57
- />
58
- <FeatureCard
59
- icon="🎨"
60
- title="HeroUI Components"
61
- description="Beautiful pre-built UI components"
62
- />
43
+ <FeatureCard icon="🔒" title="Type-Safe Navigation" description="Routes are fully typed with TypeScript" />
44
+ <FeatureCard icon="📁" title="File-Based Routing" description="Routes generated from file structure" />
45
+ <FeatureCard icon="🎨" title="HeroUI Components" description="Beautiful pre-built UI components" />
63
46
  </View>
64
47
 
65
48
  {/* Getting Started */}
@@ -78,15 +61,7 @@ function HomeScreen(): React.JSX.Element {
78
61
  );
79
62
  }
80
63
 
81
- function FeatureCard({
82
- icon,
83
- title,
84
- description,
85
- }: {
86
- icon: string;
87
- title: string;
88
- description: string;
89
- }): React.JSX.Element {
64
+ function FeatureCard({ icon, title, description }: { icon: string; title: string; description: string }) {
90
65
  return (
91
66
  <Card>
92
67
  <Card.Body className="flex-row items-center gap-4">
@@ -10,13 +10,11 @@
10
10
 
11
11
  import "../global.css";
12
12
 
13
- import type React from "react";
14
- import { StatusBar, View } from "react-native";
15
- import { SafeAreaProvider, SafeAreaView } from "react-native-safe-area-context";
13
+ import { SafeAreaProvider } from "react-native-safe-area-context";
16
14
  import { Router } from "@/navigation";
17
15
  import { AppProviders } from "@/providers";
18
16
 
19
- export function App(): React.JSX.Element {
17
+ export function App() {
20
18
  return (
21
19
  <SafeAreaProvider>
22
20
  <AppProviders>
@@ -6,14 +6,14 @@
6
6
  */
7
7
 
8
8
  import { HeroUINativeProvider } from "heroui-native";
9
- import type React from "react";
9
+ import type { ReactNode } from "react";
10
10
  import { GestureHandlerRootView } from "react-native-gesture-handler";
11
11
 
12
12
  interface AppProvidersProps {
13
- children: React.ReactNode;
13
+ children: ReactNode;
14
14
  }
15
15
 
16
- export function AppProviders({ children }: AppProvidersProps): React.JSX.Element {
16
+ export function AppProviders({ children }: AppProvidersProps) {
17
17
  return (
18
18
  <GestureHandlerRootView style={{ flex: 1 }}>
19
19
  <HeroUINativeProvider>{children}</HeroUINativeProvider>