@bepack/cli 0.1.0-beta.0

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/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ import{createRequire as e}from"node:module";import{pathToFileURL as t}from"node:url";import n from"node:path";import{promises as r}from"node:fs";import{platform as i}from"node:os";const a={root:`.`,configured:{root:!1,packOutDir:!1},name:`minecraft-addon`,version:`1.0.0`,description:``,replace:{values:{},builtins:{VERSION:!1,NAME:!1,UUID:!1,DESCRIPTION:!1}},target:`latest`,plugins:[],install:{registry:`https://registry.npmjs.org/`,saveTo:`dependencies`,packageManager:`auto`,runPackageManager:!0,updatePackageJson:!0,updateManifest:!0,dependencyCatalog:{},dependencyResolvers:[]},build:{copy:!1,timing:!1},dev:{copy:!1},copy:{defaultTarget:``,targets:{}},pack:{name:`{name}-{version}`,outDir:`dist`},hooks:{}},o={dev:!0,build:!1,file:`node_modules/.cache/bepack/tsconfig.tsbuildinfo`},s={entry:`src/main.ts`,tsconfig:`tsconfig.json`,typecheck:!0,preserveModules:!0,external:[/^@minecraft\/server.*/],useNpx:!1,minify:!1,cache:o,scriptOutputDir:`scripts`};function c(e){return e}const l=[`bepack.config.ts`,`bepack.config.mjs`,`bepack.config.js`];var u=class extends Error{code;details;suggestions;constructor(e,t,n={}){super(t),this.name=`BePackError`,this.code=e,this.details=n.details,this.suggestions=n.suggestions}};function d(e,t){return n.isAbsolute(t)?t:n.join(e,t)}function f(e){return e.replace(/\\/g,`/`)}function p(e,t){return d(e,t.root)}function m(e,t,n){return n===`bp`?t.packs.bp?d(e,t.packs.bp.root):void 0:t.packs.rp?d(e,t.packs.rp.root):void 0}function h(e,t){let n=m(p(e,t),t,`bp`);if(!n)throw Error(`packs.bp is not configured`);return n}function g(e,t){let n=m(p(e,t),t,`rp`);if(!n)throw Error(`packs.rp is not configured`);return n}function _(e,t){let r=n.relative(e,t);return r===``||!r.startsWith(`..${n.sep}`)&&r!==`..`&&!n.isAbsolute(r)}function v(e,t,r){if(!t||t===`.`)throw new u(`CONFIG_INVALID`,`compile.scriptOutputDir must be a non-empty relative path strictly inside the BP root. Got: "${t}". This directory will be emptied during build.`);let i=t.replace(/\\/g,`/`);if(n.posix.isAbsolute(i)||n.win32.isAbsolute(i))throw new u(`CONFIG_INVALID`,`compile.scriptOutputDir must be a relative path, not absolute. Got: "${t}". This directory will be emptied during build.`);let a=n.posix.normalize(i);if(a.split(`/`).includes(`..`))throw new u(`CONFIG_INVALID`,`compile.scriptOutputDir must not contain ".." (path escape). Got: "${t}" resolves outside the BP root. This directory will be emptied during build.`);let o=n.resolve(e,a),s=n.relative(e,o);if(!s||s.startsWith(`..`)||n.isAbsolute(s))throw new u(`CONFIG_INVALID`,`compile.scriptOutputDir must be a directory strictly inside the BP root. Value: "${t}", resolved: "${o}". This directory will be emptied during build and must not be the BP root or a path outside it.`);if(r&&_(o,r))throw new u(`CONFIG_INVALID`,`compile.scriptOutputDir "${t}" dangerously overlaps with the source entry directory. The output directory will be emptied during build and would delete source files.`);return f(s)}function y(e,t){if(t.packs.bp)return n.join(h(e,t),`manifest.json`)}function b(e,t){if(t.packs.rp)return n.join(g(e,t),`manifest.json`)}i();var x=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),S=e(import.meta.url),C=x(((e,t)=>{let n=S(`node:fs`),r=S(`node:child_process`),i=JSON.parse(n.readFileSync(S.resolve(`rolldown/package.json`),`utf-8`)).version,a=`/tmp/rolldown-${i}`,o=`${a}/node_modules/@rolldown/binding-wasm32-wasi/rolldown-binding.wasi.cjs`;if(!n.existsSync(o)){let e=`@rolldown/binding-wasm32-wasi@${i}`;n.rmSync(a,{recursive:!0,force:!0}),n.mkdirSync(a,{recursive:!0}),console.log(`[rolldown] Downloading ${e} on WebContainer...`),r.execFileSync(`pnpm`,[`i`,e],{cwd:a,stdio:`inherit`})}t.exports=S(o)}));x(((e,t)=>{let{readFileSync:n}=S(`fs`),r=null,i=[],a=()=>{let e=!1;return process.platform===`linux`&&(e=s(),e===null&&(e=c()),e===null&&(e=l())),e},o=e=>e.includes(`libc.musl-`)||e.includes(`ld-musl-`),s=()=>{try{return n(`/usr/bin/ldd`,`utf-8`).includes(`musl`)}catch{return null}},c=()=>{let e=null;return process.report&&typeof process.report.getReport==`function`&&(process.report.excludeNetwork=!0,e=process.report.getReport()),e?e.header&&e.header.glibcVersionRuntime?!1:!!(Array.isArray(e.sharedObjects)&&e.sharedObjects.some(o)):null},l=()=>{try{return S(`child_process`).execSync(`ldd --version`,{encoding:`utf8`}).includes(`musl`)}catch{return!1}};function u(){if(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)try{return S(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)}catch(e){i.push(e)}else if(process.platform===`android`)if(process.arch===`arm64`){try{return S(`./rolldown-binding.android-arm64.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-android-arm64`),t=S(`@rolldown/binding-android-arm64/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else if(process.arch===`arm`){try{return S(`./rolldown-binding.android-arm-eabi.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-android-arm-eabi`),t=S(`@rolldown/binding-android-arm-eabi/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else i.push(Error(`Unsupported architecture on Android ${process.arch}`));else if(process.platform===`win32`)if(process.arch===`x64`)if(process.config&&process.config.variables&&process.config.variables.shlib_suffix===`dll.a`||process.config&&process.config.variables&&process.config.variables.node_target_type===`shared_library`){try{return S(`./rolldown-binding.win32-x64-gnu.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-win32-x64-gnu`),t=S(`@rolldown/binding-win32-x64-gnu/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else{try{return S(`./rolldown-binding.win32-x64-msvc.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-win32-x64-msvc`),t=S(`@rolldown/binding-win32-x64-msvc/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else if(process.arch===`ia32`){try{return S(`./rolldown-binding.win32-ia32-msvc.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-win32-ia32-msvc`),t=S(`@rolldown/binding-win32-ia32-msvc/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else if(process.arch===`arm64`){try{return S(`./rolldown-binding.win32-arm64-msvc.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-win32-arm64-msvc`),t=S(`@rolldown/binding-win32-arm64-msvc/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else i.push(Error(`Unsupported architecture on Windows: ${process.arch}`));else if(process.platform===`darwin`){try{return S(`./rolldown-binding.darwin-universal.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-darwin-universal`),t=S(`@rolldown/binding-darwin-universal/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}if(process.arch===`x64`){try{return S(`./rolldown-binding.darwin-x64.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-darwin-x64`),t=S(`@rolldown/binding-darwin-x64/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else if(process.arch===`arm64`){try{return S(`./rolldown-binding.darwin-arm64.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-darwin-arm64`),t=S(`@rolldown/binding-darwin-arm64/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else i.push(Error(`Unsupported architecture on macOS: ${process.arch}`))}else if(process.platform===`freebsd`)if(process.arch===`x64`){try{return S(`./rolldown-binding.freebsd-x64.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-freebsd-x64`),t=S(`@rolldown/binding-freebsd-x64/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else if(process.arch===`arm64`){try{return S(`./rolldown-binding.freebsd-arm64.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-freebsd-arm64`),t=S(`@rolldown/binding-freebsd-arm64/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else i.push(Error(`Unsupported architecture on FreeBSD: ${process.arch}`));else if(process.platform===`linux`)if(process.arch===`x64`)if(a()){try{return S(`./rolldown-binding.linux-x64-musl.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-linux-x64-musl`),t=S(`@rolldown/binding-linux-x64-musl/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else{try{return S(`../rolldown-binding.linux-x64-gnu.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-linux-x64-gnu`),t=S(`@rolldown/binding-linux-x64-gnu/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else if(process.arch===`arm64`)if(a()){try{return S(`./rolldown-binding.linux-arm64-musl.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-linux-arm64-musl`),t=S(`@rolldown/binding-linux-arm64-musl/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else{try{return S(`./rolldown-binding.linux-arm64-gnu.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-linux-arm64-gnu`),t=S(`@rolldown/binding-linux-arm64-gnu/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else if(process.arch===`arm`)if(a()){try{return S(`./rolldown-binding.linux-arm-musleabihf.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-linux-arm-musleabihf`),t=S(`@rolldown/binding-linux-arm-musleabihf/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else{try{return S(`./rolldown-binding.linux-arm-gnueabihf.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-linux-arm-gnueabihf`),t=S(`@rolldown/binding-linux-arm-gnueabihf/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else if(process.arch===`loong64`)if(a()){try{return S(`./rolldown-binding.linux-loong64-musl.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-linux-loong64-musl`),t=S(`@rolldown/binding-linux-loong64-musl/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else{try{return S(`./rolldown-binding.linux-loong64-gnu.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-linux-loong64-gnu`),t=S(`@rolldown/binding-linux-loong64-gnu/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else if(process.arch===`riscv64`)if(a()){try{return S(`./rolldown-binding.linux-riscv64-musl.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-linux-riscv64-musl`),t=S(`@rolldown/binding-linux-riscv64-musl/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else{try{return S(`./rolldown-binding.linux-riscv64-gnu.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-linux-riscv64-gnu`),t=S(`@rolldown/binding-linux-riscv64-gnu/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else if(process.arch===`ppc64`){try{return S(`./rolldown-binding.linux-ppc64-gnu.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-linux-ppc64-gnu`),t=S(`@rolldown/binding-linux-ppc64-gnu/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else if(process.arch===`s390x`){try{return S(`./rolldown-binding.linux-s390x-gnu.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-linux-s390x-gnu`),t=S(`@rolldown/binding-linux-s390x-gnu/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else i.push(Error(`Unsupported architecture on Linux: ${process.arch}`));else if(process.platform===`openharmony`)if(process.arch===`arm64`){try{return S(`./rolldown-binding.openharmony-arm64.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-openharmony-arm64`),t=S(`@rolldown/binding-openharmony-arm64/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else if(process.arch===`x64`){try{return S(`./rolldown-binding.openharmony-x64.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-openharmony-x64`),t=S(`@rolldown/binding-openharmony-x64/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else if(process.arch===`arm`){try{return S(`./rolldown-binding.openharmony-arm.node`)}catch(e){i.push(e)}try{let e=S(`@rolldown/binding-openharmony-arm`),t=S(`@rolldown/binding-openharmony-arm/package.json`).version;if(t!==`1.1.4`&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!==`0`)throw Error(`Native binding package version mismatch, expected 1.1.4 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){i.push(e)}}else i.push(Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));else i.push(Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))}r=u();let d=process.env.NAPI_RS_FORCE_WASI===`true`||process.env.NAPI_RS_FORCE_WASI===`error`;if(!r||d){let e=null,t=null;try{e=S(`../rolldown-binding.wasi.cjs`),r=e}catch(e){d&&(t=e)}if(!r||d)try{e=S(`@rolldown/binding-wasm32-wasi`),r=e}catch(e){d&&(t?t.cause=e:t=e,i.push(e))}if(process.env.NAPI_RS_FORCE_WASI===`error`&&!e){let e=Error(`WASI binding not found and NAPI_RS_FORCE_WASI is set to error`);throw e.cause=t,e}}if(!r&&globalThis.process?.versions?.webcontainer)try{r=C()}catch(e){i.push(e)}if(!r){if(i.length>0){let e=Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.");throw e.cause=i.reduce((e,t)=>(t.cause=e,t)),e}throw Error(`Failed to load native binding`)}t.exports=r,t.exports.LegalCommentsMode=r.LegalCommentsMode,t.exports.minify=r.minify,t.exports.minifySync=r.minifySync,t.exports.Severity=r.Severity,t.exports.ParseResult=r.ParseResult,t.exports.ExportExportNameKind=r.ExportExportNameKind,t.exports.ExportImportNameKind=r.ExportImportNameKind,t.exports.ExportLocalNameKind=r.ExportLocalNameKind,t.exports.ImportNameKind=r.ImportNameKind,t.exports.parse=r.parse,t.exports.parseSync=r.parseSync,t.exports.rawTransferSupported=r.rawTransferSupported,t.exports.ResolverFactory=r.ResolverFactory,t.exports.EnforceExtension=r.EnforceExtension,t.exports.ModuleType=r.ModuleType,t.exports.sync=r.sync,t.exports.HelperMode=r.HelperMode,t.exports.isolatedDeclaration=r.isolatedDeclaration,t.exports.isolatedDeclarationSync=r.isolatedDeclarationSync,t.exports.moduleRunnerTransform=r.moduleRunnerTransform,t.exports.moduleRunnerTransformSync=r.moduleRunnerTransformSync,t.exports.transform=r.transform,t.exports.transformSync=r.transformSync,t.exports.BindingBundleEndEventData=r.BindingBundleEndEventData,t.exports.BindingBundleErrorEventData=r.BindingBundleErrorEventData,t.exports.BindingBundler=r.BindingBundler,t.exports.BindingCallableBuiltinPlugin=r.BindingCallableBuiltinPlugin,t.exports.BindingChunkingContext=r.BindingChunkingContext,t.exports.BindingDecodedMap=r.BindingDecodedMap,t.exports.BindingDevEngine=r.BindingDevEngine,t.exports.BindingLoadPluginContext=r.BindingLoadPluginContext,t.exports.BindingMagicString=r.BindingMagicString,t.exports.BindingModuleInfo=r.BindingModuleInfo,t.exports.BindingNormalizedOptions=r.BindingNormalizedOptions,t.exports.BindingOutputAsset=r.BindingOutputAsset,t.exports.BindingOutputChunk=r.BindingOutputChunk,t.exports.BindingPluginContext=r.BindingPluginContext,t.exports.BindingRenderedChunk=r.BindingRenderedChunk,t.exports.BindingRenderedChunkMeta=r.BindingRenderedChunkMeta,t.exports.BindingRenderedModule=r.BindingRenderedModule,t.exports.BindingSourceMap=r.BindingSourceMap,t.exports.BindingTransformPluginContext=r.BindingTransformPluginContext,t.exports.BindingWatcher=r.BindingWatcher,t.exports.BindingWatcherBundler=r.BindingWatcherBundler,t.exports.BindingWatcherChangeData=r.BindingWatcherChangeData,t.exports.BindingWatcherEvent=r.BindingWatcherEvent,t.exports.ParallelJsPluginRegistry=r.ParallelJsPluginRegistry,t.exports.TraceSubscriberGuard=r.TraceSubscriberGuard,t.exports.TsconfigCache=r.TsconfigCache,t.exports.BindingAttachDebugInfo=r.BindingAttachDebugInfo,t.exports.BindingBuiltinPluginName=r.BindingBuiltinPluginName,t.exports.BindingChunkModuleOrderBy=r.BindingChunkModuleOrderBy,t.exports.BindingErrorStage=r.BindingErrorStage,t.exports.BindingLogLevel=r.BindingLogLevel,t.exports.BindingPluginOrder=r.BindingPluginOrder,t.exports.BindingPropertyReadSideEffects=r.BindingPropertyReadSideEffects,t.exports.BindingPropertyWriteSideEffects=r.BindingPropertyWriteSideEffects,t.exports.BindingRebuildStrategy=r.BindingRebuildStrategy,t.exports.collapseSourcemaps=r.collapseSourcemaps,t.exports.enhancedTransform=r.enhancedTransform,t.exports.enhancedTransformSync=r.enhancedTransformSync,t.exports.FilterTokenKind=r.FilterTokenKind,t.exports.initTraceSubscriber=r.initTraceSubscriber,t.exports.registerPlugins=r.registerPlugins,t.exports.resolveTsconfig=r.resolveTsconfig,t.exports.shutdownAsyncRuntime=r.shutdownAsyncRuntime,t.exports.startAsyncRuntime=r.startAsyncRuntime}))();function ee(e){return{values:e?.values??{},builtins:{VERSION:e?.builtins?.VERSION??!1,NAME:e?.builtins?.NAME??!1,UUID:e?.builtins?.UUID??!1,DESCRIPTION:e?.builtins?.DESCRIPTION??!1}}}function w(e){let t=/^(\d+)\.(\d+)\.(\d+)$/.exec(e);if(!t)throw new u(`VERSION_INVALID`,`Manifest version requires x.y.z.`,{details:{version:e}});return[Number(t[1]),Number(t[2]),Number(t[3])]}function te(e){return/^\d+\.\d+\.\d+(?:[-.][0-9A-Za-z.-]+)?$/.test(e)}function T(e,t){let n=e.split(/[^0-9A-Za-z]+/),r=t.split(/[^0-9A-Za-z]+/),i=Math.max(n.length,r.length);for(let e=0;e<i;e+=1){let t=n[e]??``,i=r[e]??``,a=/^\d+$/.test(t)?Number(t):NaN,o=/^\d+$/.test(i)?Number(i):NaN,s=Number.isNaN(a)||Number.isNaN(o)?t.localeCompare(i):a-o;if(s!==0)return s}return 0}function ne(e){return e===`latest`?!0:T(e,`1.21.120`)>=0}function re(e){let t=/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/.exec(e.trim());if(!t)return;let n=/(?:^|[.-])(\d+)\.(\d+)\.(\d+)(?:[.-]|$)/.exec(t[4]??``);return{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),...n?{minecraftTarget:[Number(n[1]),Number(n[2]),Number(n[3])]}:{}}}function ie(e,t){for(let n of[`major`,`minor`,`patch`])if(e[n]!==t[n])return e[n]-t[n];return 0}function E(e,t){let n=re(e);return n?t.split(`||`).some(e=>{let t=/(?:\^|~|>=|<=|>|<|=)?\s*(v?\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?)/.exec(e.trim()),r=t?re(t[1]):void 0;return!r||n.major!==r.major||ie(n,r)<0?!1:r.minecraftTarget?n.minecraftTarget?T(n.minecraftTarget.join(`.`),r.minecraftTarget.join(`.`))>=0:!1:!0}):!1}const ae=E;function oe(e){if(e===`stable`||e===`beta`||e===`preview`)throw new u(`DEPENDENCY_VERSION_INVALID`,`${e} must be resolved from npm registry before writing package.json.`,{details:{specifier:e}});if(te(e))return e;throw new u(`DEPENDENCY_VERSION_INVALID`,`Unsupported dependency version: ${e}`,{details:{specifier:e}})}function se(e){return e.filter(e=>/^\d+\.\d+\.\d+$/.test(e)).sort(T)}function D(e){return e.filter(e=>/(?:^|[-.])beta(?:[-.]|$)/i.test(e)).sort(T)}var O=class{npm;logger;constructor(e,t){this.npm=e,this.logger=t}latestStable(e,t){let n=this.npm.distTag(t,`latest`);if(n&&/^\d+\.\d+\.\d+$/.test(n))return this.logger?.verbose(`Resolved ${e}@stable -> ${n}`),n;let r=se(this.npm.versions(t)).at(-1);if(!r)throw new u(`SAPI_VERSION_NOT_FOUND`,`Cannot resolve latest stable version for ${e}.`,{details:{package:e}});return this.logger?.verbose(`Resolved ${e}@stable -> ${r}`),r}latestBeta(e,t){let n=this.npm.distTag(t,`beta`);if(n)return this.logger?.verbose(`Resolved ${e}@beta -> ${n}`),n;let r=D(this.npm.versions(t)).at(-1);if(!r)throw new u(`SAPI_VERSION_NOT_FOUND`,`Cannot resolve latest beta version for ${e}.`,{details:{package:e}});return this.logger?.verbose(`Resolved ${e}@beta -> ${r}`),r}betaForTarget(e,t,n){let r=t.replace(/\./g,`\\.`),i=RegExp(`beta[-.]${r}-stable`),a=this.npm.versions(n).filter(e=>i.test(e)).sort(T).at(-1);if(!a)throw new u(`SAPI_VERSION_NOT_FOUND`,`Cannot resolve ${e}@beta for target ${t}.`,{details:{package:e,specifier:`beta`,target:t},suggestions:[`Use target: "latest"`,`Specify an exact version`,`Update BePack`,`Manually edit package.json and manifest.json`]});return this.logger?.verbose(`Resolved ${e}@beta for target ${t} -> ${a}`),a}inferStableFromBeta(e,t,n,r){let i=/^(\d+)\.(\d+)\.(\d+)-beta[.-]/.exec(n);if(!i)throw new u(`SAPI_VERSION_NOT_FOUND`,`Cannot infer stable version from ${e}@${n}.`,{details:{package:e,beta:n,target:t}});let a=Number(i[1]),o=Number(i[2])-1,s=`${a}.${o}.${Number(i[3])}`;if(o<0||!r.versions?.[s])throw new u(`SAPI_VERSION_NOT_FOUND`,`Cannot confirm inferred stable version ${s} for ${e}.`,{details:{package:e,target:t,beta:n,inferredStable:s}});return s}};function k(e,t){return t===`latest`||ne(t)?`beta`:/^(\d+\.\d+\.\d+-beta)/i.exec(e)?.[1]??e}function A(e,t,n){let r=D(t).filter(e=>/^\d+\.\d+\.\d+-beta\.\d+\.\d+\.\d+/.test(e)).filter(e=>!/(?:rc|beta)\.\d+\.\d+\.\d+-preview\.\d+$/i.test(e)).at(-1);if(!r)throw new u(`SAPI_VERSION_NOT_FOUND`,`Cannot resolve latest beta version for ${e}.`,{details:{package:e}});return n?.verbose(`Resolved ${e}@beta -> ${r}`),r}function ce(e){return e.filter(e=>/(?:rc|beta)\.\d+\.\d+\.\d+-preview\.\d+$/i.test(e)).sort(T)}function j(e,t,n){let r=ce(t).at(-1);if(!r)throw new u(`SAPI_VERSION_NOT_FOUND`,`Cannot resolve latest preview version for ${e}.`,{details:{package:e}});return n?.verbose(`Resolved ${e}@preview -> ${r}`),r}function M(e,t,n,r){let i=n.replace(/\./g,`\\.`),a=RegExp(`(?:rc|beta)\\.${i}-preview\\.\\d+$`),o=t.filter(e=>a.test(e)).sort(T).at(-1);if(!o)throw new u(`SAPI_VERSION_NOT_FOUND`,`Cannot resolve ${e}@preview for target ${n}.`,{details:{package:e,specifier:`preview`,target:n},suggestions:[`Use target: "latest"`,`Specify an exact version`]});return r?.verbose(`Resolved ${e}@preview for target ${n} -> ${o}`),o}const N={name:`minecraft-script-api`,resolver:`minecraft-script-api`,match:e=>e.specifier===`stable`||e.specifier===`beta`||e.specifier===`preview`,async resolve(e){let t=await e.npm.metadata(e.packageName),n=new O(e.npm,e.logger);if(e.specifier===`stable`){e.logger?.verbose(`Resolving ${e.packageName}@stable for target ${e.target}`);let r=e.target===`latest`?n.latestStable(e.packageName,t):n.inferStableFromBeta(e.packageName,e.target,n.betaForTarget(e.packageName,e.target,t),t);return{packageVersion:r,manifestVersion:r}}if(e.specifier===`beta`){e.logger?.verbose(`Resolving ${e.packageName}@beta for target ${e.target}`);let r=e.target===`latest`?A(e.packageName,e.npm.versions(t),e.logger):n.betaForTarget(e.packageName,e.target,t);return{packageVersion:r,manifestVersion:k(r,e.target)}}e.logger?.verbose(`Resolving ${e.packageName}@preview for target ${e.target}`);let r=e.target===`latest`?j(e.packageName,e.npm.versions(t),e.logger):M(e.packageName,e.npm.versions(t),e.target,e.logger);return{packageVersion:r,manifestVersion:r}}},P={name:`minecraft-script-api-bp`,resolver:`minecraft-script-api-bp`,match:e=>e.specifier===`beta`||e.specifier===`preview`,async resolve(e){let t=await e.npm.metadata(e.packageName),n=new O(e.npm,e.logger);if(e.specifier===`beta`){e.logger?.verbose(`Resolving ${e.packageName}@beta for target ${e.target}`);let r=e.target===`latest`?A(e.packageName,e.npm.versions(t),e.logger):n.betaForTarget(e.packageName,e.target,t);return{packageVersion:r,manifestVersion:k(r,e.target)}}e.logger?.verbose(`Resolving ${e.packageName}@preview for target ${e.target}`);let r=e.target===`latest`?j(e.packageName,e.npm.versions(t),e.logger):M(e.packageName,e.npm.versions(t),e.target,e.logger);return{packageVersion:r,manifestVersion:r}}},F=/^\d+\.\d+\.\d+$/,le=/^\d+\.\d+\.\d+-preview\.\d+$/,I={name:`minecraft-vanilla-data`,resolver:`minecraft-vanilla-data`,match:e=>e.specifier===`stable`||e.specifier===`preview`,async resolve(e){let t=await e.npm.metadata(e.packageName);return e.specifier===`stable`?ue(e,t):de(e,t)}};function ue(e,t){if(e.logger?.verbose(`Resolving ${e.packageName}@stable for target ${e.target}`),e.target===`latest`){let n=e.npm.distTag(t,`latest`);if(n&&F.test(n))return e.logger?.verbose(`Resolved ${e.packageName}@stable -> ${n}`),{packageVersion:n};let r=e.npm.versions(t).filter(e=>F.test(e)).sort(T).at(-1);if(!r)throw new u(`SAPI_VERSION_NOT_FOUND`,`Cannot resolve latest stable version for ${e.packageName}.`,{details:{package:e.packageName}});return e.logger?.verbose(`Resolved ${e.packageName}@stable -> ${r}`),{packageVersion:r}}if(t.versions?.[e.target])return e.logger?.verbose(`Resolved ${e.packageName}@stable for target ${e.target} -> ${e.target}`),{packageVersion:e.target};throw new u(`SAPI_VERSION_NOT_FOUND`,`Cannot resolve ${e.packageName}@stable for target ${e.target}. The target version does not exist in the registry.`,{details:{package:e.packageName,specifier:`stable`,target:e.target},suggestions:[`Use target: "latest"`,`Specify an exact version`]})}function de(e,t){if(e.logger?.verbose(`Resolving ${e.packageName}@preview for target ${e.target}`),e.target===`latest`){let n=e.npm.versions(t).filter(e=>le.test(e)).sort(T).at(-1);if(!n)throw new u(`SAPI_VERSION_NOT_FOUND`,`Cannot resolve latest preview version for ${e.packageName}.`,{details:{package:e.packageName}});return e.logger?.verbose(`Resolved ${e.packageName}@preview -> ${n}`),{packageVersion:n}}let n=e.target.replace(/\./g,`\\.`),r=RegExp(`^${n}-preview\\.\\d+$`),i=e.npm.versions(t).filter(e=>r.test(e)).sort(T).at(-1);if(!i)throw new u(`SAPI_VERSION_NOT_FOUND`,`Cannot resolve ${e.packageName}@preview for target ${e.target}. No matching preview version found.`,{details:{package:e.packageName,specifier:`preview`,target:e.target},suggestions:[`Use target: "latest"`,`Specify an exact preview version`]});return e.logger?.verbose(`Resolved ${e.packageName}@preview for target ${e.target} -> ${i}`),{packageVersion:i}}const L={"@minecraft/common":{resolver:N,manifest:!0},"@minecraft/server":{resolver:N,manifest:!0},"@minecraft/server-ui":{resolver:N,manifest:!0},"@minecraft/server-net":{resolver:P,manifest:!0},"@minecraft/server-admin":{resolver:P,manifest:!0},"@minecraft/server-gametest":{resolver:P,manifest:!0},"@minecraft/debug-utilities":{resolver:P,manifest:!0},"@minecraft/diagnostics":{resolver:P,manifest:!0},"@minecraft/server-graphics":{resolver:P,manifest:!0},"@minecraft/server-editor":{resolver:P,manifest:!0},"@minecraft/vanilla-data":{resolver:I,manifest:!1}},R={name:`exact-version`,match:e=>te(e.specifier),resolve(e){return e.logger?.verbose(`Using exact ${e.packageName}@${e.specifier}`),{packageVersion:oe(e.specifier),manifestVersion:e.specifier}}},z=[N,P,I,R];var B=class e{resolvers;pluginNames=new Map;constructor(e,t=[]){this.resolvers=e;for(let e of t)for(let t of e.install?.dependencyResolvers??[])this.pluginNames.set(t,e.name)}static fromConfig(t,n=[]){return new e([...t,...z],n)}resolverMatchesCatalog(e,t){let n=e.entry.resolver;if(!n)return!0;let r=typeof n==`string`?n:n.name;return t.resolver===void 0||t.resolver===r}find(e){let t;for(let n of this.resolvers)if(this.resolverMatchesCatalog(e,n))try{if(n.match(e)){t=n;break}}catch(e){let t=this.pluginNames.get(n);throw t?new u(`PLUGIN_FAILED`,`Plugin ${t} resolver ${n.name} match failed: ${e instanceof Error?e.message:String(e)}`):e}if(!t)throw new u(`DEPENDENCY_VERSION_INVALID`,`${e.packageName} dependency version is invalid: ${e.specifier}`,{details:{package:e.packageName,specifier:e.specifier,resolver:e.entry.resolver}});return e.logger?.verbose(`Resolving ${e.packageName}@${e.specifier} with ${t.name}`),t}async resolve(e){let t=this.find(e);try{return await t.resolve(e)}catch(e){let n=this.pluginNames.get(t);throw n?new u(`PLUGIN_FAILED`,`Plugin ${n} resolver ${t.name} failed: ${e instanceof Error?e.message:String(e)}`):e}}};const V=`sapi-pro`,H=[`@minecraft/server`,`@minecraft/server-ui`];function U(e){return/(?:beta|preview|alpha|rc)/i.test(e)}function fe(e){return U(e)?`beta`:`stable`}function pe(e){let t=/^(\d+)\.(\d+)\./.exec(e);return!!t&&(Number(t[1])>0||Number(t[2])>=4)}function W(e){return{...e.dependencies??{},...e.peerDependencies??{}}}async function me(e,t,n,r){let i=e.config.packs.bp?.dependencies??{},a={...L,...e.config.install.dependencyCatalog},o=B.fromConfig(e.config.install.dependencyResolvers.filter(e=>e!==G),e.config.plugins);for(let[s,c]of Object.entries(t)){if(!s.startsWith(`@minecraft/`))continue;let t=i[s],l=a[s];if(!t||!l)return r.add(s),!1;let u;if(n.has(s)?u=n.get(s):(u=await o.resolve({packageName:s,specifier:t,target:e.target,entry:l,config:e.config,npm:e.npm,...e.logger?{logger:e.logger}:{}}),n.set(s,u)),!u||H.includes(s)&&U(c)!==U(u.packageVersion)||!E(u.packageVersion,c))return!1}return!0}function he(e,t){if(t!==`stable`&&t!==`beta`){let n=e[t];return n?[[t,n]]:[]}return Object.entries(e).filter(([e,n])=>{if(!pe(e))return!1;let r=W(n);return Object.keys(r).length===0?!1:t===`stable`?/-stable(?:\.\d+)?$/i.test(e):/^\d+\.\d+\.\d+$/.test(e)}).sort(([e],[t])=>T(e,t)).reverse()}const G={name:`sapi-pro`,resolver:`sapi-pro`,match:e=>e.specifier===`stable`||e.specifier===`beta`||/^\d+\.\d+\.\d+(?:-[\w.-]+)?$/.test(e.specifier),async resolve(e){let t=await e.npm.metadata(V),n=new Map,r=new Set;for(let[i,a]of he(t.versions??{},e.specifier))if(await me(e,W(a),n,r))return/^0\.3\./.test(i)&&e.logger?.warn(`sapi-pro@${i} uses legacy metadata; compatibility is best-effort only.`),{packageVersion:i,manifestVersion:null};throw new u(`SAPI_VERSION_NOT_FOUND`,`Cannot find a compatible ${V}@${e.specifier} for target ${e.target}.${r.size>0?` Missing explicit dependencies: ${[...r].join(`, `)}.`:``}`,{details:{package:V,specifier:e.specifier,target:e.target},suggestions:[`Explicitly declare the @minecraft packages required by sapi-pro.`,`Use a compatible target or specify an exact sapi-pro version.`]})}};function K(){return{name:`sapi-pro`,apiVersion:1,description:`Resolve sapi-pro versions compatible with BePack Script API dependencies.`,configResolved:({config:e})=>{let t=e.packs.bp?.dependencies??{},n=t[V];if(!n)return;let r=H.filter(e=>!t[e]);if(r.length>0)throw Error(`sapi-pro requires explicit dependencies: ${r.join(`, `)}.`);if(n===`stable`||n===`beta`)for(let e of H){let r=t[e];if(fe(r)!==n)throw Error(`sapi-pro ${n} requires ${e} to use ${n}, received ${r}.`)}},install:{dependencyCatalog:{[V]:{resolver:`sapi-pro`,manifest:!1}},dependencyResolvers:[G]}}}const ge={"sapi-pro":K};function q(e){return e?Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)):{}}function _e(e,t){let n={};(e.packs?.bp||t.packs?.bp)&&(n.bp={...e.packs?.bp??{},...q(t.packs?.bp)}),(e.packs?.rp||t.packs?.rp)&&(n.rp={...e.packs?.rp??{},...q(t.packs?.rp)});let r={...e.copy?.targets??{},...q(t.copy?.targets)},i=q(t);return{...e,...i,...t.plugins!==void 0||e.plugins!==void 0?{plugins:t.plugins??e.plugins}:{},packs:n,install:{...e.install,...q(t.install)},build:{...e.build,...q(t.build)},dev:{...e.dev,...q(t.dev)},copy:{...e.copy,...q(t.copy),targets:r},pack:{...e.pack,...q(t.pack)},hooks:{...e.hooks,...q(t.hooks)}}}function ve(e){let t=(e??[]).map(e=>{if(typeof e!=`string`)return e;let t=ge[e];if(!t)throw new u(`CONFIG_INVALID`,`Unknown built-in plugin: ${e}.`);return t()}),n=new Set;for(let e of t){if(!e?.name||e.name.trim()===``)throw new u(`CONFIG_INVALID`,`Every plugin must have a non-empty name.`);if(n.has(e.name))throw new u(`CONFIG_INVALID`,`Plugin name is duplicated: ${e.name}.`);if(e.apiVersion!==void 0&&e.apiVersion!==1)throw new u(`CONFIG_INVALID`,`Plugin ${e.name} requires unsupported BePack plugin API version ${e.apiVersion}.`);if(e.priority!==void 0&&!Number.isFinite(e.priority))throw new u(`CONFIG_INVALID`,`Plugin ${e.name} priority must be a finite number.`);n.add(e.name)}return t.sort((e,t)=>(t.priority??0)-(e.priority??0))}function ye(e,t){let n=new Set;for(let r of[...e.map(e=>e.hooks),t])for(let e of Object.keys(r??{}))n.add(e);return Object.fromEntries([...n].map(n=>{let r=[...e.map(e=>({plugin:e,hook:e.hooks?.[n]})).filter(e=>e.hook!==void 0),...t?.[n]?[{hook:t[n]}]:[]];return[n,async(...e)=>{let t;for(let i of r)try{t=await i.hook(...e)}catch(e){let t=`plugin`in i?i.plugin:void 0;throw t?new u(`PLUGIN_FAILED`,`Plugin ${t.name} ${String(n)} hook failed: ${e instanceof Error?e.message:String(e)}`):e}return t}]}))}function be(e,t){let n={},r=new Map,i=[];for(let t of e)for(let[e,a]of Object.entries(t.install?.dependencyCatalog??{})){let o=r.get(e);if(o){i.push(`dependency catalog ${e}: plugin ${o} takes precedence over plugin ${t.name}`);continue}n[e]=a,r.set(e,t.name)}for(let[e,a]of Object.entries(t)){let t=r.get(e);t&&i.push(`dependency catalog ${e}: project config overrides plugin ${t}`),n[e]=a}return{catalog:n,diagnostics:i}}function xe(e,t,r){let i=s,a=e?.scriptOutputDir??i.scriptOutputDir,c=n.resolve(r,e?.entry??i.entry),l=v(t,a,n.dirname(c));return{entry:e?.entry??i.entry,tsconfig:e?.tsconfig??i.tsconfig,typecheck:e?.typecheck??i.typecheck,preserveModules:e?.preserveModules??i.preserveModules,external:e?.external??i.external,useNpx:e?.useNpx??i.useNpx,minify:e?.minify??i.minify,cache:u(e?.cache),scriptOutputDir:l};function u(e){let t=o;return{dev:e?.dev??t.dev,build:e?.build??t.build,file:e?.file??t.file}}}function Se(e,t={},r=process.cwd()){let i=_e(e,t),o=ve(i.plugins),s=i.target??a.target;if(s===`stable`||s===`beta`)throw new u(`TARGET_INVALID`,`target must be a Minecraft game version or latest, not a Script API channel.`,{details:{target:s}});let c=!!i.packs?.bp,l=!!i.packs?.rp;if(!c&&!l)throw new u(`CONFIG_INVALID`,`At least one pack (packs.bp or packs.rp) is required.`);if(!i.name||i.name.trim()===``)throw new u(`CONFIG_INVALID`,`name is required.`);let d=i.name,f=i.version??a.version,p=i.description,m=i.packs,h=m.bp?.compile,g=m.bp,_=m.rp;if(g){if(!g.uuid)throw new u(`CONFIG_INVALID`,`packs.bp.uuid is required.`);if(g.compile&&!g.moduleUuid)throw new u(`CONFIG_INVALID`,`packs.bp.moduleUuid is required when packs.bp.compile is configured.`);if(g.root===void 0)throw new u(`CONFIG_INVALID`,`packs.bp.root is required. Set the behavior pack directory in bepack.config.ts.`)}let v=n.resolve(r,i.root??`.`),y=g?n.resolve(v,g.root):void 0;if(_){if(!_.uuid||!_.moduleUuid)throw new u(`CONFIG_INVALID`,`packs.rp.uuid and packs.rp.moduleUuid are required.`);if(_.root===void 0)throw new u(`CONFIG_INVALID`,`packs.rp.root is required when packs.rp is configured.`)}let b=g?.description??p,x=_?.description??p,{catalog:S,diagnostics:C}=be(o,i.install?.dependencyCatalog??{}),w=o.flatMap(e=>e.install?.dependencyResolvers??[]);return{root:i.root??a.root,configured:{root:i.root!==void 0,packOutDir:i.pack?.outDir!==void 0},name:d,version:f,...p===void 0?{}:{description:p},replace:ee(i.replace),target:s,plugins:o,...C.length>0?{pluginDiagnostics:C}:{},...i.manifestFormat===void 0?{}:{manifestFormat:i.manifestFormat},packs:{...g?{bp:{root:g.root,uuid:g.uuid,...g.moduleUuid===void 0?{}:{moduleUuid:g.moduleUuid},name:g.name??d,...b===void 0?{}:{description:b},...h&&y?{compile:xe(h,y,v)}:{},dependencies:g.dependencies??{},...g.achievement===void 0?{}:{achievement:g.achievement},include:g.include??[]}}:{},..._?{rp:{root:_.root,uuid:_.uuid,moduleUuid:_.moduleUuid,name:_.name??d,...x===void 0?{}:{description:x},..._.pbr===void 0?{}:{pbr:_.pbr},include:_.include??[]}}:{}},install:{registry:i.install?.registry??a.install.registry,saveTo:i.install?.saveTo??a.install.saveTo,packageManager:i.install?.packageManager??a.install.packageManager,runPackageManager:i.install?.runPackageManager??a.install.runPackageManager,updatePackageJson:i.install?.updatePackageJson??a.install.updatePackageJson,updateManifest:i.install?.updateManifest??a.install.updateManifest,dependencyCatalog:S,dependencyResolvers:[...w,...i.install?.dependencyResolvers??[]]},build:{copy:i.build?.copy??a.build.copy,timing:i.build?.timing??a.build.timing},dev:{copy:i.dev?.copy??a.dev.copy,...i.dev?.watch?{watch:i.dev.watch}:{}},copy:{defaultTarget:i.copy?.defaultTarget??a.copy.defaultTarget,...i.copy?.name?{name:i.copy.name}:{},...i.copy?.include?{include:i.copy.include}:{},targets:i.copy?.targets??{}},pack:{name:i.pack?.name??a.pack.name,outDir:i.pack?.outDir??a.pack.outDir},hooks:ye(o,i.hooks)}}async function Ce(e,t){if(t){let n=d(e,t);return await r.access(n).catch(()=>{throw new u(`CONFIG_NOT_FOUND`,`Config not found: ${t}`,{details:{configPath:t}})}),n}for(let t of l){let i=n.join(e,t);try{return await r.access(i),i}catch{}}throw new u(`CONFIG_NOT_FOUND`,`No bepack.config.ts, bepack.config.mjs, or bepack.config.js found.`,{details:{cwd:e}})}async function we(e){try{if(e.endsWith(`.ts`))try{return await import(`${t(e).href}?t=${Date.now()}`)}catch{let t=Te(await r.readFile(e,`utf8`));return await import(`data:text/javascript;base64,${Buffer.from(t,`utf8`).toString(`base64`)}`)}return await import(`${t(e).href}?t=${Date.now()}`)}catch(t){throw new u(`CONFIG_INVALID`,`Failed to load config: ${t instanceof Error?t.message:String(t)}`,{details:{file:e},suggestions:[`Use bepack.config.mjs/js for complex config logic.`,`Keep bepack.config.ts free of TypeScript-only runtime syntax.`]})}}function Te(e){return e.replace(/^\s*import\s+type\s+[^;]+;\s*$/gm,``).replace(/\s+satisfies\s+[A-Za-z_$][\w$<>,\s.[\]|&{}]*/g,``).replace(/\((\s*[A-Za-z_$][\w$]*)\s*:\s*[^)=]+?\)\s*=>/g,`($1) =>`)}async function Ee(e,t){for(let n of e.plugins??[])if(n.configResolved)try{await n.configResolved({cwd:t,config:e})}catch(e){throw new u(`PLUGIN_FAILED`,`Plugin ${n.name} configResolved hook failed: ${e instanceof Error?e.message:String(e)}`)}}async function De(e){let t=n.resolve(e.cwd),r=await Ce(t,e.configPath),i=await we(r);if(i.default===void 0)throw new u(`CONFIG_INVALID`,`Config must use default export.`,{details:{file:r}});let a=Se(i.default,e.overrides,t);return await Ee(a,t),{config:a,path:r,cwd:t}}function J(e){return{...L,...e.install.dependencyCatalog}}function Oe(e,t){let n=e[t];if(!n)throw new u(`UNSUPPORTED_DEPENDENCY`,`${t} is not a managed dependency. Add it to install.dependencyCatalog or remove it from packs.bp.dependencies.`,{details:{package:t}});return n}function ke(e){return`${JSON.stringify(e,null,4)}\n`}async function Ae(e){try{return await r.access(e),!0}catch{return!1}}async function je(e){await r.mkdir(e,{recursive:!0})}async function Me(e,t){await je(n.dirname(e)),await r.writeFile(e,ke(t),`utf8`)}function Ne(e){return Array.isArray(e)&&e.length===3&&typeof e[0]==`number`&&typeof e[1]==`number`&&typeof e[2]==`number`}function Pe(e){return typeof e==`string`&&/^\d+\.\d+\.\d+$/.test(e)}function Y(e){return e===3?Pe:Ne}function X(e,t){return e===3?`${t} must be SemVer string like "x.y.z" (format 3)`:`${t} must be [number, number, number] (format 2)`}const Fe=[e=>e.format_version===void 0?`format_version is required`:null,e=>e.header?null:`header is required`,e=>e.header&&!e.header.name?`header.name is required`:null,e=>e.header&&!e.header.uuid?`header.uuid is required`:null,e=>e.header?Y(e.format_version)(e.header.version)?null:X(e.format_version,`header.version`):null,e=>e.header?Y(e.format_version)(e.header.min_engine_version)?null:X(e.format_version,`header.min_engine_version`):null,e=>e.modules!==void 0&&!Array.isArray(e.modules)?`modules must be an array`:null,(e,t)=>{if(!Array.isArray(e.modules))return null;let n=e.modules.some(e=>e?.type===`resources`),r=[];return t===`rp`&&!n&&r.push(`RP manifest must have a resources module`),r.length>0?r:null},e=>{if(!Array.isArray(e.modules))return null;let t=Y(e.format_version),n=[];for(let r=0;r<e.modules.length;r++){let i=e.modules[r];i&&i.version!==void 0&&i.version!==null&&!t(i.version)&&n.push(`modules[${r}] (uuid: ${i.uuid??`unknown`}): ${X(e.format_version,`version`)}`)}return n.length>0?n:null},e=>e.dependencies!==void 0&&!Array.isArray(e.dependencies)?`dependencies must be an array`:null,e=>{if(!Array.isArray(e.dependencies))return null;let t=Y(e.format_version),n=[];for(let r=0;r<e.dependencies.length;r++){let i=e.dependencies[r];if(!i){n.push(`dependencies[${r}] is invalid`);continue}`uuid`in i&&i.uuid&&!t(i.version)&&n.push(`dependencies[${r}] (uuid: ${i.uuid}): ${X(e.format_version,`version`)}`),`module_name`in i&&i.module_name&&typeof i.version!=`string`&&n.push(`dependencies[${r}] (module_name: ${i.module_name}): version must be a string`)}return n.length>0?n:null},e=>e.capabilities===void 0?null:Array.isArray(e.capabilities)?e.capabilities.every(e=>typeof e==`string`)?null:`capabilities must be an array of strings`:`capabilities must be an array`,e=>e.metadata!==void 0&&(typeof e.metadata!=`object`||e.metadata===null)?`metadata must be an object`:null];function Ie(e,t){let n=[];for(let r of Fe){let i=r(e,t);i!==null&&(Array.isArray(i)?n.push(...i):n.push(i))}if(n.length>0)throw new u(`MANIFEST_INVALID`,`Manifest validation failed: ${n.join(`; `)}`)}function Z(e){return!e||typeof e!=`object`||Array.isArray(e)?{}:{...e}}function Q(e){return Array.isArray(e)?e:[]}function Le(e){if(!(e&&Object.keys(e).length===0))return e}var $=class{static async read(e){if(!await Ae(e))return;let t=await r.readFile(e,`utf8`);try{return Z(JSON.parse(t))}catch{throw new u(`MANIFEST_INVALID`,`Invalid JSON in manifest: ${e}`)}}static async write(e,t,n){Ie(t,n),await Me(e,t)}};const Re=[1,21,0],ze=[1,0,0];var Be=class{config;version;versionStr;depManager;constructor(e,t){this.config=e,this.version=w(e.version),this.versionStr=e.version,this.depManager=t}buildBp(e){let t=this.requireBp(),n=Z(e);this.depManager.validateBpDependencies();let r=this.getWriteFormatVersion(n),i={...n,format_version:r,header:this.buildBpHeader(n,t,r),...t.moduleUuid?{modules:this.replaceManagedBpModules(n.modules,t,r)}:n.modules?{modules:n.modules}:{},dependencies:this.depManager.replaceBpDependencies(n.dependencies,this.config.packs.rp?.uuid,r)};return this.applyAchievementMetadata(i,t),i}buildRp(e){let t=this.requireRp(),n=Z(e),r=this.getWriteFormatVersion(n),i={...n,format_version:r,header:this.buildRpHeader(n,t,r),modules:this.replaceManagedRpModules(n.modules,t,r),dependencies:this.depManager.replaceRpDependencies(n.dependencies,this.config.packs.bp?.uuid,r)};return this.applyPbrCapability(i,t),i}buildBpHeader(e,t,n){return{...e.header??{},name:t.name,...t.description===void 0?{}:{description:t.description},uuid:t.uuid,version:this.getVersionFor(n),min_engine_version:this.normalizeMinEngineVersion(e.header?.min_engine_version,n)}}buildRpHeader(e,t,n){return{...e.header??{},name:t.name,...t.description===void 0?{}:{description:t.description},uuid:t.uuid,version:this.getVersionFor(n),min_engine_version:this.normalizeMinEngineVersion(e.header?.min_engine_version,n)}}getScriptEntry(){let e=this.config.packs.bp?.compile;return e?`${e.scriptOutputDir}/${n.basename(e.entry,n.extname(e.entry))}.js`:`scripts/main.js`}isManagedBpModule(e,t){if(e.type!==`script`||e.language!==`javascript`)return!1;let n=this.getScriptEntry();return e.uuid===t.moduleUuid||e.entry===n}isManagedRpModule(e,t){return e.type===`resources`?e.uuid===t.moduleUuid:!1}createScriptModule(e,t){return{type:`script`,language:`javascript`,uuid:e.moduleUuid,version:this.getModuleVersion(t),entry:this.getScriptEntry()}}createResourcesModule(e,t){return{type:`resources`,uuid:e.moduleUuid,version:this.getModuleVersion(t)}}replaceManagedBpModules(e,t,n){return[...Q(e).filter(e=>!this.isManagedBpModule(e,t)),this.createScriptModule(t,n)]}replaceManagedRpModules(e,t,n){return[...Q(e).filter(e=>!this.isManagedRpModule(e,t)),this.createResourcesModule(t,n)]}applyAchievementMetadata(e,t){if(t.achievement===!0)e.metadata={...e.metadata??{},product_type:`addon`};else if(t.achievement===!1&&e.metadata){let t={...e.metadata};delete t.product_type;let n=Le(t);n?e.metadata=n:delete e.metadata}}applyPbrCapability(e,t){if(t.pbr===!0){let t=Q(e.capabilities);e.capabilities=t.includes(`pbr`)?t:[...t,`pbr`]}else if(t.pbr===!1){let t=Q(e.capabilities).filter(e=>e!==`pbr`);t.length>0?e.capabilities=t:delete e.capabilities}}getVersionFor(e){return e===3?this.versionStr:this.version}getModuleVersion(e){return e===3?`1.0.0`:ze}getWriteFormatVersion(e){return this.config.manifestFormat===void 0?e.format_version??2:this.config.manifestFormat}normalizeMinEngineVersion(e,t){if(e==null)return t===3?`1.21.0`:Re;if(Array.isArray(e))return t===3?e.join(`.`):e;if(typeof e==`string`){if(t===2){let t=e.split(`.`).map(Number);if(t.length===3&&t.every(e=>!Number.isNaN(e)))return t}return e}return t===3?`1.21.0`:Re}requireBp(){if(!this.config.packs.bp)throw new u(`CONFIG_INVALID`,`packs.bp is required to build the BP manifest.`);return this.config.packs.bp}requireRp(){if(!this.config.packs.rp)throw new u(`CONFIG_INVALID`,`packs.rp is required to build the RP manifest.`);return this.config.packs.rp}},Ve=class e{config;catalog;resolvedDeps;version;versionStr;constructor(e,t,n){this.config=e,this.catalog=t,this.resolvedDeps=n??{},this.version=w(e.version),this.versionStr=e.version}static isAllowedSpecifier(e){return e===`stable`||e===`beta`||e===`preview`||/^\d+\.\d+\.\d+(?:[-.][0-9A-Za-z.-]+)?$/.test(e)}static resolveVersion(e){let{specifier:t,target:n,resolvedVersion:r}=e;if(t===`stable`){if(r)return r;throw new u(`DEPENDENCY_REQUIRES_INSTALL`,"Run `bepack install` to resolve stable manifest dependencies.",{details:{specifier:t,target:n}})}if(t===`beta`){if(ne(n))return`beta`;if(r)return r;throw new u(`DEPENDENCY_REQUIRES_INSTALL`,`Run \`bepack install\` to resolve manifest dependencies for target ${n}.`,{details:{target:n}})}if(t===`preview`){if(r)return r;throw new u(`DEPENDENCY_REQUIRES_INSTALL`,`Run \`bepack install\` to resolve preview manifest dependencies for target ${n}.`,{details:{specifier:t,target:n}})}return t}static isAchievementCompatible(e){return e!==`beta`&&e!==`preview`}validateBpDependencies(){if(this.config.packs.bp){for(let[t,n]of Object.entries(this.config.packs.bp.dependencies)){if(!this.catalog[t])throw new u(`UNSUPPORTED_DEPENDENCY`,`${t} is not a managed dependency. Add it to install.dependencyCatalog or remove it from packs.bp.dependencies.`,{details:{package:t}});if(!e.isAllowedSpecifier(n))throw new u(`DEPENDENCY_VERSION_INVALID`,`${t} dependency version is invalid: ${n}`,{details:{package:t,specifier:n}})}if(this.config.packs.bp.achievement){for(let[t,n]of Object.entries(this.config.packs.bp.dependencies))if(!e.isAchievementCompatible(n))throw new u(`ACHIEVEMENT_REQUIRES_STABLE_API`,`${t}: achievement requires stable Script API dependencies (${n} is not allowed).`)}}}isManagedBpDependency(e){return!!(`module_name`in e&&typeof e.module_name==`string`&&this.catalog[e.module_name]?.manifest||`uuid`in e&&typeof e.uuid==`string`&&this.config.packs.rp?.uuid===e.uuid)}isManagedRpDependency(e,t){return t!==void 0&&`uuid`in e&&typeof e.uuid==`string`&&e.uuid===t}buildManagedDependencies(){if(!this.config.packs.bp)return[];let t=[];for(let[n,r]of Object.entries(this.config.packs.bp.dependencies))this.catalog[n]?.manifest&&t.push({module_name:n,version:e.resolveVersion({specifier:r,target:this.config.target,resolvedVersion:this.resolvedDeps[n]})});return t}getFormatAwareVersion(e){return(e??this.config.manifestFormat??2)===3?this.versionStr:this.version}replaceBpDependencies(e,t,n){let r=Q(e).filter(e=>!this.isManagedBpDependency(e)),i=this.buildManagedDependencies();return t&&i.push({uuid:t,version:this.getFormatAwareVersion(n)}),[...r,...i]}replaceRpDependencies(e,t,n){let r=Q(e).filter(e=>!this.isManagedRpDependency(e,t));return t?[...r,{uuid:t,version:this.getFormatAwareVersion(n)}]:r}};async function He(e){let t=J(e.config),r=e.config.packs.bp?y(e.cwd,e.config):void 0,i=r?await $.read(r):void 0,a=Ue(i,t),o=new Ve(e.config,t,e.resolvedDeps?{...a,...e.resolvedDeps}:a),s=new Be(e.config,o),c={};if(e.config.packs.bp){let t=i!==void 0;e.config.manifestFormat===2&&i?.format_version===3&&(e.logger?.warn??console.warn)(`Warning: config manifestFormat is 2, but existing manifest uses format_version 3. format_version 2 does not support string versions; any string versions in the existing manifest will be preserved as-is.`);let a=s.buildBp(i);e.dryRun||await $.write(r,a,`bp`),c.bpManifest={path:f(n.relative(e.cwd,r)),updated:!0,existed:t}}if(e.config.packs.rp){let t=b(e.cwd,e.config),r=await $.read(t),i=r!==void 0,a=s.buildRp(r);e.dryRun||await $.write(t,a,`rp`),c.rpManifest={path:f(n.relative(e.cwd,t)),updated:!0,existed:i}}return c}function Ue(e,t){let n={};for(let r of e?.dependencies??[])`module_name`in r&&typeof r.module_name==`string`&&typeof r.version==`string`&&t[r.module_name]?.manifest&&r.version!==`stable`&&(n[r.module_name]=r.version);return n}function We(e,t){e?.install?e.install(t):e?.info(`[Install] ${t}`)}var Ge=class{registry;logger;cache=new Map;constructor(e,t){this.registry=e,this.logger=t}async metadata(e){let t=this.packageUrl(e),n=this.cache.get(t);if(n)return this.logger?.verbose(`Using cached metadata for ${e}`),n;We(this.logger,`fetching ${e} metadata from ${this.registry}`);let r=await fetch(t);if(!r.ok)throw new u(`SAPI_VERSION_NOT_FOUND`,`Cannot fetch ${e} versions from registry.`,{details:{package:e,registry:this.registry,status:r.status}});let i=await r.json();return this.cache.set(t,i),this.logger?.verbose(`Fetched ${e} metadata (${Object.keys(i.versions??{}).length} versions)`),i}versions(e){return Object.keys(e.versions??{})}async versionsOf(e){return this.versions(await this.metadata(e))}distTag(e,t){let n=e[`dist-tags`]?.[t];return n&&e.versions?.[n]?n:void 0}packageUrl(e){return`${this.registry.replace(/\/$/,``)}/${encodeURIComponent(e).replace(/^%40/,`@`)}`}};function Ke(e){return t=>{e?.install?e.install(t):e?.info(`[Install] ${t}`)}}var qe=class{config;logger;npm;catalog;pkgResolver;log;constructor(e,t){this.config=e,this.logger=t,this.npm=new Ge(e.install.registry,t),this.catalog=J(e),this.pkgResolver=new O(this.npm,t),this.log=Ke(t)}async resolveAll(){let e={},t=this.config.packs.bp?.dependencies;if(!t||Object.keys(t).length===0)return this.log(`no BP dependencies to resolve`),e;this.log(`resolving dependencies for target ${this.config.target}`);for(let[n,r]of Object.entries(t)){let t=Oe(this.catalog,n),i=await this.resolveOne(n,r,t),a=t.manifest??!1;e[n]={specifier:r,packageVersion:i.packageVersion,manifestVersion:a?i.manifestVersion??i.packageVersion:null,manifest:a,external:a,resolver:typeof t.resolver==`string`?t.resolver:t.resolver.name},this.log(`${n}: ${r} -> package ${e[n].packageVersion}, manifest ${e[n].manifestVersion}`)}return this.logger?.verbose(`Dependency resolution complete`),e}async resolveOne(e,t,n){let r={packageName:e,specifier:t,target:this.config.target,entry:n,config:this.config};await this.runDependencyHooks(`beforeResolveDependency`,r);let i=await B.fromConfig(this.config.install.dependencyResolvers,this.config.plugins??[]).resolve({packageName:e,specifier:t,target:this.config.target,entry:n,config:this.config,npm:this.npm,...this.logger?{logger:this.logger}:{}});return await this.runDependencyHooks(`afterResolveDependency`,{...r,result:i}),i}async runDependencyHooks(e,t){for(let n of this.config.plugins??[]){let r=n.install?.hooks?.[e];if(r)try{await r(t)}catch(t){throw new u(`PLUGIN_FAILED`,`Plugin ${n.name} ${e} hook failed: ${t instanceof Error?t.message:String(t)}`)}}}};async function Je(e,t){return new qe(e,t).resolveAll()}function Ye(e){let t=[];return e.packs.bp&&t.push({type:`bp`,root:e.packs.bp.root,uuid:e.packs.bp.uuid,...e.packs.bp.moduleUuid===void 0?{}:{moduleUuid:e.packs.bp.moduleUuid},name:e.packs.bp.name,include:e.packs.bp.include}),e.packs.rp&&t.push({type:`rp`,root:e.packs.rp.root,uuid:e.packs.rp.uuid,moduleUuid:e.packs.rp.moduleUuid,name:e.packs.rp.name,include:e.packs.rp.include}),t}export{L as BUILTIN_DEPENDENCY_CATALOG,z as BUILTIN_DEPENDENCY_RESOLVERS,ge as BUILTIN_PLUGINS,u as BePackError,B as DependencyResolverRegistry,qe as DependencyService,O as MinecraftPackageResolver,Ge as NpmRegistryClient,J as createDependencyCatalog,c as defineConfig,R as exactVersionResolver,Ye as getConfiguredPacks,De as loadConfig,P as minecraftScriptApiBpResolver,N as minecraftScriptApiResolver,I as minecraftVanillaDataResolver,oe as packageVersionForSpecifier,He as patchManifest,Je as resolveDependencies,K as sapiPro,E as satisfiesSemver,ae as satisfiesSemverRange};
package/package.json ADDED
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "@bepack/cli",
3
+ "version": "0.1.0-beta.0",
4
+ "description": "A modern pack builder for Minecraft Bedrock Edition.",
5
+ "keywords": [
6
+ "minecraft",
7
+ "bedrock",
8
+ "addon",
9
+ "script-api",
10
+ "mcpack",
11
+ "mcaddon",
12
+ "build-tool"
13
+ ],
14
+ "license": "MIT",
15
+ "author": "XiaoYangx666",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/XiaoYangx666/BEPack.git"
19
+ },
20
+ "homepage": "https://github.com/XiaoYangx666/BEPack#readme",
21
+ "type": "module",
22
+ "packageManager": "npm@11.18.0",
23
+ "workspaces": [
24
+ "packages/*"
25
+ ],
26
+ "sideEffects": false,
27
+ "main": "dist/index.js",
28
+ "types": "dist/index.d.ts",
29
+ "files": [
30
+ "dist",
31
+ "README.md",
32
+ "README.zh-CN.md",
33
+ "reference.md",
34
+ "assets",
35
+ "LICENSE"
36
+ ],
37
+ "exports": {
38
+ ".": {
39
+ "types": "./dist/index.d.ts",
40
+ "import": "./dist/index.js"
41
+ }
42
+ },
43
+ "bin": {
44
+ "bepack": "dist/cli.js"
45
+ },
46
+ "engines": {
47
+ "node": ">=20.0.0"
48
+ },
49
+ "scripts": {
50
+ "clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\"",
51
+ "build": "npm run clean && rolldown -c && node scripts/chmod.mjs",
52
+ "check": "tsc --noEmit",
53
+ "test": "vitest run",
54
+ "test:watch": "vitest",
55
+ "build:create-mcbe": "npm run build --workspace=create-mcbe",
56
+ "check:create-mcbe": "npm run typecheck --workspace=create-mcbe",
57
+ "test:create-mcbe": "npm test --workspace=create-mcbe",
58
+ "format": "prettier ./src --write",
59
+ "format:check": "prettier ./src --check"
60
+ },
61
+ "dependencies": {
62
+ "cac": "^7.0.0",
63
+ "chokidar": "^5.0.0",
64
+ "fflate": "^0.8.3",
65
+ "picocolors": "^1.1.1",
66
+ "rolldown": "^1.1.4"
67
+ },
68
+ "devDependencies": {
69
+ "@types/node": "^26.1.0",
70
+ "prettier": "^3.6.2",
71
+ "rolldown-plugin-dts": "^0.27.6",
72
+ "tsx": "^4.19.0",
73
+ "typescript": "7.0.2",
74
+ "vitest": "^4.1.10"
75
+ },
76
+ "allowScripts": {
77
+ "esbuild@0.28.1": true
78
+ }
79
+ }