@opencrvs/toolkit 2.0.0-rc.1f57a26 → 2.0.0-rc.21b1468
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/cli.js +95 -6
- package/dist/migrations/v2.0/fix-action-confirmation-handler-type.d.ts +3 -0
- package/dist/migrations/v2.0/fix-action-confirmation-handler-type.d.ts.map +1 -0
- package/dist/migrations/v2.0/fix-action-confirmation-handler-type.js +113 -0
- package/dist/migrations/v2.0/index.d.ts.map +1 -1
- package/dist/migrations/v2.0/index.js +93 -4
- package/opencrvs-toolkit-2.0.0-rc.21b1468.tgz +0 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.1f57a26.tgz +0 -0
package/dist/cli.js
CHANGED
|
@@ -1883,9 +1883,9 @@ function updateRouteHandlers(sourceFiles, group, srcDir, relCwd) {
|
|
|
1883
1883
|
}
|
|
1884
1884
|
return replacedCount;
|
|
1885
1885
|
}
|
|
1886
|
-
function resolveConfigChain(configObj,
|
|
1886
|
+
function resolveConfigChain(configObj, path24) {
|
|
1887
1887
|
let current = configObj;
|
|
1888
|
-
for (const key of
|
|
1888
|
+
for (const key of path24) {
|
|
1889
1889
|
if (!import_ts_morph10.Node.isObjectLiteralExpression(current)) return null;
|
|
1890
1890
|
const prop = current.getProperty(key);
|
|
1891
1891
|
if (!prop || !import_ts_morph10.Node.isPropertyAssignment(prop)) return null;
|
|
@@ -4697,9 +4697,9 @@ var import_path24 = require("path");
|
|
|
4697
4697
|
var TEMP_REMOTE2 = "opencrvs-upgrade-v19-v20-codemod-merge-infra";
|
|
4698
4698
|
var INFRASTRUCTURE_DIR = "infrastructure";
|
|
4699
4699
|
var BASE_BRANCH = "release-v1.9";
|
|
4700
|
-
function gitShowBytes(ref,
|
|
4700
|
+
function gitShowBytes(ref, path24) {
|
|
4701
4701
|
try {
|
|
4702
|
-
const buf = (0, import_child_process2.execFileSync)("git", ["show", `${ref}:${
|
|
4702
|
+
const buf = (0, import_child_process2.execFileSync)("git", ["show", `${ref}:${path24}`], {
|
|
4703
4703
|
cwd: process.cwd(),
|
|
4704
4704
|
stdio: ["ignore", "pipe", "pipe"]
|
|
4705
4705
|
});
|
|
@@ -4838,6 +4838,94 @@ async function main26() {
|
|
|
4838
4838
|
);
|
|
4839
4839
|
}
|
|
4840
4840
|
|
|
4841
|
+
// src/migrations/v2.0/fix-action-confirmation-handler-type.ts
|
|
4842
|
+
var import_ts_morph22 = require("ts-morph");
|
|
4843
|
+
var import_path26 = __toESM(require("path"));
|
|
4844
|
+
var TARGET_FUNCTION_NAME = "acceptRequestedRegistration";
|
|
4845
|
+
var ACTION_PARAMETER_NAME = "action";
|
|
4846
|
+
var OLD_TYPE = "ActionInput";
|
|
4847
|
+
var NEW_TYPE = "Extract<ActionInput, { type?: 'REGISTER' }>";
|
|
4848
|
+
function isTargetFunctionParameter(parameter) {
|
|
4849
|
+
const functionDeclaration = parameter.getFirstAncestorByKind(
|
|
4850
|
+
import_ts_morph22.SyntaxKind.FunctionDeclaration
|
|
4851
|
+
);
|
|
4852
|
+
if (functionDeclaration?.getName() === TARGET_FUNCTION_NAME) {
|
|
4853
|
+
return true;
|
|
4854
|
+
}
|
|
4855
|
+
const arrowFunction = parameter.getFirstAncestorByKind(
|
|
4856
|
+
import_ts_morph22.SyntaxKind.ArrowFunction
|
|
4857
|
+
);
|
|
4858
|
+
const variableDeclaration = arrowFunction?.getFirstAncestorByKind(
|
|
4859
|
+
import_ts_morph22.SyntaxKind.VariableDeclaration
|
|
4860
|
+
);
|
|
4861
|
+
return variableDeclaration?.getName() === TARGET_FUNCTION_NAME;
|
|
4862
|
+
}
|
|
4863
|
+
function processFile14(filePath, project) {
|
|
4864
|
+
const sourceFile = project.getSourceFile(filePath);
|
|
4865
|
+
if (!sourceFile) return 0;
|
|
4866
|
+
let updatedCount = 0;
|
|
4867
|
+
const parameters = sourceFile.getDescendantsOfKind(import_ts_morph22.SyntaxKind.Parameter);
|
|
4868
|
+
for (const parameter of parameters) {
|
|
4869
|
+
if (parameter.getName() !== ACTION_PARAMETER_NAME) {
|
|
4870
|
+
continue;
|
|
4871
|
+
}
|
|
4872
|
+
if (!isTargetFunctionParameter(parameter)) {
|
|
4873
|
+
continue;
|
|
4874
|
+
}
|
|
4875
|
+
const typeNode = parameter.getTypeNode();
|
|
4876
|
+
if (!typeNode) continue;
|
|
4877
|
+
if (typeNode.getText() !== OLD_TYPE) {
|
|
4878
|
+
continue;
|
|
4879
|
+
}
|
|
4880
|
+
parameter.setType(NEW_TYPE);
|
|
4881
|
+
updatedCount++;
|
|
4882
|
+
console.log(
|
|
4883
|
+
` [${import_path26.default.relative(process.cwd(), filePath)}] Updated '${ACTION_PARAMETER_NAME}' parameter type to ${NEW_TYPE}`
|
|
4884
|
+
);
|
|
4885
|
+
}
|
|
4886
|
+
return updatedCount;
|
|
4887
|
+
}
|
|
4888
|
+
async function main27() {
|
|
4889
|
+
const srcDir = import_path26.default.join(process.cwd(), "src");
|
|
4890
|
+
console.log(`Scanning for action confirmation handler types in: ${srcDir}
|
|
4891
|
+
`);
|
|
4892
|
+
const project = new import_ts_morph22.Project({
|
|
4893
|
+
tsConfigFilePath: import_path26.default.resolve(srcDir, "../tsconfig.json"),
|
|
4894
|
+
skipAddingFilesFromTsConfig: false
|
|
4895
|
+
});
|
|
4896
|
+
const sourceFiles = project.getSourceFiles().filter((sf) => {
|
|
4897
|
+
const filePath = sf.getFilePath();
|
|
4898
|
+
return filePath.includes("/src/") && !filePath.includes("/node_modules/");
|
|
4899
|
+
});
|
|
4900
|
+
let totalUpdated = 0;
|
|
4901
|
+
const modifiedFiles = [];
|
|
4902
|
+
for (const sourceFile of sourceFiles) {
|
|
4903
|
+
const filePath = sourceFile.getFilePath();
|
|
4904
|
+
const updated = processFile14(filePath, project);
|
|
4905
|
+
if (updated > 0) {
|
|
4906
|
+
totalUpdated += updated;
|
|
4907
|
+
modifiedFiles.push(filePath);
|
|
4908
|
+
}
|
|
4909
|
+
}
|
|
4910
|
+
if (modifiedFiles.length === 0) {
|
|
4911
|
+
console.log(
|
|
4912
|
+
`No '${ACTION_PARAMETER_NAME}: ${OLD_TYPE}' parameter signatures found. Nothing to do.`
|
|
4913
|
+
);
|
|
4914
|
+
return;
|
|
4915
|
+
}
|
|
4916
|
+
console.log(`
|
|
4917
|
+
Saving ${modifiedFiles.length} modified file(s)...`);
|
|
4918
|
+
for (const filePath of modifiedFiles) {
|
|
4919
|
+
const sourceFile = project.getSourceFileOrThrow(filePath);
|
|
4920
|
+
await sourceFile.save();
|
|
4921
|
+
console.log(` Saved: ${import_path26.default.relative(process.cwd(), filePath)}`);
|
|
4922
|
+
}
|
|
4923
|
+
console.log(
|
|
4924
|
+
`
|
|
4925
|
+
Done. Updated ${totalUpdated} '${ACTION_PARAMETER_NAME}' parameter type annotation(s).`
|
|
4926
|
+
);
|
|
4927
|
+
}
|
|
4928
|
+
|
|
4841
4929
|
// src/migrations/v2.0/index.ts
|
|
4842
4930
|
async function runUpgrade(dockerSwarm) {
|
|
4843
4931
|
await main18();
|
|
@@ -4860,6 +4948,7 @@ async function runUpgrade(dockerSwarm) {
|
|
|
4860
4948
|
await main19();
|
|
4861
4949
|
await main20();
|
|
4862
4950
|
await main21();
|
|
4951
|
+
await main27();
|
|
4863
4952
|
await main22();
|
|
4864
4953
|
await main23();
|
|
4865
4954
|
await main24();
|
|
@@ -4896,7 +4985,7 @@ Options:
|
|
|
4896
4985
|
'infrastructure/' directory is deleted (default).
|
|
4897
4986
|
-h, --help Show this message.
|
|
4898
4987
|
`.trim();
|
|
4899
|
-
function
|
|
4988
|
+
function main28() {
|
|
4900
4989
|
const command = args[0];
|
|
4901
4990
|
if (!command || command === "--help" || command === "-h") {
|
|
4902
4991
|
console.log(USAGE);
|
|
@@ -4971,4 +5060,4 @@ function handleCheckTranslations() {
|
|
|
4971
5060
|
console.warn("This command is not implemented yet!");
|
|
4972
5061
|
process.exit(1);
|
|
4973
5062
|
}
|
|
4974
|
-
|
|
5063
|
+
main28();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fix-action-confirmation-handler-type.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/fix-action-confirmation-handler-type.ts"],"names":[],"mappings":"AAsFA,iBAAe,IAAI,kBA6ClB;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -0,0 +1,113 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.main = main;
|
|
26
|
+
/**
|
|
27
|
+
* Codemod: Update action confirmation handler parameter type from:
|
|
28
|
+
* action: ActionInput
|
|
29
|
+
* to:
|
|
30
|
+
* action: Extract<ActionInput, { type?: 'REGISTER' }>
|
|
31
|
+
*
|
|
32
|
+
* What it does:
|
|
33
|
+
* - Scans all TypeScript files under `src/`
|
|
34
|
+
* - Finds function parameters named `action` with type exactly `ActionInput`
|
|
35
|
+
* - Rewrites the type annotation to the extracted REGISTER action subtype
|
|
36
|
+
* - Saves modified files in-place
|
|
37
|
+
*/
|
|
38
|
+
/* eslint-disable no-console */
|
|
39
|
+
const ts_morph_1 = require("ts-morph");
|
|
40
|
+
const path_1 = __importDefault(require("path"));
|
|
41
|
+
const TARGET_FUNCTION_NAME = 'acceptRequestedRegistration';
|
|
42
|
+
const ACTION_PARAMETER_NAME = 'action';
|
|
43
|
+
const OLD_TYPE = 'ActionInput';
|
|
44
|
+
const NEW_TYPE = "Extract<ActionInput, { type?: 'REGISTER' }>";
|
|
45
|
+
function isTargetFunctionParameter(parameter) {
|
|
46
|
+
const functionDeclaration = parameter.getFirstAncestorByKind(ts_morph_1.SyntaxKind.FunctionDeclaration);
|
|
47
|
+
if ((functionDeclaration === null || functionDeclaration === void 0 ? void 0 : functionDeclaration.getName()) === TARGET_FUNCTION_NAME) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
const arrowFunction = parameter.getFirstAncestorByKind(ts_morph_1.SyntaxKind.ArrowFunction);
|
|
51
|
+
const variableDeclaration = arrowFunction === null || arrowFunction === void 0 ? void 0 : arrowFunction.getFirstAncestorByKind(ts_morph_1.SyntaxKind.VariableDeclaration);
|
|
52
|
+
return (variableDeclaration === null || variableDeclaration === void 0 ? void 0 : variableDeclaration.getName()) === TARGET_FUNCTION_NAME;
|
|
53
|
+
}
|
|
54
|
+
function processFile(filePath, project) {
|
|
55
|
+
const sourceFile = project.getSourceFile(filePath);
|
|
56
|
+
if (!sourceFile)
|
|
57
|
+
return 0;
|
|
58
|
+
let updatedCount = 0;
|
|
59
|
+
const parameters = sourceFile.getDescendantsOfKind(ts_morph_1.SyntaxKind.Parameter);
|
|
60
|
+
for (const parameter of parameters) {
|
|
61
|
+
if (parameter.getName() !== ACTION_PARAMETER_NAME) {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (!isTargetFunctionParameter(parameter)) {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
const typeNode = parameter.getTypeNode();
|
|
68
|
+
if (!typeNode)
|
|
69
|
+
continue;
|
|
70
|
+
if (typeNode.getText() !== OLD_TYPE) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
parameter.setType(NEW_TYPE);
|
|
74
|
+
updatedCount++;
|
|
75
|
+
console.log(` [${path_1.default.relative(process.cwd(), filePath)}] Updated '${ACTION_PARAMETER_NAME}' parameter type to ${NEW_TYPE}`);
|
|
76
|
+
}
|
|
77
|
+
return updatedCount;
|
|
78
|
+
}
|
|
79
|
+
function main() {
|
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
const srcDir = path_1.default.join(process.cwd(), 'src');
|
|
82
|
+
console.log(`Scanning for action confirmation handler types in: ${srcDir}\n`);
|
|
83
|
+
const project = new ts_morph_1.Project({
|
|
84
|
+
tsConfigFilePath: path_1.default.resolve(srcDir, '../tsconfig.json'),
|
|
85
|
+
skipAddingFilesFromTsConfig: false
|
|
86
|
+
});
|
|
87
|
+
const sourceFiles = project.getSourceFiles().filter((sf) => {
|
|
88
|
+
const filePath = sf.getFilePath();
|
|
89
|
+
return filePath.includes('/src/') && !filePath.includes('/node_modules/');
|
|
90
|
+
});
|
|
91
|
+
let totalUpdated = 0;
|
|
92
|
+
const modifiedFiles = [];
|
|
93
|
+
for (const sourceFile of sourceFiles) {
|
|
94
|
+
const filePath = sourceFile.getFilePath();
|
|
95
|
+
const updated = processFile(filePath, project);
|
|
96
|
+
if (updated > 0) {
|
|
97
|
+
totalUpdated += updated;
|
|
98
|
+
modifiedFiles.push(filePath);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (modifiedFiles.length === 0) {
|
|
102
|
+
console.log(`No '${ACTION_PARAMETER_NAME}: ${OLD_TYPE}' parameter signatures found. Nothing to do.`);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
console.log(`\nSaving ${modifiedFiles.length} modified file(s)...`);
|
|
106
|
+
for (const filePath of modifiedFiles) {
|
|
107
|
+
const sourceFile = project.getSourceFileOrThrow(filePath);
|
|
108
|
+
yield sourceFile.save();
|
|
109
|
+
console.log(` Saved: ${path_1.default.relative(process.cwd(), filePath)}`);
|
|
110
|
+
}
|
|
111
|
+
console.log(`\nDone. Updated ${totalUpdated} '${ACTION_PARAMETER_NAME}' parameter type annotation(s).`);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/index.ts"],"names":[],"mappings":"AAsCA;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAAC,WAAW,EAAE,OAAO,iBAgCpD"}
|
|
@@ -1895,9 +1895,9 @@ function updateRouteHandlers(sourceFiles, group, srcDir, relCwd) {
|
|
|
1895
1895
|
}
|
|
1896
1896
|
return replacedCount;
|
|
1897
1897
|
}
|
|
1898
|
-
function resolveConfigChain(configObj,
|
|
1898
|
+
function resolveConfigChain(configObj, path24) {
|
|
1899
1899
|
let current = configObj;
|
|
1900
|
-
for (const key of
|
|
1900
|
+
for (const key of path24) {
|
|
1901
1901
|
if (!import_ts_morph10.Node.isObjectLiteralExpression(current)) return null;
|
|
1902
1902
|
const prop = current.getProperty(key);
|
|
1903
1903
|
if (!prop || !import_ts_morph10.Node.isPropertyAssignment(prop)) return null;
|
|
@@ -4709,9 +4709,9 @@ var import_path24 = require("path");
|
|
|
4709
4709
|
var TEMP_REMOTE2 = "opencrvs-upgrade-v19-v20-codemod-merge-infra";
|
|
4710
4710
|
var INFRASTRUCTURE_DIR = "infrastructure";
|
|
4711
4711
|
var BASE_BRANCH = "release-v1.9";
|
|
4712
|
-
function gitShowBytes(ref,
|
|
4712
|
+
function gitShowBytes(ref, path24) {
|
|
4713
4713
|
try {
|
|
4714
|
-
const buf = (0, import_child_process2.execFileSync)("git", ["show", `${ref}:${
|
|
4714
|
+
const buf = (0, import_child_process2.execFileSync)("git", ["show", `${ref}:${path24}`], {
|
|
4715
4715
|
cwd: process.cwd(),
|
|
4716
4716
|
stdio: ["ignore", "pipe", "pipe"]
|
|
4717
4717
|
});
|
|
@@ -4850,6 +4850,94 @@ async function main26() {
|
|
|
4850
4850
|
);
|
|
4851
4851
|
}
|
|
4852
4852
|
|
|
4853
|
+
// src/migrations/v2.0/fix-action-confirmation-handler-type.ts
|
|
4854
|
+
var import_ts_morph22 = require("ts-morph");
|
|
4855
|
+
var import_path26 = __toESM(require("path"));
|
|
4856
|
+
var TARGET_FUNCTION_NAME = "acceptRequestedRegistration";
|
|
4857
|
+
var ACTION_PARAMETER_NAME = "action";
|
|
4858
|
+
var OLD_TYPE = "ActionInput";
|
|
4859
|
+
var NEW_TYPE = "Extract<ActionInput, { type?: 'REGISTER' }>";
|
|
4860
|
+
function isTargetFunctionParameter(parameter) {
|
|
4861
|
+
const functionDeclaration = parameter.getFirstAncestorByKind(
|
|
4862
|
+
import_ts_morph22.SyntaxKind.FunctionDeclaration
|
|
4863
|
+
);
|
|
4864
|
+
if (functionDeclaration?.getName() === TARGET_FUNCTION_NAME) {
|
|
4865
|
+
return true;
|
|
4866
|
+
}
|
|
4867
|
+
const arrowFunction = parameter.getFirstAncestorByKind(
|
|
4868
|
+
import_ts_morph22.SyntaxKind.ArrowFunction
|
|
4869
|
+
);
|
|
4870
|
+
const variableDeclaration = arrowFunction?.getFirstAncestorByKind(
|
|
4871
|
+
import_ts_morph22.SyntaxKind.VariableDeclaration
|
|
4872
|
+
);
|
|
4873
|
+
return variableDeclaration?.getName() === TARGET_FUNCTION_NAME;
|
|
4874
|
+
}
|
|
4875
|
+
function processFile14(filePath, project) {
|
|
4876
|
+
const sourceFile = project.getSourceFile(filePath);
|
|
4877
|
+
if (!sourceFile) return 0;
|
|
4878
|
+
let updatedCount = 0;
|
|
4879
|
+
const parameters = sourceFile.getDescendantsOfKind(import_ts_morph22.SyntaxKind.Parameter);
|
|
4880
|
+
for (const parameter of parameters) {
|
|
4881
|
+
if (parameter.getName() !== ACTION_PARAMETER_NAME) {
|
|
4882
|
+
continue;
|
|
4883
|
+
}
|
|
4884
|
+
if (!isTargetFunctionParameter(parameter)) {
|
|
4885
|
+
continue;
|
|
4886
|
+
}
|
|
4887
|
+
const typeNode = parameter.getTypeNode();
|
|
4888
|
+
if (!typeNode) continue;
|
|
4889
|
+
if (typeNode.getText() !== OLD_TYPE) {
|
|
4890
|
+
continue;
|
|
4891
|
+
}
|
|
4892
|
+
parameter.setType(NEW_TYPE);
|
|
4893
|
+
updatedCount++;
|
|
4894
|
+
console.log(
|
|
4895
|
+
` [${import_path26.default.relative(process.cwd(), filePath)}] Updated '${ACTION_PARAMETER_NAME}' parameter type to ${NEW_TYPE}`
|
|
4896
|
+
);
|
|
4897
|
+
}
|
|
4898
|
+
return updatedCount;
|
|
4899
|
+
}
|
|
4900
|
+
async function main27() {
|
|
4901
|
+
const srcDir = import_path26.default.join(process.cwd(), "src");
|
|
4902
|
+
console.log(`Scanning for action confirmation handler types in: ${srcDir}
|
|
4903
|
+
`);
|
|
4904
|
+
const project = new import_ts_morph22.Project({
|
|
4905
|
+
tsConfigFilePath: import_path26.default.resolve(srcDir, "../tsconfig.json"),
|
|
4906
|
+
skipAddingFilesFromTsConfig: false
|
|
4907
|
+
});
|
|
4908
|
+
const sourceFiles = project.getSourceFiles().filter((sf) => {
|
|
4909
|
+
const filePath = sf.getFilePath();
|
|
4910
|
+
return filePath.includes("/src/") && !filePath.includes("/node_modules/");
|
|
4911
|
+
});
|
|
4912
|
+
let totalUpdated = 0;
|
|
4913
|
+
const modifiedFiles = [];
|
|
4914
|
+
for (const sourceFile of sourceFiles) {
|
|
4915
|
+
const filePath = sourceFile.getFilePath();
|
|
4916
|
+
const updated = processFile14(filePath, project);
|
|
4917
|
+
if (updated > 0) {
|
|
4918
|
+
totalUpdated += updated;
|
|
4919
|
+
modifiedFiles.push(filePath);
|
|
4920
|
+
}
|
|
4921
|
+
}
|
|
4922
|
+
if (modifiedFiles.length === 0) {
|
|
4923
|
+
console.log(
|
|
4924
|
+
`No '${ACTION_PARAMETER_NAME}: ${OLD_TYPE}' parameter signatures found. Nothing to do.`
|
|
4925
|
+
);
|
|
4926
|
+
return;
|
|
4927
|
+
}
|
|
4928
|
+
console.log(`
|
|
4929
|
+
Saving ${modifiedFiles.length} modified file(s)...`);
|
|
4930
|
+
for (const filePath of modifiedFiles) {
|
|
4931
|
+
const sourceFile = project.getSourceFileOrThrow(filePath);
|
|
4932
|
+
await sourceFile.save();
|
|
4933
|
+
console.log(` Saved: ${import_path26.default.relative(process.cwd(), filePath)}`);
|
|
4934
|
+
}
|
|
4935
|
+
console.log(
|
|
4936
|
+
`
|
|
4937
|
+
Done. Updated ${totalUpdated} '${ACTION_PARAMETER_NAME}' parameter type annotation(s).`
|
|
4938
|
+
);
|
|
4939
|
+
}
|
|
4940
|
+
|
|
4853
4941
|
// src/migrations/v2.0/index.ts
|
|
4854
4942
|
async function runUpgrade(dockerSwarm) {
|
|
4855
4943
|
await main18();
|
|
@@ -4872,6 +4960,7 @@ async function runUpgrade(dockerSwarm) {
|
|
|
4872
4960
|
await main19();
|
|
4873
4961
|
await main20();
|
|
4874
4962
|
await main21();
|
|
4963
|
+
await main27();
|
|
4875
4964
|
await main22();
|
|
4876
4965
|
await main23();
|
|
4877
4966
|
await main24();
|
|
Binary file
|
package/package.json
CHANGED
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/cli.ts","./src/api/index.ts","./src/application-config/index.ts","./src/conditionals/index.ts","./src/events/deduplication.ts","./src/events/index.ts","./src/migrations/v2.0/add-birth-certificate-issuance-flag.ts","./src/migrations/v2.0/add-resend-invite-notification.ts","./src/migrations/v2.0/checkout-upstream-files.ts","./src/migrations/v2.0/convert-config-files-to-ts.ts","./src/migrations/v2.0/convert-paragraph-to-heading.ts","./src/migrations/v2.0/create-events-index.ts","./src/migrations/v2.0/delete-infrastructure-directory.ts","./src/migrations/v2.0/index.ts","./src/migrations/v2.0/make-built-in-validate-actions-custom.ts","./src/migrations/v2.0/merge-infrastructure-directory.ts","./src/migrations/v2.0/migrate-application-config-url.ts","./src/migrations/v2.0/migrate-scopes.ts","./src/migrations/v2.0/migrate-validated-workqueue-status-to-flag.ts","./src/migrations/v2.0/migrate-workqueue-configs.ts","./src/migrations/v2.0/remove-delete-actions.ts","./src/migrations/v2.0/remove-demo-scope.ts","./src/migrations/v2.0/remove-deprecated-imports.ts","./src/migrations/v2.0/remove-fhir-url-helpers.ts","./src/migrations/v2.0/remove-hearth-migrations.ts","./src/migrations/v2.0/remove-old-statistics-service.ts","./src/migrations/v2.0/remove-pending-certification-flag.ts","./src/migrations/v2.0/remove-review-from-register-action.ts","./src/migrations/v2.0/remove-unused-environment-variables.ts","./src/migrations/v2.0/rename-api-paths.ts","./src/migrations/v2.0/rename-location-parent-id.ts","./src/migrations/v2.0/simplify-analytics-precalculations.ts","./src/migrations/v2.0/update-package-json.ts","./src/notification/index.ts","./src/scopes/index.ts"],"version":"5.6.3"}
|
|
1
|
+
{"root":["./src/cli.ts","./src/api/index.ts","./src/application-config/index.ts","./src/conditionals/index.ts","./src/events/deduplication.ts","./src/events/index.ts","./src/migrations/v2.0/add-birth-certificate-issuance-flag.ts","./src/migrations/v2.0/add-resend-invite-notification.ts","./src/migrations/v2.0/checkout-upstream-files.ts","./src/migrations/v2.0/convert-config-files-to-ts.ts","./src/migrations/v2.0/convert-paragraph-to-heading.ts","./src/migrations/v2.0/create-events-index.ts","./src/migrations/v2.0/delete-infrastructure-directory.ts","./src/migrations/v2.0/fix-action-confirmation-handler-type.ts","./src/migrations/v2.0/index.ts","./src/migrations/v2.0/make-built-in-validate-actions-custom.ts","./src/migrations/v2.0/merge-infrastructure-directory.ts","./src/migrations/v2.0/migrate-application-config-url.ts","./src/migrations/v2.0/migrate-scopes.ts","./src/migrations/v2.0/migrate-validated-workqueue-status-to-flag.ts","./src/migrations/v2.0/migrate-workqueue-configs.ts","./src/migrations/v2.0/remove-delete-actions.ts","./src/migrations/v2.0/remove-demo-scope.ts","./src/migrations/v2.0/remove-deprecated-imports.ts","./src/migrations/v2.0/remove-fhir-url-helpers.ts","./src/migrations/v2.0/remove-hearth-migrations.ts","./src/migrations/v2.0/remove-old-statistics-service.ts","./src/migrations/v2.0/remove-pending-certification-flag.ts","./src/migrations/v2.0/remove-review-from-register-action.ts","./src/migrations/v2.0/remove-unused-environment-variables.ts","./src/migrations/v2.0/rename-api-paths.ts","./src/migrations/v2.0/rename-location-parent-id.ts","./src/migrations/v2.0/simplify-analytics-precalculations.ts","./src/migrations/v2.0/update-package-json.ts","./src/notification/index.ts","./src/scopes/index.ts"],"version":"5.6.3"}
|
|
Binary file
|