BREAKING CHANGE(core): Migrate filesystem to smartfs (async) and add Elasticsearch service support; refactor format/commit/meta modules

This commit is contained in:
2025-11-27 21:32:34 +00:00
parent 2f3d67f9e3
commit e1d28bc10a
30 changed files with 2217 additions and 995 deletions

View File

@@ -6,23 +6,36 @@ import * as paths from '../paths.js';
import { logger } from '../gitzone.logging.js';
export let run = () => {
export let run = async () => {
const done = plugins.smartpromise.defer();
logger.log('warn', 'no action specified');
const dirEntries = await plugins.smartfs.directory(paths.templatesDir).list();
const templates: string[] = [];
for (const entry of dirEntries) {
try {
const stats = await plugins.smartfs
.file(plugins.path.join(paths.templatesDir, entry.path))
.stat();
if (stats.isDirectory) {
templates.push(entry.name);
}
} catch {
// Skip entries that can't be accessed
}
}
let projects = `\n`;
for (const template of templates) {
projects += ` - ${template}\n`;
}
logger.log(
'info',
`
You can do one of the following things:
* create a new project with 'gitzone template [template]'
the following templates exist: ${(() => {
let projects = `\n`;
for (const template of plugins.smartfile.fs.listFoldersSync(
paths.templatesDir,
)) {
projects += ` - ${template}\n`;
}
return projects;
})()}
the following templates exist: ${projects}
* format a project with 'gitzone format'
`,
);