fleetbo-cockpit-cli 1.0.93 → 1.0.94
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/cli.js +6 -6
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -99,9 +99,9 @@ const checkGitSecurity = () => {
|
|
|
99
99
|
const injectRouteIntoAppJs = (moduleName, subPath = '') => {
|
|
100
100
|
const appJsPath = fs.existsSync(path.join(process.cwd(), 'src', 'App.jsx'))
|
|
101
101
|
? path.join(process.cwd(), 'src', 'App.jsx')
|
|
102
|
-
: path.join(process.cwd(), 'src', 'App.
|
|
102
|
+
: path.join(process.cwd(), 'src', 'App.jsx');
|
|
103
103
|
if (!fs.existsSync(appJsPath)) {
|
|
104
|
-
console.error(` \x1b[31m[Safety Stop]\x1b[0m App.
|
|
104
|
+
console.error(` \x1b[31m[Safety Stop]\x1b[0m App.jsx missing.`);
|
|
105
105
|
return false;
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -110,7 +110,7 @@ const injectRouteIntoAppJs = (moduleName, subPath = '') => {
|
|
|
110
110
|
const routeAnchor = '{/* FLEETBO_DYNAMIC ROUTES */}';
|
|
111
111
|
|
|
112
112
|
if (!content.includes(importAnchor) || !content.includes(routeAnchor)) {
|
|
113
|
-
console.log(` \x1b[33m[Skipped]\x1b[0m Anchors missing in App.
|
|
113
|
+
console.log(` \x1b[33m[Skipped]\x1b[0m Anchors missing in App.jsx. Manual injection required.`);
|
|
114
114
|
return false;
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -202,7 +202,7 @@ const getModuleCache = async ({ projectId, moduleName }) => {
|
|
|
202
202
|
const removeRouteFromAppJs = (moduleName) => {
|
|
203
203
|
const appJsPath = fs.existsSync(path.join(process.cwd(), 'src', 'App.jsx'))
|
|
204
204
|
? path.join(process.cwd(), 'src', 'App.jsx')
|
|
205
|
-
: path.join(process.cwd(), 'src', 'App.
|
|
205
|
+
: path.join(process.cwd(), 'src', 'App.jsx');
|
|
206
206
|
if (!fs.existsSync(appJsPath)) return false;
|
|
207
207
|
|
|
208
208
|
let content = fs.readFileSync(appJsPath, 'utf8');
|
|
@@ -219,7 +219,7 @@ const removeRouteFromAppJs = (moduleName) => {
|
|
|
219
219
|
|
|
220
220
|
if (content !== originalContent) {
|
|
221
221
|
fs.writeFileSync(appJsPath, content);
|
|
222
|
-
console.log(` \x1b[32m[Unrouted]\x1b[0m ${moduleName} removed from App.
|
|
222
|
+
console.log(` \x1b[32m[Unrouted]\x1b[0m ${moduleName} removed from App.jsx.`);
|
|
223
223
|
return true;
|
|
224
224
|
}
|
|
225
225
|
return false;
|
|
@@ -690,7 +690,7 @@ else if (command === 'rm') {
|
|
|
690
690
|
actionsDone++;
|
|
691
691
|
}
|
|
692
692
|
|
|
693
|
-
// 4. Disinfect System Core (App.
|
|
693
|
+
// 4. Disinfect System Core (App.jsx)
|
|
694
694
|
const unrouted = removeRouteFromAppJs(moduleName);
|
|
695
695
|
if (unrouted) actionsDone++;
|
|
696
696
|
|