@jay-framework/typescript-bridge 0.16.3 → 0.16.5

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