@opencrvs/toolkit 2.0.0-rc.bb52508 → 2.0.0-rc.c14c17b

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 (83) hide show
  1. package/create-countryconfig/index.js +73 -0
  2. package/create-countryconfig/package.json +11 -0
  3. package/dist/application-config/index.js +35 -7
  4. package/dist/cli.js +1657 -318
  5. package/dist/commons/api/router.d.ts +34 -32
  6. package/dist/commons/conditionals/conditionals.d.ts +3 -3
  7. package/dist/commons/events/FieldConfig.d.ts +5 -0
  8. package/dist/commons/events/locations.d.ts +38 -1
  9. package/dist/commons/events/mocks.test.utils.d.ts +19 -0
  10. package/dist/commons/events/scopes.d.ts +24 -1
  11. package/dist/conditionals/index.js +35 -7
  12. package/dist/events/index.js +128 -7
  13. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -1
  14. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +63 -39
  15. package/dist/migrations/v2.0/add-resend-invite-notification.d.ts +3 -0
  16. package/dist/migrations/v2.0/add-resend-invite-notification.d.ts.map +1 -0
  17. package/dist/migrations/v2.0/add-resend-invite-notification.js +373 -0
  18. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +19 -0
  19. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
  20. package/dist/migrations/v2.0/checkout-upstream-files.js +17 -13
  21. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +1 -1
  22. package/dist/migrations/v2.0/convert-config-files-to-ts.js +4 -5
  23. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +1 -1
  24. package/dist/migrations/v2.0/convert-paragraph-to-heading.js +4 -5
  25. package/dist/migrations/v2.0/create-events-index.d.ts.map +1 -1
  26. package/dist/migrations/v2.0/create-events-index.js +1 -2
  27. package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +3 -0
  28. package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +1 -0
  29. package/dist/migrations/v2.0/delete-infrastructure-directory.js +77 -0
  30. package/dist/migrations/v2.0/index.d.ts +8 -4
  31. package/dist/migrations/v2.0/index.d.ts.map +1 -1
  32. package/dist/migrations/v2.0/index.js +1625 -315
  33. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -1
  34. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +95 -7
  35. package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +3 -0
  36. package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +1 -0
  37. package/dist/migrations/v2.0/merge-infrastructure-directory.js +221 -0
  38. package/dist/migrations/v2.0/migrate-application-config-url.d.ts +3 -0
  39. package/dist/migrations/v2.0/migrate-application-config-url.d.ts.map +1 -0
  40. package/dist/migrations/v2.0/migrate-application-config-url.js +342 -0
  41. package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -1
  42. package/dist/migrations/v2.0/migrate-scopes.js +6 -7
  43. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +1 -1
  44. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +3 -4
  45. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -1
  46. package/dist/migrations/v2.0/migrate-workqueue-configs.js +3 -4
  47. package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +1 -1
  48. package/dist/migrations/v2.0/remove-delete-actions.js +3 -4
  49. package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +1 -1
  50. package/dist/migrations/v2.0/remove-demo-scope.js +2 -3
  51. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +1 -1
  52. package/dist/migrations/v2.0/remove-deprecated-imports.js +3 -4
  53. package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts +3 -0
  54. package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts.map +1 -0
  55. package/dist/migrations/v2.0/remove-fhir-url-helpers.js +163 -0
  56. package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +1 -1
  57. package/dist/migrations/v2.0/remove-hearth-migrations.js +1 -2
  58. package/dist/migrations/v2.0/remove-old-statistics-service.d.ts +3 -0
  59. package/dist/migrations/v2.0/remove-old-statistics-service.d.ts.map +1 -0
  60. package/dist/migrations/v2.0/remove-old-statistics-service.js +356 -0
  61. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +1 -1
  62. package/dist/migrations/v2.0/remove-pending-certification-flag.js +3 -4
  63. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +1 -1
  64. package/dist/migrations/v2.0/remove-review-from-register-action.js +3 -4
  65. package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts +3 -0
  66. package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts.map +1 -0
  67. package/dist/migrations/v2.0/remove-unused-environment-variables.js +186 -0
  68. package/dist/migrations/v2.0/rename-api-paths.d.ts.map +1 -1
  69. package/dist/migrations/v2.0/rename-api-paths.js +3 -4
  70. package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +1 -1
  71. package/dist/migrations/v2.0/rename-location-parent-id.js +3 -4
  72. package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts.map +1 -1
  73. package/dist/migrations/v2.0/simplify-analytics-precalculations.js +1 -2
  74. package/dist/migrations/v2.0/update-package-json.d.ts +3 -0
  75. package/dist/migrations/v2.0/update-package-json.d.ts.map +1 -0
  76. package/dist/migrations/v2.0/update-package-json.js +105 -0
  77. package/dist/notification/index.js +35 -7
  78. package/dist/scopes/index.d.ts +82 -10
  79. package/dist/scopes/index.js +41 -8
  80. package/opencrvs-toolkit-2.0.0-rc.c14c17b.tgz +0 -0
  81. package/package.json +1 -1
  82. package/tsconfig.tsbuildinfo +1 -1
  83. package/opencrvs-toolkit-2.0.0-rc.bb52508.tgz +0 -0
@@ -19,6 +19,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
19
19
  });
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.UPSTREAM_BRANCH = exports.UPSTREAM_URL = void 0;
23
+ exports.runGit = runGit;
24
+ exports.tryGit = tryGit;
25
+ exports.assertIsGitRepo = assertIsGitRepo;
22
26
  exports.main = main;
23
27
  /**
24
28
  * Codemod: Replace selected files with their upstream v2.0 versions from
@@ -54,16 +58,16 @@ exports.main = main;
54
58
  * - Requires the country config working directory to be a git repo.
55
59
  */
56
60
  const child_process_1 = require("child_process");
57
- const _1 = require(".");
58
- const UPSTREAM_URL = 'https://github.com/opencrvs/opencrvs-countryconfig.git';
61
+ exports.UPSTREAM_URL = 'https://github.com/opencrvs/opencrvs-countryconfig.git';
59
62
  // @TODO: This needs to be changed to 'release-v2.0.0' once the branch is created
60
- const UPSTREAM_BRANCH = 'develop';
63
+ exports.UPSTREAM_BRANCH = 'develop';
61
64
  // Remote name used only for the duration of this codemod. Prefixed to avoid
62
65
  // clashing with remotes the user may have (origin, upstream, etc.).
63
66
  const TEMP_REMOTE = 'opencrvs-upgrade-v19-v20-codemod';
64
67
  const FILES_TO_CHECKOUT = [
65
- 'infrastructure/postgres/setup-analytics.sh',
66
- 'src/analytics/analytics.ts'
68
+ 'src/analytics/analytics.ts',
69
+ 'Dockerfile',
70
+ 'Dockerfile.assets'
67
71
  ];
68
72
  // ─── Git helpers ─────────────────────────────────────────────────────────────
69
73
  /**
@@ -75,7 +79,7 @@ const FILES_TO_CHECKOUT = [
75
79
  */
76
80
  function runGit(args, { silent = false } = {}) {
77
81
  return (0, child_process_1.execFileSync)('git', args, {
78
- cwd: (0, _1.getCwd)(),
82
+ cwd: process.cwd(),
79
83
  encoding: 'utf8',
80
84
  stdio: silent ? ['ignore', 'pipe', 'pipe'] : ['ignore', 'pipe', 'inherit']
81
85
  });
@@ -96,22 +100,22 @@ function tryGit(args) {
96
100
  }
97
101
  function assertIsGitRepo() {
98
102
  if (!tryGit(['rev-parse', '--is-inside-work-tree'])) {
99
- throw new Error(`checkout-upstream-files: ${(0, _1.getCwd)()} is not a git repository. Initialise git (or run the upgrade inside a git checkout) before re-running.`);
103
+ throw new Error(`${process.cwd()} is not a git repository. Initialise git (or run the upgrade inside a git checkout) before re-running.`);
100
104
  }
101
105
  }
102
106
  // ─── Entry point ─────────────────────────────────────────────────────────────
103
107
  function main() {
104
108
  return __awaiter(this, void 0, void 0, function* () {
105
- console.log(`Checking out ${FILES_TO_CHECKOUT.length} file(s) from ${UPSTREAM_URL}@${UPSTREAM_BRANCH}...\n`);
109
+ console.log(`Checking out ${FILES_TO_CHECKOUT.length} file(s) from ${exports.UPSTREAM_URL}@${exports.UPSTREAM_BRANCH}...\n`);
106
110
  assertIsGitRepo();
107
111
  // Best-effort cleanup of a stale temp remote from a previous aborted run.
108
112
  tryGit(['remote', 'remove', TEMP_REMOTE]);
109
113
  try {
110
- console.log(` Adding temporary remote '${TEMP_REMOTE}' → ${UPSTREAM_URL}`);
111
- runGit(['remote', 'add', TEMP_REMOTE, UPSTREAM_URL], { silent: true });
112
- console.log(` Fetching ${TEMP_REMOTE}/${UPSTREAM_BRANCH} (depth 1)...`);
113
- runGit(['fetch', '--depth=1', TEMP_REMOTE, UPSTREAM_BRANCH]);
114
- const ref = `${TEMP_REMOTE}/${UPSTREAM_BRANCH}`;
114
+ console.log(` Adding temporary remote '${TEMP_REMOTE}' → ${exports.UPSTREAM_URL}`);
115
+ runGit(['remote', 'add', TEMP_REMOTE, exports.UPSTREAM_URL], { silent: true });
116
+ console.log(` Fetching ${TEMP_REMOTE}/${exports.UPSTREAM_BRANCH} (depth 1)...`);
117
+ runGit(['fetch', '--depth=1', TEMP_REMOTE, exports.UPSTREAM_BRANCH]);
118
+ const ref = `${TEMP_REMOTE}/${exports.UPSTREAM_BRANCH}`;
115
119
  const missing = [];
116
120
  let checkedOut = 0;
117
121
  for (const file of FILES_TO_CHECKOUT) {
@@ -1 +1 @@
1
- {"version":3,"file":"convert-config-files-to-ts.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/convert-config-files-to-ts.ts"],"names":[],"mappings":"AAyuBA,wBAAsB,IAAI,kBAyPzB"}
1
+ {"version":3,"file":"convert-config-files-to-ts.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/convert-config-files-to-ts.ts"],"names":[],"mappings":"AAuuBA,wBAAsB,IAAI,kBAyPzB"}
@@ -87,7 +87,6 @@ exports.main = main;
87
87
  const fs = __importStar(require("fs"));
88
88
  const ts_morph_1 = require("ts-morph");
89
89
  const path_1 = __importDefault(require("path"));
90
- const _1 = require(".");
91
90
  // ─── Schema-valid keys per config type ───────────────────────────────────────
92
91
  const CLIENT_VALID_KEYS = new Set([
93
92
  'COUNTRY',
@@ -634,8 +633,8 @@ function ensureJoinImport(sf) {
634
633
  function main() {
635
634
  return __awaiter(this, void 0, void 0, function* () {
636
635
  var _a;
637
- const srcDir = path_1.default.join((0, _1.getCwd)(), 'src');
638
- const relCwd = (fp) => path_1.default.relative((0, _1.getCwd)(), fp);
636
+ const srcDir = path_1.default.join(process.cwd(), 'src');
637
+ const relCwd = (fp) => path_1.default.relative(process.cwd(), fp);
639
638
  // ── Phase 1: Convert JS config files to TypeScript ────────────────────────
640
639
  console.log('Phase 1: Converting JS config files to TypeScript...\n');
641
640
  let convertedCount = 0;
@@ -741,7 +740,7 @@ function main() {
741
740
  if (/\bjoin\s*\(/.test(adjustedValue)) {
742
741
  ensureJoinImport(sf);
743
742
  }
744
- console.log(` Inlined applicationConfig.${accessPath.join('.')} → ${adjustedValue} in ${path_1.default.relative((0, _1.getCwd)(), sf.getFilePath())}`);
743
+ console.log(` Inlined applicationConfig.${accessPath.join('.')} → ${adjustedValue} in ${path_1.default.relative(process.cwd(), sf.getFilePath())}`);
745
744
  filesToSaveAfterInlining.add(sf);
746
745
  madeReplacement = true;
747
746
  break; // restart — tree has changed
@@ -752,7 +751,7 @@ function main() {
752
751
  // Persist files that received inline replacements
753
752
  for (const sf of Array.from(filesToSaveAfterInlining)) {
754
753
  yield sf.save();
755
- console.log(` Saved (inlined): ${path_1.default.relative((0, _1.getCwd)(), sf.getFilePath())}`);
754
+ console.log(` Saved (inlined): ${path_1.default.relative(process.cwd(), sf.getFilePath())}`);
756
755
  }
757
756
  // Remove in reverse order to avoid index shifting
758
757
  for (const prop of [...propsToRemove].reverse()) {
@@ -1 +1 @@
1
- {"version":3,"file":"convert-paragraph-to-heading.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/convert-paragraph-to-heading.ts"],"names":[],"mappings":"AAwJA,iBAAe,IAAI,kBA6ClB;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
1
+ {"version":3,"file":"convert-paragraph-to-heading.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/convert-paragraph-to-heading.ts"],"names":[],"mappings":"AAsJA,iBAAe,IAAI,kBA6ClB;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
@@ -42,7 +42,6 @@ exports.main = main;
42
42
  */
43
43
  const ts_morph_1 = require("ts-morph");
44
44
  const path_1 = __importDefault(require("path"));
45
- const _1 = require(".");
46
45
  const FIELD_TYPE_ENUM_NAME = 'FieldType';
47
46
  const PARAGRAPH_MEMBER_NAME = 'PARAGRAPH';
48
47
  const HEADING_MEMBER_NAME = 'HEADING';
@@ -112,18 +111,18 @@ function processFile(filePath, project) {
112
111
  const result = transformParagraphField(obj);
113
112
  if (result === 'converted-to-heading') {
114
113
  changedCount++;
115
- console.log(` [${path_1.default.relative((0, _1.getCwd)(), filePath)}] Converted PARAGRAPH with heading fontVariant to HEADING`);
114
+ console.log(` [${path_1.default.relative(process.cwd(), filePath)}] Converted PARAGRAPH with heading fontVariant to HEADING`);
116
115
  }
117
116
  else if (result === 'removed-font-variant') {
118
117
  changedCount++;
119
- console.log(` [${path_1.default.relative((0, _1.getCwd)(), filePath)}] Removed non-heading fontVariant from PARAGRAPH`);
118
+ console.log(` [${path_1.default.relative(process.cwd(), filePath)}] Removed non-heading fontVariant from PARAGRAPH`);
120
119
  }
121
120
  }
122
121
  return changedCount;
123
122
  }
124
123
  function main() {
125
124
  return __awaiter(this, void 0, void 0, function* () {
126
- const srcDir = path_1.default.join((0, _1.getCwd)(), 'src');
125
+ const srcDir = path_1.default.join(process.cwd(), 'src');
127
126
  console.log(`Scanning for FieldType.PARAGRAPH fields in: ${srcDir}\n`);
128
127
  const project = new ts_morph_1.Project({
129
128
  tsConfigFilePath: path_1.default.resolve(srcDir, '../tsconfig.json'),
@@ -152,7 +151,7 @@ function main() {
152
151
  for (const filePath of modifiedFiles) {
153
152
  const sourceFile = project.getSourceFileOrThrow(filePath);
154
153
  yield sourceFile.save();
155
- console.log(` Saved: ${path_1.default.relative((0, _1.getCwd)(), filePath)}`);
154
+ console.log(` Saved: ${path_1.default.relative(process.cwd(), filePath)}`);
156
155
  }
157
156
  console.log(`\nDone. Processed ${totalChanged} FieldType.PARAGRAPH field(s).`);
158
157
  });
@@ -1 +1 @@
1
- {"version":3,"file":"create-events-index.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/create-events-index.ts"],"names":[],"mappings":"AAqTA,iBAAe,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAmEnC;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
1
+ {"version":3,"file":"create-events-index.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/create-events-index.ts"],"names":[],"mappings":"AAmTA,iBAAe,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAmEnC;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
@@ -63,7 +63,6 @@ exports.main = main;
63
63
  const ts_morph_1 = require("ts-morph");
64
64
  const fs_1 = __importDefault(require("fs"));
65
65
  const path_1 = __importDefault(require("path"));
66
- const _1 = require(".");
67
66
  const DEFINE_CONFIG_NAME = 'defineConfig';
68
67
  const HANDLER_FUNCTION_NAMES = new Set([
69
68
  'getCustomEventsHandler',
@@ -274,7 +273,7 @@ function modifyHandler(sourceFile, exportNames) {
274
273
  // ─── Entry point ─────────────────────────────────────────────────────────────
275
274
  function main() {
276
275
  return __awaiter(this, void 0, void 0, function* () {
277
- const cwd = (0, _1.getCwd)();
276
+ const cwd = process.cwd();
278
277
  const srcDir = path_1.default.join(cwd, 'src');
279
278
  console.log(`Scanning for defineConfig event exports in: ${srcDir}\n`);
280
279
  const project = new ts_morph_1.Project({
@@ -0,0 +1,3 @@
1
+ declare function main(): Promise<void>;
2
+ export { main };
3
+ //# sourceMappingURL=delete-infrastructure-directory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-infrastructure-directory.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/delete-infrastructure-directory.ts"],"names":[],"mappings":"AA4CA,iBAAe,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAgCnC;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ /*
3
+ * This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
+ *
7
+ * OpenCRVS is also distributed under the terms of the Civil Registration
8
+ * & Healthcare Disclaimer located at http://opencrvs.org/license.
9
+ *
10
+ * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
11
+ */
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.main = main;
23
+ /**
24
+ * Codemod: Remove the local `infrastructure/` directory.
25
+ *
26
+ * Used by the v1.9 → v2.0 upgrade when the country config does NOT deploy
27
+ * via Docker Swarm. In that case the `infrastructure/` directory shipped
28
+ * with opencrvs-countryconfig is no longer needed and can be removed.
29
+ *
30
+ * Usage:
31
+ * ts-node -r tsconfig-paths/register src/migrations/v2.0/delete-infrastructure-directory.ts
32
+ *
33
+ * What it does:
34
+ * 1. Stages deletion of all tracked files under `infrastructure/` via
35
+ * `git rm -rf --ignore-unmatch -- infrastructure/`. This both removes
36
+ * the files from the working tree and records the deletion in the
37
+ * index, so it shows up in the upgrade commit alongside the other
38
+ * codemod changes.
39
+ * 2. Cleans up any untracked files / empty directory that `git rm` left
40
+ * behind, so the path is fully gone from the working tree.
41
+ *
42
+ * Caveats:
43
+ * - Destructive: any local edits to `infrastructure/` are lost. Run on a
44
+ * clean working tree (or after committing your local changes).
45
+ * - If `infrastructure/` doesn't exist, this codemod is a no-op.
46
+ * - Requires git to be installed and the country config working directory
47
+ * to be a git repo.
48
+ */
49
+ const fs_1 = require("fs");
50
+ const path_1 = require("path");
51
+ const checkout_upstream_files_1 = require("./checkout-upstream-files");
52
+ const INFRASTRUCTURE_DIR = 'infrastructure';
53
+ function main() {
54
+ return __awaiter(this, void 0, void 0, function* () {
55
+ const fullPath = (0, path_1.join)(process.cwd(), INFRASTRUCTURE_DIR);
56
+ if (!(0, fs_1.existsSync)(fullPath)) {
57
+ console.log(`'${INFRASTRUCTURE_DIR}/' not found in ${process.cwd()} — nothing to delete.`);
58
+ return;
59
+ }
60
+ console.log(`Deleting '${INFRASTRUCTURE_DIR}/'...\n`);
61
+ (0, checkout_upstream_files_1.assertIsGitRepo)();
62
+ // `git rm -rf --ignore-unmatch` removes tracked files (working tree + index)
63
+ // and is a no-op for paths with no tracked entries, so it's safe to run
64
+ // even when `infrastructure/` exists only as untracked files.
65
+ (0, checkout_upstream_files_1.runGit)(['rm', '-rf', '--ignore-unmatch', '--', `${INFRASTRUCTURE_DIR}/`], {
66
+ silent: true
67
+ });
68
+ console.log(` Staged deletion of tracked files under '${INFRASTRUCTURE_DIR}/'.`);
69
+ // `git rm` leaves untracked files (and any now-empty directory) on disk;
70
+ // remove whatever's left so the path is fully gone.
71
+ if ((0, fs_1.existsSync)(fullPath)) {
72
+ (0, fs_1.rmSync)(fullPath, { recursive: true, force: true });
73
+ console.log(` Removed remaining untracked files under '${INFRASTRUCTURE_DIR}/'.`);
74
+ }
75
+ console.log(`\n Done. Review the staged deletion with: git diff --cached -- '${INFRASTRUCTURE_DIR}/'`);
76
+ });
77
+ }
@@ -1,7 +1,11 @@
1
- export declare function getCwd(): string;
2
1
  /**
3
- * Run the upgrade process for a given country config directory.
4
- * @param ccwd - The country config working directory.
2
+ * Run the upgrade process for the country config in the current working
3
+ * directory.
4
+ *
5
+ * @param dockerSwarm - When true, the local `infrastructure/` directory is
6
+ * merged with upstream changes (Docker Swarm deployments still need it).
7
+ * When false (the default), `infrastructure/` is deleted entirely, since
8
+ * non-Swarm deployments no longer ship it.
5
9
  */
6
- export declare function runUpgrade(ccwd: string | undefined): Promise<void>;
10
+ export declare function runUpgrade(dockerSwarm: boolean): Promise<void>;
7
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/index.ts"],"names":[],"mappings":"AA+BA,wBAAgB,MAAM,WAMrB;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,iBA8BxD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/index.ts"],"names":[],"mappings":"AAqCA;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAAC,WAAW,EAAE,OAAO,iBA+BpD"}