english-lang 0.2.2 → 0.2.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/dist/cli/engc.js +34 -1
- package/package.json +1 -1
package/dist/cli/engc.js
CHANGED
|
@@ -50,6 +50,32 @@ const fs = __importStar(require("fs"));
|
|
|
50
50
|
const path = __importStar(require("path"));
|
|
51
51
|
const childProcess = __importStar(require("child_process"));
|
|
52
52
|
const index_1 = require("../index");
|
|
53
|
+
// ── Starter App.tsx ───────────────────────────────────────────
|
|
54
|
+
const STARTER_APP_TSX = `\
|
|
55
|
+
// App.tsx — wired up by engc init
|
|
56
|
+
// All screens are generated from .eng source files in screens/
|
|
57
|
+
|
|
58
|
+
import React from 'react';
|
|
59
|
+
import { NavigationContainer } from '@react-navigation/native';
|
|
60
|
+
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
61
|
+
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
62
|
+
|
|
63
|
+
import { HomeScreen } from './src/HomeScreen';
|
|
64
|
+
|
|
65
|
+
const Stack = createNativeStackNavigator();
|
|
66
|
+
|
|
67
|
+
export default function App() {
|
|
68
|
+
return (
|
|
69
|
+
<SafeAreaProvider>
|
|
70
|
+
<NavigationContainer>
|
|
71
|
+
<Stack.Navigator initialRouteName="Home">
|
|
72
|
+
<Stack.Screen name="Home" component={HomeScreen} />
|
|
73
|
+
</Stack.Navigator>
|
|
74
|
+
</NavigationContainer>
|
|
75
|
+
</SafeAreaProvider>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
53
79
|
// ── Starter .eng file ─────────────────────────────────────────
|
|
54
80
|
const STARTER_ENG = `\
|
|
55
81
|
screen HomeScreen:
|
|
@@ -153,8 +179,15 @@ function initProject(name) {
|
|
|
153
179
|
console.error('[engc] Failed to scaffold React Native app.');
|
|
154
180
|
process.exit(1);
|
|
155
181
|
}
|
|
182
|
+
// Install React Navigation
|
|
183
|
+
const rnDir = path.join(projectDir, 'rn');
|
|
184
|
+
console.log('\n[engc] Installing React Navigation ...');
|
|
185
|
+
childProcess.execSync('npm install @react-navigation/native @react-navigation/native-stack react-native-screens react-native-safe-area-context', { cwd: rnDir, stdio: 'inherit' });
|
|
186
|
+
// Patch App.tsx to import the compiled HomeScreen
|
|
187
|
+
fs.writeFileSync(path.join(rnDir, 'App.tsx'), STARTER_APP_TSX, 'utf8');
|
|
188
|
+
console.log('[engc] Patched rn/App.tsx');
|
|
156
189
|
// Pod install for iOS
|
|
157
|
-
const iosDir = path.join(
|
|
190
|
+
const iosDir = path.join(rnDir, 'ios');
|
|
158
191
|
if (fs.existsSync(iosDir)) {
|
|
159
192
|
console.log('\n[engc] Installing iOS CocoaPods ...');
|
|
160
193
|
try {
|