@rxap/nest-logger 10.2.0 → 10.2.1-dev.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.
- package/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/migrations.json +9 -0
- package/package.json +9 -3
- package/src/lib/logger.module.js +7 -1
- package/src/lib/logger.module.js.map +1 -1
- package/src/migrations/10.0.0/replace-setup-function-with-module-import/replace-setup-function-with-module-import.d.ts +2 -0
- package/src/migrations/10.0.0/replace-setup-function-with-module-import/replace-setup-function-with-module-import.js +46 -0
- package/src/migrations/10.0.0/replace-setup-function-with-module-import/replace-setup-function-with-module-import.js.map +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [10.2.1-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/nest-logger@10.2.0...@rxap/nest-logger@10.2.1-dev.0) (2024-05-31)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- use the rxap logger as logger ([2d655ba](https://gitlab.com/rxap/packages/commit/2d655bad802e4b524575b0dd7a6fbd8e9e2fea11))
|
|
11
|
+
|
|
6
12
|
# [10.2.0](https://gitlab.com/rxap/packages/compare/@rxap/nest-logger@10.0.2-dev.1...@rxap/nest-logger@10.2.0) (2024-05-30)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @rxap/nest-logger
|
package/README.md
CHANGED
package/migrations.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"generators": {
|
|
3
|
+
"replace-setup-function-with-module-import": {
|
|
4
|
+
"version": "10.2.1-dev.0",
|
|
5
|
+
"description": "Replace the use of the app.useLogger function with an LoggerModule import",
|
|
6
|
+
"implementation": "./src/migrations/10.0.0/replace-setup-function-with-module-import/replace-setup-function-with-module-import"
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "10.2.0",
|
|
2
|
+
"version": "10.2.1-dev.0",
|
|
3
3
|
"name": "@rxap/nest-logger",
|
|
4
4
|
"license": "GPL-3.0-or-later",
|
|
5
5
|
"dependencies": {
|
|
6
|
+
"@nx/devkit": "19.1.1",
|
|
6
7
|
"tslib": "2.6.2"
|
|
7
8
|
},
|
|
8
9
|
"peerDependencies": {
|
|
9
|
-
"@nestjs/common": "^10.3.8"
|
|
10
|
+
"@nestjs/common": "^10.3.8",
|
|
11
|
+
"@rxap/ts-morph": "*",
|
|
12
|
+
"@rxap/workspace-utilities": "*"
|
|
10
13
|
},
|
|
11
14
|
"author": {
|
|
12
15
|
"name": "Merzough Münker",
|
|
@@ -25,6 +28,9 @@
|
|
|
25
28
|
"rxap",
|
|
26
29
|
"scope:utilities"
|
|
27
30
|
],
|
|
31
|
+
"ng-update": {
|
|
32
|
+
"migrations": "./migrations.json"
|
|
33
|
+
},
|
|
28
34
|
"nx-migrations": {
|
|
29
35
|
"packageGroup": [
|
|
30
36
|
{
|
|
@@ -43,6 +49,6 @@
|
|
|
43
49
|
"directory": "packages/nest/logger"
|
|
44
50
|
},
|
|
45
51
|
"type": "commonjs",
|
|
46
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "41ec24b8d91caeefbf6ad32f39d813cb114a62cc",
|
|
47
53
|
"main": "./src/index.js"
|
|
48
54
|
}
|
package/src/lib/logger.module.js
CHANGED
|
@@ -3,13 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LoggerModule = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const common_1 = require("@nestjs/common");
|
|
6
|
+
const logger_1 = require("./logger");
|
|
6
7
|
let LoggerModule = class LoggerModule {
|
|
7
8
|
};
|
|
8
9
|
exports.LoggerModule = LoggerModule;
|
|
9
10
|
exports.LoggerModule = LoggerModule = tslib_1.__decorate([
|
|
10
11
|
(0, common_1.Global)(),
|
|
11
12
|
(0, common_1.Module)({
|
|
12
|
-
providers: [
|
|
13
|
+
providers: [
|
|
14
|
+
{
|
|
15
|
+
provide: common_1.Logger,
|
|
16
|
+
useClass: logger_1.RxapLogger,
|
|
17
|
+
},
|
|
18
|
+
],
|
|
13
19
|
exports: [common_1.Logger],
|
|
14
20
|
})
|
|
15
21
|
], LoggerModule);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.module.js","sourceRoot":"","sources":["../../../../../../packages/nest/logger/src/lib/logger.module.ts"],"names":[],"mappings":";;;;AAAA,2CAIwB;
|
|
1
|
+
{"version":3,"file":"logger.module.js","sourceRoot":"","sources":["../../../../../../packages/nest/logger/src/lib/logger.module.ts"],"names":[],"mappings":";;;;AAAA,2CAIwB;AACxB,qCAAsC;AAY/B,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IAVxB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT;gBACE,OAAO,EAAE,eAAM;gBACf,QAAQ,EAAE,mBAAU;aACrB;SACF;QACD,OAAO,EAAE,CAAE,eAAM,CAAE;KACpB,CAAC;GACW,YAAY,CAAG"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ts_morph_1 = require("@rxap/ts-morph");
|
|
4
|
+
const workspace_utilities_1 = require("@rxap/workspace-utilities");
|
|
5
|
+
function update(tree) {
|
|
6
|
+
for (const { isFile, path } of (0, workspace_utilities_1.VisitTree)(tree, '/')) {
|
|
7
|
+
if (isFile) {
|
|
8
|
+
if (path.endsWith('main.ts')) {
|
|
9
|
+
let content = tree.read(path, 'utf-8');
|
|
10
|
+
const lineIndex = content.split('\n').findIndex(line => line.includes('app.useLogger(new RxapLogger())'));
|
|
11
|
+
if (lineIndex !== -1) {
|
|
12
|
+
// remove the line from content
|
|
13
|
+
content = content.split('\n').filter((_, index) => index !== lineIndex).join('\n');
|
|
14
|
+
tree.write(path, content);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
if (path.endsWith('app.module.ts')) {
|
|
18
|
+
let content = tree.read(path, 'utf-8');
|
|
19
|
+
if (content.includes('@nestjs/common') && content.includes('@Module')) {
|
|
20
|
+
const project = (0, ts_morph_1.CreateProject)();
|
|
21
|
+
const sourceFile = project.createSourceFile('app.module.ts', content);
|
|
22
|
+
if (!(0, ts_morph_1.HasNestModuleImport)(sourceFile, { moduleName: 'SentryLoggerModule' })) {
|
|
23
|
+
(0, ts_morph_1.CoerceNestModuleImport)(sourceFile, {
|
|
24
|
+
moduleName: 'LoggerModule',
|
|
25
|
+
moduleSpecifier: '@rxap/nest-logger'
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
content = sourceFile.getFullText();
|
|
29
|
+
tree.write(path, content);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (path.endsWith('module.ts')) {
|
|
33
|
+
let content = tree.read(path, 'utf-8');
|
|
34
|
+
if (content.includes('@nestjs/common') && content.includes('@Module')) {
|
|
35
|
+
const project = (0, ts_morph_1.CreateProject)();
|
|
36
|
+
const sourceFile = project.createSourceFile('app.module.ts', content);
|
|
37
|
+
(0, ts_morph_1.RemoveNestModuleProvider)(sourceFile, { providerObject: 'Logger' });
|
|
38
|
+
content = sourceFile.getFullText();
|
|
39
|
+
tree.write(path, content);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.default = update;
|
|
46
|
+
//# sourceMappingURL=replace-setup-function-with-module-import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replace-setup-function-with-module-import.js","sourceRoot":"","sources":["../../../../../../../../packages/nest/logger/src/migrations/10.0.0/replace-setup-function-with-module-import/replace-setup-function-with-module-import.ts"],"names":[],"mappings":";;AAEA,6CAKwB;AACxB,mEAAsD;AAEtD,SAAwB,MAAM,CAAC,IAAU;IAEvC,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,IAAA,+BAAS,EAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;QAEpD,IAAI,MAAM,EAAE,CAAC;YAEX,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC7B,IAAI,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAE,CAAC;gBAExC,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC,CAAC;gBAE1G,IAAI,SAAS,KAAK,CAAC,CAAC,EAAE,CAAC;oBACrB,+BAA+B;oBAC/B,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBACnF,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBAC5B,CAAC;YACH,CAAC;YAED,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;gBACnC,IAAI,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAE,CAAC;gBAExC,IAAI,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;oBACtE,MAAM,OAAO,GAAG,IAAA,wBAAa,GAAE,CAAC;oBAChC,MAA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