mbler 0.2.4 → 0.2.7-rc.2

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,41 +1,48 @@
1
- # MBLER
2
-
3
- ### 介绍
4
-
5
- 一个Minecraft Addon的开发工具,功能包括
6
- - MCX DSL
7
- - Manfiest Generator
8
- - Bundle
9
- - Component build
10
-
11
- ### 安装
12
-
13
- 确保你已经安装以下工具:
14
-
15
- - Node.js 与 npm
16
- - Git
17
- - npm
18
- `npm install -g mbler`
19
- 安装成功后,你可以直接使用:
20
-
21
- ```bash
22
- # 获取版本
23
- mbler -v
24
- ```
25
-
26
- 初始化目录配置文件
27
-
28
- ```bash
29
- mbler -c <项目路径>
30
- mbler init
31
- ```
32
-
33
- ** 详细请看 : [文档](https://mbler-docs.ruanhor.dpdns.org/) **
34
-
35
- ### 发布平台
36
-
37
- [github](https://github.com/RuanhoR/mbler) | [gitee](https://gitee.com/n304sc-haoran/mbler.git) | [npm](https://npmjs.com/package/mbler)
38
-
39
- ## 文档
40
-
41
- [中文](https://zh-mbler-docs.ruanhor.dpdns.org/) | [英文](https://mbler-docs.ruanhor.dpdns.org/)
1
+ # MBLER
2
+
3
+ ### Introduction
4
+
5
+ A development tool for Minecraft Addon based on Rolldown, featuring:
6
+
7
+ - MCX DSL
8
+ - Manifest Generator
9
+ - Bundle
10
+ - Component build
11
+
12
+ ## About repo
13
+
14
+ [MCX CORE](https://github.com/RuanhoR/mcx-core) | [MCX Language Server](https://github.com/RuanhoR/mcx-language-server) | [MCX Template](https://github.com/RuanhoR/mcx-template) | [MNX Market](https://github.com/RuanhoR/mnx)
15
+
16
+ ### Installation
17
+
18
+ Ensure you have the following tools installed:
19
+
20
+ - Node.js and npm
21
+ - Git
22
+
23
+ ```bash
24
+ npm install -g mbler
25
+ ```
26
+
27
+ After installation, you can use it directly:
28
+
29
+ ```bash
30
+ # Get version
31
+ mbler -v
32
+ ```
33
+
34
+ Initialize directory configuration file:
35
+
36
+ ```bash
37
+ mbler init
38
+ ```
39
+
40
+ For details, see: [Documentation](https://mbler-docs.ruanhor.dpdns.org/)
41
+
42
+ ### Release Platforms
43
+
44
+ [github](https://github.com/RuanhoR/mbler) | [gitee](https://gitee.com/n304sc-haoran/mbler.git) | [npm](https://npmjs.com/package/mbler)
45
+
46
+ ## Documentation
47
+
48
+ [中文](https://zh-mbler-docs.ruanhor.dpdns.org/) | [English](https://mbler-docs.ruanhor.dpdns.org/) | [한국어](./README_ko.md) | [日本語](./README_ja.md)
package/bin/mbler.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- const mbler = require("./../dist");
2
+ const mbler = require('./../dist')
3
3
 
4
4
  /**
5
5
  * @license MIT
6
6
  * @link https://github.com/RuanhoR/mbler
7
- */
8
- mbler.cli();
7
+ */
8
+ mbler.cli()
package/bin/mcx-tsc.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- require("mbler/build").McxTsc()
3
+ require('mbler/build').McxTsc()
package/client.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ import type * as mcx from '@mbler/mcx-core'
2
+
3
+ declare module '*.png' {
4
+ export default mcx.PNGImageComponent
5
+ }
6
+ declare module '*.svg' {
7
+ export default mcx.SVGImageComponent
8
+ }
9
+ declare module '*.jpg' {
10
+ export default mcx.JPGImageComponent
11
+ }
12
+ declare module '*.jpeg' {
13
+ export default mcx.JPGImageComponent
14
+ }
15
+ declare module '*.gif' {
16
+ export default mcx.GIFImageComponent
17
+ }
package/dist/build.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import * as typescript from 'typescript';
2
2
  import { watch as watch$1 } from 'chokidar';
3
- import * as rollup from 'rollup';
4
- import { Plugin } from 'rollup';
3
+ import { Plugin, RolldownWatcher } from 'rolldown';
5
4
  import { LanguagePlugin } from '@volar/language-core';
6
5
 
7
6
  interface MblerConfigScript {
@@ -17,8 +16,12 @@ interface MblerConfigOutdir {
17
16
  }
18
17
  interface MblerBuildConfig {
19
18
  rollupPlugins: Plugin[];
20
- cache: "none" | "memory" | "file" | "filesystem" | "auto";
19
+ rollupExternal: string[];
20
+ cache: 'none' | 'memory' | 'file' | 'filesystem' | 'auto';
21
+ cachePath: string;
21
22
  bundle: boolean;
23
+ outputDir: string;
24
+ outputFilename: string;
22
25
  onEnd: (ctx: MblerConfigData) => void | Promise<void>;
23
26
  onStart: (ctx: MblerConfigData) => void | Promise<void>;
24
27
  onWarn: (ctx: MblerConfigData, warning: Error) => void | Promise<void>;
@@ -38,6 +41,16 @@ interface CliParam {
38
41
  opts: Record<string, string>;
39
42
  }
40
43
 
44
+ /**
45
+ * Compare two dotted version strings ("major.minor.patch").
46
+ * Returns negative if a < b, positive if a > b, zero if equal.
47
+ */
48
+ declare const Sapi: () => {
49
+ refresh: () => Promise<void>;
50
+ generateVersion: (module: "@minecraft/server-ui" | "@minecraft/server", mcVersion: string, isBeta: boolean, withFull: boolean) => Promise<string>;
51
+ };
52
+ declare const _default: ReturnType<typeof Sapi>;
53
+
41
54
  /**
42
55
  * 运行 MCX TypeScript 编译器
43
56
  * 为 .mcx 文件提供 TypeScript 类型检查支持
@@ -78,7 +91,7 @@ declare class Build {
78
91
  * Can be safely called even before `watch()` has been invoked.
79
92
  */
80
93
  getWatchers(): {
81
- rollup: rollup.RollupWatcher;
94
+ rollup: RolldownWatcher | null;
82
95
  chokidar: ReturnType<typeof watch$1>;
83
96
  } | null;
84
97
  /**
@@ -154,4 +167,4 @@ declare class Build {
154
167
  declare function build(cliParam: CliParam, work: string): Promise<number>;
155
168
  declare function watch(cliParam: CliParam, work: string): Promise<number>;
156
169
 
157
- export { Build, runTSC as McxTsc, build, watch };
170
+ export { Build, runTSC as McxTsc, _default as Sapi, build, watch };