@qelos/plugins-cli 0.0.27 → 0.0.28
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 +1 -1
- package/services/git-files.mjs +48 -35
package/package.json
CHANGED
package/services/git-files.mjs
CHANGED
|
@@ -228,47 +228,58 @@ function classifyFiles(files, basePath) {
|
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
} else if (ext === '.html') {
|
|
231
|
-
//
|
|
232
|
-
|
|
231
|
+
// HTML files can be in different contexts:
|
|
232
|
+
// 1. In plugins directory -> micro-frontends (part of a plugin)
|
|
233
|
+
// 2. In configs directory -> standalone HTML configs
|
|
234
|
+
// 3. Other locations -> treat as micro-frontends
|
|
233
235
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
// Check if we're in a micro-frontends subdirectory
|
|
242
|
-
if (path.basename(pluginDir) === 'micro-frontends' ||
|
|
243
|
-
relativePath.includes('micro-frontends/') ||
|
|
244
|
-
relativePath.includes('micro-frontends\\')) {
|
|
245
|
-
// Go up one more level to find the plugin directory
|
|
246
|
-
pluginDir = path.dirname(pluginDir);
|
|
247
|
-
pluginJson = path.join(pluginDir, 'plugin.json');
|
|
248
|
-
}
|
|
236
|
+
if (relativePath.includes('configs/') || relativePath.includes('configs\\')) {
|
|
237
|
+
// HTML file in configs directory - treat as a config file
|
|
238
|
+
classified.configs.push(fullPath);
|
|
239
|
+
logger.debug(`Found HTML config file: ${relativePath}`);
|
|
240
|
+
} else {
|
|
241
|
+
// Find plugins that contain this HTML file (micro-frontends)
|
|
242
|
+
classified.microFrontends.push(fullPath);
|
|
249
243
|
|
|
250
|
-
//
|
|
244
|
+
// For HTML files, we need to find which plugin contains them
|
|
245
|
+
// HTML files in plugins are typically part of the plugin structure
|
|
246
|
+
let pluginDir = path.dirname(fullPath);
|
|
247
|
+
let pluginJson = path.join(pluginDir, 'plugin.json');
|
|
248
|
+
|
|
249
|
+
// If the file is in a temp path or unusual location, try to find the actual plugin
|
|
251
250
|
if (!fs.existsSync(pluginJson)) {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
251
|
+
// Check if we're in a micro-frontends subdirectory
|
|
252
|
+
if (path.basename(pluginDir) === 'micro-frontends' ||
|
|
253
|
+
relativePath.includes('micro-frontends/') ||
|
|
254
|
+
relativePath.includes('micro-frontends\\')) {
|
|
255
|
+
// Go up one more level to find the plugin directory
|
|
256
|
+
pluginDir = path.dirname(pluginDir);
|
|
257
|
+
pluginJson = path.join(pluginDir, 'plugin.json');
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// If still not found, try searching for plugin.json in parent directories
|
|
261
|
+
if (!fs.existsSync(pluginJson)) {
|
|
262
|
+
let searchDir = pluginDir;
|
|
263
|
+
for (let i = 0; i < 3; i++) { // Search up to 3 levels up
|
|
264
|
+
searchDir = path.dirname(searchDir);
|
|
265
|
+
const testPluginJson = path.join(searchDir, 'plugin.json');
|
|
266
|
+
if (fs.existsSync(testPluginJson)) {
|
|
267
|
+
pluginJson = testPluginJson;
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
259
270
|
}
|
|
260
271
|
}
|
|
261
272
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
273
|
+
|
|
274
|
+
if (fs.existsSync(pluginJson)) {
|
|
275
|
+
// This HTML file is part of a plugin
|
|
276
|
+
if (!classified.plugins.includes(pluginJson)) {
|
|
277
|
+
classified.plugins.push(pluginJson);
|
|
278
|
+
logger.debug(`Found plugin containing HTML ${relativePath}: ${path.basename(pluginJson)}`);
|
|
279
|
+
}
|
|
280
|
+
} else {
|
|
281
|
+
logger.warning(`Could not find plugin.json for HTML file: ${relativePath}`);
|
|
269
282
|
}
|
|
270
|
-
} else {
|
|
271
|
-
logger.warning(`Could not find plugin.json for HTML file: ${relativePath}`);
|
|
272
283
|
}
|
|
273
284
|
} else {
|
|
274
285
|
logger.debug(`Unclassified file: ${relativePath}`);
|
|
@@ -302,8 +313,10 @@ export function getGitFiles(type, basePath) {
|
|
|
302
313
|
// Log what we found
|
|
303
314
|
Object.entries(classified).forEach(([key, value]) => {
|
|
304
315
|
if (value.length > 0) {
|
|
305
|
-
if (key === 'prompts'
|
|
316
|
+
if (key === 'prompts') {
|
|
306
317
|
logger.info(` ${key}: ${value.length} file(s) (will be pushed via parent)`);
|
|
318
|
+
} else if (key === 'microFrontends') {
|
|
319
|
+
logger.info(` ${key}: ${value.length} file(s) (will be pushed via parent plugin)`);
|
|
307
320
|
} else {
|
|
308
321
|
logger.info(` ${key}: ${value.length} file(s)`);
|
|
309
322
|
}
|