@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/index.cjs
CHANGED
|
@@ -4238,6 +4238,19 @@ function resolveParamClass(method, decoratorName, sourceFile, project) {
|
|
|
4238
4238
|
|
|
4239
4239
|
// src/discovery/heritage.ts
|
|
4240
4240
|
var import_ts_morph8 = require("ts-morph");
|
|
4241
|
+
function resolveHeritageCall(node) {
|
|
4242
|
+
if (!node) return void 0;
|
|
4243
|
+
const expr = unwrapExpression(node);
|
|
4244
|
+
if (import_ts_morph8.Node.isCallExpression(expr)) return expr;
|
|
4245
|
+
if (!import_ts_morph8.Node.isIdentifier(expr)) return void 0;
|
|
4246
|
+
const decl = expr.getDefinitions().map((d) => d.getDeclarationNode()).find(
|
|
4247
|
+
(n) => n !== void 0 && import_ts_morph8.Node.isVariableDeclaration(n)
|
|
4248
|
+
);
|
|
4249
|
+
const init = decl?.getInitializer();
|
|
4250
|
+
if (!init) return void 0;
|
|
4251
|
+
const unwrapped = unwrapExpression(init);
|
|
4252
|
+
return import_ts_morph8.Node.isCallExpression(unwrapped) ? unwrapped : void 0;
|
|
4253
|
+
}
|
|
4241
4254
|
function unwrapExpression(node) {
|
|
4242
4255
|
let current = node;
|
|
4243
4256
|
while (import_ts_morph8.Node.isAsExpression(current) || import_ts_morph8.Node.isSatisfiesExpression(current) || import_ts_morph8.Node.isParenthesizedExpression(current) || import_ts_morph8.Node.isTypeAssertion(current)) {
|
|
@@ -4265,8 +4278,8 @@ function resolveReturnedClass(factoryDecl) {
|
|
|
4265
4278
|
return void 0;
|
|
4266
4279
|
}
|
|
4267
4280
|
function resolveInheritedMethods(cls) {
|
|
4268
|
-
const expr = cls.getExtends()?.getExpression();
|
|
4269
|
-
if (!expr
|
|
4281
|
+
const expr = resolveHeritageCall(cls.getExtends()?.getExpression());
|
|
4282
|
+
if (!expr) return void 0;
|
|
4270
4283
|
const callee = expr.getExpression();
|
|
4271
4284
|
if (!import_ts_morph8.Node.isIdentifier(callee)) return void 0;
|
|
4272
4285
|
const factoryDecl = callee.getDefinitions().map((d) => d.getDeclarationNode()).find((n) => import_ts_morph8.Node.isFunctionDeclaration(n));
|
|
@@ -4821,9 +4834,11 @@ function extractFromSourceFile(sourceFile, project) {
|
|
|
4821
4834
|
factoryFilePath: inherited.factoryFilePath,
|
|
4822
4835
|
classArgs: inherited.classArgs
|
|
4823
4836
|
} : void 0;
|
|
4837
|
+
const ownMethods = cls.getMethods();
|
|
4838
|
+
const ownNames = new Set(ownMethods.map((m) => m.getName()));
|
|
4824
4839
|
const methods = [
|
|
4825
|
-
...
|
|
4826
|
-
...(inherited?.methods ?? []).map((method) => ({ method, mixin: mixinBinding }))
|
|
4840
|
+
...ownMethods.map((method) => ({ method, mixin: mixinBinding })),
|
|
4841
|
+
...(inherited?.methods ?? []).filter((method) => !ownNames.has(method.getName())).map((method) => ({ method, mixin: mixinBinding }))
|
|
4827
4842
|
];
|
|
4828
4843
|
for (const { method, mixin } of methods) {
|
|
4829
4844
|
const verb = resolveVerb(method);
|
|
@@ -5132,7 +5147,7 @@ function createChainModuleRenderer(opts) {
|
|
|
5132
5147
|
}
|
|
5133
5148
|
|
|
5134
5149
|
// src/index.ts
|
|
5135
|
-
var VERSION = "0.17.
|
|
5150
|
+
var VERSION = "0.17.1";
|
|
5136
5151
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5137
5152
|
0 && (module.exports = {
|
|
5138
5153
|
CodegenError,
|