From 297a6e45eef2656330e17d4b2c179ee74f9f2275 Mon Sep 17 00:00:00 2001 From: Ben Allfree Date: Fri, 18 Jul 2025 17:27:20 -0700 Subject: [PATCH] linter fixes --- .prettierrc | 17 +- package.json | 2 +- .../dashboard/src/components/AlertBar.svelte | 6 +- .../src/components/CodeSample.svelte | 2 +- .../src/components/CopyButton.svelte | 4 +- .../src/components/FlounderCard.svelte | 5 +- .../src/components/PricingCard.svelte | 14 +- .../src/components/Testimonials.svelte | 3 +- .../src/components/VerifyAccountBar.svelte | 6 +- .../src/components/cards/Card.svelte | 4 +- .../src/components/cards/CardHeader.svelte | 10 +- .../src/components/guards/UserHasRole.svelte | 6 +- packages/dashboard/src/env.ts | 24 +- packages/dashboard/src/lemonsqueezy.d.ts | 11 +- .../src/pocketbase-client/PocketbaseClient.ts | 72 +- .../dashboard/src/pocketbase-client/index.ts | 5 +- .../dashboard/src/routes/(app)/+layout.svelte | 5 +- .../src/routes/(app)/account/+page.svelte | 8 +- .../src/routes/(app)/account/Card.svelte | 17 +- .../routes/(app)/account/FAQSection.svelte | 66 +- .../(app)/dashboard/InstanceList.svelte | 15 +- .../src/routes/(app)/dashboard/Main.svelte | 22 +- .../instances/[instanceId]/+layout.svelte | 73 +- .../instances/[instanceId]/Overview.svelte | 19 +- .../instances/[instanceId]/Toggle.svelte | 11 +- .../[instanceId]/admin-sync/+page.svelte | 3 +- .../[instanceId]/delete/+page.svelte | 18 +- .../instances/[instanceId]/dev/+page.svelte | 4 +- .../[instanceId]/domain/+page.svelte | 38 +- .../instances/[instanceId]/ftp/+page.svelte | 10 +- .../[instanceId]/logs/LoggingInner.svelte | 41 +- .../[instanceId]/rename/+page.svelte | 23 +- .../[instanceId]/secrets/+page.svelte | 2 +- .../[instanceId]/secrets/Form.svelte | 18 +- .../[instanceId]/secrets/List.svelte | 10 +- .../[instanceId]/secrets/SecretsInner.svelte | 9 +- .../instances/[instanceId]/secrets/stores.ts | 5 +- .../[instanceId]/version/+page.svelte | 32 +- .../[instanceId]/version/VersionPicker.svelte | 7 +- .../routes/(app)/instances/new/+page.svelte | 11 +- .../routes/(app)/instances/new/Creator.svelte | 36 +- .../src/routes/(app)/stats/+page.svelte | 6 +- .../src/routes/(static)/Splash/Splash.svelte | 23 +- .../src/routes/(static)/docs/+layout.svelte | 5 +- .../(static)/get-started/LoginForm.svelte | 16 +- .../NewInstanceProcessingBlock.svelte | 7 +- .../(static)/get-started/RegisterForm.svelte | 46 +- .../login/password-reset/+page.svelte | 6 +- .../confirm/[token]/+page.svelte | 14 +- .../routes/(static)/pricing/CTAButton.svelte | 11 +- .../src/routes/(static)/pricing/Card.svelte | 13 +- .../(static)/pricing/FeatureName.svelte | 9 +- .../routes/(static)/pricing/Paywall.svelte | 10 +- .../routes/(static)/pricing/SignupBox.svelte | 8 +- .../src/routes/(static)/pricing/features.ts | 15 +- .../src/routes/(static)/support/+page.svelte | 7 +- packages/dashboard/src/routes/+layout.svelte | 11 +- .../src/routes/MothershipStatus.svelte | 3 +- .../dashboard/src/routes/Navbar/Avatar.svelte | 4 +- .../dashboard/src/routes/Navbar/Logo.svelte | 10 +- .../dashboard/src/routes/Navbar/Navbar.svelte | 50 +- .../src/routes/Navbar/NavbarMenu.svelte | 11 +- .../dashboard/src/routes/PromoBanner.svelte | 3 +- packages/dashboard/src/util/database.ts | 7 +- packages/dashboard/src/util/stores.ts | 15 +- .../DaemonCommand/ServeCommand/daemon.ts | 7 +- .../DaemonCommand/ServeCommand/index.ts | 10 +- .../EdgeCommand/FtpCommand/FtpService/PhFs.ts | 96 +- .../FtpCommand/FtpService/guards.ts | 8 +- .../FtpCommand/FtpService/index.ts | 47 +- .../FtpCommand/ServeCommand/index.ts | 10 +- .../VolumeCommand/MigrateCommand.ts | 21 +- .../EdgeCommand/VolumeCommand/MountCommand.ts | 6 +- .../ServeCommand/firewall/cidr.ts | 6 +- .../firewall/createVhostProxyMiddleware.ts | 6 +- .../FirewallCommand/ServeCommand/index.ts | 10 +- .../cli/commands/HealthCommand/checkHealth.ts | 31 +- .../src/cli/commands/HealthCommand/compact.ts | 6 +- .../src/cli/commands/HealthCommand/index.ts | 8 +- .../UpdateVersionsCommand/index.ts | 24 +- .../PocketBaseCommand/UpdateCommand/index.ts | 14 +- .../src/cli/commands/SendMailCommand/index.ts | 4 +- .../cli/commands/SendMailCommand/sendmail.ts | 18 +- .../src/cli/commands/ServeCommand/index.ts | 16 +- packages/pockethost/src/cli/ioc.ts | 7 +- .../pockethost/src/common/CleanupManager.ts | 4 +- .../pockethost/src/common/ConsoleLogger.ts | 4 +- .../src/common/ResourceAllocator.ts | 5 +- .../pockethost/src/common/TimerManager.ts | 6 +- packages/pockethost/src/common/assert.ts | 15 +- packages/pockethost/src/common/events.ts | 19 +- packages/pockethost/src/common/ioc.ts | 2 +- packages/pockethost/src/common/mergeConfig.ts | 8 +- packages/pockethost/src/common/mkSingleton.ts | 7 +- .../pocketbase-client-helpers/RestHelper.ts | 6 +- packages/pockethost/src/common/pocketbase.ts | 15 +- .../src/common/schema/Rest/CreateInstance.ts | 17 +- .../src/common/schema/Rest/DeleteInstance.ts | 17 +- .../src/common/schema/Rest/UpdateInstance.ts | 72 +- .../pockethost/src/common/schema/index.ts | 2 +- packages/pockethost/src/constants.ts | 135 +- packages/pockethost/src/core/Settings.ts | 13 +- .../src/core/asyncExecutionGuard.ts | 12 +- packages/pockethost/src/core/dir.ts | 22 +- packages/pockethost/src/core/discordAlert.ts | 5 +- packages/pockethost/src/core/env.ts | 6 +- packages/pockethost/src/core/internal.ts | 3 +- packages/pockethost/src/core/ioc.ts | 6 +- packages/pockethost/src/core/smartFetch.ts | 5 +- packages/pockethost/src/core/tryFetch.ts | 14 +- packages/pockethost/src/core/winston.ts | 16 +- .../v22/pb_hooks/_ph_admin_sync.pb.js | 2 +- .../src/instance-app/v22/pb_hooks/_ph_lib.js | 2 +- .../1699198734_pockethost_defaults.js | 2 +- .../src/instance-app/v22/types/goja.d.ts | 15 +- .../src/instance-app/v22/types/types.d.ts | 11314 ++--- .../v23/pb_hooks/_ph_admin_sync.pb.js | 2 +- .../src/instance-app/v23/pb_hooks/_ph_lib.js | 2 +- .../1699198734_pockethost_defaults.js | 2 +- .../src/mothership-app/pb_hooks/versions.cjs | 58 +- .../1705062576_collections_snapshot.js | 17 +- .../1725942258_create_pocodex.js | 70 +- .../1728773613_updated_legacy_users.js | 224 +- .../1728773613_updated_subscribed_users.js | 352 +- .../1728773613_updated_unverified_users.js | 352 +- .../pb_migrations/1728773613_updated_users.js | 92 +- .../1728773613_updated_verified_users.js | 480 +- .../pb_migrations/1728773684_updated_users.js | 59 +- .../pb_migrations/1728773742_updated_users.js | 89 +- .../pb_migrations/1728837919_updated_audit.js | 53 +- .../pb_migrations/1728891041_updated_stats.js | 1591 +- .../pb_migrations/1728891059_updated_stats.js | 1595 +- .../1728891330_updated_verified_users.js | 565 +- .../pb_migrations/1728891504_updated_stats.js | 1639 +- .../pb_migrations/1729106486_updated_users.js | 27 +- .../1729154752_updated_verified_users.js | 607 +- .../1729154760_updated_subscribed_users.js | 389 +- .../1729221954_updated_sent_messages.js | 27 +- .../1729222289_deleted_legacy_users.js | 132 +- .../1729222341_deleted_unpaid_instances.js | 142 +- .../1729222351_deleted_settings.js | 105 +- .../1729222416_updated_notifications.js | 221 +- .../1729222448_updated_sent_messages.js | 57 +- .../1729223398_updated_verified_users.js | 557 +- .../1729223450_updated_subscribed_users.js | 367 +- .../pb_migrations/1729224232_updated_stats.js | 1679 +- .../1729224263_updated_unverified_users.js | 262 +- .../1729224277_updated_verified_users.js | 607 +- .../pb_migrations/1729224292_updated_users.js | 77 +- .../1729224413_updated_instances.js | 93 +- .../1729224451_updated_sent_messages.js | 93 +- .../1729224467_updated_notifications.js | 93 +- .../1729224491_updated_payments.js | 93 +- .../pb_migrations/1729224515_updated_audit.js | 93 +- .../pb_migrations/1729224569_updated_audit.js | 221 +- .../pb_migrations/1729224595_updated_audit.js | 57 +- .../1730944175_updated_campaign_messages.js | 85 +- .../1731248081_updated_subscribed_users.js | 317 +- .../pb_migrations/1731248081_updated_users.js | 93 +- .../1731248081_updated_verified_users.js | 501 +- .../1732403125_updated_instances.js | 94 +- .../1732422451_updated_instances.js | 57 +- .../1733328169_updated_instances.js | 49 +- .../1733329330_updated_instances.js | 105 +- .../1733329331_updated_instances.js | 2 +- .../1733329332_updated_instances.js | 2 +- .../pb_migrations/1733467643_updated_users.js | 57 +- .../pb_migrations/1733487897_updated_users.js | 63 +- .../1736451099_updated_subscribed_users.js | 318 +- .../pb_migrations/1736451099_updated_users.js | 94 +- .../1736451099_updated_verified_users.js | 566 +- .../pb_migrations/1736478456_updated_users.js | 57 +- .../1752815917_created_domains.js | 2 +- .../instance/api/HandleInstanceCreate.ts | 4 +- .../instance/api/HandleInstanceDelete.ts | 2 +- .../instance/api/HandleInstanceResolve.ts | 25 +- .../instance/api/HandleInstanceUpdate.ts | 2 +- .../bootstrap/HandleMigrateCnamesToDomains.ts | 10 +- .../bootstrap/HandleMigrateRegions.ts | 5 +- .../src/lib/handlers/instance/hooks.ts | 8 +- .../model/HandleInstanceBeforeUpdate.ts | 11 +- .../model/HandleInstanceVersionValidation.ts | 6 +- .../lemon/api/HandleLemonSqueezySale.ts | 22 +- .../lib/handlers/mail/api/HandleMailSend.ts | 4 +- .../src/lib/handlers/mail/hooks.ts | 2 +- .../handlers/mirror/api/HandleMirrorData.ts | 5 +- .../src/lib/handlers/mirror/hooks.ts | 2 +- .../api/HandleProcessSingleNotification.ts | 12 +- .../outpost/api/HandleOutpostUnsubscribe.ts | 2 +- .../handlers/signup/api/HandleSignupCheck.ts | 8 +- .../signup/api/HandleSignupConfirm.ts | 22 +- .../src/lib/handlers/signup/error.ts | 7 +- .../src/lib/handlers/signup/isAvailable.ts | 4 +- .../lib/handlers/signup/random-words/index.ts | 16 +- .../lib/handlers/sns/api/HandleSesError.ts | 22 +- .../src/lib/handlers/user/hooks.ts | 2 +- .../src/mothership-app/src/lib/util/Logger.ts | 2 +- .../mothership-app/src/lib/util/mkAudit.ts | 10 +- .../src/lib/util/mkNotificationProcessor.ts | 14 +- .../mothership-app/src/lib/util/mkNotifier.ts | 23 +- .../src/lib/util/removeEmptyKeys.ts | 6 +- .../src/mothership-app/src/types/goja.d.ts | 15 +- .../src/mothership-app/src/types/types.d.ts | 34196 +++++++--------- .../services/InstanceLoggerService/index.ts | 40 +- .../src/services/InstanceService/index.ts | 623 +- .../InstanceService/mkInstanceCache.ts | 2 +- .../InstanceMIxin.ts | 59 +- .../createAdminPbClient.ts | 17 +- .../MothershipAdminClientService/index.ts | 58 +- .../src/services/PocketBaseService/index.ts | 58 +- .../pockethost/src/services/ProxyService.ts | 33 +- .../pockethost/src/services/RealtimeLog.ts | 19 +- pnpm-lock.yaml | 40 +- 213 files changed, 28142 insertions(+), 36109 deletions(-) diff --git a/.prettierrc b/.prettierrc index 80f0cc28..88b48c84 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,11 +1,14 @@ { - "semi": false, - "useTabs": false, "singleQuote": true, - "trailingComma": "all", + "trailingComma": "es5", + "semi": false, + "printWidth": 120, + "tabWidth": 2, + "useTabs": false, "plugins": [ - "./node_modules/prettier-plugin-organize-imports/index.js", - "./node_modules/prettier-plugin-svelte/plugin.js", - "./node_modules/prettier-plugin-jsdoc/dist/index.js" - ] + "prettier-plugin-organize-imports", + "prettier-plugin-svelte", + "prettier-plugin-jsdoc" + ], + "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] } diff --git a/package.json b/package.json index 742c2f3c..c6553c2b 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "prettier": "^3.4.2", "prettier-plugin-jsdoc": "^1.3.2", "prettier-plugin-organize-imports": "^4.1.0", - "prettier-plugin-svelte": "^3.3.2", + "prettier-plugin-svelte": "^3.4.0", "tslib": "^2.8.1", "tsx": "^4.19.2", "typescript": "^5.7.3" diff --git a/packages/dashboard/src/components/AlertBar.svelte b/packages/dashboard/src/components/AlertBar.svelte index 5862c21c..347ec693 100644 --- a/packages/dashboard/src/components/AlertBar.svelte +++ b/packages/dashboard/src/components/AlertBar.svelte @@ -58,11 +58,7 @@ {#if message && !isHidden} - {:else} - + {/if} {#if formError} diff --git a/packages/dashboard/src/components/cards/Card.svelte b/packages/dashboard/src/components/cards/Card.svelte index e48c31c5..8603620e 100644 --- a/packages/dashboard/src/components/cards/Card.svelte +++ b/packages/dashboard/src/components/cards/Card.svelte @@ -6,9 +6,7 @@
diff --git a/packages/dashboard/src/components/cards/CardHeader.svelte b/packages/dashboard/src/components/cards/CardHeader.svelte index 07ea320b..113032dc 100644 --- a/packages/dashboard/src/components/cards/CardHeader.svelte +++ b/packages/dashboard/src/components/cards/CardHeader.svelte @@ -9,14 +9,8 @@

- Full documentation Full documentation
{/if} diff --git a/packages/dashboard/src/components/guards/UserHasRole.svelte b/packages/dashboard/src/components/guards/UserHasRole.svelte index 7d6f8fa2..447ec6d1 100644 --- a/packages/dashboard/src/components/guards/UserHasRole.svelte +++ b/packages/dashboard/src/components/guards/UserHasRole.svelte @@ -1,9 +1,5 @@ -
-

- Frequently asked questions -

+
+

Frequently asked questions

- Legacy accounts have access to existing projects and features, but - cannot create new projects or use new features. + Legacy accounts have access to existing projects and features, but cannot create new projects or use new + features.

- If you upgrade to a paid plan and then downgrade again, you will still - have access to your Legacy projects and features, but any new projects - and features created on a paid plan will no longer work. + If you upgrade to a paid plan and then downgrade again, you will still have access to your Legacy projects and + features, but any new projects and features created on a paid plan will no longer work.

- PocketHost is committed to giving back to the open source community that - helps create PocketHost and PocketBase. + PocketHost is committed to giving back to the open source community that helps create PocketHost and PocketBase.

- 10% of net proceeds (after expenses) are donated back to the community. - Specifically, PocketHost makes donations to the PocketBase project and - major contributors to the PocketHost project. -

-

- In addition, 1% of membership fees is collected by Stripe to reduce - carbon footprints around the world. + 10% of net proceeds (after expenses) are donated back to the community. Specifically, PocketHost makes donations + to the PocketBase project and major contributors to the PocketHost project.

+

In addition, 1% of membership fees is collected by Stripe to reduce carbon footprints around the world.

- When we say 'unlimited', we mean it in the Fair Use sense of the word. - Obviously, everything has limits. In our study of PocketHost usage - patterns, we found that even the busiest and most successful PocketHost - instances rarely stress our system. + When we say 'unlimited', we mean it in the Fair Use sense of the word. Obviously, everything has limits. In our + study of PocketHost usage patterns, we found that even the busiest and most successful PocketHost instances + rarely stress our system.

- PocketHost is a haven for developers who want to launch and iterate - quickly on ideas without worrying about metering and infrastructure. + PocketHost is a haven for developers who want to launch and iterate quickly on ideas without worrying about + metering and infrastructure.

- If your app gets big and it starts affecting the system, we'll talk - about an enterprise plan or a dedicated setup. + If your app gets big and it starts affecting the system, we'll talk about an enterprise plan or a dedicated + setup.

- Please enjoy PocketHost knowing that you can use as much storage, - bandwidth, and CPU as your application requires under normal operating - conditions. Let us handle the hosting so you can get back to work. + Please enjoy PocketHost knowing that you can use as much storage, bandwidth, and CPU as your application + requires under normal operating conditions. Let us handle the hosting so you can get back to work.

+

Short version: We only want your money if you are happy.

- Short version: We only want your money if you are happy. -

-

- Long version: If you need to cancel your membership for any reason, - please contact .noaxis on Discord. If you cancel within the first 5 days of a signup or renewal, we'll - refund the full amount. Otherwise, we'll pro-rate it. Sound good? + >. If you cancel within the first 5 days of a signup or renewal, we'll refund the full amount. Otherwise, we'll + pro-rate it. Sound good?

- If you create additional instances and then downgrade to the free plan, - the extra instances will remain accessible in your dashboard, but they - will not run. + If you create additional instances and then downgrade to the free plan, the extra instances will remain + accessible in your dashboard, but they will not run.

diff --git a/packages/dashboard/src/routes/(app)/dashboard/InstanceList.svelte b/packages/dashboard/src/routes/(app)/dashboard/InstanceList.svelte index 0b336b9e..f8e9889e 100644 --- a/packages/dashboard/src/routes/(app)/dashboard/InstanceList.svelte +++ b/packages/dashboard/src/routes/(app)/dashboard/InstanceList.svelte @@ -23,7 +23,7 @@ } -{#each values($globalInstancesStore).sort( (a, b) => a.subdomain.localeCompare(b.subdomain), ) as instance, index} +{#each values($globalInstancesStore).sort((a, b) => a.subdomain.localeCompare(b.subdomain)) as instance, index}
diff --git a/packages/dashboard/src/routes/(app)/dashboard/Main.svelte b/packages/dashboard/src/routes/(app)/dashboard/Main.svelte index 654e0eb9..3a09cbc6 100644 --- a/packages/dashboard/src/routes/(app)/dashboard/Main.svelte +++ b/packages/dashboard/src/routes/(app)/dashboard/Main.svelte @@ -1,9 +1,5 @@ - {isReady ? $instance.subdomain : 'Instance'} overview - PocketHost + {isReady ? $instance.subdomain : 'Instance'} overview - PocketHost {#if isReady} -
+
-

+

{$instance.subdomain}

@@ -77,19 +68,13 @@
- +
{#if !$instance.power}
- +
{/if} @@ -101,29 +86,17 @@ Overview
  • - Secrets + Secrets
  • Logs
  • - FTP Access + FTP Access
  • - - PocketBase Logo + + PocketBase Logo Admin @@ -136,36 +109,22 @@
  • diff --git a/packages/dashboard/src/routes/(app)/instances/[instanceId]/Overview.svelte b/packages/dashboard/src/routes/(app)/instances/[instanceId]/Overview.svelte index aece9cc5..7d1bdf43 100644 --- a/packages/dashboard/src/routes/(app)/instances/[instanceId]/Overview.svelte +++ b/packages/dashboard/src/routes/(app)/instances/[instanceId]/Overview.svelte @@ -38,9 +38,10 @@
    Notice: You are in Custom Domain mode
    {:else}
    - Notice: You are in Custom Domain mode but it is not active and will not - work. Go find .noaxis on Discord.noaxis on Discord to get set up.
    {/if} @@ -57,18 +58,10 @@

    Additional Resources:

    diff --git a/packages/dashboard/src/routes/(app)/instances/[instanceId]/Toggle.svelte b/packages/dashboard/src/routes/(app)/instances/[instanceId]/Toggle.svelte index 0d408a1f..df41e401 100644 --- a/packages/dashboard/src/routes/(app)/instances/[instanceId]/Toggle.svelte +++ b/packages/dashboard/src/routes/(app)/instances/[instanceId]/Toggle.svelte @@ -16,17 +16,12 @@