@payfit/iac 1.0.0-ephemeral-migration-scripts.10 → 1.0.0-ephemeral-release-rerun.0

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 (37) hide show
  1. package/README.md +14 -87
  2. package/dist/executors/stack-migration/README.md +69 -115
  3. package/dist/executors/stack-migration/lib/constants.d.ts +1 -1
  4. package/dist/executors/stack-migration/lib/constants.js +1 -1
  5. package/dist/executors/stack-migration/lib/constants.js.map +1 -1
  6. package/dist/executors/stack-migration/lib/logger.d.ts +1 -0
  7. package/dist/executors/stack-migration/lib/logger.js +15 -16
  8. package/dist/executors/stack-migration/lib/logger.js.map +1 -1
  9. package/dist/executors/stack-migration/lib/migration-helper.d.ts +7 -5
  10. package/dist/executors/stack-migration/lib/migration-helper.js +81 -36
  11. package/dist/executors/stack-migration/lib/migration-helper.js.map +1 -1
  12. package/dist/executors/stack-migration/lib/migration-tool.d.ts +18 -13
  13. package/dist/executors/stack-migration/lib/migration-tool.js +365 -404
  14. package/dist/executors/stack-migration/lib/migration-tool.js.map +1 -1
  15. package/dist/executors/stack-migration/lib/templates/index.d.ts +1 -0
  16. package/dist/executors/stack-migration/lib/templates/index.js +1 -0
  17. package/dist/executors/stack-migration/lib/templates/index.js.map +1 -1
  18. package/dist/executors/stack-migration/lib/templates/mermaid-diagram.d.ts +13 -0
  19. package/dist/executors/stack-migration/lib/templates/mermaid-diagram.js +45 -0
  20. package/dist/executors/stack-migration/lib/templates/mermaid-diagram.js.map +1 -0
  21. package/dist/executors/stack-migration/lib/templates/message-templates.d.ts +11 -20
  22. package/dist/executors/stack-migration/lib/templates/message-templates.js +28 -93
  23. package/dist/executors/stack-migration/lib/templates/message-templates.js.map +1 -1
  24. package/dist/executors/stack-migration/lib/templates/pr-templates.d.ts +16 -5
  25. package/dist/executors/stack-migration/lib/templates/pr-templates.js +81 -72
  26. package/dist/executors/stack-migration/lib/templates/pr-templates.js.map +1 -1
  27. package/dist/executors/stack-migration/lib/templates/procedure-template.d.ts +1 -0
  28. package/dist/executors/stack-migration/lib/templates/procedure-template.js +36 -118
  29. package/dist/executors/stack-migration/lib/templates/procedure-template.js.map +1 -1
  30. package/dist/executors/stack-migration/lib/types.d.ts +7 -0
  31. package/dist/executors/stack-migration/schema.d.ts +4 -4
  32. package/dist/executors/stack-migration/schema.json +7 -4
  33. package/dist/executors/stack-migration/stack-migration.js +10 -10
  34. package/dist/executors/stack-migration/stack-migration.js.map +1 -1
  35. package/dist/index.js +4 -7
  36. package/dist/index.js.map +1 -1
  37. package/package.json +3 -3
package/README.md CHANGED
@@ -1,104 +1,31 @@
1
1
  # @payfit/iac
2
2
 
3
- A Nx plugin that provides executors for infrastructure as code operations
3
+ Nx plugin for infrastructure as code operations.
4
4
 
5
5
  ## Installation
6
6
 
7
- ```shell
7
+ ```bash
8
8
  npx nx add @payfit/iac
9
9
  ```
10
10
 
11
- ## Usage
12
-
13
- ### Stack Migration Executor
11
+ ## Executors
14
12
 
15
- The stack migration executor automates the process of migrating Spacelift stacks from a centralized iac-deploy repository to repository-level metastacks with autodiscovery.
13
+ ### Stack Migration
16
14
 
17
- #### Quick Start
15
+ Migrate Spacelift stacks from iac-deploy to repository-level metastacks.
18
16
 
19
17
  ```bash
20
- # Run the complete migration workflow
21
- npx nx run <project>:stack-migration --command=run
22
-
23
- # Run in dry-run mode to preview changes
24
- npx nx run <project>:stack-migration --command=run --dryRun
18
+ nx run <project>:stack-migration --command=run
25
19
  ```
26
20
 
27
- #### Migration Workflow
28
-
29
- The migration process consists of several phases:
30
-
31
- 1. **Initialization**: Clone repositories and collect configuration
32
-
33
- ```bash
34
- npx nx run <project>:stack-migration --command=init
35
- ```
36
-
37
- 2. **Domain Enrollment**: Create PR to enroll repository in domain
38
-
39
- ```bash
40
- npx nx run <project>:stack-migration --command=enroll
41
- ```
42
-
43
- 3. **Generate Migration Files**: Create service repository PR with import configuration
44
-
45
- ```bash
46
- npx nx run <project>:stack-migration --command=generate-tf-migration
47
- ```
48
-
49
- 4. **Cleanup**: Create PR to remove old stack configuration
50
-
51
- ```bash
52
- npx nx run <project>:stack-migration --command=cleanup-pr
53
- ```
54
-
55
- 5. **Generate Documentation**: Create migration procedure document
56
-
57
- ```bash
58
- npx nx run <project>:stack-migration --command=generate-procedure
59
- ```
21
+ See [Stack Migration README](./src/executors/stack-migration/README.md) for detailed documentation.
60
22
 
61
- 6. **Migrate Spaces** (Manual step): Move stacks to domain space
23
+ ## Development
62
24
 
63
- ```bash
64
- npx nx run <project>:stack-migration --command=migrate-spaces
65
- ```
66
-
67
- 7. **Cleanup Migration Files**: Remove temporary migration files
68
- ```bash
69
- npx nx run <project>:stack-migration --command=migration-cleanup
70
- ```
71
-
72
- #### Configuration
73
-
74
- Once installed, the executor should be automatically inferred from your root project.
75
-
76
- #### Available Commands
77
-
78
- - `init` - Initialize migration by cloning repositories and collecting configuration
79
- - `state` - Check current migration state
80
- - `enroll` - Create domain enrollment PR
81
- - `generate-tf-migration` - Generate service repository PR and state removal commands
82
- - `cleanup-pr` - Create cleanup PR for iac-deploy
83
- - `generate-procedure` - Generate migration procedure documentation
84
- - `migrate-spaces` - Update stack spaces (manual step, run after state removal)
85
- - `migration-cleanup` - Clean up migration files after completion
86
- - `run` - Execute complete migration workflow (excludes migrate-spaces for safety)
87
- - `help` - Display help information
88
-
89
- #### Important Notes
90
-
91
- - The migration state is saved in `.migration-state.json` and can be resumed from any step
92
- - The `migrate-spaces` command must be run manually after executing state removal commands
93
- - Follow the recommended order: enrollment → migration files → state removal → space migration → cleanup
94
- - Always review PRs before merging them
95
-
96
- ---
97
-
98
- ## Building
99
-
100
- Run `npx nx build iac` to build the library.
101
-
102
- ## Running unit tests
25
+ ```bash
26
+ # Build
27
+ npx nx build iac
103
28
 
104
- Run `npx nx test iac` to execute the unit tests via [Vitest](https://vitest.dev/).
29
+ # Test
30
+ npx nx test iac
31
+ ```
@@ -1,125 +1,79 @@
1
1
  # Stack Migration Executor
2
2
 
3
- NX executor for migrating Spacelift stacks from centralized iac-deploy to repository-level metastacks.
4
-
5
- ## Overview
6
-
7
- This tool automates the migration of Spacelift stacks to the new metastack architecture. It creates necessary PRs, generates import files, and manages state removal.
8
-
9
- ## Commands
10
-
11
- ### Complete Workflow
12
-
13
- ```bash
14
- # Run the full migration (recommended for first-time users)
15
- nx run <project>:stack-migration --command=run
16
-
17
- # Run in dry-run mode to preview changes
18
- nx run <project>:stack-migration --command=run --dryRun
3
+ Migrate Spacelift stacks from iac-deploy to repository-level metastacks.
4
+
5
+ ## Migration Flow
6
+
7
+ ```mermaid
8
+ flowchart TD
9
+ subgraph Phase1["📦 1: Setup"]
10
+ A[init] --> B[Create PRs + Scripts]
11
+ end
12
+
13
+ subgraph Phase2["🔒 2: Safety & Enrollment"]
14
+ B --> C[Merge Safety Net PR]
15
+ C --> D[Merge Domain Enrollment PR]
16
+ end
17
+
18
+ subgraph Phase3["🧹 3: State Management"]
19
+ D --> E[Run State Removal]
20
+ E --> F[Merge iac-deploy Cleanup PR]
21
+ end
22
+
23
+ subgraph Phase4["✅ 4: Complete"]
24
+ F --> G[Merge Service Repo PR]
25
+ G --> H[Run Cleanup]
26
+ H --> I[Merge Post-Migration Cleanup PR]
27
+ end
19
28
  ```
20
29
 
21
- ### Individual Steps
22
-
23
- You can also run each step independently. This is useful if you need to pause the migration or re-run specific steps.
30
+ ## Quick Start
24
31
 
25
32
  ```bash
26
- # 1. Initialize migration (clone repos, collect info)
27
- nx run <project>:stack-migration --command=init
28
-
29
- # 2. Check migration state
30
- nx run <project>:stack-migration --command=state
31
-
32
- # 3. Create domain enrollment PR
33
- nx run <project>:stack-migration --command=enroll
34
-
35
- # 4. Create service repository PR and generate state removal commands
36
- nx run <project>:stack-migration --command=generate-tf-migration
37
-
38
- # 5. Create cleanup PR (iac-deploy)
39
- nx run <project>:stack-migration --command=cleanup-pr
40
-
41
- # 6. Generate migration procedure documentation
42
- nx run <project>:stack-migration --command=generate-procedure
43
-
44
- # 7. Update stack spaces (move to domain space) - RUN MANUALLY ONLY
45
- nx run <project>:stack-migration --command=migrate-spaces
33
+ # Full migration (recommended)
34
+ nx run <project>:stack-migration --command=run
46
35
 
47
- # 8. Clean up migration files
48
- nx run <project>:stack-migration --command=migration-cleanup
36
+ # Preview changes first
37
+ nx run <project>:stack-migration --command=run --dry-run
49
38
  ```
50
39
 
51
- ## Migration Flow and Dependencies
52
-
53
- The migration follows a specific sequence. Here's the required flow:
54
-
55
- ### Phase 1: Setup and Configuration
56
-
57
- 1. **init** - Clones required repos, validates auth, collects service info
58
- - Creates `.migration-state.json` to track progress
59
- - Clones: `domain-enrollment`, `iac-deploy`
60
- - Loads stack configuration
61
-
62
- ### Phase 2: Safety and Enrollment
63
-
64
- 2. **enroll** - Creates domain enrollment PR
65
- - Adds repository to domain's `spacelift.yaml`
66
- - PR must be merged before continuing
67
- - Deploys the metastack for your repository
68
-
69
- 3. **generate-tf-migration** - Creates service repository PR and state removal script
70
- - Copies `spacelift.yaml` from iac-deploy
71
- - Generates `.metastack/import.tf` with import blocks
72
- - Generates `METASTACK_STATE_REMOVAL_COMMANDS.sh`
73
- - DO NOT MERGE THIS PR YET
74
-
75
- ### Phase 3: Cleanup and State Management
76
-
77
- 4. **cleanup-pr** - Creates cleanup PR
78
- - iac-deploy: Removes stack configuration file
79
- - DO NOT MERGE THIS PR YET
80
-
81
- 5. **generate-procedure** - Generates migration documentation
82
- - Creates `METASTACK_MIGRATION_PROCEDURE.md`
83
- - Provides complete overview of migration steps
84
-
85
- 6. **migrate-spaces** - Updates stack spaces (MANUAL STEP)
86
- - Moves stacks from old space to `domain-{domain}` space
87
- - **IMPORTANT**: Run MANUALLY after state removal commands
88
- - Run AFTER state removal, BEFORE merging cleanup PRs
89
- - NOT included in full `run` workflow for safety
90
-
91
- ### Phase 4: Completion
92
-
93
- 7. After all steps complete:
94
- - Merge cleanup PR (iac-deploy)
95
- - Merge service repository PR
96
- - Run **migration-cleanup** to remove temporary files
97
-
98
- ## Important Notes
99
-
100
- ### State Management
101
-
102
- - Migration state is saved in `.migration-state.json`
103
- - You can resume migration from any step
104
- - Configuration (stacks) is preserved in state
105
- - You can run steps in any order after `init`, but follow the recommended flow
106
-
107
- ### Order Requirements
108
-
109
- While steps can be run independently, they should generally follow this sequence:
110
-
111
- 1. `init` must be run first (loads configuration)
112
- 2. `enroll` should be merged before running `generate-tf-migration`
113
- 3. `generate-tf-migration` creates the service repo PR and state removal script
114
- 4. Run state removal commands from `METASTACK_STATE_REMOVAL_COMMANDS.sh` before merging cleanup PR
115
- 5. Run `migrate-spaces` MANUALLY after state removal but before merging cleanup PR
116
- 6. Merge cleanup PR before merging service repository PR
117
- 7. The full `run` command skips `migrate-spaces` for safety - you must run it manually
118
-
119
- ### Files Generated
40
+ ## Commands
120
41
 
121
- - `.migration-state.json` - Migration state and progress
122
- - `METASTACK_MIGRATION_PROCEDURE.md` - Complete migration procedure
123
- - `METASTACK_STATE_REMOVAL_COMMANDS.sh` - Commands to remove Terraform state
124
- - `.metastack/import.tf` - Terraform import blocks
125
- - `spacelift.yaml` - Stack configuration
42
+ | Command | Description |
43
+ | ----------------------- | --------------------------------------------- |
44
+ | `run` | Execute full migration workflow |
45
+ | `init` | Clone repos, load config |
46
+ | `state` | Show migration state |
47
+ | `enroll` | Create domain enrollment PR |
48
+ | `generate-tf-migration` | Create service PR + state removal script |
49
+ | `iac-deploy-cleanup` | Create iac-deploy cleanup PR |
50
+ | `generate-procedure` | Generate procedure doc |
51
+ | `cleanup` | Create post-migration PR + remove local files |
52
+ | `help` | Show usage information |
53
+
54
+ ## Execution Order
55
+
56
+ | Step | Action | Type |
57
+ | ---- | ----------------------------------- | --------- |
58
+ | 1 | Merge **Safety Net** PR | 🔀 PR |
59
+ | 2 | Merge **Domain Enrollment** PR | 🔀 PR |
60
+ | 3 | Run state removal script | 🔧 Manual |
61
+ | 4 | Merge **iac-deploy Cleanup** PR | 🔀 PR |
62
+ | 5 | Merge **Service Repo** PR | 🔀 PR |
63
+ | 6 | Run cleanup | 🔧 Manual |
64
+ | 7 | Merge **Post-Migration Cleanup** PR | 🔀 PR |
65
+
66
+ ## Files Generated
67
+
68
+ | File | Purpose |
69
+ | ------------------------------------- | -------------------------------- |
70
+ | `.migration-state.json` | Migration state (resume anytime) |
71
+ | `METASTACK_MIGRATION_PROCEDURE.md` | Checklist & instructions |
72
+ | `METASTACK_STATE_REMOVAL_COMMANDS.sh` | State removal commands |
73
+ | `.metastack/import.tf` | Terraform import blocks |
74
+ | `spacelift.yaml` | Stack definitions |
75
+
76
+ ## Notes
77
+
78
+ - State saved in `.migration-state.json`, you can resume at any time
79
+ - Run state removal before merging iac-deploy cleanup PR to avoid actually deleting the stacks
@@ -17,7 +17,7 @@ export declare const IAC_DEPLOY_PATHS: {
17
17
  export declare const DOMAIN_ENROLLMENT_PATHS: {
18
18
  readonly domains: "domains";
19
19
  readonly spaceliftDir: "spacelift";
20
- readonly spaceliftYaml: "spacelift/spacelift.yaml";
20
+ readonly spaceliftYaml: "spacelift/domain-spacelift.yaml";
21
21
  };
22
22
  export declare const SPACELIFT_API: {
23
23
  readonly endpoint: "https://payfit.app.spacelift.io/graphql";
@@ -27,7 +27,7 @@ exports.IAC_DEPLOY_PATHS = {
27
27
  exports.DOMAIN_ENROLLMENT_PATHS = {
28
28
  domains: 'domains',
29
29
  spaceliftDir: 'spacelift',
30
- spaceliftYaml: 'spacelift/spacelift.yaml',
30
+ spaceliftYaml: 'spacelift/domain-spacelift.yaml',
31
31
  };
32
32
  exports.SPACELIFT_API = {
33
33
  endpoint: 'https://payfit.app.spacelift.io/graphql',
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/executors/stack-migration/lib/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG;IACvB,gBAAgB,EAAE,6CAA6C;IAC/D,SAAS,EAAE,sCAAsC;CACzC,CAAA;AAEG,QAAA,UAAU,GAAG;IACxB,cAAc,EAAE,uBAAuB;IACvC,OAAO,EAAE,gBAAgB;IACzB,oBAAoB,EAAE,qCAAqC;IAC3D,kBAAkB,EAAE,kCAAkC;IACtD,aAAa,EAAE,gBAAgB;IAC/B,SAAS,EAAE,YAAY;CACf,CAAA;AAEG,QAAA,iBAAiB,GAAG;IAC/B,EAAE;IACF,6BAA6B;IAC7B,GAAG,kBAAU,CAAC,OAAO,GAAG;IACxB,kBAAU,CAAC,cAAc;IACzB,kBAAU,CAAC,oBAAoB;IAC/B,kBAAU,CAAC,kBAAkB;CAC9B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEC,QAAA,gBAAgB,GAAG;IAC9B,eAAe,EAAE,kBAAkB;CAC3B,CAAA;AAEG,QAAA,uBAAuB,GAAG;IACrC,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,WAAW;IACzB,aAAa,EAAE,0BAA0B;CACjC,CAAA;AAEG,QAAA,aAAa,GAAG;IAC3B,QAAQ,EAAE,yCAAyC;CAC3C,CAAA;AAEG,QAAA,8BAA8B,GAAG;IAC5C,GAAG,EAAE,4BAA4B;IACjC,IAAI,EAAE,4BAA4B;IAClC,MAAM,EAAE,4BAA4B;IACpC,OAAO,EAAE,4BAA4B;CAC7B,CAAA;AAEG,QAAA,cAAc,GAAG;IAC5B,eAAe,EAAE,kBAAkB;CAC3B,CAAA"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/executors/stack-migration/lib/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG;IACvB,gBAAgB,EAAE,6CAA6C;IAC/D,SAAS,EAAE,sCAAsC;CACzC,CAAA;AAEG,QAAA,UAAU,GAAG;IACxB,cAAc,EAAE,uBAAuB;IACvC,OAAO,EAAE,gBAAgB;IACzB,oBAAoB,EAAE,qCAAqC;IAC3D,kBAAkB,EAAE,kCAAkC;IACtD,aAAa,EAAE,gBAAgB;IAC/B,SAAS,EAAE,YAAY;CACf,CAAA;AAEG,QAAA,iBAAiB,GAAG;IAC/B,EAAE;IACF,6BAA6B;IAC7B,GAAG,kBAAU,CAAC,OAAO,GAAG;IACxB,kBAAU,CAAC,cAAc;IACzB,kBAAU,CAAC,oBAAoB;IAC/B,kBAAU,CAAC,kBAAkB;CAC9B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEC,QAAA,gBAAgB,GAAG;IAC9B,eAAe,EAAE,kBAAkB;CAC3B,CAAA;AAEG,QAAA,uBAAuB,GAAG;IACrC,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,WAAW;IACzB,aAAa,EAAE,iCAAiC;CACxC,CAAA;AAEG,QAAA,aAAa,GAAG;IAC3B,QAAQ,EAAE,yCAAyC;CAC3C,CAAA;AAEG,QAAA,8BAA8B,GAAG;IAC5C,GAAG,EAAE,4BAA4B;IACjC,IAAI,EAAE,4BAA4B;IAClC,MAAM,EAAE,4BAA4B;IACpC,OAAO,EAAE,4BAA4B;CAC7B,CAAA;AAEG,QAAA,cAAc,GAAG;IAC5B,eAAe,EAAE,kBAAkB;CAC3B,CAAA"}
@@ -1,3 +1,4 @@
1
+ export declare const consola: import("consola").ConsolaInstance;
1
2
  export declare class MigrationLogger {
2
3
  info(message: string): void;
3
4
  success(message: string): void;
@@ -1,33 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MigrationLogger = void 0;
4
- const tslib_1 = require("tslib");
5
- const chalk = tslib_1.__importStar(require("chalk"));
3
+ exports.MigrationLogger = exports.consola = void 0;
4
+ const consola_1 = require("consola");
5
+ exports.consola = (0, consola_1.createConsola)({
6
+ fancy: true,
7
+ });
6
8
  class MigrationLogger {
7
9
  info(message) {
8
- console.log(message);
10
+ exports.consola.info(message);
9
11
  }
10
12
  success(message) {
11
- console.log(chalk.green(`✓ ${message}`));
13
+ exports.consola.success(message);
12
14
  }
13
15
  warn(message) {
14
- console.log(chalk.yellow(`⚠ ${message}`));
16
+ exports.consola.warn(message);
15
17
  }
16
18
  error(message) {
17
- console.log(chalk.red(`✗ ${message}`));
19
+ exports.consola.error(message);
18
20
  }
19
21
  section(title) {
20
- console.log('');
21
- console.log(chalk.cyan.bold('='.repeat(60)));
22
- console.log(chalk.cyan.bold(title));
23
- console.log(chalk.cyan.bold('='.repeat(60)));
24
- console.log('');
22
+ exports.consola.log('');
23
+ exports.consola.box(title);
24
+ exports.consola.log('');
25
25
  }
26
26
  step(current, total, description) {
27
- console.log('');
28
- console.log(chalk.blue.bold(`[Step ${current}/${total}] ${description}`));
29
- console.log(chalk.blue('-'.repeat(60)));
30
- console.log('');
27
+ exports.consola.log('');
28
+ exports.consola.start(`[Step ${current}/${total}] ${description}`);
29
+ exports.consola.log('');
31
30
  }
32
31
  }
33
32
  exports.MigrationLogger = MigrationLogger;
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../../src/executors/stack-migration/lib/logger.ts"],"names":[],"mappings":";;;;AAAA,qDAA8B;AAE9B,MAAa,eAAe;IAC1B,IAAI,CAAC,OAAe;QAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IACtB,CAAC;IAED,OAAO,CAAC,OAAe;QACrB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAA;IAC1C,CAAC;IAED,IAAI,CAAC,OAAe;QAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAA;IAC3C,CAAC;IAED,KAAK,CAAC,OAAe;QACnB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAA;IACxC,CAAC;IAED,OAAO,CAAC,KAAa;QACnB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACf,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAA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,CAAC;IAED,OAAO,CAAC,KAAa;QACnB,eAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACf,eAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAClB,eAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IACjB,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,KAAa,EAAE,WAAmB;QACtD,eAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACf,eAAO,CAAC,KAAK,CAAC,SAAS,OAAO,IAAI,KAAK,KAAK,WAAW,EAAE,CAAC,CAAA;QAC1D,eAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IACjB,CAAC;CACF;AA5BD,0CA4BC"}
@@ -1,4 +1,3 @@
1
- import * as readline from 'readline';
2
1
  import type { MigrationConfig } from './types';
3
2
  import { FileOperations } from './file-operations';
4
3
  import { GitOperations } from './git-operations';
@@ -6,15 +5,12 @@ import { MigrationLogger } from './logger';
6
5
  import { MigrationPaths } from './path-builder';
7
6
  export declare class MigrationHelper {
8
7
  logger: MigrationLogger;
9
- rl: readline.Interface | null;
10
8
  config: MigrationConfig;
11
9
  dryRun: boolean;
12
10
  paths: MigrationPaths;
13
11
  git: GitOperations;
14
12
  files: FileOperations;
15
13
  constructor(dryRun?: boolean, serviceRepoPath?: string);
16
- initReadline(): void;
17
- closeReadline(): void;
18
14
  ask(question: string): Promise<string>;
19
15
  confirm(question: string, defaultYes?: boolean): Promise<boolean>;
20
16
  getOrAskConfig(optionValue: string | string[] | undefined, promptText: string, defaultValue?: string): Promise<string>;
@@ -25,9 +21,15 @@ export declare class MigrationHelper {
25
21
  silent?: boolean;
26
22
  }): string;
27
23
  execSilent(command: string, cwd?: string): string;
24
+ isSpacectlInstalled(): boolean;
25
+ ensureSpacectlInstalled(): Promise<void>;
28
26
  isSpacectlAuthenticated(): boolean;
29
27
  ensureSpacectlAuthentication(): Promise<void>;
30
- getStackResourcesFromDirectory(stackId: string, cwd: string): string;
28
+ getStacksGeneratorModuleKey(stack: {
29
+ identifier: string;
30
+ environment: string;
31
+ region?: string;
32
+ }): string;
31
33
  getStackModuleKey(stack: {
32
34
  identifier: string;
33
35
  environment: string;
@@ -4,7 +4,6 @@ exports.MigrationHelper = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const child_process_1 = require("child_process");
6
6
  const fs = tslib_1.__importStar(require("fs"));
7
- const readline = tslib_1.__importStar(require("readline"));
8
7
  const constants_1 = require("./constants");
9
8
  const file_operations_1 = require("./file-operations");
10
9
  const git_operations_1 = require("./git-operations");
@@ -12,7 +11,6 @@ const logger_1 = require("./logger");
12
11
  const path_builder_1 = require("./path-builder");
13
12
  class MigrationHelper {
14
13
  constructor(dryRun = false, serviceRepoPath = process.cwd()) {
15
- this.rl = null;
16
14
  this.dryRun = dryRun;
17
15
  this.logger = new logger_1.MigrationLogger();
18
16
  this.config = {
@@ -34,41 +32,40 @@ class MigrationHelper {
34
32
  this.git = new git_operations_1.GitOperations(dryRun, this.logger);
35
33
  this.files = new file_operations_1.FileOperations(dryRun, this.logger);
36
34
  }
37
- initReadline() {
38
- if (!this.rl) {
39
- this.rl = readline.createInterface({
40
- input: process.stdin,
41
- output: process.stdout,
42
- });
43
- }
44
- }
45
- closeReadline() {
46
- if (this.rl) {
47
- this.rl.close();
48
- this.rl = null;
49
- }
50
- }
51
35
  async ask(question) {
52
- this.initReadline();
53
- return new Promise(resolve => {
54
- this.rl.question(` ${question}: `, answer => {
55
- resolve(answer.trim());
56
- });
36
+ const answer = await logger_1.consola.prompt(question, {
37
+ type: 'text',
57
38
  });
39
+ if (answer === null || answer === undefined) {
40
+ // User cancelled
41
+ process.exit(0);
42
+ }
43
+ return String(answer).trim();
58
44
  }
59
45
  async confirm(question, defaultYes = false) {
60
- const suffix = defaultYes ? ' (Y/n)' : ' (y/N)';
61
- const answer = await this.ask(question + suffix);
62
- if (!answer)
63
- return defaultYes;
64
- return answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes';
46
+ const answer = await logger_1.consola.prompt(question, {
47
+ type: 'confirm',
48
+ initial: defaultYes,
49
+ });
50
+ if (answer === null || answer === undefined) {
51
+ // User cancelled
52
+ process.exit(0);
53
+ }
54
+ return Boolean(answer);
65
55
  }
66
56
  async getOrAskConfig(optionValue, promptText, defaultValue) {
67
57
  if (optionValue) {
68
58
  return Array.isArray(optionValue) ? optionValue.join(',') : optionValue;
69
59
  }
70
- const answer = await this.ask(defaultValue ? `${promptText} [${defaultValue}]` : promptText);
71
- return answer || defaultValue || '';
60
+ const answer = await logger_1.consola.prompt(promptText, {
61
+ type: 'text',
62
+ initial: defaultValue,
63
+ });
64
+ if (answer === null || answer === undefined) {
65
+ // User cancelled
66
+ process.exit(0);
67
+ }
68
+ return String(answer) || defaultValue || '';
72
69
  }
73
70
  generateBranchName(prefix) {
74
71
  return `${prefix}-${Date.now()}`;
@@ -96,6 +93,46 @@ class MigrationHelper {
96
93
  execSilent(command, cwd) {
97
94
  return this.exec(command, { cwd, silent: true });
98
95
  }
96
+ isSpacectlInstalled() {
97
+ try {
98
+ this.execSilent('which spacectl');
99
+ return true;
100
+ }
101
+ catch {
102
+ return false;
103
+ }
104
+ }
105
+ async ensureSpacectlInstalled() {
106
+ if (this.isSpacectlInstalled()) {
107
+ this.logger.success('spacectl CLI is installed');
108
+ return;
109
+ }
110
+ this.logger.warn('spacectl CLI is not installed');
111
+ if (this.dryRun) {
112
+ this.logger.info('[DRY RUN] Would install spacectl');
113
+ return;
114
+ }
115
+ const shouldInstall = await this.confirm('Install spacectl using brew now?', true);
116
+ if (!shouldInstall) {
117
+ this.logger.error('spacectl CLI is required');
118
+ this.logger.info('Install spacectl using:');
119
+ this.logger.info(' brew install spacelift-io/spacelift/spacectl');
120
+ this.logger.info('');
121
+ this.logger.info('Or visit: https://github.com/spacelift-io/spacectl#installation');
122
+ throw new Error('spacectl CLI is required. Please install it and try again.');
123
+ }
124
+ this.logger.info('Installing spacectl...');
125
+ try {
126
+ this.exec('brew install spacelift-io/spacelift/spacectl');
127
+ this.logger.success('spacectl installed successfully');
128
+ }
129
+ catch (error) {
130
+ this.logger.error('Failed to install spacectl');
131
+ this.logger.info('Please install manually:');
132
+ this.logger.info(' brew install spacelift-io/spacelift/spacectl');
133
+ throw error;
134
+ }
135
+ }
99
136
  isSpacectlAuthenticated() {
100
137
  try {
101
138
  this.execSilent('spacectl profile current');
@@ -115,19 +152,27 @@ class MigrationHelper {
115
152
  return;
116
153
  }
117
154
  this.logger.warn('spacectl is not authenticated');
118
- const shouldLogin = await this.confirm('Run spacectl profile login now?', true);
155
+ const shouldLogin = await this.confirm('Run spacectl profile login payfit now?', true);
119
156
  if (!shouldLogin) {
120
- throw new Error('spacectl authentication required. Run: spacectl profile login');
157
+ throw new Error('spacectl authentication required. Run: spacectl profile login --endpoint https://payfit.app.spacelift.io/ payfit');
158
+ }
159
+ this.logger.info('Running spacectl profile login payfit...');
160
+ try {
161
+ this.exec('spacectl profile login --endpoint https://payfit.app.spacelift.io/ payfit');
162
+ this.logger.success('spacectl authentication complete');
163
+ }
164
+ catch (error) {
165
+ this.logger.error('Failed to authenticate with spacectl');
166
+ this.logger.info('Please run manually:');
167
+ this.logger.info(' spacectl profile login --endpoint https://payfit.app.spacelift.io/ payfit');
168
+ throw error;
121
169
  }
122
- this.logger.info('Running spacectl profile login...');
123
- this.exec('spacectl profile login');
124
- this.logger.success('spacectl authentication complete');
125
170
  }
126
- getStackResourcesFromDirectory(stackId, cwd) {
127
- return this.execSilent(`spacectl stack resources list --id ${stackId}`, cwd);
171
+ getStacksGeneratorModuleKey(stack) {
172
+ return `${stack.identifier}${stack.environment ? `-${stack.environment}` : '-global'}${stack.region ? `-${stack.region}` : '-global'}`;
128
173
  }
129
174
  getStackModuleKey(stack) {
130
- return `${stack.identifier}-${stack.environment}${stack.region ? `-${stack.region}` : ''}`;
175
+ return `${stack.identifier}${stack.environment ? `-${stack.environment}` : ''}${stack.region ? `-${stack.region}` : ''}`;
131
176
  }
132
177
  saveMigrationState() {
133
178
  if (this.dryRun) {
@@ -1 +1 @@
1
- {"version":3,"file":"migration-helper.js","sourceRoot":"","sources":["../../../../src/executors/stack-migration/lib/migration-helper.ts"],"names":[],"mappings":";;;;AAAA,iDAAwC;AACxC,+CAAwB;AACxB,2DAAoC;AAIpC,2CAAwC;AACxC,uDAAkD;AAClD,qDAAgD;AAChD,qCAA0C;AAC1C,iDAA+C;AAE/C,MAAa,eAAe;IAS1B,YAAY,MAAM,GAAG,KAAK,EAAE,kBAA0B,OAAO,CAAC,GAAG,EAAE;QAP5D,OAAE,GAA8B,IAAI,CAAA;QAQzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,IAAI,wBAAe,EAAE,CAAA;QACnC,IAAI,CAAC,MAAM,GAAG;YACZ,iBAAiB,EAAE;gBACjB,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,eAAe;gBACrB,MAAM,EAAE,EAAE;gBACV,IAAI,EAAE,EAAE;gBACR,UAAU,EAAE,EAAE;aACf;YACD,YAAY,EAAE;gBACZ,gBAAgB,EAAE,EAAE;gBACpB,SAAS,EAAE,EAAE;aACd;YACD,MAAM,EAAE,EAAE;YACV,cAAc,EAAE,EAAE;SACnB,CAAA;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,6BAAc,CAAC,eAAe,CAAC,CAAA;QAChD,IAAI,CAAC,GAAG,GAAG,IAAI,8BAAa,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;QACjD,IAAI,CAAC,KAAK,GAAG,IAAI,gCAAc,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;IACtD,CAAC;IAED,YAAY;QACV,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;YACb,IAAI,CAAC,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC;gBACjC,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,MAAM,EAAE,OAAO,CAAC,MAAM;aACvB,C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CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,mCAAmC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC5F,CAAA;YACD,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;CACF;AArMD,0CAqMC"}
1
+ {"version":3,"file":"migration-helper.js","sourceRoot":"","sources":["../../../../src/executors/stack-migration/lib/migration-helper.ts"],"names":[],"mappings":";;;;AAAA,iDAAwC;AACxC,+CAAwB;AAIxB,2CAAwC;AACxC,uDAAkD;AAClD,qDAAgD;AAChD,qCAAmD;AACnD,iDAA+C;AAE/C,MAAa,eAAe;IAQ1B,YAAY,MAAM,GAAG,KAAK,EAAE,kBAA0B,OAAO,CAAC,GAAG,EAAE;QACjE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,IAAI,wBAAe,EAAE,CAAA;QACnC,IAAI,CAAC,MAAM,GAAG;YACZ,iBAAiB,EAAE;gBACjB,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,eAAe;gBACrB,MAAM,EAAE,EAAE;gBACV,IAAI,EAAE,EAAE;gBACR,UAAU,EAAE,EAAE;aACf;YACD,YAAY,EAAE;gBACZ,gBAAgB,EAAE,EAAE;gBACpB,SAAS,EAAE,EAAE;aACd;YACD,MAAM,EAAE,EAAE;YACV,cAAc,EAAE,EAAE;SACnB,CAAA;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,6BAAc,CAAC,eAAe,CAAC,CAAA;QAChD,IAAI,CAAC,GAAG,GAAG,IAAI,8BAAa,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;QACjD,IAAI,CAAC,KAAK,GAAG,IAAI,gCAAc,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;IACtD,CAAC;IAED,KAAK,C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