@rxap/ts-morph 1.5.5 → 1.6.0-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 CHANGED
@@ -3,6 +3,16 @@
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
+ # [1.6.0-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.5.6-dev.0...@rxap/ts-morph@1.6.0-dev.0) (2025-09-01)
7
+
8
+ ### Features
9
+
10
+ - **ts-morph:** add utilities for coercing interface and function declarations ([6b1b5ff](https://gitlab.com/rxap/packages/commit/6b1b5ff6552a22be754bac3077887e9202fa7d4a))
11
+
12
+ ## [1.5.6-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.5.5...@rxap/ts-morph@1.5.6-dev.0) (2025-05-19)
13
+
14
+ **Note:** Version bump only for package @rxap/ts-morph
15
+
6
16
  ## [1.5.5](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.5.5-dev.0...@rxap/ts-morph@1.5.5) (2025-05-16)
7
17
 
8
18
  **Note:** Version bump only for package @rxap/ts-morph
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
- "version": "1.5.5",
2
+ "version": "1.6.0-dev.0",
3
3
  "name": "@rxap/ts-morph",
4
4
  "description": "Provides utilities for manipulating TypeScript code using the ts-morph library. It offers a fluent API to add, modify, and remove code elements such as classes, decorators, imports, and properties in both Angular and NestJS projects. This package simplifies common code generation and refactoring tasks.\n",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "dependencies": {
7
7
  "@nx/devkit": "20.5.0",
8
- "@rxap/utilities": "^16.4.4",
8
+ "@rxap/utilities": "^16.4.5-dev.0",
9
9
  "colors": "^1.4.0",
10
10
  "ts-morph": "^18.0.0",
11
11
  "tslib": "2.6.2"
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "schematics": "./generators.json",
46
46
  "type": "commonjs",
47
- "gitHead": "3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa",
47
+ "gitHead": "431b4c9f4e367db6ef8a07c59d8fc251962141e5",
48
48
  "types": "./src/index.d.ts",
49
49
  "main": "./src/index.js"
50
50
  }
package/src/index.d.ts CHANGED
@@ -63,7 +63,9 @@ export * from './lib/coerce-decorator';
63
63
  export * from './lib/coerce-default-class-export';
64
64
  export * from './lib/coerce-default-export';
65
65
  export * from './lib/coerce-dependency-injection';
66
+ export * from './lib/coerce-function';
66
67
  export * from './lib/coerce-imports';
68
+ export * from './lib/coerce-interface';
67
69
  export * from './lib/coerce-mapping-class-method';
68
70
  export * from './lib/coerce-property-assignment';
69
71
  export * from './lib/coerce-property-declaration';
package/src/index.js CHANGED
@@ -71,7 +71,9 @@ tslib_1.__exportStar(require("./lib/coerce-decorator"), exports);
71
71
  tslib_1.__exportStar(require("./lib/coerce-default-class-export"), exports);
72
72
  tslib_1.__exportStar(require("./lib/coerce-default-export"), exports);
73
73
  tslib_1.__exportStar(require("./lib/coerce-dependency-injection"), exports);
74
+ tslib_1.__exportStar(require("./lib/coerce-function"), exports);
74
75
  tslib_1.__exportStar(require("./lib/coerce-imports"), exports);
76
+ tslib_1.__exportStar(require("./lib/coerce-interface"), exports);
75
77
  tslib_1.__exportStar(require("./lib/coerce-mapping-class-method"), exports);
76
78
  tslib_1.__exportStar(require("./lib/coerce-property-assignment"), exports);
77
79
  tslib_1.__exportStar(require("./lib/coerce-property-declaration"), exports);
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/ts-morph/src/index.ts"],"names":[],"mappings":";;;AAAA,cAAc;AACd,mFAAyD;AACzD,+EAAqD;AACrD,sEAA4C;AAC5C,8EAAoD;AACpD,4EAAkD;AAClD,6EAAmD;AACnD,0EAAgD;AAChD,4EAAkD;AAClD,gFAAsD;AACtD,4EAAkD;AAClD,qFAA2D;AAC3D,sFAA4D;AAC5D,4EAAkD;AAClD,oFAA0D;AAC1D,sFAA4D;AAC5D,mFAAyD;AACzD,+EAAqD;AACrD,iFAAuD;AACvD,wEAA8C;AAC9C,2EAAiD;AACjD,mFAAyD;AACzD,yFAA+D;AAC/D,wEAA8C;AAC9C,kFAAwD;AACxD,0EAAgD;AAChD,8EAAoD;AACpD,2EAAiD;AACjD,4EAAkD;AAClD,0EAAgD;AAChD,0EAAgD;AAChD,4EAAkD;AAClD,+EAAqD;AACrD,iFAAuD;AACvD,mFAAyD;AACzD,YAAY;AAEZ,iBAAiB;AACjB,kEAAwC;AACxC,2EAAiD;AACjD,mFAAyD;AACzD,8EAAoD;AACpD,0EAAgD;AAChD,gFAAsD;AACtD,+EAAqD;AACrD,yEAA+C;AAC/C,iFAAuD;AACvD,6EAAmD;AACnD,+EAAqD;AACrD,2EAAiD;AACjD,sEAA4C;AAC5C,uEAA6C;AAC7C,4EAAkD;AAClD,0EAAgD;AAChD,4EAAkD;AAClD,uFAA6D;AAC7D,gFAAsD;AACtD,qEAA2C;AAC3C,YAAY;AAEZ,UAAU;AACV,sEAA4C;AAC5C,4EAAkD;AAClD,qEAA2C;AAC3C,yEAA+C;AAC/C,oEAA0C;AAC1C,sEAA4C;AAC5C,6DAAmC;AACnC,iEAAuC;AACvC,4EAAkD;AAClD,sEAA4C;AAC5C,4EAAkD;AAClD,+DAAqC;AACrC,4EAAkD;AAClD,2EAAiD;AACjD,4EAAkD;AAClD,mEAAyC;AACzC,kEAAwC;AACxC,4EAAkD;AAClD,+DAAqC;AACrC,8DAAoC;AACpC,8DAAoC;AACpC,8EAAoD;AACpD,0DAAgC;AAChC,6FAAmE;AACnE,0EAAgD;AAChD,2DAAiC;AACjC,kEAAwC;AACxC,gEAAsC;AACtC,kEAAwC;AACxC,4DAAkC;AAClC,iEAAuC;AACvC,2DAAiC;AACjC,YAAY"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/ts-morph/src/index.ts"],"names":[],"mappings":";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C,6FAAmE;AACnE,0EAAgD;AAChD,2DAAiC;AACjC,kEAAwC;AACxC,gEAAsC;AACtC,kEAAwC;AACxC,4DAAkC;AAClC,iEAAuC;AACvC,2DAAiC;AACjC,YAAY"}
@@ -0,0 +1,2 @@
1
+ import { FunctionDeclarationStructure, SourceFile } from 'ts-morph';
2
+ export declare function CoerceFunction(sourceFile: SourceFile, name: string, structure?: Omit<Partial<FunctionDeclarationStructure>, 'name'>): import("ts-morph").FunctionDeclaration;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CoerceFunction = CoerceFunction;
4
+ function CoerceFunction(sourceFile, name, structure = {}) {
5
+ const functionDeclaration = sourceFile.getFunction(name) || sourceFile.addFunction({ name });
6
+ functionDeclaration.set(structure);
7
+ return functionDeclaration;
8
+ }
9
+ //# sourceMappingURL=coerce-function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coerce-function.js","sourceRoot":"","sources":["../../../../../packages/ts-morph/src/lib/coerce-function.ts"],"names":[],"mappings":";;AAKA,wCAQC;AARD,SAAgB,cAAc,CAC5B,UAAsB,EACtB,IAAY,EACZ,YAAiE,EAAE;IAEnE,MAAM,mBAAmB,GAAG,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7F,mBAAmB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACnC,OAAO,mBAAmB,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { InterfaceDeclarationStructure, OptionalKind, SourceFile } from 'ts-morph';
2
+ export declare function CoerceInterface(sourceFile: SourceFile, interfaceName: string, structure?: Omit<OptionalKind<InterfaceDeclarationStructure>, 'name'>): import("ts-morph").InterfaceDeclaration;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CoerceInterface = CoerceInterface;
4
+ function CoerceInterface(sourceFile, interfaceName, structure = {}) {
5
+ let interfaceDeclaration = sourceFile.getInterface(interfaceName);
6
+ if (!interfaceDeclaration) {
7
+ interfaceDeclaration = sourceFile.addInterface(Object.assign(Object.assign({}, structure), { name: interfaceName }));
8
+ }
9
+ return interfaceDeclaration;
10
+ }
11
+ //# sourceMappingURL=coerce-interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coerce-interface.js","sourceRoot":"","sources":["../../../../../packages/ts-morph/src/lib/coerce-interface.ts"],"names":[],"mappings":";;AAMA,0CAaC;AAbD,SAAgB,eAAe,CAC7B,UAAsB,EACtB,aAAqB,EACrB,YAAuE,EAAE;IAEzE,IAAI,oBAAoB,GAAG,UAAU,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IAClE,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC1B,oBAAoB,GAAG,UAAU,CAAC,YAAY,iCACzC,SAAS,KACZ,IAAI,EAAE,aAAa,IACnB,CAAC;IACL,CAAC;IACD,OAAO,oBAAoB,CAAC;AAC9B,CAAC"}