last refactor imports ...
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import { Command } from 'commander';
|
||||
import { join } from 'path';
|
||||
import * as fs from 'fs-extra';
|
||||
import { Command } from 'commander';
|
||||
import {
|
||||
loadManifest,
|
||||
writeManifest,
|
||||
findManifestRoot,
|
||||
} from '../manifest/manifest-store';
|
||||
import { logger } from '../lib/logger';
|
||||
import { findManifestRoot, loadManifest, writeManifest } from '../manifest/manifest-store';
|
||||
import { scanProject } from '../manifest/manifest-scanner';
|
||||
|
||||
export function registerManifestCommand(program: Command): void {
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
import { Command } from 'commander';
|
||||
import { join } from 'path';
|
||||
import * as fs from 'fs-extra';
|
||||
import {
|
||||
loadManifest,
|
||||
writeManifest,
|
||||
findManifestRoot,
|
||||
} from '../manifest/manifest-store';
|
||||
import { Command } from 'commander';
|
||||
import { logger } from '../lib/logger';
|
||||
import { findManifestRoot, loadManifest, writeManifest } from '../manifest/manifest-store';
|
||||
import { scanProject } from '../manifest/manifest-scanner';
|
||||
|
||||
export function registerProjectCommand(program: Command): void {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import * as fs from 'fs-extra';
|
||||
import { join } from 'path';
|
||||
import * as fs from 'fs-extra';
|
||||
import { logger } from '../lib/logger';
|
||||
import { copyTemplate } from '../lib/fs-utils';
|
||||
import { toKebab, toPascal } from '../lib/naming';
|
||||
import { requireProjectRoot } from '../lib/project-utils';
|
||||
import { copyTemplate } from '../lib/fs-utils';
|
||||
import { logger } from '../lib/logger';
|
||||
|
||||
export async function generateModule(opts: { name: string }): Promise<void> {
|
||||
const root = await requireProjectRoot(); const kebab = toKebab(opts.name); const pascal = toPascal(opts.name);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import * as fs from 'fs-extra';
|
||||
import { join } from 'path';
|
||||
import * as fs from 'fs-extra';
|
||||
import { logger } from '../lib/logger';
|
||||
import { copyTemplate } from '../lib/fs-utils';
|
||||
import { toKebab, toPascal } from '../lib/naming';
|
||||
import { requireProjectRoot } from '../lib/project-utils';
|
||||
import { copyTemplate } from '../lib/fs-utils';
|
||||
import { logger } from '../lib/logger';
|
||||
|
||||
export async function generateProviderPage(opts: { name: string; kind?: string }): Promise<void> {
|
||||
const root = await requireProjectRoot(); const kebab = toKebab(opts.name); const pascal = toPascal(opts.name); const kind = opts.kind === 'management' ? 'management' : 'explorer';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import * as fs from 'fs-extra';
|
||||
import { join } from 'path';
|
||||
import * as fs from 'fs-extra';
|
||||
import { logger } from '../lib/logger';
|
||||
import { copyTemplate } from '../lib/fs-utils';
|
||||
import { toKebab, toPascal } from '../lib/naming';
|
||||
import { requireProjectRoot } from '../lib/project-utils';
|
||||
import { copyTemplate } from '../lib/fs-utils';
|
||||
import { logger } from '../lib/logger';
|
||||
|
||||
export async function generateService(opts: { name: string }): Promise<void> {
|
||||
const root = await requireProjectRoot(); const kebab = toKebab(opts.name); const pascal = toPascal(opts.name);
|
||||
|
||||
+8
-19
@@ -1,20 +1,14 @@
|
||||
// src/index.ts
|
||||
import chalk from 'chalk';
|
||||
import { join } from 'path';
|
||||
import { readFileSync } from 'fs';
|
||||
import { Command } from 'commander';
|
||||
import { registerGenerateCommand } from './commands/generate';
|
||||
import { registerProjectCommand } from './commands/project';
|
||||
import { registerManifestCommand } from './commands/manifest';
|
||||
import { registerAddCommand } from './commands/add';
|
||||
import { registerNewCommand } from './commands/new';
|
||||
import { registerConfigCommand } from './commands/config';
|
||||
import { registerDoctorCommand } from './commands/doctor';
|
||||
import { registerNewCommand } from './commands/new';
|
||||
// import { registerAddCommand } from './commands/add';
|
||||
// import { registerBuildCommand } from './commands/build';
|
||||
// import { registerConfigCommand } from './commands/config';
|
||||
// import { registerDoctorCommand } from './commands/doctor';
|
||||
// import { registerGenerateCommand } from './commands/generate';
|
||||
import { registerProjectCommand } from './commands/project';
|
||||
import { registerGenerateCommand } from './commands/generate';
|
||||
import { registerManifestCommand } from './commands/manifest';
|
||||
|
||||
const pkg = JSON.parse(
|
||||
readFileSync(join(__dirname, '..', 'package.json'), 'utf-8')
|
||||
@@ -27,18 +21,13 @@ program
|
||||
.version(pkg.version, '-v, --version', 'output the current version');
|
||||
|
||||
// ثبت زیردستورات
|
||||
registerGenerateCommand(program);
|
||||
registerProjectCommand(program);
|
||||
registerManifestCommand(program);
|
||||
registerAddCommand(program);
|
||||
registerConfigCommand(program);
|
||||
registerNewCommand(program);
|
||||
registerConfigCommand(program);
|
||||
registerDoctorCommand(program);
|
||||
// registerGenerateCommand(program);
|
||||
// registerAddCommand(program);
|
||||
// registerConfigCommand(program);
|
||||
// registerBuildCommand(program);
|
||||
// registerDoctorCommand(program);
|
||||
registerProjectCommand(program);
|
||||
registerGenerateCommand(program);
|
||||
registerManifestCommand(program);
|
||||
|
||||
// دستور پیشفرض
|
||||
program
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as fs from 'fs-extra';
|
||||
import { join } from 'path';
|
||||
import * as fs from 'fs-extra';
|
||||
import { Project, SyntaxKind } from 'ts-morph';
|
||||
import { findManifestRoot, loadManifest } from '../manifest/manifest-store';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user