@jay-framework/typescript-bridge 0.15.5 → 0.15.6
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.d.ts +9 -13
- package/dist/index.js +13 -27
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as typescript from 'typescript';
|
|
2
|
+
export { typescript as TypeScript };
|
|
3
|
+
|
|
2
4
|
declare const tsModule: typeof typescript;
|
|
3
5
|
/**
|
|
4
6
|
* Re-export the TypeScript module to avoid ESM/CommonJS compatibility issues
|
|
5
7
|
* This allows importing TypeScript in a consistent way across the project
|
|
6
8
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* Re-export the TypeScript types for use in type annotations
|
|
10
|
-
*/
|
|
11
|
-
export type { typescript as TypeScript };
|
|
9
|
+
declare const ts: typeof typescript;
|
|
10
|
+
|
|
12
11
|
/**
|
|
13
12
|
* Create a proxy that forwards all property access to the TypeScript module
|
|
14
13
|
* This allows accessing any TypeScript utility without explicitly listing them
|
|
15
14
|
*/
|
|
16
|
-
|
|
15
|
+
declare const tsBridge: typeof typescript;
|
|
17
16
|
/**
|
|
18
17
|
* Alternative approach: Create a function that returns any TypeScript utility
|
|
19
18
|
* Usage: getTs('isIdentifier')(node)
|
|
20
19
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* Usage: import tsBridge, { ts } from '@jay-framework/typescript-bridge'
|
|
25
|
-
*/
|
|
26
|
-
export default tsBridge;
|
|
20
|
+
declare function getTs<T extends keyof typeof tsModule>(utilName: T): (typeof tsModule)[T];
|
|
21
|
+
|
|
22
|
+
export { tsBridge as default, getTs, ts, tsBridge };
|
package/dist/index.js
CHANGED
|
@@ -1,29 +1,15 @@
|
|
|
1
|
-
import { createRequire } from
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* This allows importing TypeScript in a consistent way across the project
|
|
7
|
-
*/
|
|
8
|
-
export const ts = tsModule;
|
|
9
|
-
/**
|
|
10
|
-
* Create a proxy that forwards all property access to the TypeScript module
|
|
11
|
-
* This allows accessing any TypeScript utility without explicitly listing them
|
|
12
|
-
*/
|
|
13
|
-
export const tsBridge = new Proxy(tsModule, {
|
|
14
|
-
get(target, prop) {
|
|
15
|
-
return target[prop];
|
|
16
|
-
},
|
|
1
|
+
import { createRequire as o } from "module";
|
|
2
|
+
const s = o(import.meta.url), e = s("typescript"), u = e, c = new Proxy(e, {
|
|
3
|
+
get(t, r) {
|
|
4
|
+
return t[r];
|
|
5
|
+
}
|
|
17
6
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* Usage: getTs('isIdentifier')(node)
|
|
21
|
-
*/
|
|
22
|
-
export function getTs(utilName) {
|
|
23
|
-
return tsModule[utilName];
|
|
7
|
+
function i(t) {
|
|
8
|
+
return e[t];
|
|
24
9
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
10
|
+
export {
|
|
11
|
+
c as default,
|
|
12
|
+
i as getTs,
|
|
13
|
+
u as ts,
|
|
14
|
+
c as tsBridge
|
|
15
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jay-framework/typescript-bridge",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "TypeScript CommonJS to ESM bridge for seamless TypeScript utility access",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"typescript": "^5.3.3"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@jay-framework/dev-environment": "^0.15.
|
|
30
|
+
"@jay-framework/dev-environment": "^0.15.6",
|
|
31
31
|
"@types/node": "^20.11.5",
|
|
32
32
|
"rimraf": "^5.0.5",
|
|
33
33
|
"tsup": "^8.0.1",
|