@mbler/mcx-core 0.1.1 → 0.1.2-rc.10

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.
Files changed (41) hide show
  1. package/README.md +40 -5
  2. package/dist/chunk-DEq-mXcV.js +15 -0
  3. package/dist/index.d.ts +296 -5175
  4. package/dist/index.js +1851 -12192
  5. package/dist/index.js.map +1 -1
  6. package/package.json +15 -7
  7. package/dist/types/ast/index.d.ts +0 -7
  8. package/dist/types/ast/prop.d.ts +0 -8
  9. package/dist/types/ast/tag.d.ts +0 -66
  10. package/dist/types/compile-mcx/compiler/compileData.d.ts +0 -20
  11. package/dist/types/compile-mcx/compiler/index.d.ts +0 -36
  12. package/dist/types/compile-mcx/compiler/main.d.ts +0 -6
  13. package/dist/types/compile-mcx/compiler/utils.d.ts +0 -11
  14. package/dist/types/compile-mcx/index.d.ts +0 -1
  15. package/dist/types/compile-mcx/types.d.ts +0 -52
  16. package/dist/types/compile-mcx/utils.node.d.ts +0 -14
  17. package/dist/types/index.d.ts +0 -10
  18. package/dist/types/mcx-component/components/block.d.ts +0 -4
  19. package/dist/types/mcx-component/components/entity.d.ts +0 -1266
  20. package/dist/types/mcx-component/components/item.d.ts +0 -520
  21. package/dist/types/mcx-component/index.d.ts +0 -17
  22. package/dist/types/mcx-component/lib.d.ts +0 -32
  23. package/dist/types/mcx-component/types/AttackCriticalHitChoices.d.ts +0 -3
  24. package/dist/types/mcx-component/types/EnchantableSlot.d.ts +0 -9
  25. package/dist/types/mcx-component/types/ParticleType.d.ts +0 -8
  26. package/dist/types/mcx-component/types/SoundEvent.d.ts +0 -8
  27. package/dist/types/mcx-component/types/StartSoundChoices.d.ts +0 -3
  28. package/dist/types/mcx-component/types.d.ts +0 -3053
  29. package/dist/types/mcx-component/utils.d.ts +0 -2
  30. package/dist/types/mcx-component/vm.d.ts +0 -28
  31. package/dist/types/transforms/config.d.ts +0 -8
  32. package/dist/types/transforms/file_id.d.ts +0 -1
  33. package/dist/types/transforms/index.d.ts +0 -5
  34. package/dist/types/transforms/main.d.ts +0 -2
  35. package/dist/types/transforms/utils.d.ts +0 -22
  36. package/dist/types/transforms/x-comp/index.d.ts +0 -3
  37. package/dist/types/transforms/x-comp/x-app.d.ts +0 -2
  38. package/dist/types/transforms/x-comp/x-event.d.ts +0 -2
  39. package/dist/types/transforms/x-comp/x-ui.d.ts +0 -2
  40. package/dist/types/types.d.ts +0 -100
  41. package/dist/types/utils.d.ts +0 -18
package/README.md CHANGED
@@ -1,5 +1,40 @@
1
- # mcx
2
-
3
- ## This is a DSL for build minecraft bedrock script
4
-
5
- Docs **[see this](https://mbler-docs.ruanhor.dpdns.org/guide/mcx)**
1
+ # @mbler/mcx-core
2
+
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
+
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,15 @@
1
+ import { createRequire } from "node:module";
2
+ //#region \0rolldown/runtime.js
3
+ var __defProp = Object.defineProperty;
4
+ var __exportAll = (all, no_symbols) => {
5
+ let target = {};
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
11
+ return target;
12
+ };
13
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
14
+ //#endregion
15
+ export { __require as n, __exportAll as t };