@kodus/cli 0.0.6 → 0.0.8

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/index.js CHANGED
@@ -6,7 +6,7 @@ import { dirname, join } from 'path';
6
6
  import { setupEnvironment } from './src/commands/install.js';
7
7
 
8
8
  // CLI version
9
- program.version("0.0.5");
9
+ program.version("0.0.8");
10
10
 
11
11
  // Install command
12
12
  program
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kodus/cli",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "CLI tool for Kodus installation and management",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -20,7 +20,12 @@
20
20
  "scripts": {
21
21
  "test": "echo \"Error: no test specified\" && exit 1"
22
22
  },
23
- "keywords": ["kodus", "cli", "installation", "deployment"],
23
+ "keywords": [
24
+ "kodus",
25
+ "cli",
26
+ "installation",
27
+ "deployment"
28
+ ],
24
29
  "author": "Kodus",
25
30
  "license": "ISC",
26
31
  "repository": {
@@ -20,8 +20,32 @@ export const generateDbPassword = () =>
20
20
  .slice(0, 16);
21
21
 
22
22
  export const copyTemplates = (targetDir) => {
23
- const templatesDir = path.join(__dirname, '../../templates');
24
- fs.copySync(path.join(templatesDir, 'docker-compose.yml'), path.join(targetDir, 'docker-compose.yml'));
23
+ try {
24
+ const moduleDir = dirname(dirname(dirname(__filename))); // Sobe 3 níveis: utils -> src -> root
25
+ const templatesDir = path.join(moduleDir, 'templates');
26
+
27
+ if (!fs.existsSync(templatesDir)) {
28
+ console.error(chalk.red(`Templates directory not found at: ${templatesDir}`));
29
+ console.error(chalk.yellow('Current directory structure:'));
30
+ console.error(chalk.white(fs.readdirSync(moduleDir)));
31
+ throw new Error('Templates directory not found');
32
+ }
33
+
34
+ const sourceFile = path.join(templatesDir, 'docker-compose.yml');
35
+ const targetFile = path.join(targetDir, 'docker-compose.yml');
36
+
37
+ if (!fs.existsSync(sourceFile)) {
38
+ console.error(chalk.red(`Template file not found at: ${sourceFile}`));
39
+ console.error(chalk.yellow('Files in templates directory:'));
40
+ console.error(chalk.white(fs.readdirSync(templatesDir)));
41
+ throw new Error('Template file not found');
42
+ }
43
+
44
+ fs.copySync(sourceFile, targetFile);
45
+ } catch (error) {
46
+ console.error(chalk.red('Error copying templates:'), error);
47
+ throw error;
48
+ }
25
49
  };
26
50
 
27
51
  export const backupEnv = () => {
@@ -34,22 +34,6 @@ services:
34
34
  env_file:
35
35
  - .env
36
36
 
37
- rabbitmq:
38
- image: localhost:5000/rabbitmq:prod
39
- container_name: rabbitmq-prod
40
- hostname: rabbitmq
41
- ports:
42
- - "5672:5672"
43
- - "15672:15672"
44
- networks:
45
- - monitoring-network
46
- - shared-network
47
- environment:
48
- - RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbit heartbeat 60
49
- restart: unless-stopped
50
- env_file:
51
- - .env
52
-
53
37
  db_kodus_postgres:
54
38
  image: postgres:latest
55
39
  container_name: db_kodus_postgres