omegga 0.1.85 → 1.0.2
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/README.md +142 -62
- package/bin/omegga +10 -4
- package/dist/brickadia/config.d.ts +3 -0
- package/dist/brickadia/config.d.ts.map +1 -0
- package/dist/brickadia/config.js +61 -0
- package/dist/brickadia/config.js.map +1 -0
- package/dist/brickadia/presets.d.ts +65 -0
- package/dist/brickadia/presets.js +3 -0
- package/dist/brickadia/presets.js.map +1 -0
- package/dist/brickadia/server.d.ts +20 -0
- package/dist/brickadia/server.d.ts.map +1 -0
- package/dist/brickadia/server.js +188 -0
- package/dist/brickadia/server.js.map +1 -0
- package/dist/brickadia/types.d.ts +45 -0
- package/dist/brickadia/types.d.ts.map +1 -0
- package/dist/brickadia/types.js +3 -0
- package/dist/brickadia/types.js.map +1 -0
- package/dist/cli/auth.d.ts +20 -0
- package/dist/cli/auth.d.ts.map +1 -0
- package/dist/cli/auth.js +115 -0
- package/dist/cli/auth.js.map +1 -0
- package/dist/cli/config.d.ts +10 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +72 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/index.d.ts +20 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +15 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/installer.d.ts +1 -0
- package/dist/cli/installer.d.ts.map +1 -0
- package/dist/cli/installer.js +55 -0
- package/dist/cli/installer.js.map +1 -0
- package/dist/cli/plugin.d.ts +11 -0
- package/dist/cli/plugin.d.ts.map +1 -0
- package/dist/cli/plugin.js +598 -0
- package/dist/cli/plugin.js.map +1 -0
- package/dist/cli/terminal.d.ts +34 -0
- package/dist/cli/terminal.d.ts.map +1 -0
- package/dist/cli/terminal.js +395 -0
- package/dist/cli/terminal.js.map +1 -0
- package/dist/config/authorizer.d.ts +2 -0
- package/dist/config/authorizer.d.ts.map +1 -0
- package/dist/config/authorizer.js +38 -0
- package/dist/config/authorizer.js.map +1 -0
- package/dist/config/formats/format_js.d.ts +3 -0
- package/dist/config/formats/format_js.d.ts.map +1 -0
- package/dist/config/formats/format_js.js +10 -0
- package/dist/config/formats/format_js.js.map +1 -0
- package/dist/config/formats/format_yml.d.ts +3 -0
- package/dist/config/formats/format_yml.d.ts.map +1 -0
- package/dist/config/formats/format_yml.js +14 -0
- package/dist/config/formats/format_yml.js.map +1 -0
- package/dist/config/index.d.ts +18 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +86 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/reader.d.ts +3 -0
- package/dist/config/reader.d.ts.map +1 -0
- package/dist/config/reader.js +30 -0
- package/dist/config/reader.js.map +1 -0
- package/dist/config/types.d.ts +37 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +3 -0
- package/dist/config/types.js.map +1 -0
- package/dist/config/validator.d.ts +6 -0
- package/dist/config/validator.d.ts.map +1 -0
- package/dist/config/validator.js +26 -0
- package/dist/config/validator.js.map +1 -0
- package/dist/config/writer.d.ts +3 -0
- package/dist/config/writer.d.ts.map +1 -0
- package/dist/config/writer.js +25 -0
- package/dist/config/writer.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/info/default_commands.json +28 -0
- package/dist/lib.d.ts +21 -0
- package/dist/lib.d.ts.map +1 -0
- package/dist/lib.js +54 -0
- package/dist/lib.js.map +1 -0
- package/dist/logger.d.ts +41 -0
- package/dist/logger.js +67 -0
- package/dist/logger.js.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +284 -0
- package/dist/main.js.map +1 -0
- package/dist/omegga/auth.d.ts +6 -0
- package/dist/omegga/auth.d.ts.map +1 -0
- package/dist/omegga/auth.js +139 -0
- package/dist/omegga/auth.js.map +1 -0
- package/dist/omegga/commandInjector.d.ts +35 -0
- package/dist/omegga/commandInjector.d.ts.map +1 -0
- package/dist/omegga/commandInjector.js +234 -0
- package/dist/omegga/commandInjector.js.map +1 -0
- package/dist/omegga/index.d.ts +7 -0
- package/dist/omegga/index.d.ts.map +1 -0
- package/dist/omegga/index.js +43 -0
- package/dist/omegga/index.js.map +1 -0
- package/dist/omegga/logWrangler.d.ts +32 -0
- package/dist/omegga/logWrangler.d.ts.map +1 -0
- package/dist/omegga/logWrangler.js +279 -0
- package/dist/omegga/logWrangler.js.map +1 -0
- package/dist/omegga/matchers/auth.d.ts +9 -0
- package/dist/omegga/matchers/auth.d.ts.map +1 -0
- package/dist/omegga/matchers/auth.js +53 -0
- package/dist/omegga/matchers/auth.js.map +1 -0
- package/dist/omegga/matchers/chat.d.ts +9 -0
- package/dist/omegga/matchers/chat.d.ts.map +1 -0
- package/dist/omegga/matchers/chat.js +68 -0
- package/dist/omegga/matchers/chat.js.map +1 -0
- package/dist/omegga/matchers/command.d.ts +7 -0
- package/dist/omegga/matchers/command.d.ts.map +1 -0
- package/dist/omegga/matchers/command.js +39 -0
- package/dist/omegga/matchers/command.js.map +1 -0
- package/dist/omegga/matchers/exit.d.ts +3 -0
- package/dist/omegga/matchers/exit.d.ts.map +1 -0
- package/dist/omegga/matchers/exit.js +21 -0
- package/dist/omegga/matchers/exit.js.map +1 -0
- package/dist/omegga/matchers/index.d.ts +3 -0
- package/dist/omegga/matchers/index.d.ts.map +1 -0
- package/dist/omegga/matchers/index.js +39 -0
- package/dist/omegga/matchers/index.js.map +1 -0
- package/dist/omegga/matchers/init.d.ts +3 -0
- package/dist/omegga/matchers/init.d.ts.map +1 -0
- package/dist/omegga/matchers/init.js +26 -0
- package/dist/omegga/matchers/init.js.map +1 -0
- package/dist/omegga/matchers/interact.d.ts +4 -0
- package/dist/omegga/matchers/interact.js +39 -0
- package/dist/omegga/matchers/interact.js.map +1 -0
- package/dist/omegga/matchers/join.d.ts +4 -0
- package/dist/omegga/matchers/join.d.ts.map +1 -0
- package/dist/omegga/matchers/join.js +95 -0
- package/dist/omegga/matchers/join.js.map +1 -0
- package/dist/omegga/matchers/leave.d.ts +4 -0
- package/dist/omegga/matchers/leave.d.ts.map +1 -0
- package/dist/omegga/matchers/leave.js +59 -0
- package/dist/omegga/matchers/leave.js.map +1 -0
- package/dist/omegga/matchers/mapChange.d.ts +3 -0
- package/dist/omegga/matchers/mapChange.d.ts.map +1 -0
- package/dist/omegga/matchers/mapChange.js +38 -0
- package/dist/omegga/matchers/mapChange.js.map +1 -0
- package/dist/omegga/matchers/types.d.ts +5 -0
- package/dist/omegga/matchers/types.d.ts.map +1 -0
- package/dist/omegga/matchers/types.js +7 -0
- package/dist/omegga/matchers/types.js.map +1 -0
- package/dist/omegga/matchers/version.d.ts +3 -0
- package/dist/omegga/matchers/version.d.ts.map +1 -0
- package/dist/omegga/matchers/version.js +45 -0
- package/dist/omegga/matchers/version.js.map +1 -0
- package/dist/omegga/player.d.ts +71 -0
- package/dist/omegga/player.d.ts.map +1 -0
- package/dist/omegga/player.js +442 -0
- package/dist/omegga/player.js.map +1 -0
- package/dist/omegga/plugin/plugin_jsonrpc_stdio.d.ts +23 -0
- package/dist/omegga/plugin/plugin_jsonrpc_stdio.d.ts.map +1 -0
- package/dist/omegga/plugin/plugin_jsonrpc_stdio.js +441 -0
- package/dist/omegga/plugin/plugin_jsonrpc_stdio.js.map +1 -0
- package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.d.ts +129 -0
- package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.d.ts.map +1 -0
- package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.js +260 -0
- package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.js.map +1 -0
- package/dist/omegga/plugin/plugin_node_safe/worker.d.ts +1 -0
- package/dist/omegga/plugin/plugin_node_safe/worker.d.ts.map +1 -0
- package/dist/omegga/plugin/plugin_node_safe/worker.js +289 -0
- package/dist/omegga/plugin/plugin_node_safe/worker.js.map +1 -0
- package/dist/omegga/plugin/plugin_node_safe.d.ts +24 -0
- package/dist/omegga/plugin/plugin_node_safe.d.ts.map +1 -0
- package/dist/omegga/plugin/plugin_node_safe.js +397 -0
- package/dist/omegga/plugin/plugin_node_safe.js.map +1 -0
- package/dist/omegga/plugin/plugin_node_unsafe.d.ts +13 -0
- package/dist/omegga/plugin/plugin_node_unsafe.d.ts.map +1 -0
- package/dist/omegga/plugin/plugin_node_unsafe.js +178 -0
- package/dist/omegga/plugin/plugin_node_unsafe.js.map +1 -0
- package/dist/omegga/plugin.d.ts +86 -0
- package/dist/omegga/plugin.d.ts.map +1 -0
- package/dist/omegga/plugin.js +458 -0
- package/dist/omegga/plugin.js.map +1 -0
- package/dist/omegga/server.d.ts +149 -0
- package/dist/omegga/server.d.ts.map +1 -0
- package/dist/omegga/server.js +601 -0
- package/dist/omegga/server.js.map +1 -0
- package/dist/omegga/types.d.ts +48 -0
- package/dist/omegga/types.d.ts.map +1 -0
- package/dist/omegga/types.js +3 -0
- package/dist/omegga/types.js.map +1 -0
- package/dist/omegga/wrapper.d.ts +22 -0
- package/dist/omegga/wrapper.d.ts.map +1 -0
- package/dist/omegga/wrapper.js +75 -0
- package/dist/omegga/wrapper.js.map +1 -0
- package/dist/omeggaplugin.d.ts +1 -0
- package/dist/omeggaplugin.js +4 -0
- package/dist/omeggaplugin.js.map +1 -0
- package/dist/plugin.d.ts +781 -0
- package/dist/plugin.js +41 -0
- package/dist/plugin.js.map +1 -0
- package/dist/softconfig.d.ts +51 -0
- package/dist/softconfig.d.ts.map +1 -0
- package/dist/softconfig.js +82 -0
- package/dist/softconfig.js.map +1 -0
- package/dist/util/brick/checkBounds.d.ts +8 -0
- package/dist/util/brick/checkBounds.d.ts.map +1 -0
- package/dist/util/brick/checkBounds.js +22 -0
- package/dist/util/brick/checkBounds.js.map +1 -0
- package/dist/util/brick/constants.d.ts +18 -0
- package/dist/util/brick/constants.d.ts.map +1 -0
- package/dist/util/brick/constants.js +184 -0
- package/dist/util/brick/constants.js.map +1 -0
- package/dist/util/brick/getBounds.d.ts +4 -0
- package/dist/util/brick/getBounds.d.ts.map +1 -0
- package/dist/util/brick/getBounds.js +39 -0
- package/dist/util/brick/getBounds.js.map +1 -0
- package/dist/util/brick/getBrickSize.d.ts +3 -0
- package/dist/util/brick/getBrickSize.d.ts.map +1 -0
- package/dist/util/brick/getBrickSize.js +12 -0
- package/dist/util/brick/getBrickSize.js.map +1 -0
- package/dist/util/brick/getScaleAxis.d.ts +3 -0
- package/dist/util/brick/getScaleAxis.d.ts.map +1 -0
- package/dist/util/brick/getScaleAxis.js +38 -0
- package/dist/util/brick/getScaleAxis.js.map +1 -0
- package/dist/util/brick/index.d.ts +13 -0
- package/dist/util/brick/index.d.ts.map +1 -0
- package/dist/util/brick/index.js +29 -0
- package/dist/util/brick/index.js.map +1 -0
- package/dist/util/brick/rotate.d.ts +17 -0
- package/dist/util/brick/rotate.d.ts.map +1 -0
- package/dist/util/brick/rotate.js +38 -0
- package/dist/util/brick/rotate.js.map +1 -0
- package/dist/util/brick/setOwnership.d.ts +12 -0
- package/dist/util/brick/setOwnership.d.ts.map +1 -0
- package/dist/util/brick/setOwnership.js +21 -0
- package/dist/util/brick/setOwnership.js.map +1 -0
- package/dist/util/chat.d.ts +23 -0
- package/dist/util/chat.d.ts.map +1 -0
- package/dist/util/chat.js +50 -0
- package/dist/util/chat.js.map +1 -0
- package/dist/util/color.d.ts +13 -0
- package/dist/util/color.d.ts.map +1 -0
- package/dist/util/color.js +130 -0
- package/dist/util/color.js.map +1 -0
- package/dist/util/file.d.ts +5 -0
- package/dist/util/file.d.ts.map +1 -0
- package/dist/util/file.js +114 -0
- package/dist/util/file.js.map +1 -0
- package/dist/util/index.d.ts +162 -0
- package/dist/util/index.d.ts.map +1 -0
- package/dist/util/index.js +92 -0
- package/dist/util/index.js.map +1 -0
- package/dist/util/map.d.ts +6 -0
- package/dist/util/map.d.ts.map +1 -0
- package/dist/util/map.js +26 -0
- package/dist/util/map.js.map +1 -0
- package/dist/util/pattern.d.ts +1 -0
- package/dist/util/pattern.d.ts.map +1 -0
- package/dist/util/pattern.js +11 -0
- package/dist/util/pattern.js.map +1 -0
- package/dist/util/time.d.ts +4 -0
- package/dist/util/time.d.ts.map +1 -0
- package/dist/util/time.js +41 -0
- package/dist/util/time.js.map +1 -0
- package/dist/util/uuid.d.ts +2 -0
- package/dist/util/uuid.d.ts.map +1 -0
- package/dist/util/uuid.js +8 -0
- package/dist/util/uuid.js.map +1 -0
- package/dist/util/wsl.d.ts +1 -0
- package/dist/util/wsl.d.ts.map +1 -0
- package/dist/util/wsl.js +14 -0
- package/dist/util/wsl.js.map +1 -0
- package/dist/webserver/backend/api.d.ts +3 -0
- package/dist/webserver/backend/api.d.ts.map +1 -0
- package/dist/webserver/backend/api.js +685 -0
- package/dist/webserver/backend/api.js.map +1 -0
- package/dist/webserver/backend/calendar.d.ts +5 -0
- package/dist/webserver/backend/calendar.d.ts.map +1 -0
- package/dist/webserver/backend/calendar.js +21 -0
- package/dist/webserver/backend/calendar.js.map +1 -0
- package/dist/webserver/backend/database.d.ts +149 -0
- package/dist/webserver/backend/database.d.ts.map +1 -0
- package/dist/webserver/backend/database.js +575 -0
- package/dist/webserver/backend/database.js.map +1 -0
- package/dist/webserver/backend/index.d.ts +31 -0
- package/dist/webserver/backend/index.d.ts.map +1 -0
- package/dist/webserver/backend/index.js +189 -0
- package/dist/webserver/backend/index.js.map +1 -0
- package/dist/webserver/backend/metrics.d.ts +3 -0
- package/dist/webserver/backend/metrics.d.ts.map +1 -0
- package/dist/webserver/backend/metrics.js +203 -0
- package/dist/webserver/backend/metrics.js.map +1 -0
- package/dist/webserver/backend/types.d.ts +115 -0
- package/dist/webserver/backend/types.d.ts.map +1 -0
- package/dist/webserver/backend/types.js +3 -0
- package/dist/webserver/backend/types.js.map +1 -0
- package/dist/webserver/backend/util.d.ts +2 -0
- package/dist/webserver/backend/util.d.ts.map +1 -0
- package/dist/webserver/backend/util.js +78 -0
- package/dist/webserver/backend/util.js.map +1 -0
- package/dist/webserver/index.d.ts +2 -0
- package/dist/webserver/index.d.ts.map +1 -0
- package/dist/webserver/index.js +9 -0
- package/dist/webserver/index.js.map +1 -0
- package/{src/webserver/frontend → frontend}/app.html +0 -0
- package/{src/webserver/frontend → frontend}/assets/fonts/GlacialIndifferenceBold.ttf +0 -0
- package/{src/webserver/frontend → frontend}/assets/fonts/GlacialIndifferenceItalic.otf +0 -0
- package/{src/webserver/frontend → frontend}/assets/fonts/GlacialIndifferenceMedium.otf +0 -0
- package/{src/webserver/frontend → frontend}/assets/fonts/GlacialIndifferenceRegular.ttf +0 -0
- package/{src/webserver/frontend → frontend}/assets/fonts/RobotoBold.ttf +0 -0
- package/{src/webserver/frontend → frontend}/assets/fonts/RobotoItalic.ttf +0 -0
- package/{src/webserver/frontend → frontend}/assets/fonts/RobotoRegular.ttf +0 -0
- package/{src/webserver/frontend → frontend}/assets/img/auth_bg.webp +0 -0
- package/{src/webserver/frontend → frontend}/assets/img/dark_bg.webp +0 -0
- package/{src/webserver/frontend → frontend}/assets/img/turkey.webp +0 -0
- package/{src/webserver/frontend → frontend}/auth.html +0 -0
- package/index.js +10 -2
- package/package.json +44 -16
- package/public/app.bundle.js +537 -73
- package/public/app.bundle.js.map +1 -1
- package/public/app.css +727 -2
- package/public/app.css.map +1 -1
- package/public/auth.bundle.js +18 -18
- package/public/auth.bundle.js.map +1 -1
- package/public/auth.css +364 -2
- package/public/auth.css.map +1 -1
- package/templates/rpc/README.md +29 -0
- package/templates/rpc/doc.json +7 -0
- package/templates/rpc/omegga_plugin +0 -0
- package/templates/rpc/plugin.json +4 -0
- package/templates/rpc/setup.sh +3 -0
- package/templates/safe/README.md +29 -0
- package/templates/safe/access.json +1 -0
- package/templates/safe/doc.json +7 -0
- package/templates/safe/omegga.plugin.js +20 -0
- package/templates/safe/plugin.json +4 -0
- package/templates/safe/setup.sh +4 -0
- package/templates/safe-ts/.gitignore.rename +3 -0
- package/templates/safe-ts/README.md +29 -0
- package/templates/safe-ts/access.json +1 -0
- package/templates/safe-ts/doc.json +7 -0
- package/templates/safe-ts/omegga.d.ts +1311 -0
- package/templates/safe-ts/omegga.plugin.ts +29 -0
- package/templates/safe-ts/plugin.json +4 -0
- package/templates/safe-ts/setup.sh +4 -0
- package/templates/safe-ts/tsconfig.json +10 -0
- package/templates/unsafe/README.md +29 -0
- package/templates/unsafe/doc.json +7 -0
- package/templates/unsafe/omegga.main.js +15 -0
- package/templates/unsafe/plugin.json +4 -0
- package/templates/unsafe/setup.sh +4 -0
- package/.babelrc.json +0 -5
- package/.github/workflows/lint.yml +0 -26
- package/.prettierrc +0 -7
- package/.vscode/extensions.json +0 -5
- package/src/OMEGGA_LEGACY_INSTALL +0 -44
- package/src/brickadia/config.js +0 -42
- package/src/brickadia/server.js +0 -227
- package/src/cli/auth.js +0 -104
- package/src/cli/config.js +0 -77
- package/src/cli/index.js +0 -6
- package/src/cli/installer.js +0 -65
- package/src/cli/plugin.js +0 -575
- package/src/cli/terminal.js +0 -466
- package/src/config/authorizer.js +0 -37
- package/src/config/formats/format_js.js +0 -6
- package/src/config/formats/format_yml.js +0 -8
- package/src/config/index.js +0 -81
- package/src/config/reader.js +0 -27
- package/src/config/validator.js +0 -32
- package/src/config/writer.js +0 -20
- package/src/info/default_commands.json +0 -26
- package/src/lib.js +0 -23
- package/src/main.js +0 -332
- package/src/omegga/auth.js +0 -138
- package/src/omegga/commandInjector.js +0 -228
- package/src/omegga/index.js +0 -22
- package/src/omegga/logWrangler.js +0 -323
- package/src/omegga/matchers/auth.js +0 -49
- package/src/omegga/matchers/chat.js +0 -73
- package/src/omegga/matchers/command.js +0 -39
- package/src/omegga/matchers/exit.js +0 -19
- package/src/omegga/matchers/init.js +0 -23
- package/src/omegga/matchers/join.js +0 -115
- package/src/omegga/matchers/leave.js +0 -58
- package/src/omegga/matchers/mapChange.js +0 -37
- package/src/omegga/matchers/version.js +0 -45
- package/src/omegga/player.js +0 -585
- package/src/omegga/plugin/plugin_jsonrpc_stdio.js +0 -526
- package/src/omegga/plugin/plugin_node_safe/proxyOmegga.js +0 -117
- package/src/omegga/plugin/plugin_node_safe/worker.js +0 -238
- package/src/omegga/plugin/plugin_node_safe.js +0 -473
- package/src/omegga/plugin/plugin_node_unsafe.js +0 -177
- package/src/omegga/plugin.js +0 -565
- package/src/omegga/server.js +0 -658
- package/src/omegga/wrapper.js +0 -62
- package/src/softconfig.js +0 -64
- package/src/util/brick/checkBounds.js +0 -22
- package/src/util/brick/constants.js +0 -185
- package/src/util/brick/getBounds.js +0 -36
- package/src/util/brick/getBrickSize.js +0 -9
- package/src/util/brick/getScaleAxis.js +0 -31
- package/src/util/brick/index.js +0 -9
- package/src/util/brick/rotate.js +0 -43
- package/src/util/brick/setOwnership.js +0 -20
- package/src/util/chat.js +0 -28
- package/src/util/color.js +0 -143
- package/src/util/file.js +0 -119
- package/src/util/index.js +0 -28
- package/src/util/map.js +0 -28
- package/src/util/pattern.js +0 -14
- package/src/util/time.js +0 -46
- package/src/util/uuid.js +0 -8
- package/src/util/wsl.js +0 -9
- package/src/webserver/backend/api.js +0 -795
- package/src/webserver/backend/calendar.js +0 -15
- package/src/webserver/backend/database.js +0 -725
- package/src/webserver/backend/index.js +0 -206
- package/src/webserver/backend/metrics.js +0 -148
- package/src/webserver/backend/util.js +0 -75
- package/src/webserver/frontend/.eslintrc.yml +0 -26
- package/src/webserver/frontend/app.js +0 -78
- package/src/webserver/frontend/auth.js +0 -16
- package/src/webserver/frontend/components/Background.vue +0 -83
- package/src/webserver/frontend/components/Button.vue +0 -105
- package/src/webserver/frontend/components/ChatEntry.vue +0 -107
- package/src/webserver/frontend/components/ChatTime.vue +0 -40
- package/src/webserver/frontend/components/Dimmer.vue +0 -43
- package/src/webserver/frontend/components/Dropdown.vue +0 -145
- package/src/webserver/frontend/components/Footer.vue +0 -29
- package/src/webserver/frontend/components/Header.vue +0 -27
- package/src/webserver/frontend/components/InfiniteScroll.vue +0 -51
- package/src/webserver/frontend/components/Input.vue +0 -93
- package/src/webserver/frontend/components/ListInput.vue +0 -105
- package/src/webserver/frontend/components/Loader.vue +0 -98
- package/src/webserver/frontend/components/MainMenuButton.vue +0 -83
- package/src/webserver/frontend/components/Modal.vue +0 -44
- package/src/webserver/frontend/components/NavBar.vue +0 -24
- package/src/webserver/frontend/components/PlayerDropdown.vue +0 -210
- package/src/webserver/frontend/components/PopoutContent.vue +0 -32
- package/src/webserver/frontend/components/RoleDropdown.vue +0 -157
- package/src/webserver/frontend/components/Scroll.vue +0 -33
- package/src/webserver/frontend/components/Toggle.vue +0 -91
- package/src/webserver/frontend/components/index.js +0 -33
- package/src/webserver/frontend/css/font.scss +0 -53
- package/src/webserver/frontend/css/mixins.scss +0 -49
- package/src/webserver/frontend/css/style.scss +0 -166
- package/src/webserver/frontend/css/theme.scss +0 -64
- package/src/webserver/frontend/partials/NavHeader.vue +0 -55
- package/src/webserver/frontend/partials/Page.vue +0 -40
- package/src/webserver/frontend/partials/PageContent.vue +0 -31
- package/src/webserver/frontend/partials/SideNav.vue +0 -115
- package/src/webserver/frontend/partials/index.js +0 -4
- package/src/webserver/frontend/router.js +0 -83
- package/src/webserver/frontend/views/Auth.vue +0 -190
- package/src/webserver/frontend/views/History.vue +0 -462
- package/src/webserver/frontend/views/Home.vue +0 -251
- package/src/webserver/frontend/views/Main.vue +0 -69
- package/src/webserver/frontend/views/NotFound.vue +0 -10
- package/src/webserver/frontend/views/Players.vue +0 -425
- package/src/webserver/frontend/views/PlayersInspector.vue +0 -538
- package/src/webserver/frontend/views/Plugins.vue +0 -217
- package/src/webserver/frontend/views/PluginsInspector.vue +0 -418
- package/src/webserver/frontend/views/Server.vue +0 -167
- package/src/webserver/frontend/views/Users.vue +0 -538
- package/src/webserver/frontend/widgets/Chat.vue +0 -124
- package/src/webserver/frontend/widgets/Status.vue +0 -91
- package/src/webserver/frontend/widgets/index.js +0 -2
- package/src/webserver/frontend/widgets/tooltip.js +0 -108
- package/src/webserver/index.js +0 -4
package/src/cli/installer.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// DEPRECATED
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const readline = require('readline');
|
|
4
|
-
const { spawn } = require('child_process');
|
|
5
|
-
require('colors');
|
|
6
|
-
|
|
7
|
-
const err = (...args) => console.error('!>'.red, ...args);
|
|
8
|
-
const log = (...args) => console.log('>>'.green, ...args);
|
|
9
|
-
|
|
10
|
-
const INSTALLER_PATH = path.join(__dirname, '../../tools/install_launcher.sh');
|
|
11
|
-
|
|
12
|
-
// wait for user response
|
|
13
|
-
function prompt() {
|
|
14
|
-
return new Promise(resolve => {
|
|
15
|
-
const rl = readline.createInterface({
|
|
16
|
-
input: process.stdin,
|
|
17
|
-
output: process.stdout,
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
rl.question(
|
|
21
|
-
'>>'.green +
|
|
22
|
-
' Would you like to download ' +
|
|
23
|
-
'the brickadia launcher'.yellow.underline +
|
|
24
|
-
'? (y/N): ',
|
|
25
|
-
resp => {
|
|
26
|
-
rl.close();
|
|
27
|
-
resolve(['y', 'yes'].includes(resp.toLowerCase()));
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// run the installer script
|
|
34
|
-
function runInstaller() {
|
|
35
|
-
return new Promise(resolve => {
|
|
36
|
-
const child = spawn(INSTALLER_PATH, { stdio: ['ignore', 1, 2] });
|
|
37
|
-
|
|
38
|
-
child.on('close', code => {
|
|
39
|
-
resolve(code);
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
async function installLauncher() {
|
|
45
|
-
const ok = await prompt();
|
|
46
|
-
|
|
47
|
-
if (!ok) {
|
|
48
|
-
err(
|
|
49
|
-
'Omegga could not be started - missing dependencies. Visit ' +
|
|
50
|
-
'https://www.brickadia.com'.yellow.underline +
|
|
51
|
-
' to download the launcher.'
|
|
52
|
-
);
|
|
53
|
-
process.exit(1);
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
log('Running launcher installer...');
|
|
58
|
-
const res = await runInstaller();
|
|
59
|
-
if (res === 0) {
|
|
60
|
-
log('Success!');
|
|
61
|
-
require('../main.js');
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
installLauncher();
|
package/src/cli/plugin.js
DELETED
|
@@ -1,575 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const simpleGit = require('simple-git');
|
|
4
|
-
const semver = require('semver');
|
|
5
|
-
const util = require('util');
|
|
6
|
-
const { exec: execNonPromise } = require('child_process');
|
|
7
|
-
const exec = util.promisify(execNonPromise);
|
|
8
|
-
|
|
9
|
-
require('colors');
|
|
10
|
-
|
|
11
|
-
const soft = require('../softconfig.js');
|
|
12
|
-
const pkg = require('../../package.json');
|
|
13
|
-
const config = require('../config/index');
|
|
14
|
-
|
|
15
|
-
const MAIN_BRANCHES = ['master', 'main'];
|
|
16
|
-
|
|
17
|
-
// get the working directory for omegga
|
|
18
|
-
function getWorkDir() {
|
|
19
|
-
// default working directory is the one specified in config
|
|
20
|
-
let workDir = config.store.get('defaultOmegga');
|
|
21
|
-
verboseLog('Using working directory', workDir.yellow);
|
|
22
|
-
|
|
23
|
-
// if there's a config in the current directory, use that one instead
|
|
24
|
-
if (config.find('.')) workDir = '.';
|
|
25
|
-
|
|
26
|
-
const confFile = config.find(workDir);
|
|
27
|
-
|
|
28
|
-
return confFile
|
|
29
|
-
? path.resolve(process.cwd(), path.dirname(confFile))
|
|
30
|
-
: undefined;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// plugin url transformers
|
|
34
|
-
const transformers = [
|
|
35
|
-
{
|
|
36
|
-
// github transformer
|
|
37
|
-
pattern: /^gh:(?<owner>[^/]+)\/(?<repo>[^/]+)$/,
|
|
38
|
-
fn: ({ owner, repo }) => ({
|
|
39
|
-
type: 'short',
|
|
40
|
-
name: repo,
|
|
41
|
-
url: `https://github.com/${owner}/omegga-${repo}`,
|
|
42
|
-
}),
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
// gitlab transformer
|
|
46
|
-
pattern: /^gl:(?<owner>[^/]+)\/(?<repo>[^/]+)$/,
|
|
47
|
-
fn: ({ owner, repo }) => ({
|
|
48
|
-
type: 'short',
|
|
49
|
-
name: repo,
|
|
50
|
-
url: `https://gitlab.com/${owner}/omegga-${repo}`,
|
|
51
|
-
}),
|
|
52
|
-
},
|
|
53
|
-
];
|
|
54
|
-
|
|
55
|
-
// convert a shortened url into a full length one
|
|
56
|
-
const transformUrl = url => {
|
|
57
|
-
const found = transformers.find(t => url.match(t.pattern));
|
|
58
|
-
if (!found) return { type: 'raw', url };
|
|
59
|
-
return found.fn(url.match(found.pattern).groups);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
let needsNL = false;
|
|
63
|
-
|
|
64
|
-
// rewrite a console line
|
|
65
|
-
const rewriteLine = (...args) => {
|
|
66
|
-
process.stdout.clearLine();
|
|
67
|
-
process.stdout.cursorTo(0);
|
|
68
|
-
process.stdout.write(args.join(' '));
|
|
69
|
-
needsNL = true;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// logging helper functions
|
|
73
|
-
const plg = (plugin, ...args) => {
|
|
74
|
-
if (needsNL) {
|
|
75
|
-
needsNL = false;
|
|
76
|
-
console.log();
|
|
77
|
-
}
|
|
78
|
-
console.log(plugin.name, '>>'.green, ...args);
|
|
79
|
-
};
|
|
80
|
-
const plgLog = (plugin, ...args) => {
|
|
81
|
-
if (global.VERBOSE) plg(plugin, ...args);
|
|
82
|
-
else rewriteLine(plugin.name, '>>'.green, ...args);
|
|
83
|
-
};
|
|
84
|
-
const plgWarn = (plugin, ...args) => {
|
|
85
|
-
if (needsNL) {
|
|
86
|
-
needsNL = false;
|
|
87
|
-
console.warn();
|
|
88
|
-
}
|
|
89
|
-
console.warn(plugin.name, 'W>'.yellow, ...args);
|
|
90
|
-
};
|
|
91
|
-
const plgErr = (plugin, ...args) => {
|
|
92
|
-
if (needsNL) {
|
|
93
|
-
needsNL = false;
|
|
94
|
-
console.error();
|
|
95
|
-
}
|
|
96
|
-
console.error(plugin.name, '!>'.red, ...args);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
const err = (...args) => {
|
|
100
|
-
if (needsNL) {
|
|
101
|
-
needsNL = false;
|
|
102
|
-
console.error();
|
|
103
|
-
}
|
|
104
|
-
console.error('!>'.red, ...args);
|
|
105
|
-
};
|
|
106
|
-
const log = (...args) => {
|
|
107
|
-
if (needsNL) {
|
|
108
|
-
needsNL = false;
|
|
109
|
-
console.log();
|
|
110
|
-
}
|
|
111
|
-
console.log('>>'.green, ...args);
|
|
112
|
-
};
|
|
113
|
-
const verboseLog = (...args) => {
|
|
114
|
-
if (!global.VERBOSE) return;
|
|
115
|
-
if (needsNL) {
|
|
116
|
-
needsNL = false;
|
|
117
|
-
console.log();
|
|
118
|
-
}
|
|
119
|
-
console.log('V>'.magenta, ...args);
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
function checkPlugin(omeggaPath, plugin) {
|
|
123
|
-
const pluginPath = path.join(omeggaPath, soft.PLUGIN_PATH, plugin.name);
|
|
124
|
-
|
|
125
|
-
// check for the plugin file, whatever it's called
|
|
126
|
-
if (fs.existsSync(path.join(pluginPath, soft.PLUGIN_FILE))) {
|
|
127
|
-
if (needsNL) {
|
|
128
|
-
console.log();
|
|
129
|
-
needsNL = false;
|
|
130
|
-
}
|
|
131
|
-
plgLog(plugin, 'Checking plugin file...');
|
|
132
|
-
let data;
|
|
133
|
-
try {
|
|
134
|
-
data = JSON.parse(
|
|
135
|
-
fs.readFileSync(path.join(pluginPath, soft.PLUGIN_FILE), 'utf8')
|
|
136
|
-
);
|
|
137
|
-
} catch (e) {
|
|
138
|
-
plgErr(plugin, 'Error reading plugin file', e);
|
|
139
|
-
return false;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// make sure this plugin version is okay.
|
|
143
|
-
// in the future, this may include deprecation warnings and format changes
|
|
144
|
-
if (data.formatVersion !== 1) {
|
|
145
|
-
plgWarn(
|
|
146
|
-
plugin,
|
|
147
|
-
'WARNING - Plugin file has invalid',
|
|
148
|
-
'formatVersion'.yellow + '. Expected',
|
|
149
|
-
'1'.yellow
|
|
150
|
-
);
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
// check the omeggaVersion field of the plugin file
|
|
155
|
-
if (!data.omeggaVersion || !semver.validRange(data.omeggaVersion)) {
|
|
156
|
-
plgWarn(
|
|
157
|
-
plugin,
|
|
158
|
-
'WARNING - Plugin file has invalid',
|
|
159
|
-
'omeggaVersion'.yellow + '. Expected semver expression'
|
|
160
|
-
);
|
|
161
|
-
return false;
|
|
162
|
-
} else if (!semver.satisfies(pkg.version, data.omeggaVersion)) {
|
|
163
|
-
plgWarn(
|
|
164
|
-
plugin,
|
|
165
|
-
`WARNING - Plugin is not made for this version of omegga (${pkg.version.yellow} vs ${data.omeggaVersion.yellow})`
|
|
166
|
-
);
|
|
167
|
-
return false;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
plgLog(plugin, 'Plugin file', 'OK'.green);
|
|
171
|
-
return true;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
// no plugin file, no problem!
|
|
175
|
-
plgWarn(
|
|
176
|
-
plugin,
|
|
177
|
-
`WARNING - Plugin is missing plugin file (${soft.PLUGIN_FILE}), this may be a problem in future versions`
|
|
178
|
-
);
|
|
179
|
-
return true;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
module.exports = {
|
|
183
|
-
// install plugins from a list of plugins
|
|
184
|
-
async install(plugins, _options) {
|
|
185
|
-
const omeggaPath = getWorkDir();
|
|
186
|
-
if (!omeggaPath)
|
|
187
|
-
return err(
|
|
188
|
-
'Not an omegga directory, run ',
|
|
189
|
-
'omegga init'.yellow,
|
|
190
|
-
'to setup one.'
|
|
191
|
-
);
|
|
192
|
-
|
|
193
|
-
log('Attempting to install', (plugins.length + '').yellow, 'plugins...');
|
|
194
|
-
|
|
195
|
-
for (const pluginUrl of plugins) {
|
|
196
|
-
const plugin = transformUrl(pluginUrl);
|
|
197
|
-
|
|
198
|
-
// if the plugin wasn't transformed, try to extract its name from the git url
|
|
199
|
-
if (!('name' in plugin)) {
|
|
200
|
-
try {
|
|
201
|
-
const { name } = path.parse(plugin.url);
|
|
202
|
-
plugin.name = name.replace(/^omegga-/, '');
|
|
203
|
-
} catch (e) {
|
|
204
|
-
console.error('!>'.red, 'Error parsing name from url', plugin.url);
|
|
205
|
-
break;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
log(
|
|
210
|
-
'Installing plugin',
|
|
211
|
-
plugin.name.yellow,
|
|
212
|
-
'from',
|
|
213
|
-
plugin.url.yellow + '...'
|
|
214
|
-
);
|
|
215
|
-
|
|
216
|
-
// plugin absolute path
|
|
217
|
-
const pluginPath = path.join(omeggaPath, soft.PLUGIN_PATH, plugin.name);
|
|
218
|
-
|
|
219
|
-
// check if plugin already exists
|
|
220
|
-
// TODO: if force is passed in, remove the old directory
|
|
221
|
-
if (
|
|
222
|
-
fs.existsSync(pluginPath) &&
|
|
223
|
-
fs.existsSync(path.join(pluginPath, 'doc.json'))
|
|
224
|
-
) {
|
|
225
|
-
plgErr(
|
|
226
|
-
plugin,
|
|
227
|
-
'Directory already exists! Try',
|
|
228
|
-
('omegga update ' + plugin.name).yellow,
|
|
229
|
-
'or check for plugin name collisions'
|
|
230
|
-
);
|
|
231
|
-
continue;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
if (!fs.existsSync(pluginPath)) {
|
|
235
|
-
// create plugin local directory
|
|
236
|
-
try {
|
|
237
|
-
fs.mkdirSync(pluginPath, { recursive: true });
|
|
238
|
-
} catch (e) {
|
|
239
|
-
plgErr(plugin, 'Error creating plugin directory', e);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
// clone the plugin from git
|
|
244
|
-
try {
|
|
245
|
-
plgLog(plugin, 'Cloning...');
|
|
246
|
-
const git = simpleGit(pluginPath);
|
|
247
|
-
await git.clone(plugin.url, pluginPath);
|
|
248
|
-
} catch (e) {
|
|
249
|
-
plgErr(plugin, 'Error cloning plugin', e);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
// check for the plugin file for issues
|
|
253
|
-
// TODO: if force is passed in, ignore the plugin check
|
|
254
|
-
if (!checkPlugin(omeggaPath, plugin)) continue;
|
|
255
|
-
|
|
256
|
-
const postInstallPath = path.join(pluginPath, soft.PLUGIN_POSTINSTALL);
|
|
257
|
-
if (fs.existsSync(postInstallPath)) {
|
|
258
|
-
plgLog(plugin, 'Running post install script...');
|
|
259
|
-
try {
|
|
260
|
-
fs.chmodSync(postInstallPath, '0755');
|
|
261
|
-
let { stdout, stderr } = await exec(postInstallPath, {
|
|
262
|
-
cwd: pluginPath,
|
|
263
|
-
shell: true,
|
|
264
|
-
});
|
|
265
|
-
|
|
266
|
-
if (stderr.length) plgErr(plugin, stderr);
|
|
267
|
-
|
|
268
|
-
verboseLog(stdout);
|
|
269
|
-
} catch (e) {
|
|
270
|
-
plgErr(plugin, 'Error running post install script:', e);
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
},
|
|
275
|
-
|
|
276
|
-
async update(plugins, _options) {
|
|
277
|
-
const omeggaPath = getWorkDir();
|
|
278
|
-
if (!omeggaPath)
|
|
279
|
-
return err(
|
|
280
|
-
'Not an omegga directory, run ',
|
|
281
|
-
'omegga init'.yellow,
|
|
282
|
-
'to setup one.'
|
|
283
|
-
);
|
|
284
|
-
|
|
285
|
-
const pluginFolder = path.join(omeggaPath, soft.PLUGIN_PATH);
|
|
286
|
-
|
|
287
|
-
// if no plugins are passed in, use every plugin in the plugins folder
|
|
288
|
-
if (plugins.length === 0) {
|
|
289
|
-
plugins = fs.readdirSync(pluginFolder);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
plugins = plugins
|
|
293
|
-
.map(dir => path.join(pluginFolder, dir))
|
|
294
|
-
// every plugin must be in a directory
|
|
295
|
-
.filter(
|
|
296
|
-
dir =>
|
|
297
|
-
fs.existsSync(dir) &&
|
|
298
|
-
fs.lstatSync(dir).isDirectory() &&
|
|
299
|
-
fs.existsSync(path.join(dir, '.git'))
|
|
300
|
-
)
|
|
301
|
-
.map(dir => ({ name: path.basename(dir) }));
|
|
302
|
-
|
|
303
|
-
if (plugins.length === 0) {
|
|
304
|
-
log('Found no plugins that can be updated');
|
|
305
|
-
return;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
log('Checking', (plugins.length + '').yellow, 'plugins for updates...');
|
|
309
|
-
|
|
310
|
-
// list of plugins that will be updated
|
|
311
|
-
let pluginsToUpdate = [];
|
|
312
|
-
|
|
313
|
-
for (const plugin of plugins) {
|
|
314
|
-
if (needsNL) {
|
|
315
|
-
console.log();
|
|
316
|
-
needsNL = false;
|
|
317
|
-
}
|
|
318
|
-
plgLog(plugin, 'Checking...');
|
|
319
|
-
const pluginPath = path.join(pluginFolder, plugin.name);
|
|
320
|
-
plugin.path = pluginPath;
|
|
321
|
-
const git = simpleGit(pluginPath);
|
|
322
|
-
plugin.git = git;
|
|
323
|
-
if (!(await git.checkIsRepo())) {
|
|
324
|
-
plgErr(plugin, 'No git repo detected');
|
|
325
|
-
continue;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
let status;
|
|
329
|
-
// get git status
|
|
330
|
-
try {
|
|
331
|
-
status = await git.status();
|
|
332
|
-
} catch (e) {
|
|
333
|
-
plgErr(plugin, 'Error getting status', e);
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
try {
|
|
337
|
-
// check for uncommitted changes
|
|
338
|
-
if (status.files.some(f => f.working_dir !== '?')) {
|
|
339
|
-
plgErr(plugin, 'Detected uncommitted changes - ignoring');
|
|
340
|
-
continue;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
const remotes = await git.getRemotes();
|
|
344
|
-
const branches = await git.branch();
|
|
345
|
-
|
|
346
|
-
// check if we're on a weird branch
|
|
347
|
-
if (!MAIN_BRANCHES.includes(branches.current)) {
|
|
348
|
-
plgErr(plugin, 'Not on a main branch - ignoring');
|
|
349
|
-
continue;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
// try to correct a weird detached branch
|
|
353
|
-
if (
|
|
354
|
-
remotes.length === 1 &&
|
|
355
|
-
remotes[0].name === 'origin' &&
|
|
356
|
-
!status.tracking
|
|
357
|
-
) {
|
|
358
|
-
let skip = false;
|
|
359
|
-
for (const branch of MAIN_BRANCHES) {
|
|
360
|
-
if (
|
|
361
|
-
branches.current === branch &&
|
|
362
|
-
branches.branches[`remotes/origin/${branch}`]
|
|
363
|
-
) {
|
|
364
|
-
plgLog(plugin, 'Correcting upstream...');
|
|
365
|
-
try {
|
|
366
|
-
await git.branch({ '--set-upstream-to': `origin/${branch}` });
|
|
367
|
-
status = await git.status();
|
|
368
|
-
break;
|
|
369
|
-
} catch (e) {
|
|
370
|
-
plgErr(
|
|
371
|
-
plugin,
|
|
372
|
-
'Error getting status/fixing upstream branch',
|
|
373
|
-
e
|
|
374
|
-
);
|
|
375
|
-
skip = true;
|
|
376
|
-
break;
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
if (skip) continue;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
// this should be corrected by the above check, though if it's not I am not fighting git lol
|
|
384
|
-
if (!status.tracking) {
|
|
385
|
-
plgErr(plugin, 'No upstream branch - ignoring');
|
|
386
|
-
continue;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
// local developers, publish your code please!!! :)
|
|
390
|
-
if (remotes.length === 0) {
|
|
391
|
-
plgErr(plugin, 'No remotes - ignoring');
|
|
392
|
-
continue;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
try {
|
|
396
|
-
plgLog(plugin, 'Fetching...');
|
|
397
|
-
await git.fetch();
|
|
398
|
-
status = await git.status();
|
|
399
|
-
} catch (e) {
|
|
400
|
-
plgErr(plugin, 'Error fetching remote code', e);
|
|
401
|
-
continue;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
if (status.ahead > 0) {
|
|
405
|
-
plgErr(plugin, 'Detected plugin is ahead - ignoring');
|
|
406
|
-
continue;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
if (status.behind === 0) {
|
|
410
|
-
plgLog(plugin, 'Already up-to-date!'.green);
|
|
411
|
-
continue;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
plgLog(plugin, 'Update available');
|
|
415
|
-
pluginsToUpdate.push(plugin);
|
|
416
|
-
} catch (e) {
|
|
417
|
-
plgErr(plugin, 'Error', e);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
if (pluginsToUpdate.length === 0) {
|
|
422
|
-
log('All plugins are currently up-to-date');
|
|
423
|
-
return;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
log('Updating', (pluginsToUpdate.length + '').yellow, 'plugins...');
|
|
427
|
-
let updates = 0;
|
|
428
|
-
|
|
429
|
-
for (const plugin of pluginsToUpdate) {
|
|
430
|
-
const { git } = plugin;
|
|
431
|
-
if (needsNL) {
|
|
432
|
-
console.log();
|
|
433
|
-
needsNL = false;
|
|
434
|
-
}
|
|
435
|
-
plgLog(plugin, 'Creating backup branch...');
|
|
436
|
-
try {
|
|
437
|
-
const branches = await git.branch();
|
|
438
|
-
const mainBranch =
|
|
439
|
-
MAIN_BRANCHES.find(b => branches.branches[b]) ?? MAIN_BRANCHES[0];
|
|
440
|
-
if (branches.branches['omegga-upgrade-backup']) {
|
|
441
|
-
plgLog(plugin, 'Deleting leftover backup branch...');
|
|
442
|
-
await git.deleteLocalBranch('omegga-upgrade-backup', true);
|
|
443
|
-
}
|
|
444
|
-
await git.checkoutBranch('omegga-upgrade-backup', mainBranch);
|
|
445
|
-
await git.branch({ '--set-upstream-to': `origin/${mainBranch}` });
|
|
446
|
-
await git.checkout(mainBranch);
|
|
447
|
-
plgLog(plugin, 'Pulling update...');
|
|
448
|
-
await git.pull();
|
|
449
|
-
if ((await git.status()).behind > 0) {
|
|
450
|
-
throw '- still behind?';
|
|
451
|
-
}
|
|
452
|
-
plgLog(plugin, 'Checking plugin versions...');
|
|
453
|
-
if (!checkPlugin(omeggaPath, plugin)) {
|
|
454
|
-
throw 'Incompatible';
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
const postInstallPath = path.join(plugin.path, soft.PLUGIN_POSTINSTALL);
|
|
458
|
-
if (fs.existsSync(postInstallPath)) {
|
|
459
|
-
plgLog(plugin, 'Running post install script...');
|
|
460
|
-
try {
|
|
461
|
-
fs.chmodSync(postInstallPath, '0755');
|
|
462
|
-
let { stdout, stderr } = await exec(postInstallPath, {
|
|
463
|
-
cwd: plugin.path,
|
|
464
|
-
shell: true,
|
|
465
|
-
});
|
|
466
|
-
|
|
467
|
-
if (stderr.length) plgErr(plugin, stderr);
|
|
468
|
-
|
|
469
|
-
verboseLog(stdout);
|
|
470
|
-
} catch (e) {
|
|
471
|
-
plgErr(plugin, 'Error running post install script:', e);
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
plgLog(plugin, 'Updated!'.green);
|
|
476
|
-
updates++;
|
|
477
|
-
} catch (e) {
|
|
478
|
-
plgErr(
|
|
479
|
-
plugin,
|
|
480
|
-
'Error updating - attempting to restore from backup branch',
|
|
481
|
-
e
|
|
482
|
-
);
|
|
483
|
-
try {
|
|
484
|
-
const branches = await git.branch();
|
|
485
|
-
if (!MAIN_BRANCHES.includes(branches.current)) {
|
|
486
|
-
plgErr(
|
|
487
|
-
plugin,
|
|
488
|
-
'Not on expected branch - exiting before I break more things'
|
|
489
|
-
);
|
|
490
|
-
continue;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
const mainBranch =
|
|
494
|
-
MAIN_BRANCHES.find(b => branches.branches[b]) ?? MAIN_BRANCHES[0];
|
|
495
|
-
|
|
496
|
-
plg(plugin, 'Resetting current branch');
|
|
497
|
-
await git.reset('hard');
|
|
498
|
-
plgLog(plugin, 'Attempting to checkout backup branch');
|
|
499
|
-
await git.checkout('omegga-upgrade-backup');
|
|
500
|
-
plgLog(plugin, `Replacing ${mainBranch} with backup`);
|
|
501
|
-
await git.deleteLocalBranch(mainBranch);
|
|
502
|
-
await git.checkoutBranch(mainBranch, 'omegga-upgrade-backup');
|
|
503
|
-
plgLog(plugin, 'Restored to backup branch');
|
|
504
|
-
|
|
505
|
-
if ((await git.branch()) !== mainBranch) {
|
|
506
|
-
plgErr(
|
|
507
|
-
plugin,
|
|
508
|
-
`Failed to checkout newly created ${mainBranch} branch`
|
|
509
|
-
);
|
|
510
|
-
continue;
|
|
511
|
-
} else {
|
|
512
|
-
plgWarn(plugin, 'Restored from backup and plugin not updated...');
|
|
513
|
-
}
|
|
514
|
-
} catch (e) {
|
|
515
|
-
plgErr(plugin, 'Error restoring from backup... Whelp...');
|
|
516
|
-
}
|
|
517
|
-
continue;
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
log('Updated', (updates + '').yellow, 'plugins!');
|
|
522
|
-
},
|
|
523
|
-
|
|
524
|
-
async check(plugins, _options) {
|
|
525
|
-
const omeggaPath = getWorkDir();
|
|
526
|
-
if (!omeggaPath)
|
|
527
|
-
return err(
|
|
528
|
-
'Not an omegga directory, run ',
|
|
529
|
-
'omegga init'.yellow,
|
|
530
|
-
'to setup one.'
|
|
531
|
-
);
|
|
532
|
-
|
|
533
|
-
const pluginFolder = path.join(omeggaPath, soft.PLUGIN_PATH);
|
|
534
|
-
|
|
535
|
-
// if no plugins are passed in, use every plugin in the plugins folder
|
|
536
|
-
if (plugins.length === 0) {
|
|
537
|
-
plugins = fs.readdirSync(pluginFolder);
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
plugins = plugins
|
|
541
|
-
.map(dir => path.join(pluginFolder, dir))
|
|
542
|
-
// every plugin must be in a directory
|
|
543
|
-
.filter(
|
|
544
|
-
dir =>
|
|
545
|
-
fs.existsSync(dir) &&
|
|
546
|
-
fs.lstatSync(dir).isDirectory() &&
|
|
547
|
-
fs.existsSync(path.join(dir, '.git'))
|
|
548
|
-
)
|
|
549
|
-
.map(dir => ({ name: path.basename(dir) }));
|
|
550
|
-
|
|
551
|
-
if (plugins.length === 0) {
|
|
552
|
-
log('Found no plugins that can be checked');
|
|
553
|
-
return;
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
log(
|
|
557
|
-
'Checking',
|
|
558
|
-
(plugins.length + '').yellow,
|
|
559
|
-
'plugins for valid plugin files'
|
|
560
|
-
);
|
|
561
|
-
|
|
562
|
-
for (const plugin of plugins) {
|
|
563
|
-
const pluginPath = path.join(pluginFolder, plugin.name);
|
|
564
|
-
plugin.path = pluginPath;
|
|
565
|
-
const git = simpleGit(pluginPath);
|
|
566
|
-
plugin.git = git;
|
|
567
|
-
if (!(await git.checkIsRepo())) {
|
|
568
|
-
plgErr(plugin, 'No git repo detected');
|
|
569
|
-
continue;
|
|
570
|
-
}
|
|
571
|
-
checkPlugin(omeggaPath, plugin);
|
|
572
|
-
}
|
|
573
|
-
console.log();
|
|
574
|
-
},
|
|
575
|
-
};
|