@comet/upgrade 1.63.0 → 1.65.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.
|
@@ -26,6 +26,9 @@ async function replaceGridColDefImport() {
|
|
|
26
26
|
.getNamedImports()
|
|
27
27
|
.find((namedImport) => namedImport.getText() === "GridColDef")
|
|
28
28
|
?.remove();
|
|
29
|
+
if (dataGridImport.getNamedImports().length === 0) {
|
|
30
|
+
dataGridImport.remove();
|
|
31
|
+
}
|
|
29
32
|
sourceFile.addImportDeclaration({
|
|
30
33
|
namedImports: ["GridColDef"],
|
|
31
34
|
moduleSpecifier: "@comet/admin",
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stage = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const ts_morph_1 = require("ts-morph");
|
|
6
|
+
const package_json_util_1 = require("../util/package-json.util");
|
|
7
|
+
exports.stage = "before-install";
|
|
8
|
+
async function updateSentry() {
|
|
9
|
+
if (!(0, fs_1.existsSync)("api/package.json")) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const packageJson = new package_json_util_1.PackageJson("api/package.json");
|
|
13
|
+
packageJson.updateDependency("@sentry/node", "^9.0.0");
|
|
14
|
+
packageJson.save();
|
|
15
|
+
const project = new ts_morph_1.Project({ tsConfigFilePath: "./api/tsconfig.json" });
|
|
16
|
+
const sourceFile = project.getSourceFile("api/src/main.ts");
|
|
17
|
+
if (!sourceFile)
|
|
18
|
+
throw new Error("main.ts not found");
|
|
19
|
+
sourceFile.getDescendantsOfKind(ts_morph_1.SyntaxKind.ExpressionStatement).forEach((node) => {
|
|
20
|
+
if (node.getText() === "app.use(Sentry.Handlers.requestHandler());") {
|
|
21
|
+
node.replaceWithText(`Sentry.setupExpressErrorHandler(app);`);
|
|
22
|
+
}
|
|
23
|
+
else if (node.getText() === "app.use(Sentry.Handlers.tracingHandler());") {
|
|
24
|
+
node.remove();
|
|
25
|
+
}
|
|
26
|
+
else if (node.getText() === "app.use(Sentry.Handlers.errorHandler());") {
|
|
27
|
+
node.remove();
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
await sourceFile.save();
|
|
31
|
+
}
|
|
32
|
+
exports.default = updateSentry;
|