@mbler/mcx-core 0.1.2 → 0.1.3-rc.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 CHANGED
@@ -1,5 +1,40 @@
1
- # mcx
1
+ # @mbler/mcx-core
2
2
 
3
- ## This is a DSL for build minecraft bedrock script
3
+ The MCX DSL compiler the core of the MCX ecosystem. Compiles `.mcx` source files into MCBE-compatible JSON components, UI forms, and event systems.
4
4
 
5
- Docs **[see this](https://mbler-docs.ruanhor.dpdns.org/guide/mcx)**
5
+ ## Pipeline
6
+
7
+ `.mcx` file → **parser** → AST → **transform** (Babel) → compiled JS → MCBE JSON
8
+
9
+ ## Features
10
+
11
+ - **MCX Parser** — Parses `.mcx` source into a tokenized AST (`tag`, `prop`)
12
+ - **Transform Pipeline** — Detects file type (`event`, `ui`, `component`, `app`) and generates compiled Babel AST
13
+ - **Component Compilation** — Runs component scripts in a sandboxed VM, generates MCBE JSON, executes file edit operations
14
+ - **CJS Transform** — Rewrites ESM imports to CommonJS `require()` for VM execution
15
+ - **Image Assets** — Compiles PNG, JPG, SVG, GIF image references into MCBE texture assets
16
+ - **Rollup/Rolldown Plugin** — Seamless `.mcx` file resolution and transformation in your build pipeline
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ pnpm add -D @mbler/mcx-core
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ Add the plugin to your Rollup or Rolldown config:
27
+
28
+ ```ts
29
+ import { rollupPlugin } from '@mbler/mcx-core'
30
+
31
+ export default {
32
+ plugins: [rollupPlugin({ moduleDir: './modules', tsconfigPath: './tsconfig.json' })],
33
+ }
34
+ ```
35
+
36
+ For full documentation, visit the **[Docs](https://mbler-docs.ruanhor.dpdns.org/guide/mcx)**.
37
+
38
+ ## License
39
+
40
+ MIT
@@ -0,0 +1,16 @@
1
+ import { createRequire } from "node:module";
2
+ //#region \0rolldown/runtime.js
3
+ var __defProp = Object.defineProperty;
4
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
5
+ var __exportAll = (all, no_symbols) => {
6
+ let target = {};
7
+ for (var name in all) __defProp(target, name, {
8
+ get: all[name],
9
+ enumerable: true
10
+ });
11
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
12
+ return target;
13
+ };
14
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
15
+ //#endregion
16
+ export { __exportAll as n, __require as r, __commonJSMin as t };
@@ -0,0 +1,21 @@
1
+ import { createRequire } from "node:module";
2
+
3
+ //#region \0rolldown/runtime.js
4
+ var __defProp = Object.defineProperty;
5
+ var __exportAll = (all, no_symbols) => {
6
+ let target = {};
7
+ for (var name in all) {
8
+ __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ }
13
+ if (!no_symbols) {
14
+ __defProp(target, Symbol.toStringTag, { value: "Module" });
15
+ }
16
+ return target;
17
+ };
18
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
19
+
20
+ //#endregion
21
+ export { __require as n, __exportAll as t };