diff --git a/src/mod_utils/importers/tabula.js b/src/mod_utils/importers/tabula.js new file mode 100644 index 00000000..5224f4d4 --- /dev/null +++ b/src/mod_utils/importers/tabula.js @@ -0,0 +1,280 @@ +function loadTabulaModel(data) { + Undo.initEdit({ + outliner: true, + bitmap: true, + uv_mode: true + }); + let json = JSON.parse(data); + + let version = json.projVersion || 0; + + switch(version){ + case 5: + Project.name = json.modelName; + Project.texture_width = json.texWidth; + Project.texture_height = json.texHeight; + json.parts.forEach(part => readTblBone(part, version, null)); + Blockbench.showMessageBox({ + title: "Warning", + message: "You imported a version 5 Tabula Model.\nThis Format has some functions which are not supported by Blockbench, for this reason some things might have broken on import." + }); + break; + default: + Project.name = json.modelName; + Project.texture_width = json.textureWidth; + Project.texture_height = json.textureHeight; + let rootGroup = new Group( + { + name: "root", + origin: [0, 24, 0], + rotation: [0, 0, 0], + } + ).addTo(); + rootGroup.init(); + json.cubes.forEach(cube => readTblBone(cube, version, rootGroup)); + break; + } + + + Undo.finishEdit('Import Tabula Model'); + Canvas.updateAll(); +} + +function readTblBone(json, version, parentGroup){ + let group; + switch(version){ + case 5: + group = new Group({ + name: json.name, + origin: [(parentGroup == null ? 0 : parentGroup.origin[0]) + json.rotPX, (parentGroup == null ? + 24 : parentGroup.origin[1]) - json.rotPY, (parentGroup == null ? 0 : parentGroup.origin[2]) + json.rotPZ], + rotation: [-json.rotAX, json.rotAY, -json.rotAZ] + }); + break; + case 2: + group = new Group({ + name: json.name, + origin: [parentGroup.origin[0] + json.position[0], parentGroup.origin[1] - json.position[1], parentGroup.origin[2] + json.position[2]], + rotation: [-json.rotation[0], json.rotation[1], -json.rotation[2]], + }); + break; + default: + group = new Group({ + name: json.name, + origin: [parentGroup.origin[0] + json.position[0], parentGroup.origin[1] - json.position[1], parentGroup.origin[2] + json.position[2]], + rotation: [-json.rotation[0], json.rotation[1], json.rotation[2]], + }); + break; + } + if(parentGroup) group.addTo(parentGroup); + group.init(); + + switch(version){ + case 5: + if(json.children) json.children.forEach(bone => readTblBone(bone, version, group)); + if(json.boxes) json.boxes.forEach(cube => readTblCube(cube, version, group, json)); + break; + default: + if(json.children) json.children.forEach(bone => readTblBone(bone, version, group)); + readTblCube(json, version, group); + break; + } +} + +function readTblCube(json, version, parentGroup, extra){ + let cube; + switch(version){ + case 5: + let pos = [json.posX, json.posY, json.posZ]; + let dim = [json.dimX, json.dimY, json.dimZ]; + cube = new Cube({ + mirror_uv: extra.mirror, + name: json.name, + from: [parentGroup.origin[0] + pos[0], parentGroup.origin[1] - pos[1] - dim[1], parentGroup.origin[2] + pos[2]], + to: [parentGroup.origin[0] + pos[0] + dim[0], parentGroup.origin[1] - pos[1], parentGroup.origin[2] + pos[2] + dim[2]], + uv_offset: [extra.texOffX + json.texOffX, extra.texOffY + json.texOffY] + }); + break; + default: + cube = new Cube({ + mirror_uv: json.txMirror, + name: json.name, + from: [parentGroup.origin[0] + json.offset[0], parentGroup.origin[1] - json.offset[1] - json.dimensions[1], parentGroup.origin[2] + json.offset[2]], + to: [parentGroup.origin[0] + json.offset[0] + json.dimensions[0], parentGroup.origin[1] - json.offset[1], parentGroup.origin[2] + json.offset[2] + json.dimensions[2]], + uv_offset: [json.txOffset[0], json.txOffset[1]], + }); + break; + } + if(parentGroup) cube.addTo(parentGroup); + cube.init(); +} + +/** ---------- Import Tabula Model v2 --------- */ +function loadTabulaModel2(data) { + Undo.initEdit({ + outliner: true, + bitmap: true, + uv_mode: true, + }); + let json = JSON.parse(data); + + let version = json.projVersion || 0; + + if(version != 2){ + Blockbench.showMessageBox({ + title: "Warning", + message: "You are importing an unsupported version of Tabula files, if you experience any issues, please report them and provide your model file so we can try to fix them." + }); + } + Project.name = json.modelName; + Project.texture_width = json.textureWidth; + Project.texture_height = json.textureHeight; + let rootGroup = new Group( + { + name: json.modelName, + origin: [0, 24, 0], + rotation: [0, 0, 0], + } + ).addTo(); + rootGroup.init(); + json.cubes.forEach(cube => parseTbl(cube, version, rootGroup)); + + + Undo.finishEdit('Import Tabula Model', { + outliner: true, + bitmap: true, + uv_mode: true, + }); + Canvas.updateAll(); +} + +function parseTbl(json, version, parentGroup){ + if((json.children && json.children.length > 1) || !parentGroup){ + let group = null; + switch(version){ + case 2: + group = new Group({ + name: json.name, + origin: [parentGroup.origin[0] + json.position[0], parentGroup.origin[1] - json.position[1], parentGroup.origin[2] + json.position[2]], + rotation: [-json.rotation[0], json.rotation[1], -json.rotation[2]], + }); + if(parentGroup) group.addTo(parentGroup); + group.init(); + createCube(json, group, false); + if(json.children) json.children.forEach(bone => parseTbl(bone, version, group)); + break; + default: break; + } + }else{ + createCube(json, parentGroup, true); + } +} + +function createCube(json, parentGroup, useRotation){ + let cubeObj = null; + + if(!useRotation) + cubeObj = { + mirror_uv: json.txMirror, + name: json.name, + from: [parentGroup.origin[0] + json.offset[0], parentGroup.origin[1] - json.offset[1] - json.dimensions[1], parentGroup.origin[2] + json.offset[2]], + to: [parentGroup.origin[0] + json.offset[0] + json.dimensions[0], parentGroup.origin[1] - json.offset[1], parentGroup.origin[2] + json.offset[2] + json.dimensions[2]], + uv_offset: [json.txOffset[0], json.txOffset[1]], + origin: [parentGroup.origin[0], parentGroup.origin[1], parentGroup.origin[2]], + }; + else + cubeObj = { + mirror_uv: json.txMirror, + name: json.name, + from: [ + parentGroup.origin[0] + json.position[0] + json.offset[0], + parentGroup.origin[1] - json.position[1] - json.offset[1] - json.dimensions[1], + parentGroup.origin[2] + json.position[2] + json.offset[2] + ], + to: [ + parentGroup.origin[0] + json.position[0] + json.offset[0] + json.dimensions[0], + parentGroup.origin[1] - json.position[1] - json.offset[1], + parentGroup.origin[2] + json.position[2] + json.offset[2] + json.dimensions[2] + ], + uv_offset: [json.txOffset[0], json.txOffset[1]], + origin: [parentGroup.origin[0] + json.position[0], parentGroup.origin[1] - json.position[1], parentGroup.origin[2] + json.position[2]], + rotation: [-json.rotation[0], json.rotation[1], -json.rotation[2]], + }; + + let cube = new Cube(cubeObj); + if(parentGroup) cube.addTo(parentGroup); + cube.init(); +} + +function loadZipToJson(isTabulaV2){ + /*Undo.initEdit({ + outliner: true, + uv_mode: true, + elements: Outliner.elements, + textures: textures + });*/ + + Blockbench.import({ + type: 'Tabula File (tbl)', + extensions: [tbl], + readtype: 'binary' + }, (files) => { + let data = files[0].content; + let loadedZip = new JSZip().loadAsync(data); + loadedZip.then(zip => { + zip.file("model.json").async("string") + .then(json => { + if(isTabulaV2) + loadTabulaModel2(); + else + loadTabulaModel(); + importType.import(json); + }); + + if(!isTabulaV2){ + if(zip.file("texture.png")) + zip.file("texture.png").async("base64").then(img => { + let texture = new Texture().fromDataURL('data:image/png;base64,' + img); + + texture.add(); + }); + }else{ + if(zip.file("texture.png")) + zip.file("texture.png").forEach(pr => { + pr.async("base64").then(img => { + let texture = new Texture().fromDataURL('data:image/png;base64,' + img); + + texture.add(); + }); + }); + } + }); + }); + //Undo.finishEdit("Model Import"); +} + +export const importTabula = new Action({ + id: 'import_tabula', + name: "Import Tabula Model (.tbl)", + icon: 'flip_to_back', + description: 'Import a Tabula Model', + category: 'file', + condition: () => Format.id === Formats.modded_entity.id, + click: function (event) { + loadZipToJson(false); + } +}); + +export const importTabulaV2 = { + act: new Action({ + id: 'import_tabula_2', + name: "Import Tabula Model - Better but Experimental (.tbl)", + icon: 'flip_to_back', + description: 'Experimental - Import a Tabula Model, may produce a better result, but does not support all tabula file format versions. If you have broken results please report those issues.', + category: 'file', + condition: () => Format.id === Formats.modded_entity.id, + click: function (event) { + loadZipToJson(true); + } + }), + baseFunc: loadTabulaModel2, +}; \ No newline at end of file diff --git a/src/mod_utils/mod_utils.js b/src/mod_utils/mod_utils.js new file mode 100644 index 00000000..fe6ee717 --- /dev/null +++ b/src/mod_utils/mod_utils.js @@ -0,0 +1,39 @@ +import {importTabula, importTabulaV2} from "tabula.js" + +Plugin.register('mod_utils', { + title: 'Mod Utils', + author: 'JTK222 (Maintainer), Wither (For the original Techne importer), Ocraftyone (VoxelShape improvements)', + icon: 'fa-cubes', + description: 'Allows importing Tabula files, and exporting VoxelShapes', + tags: ["Minecraft: Java Edition"], + version: '1.7.1', + variant: 'desktop', + + onload() { + if(isValidVersion){ + + // helpMenu = new BarMenu('help', []); + // helpMenu.label.textContent = 'Help'; + // MenuBar.update(); + + //MenuBar.addAction(exportVoxelShapeAction, 'file.export'); + MenuBar.addAction(importTabulaV2, 'file.import'); + MenuBar.addAction(importTabula, 'file.import'); + //MenuBar.addAction(importTechne, 'file.import'); + //MenuBar.addAction(modUtilsHelp, 'help'); + } + }, + onunload() { + if(isValidVersion){ + //exportVoxelShapeAction.delete(); + importTabula.delete(); + importTabula2.delete(); + //importTechne.delete(); + //modUtilsHelp.delete(); + + // helpMenu.hide(); + } + }, + oninstall(){}, + onuninstall() {} +}); \ No newline at end of file diff --git a/src/mod_utils/package-lock.json b/src/mod_utils/package-lock.json new file mode 100644 index 00000000..f9d23107 --- /dev/null +++ b/src/mod_utils/package-lock.json @@ -0,0 +1,405 @@ +{ + "name": "mod_utils", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "mod_utils", + "version": "1.0.0", + "license": "ISC", + "devDependencies": { + "esbuild": "0.19.5" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.5.tgz", + "integrity": "sha512-bhvbzWFF3CwMs5tbjf3ObfGqbl/17ict2/uwOSfr3wmxDE6VdS2GqY/FuzIPe0q0bdhj65zQsvqfArI9MY6+AA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.5.tgz", + "integrity": "sha512-5d1OkoJxnYQfmC+Zd8NBFjkhyCNYwM4n9ODrycTFY6Jk1IGiZ+tjVJDDSwDt77nK+tfpGP4T50iMtVi4dEGzhQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.5.tgz", + "integrity": "sha512-9t+28jHGL7uBdkBjL90QFxe7DVA+KGqWlHCF8ChTKyaKO//VLuoBricQCgwhOjA1/qOczsw843Fy4cbs4H3DVA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.5.tgz", + "integrity": "sha512-mvXGcKqqIqyKoxq26qEDPHJuBYUA5KizJncKOAf9eJQez+L9O+KfvNFu6nl7SCZ/gFb2QPaRqqmG0doSWlgkqw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.5.tgz", + "integrity": "sha512-Ly8cn6fGLNet19s0X4unjcniX24I0RqjPv+kurpXabZYSXGM4Pwpmf85WHJN3lAgB8GSth7s5A0r856S+4DyiA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.5.tgz", + "integrity": "sha512-GGDNnPWTmWE+DMchq1W8Sd0mUkL+APvJg3b11klSGUDvRXh70JqLAO56tubmq1s2cgpVCSKYywEiKBfju8JztQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.5.tgz", + "integrity": "sha512-1CCwDHnSSoA0HNwdfoNY0jLfJpd7ygaLAp5EHFos3VWJCRX9DMwWODf96s9TSse39Br7oOTLryRVmBoFwXbuuQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.5.tgz", + "integrity": "sha512-lrWXLY/vJBzCPC51QN0HM71uWgIEpGSjSZZADQhq7DKhPcI6NH1IdzjfHkDQws2oNpJKpR13kv7/pFHBbDQDwQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.5.tgz", + "integrity": "sha512-o3vYippBmSrjjQUCEEiTZ2l+4yC0pVJD/Dl57WfPwwlvFkrxoSO7rmBZFii6kQB3Wrn/6GwJUPLU5t52eq2meA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.5.tgz", + "integrity": "sha512-MkjHXS03AXAkNp1KKkhSKPOCYztRtK+KXDNkBa6P78F8Bw0ynknCSClO/ztGszILZtyO/lVKpa7MolbBZ6oJtQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.5.tgz", + "integrity": "sha512-42GwZMm5oYOD/JHqHska3Jg0r+XFb/fdZRX+WjADm3nLWLcIsN27YKtqxzQmGNJgu0AyXg4HtcSK9HuOk3v1Dw==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.5.tgz", + "integrity": "sha512-kcjndCSMitUuPJobWCnwQ9lLjiLZUR3QLQmlgaBfMX23UEa7ZOrtufnRds+6WZtIS9HdTXqND4yH8NLoVVIkcg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.5.tgz", + "integrity": "sha512-yJAxJfHVm0ZbsiljbtFFP1BQKLc8kUF6+17tjQ78QjqjAQDnhULWiTA6u0FCDmYT1oOKS9PzZ2z0aBI+Mcyj7Q==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.5.tgz", + "integrity": "sha512-5u8cIR/t3gaD6ad3wNt1MNRstAZO+aNyBxu2We8X31bA8XUNyamTVQwLDA1SLoPCUehNCymhBhK3Qim1433Zag==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.5.tgz", + "integrity": "sha512-Z6JrMyEw/EmZBD/OFEFpb+gao9xJ59ATsoTNlj39jVBbXqoZm4Xntu6wVmGPB/OATi1uk/DB+yeDPv2E8PqZGw==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.5.tgz", + "integrity": "sha512-psagl+2RlK1z8zWZOmVdImisMtrUxvwereIdyJTmtmHahJTKb64pAcqoPlx6CewPdvGvUKe2Jw+0Z/0qhSbG1A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.5.tgz", + "integrity": "sha512-kL2l+xScnAy/E/3119OggX8SrWyBEcqAh8aOY1gr4gPvw76la2GlD4Ymf832UCVbmuWeTf2adkZDK+h0Z/fB4g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.5.tgz", + "integrity": "sha512-sPOfhtzFufQfTBgRnE1DIJjzsXukKSvZxloZbkJDG383q0awVAq600pc1nfqBcl0ice/WN9p4qLc39WhBShRTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.5.tgz", + "integrity": "sha512-dGZkBXaafuKLpDSjKcB0ax0FL36YXCvJNnztjKV+6CO82tTYVDSH2lifitJ29jxRMoUhgkg9a+VA/B03WK5lcg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.5.tgz", + "integrity": "sha512-dWVjD9y03ilhdRQ6Xig1NWNgfLtf2o/STKTS+eZuF90fI2BhbwD6WlaiCGKptlqXlURVB5AUOxUj09LuwKGDTg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.5.tgz", + "integrity": "sha512-4liggWIA4oDgUxqpZwrDhmEfAH4d0iljanDOK7AnVU89T6CzHon/ony8C5LeOdfgx60x5cnQJFZwEydVlYx4iw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.5.tgz", + "integrity": "sha512-czTrygUsB/jlM8qEW5MD8bgYU2Xg14lo6kBDXW6HdxKjh8M5PzETGiSHaz9MtbXBYDloHNUAUW2tMiKW4KM9Mw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.5.tgz", + "integrity": "sha512-bUxalY7b1g8vNhQKdB24QDmHeY4V4tw/s6Ak5z+jJX9laP5MoQseTOMemAr0gxssjNcH0MCViG8ONI2kksvfFQ==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.19.5", + "@esbuild/android-arm64": "0.19.5", + "@esbuild/android-x64": "0.19.5", + "@esbuild/darwin-arm64": "0.19.5", + "@esbuild/darwin-x64": "0.19.5", + "@esbuild/freebsd-arm64": "0.19.5", + "@esbuild/freebsd-x64": "0.19.5", + "@esbuild/linux-arm": "0.19.5", + "@esbuild/linux-arm64": "0.19.5", + "@esbuild/linux-ia32": "0.19.5", + "@esbuild/linux-loong64": "0.19.5", + "@esbuild/linux-mips64el": "0.19.5", + "@esbuild/linux-ppc64": "0.19.5", + "@esbuild/linux-riscv64": "0.19.5", + "@esbuild/linux-s390x": "0.19.5", + "@esbuild/linux-x64": "0.19.5", + "@esbuild/netbsd-x64": "0.19.5", + "@esbuild/openbsd-x64": "0.19.5", + "@esbuild/sunos-x64": "0.19.5", + "@esbuild/win32-arm64": "0.19.5", + "@esbuild/win32-ia32": "0.19.5", + "@esbuild/win32-x64": "0.19.5" + } + } + } +} diff --git a/src/mod_utils/package.json b/src/mod_utils/package.json new file mode 100644 index 00000000..5439f4c9 --- /dev/null +++ b/src/mod_utils/package.json @@ -0,0 +1,15 @@ +{ + "name": "mod_utils", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "build": "esbuild mod_utils.js --bundle --outfile=out.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ARR", + "devDependencies": { + "esbuild": "0.19.5" + } +}