@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.
- package/README.md +40 -5
- package/dist/chunk-DEq-mXcV.js +15 -0
- package/dist/index.d.ts +296 -5175
- package/dist/index.js +1851 -12192
- package/dist/index.js.map +1 -1
- package/package.json +15 -7
- package/dist/types/ast/index.d.ts +0 -7
- package/dist/types/ast/prop.d.ts +0 -8
- package/dist/types/ast/tag.d.ts +0 -66
- package/dist/types/compile-mcx/compiler/compileData.d.ts +0 -20
- package/dist/types/compile-mcx/compiler/index.d.ts +0 -36
- package/dist/types/compile-mcx/compiler/main.d.ts +0 -6
- package/dist/types/compile-mcx/compiler/utils.d.ts +0 -11
- package/dist/types/compile-mcx/index.d.ts +0 -1
- package/dist/types/compile-mcx/types.d.ts +0 -52
- package/dist/types/compile-mcx/utils.node.d.ts +0 -14
- package/dist/types/index.d.ts +0 -10
- package/dist/types/mcx-component/components/block.d.ts +0 -4
- package/dist/types/mcx-component/components/entity.d.ts +0 -1266
- package/dist/types/mcx-component/components/item.d.ts +0 -520
- package/dist/types/mcx-component/index.d.ts +0 -17
- package/dist/types/mcx-component/lib.d.ts +0 -32
- package/dist/types/mcx-component/types/AttackCriticalHitChoices.d.ts +0 -3
- package/dist/types/mcx-component/types/EnchantableSlot.d.ts +0 -9
- package/dist/types/mcx-component/types/ParticleType.d.ts +0 -8
- package/dist/types/mcx-component/types/SoundEvent.d.ts +0 -8
- package/dist/types/mcx-component/types/StartSoundChoices.d.ts +0 -3
- package/dist/types/mcx-component/types.d.ts +0 -3053
- package/dist/types/mcx-component/utils.d.ts +0 -2
- package/dist/types/mcx-component/vm.d.ts +0 -28
- package/dist/types/transforms/config.d.ts +0 -8
- package/dist/types/transforms/file_id.d.ts +0 -1
- package/dist/types/transforms/index.d.ts +0 -5
- package/dist/types/transforms/main.d.ts +0 -2
- package/dist/types/transforms/utils.d.ts +0 -22
- package/dist/types/transforms/x-comp/index.d.ts +0 -3
- package/dist/types/transforms/x-comp/x-app.d.ts +0 -2
- package/dist/types/transforms/x-comp/x-event.d.ts +0 -2
- package/dist/types/transforms/x-comp/x-ui.d.ts +0 -2
- package/dist/types/types.d.ts +0 -100
- package/dist/types/utils.d.ts +0 -18
package/README.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
|
-
# mcx
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 };
|