macroforge 0.1.4 → 0.1.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/README.md +13 -15
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# macroforge
|
|
2
2
|
|
|
3
|
+
> **Warning:** This is a work in progress and probably won't work for you. Use at your own risk!
|
|
4
|
+
|
|
3
5
|
TypeScript macro expansion engine powered by Rust and SWC.
|
|
4
6
|
|
|
5
7
|
## Overview
|
|
@@ -214,8 +216,7 @@ napi-build = "2.3.1"
|
|
|
214
216
|
|
|
215
217
|
**src/lib.rs:**
|
|
216
218
|
```rust
|
|
217
|
-
use macroforge_ts::
|
|
218
|
-
use macroforge_ts::ts_quote::body;
|
|
219
|
+
use macroforge_ts::macros::{ts_macro_derive, body};
|
|
219
220
|
use macroforge_ts::ts_syn::{
|
|
220
221
|
Data, DeriveInput, MacroforgeError, TsStream, parse_ts_macro_input,
|
|
221
222
|
};
|
|
@@ -263,19 +264,16 @@ The `ts_template!` and `body!` macros support:
|
|
|
263
264
|
`macroforge_ts` re-exports everything needed for macro development:
|
|
264
265
|
|
|
265
266
|
```rust
|
|
266
|
-
//
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
pub use ts_syn::swc_core;
|
|
277
|
-
pub use ts_syn::swc_common;
|
|
278
|
-
pub use ts_syn::swc_ecma_ast;
|
|
267
|
+
// TypeScript syntax types
|
|
268
|
+
use macroforge_ts::ts_syn::*;
|
|
269
|
+
|
|
270
|
+
// Macro attributes and quote templates
|
|
271
|
+
use macroforge_ts::macros::{ts_macro_derive, body, ts_template, above, below};
|
|
272
|
+
|
|
273
|
+
// SWC modules (for advanced use)
|
|
274
|
+
use macroforge_ts::swc_core;
|
|
275
|
+
use macroforge_ts::swc_common;
|
|
276
|
+
use macroforge_ts::swc_ecma_ast;
|
|
279
277
|
```
|
|
280
278
|
|
|
281
279
|
## Integration
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "macroforge",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "TypeScript macro expansion engine powered by Rust and SWC",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"node": ">= 18"
|
|
42
42
|
},
|
|
43
43
|
"optionalDependencies": {
|
|
44
|
-
"@macroforge/bin-darwin-x64": "0.1.
|
|
45
|
-
"@macroforge/bin-darwin-arm64": "0.1.
|
|
46
|
-
"@macroforge/bin-linux-x64-gnu": "0.1.
|
|
47
|
-
"@macroforge/bin-linux-arm64-gnu": "0.1.
|
|
48
|
-
"@macroforge/bin-win32-x64-msvc": "0.1.
|
|
49
|
-
"@macroforge/bin-win32-arm64-msvc": "0.1.
|
|
44
|
+
"@macroforge/bin-darwin-x64": "0.1.6",
|
|
45
|
+
"@macroforge/bin-darwin-arm64": "0.1.6",
|
|
46
|
+
"@macroforge/bin-linux-x64-gnu": "0.1.6",
|
|
47
|
+
"@macroforge/bin-linux-arm64-gnu": "0.1.6",
|
|
48
|
+
"@macroforge/bin-win32-x64-msvc": "0.1.6",
|
|
49
|
+
"@macroforge/bin-win32-arm64-msvc": "0.1.6"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"artifacts": "napi artifacts --npm-dir npm"
|