@sdk-usage/plugin-typescript 0.0.0-next-ed7a1ee → 0.1.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/dist/index.cjs ADDED
@@ -0,0 +1,21 @@
1
+ let _sdk_usage_core = require("@sdk-usage/core");
2
+
3
+ //#region src/index.ts
4
+ var src_default = (0, _sdk_usage_core.createPlugin)((context) => {
5
+ return { TsType(node) {
6
+ let typeValue = "";
7
+ if (node.type === "TsTypeReference" && node.typeName.type === "Identifier") typeValue = node.typeName.value;
8
+ if (node.type === "TsIndexedAccessType" && node.objectType.type === "TsTypeReference" && node.objectType.typeName.type === "Identifier") typeValue = node.objectType.typeName.value;
9
+ const importMetadata = context.imports.get(typeValue);
10
+ if (!importMetadata) return;
11
+ return {
12
+ module: importMetadata.module,
13
+ name: importMetadata.name,
14
+ offset: node.span.start,
15
+ type: "typescript/type"
16
+ };
17
+ } };
18
+ });
19
+
20
+ //#endregion
21
+ module.exports = src_default;
@@ -0,0 +1,4 @@
1
+ //#region src/index.d.ts
2
+ declare const _default: import("@sdk-usage/core").Plugin;
3
+ //#endregion
4
+ export { _default as default };
package/dist/index.mjs ADDED
@@ -0,0 +1,21 @@
1
+ import { createPlugin } from "@sdk-usage/core";
2
+
3
+ //#region src/index.ts
4
+ var src_default = createPlugin((context) => {
5
+ return { TsType(node) {
6
+ let typeValue = "";
7
+ if (node.type === "TsTypeReference" && node.typeName.type === "Identifier") typeValue = node.typeName.value;
8
+ if (node.type === "TsIndexedAccessType" && node.objectType.type === "TsTypeReference" && node.objectType.typeName.type === "Identifier") typeValue = node.objectType.typeName.value;
9
+ const importMetadata = context.imports.get(typeValue);
10
+ if (!importMetadata) return;
11
+ return {
12
+ module: importMetadata.module,
13
+ name: importMetadata.name,
14
+ offset: node.span.start,
15
+ type: "typescript/type"
16
+ };
17
+ } };
18
+ });
19
+
20
+ //#endregion
21
+ export { src_default as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdk-usage/plugin-typescript",
3
- "version": "0.0.0-next-ed7a1ee",
3
+ "version": "0.1.0",
4
4
  "description": "sdk-usage parser plugin to enable types syntax analysis",
5
5
  "keywords": [
6
6
  "analyze",
@@ -42,10 +42,10 @@
42
42
  "devDependencies": {
43
43
  "@types/node": "24.12.4",
44
44
  "quickbundle": "3.0.0",
45
- "@sdk-usage/core": "0.0.0-next-ed7a1ee"
45
+ "@sdk-usage/core": "0.1.0"
46
46
  },
47
47
  "peerDependencies": {
48
- "@sdk-usage/core": "<1.0.0"
48
+ "@sdk-usage/core": "^0.0.0 || <1.0.0"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public",