@actuate-media/cli 0.4.0 → 0.4.2

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.
Files changed (79) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-test.log +21 -10
  3. package/CHANGELOG.md +34 -0
  4. package/dist/__tests__/deployment-diagnostics.test.js +40 -0
  5. package/dist/__tests__/deployment-diagnostics.test.js.map +1 -1
  6. package/dist/__tests__/init.test.js.map +1 -1
  7. package/dist/__tests__/schema-fragment.test.js +1 -1
  8. package/dist/__tests__/schema-fragment.test.js.map +1 -1
  9. package/dist/__tests__/seed.test.js.map +1 -1
  10. package/dist/commands/db-init.d.ts +2 -2
  11. package/dist/commands/db-init.d.ts.map +1 -1
  12. package/dist/commands/db-init.js +32 -32
  13. package/dist/commands/db-init.js.map +1 -1
  14. package/dist/commands/db-status.d.ts +1 -1
  15. package/dist/commands/db-status.d.ts.map +1 -1
  16. package/dist/commands/db-status.js +33 -33
  17. package/dist/commands/db-status.js.map +1 -1
  18. package/dist/commands/doctor.d.ts +1 -1
  19. package/dist/commands/doctor.d.ts.map +1 -1
  20. package/dist/commands/doctor.js +55 -38
  21. package/dist/commands/doctor.js.map +1 -1
  22. package/dist/commands/export.d.ts +1 -1
  23. package/dist/commands/export.d.ts.map +1 -1
  24. package/dist/commands/export.js +32 -32
  25. package/dist/commands/export.js.map +1 -1
  26. package/dist/commands/generate.d.ts +1 -1
  27. package/dist/commands/generate.d.ts.map +1 -1
  28. package/dist/commands/generate.js +8 -8
  29. package/dist/commands/generate.js.map +1 -1
  30. package/dist/commands/import.d.ts +1 -1
  31. package/dist/commands/import.d.ts.map +1 -1
  32. package/dist/commands/import.js +55 -58
  33. package/dist/commands/import.js.map +1 -1
  34. package/dist/commands/init.d.ts.map +1 -1
  35. package/dist/commands/init.js.map +1 -1
  36. package/dist/commands/migrate.d.ts +1 -1
  37. package/dist/commands/migrate.d.ts.map +1 -1
  38. package/dist/commands/migrate.js +18 -24
  39. package/dist/commands/migrate.js.map +1 -1
  40. package/dist/commands/seed.d.ts +1 -1
  41. package/dist/commands/seed.d.ts.map +1 -1
  42. package/dist/commands/seed.js +156 -157
  43. package/dist/commands/seed.js.map +1 -1
  44. package/dist/commands/update-check.d.ts +1 -1
  45. package/dist/commands/update-check.d.ts.map +1 -1
  46. package/dist/commands/update-check.js +34 -27
  47. package/dist/commands/update-check.js.map +1 -1
  48. package/dist/commands/upgrade.d.ts +1 -1
  49. package/dist/commands/upgrade.d.ts.map +1 -1
  50. package/dist/commands/upgrade.js +41 -34
  51. package/dist/commands/upgrade.js.map +1 -1
  52. package/dist/deployment/diagnostics.d.ts +2 -0
  53. package/dist/deployment/diagnostics.d.ts.map +1 -1
  54. package/dist/deployment/diagnostics.js +50 -1
  55. package/dist/deployment/diagnostics.js.map +1 -1
  56. package/dist/index.js +15 -15
  57. package/dist/index.js.map +1 -1
  58. package/dist/utils/logger.d.ts.map +1 -1
  59. package/dist/utils/logger.js +5 -5
  60. package/dist/utils/logger.js.map +1 -1
  61. package/package.json +3 -3
  62. package/src/__tests__/deployment-diagnostics.test.ts +100 -50
  63. package/src/__tests__/init.test.ts +17 -17
  64. package/src/__tests__/schema-fragment.test.ts +29 -25
  65. package/src/__tests__/seed.test.ts +25 -25
  66. package/src/commands/db-init.ts +59 -59
  67. package/src/commands/db-status.ts +70 -68
  68. package/src/commands/doctor.ts +110 -86
  69. package/src/commands/export.ts +65 -75
  70. package/src/commands/generate.ts +14 -16
  71. package/src/commands/import.ts +125 -140
  72. package/src/commands/init.ts +14 -14
  73. package/src/commands/migrate.ts +29 -35
  74. package/src/commands/seed.ts +294 -300
  75. package/src/commands/update-check.ts +77 -72
  76. package/src/commands/upgrade.ts +92 -85
  77. package/src/deployment/diagnostics.ts +124 -61
  78. package/src/index.ts +30 -30
  79. package/src/utils/logger.ts +10 -10
@@ -1,62 +1,56 @@
1
- import { Command } from "commander";
2
- import { execSync, type ExecSyncOptions } from "node:child_process";
3
- import ora from "ora";
4
- import { logger } from "../utils/logger.js";
1
+ import { Command } from 'commander'
2
+ import { execSync, type ExecSyncOptions } from 'node:child_process'
3
+ import ora from 'ora'
4
+ import { logger } from '../utils/logger.js'
5
5
 
6
- const execOpts: ExecSyncOptions = { stdio: "inherit", cwd: process.cwd() };
6
+ const execOpts: ExecSyncOptions = { stdio: 'inherit', cwd: process.cwd() }
7
7
 
8
8
  function runPendingMigrations(): void {
9
- const spinner = ora("Running pending migrations…").start();
9
+ const spinner = ora('Running pending migrations…').start()
10
10
  try {
11
- spinner.stop();
12
- execSync("npx prisma migrate deploy", execOpts);
13
- logger.success("All pending migrations applied.");
11
+ spinner.stop()
12
+ execSync('npx prisma migrate deploy', execOpts)
13
+ logger.success('All pending migrations applied.')
14
14
  } catch {
15
- spinner.fail("Migration run failed.");
16
- process.exitCode = 1;
15
+ spinner.fail('Migration run failed.')
16
+ process.exitCode = 1
17
17
  }
18
18
  }
19
19
 
20
20
  function createMigration(name: string): void {
21
- const spinner = ora(`Creating migration "${name}"…`).start();
21
+ const spinner = ora(`Creating migration "${name}"…`).start()
22
22
  try {
23
- spinner.stop();
24
- execSync(`npx prisma migrate dev --name ${name}`, execOpts);
25
- logger.success(`Migration "${name}" created.`);
23
+ spinner.stop()
24
+ execSync(`npx prisma migrate dev --name ${name}`, execOpts)
25
+ logger.success(`Migration "${name}" created.`)
26
26
  } catch {
27
- spinner.fail("Migration creation failed.");
28
- process.exitCode = 1;
27
+ spinner.fail('Migration creation failed.')
28
+ process.exitCode = 1
29
29
  }
30
30
  }
31
31
 
32
32
  function showMigrationStatus(): void {
33
- const spinner = ora("Checking migration status…").start();
33
+ const spinner = ora('Checking migration status…').start()
34
34
  try {
35
- spinner.stop();
36
- execSync("npx prisma migrate status", execOpts);
35
+ spinner.stop()
36
+ execSync('npx prisma migrate status', execOpts)
37
37
  } catch {
38
- spinner.fail("Could not retrieve migration status.");
39
- process.exitCode = 1;
38
+ spinner.fail('Could not retrieve migration status.')
39
+ process.exitCode = 1
40
40
  }
41
41
  }
42
42
 
43
43
  export function registerMigrateCommand(program: Command): void {
44
44
  const migrate = program
45
- .command("migrate")
46
- .description("Database migration utilities powered by Prisma");
45
+ .command('migrate')
46
+ .description('Database migration utilities powered by Prisma')
47
47
 
48
- migrate
49
- .command("run")
50
- .description("Apply all pending migrations")
51
- .action(runPendingMigrations);
48
+ migrate.command('run').description('Apply all pending migrations').action(runPendingMigrations)
52
49
 
53
50
  migrate
54
- .command("create <name>")
55
- .description("Create a new migration with the given name")
56
- .action(createMigration);
51
+ .command('create <name>')
52
+ .description('Create a new migration with the given name')
53
+ .action(createMigration)
57
54
 
58
- migrate
59
- .command("status")
60
- .description("Show current migration status")
61
- .action(showMigrationStatus);
55
+ migrate.command('status').description('Show current migration status').action(showMigrationStatus)
62
56
  }