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