mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-25 08:23:13 +09:00
Merge remote-tracking branch 'upstream/master' into refactor/plugin-hooks-v2
# Conflicts: # packages/lib/src/data/messages_plugin.ts # packages/web_ui/src/components/PluginViewPage.tsx # test/lib/plugin.js
This commit is contained in:
commit
db84455c34
37 files changed
+573
-60
No files matched your search
@@ -19,8 +19,8 @@ async function logExec(cmd: string) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function updatePackage(name: string) {
|
||||
return logExec(`npm update --save ${name}`);
|
||||
export async function updatePackage(...names: string[]) {
|
||||
return logExec(`npm update --save ${names.join(" ")}`);
|
||||
}
|
||||
|
||||
export async function installPackage(name: string) {
|
||||
@@ -35,6 +35,13 @@ export async function handlePluginUpdate(pluginName: string, pluginInfos: Plugin
|
||||
return await updatePackage(pluginName);
|
||||
}
|
||||
|
||||
export async function handleUpdateAll(corePackage: string, pluginInfos: PluginNodeEnvInfo[]) {
|
||||
const pluginPackages = pluginInfos
|
||||
.map(plugin => plugin.npmPackage)
|
||||
.filter((name): name is string => name !== undefined);
|
||||
return await updatePackage(corePackage, ...pluginPackages);
|
||||
}
|
||||
|
||||
export async function handlePluginInstall(pluginName: string) {
|
||||
if (pluginName.length > 214 || /[^a-zA-Z0-9\-_.+@\/]/.test(pluginName)) {
|
||||
// https://docs.npmjs.com/cli/v11/configuring-npm/package-json#name
|
||||
|
||||
Reference in new issue
Block a user