Commit 69eae1d5 authored by nanahira's avatar nanahira

use original loader

parent 6dc9d0c0
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
"version": "5.5.0", "version": "5.5.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@koishijs/cli": "^4.3.2", "@koishijs/cli": "^4.4.0",
"koishi": "^4.3.2", "@koishijs/loader": "^1.0.0",
"koishi": "^4.4.0",
"load-json-file": "^6.2.0", "load-json-file": "^6.2.0",
"ws": "^8.2.3", "ws": "^8.2.3",
"yaml": "^1.10.2" "yaml": "^1.10.2"
...@@ -187,14 +188,14 @@ ...@@ -187,14 +188,14 @@
} }
}, },
"node_modules/@koishijs/cli": { "node_modules/@koishijs/cli": {
"version": "4.3.2", "version": "4.4.0",
"resolved": "https://registry.npmjs.org/@koishijs/cli/-/cli-4.3.2.tgz", "resolved": "https://registry.npmjs.org/@koishijs/cli/-/cli-4.4.0.tgz",
"integrity": "sha512-XJQGeinDFa/nGGq0+sGKNeJqNdDFOHnI88TuFKi40Mqw6WFjhZloXqkXShV2HLZHEka5Jqr2bzZXLkjo2RPEVQ==", "integrity": "sha512-W57/2Pmt8kp9SlrwJj2ohObYywdfzopf2OV5mX7t8PlC4abe+msOvz3z+qi6C6P/SWFOStXh4Hz+FBIpdTFTFw==",
"dependencies": { "dependencies": {
"@koishijs/loader": "^1.0.0",
"cac": "^6.7.12", "cac": "^6.7.12",
"chokidar": "^3.5.3", "chokidar": "^3.5.3",
"dotenv": "^16.0.0", "dotenv": "^16.0.0",
"js-yaml": "^4.1.0",
"kleur": "^4.1.4", "kleur": "^4.1.4",
"prompts": "^2.4.2", "prompts": "^2.4.2",
"throttle-debounce": "^3.0.1" "throttle-debounce": "^3.0.1"
...@@ -206,15 +207,36 @@ ...@@ -206,15 +207,36 @@
"node": ">=12.0.0" "node": ">=12.0.0"
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.3.2" "koishi": "^4.4.0"
}
},
"node_modules/@koishijs/core": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.4.0.tgz",
"integrity": "sha512-MmKVlCx89M5icof92+U8U5QnywQ7dIjkGGUnzGlcBr59OrylHdRMKqZIIrtnqZo5EONehqh3k1Zbxr5V/6X5Eg==",
"dependencies": {
"@koishijs/utils": "^5.2.0",
"fastest-levenshtein": "^1.0.12",
"schemastery": "^3.1.0"
},
"engines": {
"node": ">=12.0.0"
} }
}, },
"node_modules/@koishijs/cli/node_modules/argparse": { "node_modules/@koishijs/loader": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@koishijs/loader/-/loader-1.0.0.tgz",
"integrity": "sha512-9Gbe9JLa/d+7nZkQH+xIJFmnsHlWJhlAbhA8UHmOqj+ei8/08gB1RGI5A1FRw8S5DguITP0hr8/40uqTqWVXZA==",
"dependencies": {
"js-yaml": "^4.1.0"
}
},
"node_modules/@koishijs/loader/node_modules/argparse": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
}, },
"node_modules/@koishijs/cli/node_modules/js-yaml": { "node_modules/@koishijs/loader/node_modules/js-yaml": {
"version": "4.1.0", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
...@@ -225,28 +247,15 @@ ...@@ -225,28 +247,15 @@
"js-yaml": "bin/js-yaml.js" "js-yaml": "bin/js-yaml.js"
} }
}, },
"node_modules/@koishijs/core": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.3.2.tgz",
"integrity": "sha512-Z/xnla4oneEG0WzI05ZkfZRy9bAEVkzcvpEkXk3lGbuhoY6/CIHL7eboOlPLZnICFV7GNqiHobPQJxNI4cyC1Q==",
"dependencies": {
"@koishijs/utils": "^5.1.2",
"fastest-levenshtein": "^1.0.12",
"schemastery": "^3.0.0"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/@koishijs/segment": { "node_modules/@koishijs/segment": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/@koishijs/segment/-/segment-1.1.1.tgz", "resolved": "https://registry.npmjs.org/@koishijs/segment/-/segment-1.1.1.tgz",
"integrity": "sha512-HmLRKJiIX++U+ow+RP0BVGwgAFzDRqwHusUzjoZcZdcnG8yudTsvB6MXnzBMnBL7k9LBxUlfB5P8ukkM1roZFQ==" "integrity": "sha512-HmLRKJiIX++U+ow+RP0BVGwgAFzDRqwHusUzjoZcZdcnG8yudTsvB6MXnzBMnBL7k9LBxUlfB5P8ukkM1roZFQ=="
}, },
"node_modules/@koishijs/utils": { "node_modules/@koishijs/utils": {
"version": "5.1.2", "version": "5.2.0",
"resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.1.2.tgz", "resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.2.0.tgz",
"integrity": "sha512-KexHBO3dXR2d5oxPgbVGQ5sFnApjo7iiUfK1+cv5o2dztsKxaI2E//7e26tYQqPoBzImpJpxt5peBu43Mwa5fg==", "integrity": "sha512-KqZS/zK415XkFZn1EQ9BpT4ydaNS0ZFCAS64RT4pR8pzCUWz5eyN81Z8A7AmLKdJWgNDiT6mQ08EyUvMq0l/7Q==",
"dependencies": { "dependencies": {
"@koishijs/segment": "^1.1.1", "@koishijs/segment": "^1.1.1",
"supports-color": "^8.1.0" "supports-color": "^8.1.0"
...@@ -458,9 +467,9 @@ ...@@ -458,9 +467,9 @@
} }
}, },
"node_modules/@types/ws": { "node_modules/@types/ws": {
"version": "8.5.0", "version": "8.5.2",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.0.tgz", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.2.tgz",
"integrity": "sha512-mTClfhq5cuGyW4jthaFuig6Q8OVfB3IRyZfN/9SCyJtiM5H0SubwM89cHoT9UngO6HyUFic88HvT1zSNLNyxWA==", "integrity": "sha512-VXI82ykONr5tacHEojnErTQk+KQSoYbW1NB6iz6wUwrNd+BqfkfggQNoNdCqhJSzbNumShPERbM+Pc5zpfhlbw==",
"dependencies": { "dependencies": {
"@types/node": "*" "@types/node": "*"
} }
...@@ -1099,9 +1108,9 @@ ...@@ -1099,9 +1108,9 @@
} }
}, },
"node_modules/destroy": { "node_modules/destroy": {
"version": "1.1.0", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.1.0.tgz", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.1.1.tgz",
"integrity": "sha512-R5QZrOXxSs0JDUIU/VANvRJlQVMts9C0L76HToQdPdlftfZCE7W6dyH0G4GZ5UW9fRqUOhAoCE2aGekuu+3HjQ==", "integrity": "sha512-jxwFW+yrVOLdwqIWvowFOM8UPdhZnvOF6mhXQQLXMxBDLtv2JVJlVJPEwkDv9prqscEtGtmnxuuI6pQKStK1vA==",
"engines": { "engines": {
"node": ">= 0.8", "node": ">= 0.8",
"npm": "1.2.8000 || >= 1.4.16" "npm": "1.2.8000 || >= 1.4.16"
...@@ -1822,9 +1831,9 @@ ...@@ -1822,9 +1831,9 @@
} }
}, },
"node_modules/has-symbols": { "node_modules/has-symbols": {
"version": "1.0.2", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
"integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
"engines": { "engines": {
"node": ">= 0.4" "node": ">= 0.4"
}, },
...@@ -2200,13 +2209,13 @@ ...@@ -2200,13 +2209,13 @@
} }
}, },
"node_modules/koishi": { "node_modules/koishi": {
"version": "4.3.2", "version": "4.4.0",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.3.2.tgz", "resolved": "https://registry.npmjs.org/koishi/-/koishi-4.4.0.tgz",
"integrity": "sha512-RC6wb6a+PS6Es3gEhbmyQ7Px9qXIwoGtIIuJYghaTOFKGcU301x/jYXjOGY0RTKgOoLPIRd9dgdk158TB33ZPg==", "integrity": "sha512-ar4V0oBJ2by9gT0Hey3w/japL80ddtF2A48jP+UrPZ17Z3ha505lB79sQyPVyFdM78BY7wRkFw/qMc8eKZG3+g==",
"dependencies": { "dependencies": {
"@koa/router": "^10.1.1", "@koa/router": "^10.1.1",
"@koishijs/core": "^4.3.2", "@koishijs/core": "^4.4.0",
"@koishijs/utils": "^5.1.2", "@koishijs/utils": "^5.2.0",
"@types/koa": "*", "@types/koa": "*",
"@types/koa__router": "*", "@types/koa__router": "*",
"@types/ws": "^8.2.2", "@types/ws": "^8.2.2",
...@@ -2707,9 +2716,9 @@ ...@@ -2707,9 +2716,9 @@
] ]
}, },
"node_modules/raw-body": { "node_modules/raw-body": {
"version": "2.5.0", "version": "2.5.1",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.0.tgz", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz",
"integrity": "sha512-XpyZ6O7PVu3ItMQl0LslfsRoKxMOxi3SzDkrOtxMES5AqLFpYjQCryxI4LGygUN2jL+RgFsPkMPPlG7cg/47+A==", "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==",
"dependencies": { "dependencies": {
"bytes": "3.1.2", "bytes": "3.1.2",
"http-errors": "2.0.0", "http-errors": "2.0.0",
...@@ -2912,9 +2921,9 @@ ...@@ -2912,9 +2921,9 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
}, },
"node_modules/schemastery": { "node_modules/schemastery": {
"version": "3.0.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.0.0.tgz", "resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.1.0.tgz",
"integrity": "sha512-0aWxVyVoa5XMxfsFqHdyj2QZCiUgImzcsCEdseALm57JlmBktu92EvTXm1AebD21q/fcSi+M7BGclDQyfMjQzg==" "integrity": "sha512-I1KaYmKfB+buINqBXydV8bC7N+BaC8y/V+609oSJNDO3mP3DY0zoNcDCIaY95KR0a5Cr9+CxgKl5BLEgFoikzw=="
}, },
"node_modules/semver": { "node_modules/semver": {
"version": "7.3.5", "version": "7.3.5",
...@@ -3348,9 +3357,9 @@ ...@@ -3348,9 +3357,9 @@
} }
}, },
"node_modules/vm2": { "node_modules/vm2": {
"version": "3.9.8", "version": "3.9.9",
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.8.tgz", "resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.9.tgz",
"integrity": "sha512-/1PYg/BwdKzMPo8maOZ0heT7DLI0DAFTm7YQaz/Lim9oIaFZsJs3EdtalvXuBfZwczNwsYhju75NW4d6E+4q+w==", "integrity": "sha512-xwTm7NLh/uOjARRBs8/95H0e8fT3Ukw5D/JJWhxMbhKzNh1Nu981jQKvkep9iKYNxzlVrdzD0mlBGkDKZWprlw==",
"dependencies": { "dependencies": {
"acorn": "^8.7.0", "acorn": "^8.7.0",
"acorn-walk": "^8.2.0" "acorn-walk": "^8.2.0"
...@@ -3583,17 +3592,35 @@ ...@@ -3583,17 +3592,35 @@
} }
}, },
"@koishijs/cli": { "@koishijs/cli": {
"version": "4.3.2", "version": "4.4.0",
"resolved": "https://registry.npmjs.org/@koishijs/cli/-/cli-4.3.2.tgz", "resolved": "https://registry.npmjs.org/@koishijs/cli/-/cli-4.4.0.tgz",
"integrity": "sha512-XJQGeinDFa/nGGq0+sGKNeJqNdDFOHnI88TuFKi40Mqw6WFjhZloXqkXShV2HLZHEka5Jqr2bzZXLkjo2RPEVQ==", "integrity": "sha512-W57/2Pmt8kp9SlrwJj2ohObYywdfzopf2OV5mX7t8PlC4abe+msOvz3z+qi6C6P/SWFOStXh4Hz+FBIpdTFTFw==",
"requires": { "requires": {
"@koishijs/loader": "^1.0.0",
"cac": "^6.7.12", "cac": "^6.7.12",
"chokidar": "^3.5.3", "chokidar": "^3.5.3",
"dotenv": "^16.0.0", "dotenv": "^16.0.0",
"js-yaml": "^4.1.0",
"kleur": "^4.1.4", "kleur": "^4.1.4",
"prompts": "^2.4.2", "prompts": "^2.4.2",
"throttle-debounce": "^3.0.1" "throttle-debounce": "^3.0.1"
}
},
"@koishijs/core": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.4.0.tgz",
"integrity": "sha512-MmKVlCx89M5icof92+U8U5QnywQ7dIjkGGUnzGlcBr59OrylHdRMKqZIIrtnqZo5EONehqh3k1Zbxr5V/6X5Eg==",
"requires": {
"@koishijs/utils": "^5.2.0",
"fastest-levenshtein": "^1.0.12",
"schemastery": "^3.1.0"
}
},
"@koishijs/loader": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@koishijs/loader/-/loader-1.0.0.tgz",
"integrity": "sha512-9Gbe9JLa/d+7nZkQH+xIJFmnsHlWJhlAbhA8UHmOqj+ei8/08gB1RGI5A1FRw8S5DguITP0hr8/40uqTqWVXZA==",
"requires": {
"js-yaml": "^4.1.0"
}, },
"dependencies": { "dependencies": {
"argparse": { "argparse": {
...@@ -3611,25 +3638,15 @@ ...@@ -3611,25 +3638,15 @@
} }
} }
}, },
"@koishijs/core": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.3.2.tgz",
"integrity": "sha512-Z/xnla4oneEG0WzI05ZkfZRy9bAEVkzcvpEkXk3lGbuhoY6/CIHL7eboOlPLZnICFV7GNqiHobPQJxNI4cyC1Q==",
"requires": {
"@koishijs/utils": "^5.1.2",
"fastest-levenshtein": "^1.0.12",
"schemastery": "^3.0.0"
}
},
"@koishijs/segment": { "@koishijs/segment": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/@koishijs/segment/-/segment-1.1.1.tgz", "resolved": "https://registry.npmjs.org/@koishijs/segment/-/segment-1.1.1.tgz",
"integrity": "sha512-HmLRKJiIX++U+ow+RP0BVGwgAFzDRqwHusUzjoZcZdcnG8yudTsvB6MXnzBMnBL7k9LBxUlfB5P8ukkM1roZFQ==" "integrity": "sha512-HmLRKJiIX++U+ow+RP0BVGwgAFzDRqwHusUzjoZcZdcnG8yudTsvB6MXnzBMnBL7k9LBxUlfB5P8ukkM1roZFQ=="
}, },
"@koishijs/utils": { "@koishijs/utils": {
"version": "5.1.2", "version": "5.2.0",
"resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.1.2.tgz", "resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.2.0.tgz",
"integrity": "sha512-KexHBO3dXR2d5oxPgbVGQ5sFnApjo7iiUfK1+cv5o2dztsKxaI2E//7e26tYQqPoBzImpJpxt5peBu43Mwa5fg==", "integrity": "sha512-KqZS/zK415XkFZn1EQ9BpT4ydaNS0ZFCAS64RT4pR8pzCUWz5eyN81Z8A7AmLKdJWgNDiT6mQ08EyUvMq0l/7Q==",
"requires": { "requires": {
"@koishijs/segment": "^1.1.1", "@koishijs/segment": "^1.1.1",
"supports-color": "^8.1.0" "supports-color": "^8.1.0"
...@@ -3825,9 +3842,9 @@ ...@@ -3825,9 +3842,9 @@
} }
}, },
"@types/ws": { "@types/ws": {
"version": "8.5.0", "version": "8.5.2",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.0.tgz", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.2.tgz",
"integrity": "sha512-mTClfhq5cuGyW4jthaFuig6Q8OVfB3IRyZfN/9SCyJtiM5H0SubwM89cHoT9UngO6HyUFic88HvT1zSNLNyxWA==", "integrity": "sha512-VXI82ykONr5tacHEojnErTQk+KQSoYbW1NB6iz6wUwrNd+BqfkfggQNoNdCqhJSzbNumShPERbM+Pc5zpfhlbw==",
"requires": { "requires": {
"@types/node": "*" "@types/node": "*"
} }
...@@ -4267,9 +4284,9 @@ ...@@ -4267,9 +4284,9 @@
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
}, },
"destroy": { "destroy": {
"version": "1.1.0", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.1.0.tgz", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.1.1.tgz",
"integrity": "sha512-R5QZrOXxSs0JDUIU/VANvRJlQVMts9C0L76HToQdPdlftfZCE7W6dyH0G4GZ5UW9fRqUOhAoCE2aGekuu+3HjQ==" "integrity": "sha512-jxwFW+yrVOLdwqIWvowFOM8UPdhZnvOF6mhXQQLXMxBDLtv2JVJlVJPEwkDv9prqscEtGtmnxuuI6pQKStK1vA=="
}, },
"dir-glob": { "dir-glob": {
"version": "3.0.1", "version": "3.0.1",
...@@ -4797,9 +4814,9 @@ ...@@ -4797,9 +4814,9 @@
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
}, },
"has-symbols": { "has-symbols": {
"version": "1.0.2", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
"integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==" "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A=="
}, },
"has-tostringtag": { "has-tostringtag": {
"version": "1.0.0", "version": "1.0.0",
...@@ -5079,13 +5096,13 @@ ...@@ -5079,13 +5096,13 @@
} }
}, },
"koishi": { "koishi": {
"version": "4.3.2", "version": "4.4.0",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.3.2.tgz", "resolved": "https://registry.npmjs.org/koishi/-/koishi-4.4.0.tgz",
"integrity": "sha512-RC6wb6a+PS6Es3gEhbmyQ7Px9qXIwoGtIIuJYghaTOFKGcU301x/jYXjOGY0RTKgOoLPIRd9dgdk158TB33ZPg==", "integrity": "sha512-ar4V0oBJ2by9gT0Hey3w/japL80ddtF2A48jP+UrPZ17Z3ha505lB79sQyPVyFdM78BY7wRkFw/qMc8eKZG3+g==",
"requires": { "requires": {
"@koa/router": "^10.1.1", "@koa/router": "^10.1.1",
"@koishijs/core": "^4.3.2", "@koishijs/core": "^4.4.0",
"@koishijs/utils": "^5.1.2", "@koishijs/utils": "^5.2.0",
"@types/koa": "*", "@types/koa": "*",
"@types/koa__router": "*", "@types/koa__router": "*",
"@types/ws": "^8.2.2", "@types/ws": "^8.2.2",
...@@ -5451,9 +5468,9 @@ ...@@ -5451,9 +5468,9 @@
"dev": true "dev": true
}, },
"raw-body": { "raw-body": {
"version": "2.5.0", "version": "2.5.1",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.0.tgz", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz",
"integrity": "sha512-XpyZ6O7PVu3ItMQl0LslfsRoKxMOxi3SzDkrOtxMES5AqLFpYjQCryxI4LGygUN2jL+RgFsPkMPPlG7cg/47+A==", "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==",
"requires": { "requires": {
"bytes": "3.1.2", "bytes": "3.1.2",
"http-errors": "2.0.0", "http-errors": "2.0.0",
...@@ -5585,9 +5602,9 @@ ...@@ -5585,9 +5602,9 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
}, },
"schemastery": { "schemastery": {
"version": "3.0.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.0.0.tgz", "resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.1.0.tgz",
"integrity": "sha512-0aWxVyVoa5XMxfsFqHdyj2QZCiUgImzcsCEdseALm57JlmBktu92EvTXm1AebD21q/fcSi+M7BGclDQyfMjQzg==" "integrity": "sha512-I1KaYmKfB+buINqBXydV8bC7N+BaC8y/V+609oSJNDO3mP3DY0zoNcDCIaY95KR0a5Cr9+CxgKl5BLEgFoikzw=="
}, },
"semver": { "semver": {
"version": "7.3.5", "version": "7.3.5",
...@@ -5897,9 +5914,9 @@ ...@@ -5897,9 +5914,9 @@
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
}, },
"vm2": { "vm2": {
"version": "3.9.8", "version": "3.9.9",
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.8.tgz", "resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.9.tgz",
"integrity": "sha512-/1PYg/BwdKzMPo8maOZ0heT7DLI0DAFTm7YQaz/Lim9oIaFZsJs3EdtalvXuBfZwczNwsYhju75NW4d6E+4q+w==", "integrity": "sha512-xwTm7NLh/uOjARRBs8/95H0e8fT3Ukw5D/JJWhxMbhKzNh1Nu981jQKvkep9iKYNxzlVrdzD0mlBGkDKZWprlw==",
"requires": { "requires": {
"acorn": "^8.7.0", "acorn": "^8.7.0",
"acorn-walk": "^8.2.0" "acorn-walk": "^8.2.0"
......
...@@ -36,8 +36,9 @@ ...@@ -36,8 +36,9 @@
"typescript": "^4.5.2" "typescript": "^4.5.2"
}, },
"dependencies": { "dependencies": {
"@koishijs/cli": "^4.3.2", "@koishijs/cli": "^4.4.0",
"koishi": "^4.3.2", "@koishijs/loader": "^1.0.0",
"koishi": "^4.4.0",
"load-json-file": "^6.2.0", "load-json-file": "^6.2.0",
"ws": "^8.2.3", "ws": "^8.2.3",
"yaml": "^1.10.2" "yaml": "^1.10.2"
......
export interface PluginInstallConfig { export interface PluginInstallConfig {
$install: boolean | string; $install: boolean | string;
$version: string;
} }
export interface KoishiConfig { export interface KoishiConfig {
......
...@@ -5,6 +5,9 @@ import { promisify } from 'util'; ...@@ -5,6 +5,9 @@ import { promisify } from 'util';
import path from 'path'; import path from 'path';
import { getPackageJsonPackages } from './utils/read-package-json'; import { getPackageJsonPackages } from './utils/read-package-json';
import { loadConfig } from './utils/load-config'; import { loadConfig } from './utils/load-config';
import { Loader } from "@koishijs/cli";
import ConfigLoader from "@koishijs/loader";
import { KoishiConfig, PluginInstallConfig } from "./def/interfaces";
const execAsync = promisify(exec); const execAsync = promisify(exec);
const logger = new Logger('bootstrap-install-plugin'); const logger = new Logger('bootstrap-install-plugin');
...@@ -56,13 +59,15 @@ async function tryInstallPackages(names: string[]) { ...@@ -56,13 +59,15 @@ async function tryInstallPackages(names: string[]) {
} }
async function installPlugin(name: string, info: any) { async function installPlugin(name: string, info: any) {
const version: string =
info.$version ||
(typeof info.$install === 'string' ? info.$install : undefined);
if (name.match(/^([\.\/~\\]|[A-Za-z]:[\/\\])/)) { if (name.match(/^([\.\/~\\]|[A-Za-z]:[\/\\])/)) {
logger.info(`Plugin ${name} is a local plugin, skipping.`); logger.info(`Plugin ${name} is a local plugin, skipping.`);
return; return;
} }
const version: string =
info.$version ||
(typeof info.$install === 'string' ? info.$install : undefined);
logger.info(`Installing plugin ${name}@${version || 'unknown'}.`); logger.info(`Installing plugin ${name}@${version || 'unknown'}.`);
const allowCommunity = !info.$official; const allowCommunity = !info.$official;
const allowOfficial = !info.$community; const allowOfficial = !info.$community;
...@@ -77,7 +82,7 @@ async function installPlugin(name: string, info: any) { ...@@ -77,7 +82,7 @@ async function installPlugin(name: string, info: any) {
); );
if ( if (
existingPluginVersion && existingPluginVersion &&
(existingPluginVersion === version || !version) (existingPluginVersion === version || !version || version === '*')
) { ) {
logger.info(`Plugin ${name}@${existingPluginVersion} exists, skipping.`); logger.info(`Plugin ${name}@${existingPluginVersion} exists, skipping.`);
return; return;
...@@ -113,7 +118,7 @@ async function installPlugin(name: string, info: any) { ...@@ -113,7 +118,7 @@ async function installPlugin(name: string, info: any) {
export async function installPluginEntry() { export async function installPluginEntry() {
logger.info(`Bootstrapping...`); logger.info(`Bootstrapping...`);
const config = await loadConfig(); const config = new ConfigLoader<KoishiConfig>().readConfig();
const plugins = config?.plugins; const plugins = config?.plugins;
if (!plugins) { if (!plugins) {
logger.warn(`No plugins found, exiting.`); logger.warn(`No plugins found, exiting.`);
...@@ -122,7 +127,7 @@ export async function installPluginEntry() { ...@@ -122,7 +127,7 @@ export async function installPluginEntry() {
logger.info(`Cleaning NPM cache.`); logger.info(`Cleaning NPM cache.`);
await execAsync(`npm cache clean --force`); await execAsync(`npm cache clean --force`);
for (const [name, info] of Object.entries(plugins)) { for (const [name, info] of Object.entries(plugins)) {
if (!info.$install) { if (!info.$install || !info.$version) {
continue; continue;
} }
await installPlugin(name, info); await installPlugin(name, info);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment