@rxap/ts-morph 0.1.0-dev.20 → 0.1.0-dev.21
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/package.json +2 -2
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/lib/type-import.d.ts +11 -0
- package/src/lib/type-import.js +30 -0
- package/src/lib/type-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
|
+
# [0.1.0-dev.21](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@0.1.0-dev.20...@rxap/ts-morph@0.1.0-dev.21) (2023-11-19)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- support complex and importable types ([1636580](https://gitlab.com/rxap/packages/commit/1636580713961324683ea0246e109e35e7efc6c1))
|
|
11
|
+
|
|
6
12
|
# [0.1.0-dev.20](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@0.1.0-dev.19...@rxap/ts-morph@0.1.0-dev.20) (2023-11-18)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.0-dev.
|
|
2
|
+
"version": "0.1.0-dev.21",
|
|
3
3
|
"name": "@rxap/ts-morph",
|
|
4
4
|
"license": "GPL-3.0-or-later",
|
|
5
5
|
"dependencies": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"directory": "packages/ts-morph"
|
|
43
43
|
},
|
|
44
44
|
"type": "commonjs",
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "d176d9da2d3ebf2bb2bb0b0ebde2a3526816f829",
|
|
46
46
|
"main": "./src/index.js",
|
|
47
47
|
"types": "./src/index.d.ts"
|
|
48
48
|
}
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -56,5 +56,6 @@ tslib_1.__exportStar(require("./lib/get-class"), exports);
|
|
|
56
56
|
tslib_1.__exportStar(require("./lib/get-coerce-array-literal-form-object-literal"), exports);
|
|
57
57
|
tslib_1.__exportStar(require("./lib/provider-object"), exports);
|
|
58
58
|
tslib_1.__exportStar(require("./lib/to-mapping-object"), exports);
|
|
59
|
+
tslib_1.__exportStar(require("./lib/type-import"), exports);
|
|
59
60
|
// endregion
|
|
60
61
|
//# sourceMappingURL=index.js.map
|
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,yEAA+C;AAC/C,0EAAgD;AAChD,mFAAyD;AACzD,+EAAqD;AACrD,8EAAoD;AACpD,0EAAgD;AAChD,4EAAkD;AAClD,gFAAsD;AACtD,4EAAkD;AAClD,sFAA4D;AAC5D,4EAAkD;AAClD,sFAA4D;AAC5D,iFAAuD;AACvD,mFAAyD;AACzD,+EAAqD;AACrD,iFAAuD;AACvD,wEAA8C;AAC9C,2EAAiD;AACjD,mFAAyD;AACzD,yFAA+D;AAC/D,kFAAwD;AACxD,0EAAgD;AAChD,8EAAoD;AACpD,2EAAiD;AACjD,0EAAgD;AAChD,0EAAgD;AAChD,4EAAkD;AAClD,iFAAuD;AACvD,mFAAyD;AACzD,YAAY;AAEZ,iBAAiB;AACjB,mFAAyD;AACzD,YAAY;AAEZ,UAAU;AACV,sEAA4C;AAC5C,qEAA2C;AAC3C,yEAA+C;AAC/C,oEAA0C;AAC1C,sEAA4C;AAC5C,6DAAmC;AACnC,iEAAuC;AACvC,4EAAkD;AAClD,+DAAqC;AACrC,4EAAkD;AAClD,mEAAyC;AACzC,kEAAwC;AACxC,4EAAkD;AAClD,+DAAqC;AACrC,8DAAoC;AACpC,8EAAoD;AACpD,0DAAgC;AAChC,6FAAmE;AACnE,gEAAsC;AACtC,kEAAwC;AACxC,YAAY"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/ts-morph/src/index.ts"],"names":[],"mappings":";;;AAAA,cAAc;AACd,yEAA+C;AAC/C,0EAAgD;AAChD,mFAAyD;AACzD,+EAAqD;AACrD,8EAAoD;AACpD,0EAAgD;AAChD,4EAAkD;AAClD,gFAAsD;AACtD,4EAAkD;AAClD,sFAA4D;AAC5D,4EAAkD;AAClD,sFAA4D;AAC5D,iFAAuD;AACvD,mFAAyD;AACzD,+EAAqD;AACrD,iFAAuD;AACvD,wEAA8C;AAC9C,2EAAiD;AACjD,mFAAyD;AACzD,yFAA+D;AAC/D,kFAAwD;AACxD,0EAAgD;AAChD,8EAAoD;AACpD,2EAAiD;AACjD,0EAAgD;AAChD,0EAAgD;AAChD,4EAAkD;AAClD,iFAAuD;AACvD,mFAAyD;AACzD,YAAY;AAEZ,iBAAiB;AACjB,mFAAyD;AACzD,YAAY;AAEZ,UAAU;AACV,sEAA4C;AAC5C,qEAA2C;AAC3C,yEAA+C;AAC/C,oEAA0C;AAC1C,sEAA4C;AAC5C,6DAAmC;AACnC,iEAAuC;AACvC,4EAAkD;AAClD,+DAAqC;AACrC,4EAAkD;AAClD,mEAAyC;AACzC,kEAAwC;AACxC,4EAAkD;AAClD,+DAAqC;AACrC,8DAAoC;AACpC,8EAAoD;AACpD,0DAAgC;AAChC,6FAAmE;AACnE,gEAAsC;AACtC,kEAAwC;AACxC,4DAAkC;AAClC,YAAY"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ImportDeclarationStructure, OptionalKind } from 'ts-morph';
|
|
2
|
+
export interface TypeImport {
|
|
3
|
+
name: string;
|
|
4
|
+
moduleSpecifier?: string | null;
|
|
5
|
+
namedImport?: string | null;
|
|
6
|
+
namespaceImport?: string | null;
|
|
7
|
+
isTypeOnly?: boolean | null;
|
|
8
|
+
defaultImport?: string | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function RequiresTypeImport(typeImport: TypeImport): boolean;
|
|
11
|
+
export declare function TypeImportToImportStructure(typeImport: TypeImport): OptionalKind<ImportDeclarationStructure>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeImportToImportStructure = exports.RequiresTypeImport = void 0;
|
|
4
|
+
function RequiresTypeImport(typeImport) {
|
|
5
|
+
return !!typeImport.moduleSpecifier;
|
|
6
|
+
}
|
|
7
|
+
exports.RequiresTypeImport = RequiresTypeImport;
|
|
8
|
+
function TypeImportToImportStructure(typeImport) {
|
|
9
|
+
if (!typeImport.moduleSpecifier) {
|
|
10
|
+
throw new Error('The moduleSpecifier is required');
|
|
11
|
+
}
|
|
12
|
+
const structure = {
|
|
13
|
+
moduleSpecifier: typeImport.moduleSpecifier,
|
|
14
|
+
};
|
|
15
|
+
if (!typeImport.namedImport && !typeImport.namespaceImport && !typeImport.defaultImport) {
|
|
16
|
+
structure.namedImports = [typeImport.name];
|
|
17
|
+
}
|
|
18
|
+
if (typeImport.namedImport) {
|
|
19
|
+
structure.namedImports = [typeImport.namedImport];
|
|
20
|
+
}
|
|
21
|
+
if (typeImport.namespaceImport) {
|
|
22
|
+
structure.namespaceImport = typeImport.namespaceImport;
|
|
23
|
+
}
|
|
24
|
+
if (typeImport.defaultImport) {
|
|
25
|
+
structure.defaultImport = typeImport.defaultImport;
|
|
26
|
+
}
|
|
27
|
+
return structure;
|
|
28
|
+
}
|
|
29
|
+
exports.TypeImportToImportStructure = TypeImportToImportStructure;
|
|
30
|
+
//# sourceMappingURL=type-import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-import.js","sourceRoot":"","sources":["../../../../../packages/ts-morph/src/lib/type-import.ts"],"names":[],"mappings":";;;AAcA,SAAgB,kBAAkB,CAAC,UAAsB;IACvD,OAAO,CAAC,CAAC,UAAU,CAAC,eAAe,CAAC;AACtC,CAAC;AAFD,gDAEC;AAED,SAAgB,2BAA2B,CAAC,UAAsB;IAChE,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;KACpD;IACD,MAAM,SAAS,GAA6C;QAC1D,eAAe,EAAE,UAAU,CAAC,eAAe;KAC5C,CAAC;IACF,IAAI,CAAC,UAAU,CAAC,WAAW,IAAI,CAAC,UAAU,CAAC,eAAe,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE;QACvF,SAAS,CAAC,YAAY,GAAG,CAAE,UAAU,CAAC,IAAI,CAAE,CAAC;KAC9C;IACD,IAAI,UAAU,CAAC,WAAW,EAAE;QAC1B,SAAS,CAAC,YAAY,GAAG,CAAE,UAAU,CAAC,WAAW,CAAE,CAAC;KACrD;IACD,IAAI,UAAU,CAAC,eAAe,EAAE;QAC9B,SAAS,CAAC,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC;KACxD;IACD,IAAI,UAAU,CAAC,aAAa,EAAE;QAC5B,SAAS,CAAC,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC;KACpD;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AApBD,kEAoBC"}
|