first commit
Some checks failed
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled

This commit is contained in:
2026-03-17 16:22:57 +03:30
commit 3d5eaf9445
15349 changed files with 2847338 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
#!/usr/bin/env zx
import { readFile } from 'node:fs/promises';
import path from 'node:path';
const MODULE_NAME = 'my-feature';
const moduleDir = `./packages/cli/src/modules/${MODULE_NAME}`;
const testsDir = `${moduleDir}/__tests__`;
const templateDir = './scripts/backend-module';
await $`mkdir -p ${moduleDir}`;
await $`mkdir -p ${testsDir}`;
const templateFiles = [
{ template: `${MODULE_NAME}.config.template`, target: `${moduleDir}/${MODULE_NAME}.config.ts` },
{
template: `${MODULE_NAME}.controller.template`,
target: `${moduleDir}/${MODULE_NAME}.controller.ts`,
},
{ template: `${MODULE_NAME}.entity.template`, target: `${moduleDir}/${MODULE_NAME}.entity.ts` },
{ template: `${MODULE_NAME}.module.template`, target: `${moduleDir}/${MODULE_NAME}.module.ts` },
{
template: `${MODULE_NAME}.repository.template`,
target: `${moduleDir}/${MODULE_NAME}.repository.ts`,
},
{
template: `${MODULE_NAME}.service.test.template`,
target: `${testsDir}/${MODULE_NAME}.service.test.ts`,
},
{ template: `${MODULE_NAME}.service.template`, target: `${moduleDir}/${MODULE_NAME}.service.ts` },
];
await Promise.all(
templateFiles.map(async ({ template, target }) => {
const content = await readFile(path.join(templateDir, template), 'utf8');
await fs.writeFile(target, content);
}),
);
console.log(`Backend module setup done at: ${moduleDir}`);