@moamc/rn-cli 1.1.0 → 1.3.0
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/generators/screen.js +15 -2
- package/package.json +2 -2
package/generators/screen.js
CHANGED
|
@@ -31,6 +31,16 @@ const generateScreen = async () => {
|
|
|
31
31
|
console.log(chalk.gray(' Add a new screen to an existing feature module\n'));
|
|
32
32
|
|
|
33
33
|
const screensPath = getProjectPath('screens');
|
|
34
|
+
|
|
35
|
+
if (!fs.existsSync(screensPath)) {
|
|
36
|
+
console.log(chalk.red('\n✗ Error: screens directory not found'));
|
|
37
|
+
console.log(chalk.yellow('\nℹ️ Make sure you run this command from your React Native project root'));
|
|
38
|
+
console.log(chalk.gray(' Current directory: ') + chalk.white(process.cwd()));
|
|
39
|
+
console.log(chalk.gray(' Looking for: ') + chalk.white(screensPath));
|
|
40
|
+
console.log(chalk.yellow('\n💡 Tip: Navigate to your project root and try again\n'));
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
|
|
34
44
|
const features = fs.readdirSync(screensPath).filter(file => {
|
|
35
45
|
const fullPath = path.join(screensPath, file);
|
|
36
46
|
return fs.statSync(fullPath).isDirectory();
|
|
@@ -323,8 +333,11 @@ const generateScreen = async () => {
|
|
|
323
333
|
addScreenToIndexExport(screenName, featureName, screensIndexPath);
|
|
324
334
|
}
|
|
325
335
|
|
|
326
|
-
// Add screen to Navigation.js
|
|
327
|
-
|
|
336
|
+
// Add screen to Navigation.js (support both 'navigation' and 'navigations' folders)
|
|
337
|
+
let navigationPath = getProjectPath('navigations', 'Navigation.js');
|
|
338
|
+
if (!fileExists(navigationPath)) {
|
|
339
|
+
navigationPath = getProjectPath('navigation', 'Navigation.js');
|
|
340
|
+
}
|
|
328
341
|
if (fileExists(navigationPath)) {
|
|
329
342
|
addScreenToNavigation(screenName, featureName, navigationPath);
|
|
330
343
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moamc/rn-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Enterprise-grade Code Generation CLI for React Native Applications",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"scaffolding",
|
|
18
18
|
"boilerplate"
|
|
19
19
|
],
|
|
20
|
-
"author": "
|
|
20
|
+
"author": "MOAMC Engineering Team",
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|