@codefast/cli 0.3.4 → 0.3.5

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/dist/index.js CHANGED
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env node
2
- import * as __WEBPACK_EXTERNAL_MODULE_inversify__ from "inversify";
3
- import * as __WEBPACK_EXTERNAL_MODULE_commander__ from "commander";
4
- import * as __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__ from "node:process";
5
- import * as __WEBPACK_EXTERNAL_MODULE_node_child_process_27f17141__ from "node:child_process";
6
- import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
7
- import * as __WEBPACK_EXTERNAL_MODULE_zod__ from "zod";
8
- import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
9
- import * as __WEBPACK_EXTERNAL_MODULE_node_readline_91c31510__ from "node:readline";
10
- import * as __WEBPACK_EXTERNAL_MODULE_ts_morph_07c7ce60__ from "ts-morph";
11
- import * as __WEBPACK_EXTERNAL_MODULE_glob__ from "glob";
12
- import * as __WEBPACK_EXTERNAL_MODULE_lodash_es_18c59938__ from "lodash-es";
13
- import * as __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__ from "node:url";
2
+ import { Container, inject, injectable } from "inversify";
3
+ import { Command } from "commander";
4
+ import external_node_process_default, { exit } from "node:process";
5
+ import { execSync } from "node:child_process";
6
+ import external_node_path_default from "node:path";
7
+ import { z } from "zod";
8
+ import external_node_fs_default from "node:fs";
9
+ import external_node_readline_default from "node:readline";
10
+ import { Project } from "ts-morph";
11
+ import { glob } from "glob";
12
+ import { merge } from "lodash-es";
13
+ import { fileURLToPath } from "node:url";
14
14
  const TYPES = {
15
15
  ProjectRepository: Symbol.for("ProjectRepository"),
16
16
  PackageRepository: Symbol.for("PackageRepository"),
@@ -47,15 +47,15 @@ class CreateProjectCommand {
47
47
  this.createProjectUseCase = createProjectUseCase;
48
48
  }
49
49
  getCommand() {
50
- return new __WEBPACK_EXTERNAL_MODULE_commander__.Command().name("create-project").description("Create a new Next.js project with TypeScript, TailwindCSS, and linting setup").argument("[project-name]", "Name of the project to create").action(async (projectName)=>{
50
+ return new Command().name("create-project").description("Create a new Next.js project with TypeScript, TailwindCSS, and linting setup").argument("[project-name]", "Name of the project to create").action(async (projectName)=>{
51
51
  await this.createProjectUseCase.execute(projectName);
52
- __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__["default"].exit(0);
52
+ external_node_process_default.exit(0);
53
53
  });
54
54
  }
55
55
  }
56
56
  CreateProjectCommand = _ts_decorate([
57
- (0, __WEBPACK_EXTERNAL_MODULE_inversify__.injectable)(),
58
- _ts_param(0, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.CreateProjectUseCase)),
57
+ injectable(),
58
+ _ts_param(0, inject(TYPES.CreateProjectUseCase)),
59
59
  _ts_metadata("design:type", Function),
60
60
  _ts_metadata("design:paramtypes", [
61
61
  "undefined" == typeof CreateProjectUseCase ? Object : CreateProjectUseCase
@@ -80,19 +80,19 @@ class UpdateExportsCommand {
80
80
  this.updateExportsUseCase = updateExportsUseCase;
81
81
  }
82
82
  getCommand() {
83
- return new __WEBPACK_EXTERNAL_MODULE_commander__.Command().name("update-exports").description("Updates exports for all packages").option("-p, --package <package>", "Filter by package name").option("-d, --dry-run", "Run without making changes").option("-c, --config <path>", "Path to configuration file").action(async (options)=>{
83
+ return new Command().name("update-exports").description("Updates exports for all packages").option("-p, --package <package>", "Filter by package name").option("-d, --dry-run", "Run without making changes").option("-c, --config <path>", "Path to configuration file").action(async (options)=>{
84
84
  await this.updateExportsUseCase.execute({
85
85
  packageFilter: options.package,
86
86
  dryRun: Boolean(options.dryRun),
87
87
  configPath: options.config
88
88
  });
89
- __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__.exit(0);
89
+ exit(0);
90
90
  });
91
91
  }
92
92
  }
93
93
  UpdateExportsCommand = update_exports_command_ts_decorate([
94
- (0, __WEBPACK_EXTERNAL_MODULE_inversify__.injectable)(),
95
- update_exports_command_ts_param(0, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.UpdateExportsUseCase)),
94
+ injectable(),
95
+ update_exports_command_ts_param(0, inject(TYPES.UpdateExportsUseCase)),
96
96
  update_exports_command_ts_metadata("design:type", Function),
97
97
  update_exports_command_ts_metadata("design:paramtypes", [
98
98
  "undefined" == typeof UpdateExportsUseCase ? Object : UpdateExportsUseCase
@@ -427,7 +427,7 @@ export const fontVariables = cn(fontGeistSans.variable, fontGeistMono.variable);
427
427
  }
428
428
  }
429
429
  ConfigService = config_service_ts_decorate([
430
- (0, __WEBPACK_EXTERNAL_MODULE_inversify__.injectable)()
430
+ injectable()
431
431
  ], ConfigService);
432
432
  function create_project_use_case_ts_decorate(decorators, target, key, desc) {
433
433
  var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -508,12 +508,12 @@ class create_project_use_case_CreateProjectUseCase {
508
508
  }
509
509
  }
510
510
  create_project_use_case_CreateProjectUseCase = create_project_use_case_ts_decorate([
511
- (0, __WEBPACK_EXTERNAL_MODULE_inversify__.injectable)(),
512
- create_project_use_case_ts_param(0, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.ProjectRepository)),
513
- create_project_use_case_ts_param(1, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.FileSystemPort)),
514
- create_project_use_case_ts_param(2, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.CommandExecutorPort)),
515
- create_project_use_case_ts_param(3, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.PromptPort)),
516
- create_project_use_case_ts_param(4, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.ConfigService)),
511
+ injectable(),
512
+ create_project_use_case_ts_param(0, inject(TYPES.ProjectRepository)),
513
+ create_project_use_case_ts_param(1, inject(TYPES.FileSystemPort)),
514
+ create_project_use_case_ts_param(2, inject(TYPES.CommandExecutorPort)),
515
+ create_project_use_case_ts_param(3, inject(TYPES.PromptPort)),
516
+ create_project_use_case_ts_param(4, inject(TYPES.ConfigService)),
517
517
  create_project_use_case_ts_metadata("design:type", Function),
518
518
  create_project_use_case_ts_metadata("design:paramtypes", [
519
519
  "undefined" == typeof ProjectRepositoryInterface ? Object : ProjectRepositoryInterface,
@@ -565,8 +565,8 @@ class update_exports_use_case_UpdateExportsUseCase {
565
565
  }
566
566
  }
567
567
  update_exports_use_case_UpdateExportsUseCase = update_exports_use_case_ts_decorate([
568
- (0, __WEBPACK_EXTERNAL_MODULE_inversify__.injectable)(),
569
- update_exports_use_case_ts_param(0, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.PackageRepository)),
568
+ injectable(),
569
+ update_exports_use_case_ts_param(0, inject(TYPES.PackageRepository)),
570
570
  update_exports_use_case_ts_metadata("design:type", Function),
571
571
  update_exports_use_case_ts_metadata("design:paramtypes", [
572
572
  "undefined" == typeof PackageRepository ? Object : PackageRepository
@@ -593,15 +593,15 @@ class CLIAdapter {
593
593
  this.packageInfoService = packageInfoService;
594
594
  }
595
595
  initialize() {
596
- const program = new __WEBPACK_EXTERNAL_MODULE_commander__.Command();
596
+ const program = new Command();
597
597
  program.name("codefast").description("CodeFast CLI - A development toolkit for CodeFast.").version(this.packageInfoService.getPackageVersion(), "-v, --version", "display CLI version").addCommand(this.createProjectCommand.getCommand()).addCommand(this.updateExportsCommand.getCommand()).parse(process.argv);
598
598
  }
599
599
  }
600
600
  CLIAdapter = cli_adapter_ts_decorate([
601
- (0, __WEBPACK_EXTERNAL_MODULE_inversify__.injectable)(),
602
- cli_adapter_ts_param(0, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.CreateProjectCommand)),
603
- cli_adapter_ts_param(1, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.UpdateExportsCommand)),
604
- cli_adapter_ts_param(2, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.PackageInfoService)),
601
+ injectable(),
602
+ cli_adapter_ts_param(0, inject(TYPES.CreateProjectCommand)),
603
+ cli_adapter_ts_param(1, inject(TYPES.UpdateExportsCommand)),
604
+ cli_adapter_ts_param(2, inject(TYPES.PackageInfoService)),
605
605
  cli_adapter_ts_metadata("design:type", Function),
606
606
  cli_adapter_ts_metadata("design:paramtypes", [
607
607
  void 0 === CreateProjectCommand ? Object : CreateProjectCommand,
@@ -609,49 +609,49 @@ CLIAdapter = cli_adapter_ts_decorate([
609
609
  "undefined" == typeof PackageInfoServiceInterface ? Object : PackageInfoServiceInterface
610
610
  ])
611
611
  ], CLIAdapter);
612
- const packageConfigSchema = __WEBPACK_EXTERNAL_MODULE_zod__.z.object({
613
- cjsOutputPattern: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe("Output pattern for CommonJS format, e.g., './dist/cjs/{dir}/{name}.cjs'"),
614
- esmOutputPattern: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe("Output pattern for ESM format, e.g., './dist/esm/{dir}/{name}.js'"),
615
- packageJsonPath: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe("Path to the package.json file, e.g., 'package.json'"),
616
- srcIndexPath: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe("Path to the source index file, e.g., 'src/index.ts'"),
617
- typesOutputCjsPattern: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe("Output pattern for CommonJS type declarations, e.g., './dist/types/{dir}/{name}.d.cts'"),
618
- typesOutputPattern: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe("Output pattern for type declarations, e.g., './dist/types/{dir}/{name}.d.ts'"),
619
- exportPathPrefixesToRemove: __WEBPACK_EXTERNAL_MODULE_zod__.z.array(__WEBPACK_EXTERNAL_MODULE_zod__.z.string()).optional().describe("Prefixes to remove from export paths, e.g., ['components']")
612
+ const packageConfigSchema = z.object({
613
+ cjsOutputPattern: z.string().describe("Output pattern for CommonJS format, e.g., './dist/cjs/{dir}/{name}.cjs'"),
614
+ esmOutputPattern: z.string().describe("Output pattern for ESM format, e.g., './dist/esm/{dir}/{name}.js'"),
615
+ packageJsonPath: z.string().describe("Path to the package.json file, e.g., 'package.json'"),
616
+ srcIndexPath: z.string().describe("Path to the source index file, e.g., 'src/index.ts'"),
617
+ typesOutputCjsPattern: z.string().describe("Output pattern for CommonJS type declarations, e.g., './dist/types/{dir}/{name}.d.cts'"),
618
+ typesOutputPattern: z.string().describe("Output pattern for type declarations, e.g., './dist/types/{dir}/{name}.d.ts'"),
619
+ exportPathPrefixesToRemove: z.array(z.string()).optional().describe("Prefixes to remove from export paths, e.g., ['components']")
620
620
  });
621
- const scriptConfigSchema = __WEBPACK_EXTERNAL_MODULE_zod__.z.object({
622
- customPackageConfigs: __WEBPACK_EXTERNAL_MODULE_zod__.z.record(__WEBPACK_EXTERNAL_MODULE_zod__.z.string(), packageConfigSchema.partial()).describe("Custom configurations for specific packages"),
621
+ const scriptConfigSchema = z.object({
622
+ customPackageConfigs: z.record(z.string(), packageConfigSchema.partial()).describe("Custom configurations for specific packages"),
623
623
  defaultPackageConfig: packageConfigSchema.describe("Default configuration applied to all packages unless overridden"),
624
- packagesGlob: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe("Glob pattern to find package.json files, e.g., './packages/**/package.json'")
624
+ packagesGlob: z.string().describe("Glob pattern to find package.json files, e.g., './packages/**/package.json'")
625
625
  });
626
- __WEBPACK_EXTERNAL_MODULE_zod__.z.object({
627
- directory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe("Directory containing the import, e.g., 'components'"),
628
- exportPath: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe("Resolved export path from the directory, e.g., './button'"),
629
- name: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe("Name of the import, e.g., 'Button'"),
630
- originalPath: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe("Original unresolved path, e.g., './components/button'")
626
+ z.object({
627
+ directory: z.string().describe("Directory containing the import, e.g., 'components'"),
628
+ exportPath: z.string().describe("Resolved export path from the directory, e.g., './button'"),
629
+ name: z.string().describe("Name of the import, e.g., 'Button'"),
630
+ originalPath: z.string().describe("Original unresolved path, e.g., './components/button'")
631
631
  });
632
- const exportConfigSchema = __WEBPACK_EXTERNAL_MODULE_zod__.z.object({
633
- import: __WEBPACK_EXTERNAL_MODULE_zod__.z.object({
634
- default: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe("ESM default export path"),
635
- types: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe("ESM types export path")
632
+ const exportConfigSchema = z.object({
633
+ import: z.object({
634
+ default: z.string().describe("ESM default export path"),
635
+ types: z.string().describe("ESM types export path")
636
636
  }),
637
- require: __WEBPACK_EXTERNAL_MODULE_zod__.z.object({
638
- default: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe("CommonJS default export path"),
639
- types: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe("CommonJS types export path")
637
+ require: z.object({
638
+ default: z.string().describe("CommonJS default export path"),
639
+ types: z.string().describe("CommonJS types export path")
640
640
  })
641
641
  });
642
- const PackageExportsSchema = __WEBPACK_EXTERNAL_MODULE_zod__.z.record(__WEBPACK_EXTERNAL_MODULE_zod__.z.string(), __WEBPACK_EXTERNAL_MODULE_zod__.z.union([
642
+ const PackageExportsSchema = z.record(z.string(), z.union([
643
643
  exportConfigSchema,
644
- __WEBPACK_EXTERNAL_MODULE_zod__.z.string()
644
+ z.string()
645
645
  ]));
646
- const packageJsonSchema = __WEBPACK_EXTERNAL_MODULE_zod__.z.object({
647
- dependencies: __WEBPACK_EXTERNAL_MODULE_zod__.z.record(__WEBPACK_EXTERNAL_MODULE_zod__.z.string(), __WEBPACK_EXTERNAL_MODULE_zod__.z.string()).optional().describe("List of runtime dependencies with their versions"),
648
- devDependencies: __WEBPACK_EXTERNAL_MODULE_zod__.z.record(__WEBPACK_EXTERNAL_MODULE_zod__.z.string(), __WEBPACK_EXTERNAL_MODULE_zod__.z.string()).optional().describe("List of development dependencies with their versions"),
646
+ const packageJsonSchema = z.object({
647
+ dependencies: z.record(z.string(), z.string()).optional().describe("List of runtime dependencies with their versions"),
648
+ devDependencies: z.record(z.string(), z.string()).optional().describe("List of development dependencies with their versions"),
649
649
  exports: PackageExportsSchema.optional().describe("Export mappings for the package"),
650
- name: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe("Name of the package"),
651
- scripts: __WEBPACK_EXTERNAL_MODULE_zod__.z.record(__WEBPACK_EXTERNAL_MODULE_zod__.z.string(), __WEBPACK_EXTERNAL_MODULE_zod__.z.string()).describe("Script commands defined for the package"),
652
- "simple-git-hooks": __WEBPACK_EXTERNAL_MODULE_zod__.z.record(__WEBPACK_EXTERNAL_MODULE_zod__.z.string(), __WEBPACK_EXTERNAL_MODULE_zod__.z.string()).optional().describe("Git hooks configuration for the package"),
653
- version: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().optional().describe("Version of the package")
654
- }).catchall(__WEBPACK_EXTERNAL_MODULE_zod__.z.unknown());
650
+ name: z.string().describe("Name of the package"),
651
+ scripts: z.record(z.string(), z.string()).describe("Script commands defined for the package"),
652
+ "simple-git-hooks": z.record(z.string(), z.string()).optional().describe("Git hooks configuration for the package"),
653
+ version: z.string().optional().describe("Version of the package")
654
+ }).catchall(z.unknown());
655
655
  function node_command_executor_adapter_ts_decorate(decorators, target, key, desc) {
656
656
  var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
657
657
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
@@ -672,7 +672,7 @@ class NodeCommandExecutorAdapter {
672
672
  this.dependencyConfigService = dependencyConfigService;
673
673
  }
674
674
  runCommand(command) {
675
- (0, __WEBPACK_EXTERNAL_MODULE_node_child_process_27f17141__.execSync)(command, {
675
+ execSync(command, {
676
676
  stdio: "inherit"
677
677
  });
678
678
  }
@@ -695,7 +695,7 @@ class NodeCommandExecutorAdapter {
695
695
  cleanupPackages() {
696
696
  console.log(`
697
697
  \u{1F9F9} Cleaning up unnecessary packages...`);
698
- const packageJsonPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(process.cwd(), "package.json");
698
+ const packageJsonPath = external_node_path_default.join(process.cwd(), "package.json");
699
699
  if (!this.fileSystemPort.exists(packageJsonPath)) return void console.warn(`\u{26A0}\u{FE0F} package.json not found, skipping cleanup.`);
700
700
  let packageJson;
701
701
  try {
@@ -727,9 +727,9 @@ class NodeCommandExecutorAdapter {
727
727
  }
728
728
  }
729
729
  NodeCommandExecutorAdapter = node_command_executor_adapter_ts_decorate([
730
- (0, __WEBPACK_EXTERNAL_MODULE_inversify__.injectable)(),
731
- node_command_executor_adapter_ts_param(0, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.FileSystemPort)),
732
- node_command_executor_adapter_ts_param(1, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.DependencyConfigService)),
730
+ injectable(),
731
+ node_command_executor_adapter_ts_param(0, inject(TYPES.FileSystemPort)),
732
+ node_command_executor_adapter_ts_param(1, inject(TYPES.DependencyConfigService)),
733
733
  node_command_executor_adapter_ts_metadata("design:type", Function),
734
734
  node_command_executor_adapter_ts_metadata("design:paramtypes", [
735
735
  "undefined" == typeof FileSystemPort ? Object : FileSystemPort,
@@ -744,29 +744,29 @@ function node_file_system_adapter_ts_decorate(decorators, target, key, desc) {
744
744
  }
745
745
  class NodeFileSystemAdapter {
746
746
  exists(filePath) {
747
- return __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].existsSync(filePath);
747
+ return external_node_fs_default.existsSync(filePath);
748
748
  }
749
749
  access(filePath) {
750
- __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].accessSync(filePath, __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].constants.W_OK);
750
+ external_node_fs_default.accessSync(filePath, external_node_fs_default.constants.W_OK);
751
751
  }
752
752
  readFile(filePath) {
753
753
  try {
754
- return __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].readFileSync(filePath, "utf8");
754
+ return external_node_fs_default.readFileSync(filePath, "utf8");
755
755
  } catch (error) {
756
756
  throw new Error(`Failed to read file ${filePath}: ${error instanceof Error ? error.message : "Unknown error"}`);
757
757
  }
758
758
  }
759
759
  writeFile(filePath, content) {
760
760
  try {
761
- const dir = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].dirname(filePath);
761
+ const dir = external_node_path_default.dirname(filePath);
762
762
  this.createDirectory(dir);
763
- __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].writeFileSync(filePath, content);
763
+ external_node_fs_default.writeFileSync(filePath, content);
764
764
  } catch (error) {
765
765
  throw new Error(`Failed to write to file ${filePath}: ${error instanceof Error ? error.message : "Unknown error"}`);
766
766
  }
767
767
  }
768
768
  createDirectory(dirPath) {
769
- if (!this.exists(dirPath)) __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].mkdirSync(dirPath, {
769
+ if (!this.exists(dirPath)) external_node_fs_default.mkdirSync(dirPath, {
770
770
  recursive: true
771
771
  });
772
772
  }
@@ -781,7 +781,7 @@ class NodeFileSystemAdapter {
781
781
  console.log(`
782
782
  \u{1F4C2} Setting up ${category} configurations:`);
783
783
  for (const config of configs){
784
- const fullPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(projectDir, config.path);
784
+ const fullPath = external_node_path_default.join(projectDir, config.path);
785
785
  this.writeConfigFile(fullPath, config.content);
786
786
  if (config.description) console.log(`\u{2139}\u{FE0F} ${config.path}: ${config.description}`);
787
787
  }
@@ -789,7 +789,7 @@ class NodeFileSystemAdapter {
789
789
  }
790
790
  }
791
791
  NodeFileSystemAdapter = node_file_system_adapter_ts_decorate([
792
- (0, __WEBPACK_EXTERNAL_MODULE_inversify__.injectable)()
792
+ injectable()
793
793
  ], NodeFileSystemAdapter);
794
794
  function node_prompt_adapter_ts_decorate(decorators, target, key, desc) {
795
795
  var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -802,7 +802,7 @@ function node_prompt_adapter_ts_metadata(k, v) {
802
802
  }
803
803
  class NodePromptAdapter {
804
804
  constructor(){
805
- this.rl = __WEBPACK_EXTERNAL_MODULE_node_readline_91c31510__["default"].createInterface({
805
+ this.rl = external_node_readline_default.createInterface({
806
806
  input: process.stdin,
807
807
  output: process.stdout
808
808
  });
@@ -819,7 +819,7 @@ class NodePromptAdapter {
819
819
  }
820
820
  }
821
821
  NodePromptAdapter = node_prompt_adapter_ts_decorate([
822
- (0, __WEBPACK_EXTERNAL_MODULE_inversify__.injectable)(),
822
+ injectable(),
823
823
  node_prompt_adapter_ts_metadata("design:type", Function),
824
824
  node_prompt_adapter_ts_metadata("design:paramtypes", [])
825
825
  ], NodePromptAdapter);
@@ -831,7 +831,7 @@ function ts_morph_analysis_adapter_ts_decorate(decorators, target, key, desc) {
831
831
  }
832
832
  class TsMorphAnalysisAdapter {
833
833
  analyzeImports(indexFilePath, packageConfig) {
834
- const project = new __WEBPACK_EXTERNAL_MODULE_ts_morph_07c7ce60__.Project();
834
+ const project = new Project();
835
835
  let sourceFile;
836
836
  try {
837
837
  sourceFile = project.addSourceFileAtPath(indexFilePath);
@@ -877,7 +877,7 @@ class TsMorphAnalysisAdapter {
877
877
  }
878
878
  }
879
879
  TsMorphAnalysisAdapter = ts_morph_analysis_adapter_ts_decorate([
880
- (0, __WEBPACK_EXTERNAL_MODULE_inversify__.injectable)()
880
+ injectable()
881
881
  ], TsMorphAnalysisAdapter);
882
882
  function file_system_package_repository_ts_decorate(decorators, target, key, desc) {
883
883
  var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -928,12 +928,12 @@ class FileSystemPackageRepository {
928
928
  }
929
929
  async findAllPackages(configPath) {
930
930
  const config = this.getConfig(configPath);
931
- return await (0, __WEBPACK_EXTERNAL_MODULE_glob__.glob)(config.packagesGlob, {
931
+ return await glob(config.packagesGlob, {
932
932
  ignore: this.DEFAULT_IGNORE_PATTERN
933
933
  });
934
934
  }
935
935
  processPackage(packageJsonPath, options) {
936
- const packageDir = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].dirname(packageJsonPath);
936
+ const packageDir = external_node_path_default.dirname(packageJsonPath);
937
937
  let packageJson;
938
938
  try {
939
939
  packageJson = JSON.parse(this.fileSystemPort.readFile(packageJsonPath));
@@ -949,7 +949,7 @@ class FileSystemPackageRepository {
949
949
  console.info(`\u{2662}\u{2012} Processing package: ${packageName}`);
950
950
  const config = this.getConfig(options.configPath);
951
951
  const packageConfig = this.getPackageConfig(packageName, config);
952
- const srcIndexPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(packageDir, packageConfig.srcIndexPath);
952
+ const srcIndexPath = external_node_path_default.join(packageDir, packageConfig.srcIndexPath);
953
953
  if (!this.fileSystemPort.exists(srcIndexPath)) {
954
954
  console.error(`\u{23B9} \u{26D4}\u{FE0E} Source file not found at ${srcIndexPath}`);
955
955
  return false;
@@ -1022,14 +1022,14 @@ class FileSystemPackageRepository {
1022
1022
  getConfig(configPath) {
1023
1023
  if (this.cachedConfig && !configPath) return this.cachedConfig;
1024
1024
  const userConfig = this.loadConfigFile(configPath);
1025
- const config = (0, __WEBPACK_EXTERNAL_MODULE_lodash_es_18c59938__.merge)({}, this.defaultConfig, userConfig);
1025
+ const config = merge({}, this.defaultConfig, userConfig);
1026
1026
  if (!configPath) this.cachedConfig = config;
1027
1027
  return config;
1028
1028
  }
1029
1029
  loadConfigFile(configPath) {
1030
1030
  if (!configPath) return {};
1031
1031
  try {
1032
- const fullPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(configPath);
1032
+ const fullPath = external_node_path_default.resolve(configPath);
1033
1033
  if (!this.fileSystemPort.exists(fullPath)) {
1034
1034
  console.warn(`Configuration file not found at ${fullPath}`);
1035
1035
  return {};
@@ -1053,21 +1053,21 @@ class FileSystemPackageRepository {
1053
1053
  return pattern.replace("{dir}/", dirPart).replace("{dir}", directory).replace("{name}", name);
1054
1054
  }
1055
1055
  saveExportsAnalysis(packageDir, analysis) {
1056
- const outputDir = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(packageDir, ".exports-analysis");
1056
+ const outputDir = external_node_path_default.join(packageDir, ".exports-analysis");
1057
1057
  this.fileSystemPort.createDirectory(outputDir);
1058
- this.fileSystemPort.writeFile(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(outputDir, "exports-analysis.json"), JSON.stringify(analysis, null, 2));
1058
+ this.fileSystemPort.writeFile(external_node_path_default.join(outputDir, "exports-analysis.json"), JSON.stringify(analysis, null, 2));
1059
1059
  }
1060
1060
  saveExportsPreview(packageDir, exports) {
1061
- const outputDir = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(packageDir, ".exports-analysis");
1061
+ const outputDir = external_node_path_default.join(packageDir, ".exports-analysis");
1062
1062
  this.fileSystemPort.createDirectory(outputDir);
1063
- this.fileSystemPort.writeFile(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(outputDir, "exports-preview.json"), JSON.stringify(exports, null, 2));
1063
+ this.fileSystemPort.writeFile(external_node_path_default.join(outputDir, "exports-preview.json"), JSON.stringify(exports, null, 2));
1064
1064
  }
1065
1065
  }
1066
1066
  FileSystemPackageRepository = file_system_package_repository_ts_decorate([
1067
- (0, __WEBPACK_EXTERNAL_MODULE_inversify__.injectable)(),
1068
- file_system_package_repository_ts_param(0, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.FileSystemPort)),
1069
- file_system_package_repository_ts_param(1, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.AnalysisPort)),
1070
- file_system_package_repository_ts_param(2, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.FileSystemUtility)),
1067
+ injectable(),
1068
+ file_system_package_repository_ts_param(0, inject(TYPES.FileSystemPort)),
1069
+ file_system_package_repository_ts_param(1, inject(TYPES.AnalysisPort)),
1070
+ file_system_package_repository_ts_param(2, inject(TYPES.FileSystemUtility)),
1071
1071
  file_system_package_repository_ts_metadata("design:type", Function),
1072
1072
  file_system_package_repository_ts_metadata("design:paramtypes", [
1073
1073
  "undefined" == typeof FileSystemPort ? Object : FileSystemPort,
@@ -1075,16 +1075,16 @@ FileSystemPackageRepository = file_system_package_repository_ts_decorate([
1075
1075
  "undefined" == typeof FileSystemUtility ? Object : FileSystemUtility
1076
1076
  ])
1077
1077
  ], FileSystemPackageRepository);
1078
- const projectSchema = __WEBPACK_EXTERNAL_MODULE_zod__.z.object({
1079
- name: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().min(1, "Project name cannot be empty").max(100, "Project name is too long (maximum 100 characters)").regex(/^[a-z0-9-~][a-z0-9-._~]*$/, {
1078
+ const projectSchema = z.object({
1079
+ name: z.string().min(1, "Project name cannot be empty").max(100, "Project name is too long (maximum 100 characters)").regex(/^[a-z0-9-~][a-z0-9-._~]*$/, {
1080
1080
  message: "Project name must be URL-friendly (letters, numbers, hyphens, underscores, dots; no @ or scoped packages)"
1081
1081
  }).refine((name)=>"." !== name && ".." !== name, {
1082
1082
  message: "Project name cannot be '.' or '..'"
1083
1083
  }).refine((name)=>!/^(?<reserved>CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])$/i.test(name), {
1084
1084
  message: "Project name is a reserved system name"
1085
1085
  }),
1086
- directory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe("Project directory path"),
1087
- packageJsonExists: __WEBPACK_EXTERNAL_MODULE_zod__.z.boolean().describe("Whether package.json exists in the project directory")
1086
+ directory: z.string().describe("Project directory path"),
1087
+ packageJsonExists: z.boolean().describe("Whether package.json exists in the project directory")
1088
1088
  });
1089
1089
  function file_system_project_repository_ts_decorate(decorators, target, key, desc) {
1090
1090
  var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -1110,14 +1110,14 @@ class FileSystemProjectRepository {
1110
1110
  async checkExistingProject(projectName) {
1111
1111
  let fullPath = process.cwd();
1112
1112
  let name = "";
1113
- const packageJsonPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(process.cwd(), "package.json");
1113
+ const packageJsonPath = external_node_path_default.join(process.cwd(), "package.json");
1114
1114
  const packageJsonExists = this.fileSystemPort.exists(packageJsonPath);
1115
1115
  if (packageJsonExists) {
1116
1116
  const result = packageJsonSchema.safeParse(JSON.parse(this.fileSystemPort.readFile(packageJsonPath)));
1117
1117
  if (result.success) name = result.data.name;
1118
1118
  } else {
1119
1119
  name = await this.getValidProjectName(projectName);
1120
- fullPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(process.cwd(), name);
1120
+ fullPath = external_node_path_default.resolve(process.cwd(), name);
1121
1121
  }
1122
1122
  return {
1123
1123
  name,
@@ -1130,7 +1130,7 @@ class FileSystemProjectRepository {
1130
1130
  this.commandExecutorPort.runCommand(`npx create-next-app@latest ${projectName} ${flags}`);
1131
1131
  }
1132
1132
  updateLayoutFile(projectDir) {
1133
- const layoutPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(projectDir, "src", "app", "layout.tsx");
1133
+ const layoutPath = external_node_path_default.join(projectDir, "src", "app", "layout.tsx");
1134
1134
  const htmlTarget = '<html className={cn(fontVariables, "antialiased")} lang="en">';
1135
1135
  this.fileSystemUtility.updateFileIfNeeded(layoutPath, (content)=>content.includes(htmlTarget), (content)=>{
1136
1136
  const newImports = `import type { Metadata } from "next";
@@ -1149,7 +1149,7 @@ import "@/app/globals.css";`;
1149
1149
  });
1150
1150
  }
1151
1151
  updatePageFile(projectDir) {
1152
- const pagePath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(projectDir, "src", "app", "page.tsx");
1152
+ const pagePath = external_node_path_default.join(projectDir, "src", "app", "page.tsx");
1153
1153
  this.fileSystemUtility.updateFileIfNeeded(pagePath, (content)=>content.includes("): JSX.Element"), (content)=>{
1154
1154
  let result = content;
1155
1155
  if (!result.includes("import type { JSX }")) result = result.includes("import type {") ? result.replace(/import type {(?<types>[^}]+)} from "react";/, 'import type {$1, JSX } from "react";') : result.includes("import {") ? result.replace(/import {/, 'import type { JSX } from "react";\n\nimport {') : `import type { JSX } from "react";\n\n${result}`;
@@ -1158,12 +1158,12 @@ import "@/app/globals.css";`;
1158
1158
  });
1159
1159
  }
1160
1160
  updatePostcssConfig(projectDir) {
1161
- const postcssConfigPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(projectDir, "postcss.config.mjs");
1161
+ const postcssConfigPath = external_node_path_default.join(projectDir, "postcss.config.mjs");
1162
1162
  const typeComment = `/** @type {import('postcss-load-config').Config} */\n`;
1163
1163
  this.fileSystemUtility.updateFileIfNeeded(postcssConfigPath, (content)=>content.includes(typeComment), (content)=>content.replace("const config = {", `${typeComment}const config = {`));
1164
1164
  }
1165
1165
  updateNextConfig(projectDir) {
1166
- const nextConfigPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(projectDir, "next.config.ts");
1166
+ const nextConfigPath = external_node_path_default.join(projectDir, "next.config.ts");
1167
1167
  const optimizePackagesConfig = 'optimizePackageImports: ["@codefast/ui"]';
1168
1168
  this.fileSystemUtility.updateFileIfNeeded(nextConfigPath, (content)=>content.includes(optimizePackagesConfig), (content)=>content.replace(/const nextConfig: NextConfig = \{/, `const nextConfig: NextConfig = {
1169
1169
  experimental: {
@@ -1171,7 +1171,7 @@ import "@/app/globals.css";`;
1171
1171
  },`));
1172
1172
  }
1173
1173
  updatePackageJson(projectDir) {
1174
- const packageJsonPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(projectDir, "package.json");
1174
+ const packageJsonPath = external_node_path_default.join(projectDir, "package.json");
1175
1175
  if (!this.fileSystemPort.exists(packageJsonPath)) return void console.warn(`\u{26A0}\u{FE0F} package.json not found, skipping update.`);
1176
1176
  let packageJson;
1177
1177
  try {
@@ -1209,7 +1209,7 @@ import "@/app/globals.css";`;
1209
1209
  packageJsonExists: false
1210
1210
  });
1211
1211
  if (result.success) {
1212
- const fullPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(process.cwd(), projectName);
1212
+ const fullPath = external_node_path_default.resolve(process.cwd(), projectName);
1213
1213
  if (this.fileSystemPort.exists(fullPath)) throw new Error(`A directory named "${projectName}" already exists.`);
1214
1214
  try {
1215
1215
  this.fileSystemPort.access(process.cwd());
@@ -1224,11 +1224,11 @@ import "@/app/globals.css";`;
1224
1224
  }
1225
1225
  }
1226
1226
  FileSystemProjectRepository = file_system_project_repository_ts_decorate([
1227
- (0, __WEBPACK_EXTERNAL_MODULE_inversify__.injectable)(),
1228
- file_system_project_repository_ts_param(0, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.FileSystemPort)),
1229
- file_system_project_repository_ts_param(1, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.CommandExecutorPort)),
1230
- file_system_project_repository_ts_param(2, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.PromptPort)),
1231
- file_system_project_repository_ts_param(3, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.FileSystemUtility)),
1227
+ injectable(),
1228
+ file_system_project_repository_ts_param(0, inject(TYPES.FileSystemPort)),
1229
+ file_system_project_repository_ts_param(1, inject(TYPES.CommandExecutorPort)),
1230
+ file_system_project_repository_ts_param(2, inject(TYPES.PromptPort)),
1231
+ file_system_project_repository_ts_param(3, inject(TYPES.FileSystemUtility)),
1232
1232
  file_system_project_repository_ts_metadata("design:type", Function),
1233
1233
  file_system_project_repository_ts_metadata("design:paramtypes", [
1234
1234
  "undefined" == typeof FileSystemPort ? Object : FileSystemPort,
@@ -1289,7 +1289,7 @@ class DependencyConfigService {
1289
1289
  }
1290
1290
  }
1291
1291
  DependencyConfigService = dependency_config_service_ts_decorate([
1292
- (0, __WEBPACK_EXTERNAL_MODULE_inversify__.injectable)()
1292
+ injectable()
1293
1293
  ], DependencyConfigService);
1294
1294
  function node_package_info_service_ts_decorate(decorators, target, key, desc) {
1295
1295
  var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -1311,9 +1311,9 @@ class NodePackageInfoService {
1311
1311
  }
1312
1312
  getPackageVersion() {
1313
1313
  try {
1314
- const __filename = (0, __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__.fileURLToPath)(import.meta.url);
1315
- const __dirname = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].dirname(__filename);
1316
- const packageJsonPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(__dirname, "..", "package.json");
1314
+ const __filename = fileURLToPath(import.meta.url);
1315
+ const __dirname = external_node_path_default.dirname(__filename);
1316
+ const packageJsonPath = external_node_path_default.resolve(__dirname, "..", "package.json");
1317
1317
  const packageJsonResult = packageJsonSchema.parse(JSON.parse(this.fileSystemPort.readFile(packageJsonPath)));
1318
1318
  return packageJsonResult.version ?? "0.0.0";
1319
1319
  } catch (error) {
@@ -1323,8 +1323,8 @@ class NodePackageInfoService {
1323
1323
  }
1324
1324
  }
1325
1325
  NodePackageInfoService = node_package_info_service_ts_decorate([
1326
- (0, __WEBPACK_EXTERNAL_MODULE_inversify__.injectable)(),
1327
- node_package_info_service_ts_param(0, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.FileSystemPort)),
1326
+ injectable(),
1327
+ node_package_info_service_ts_param(0, inject(TYPES.FileSystemPort)),
1328
1328
  node_package_info_service_ts_metadata("design:type", Function),
1329
1329
  node_package_info_service_ts_metadata("design:paramtypes", [
1330
1330
  "undefined" == typeof FileSystemPort ? Object : FileSystemPort
@@ -1363,10 +1363,10 @@ class file_system_utility_FileSystemUtility {
1363
1363
  backupFile(filePath, backupDir) {
1364
1364
  try {
1365
1365
  const content = this.fileSystemPort.readFile(filePath);
1366
- const baseName = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].basename(filePath);
1366
+ const baseName = external_node_path_default.basename(filePath);
1367
1367
  const timestamp = new Date().toISOString().replaceAll(/[:.]/g, "-");
1368
- const backupPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].dirname(filePath), backupDir, `${baseName}.backup.${timestamp}`);
1369
- this.fileSystemPort.createDirectory(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].dirname(backupPath));
1368
+ const backupPath = external_node_path_default.join(external_node_path_default.dirname(filePath), backupDir, `${baseName}.backup.${timestamp}`);
1369
+ this.fileSystemPort.createDirectory(external_node_path_default.dirname(backupPath));
1370
1370
  this.fileSystemPort.writeFile(backupPath, content);
1371
1371
  } catch (error) {
1372
1372
  console.error(`Error backing up ${filePath}: ${error instanceof Error ? error.message : "Unknown error"}`);
@@ -1374,14 +1374,14 @@ class file_system_utility_FileSystemUtility {
1374
1374
  }
1375
1375
  }
1376
1376
  file_system_utility_FileSystemUtility = file_system_utility_ts_decorate([
1377
- (0, __WEBPACK_EXTERNAL_MODULE_inversify__.injectable)(),
1378
- file_system_utility_ts_param(0, (0, __WEBPACK_EXTERNAL_MODULE_inversify__.inject)(TYPES.FileSystemPort)),
1377
+ injectable(),
1378
+ file_system_utility_ts_param(0, inject(TYPES.FileSystemPort)),
1379
1379
  file_system_utility_ts_metadata("design:type", Function),
1380
1380
  file_system_utility_ts_metadata("design:paramtypes", [
1381
1381
  "undefined" == typeof FileSystemPort ? Object : FileSystemPort
1382
1382
  ])
1383
1383
  ], file_system_utility_FileSystemUtility);
1384
- const container = new __WEBPACK_EXTERNAL_MODULE_inversify__.Container();
1384
+ const container = new Container();
1385
1385
  container.bind(TYPES.ProjectRepository).to(FileSystemProjectRepository).inSingletonScope();
1386
1386
  container.bind(TYPES.PackageRepository).to(FileSystemPackageRepository).inSingletonScope();
1387
1387
  container.bind(TYPES.PackageInfoService).to(NodePackageInfoService).inSingletonScope();