module-tsx 0.0.2 → 0.0.3
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/README.md +17 -5
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -62,13 +62,22 @@ const react = await m.import("react");
|
|
|
62
62
|
const app = await m.import("./app.tsx");
|
|
63
63
|
|
|
64
64
|
// Import from an in-memory string
|
|
65
|
-
const { x } = await m.importCode(
|
|
65
|
+
const { x } = await m.importCode(
|
|
66
|
+
document.location.href,
|
|
67
|
+
`export const x: number = 1`,
|
|
68
|
+
);
|
|
66
69
|
|
|
67
70
|
// Events
|
|
68
71
|
m.addEventListener("import", (e) => console.log("loading", e.detail.id));
|
|
69
|
-
m.addEventListener("import:error", (e) =>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
m.addEventListener("import:error", (e) =>
|
|
73
|
+
console.error("failed", e.detail.id, e.detail.error),
|
|
74
|
+
);
|
|
75
|
+
m.addEventListener("transform", (e) =>
|
|
76
|
+
console.log("compiling", e.detail.sourceUrl),
|
|
77
|
+
);
|
|
78
|
+
m.addEventListener("transform:error", (e) =>
|
|
79
|
+
console.error("compile error", e.detail.sourceUrl, e.detail.error),
|
|
80
|
+
);
|
|
72
81
|
```
|
|
73
82
|
|
|
74
83
|
## Use with AI
|
|
@@ -88,7 +97,10 @@ npx skills add yieldray/module-tsx
|
|
|
88
97
|
<script type="module" src="https://esm.sh/module-tsx"></script>
|
|
89
98
|
|
|
90
99
|
<!-- ESM (self-contained, no external dependencies) -->
|
|
91
|
-
<script
|
|
100
|
+
<script
|
|
101
|
+
type="module"
|
|
102
|
+
src="https://raw.esm.sh/module-tsx/dist/index.mjs"
|
|
103
|
+
></script>
|
|
92
104
|
|
|
93
105
|
<!-- UMD (exposes window.ModuleTSX) -->
|
|
94
106
|
<script src="https://raw.esm.sh/module-tsx/dist/index.umd.js"></script>
|
package/package.json
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "module-tsx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
7
7
|
],
|
|
8
|
-
"main": "dist/index.
|
|
8
|
+
"main": "dist/index.mjs",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
10
|
-
"browser": "dist/index.mjs",
|
|
11
10
|
"scripts": {
|
|
12
11
|
"build": "tsdown",
|
|
13
|
-
"test": "node --
|
|
12
|
+
"test": "node --test 'src/*.test.ts'"
|
|
14
13
|
},
|
|
15
14
|
"dependencies": {
|
|
16
15
|
"typescript": "^5.9.3"
|
|
17
16
|
},
|
|
18
17
|
"devDependencies": {
|
|
19
|
-
"@types/node": "^24.12.
|
|
18
|
+
"@types/node": "^24.12.3",
|
|
20
19
|
"esbuild": "^0.28.0",
|
|
21
20
|
"tsdown": "^0.22.0"
|
|
22
21
|
},
|
|
@@ -32,5 +31,6 @@
|
|
|
32
31
|
"homepage": "https://github.com/YieldRay/module-tsx#readme",
|
|
33
32
|
"publishConfig": {
|
|
34
33
|
"registry": "https://registry.npmjs.org"
|
|
35
|
-
}
|
|
34
|
+
},
|
|
35
|
+
"packageManager": "pnpm@10.33.4"
|
|
36
36
|
}
|