@dudousxd/nestjs-codegen 0.17.0 → 0.17.1
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 +23 -0
- package/dist/cli/main.cjs +20 -5
- package/dist/cli/main.cjs.map +1 -1
- package/dist/cli/main.js +20 -5
- package/dist/cli/main.js.map +1 -1
- package/dist/index.cjs +20 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +20 -5
- package/dist/index.js.map +1 -1
- package/dist/nest/index.cjs +20 -5
- package/dist/nest/index.cjs.map +1 -1
- package/dist/nest/index.js +20 -5
- package/dist/nest/index.js.map +1 -1
- package/package.json +1 -1
package/dist/nest/index.js
CHANGED
|
@@ -3996,6 +3996,19 @@ function resolveParamClass(method, decoratorName, sourceFile, project) {
|
|
|
3996
3996
|
|
|
3997
3997
|
// src/discovery/heritage.ts
|
|
3998
3998
|
import { Node as Node7, Project as Project3 } from "ts-morph";
|
|
3999
|
+
function resolveHeritageCall(node) {
|
|
4000
|
+
if (!node) return void 0;
|
|
4001
|
+
const expr = unwrapExpression(node);
|
|
4002
|
+
if (Node7.isCallExpression(expr)) return expr;
|
|
4003
|
+
if (!Node7.isIdentifier(expr)) return void 0;
|
|
4004
|
+
const decl = expr.getDefinitions().map((d) => d.getDeclarationNode()).find(
|
|
4005
|
+
(n) => n !== void 0 && Node7.isVariableDeclaration(n)
|
|
4006
|
+
);
|
|
4007
|
+
const init = decl?.getInitializer();
|
|
4008
|
+
if (!init) return void 0;
|
|
4009
|
+
const unwrapped = unwrapExpression(init);
|
|
4010
|
+
return Node7.isCallExpression(unwrapped) ? unwrapped : void 0;
|
|
4011
|
+
}
|
|
3999
4012
|
function unwrapExpression(node) {
|
|
4000
4013
|
let current = node;
|
|
4001
4014
|
while (Node7.isAsExpression(current) || Node7.isSatisfiesExpression(current) || Node7.isParenthesizedExpression(current) || Node7.isTypeAssertion(current)) {
|
|
@@ -4023,8 +4036,8 @@ function resolveReturnedClass(factoryDecl) {
|
|
|
4023
4036
|
return void 0;
|
|
4024
4037
|
}
|
|
4025
4038
|
function resolveInheritedMethods(cls) {
|
|
4026
|
-
const expr = cls.getExtends()?.getExpression();
|
|
4027
|
-
if (!expr
|
|
4039
|
+
const expr = resolveHeritageCall(cls.getExtends()?.getExpression());
|
|
4040
|
+
if (!expr) return void 0;
|
|
4028
4041
|
const callee = expr.getExpression();
|
|
4029
4042
|
if (!Node7.isIdentifier(callee)) return void 0;
|
|
4030
4043
|
const factoryDecl = callee.getDefinitions().map((d) => d.getDeclarationNode()).find((n) => Node7.isFunctionDeclaration(n));
|
|
@@ -4560,9 +4573,11 @@ function extractFromSourceFile(sourceFile, project) {
|
|
|
4560
4573
|
factoryFilePath: inherited.factoryFilePath,
|
|
4561
4574
|
classArgs: inherited.classArgs
|
|
4562
4575
|
} : void 0;
|
|
4576
|
+
const ownMethods = cls.getMethods();
|
|
4577
|
+
const ownNames = new Set(ownMethods.map((m) => m.getName()));
|
|
4563
4578
|
const methods = [
|
|
4564
|
-
...
|
|
4565
|
-
...(inherited?.methods ?? []).map((method) => ({ method, mixin: mixinBinding }))
|
|
4579
|
+
...ownMethods.map((method) => ({ method, mixin: mixinBinding })),
|
|
4580
|
+
...(inherited?.methods ?? []).filter((method) => !ownNames.has(method.getName())).map((method) => ({ method, mixin: mixinBinding }))
|
|
4566
4581
|
];
|
|
4567
4582
|
for (const { method, mixin } of methods) {
|
|
4568
4583
|
const verb = resolveVerb(method);
|
|
@@ -4788,7 +4803,7 @@ async function watch(config, onChange, options = {}) {
|
|
|
4788
4803
|
}
|
|
4789
4804
|
|
|
4790
4805
|
// src/index.ts
|
|
4791
|
-
var VERSION = "0.17.
|
|
4806
|
+
var VERSION = "0.17.1";
|
|
4792
4807
|
|
|
4793
4808
|
// src/generate-manifest.ts
|
|
4794
4809
|
var MANIFEST_FILE = ".codegen-manifest.json";
|