diff --git a/npm-installer/postinstall.js b/install.js similarity index 87% rename from npm-installer/postinstall.js rename to install.js index c4472e4f..b4a539c0 100755 --- a/npm-installer/postinstall.js +++ b/install.js @@ -3,7 +3,7 @@ import * as fs from "fs/promises"; import fetch from "node-fetch"; import { pipeline } from "stream/promises"; import StreamZip from "node-stream-zip"; -import { ARCH_MAPPING, CONFIG, PLATFORM_MAPPING } from "./config.js"; +import { ARCH_MAPPING, CONFIG, PLATFORM_MAPPING } from "./npm-config.js"; import path from "path"; async function install() { @@ -38,7 +38,7 @@ async function install() { if (old == "yes") { return path.join(f, "bin", "botway"); } else if (old == "no") { - return path.join("..", "bin", "botway"); + return path.join("bin", "botway"); } else { return f; } @@ -66,7 +66,7 @@ async function install() { }); // chmod +x /bin/botway - await fs.chmod(path.join("..", "bin", "botway"), 0o755); + await fs.chmod(path.join("bin", "botway"), 0o755); await fs.rm(zipFile); await fs.rm(folder(), { recursive: true }); diff --git a/npm-installer/config.js b/npm-config.js similarity index 91% rename from npm-installer/config.js rename to npm-config.js index 0893b019..64d18058 100755 --- a/npm-installer/config.js +++ b/npm-config.js @@ -10,7 +10,7 @@ export const CONFIG = { /** * @type {string} */ - path: "./bin", + path: "../bin", /** * @type {string} diff --git a/npm-installer/bun.lockb b/npm-installer/bun.lockb deleted file mode 100755 index d76ae020..00000000 Binary files a/npm-installer/bun.lockb and /dev/null differ diff --git a/npm-installer/package.json b/npm-installer/package.json deleted file mode 100644 index fe5f89a6..00000000 --- a/npm-installer/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "botway", - "version": "0.1.81", - "description": "🤖 Generate, build, handle and deploy your own bot with your favorite language, for Discord, or Telegram, or Slack.", - "type": "module", - "author": "abdfnx", - "license": "MIT", - "homepage": "https://github.com/abdfnx/botway", - "repository": { - "type": "git", - "url": "https://github.com/abdfnx/botway.git" - }, - "engines": { - "node": ">=8.0.0" - }, - "bin": { - "botway": "../bin/botway.js" - }, - "scripts": { - "postinstall": "node ./postinstall.js" - }, - "files": [ - "../bin", - "config.js", - "postinstall.js" - ], - "dependencies": { - "global": "^4.4.0", - "node-fetch": "^3.2.4", - "node-stream-zip": "^1.15.0", - "stream": "^0.0.2" - }, - "packageManager": "pnpm@7.9.0" -} diff --git a/package.json b/package.json index 6f75be23..d6f408b0 100644 --- a/package.json +++ b/package.json @@ -14,15 +14,15 @@ "node": ">=8.0.0" }, "bin": { - "botway": "../bin/botway.js" + "botway": "bin/botway.js" }, "scripts": { - "postinstall": "node ./postinstall.js" + "postinstall": "node ./install.js" }, "files": [ - "../bin", + "bin", "config.js", - "postinstall.js" + "install.js" ], "dependencies": { "global": "^4.4.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ea76f1cb..c79ab898 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,9 +4,15 @@ importers: .: specifiers: - turbo: ^1.4.2 - devDependencies: - turbo: 1.4.2 + global: ^4.4.0 + node-fetch: ^3.2.4 + node-stream-zip: ^1.15.0 + stream: ^0.0.2 + dependencies: + global: 4.4.0 + node-fetch: 3.2.10 + node-stream-zip: 1.15.0 + stream: 0.0.2 installer/assets: specifiers: @@ -765,6 +771,11 @@ packages: resolution: {integrity: sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==} dev: true + /data-uri-to-buffer/4.0.0: + resolution: {integrity: sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==} + engines: {node: '>= 12'} + dev: false + /debug/2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} peerDependencies: @@ -815,6 +826,10 @@ packages: resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} dev: true + /dom-walk/0.1.2: + resolution: {integrity: sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==} + dev: false + /eastasianwidth/0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true @@ -823,6 +838,10 @@ packages: resolution: {integrity: sha512-BZSbMpyFQU0KBJ1JG26XGeFI3i4op+qOYGxftmZXFZoHkhLgsSv4DHDJfl8ogII3hIuzGt51PaZ195OVu0yJ9A==} dev: true + /emitter-component/1.1.1: + resolution: {integrity: sha512-G+mpdiAySMuB7kesVRLuyvYRqDmshB7ReKEVuyBPkzQlmiDiLrt7hHHIy4Aff552bgknVN7B2/d3lzhGO5dvpQ==} + dev: false + /emoji-regex/8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} dev: true @@ -1092,6 +1111,14 @@ packages: reusify: 1.0.4 dev: true + /fetch-blob/3.2.0: + resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} + engines: {node: ^12.20 || >= 14.13} + dependencies: + node-domexception: 1.0.0 + web-streams-polyfill: 3.2.1 + dev: false + /fill-range/7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} @@ -1099,6 +1126,13 @@ packages: to-regex-range: 5.0.1 dev: true + /formdata-polyfill/4.0.10: + resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==} + engines: {node: '>=12.20.0'} + dependencies: + fetch-blob: 3.2.0 + dev: false + /fraction.js/4.2.0: resolution: {integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==} dev: true @@ -1139,6 +1173,13 @@ packages: is-glob: 4.0.3 dev: true + /global/4.4.0: + resolution: {integrity: sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==} + dependencies: + min-document: 2.19.0 + process: 0.11.10 + dev: false + /globals/11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} @@ -1323,6 +1364,12 @@ packages: engines: {node: '>=6'} dev: true + /min-document/2.19.0: + resolution: {integrity: sha512-9Wy1B3m3f66bPPmU5hdA4DR4PB2OfDU/+GS3yAB7IQozE3tqXaVv2zOjgla7MEGSRv95+ILmOuvhLkOK6wJtCQ==} + dependencies: + dom-walk: 0.1.2 + dev: false + /minimatch/3.0.4: resolution: {integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==} dependencies: @@ -1352,10 +1399,29 @@ packages: engines: {node: '>= 0.6'} dev: true + /node-domexception/1.0.0: + resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} + engines: {node: '>=10.5.0'} + dev: false + + /node-fetch/3.2.10: + resolution: {integrity: sha512-MhuzNwdURnZ1Cp4XTazr69K0BTizsBroX7Zx3UgDSVcZYKF/6p0CBe4EUb/hLqmzVhl0UpYfgRljQ4yxE+iCxA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + data-uri-to-buffer: 4.0.0 + fetch-blob: 3.2.0 + formdata-polyfill: 4.0.10 + dev: false + /node-releases/2.0.6: resolution: {integrity: sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==} dev: true + /node-stream-zip/1.15.0: + resolution: {integrity: sha512-LN4fydt9TqhZhThkZIVQnF9cwjU3qmUH9h78Mx/K7d3VvfRqqwthLwJEUOEL0QPZ0XQmNN7be5Ggit5+4dq3Bw==} + engines: {node: '>=0.12.0'} + dev: false + /normalize-path/3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} @@ -1491,6 +1557,11 @@ packages: source-map-js: 1.0.2 dev: true + /process/0.11.10: + resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} + engines: {node: '>= 0.6.0'} + dev: false + /punycode/1.4.1: resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==} dev: true @@ -1683,6 +1754,12 @@ packages: resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==} dev: true + /stream/0.0.2: + resolution: {integrity: sha512-gCq3NDI2P35B2n6t76YJuOp7d6cN/C7Rt0577l91wllh0sY9ZBuw9KaSGqH/b0hzn3CWWJbpbW0W0WvQ1H/Q7g==} + dependencies: + emitter-component: 1.1.1 + dev: false + /string-width/4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -1787,139 +1864,6 @@ packages: is-number: 7.0.0 dev: true - /turbo-android-arm64/1.4.2: - resolution: {integrity: sha512-h6PorJ+muKDQE3wETwrkx3NpqypAxjIFLP3b8RQaAoNvxYa1JTSC71VMtYxMbwuDk58A1KGbXLDteR4by8Lqew==} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /turbo-darwin-64/1.4.2: - resolution: {integrity: sha512-HrXRwx+5FuKeR4r2ea2mWO5dImzxG7z987t4xZWytEWJ0gEujln1z1cjwotYU1l2pq8slJS8W3q9Qv3JRMrSkQ==} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /turbo-darwin-arm64/1.4.2: - resolution: {integrity: sha512-/qkMqq1hdbM/I0gchx08/ZZucgnQVp6gd03tHHYnyG20z8a39f38MbX7+I5aLRpa3pQzBk8RgNx0o7G1T+KvzA==} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /turbo-freebsd-64/1.4.2: - resolution: {integrity: sha512-bZcjR7GxpuE/0qz/aKg4gWDa+6eiuoV0cRnqCJ/rae14/iSmBt0MsMa+lUH5gZUFj581Dj8fQRoBeE+EOau5CA==} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /turbo-freebsd-arm64/1.4.2: - resolution: {integrity: sha512-dDx++7AELGAHuaMQjzNiKjSPu/xdDelUtRjWOzJWmwXzrgJlwNgQ93p+LYEA7LBWVZ8a32fpBE/VDait0alIJw==} - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /turbo-linux-32/1.4.2: - resolution: {integrity: sha512-AAxsEYhgv6x4UXwCoiRe+iL2pd+ArsJQDMgJGsJn+Tb09ca6+i1rTgdOTgcCSyvRwbXt0LYzqXN9zp6FwG6VHQ==} - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /turbo-linux-64/1.4.2: - resolution: {integrity: sha512-t7gGxp1ILmGwzymcf72Lw4Ca916Bi9j2C4xPnJ2CAqxMWQOJKCRvyOuUHC/uy1kFDjR2yszxMb+ZJL6P3nccfA==} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /turbo-linux-arm/1.4.2: - resolution: {integrity: sha512-6Rri//bX3wPMa8D0sSie05Xuze+6jTUDt4qsKp+JoQVanUKkKmRaVDpyV4WuFfjDbC5iP4ocN20FeaXenMFxTA==} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /turbo-linux-arm64/1.4.2: - resolution: {integrity: sha512-V7eBFUOrIvLvjrc81UE8C+NfqBRKADyKrrbKD9hMG5beE/piZZNGoHUwuEgLgsykCSfHjn1sQCidocVztuTMAw==} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /turbo-linux-mips64le/1.4.2: - resolution: {integrity: sha512-C0JpzpwyvhW5ChWr6S7ulUd8a+1SBLe2mLBepTWaXTh/5+sFDU/AMwPNkhpfV5o0gEtz03UPm7Y4G6dqU3UCAQ==} - cpu: [mipsel] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /turbo-linux-ppc64le/1.4.2: - resolution: {integrity: sha512-ipxyQCj3NXq/2V6a4lKoNDt8CjcufICgHAvOhAUmoAxz4kIEKRvA/75xsPpt2Ih/a4fWGxsbWFK6oA+ac0l3jQ==} - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /turbo-windows-32/1.4.2: - resolution: {integrity: sha512-pCvsh8mPSw6ZFABQqeJzfercnsOwCj1LpbWTPW1QftDij6zw1OWU4jWU529Ub1f+GMBej+xm/ufJhT+8A3NhwA==} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /turbo-windows-64/1.4.2: - resolution: {integrity: sha512-GnvM8uGOA6idUloDDxiEgUpIx5o5ZJL0ARL7f+6r/vfwA+qlSe/F+4hDCmT3+Xkg7/7zDZix5ViKVoTDMBP/Ig==} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /turbo-windows-arm64/1.4.2: - resolution: {integrity: sha512-2mCPiDnMLY924+M07mMo464cjOr0EITuIkK67IBm3EeEwSlunOmQk+LRc/Jq/Zx6Zuzp5XPZ2fZVvmmSFfogpQ==} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /turbo/1.4.2: - resolution: {integrity: sha512-ry1vUs5oHCIM+Sef8HED2XsbL28YAeclCrOtDp9zbZZMUX1r5s01COqOJjFJZfDiv2zSlUge9IIQXprM8BfrtA==} - hasBin: true - requiresBuild: true - optionalDependencies: - turbo-android-arm64: 1.4.2 - turbo-darwin-64: 1.4.2 - turbo-darwin-arm64: 1.4.2 - turbo-freebsd-64: 1.4.2 - turbo-freebsd-arm64: 1.4.2 - turbo-linux-32: 1.4.2 - turbo-linux-64: 1.4.2 - turbo-linux-arm: 1.4.2 - turbo-linux-arm64: 1.4.2 - turbo-linux-mips64le: 1.4.2 - turbo-linux-ppc64le: 1.4.2 - turbo-windows-32: 1.4.2 - turbo-windows-64: 1.4.2 - turbo-windows-arm64: 1.4.2 - dev: true - /type-fest/2.18.0: resolution: {integrity: sha512-pRS+/yrW5TjPPHNOvxhbNZexr2bS63WjrMU8a+VzEBhUi9Tz1pZeD+vQz3ut0svZ46P+SRqMEPnJmk2XnvNzTw==} engines: {node: '>=12.20'} @@ -1991,6 +1935,11 @@ packages: fsevents: 2.3.2 dev: true + /web-streams-polyfill/3.2.1: + resolution: {integrity: sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==} + engines: {node: '>= 8'} + dev: false + /which/2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} diff --git a/scripts/release/start-release.go b/scripts/release/start-release.go index 733c3e17..dc75749e 100644 --- a/scripts/release/start-release.go +++ b/scripts/release/start-release.go @@ -5,7 +5,6 @@ import ( "log" "os" "os/exec" - "path" "github.com/tidwall/sjson" ) @@ -21,7 +20,7 @@ func main() { func updateVersionOnPackageJSON(version string) { version = version[1:] - packageJSON, err := ioutil.ReadFile(path.Join("npm-installer", "package.json")) + packageJSON, err := ioutil.ReadFile("package.json") if err != nil { log.Fatal(err)