diff --git a/.prettierignore b/.prettierignore index dbc8e6a5..c3551435 100644 --- a/.prettierignore +++ b/.prettierignore @@ -9,6 +9,6 @@ build _site forks -src/mothership-app/migrations -src/mothership-app/pb_hooks/types/types.d.ts -src/instance-app/types/types.d.ts +packages/pockethost/src/mothership-app/migrations +packages/pockethost/src/mothership-app/pb_hooks/types/types.d.ts +packages/pockethost/src/instance-app/types/types.d.ts diff --git a/package.json b/package.json index 9a8a91a8..0056bbdb 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "pockethost", + "name": "pockethost-root", "version": "0.11.0", "author": { "name": "Ben Allfree", @@ -22,14 +22,14 @@ "build:docker": "cd pockethost-instance && docker build . -t benallfree/pockethost-instance:${npm_package_version} -t benallfree/pockethost-instance:latest", "build:frontend:lander": "cd packages/lander && pnpm build", "build:frontend:superadmin": "cd packages/superadmin && pnpm build", - "dev:cli": "NODE_ENV=development tsx src/cli/index.ts", + "dev:cli": "NODE_ENV=development cd packages/pockethost && pnpm dev", "dev:lander": "cd packages/lander && pnpm start", "dev:dashboard": "cd packages/dashboard && pnpm dev", "dev:superadmin": "cd packages/superadmin && pnpm dev", - "prod:cli": "tsx ./src/cli/index.ts", + "prod:cli": "tsx ./packages/pockethost/src/cli/index.ts", "plop": "plop --no-progress", "nofile": "cat /proc/sys/fs/file-nr", - "mail": "tsx ./src/cli/sendmail.ts", + "mail": "tsx ./packages/pockethost/src/cli/sendmail.ts", "prepare": "husky" }, "prettier": { @@ -44,57 +44,10 @@ ] }, "type": "module", - "dependencies": { + "devDependencies": { "@changesets/cli": "^2.27.5", - "@s-libs/micro-dash": "^16.1.0", "@types/node-os-utils": "^1.3.4", "@types/winston-syslog": "^2.4.3", - "ajv": "^8.12.0", - "boolean": "^3.2.0", - "bottleneck": "^2.19.5", - "chalk": "^5.3.0", - "commander": "^11.1.0", - "cors": "^2.8.5", - "decompress": "^4.2.1", - "decompress-unzip": "https://github.com/pockethost/decompress-unzip.git#6ef397b9a2df11d39c7b26ce779e123833844751", - "devcert": "^1.2.2", - "dockerode": "^3.3.5", - "dotenv": "^16.3.1", - "env-paths": "^3.0.0", - "event-source-polyfill": "^1.0.31", - "eventsource": "^2.0.2", - "exit-hook": "^4.0.0", - "express": "^4.18.2", - "express-async-errors": "^3.1.1", - "express-sslify": "^1.2.0", - "find-up": "^6.3.0", - "ftp-srv": "github:pockethost/ftp-srv#0fc708bae0d5d7a55ce948767f082d6fcfb2af59", - "get-port": "^6.1.2", - "glob": "^10.3.10", - "gobot": "1.0.0-alpha.40", - "gobot-pocketbase": "0.22.8-alpha.22", - "http-proxy": "^1.18.1", - "http-proxy-middleware": "^2.0.6", - "ip-cidr": "^3.1.0", - "json-stringify-safe": "^5.0.1", - "knex": "^2.5.1", - "memorystream": "^0.3.1", - "nanoid": "^5.0.2", - "node-fetch": "^3.3.2", - "node-os-utils": "^1.3.7", - "pocketbase": "^0.20.1", - "rimraf": "^5.0.5", - "semver": "^7.5.4", - "sqlite3": "^5.1.6", - "syslog-parse": "^2.0.0", - "tail": "^2.2.6", - "tmp": "^0.2.1", - "url-pattern": "^1.0.3", - "vhost": "^3.0.2", - "winston": "^3.11.0", - "winston-syslog": "^2.7.0" - }, - "devDependencies": { "@commitlint/cli": "^19.3.0", "@commitlint/config-conventional": "^19.2.2", "@swc/cli": "^0.1.62", diff --git a/packages/dashboard/package.json b/packages/dashboard/package.json index 1990b681..a4cd02d3 100644 --- a/packages/dashboard/package.json +++ b/packages/dashboard/package.json @@ -30,7 +30,6 @@ "daisyui": "^4.4.23", "date-fns": "^2.30.0", "highlight.js": "^11.8.0", - "pocketbase": "^0.19.0", "sass": "^1.68.0", "svelte": "^4.2.1", "svelte-chartjs": "3.1.2", diff --git a/packages/dashboard/src/app.html b/packages/dashboard/src/app.html index f7d6bb88..89040c73 100644 --- a/packages/dashboard/src/app.html +++ b/packages/dashboard/src/app.html @@ -1,6 +1,6 @@ - + PocketHost @@ -19,7 +19,7 @@ %sveltekit.head% - +
%sveltekit.body%
diff --git a/packages/dashboard/svelte.config.js b/packages/dashboard/svelte.config.js index d17eb5e7..df734f21 100644 --- a/packages/dashboard/svelte.config.js +++ b/packages/dashboard/svelte.config.js @@ -15,7 +15,7 @@ const config = { $components: './src/components', $util: './src/util', $src: './src', - $shared: '../../src/shared', + $shared: '../pockethost/src/shared', }, }, target: '#svelte', diff --git a/packages/dashboard/tsconfig.json b/packages/dashboard/tsconfig.json index 6c72a050..744a3d1f 100644 --- a/packages/dashboard/tsconfig.json +++ b/packages/dashboard/tsconfig.json @@ -11,7 +11,13 @@ "resolveJsonModule": true, "skipLibCheck": true, "sourceMap": true, - "strict": true + "strict": true, + "paths": { + "$util/*": ["./src/util/*"], + "$src/*": ["./src/*"], + "$shared": ["../pockethost/src/shared/"], + "$components/*": ["./src/components/*"] + } } // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias // diff --git a/packages/pockethost/package.json b/packages/pockethost/package.json new file mode 100644 index 00000000..0f9219e1 --- /dev/null +++ b/packages/pockethost/package.json @@ -0,0 +1,105 @@ +{ + "name": "pockethost", + "version": "0.11.0", + "author": { + "name": "Ben Allfree", + "url": "https://github.com/benallfree" + }, + "license": "MIT", + "main": "src/index.ts", + "bin": { + "pockethost": "src/cli/index.ts" + }, + "scripts": { + "dev": "NODE_ENV=development tsx ./src/cli/index.ts", + "start": "tsx ./src/cli/index.ts", + "mail": "tsx ./src/cli/sendmail.ts" + }, + "type": "module", + "dependencies": { + "@s-libs/micro-dash": "^16.1.0", + "@types/node-os-utils": "^1.3.4", + "@types/winston-syslog": "^2.4.3", + "ajv": "^8.12.0", + "boolean": "^3.2.0", + "bottleneck": "^2.19.5", + "chalk": "^5.3.0", + "commander": "^11.1.0", + "cors": "^2.8.5", + "decompress": "^4.2.1", + "decompress-unzip": "https://github.com/pockethost/decompress-unzip.git#6ef397b9a2df11d39c7b26ce779e123833844751", + "devcert": "^1.2.2", + "dockerode": "^3.3.5", + "dotenv": "^16.3.1", + "env-paths": "^3.0.0", + "event-source-polyfill": "^1.0.31", + "eventsource": "^2.0.2", + "exit-hook": "^4.0.0", + "express": "^4.18.2", + "express-async-errors": "^3.1.1", + "express-sslify": "^1.2.0", + "ftp-srv": "github:pockethost/ftp-srv#0fc708bae0d5d7a55ce948767f082d6fcfb2af59", + "get-port": "^6.1.2", + "glob": "^10.3.10", + "gobot": "1.0.0-alpha.40", + "gobot-pocketbase": "0.22.8-alpha.22", + "http-proxy": "^1.18.1", + "http-proxy-middleware": "^2.0.6", + "ip-cidr": "^3.1.0", + "json-stringify-safe": "^5.0.1", + "knex": "^2.5.1", + "memorystream": "^0.3.1", + "nanoid": "^5.0.2", + "node-fetch": "^3.3.2", + "node-os-utils": "^1.3.7", + "pocketbase": "^0.20.1", + "rimraf": "^5.0.5", + "semver": "^7.5.4", + "sqlite3": "^5.1.6", + "syslog-parse": "^2.0.0", + "tail": "^2.2.6", + "tmp": "^0.2.1", + "url-pattern": "^1.0.3", + "vhost": "^3.0.2", + "winston": "^3.11.0", + "winston-syslog": "^2.7.0" + }, + "devDependencies": { + "@types/cors": "^2.8.17", + "@types/d3-scale": "^4.0.6", + "@types/d3-scale-chromatic": "^3.0.1", + "@types/decompress": "^4.2.6", + "@types/dockerode": "^3.3.21", + "@types/eventsource": "^1.1.14", + "@types/express": "^4.17.21", + "@types/express-sslify": "^1.2.5", + "@types/http-proxy": "^1.17.13", + "@types/inquirer": "^9.0.7", + "@types/js-cookie": "^3.0.5", + "@types/js-yaml": "^4.0.9", + "@types/json-stringify-safe": "^5.0.2", + "@types/memorystream": "^0.3.3", + "@types/ncp": "^2.0.8", + "@types/node": "^20.8.10", + "@types/semver": "^7.5.4", + "@types/tail": "^2.2.2", + "@types/tmp": "^0.2.5", + "@types/unzipper": "^0.10.8", + "@types/vhost": "^3.0.9", + "chokidar-cli": "^3.0.0", + "concurrently": "^8.2.2", + "copyfiles": "^2.4.1", + "date-fns": "^2.30.0", + "dotenv-cli": "^7.3.0", + "express": "^4.18.2", + "http-proxy-middleware": "^2.0.6", + "inquirer": "^9.2.15", + "ip-cidr": "^3.1.0", + "js-yaml": "^4.1.0", + "ncp": "^2.0.0", + "nodemon": "^3.0.3", + "ora": "^7.0.1", + "postinstall-postinstall": "^2.1.0", + "type-fest": "^4.6.0" + } +} diff --git a/src/cli/commands/EdgeCommand/DaemonCommand/ServeCommand/daemon.ts b/packages/pockethost/src/cli/commands/EdgeCommand/DaemonCommand/ServeCommand/daemon.ts similarity index 100% rename from src/cli/commands/EdgeCommand/DaemonCommand/ServeCommand/daemon.ts rename to packages/pockethost/src/cli/commands/EdgeCommand/DaemonCommand/ServeCommand/daemon.ts diff --git a/src/cli/commands/EdgeCommand/DaemonCommand/ServeCommand/index.ts b/packages/pockethost/src/cli/commands/EdgeCommand/DaemonCommand/ServeCommand/index.ts similarity index 100% rename from src/cli/commands/EdgeCommand/DaemonCommand/ServeCommand/index.ts rename to packages/pockethost/src/cli/commands/EdgeCommand/DaemonCommand/ServeCommand/index.ts diff --git a/src/cli/commands/EdgeCommand/DaemonCommand/index.ts b/packages/pockethost/src/cli/commands/EdgeCommand/DaemonCommand/index.ts similarity index 100% rename from src/cli/commands/EdgeCommand/DaemonCommand/index.ts rename to packages/pockethost/src/cli/commands/EdgeCommand/DaemonCommand/index.ts diff --git a/src/cli/commands/EdgeCommand/FtpCommand/ServeCommand/ftp.ts b/packages/pockethost/src/cli/commands/EdgeCommand/FtpCommand/ServeCommand/ftp.ts similarity index 100% rename from src/cli/commands/EdgeCommand/FtpCommand/ServeCommand/ftp.ts rename to packages/pockethost/src/cli/commands/EdgeCommand/FtpCommand/ServeCommand/ftp.ts diff --git a/src/cli/commands/EdgeCommand/FtpCommand/ServeCommand/index.ts b/packages/pockethost/src/cli/commands/EdgeCommand/FtpCommand/ServeCommand/index.ts similarity index 100% rename from src/cli/commands/EdgeCommand/FtpCommand/ServeCommand/index.ts rename to packages/pockethost/src/cli/commands/EdgeCommand/FtpCommand/ServeCommand/index.ts diff --git a/src/cli/commands/EdgeCommand/FtpCommand/index.ts b/packages/pockethost/src/cli/commands/EdgeCommand/FtpCommand/index.ts similarity index 100% rename from src/cli/commands/EdgeCommand/FtpCommand/index.ts rename to packages/pockethost/src/cli/commands/EdgeCommand/FtpCommand/index.ts diff --git a/src/cli/commands/EdgeCommand/SyslogCommand/ServeCommand/index.ts b/packages/pockethost/src/cli/commands/EdgeCommand/SyslogCommand/ServeCommand/index.ts similarity index 100% rename from src/cli/commands/EdgeCommand/SyslogCommand/ServeCommand/index.ts rename to packages/pockethost/src/cli/commands/EdgeCommand/SyslogCommand/ServeCommand/index.ts diff --git a/src/cli/commands/EdgeCommand/SyslogCommand/ServeCommand/syslog.ts b/packages/pockethost/src/cli/commands/EdgeCommand/SyslogCommand/ServeCommand/syslog.ts similarity index 100% rename from src/cli/commands/EdgeCommand/SyslogCommand/ServeCommand/syslog.ts rename to packages/pockethost/src/cli/commands/EdgeCommand/SyslogCommand/ServeCommand/syslog.ts diff --git a/src/cli/commands/EdgeCommand/SyslogCommand/index.ts b/packages/pockethost/src/cli/commands/EdgeCommand/SyslogCommand/index.ts similarity index 100% rename from src/cli/commands/EdgeCommand/SyslogCommand/index.ts rename to packages/pockethost/src/cli/commands/EdgeCommand/SyslogCommand/index.ts diff --git a/src/cli/commands/EdgeCommand/index.ts b/packages/pockethost/src/cli/commands/EdgeCommand/index.ts similarity index 100% rename from src/cli/commands/EdgeCommand/index.ts rename to packages/pockethost/src/cli/commands/EdgeCommand/index.ts diff --git a/src/cli/commands/FirewallCommand/ServeCommand/firewall/cidr.ts b/packages/pockethost/src/cli/commands/FirewallCommand/ServeCommand/firewall/cidr.ts similarity index 100% rename from src/cli/commands/FirewallCommand/ServeCommand/firewall/cidr.ts rename to packages/pockethost/src/cli/commands/FirewallCommand/ServeCommand/firewall/cidr.ts diff --git a/src/cli/commands/FirewallCommand/ServeCommand/firewall/createVhostProxyMiddleware.ts b/packages/pockethost/src/cli/commands/FirewallCommand/ServeCommand/firewall/createVhostProxyMiddleware.ts similarity index 100% rename from src/cli/commands/FirewallCommand/ServeCommand/firewall/createVhostProxyMiddleware.ts rename to packages/pockethost/src/cli/commands/FirewallCommand/ServeCommand/firewall/createVhostProxyMiddleware.ts diff --git a/src/cli/commands/FirewallCommand/ServeCommand/firewall/server.ts b/packages/pockethost/src/cli/commands/FirewallCommand/ServeCommand/firewall/server.ts similarity index 98% rename from src/cli/commands/FirewallCommand/ServeCommand/firewall/server.ts rename to packages/pockethost/src/cli/commands/FirewallCommand/ServeCommand/firewall/server.ts index bc2dcf9c..069634a9 100644 --- a/src/cli/commands/FirewallCommand/ServeCommand/firewall/server.ts +++ b/packages/pockethost/src/cli/commands/FirewallCommand/ServeCommand/firewall/server.ts @@ -9,7 +9,7 @@ import { SSL_CERT, SSL_KEY, } from '$constants' -import { LoggerService } from '$src/shared' +import { LoggerService } from '$shared' import { discordAlert } from '$util' import { forEach } from '@s-libs/micro-dash' import cors from 'cors' diff --git a/src/cli/commands/FirewallCommand/ServeCommand/index.ts b/packages/pockethost/src/cli/commands/FirewallCommand/ServeCommand/index.ts similarity index 100% rename from src/cli/commands/FirewallCommand/ServeCommand/index.ts rename to packages/pockethost/src/cli/commands/FirewallCommand/ServeCommand/index.ts diff --git a/src/cli/commands/FirewallCommand/index.ts b/packages/pockethost/src/cli/commands/FirewallCommand/index.ts similarity index 100% rename from src/cli/commands/FirewallCommand/index.ts rename to packages/pockethost/src/cli/commands/FirewallCommand/index.ts diff --git a/src/cli/commands/HealthCommand/checkHealth.ts b/packages/pockethost/src/cli/commands/HealthCommand/checkHealth.ts similarity index 100% rename from src/cli/commands/HealthCommand/checkHealth.ts rename to packages/pockethost/src/cli/commands/HealthCommand/checkHealth.ts diff --git a/src/cli/commands/HealthCommand/index.ts b/packages/pockethost/src/cli/commands/HealthCommand/index.ts similarity index 100% rename from src/cli/commands/HealthCommand/index.ts rename to packages/pockethost/src/cli/commands/HealthCommand/index.ts diff --git a/src/cli/commands/MothershipCommand/ServeCommand/index.ts b/packages/pockethost/src/cli/commands/MothershipCommand/ServeCommand/index.ts similarity index 100% rename from src/cli/commands/MothershipCommand/ServeCommand/index.ts rename to packages/pockethost/src/cli/commands/MothershipCommand/ServeCommand/index.ts diff --git a/src/cli/commands/MothershipCommand/ServeCommand/mothership.ts b/packages/pockethost/src/cli/commands/MothershipCommand/ServeCommand/mothership.ts similarity index 100% rename from src/cli/commands/MothershipCommand/ServeCommand/mothership.ts rename to packages/pockethost/src/cli/commands/MothershipCommand/ServeCommand/mothership.ts diff --git a/src/cli/commands/MothershipCommand/UpdateCommand/index.ts b/packages/pockethost/src/cli/commands/MothershipCommand/UpdateCommand/index.ts similarity index 100% rename from src/cli/commands/MothershipCommand/UpdateCommand/index.ts rename to packages/pockethost/src/cli/commands/MothershipCommand/UpdateCommand/index.ts diff --git a/src/cli/commands/MothershipCommand/freshenPocketbaseVersions.ts b/packages/pockethost/src/cli/commands/MothershipCommand/freshenPocketbaseVersions.ts similarity index 100% rename from src/cli/commands/MothershipCommand/freshenPocketbaseVersions.ts rename to packages/pockethost/src/cli/commands/MothershipCommand/freshenPocketbaseVersions.ts diff --git a/src/cli/commands/MothershipCommand/index.ts b/packages/pockethost/src/cli/commands/MothershipCommand/index.ts similarity index 100% rename from src/cli/commands/MothershipCommand/index.ts rename to packages/pockethost/src/cli/commands/MothershipCommand/index.ts diff --git a/src/cli/commands/SendMailCommand/index.ts b/packages/pockethost/src/cli/commands/SendMailCommand/index.ts similarity index 100% rename from src/cli/commands/SendMailCommand/index.ts rename to packages/pockethost/src/cli/commands/SendMailCommand/index.ts diff --git a/src/cli/commands/SendMailCommand/sendmail.ts b/packages/pockethost/src/cli/commands/SendMailCommand/sendmail.ts similarity index 98% rename from src/cli/commands/SendMailCommand/sendmail.ts rename to packages/pockethost/src/cli/commands/SendMailCommand/sendmail.ts index 4c958873..e9e5c5e9 100644 --- a/src/cli/commands/SendMailCommand/sendmail.ts +++ b/packages/pockethost/src/cli/commands/SendMailCommand/sendmail.ts @@ -7,7 +7,7 @@ import { TEST_EMAIL, } from '$constants' import { SqliteService } from '$services' -import { LoggerService, UserFields } from '$src/shared' +import { LoggerService, UserFields } from '$shared' import { map } from '@s-libs/micro-dash' import Bottleneck from 'bottleneck' import { InvalidArgumentError, program } from 'commander' diff --git a/src/cli/commands/ServeCommand/index.ts b/packages/pockethost/src/cli/commands/ServeCommand/index.ts similarity index 100% rename from src/cli/commands/ServeCommand/index.ts rename to packages/pockethost/src/cli/commands/ServeCommand/index.ts diff --git a/src/cli/index.ts b/packages/pockethost/src/cli/index.ts similarity index 100% rename from src/cli/index.ts rename to packages/pockethost/src/cli/index.ts diff --git a/src/constants.ts b/packages/pockethost/src/constants.ts similarity index 95% rename from src/constants.ts rename to packages/pockethost/src/constants.ts index a7c8eed0..aed40eb4 100644 --- a/src/constants.ts +++ b/packages/pockethost/src/constants.ts @@ -2,28 +2,30 @@ import { InstanceFields, InstanceId, IoCManager, - mkSingleton, UserFields, + mkSingleton, } from '$shared' import { HandlerFactory, + SettingsService, mkBoolean, mkCsvString, mkNumber, mkPath, mkString, - SettingsService, -} from '$src/util/Settings' +} from '$util' import { forEach } from '@s-libs/micro-dash' import devcert from 'devcert' import dotenv from 'dotenv' import envPaths from 'env-paths' -import { findUpSync } from 'find-up' import { mkdirSync, realpathSync, writeFileSync } from 'fs' -import { dirname, join, resolve } from 'path' +import { dirname, join } from 'path' +import { fileURLToPath } from 'url' import { LogEntry } from 'winston' -dotenv.config({ path: `.env` }) +const __dirname = dirname(fileURLToPath(import.meta.url)) + +dotenv.config() const realScriptPath = realpathSync(process.argv[1]!) @@ -32,9 +34,7 @@ export const _PH_HOME = process.env.PH_HOME || envPaths(`pockethost`).data export const _SSL_HOME = join(_PH_HOME, `ssl`) export const _IS_DEV = process.env.NODE_ENV === 'development' -export const _PH_PROJECT_ROOT = dirname( - findUpSync('package.json', { cwd: dirname(realScriptPath) })!, -) +export const _PH_PROJECT_ROOT = join(__dirname, '..') export const _APEX_DOMAIN = process.env.APEX_DOMAIN || 'pockethost.lvh.me' export const _HTTP_PROTOCOL = process.env.HTTP_PROTOCOL || `https:` export const _APP_NAME = process.env.APP_NAME || 'app' @@ -43,15 +43,13 @@ export const _MOTHERSHIP_NAME = export const _MOTHERSHIP_APP_ROOT = (...paths: string[]) => join( - process.env.PH_MOTHERSHIP_APP_ROOT || - join(_PH_PROJECT_ROOT, `src`, 'mothership-app'), + process.env.PH_MOTHERSHIP_APP_ROOT || join(__dirname, 'mothership-app'), ...paths, ) export const _INSTANCE_APP_ROOT = (...paths: string[]) => join( - process.env.PH_INSTANCE_APP_ROOT || - join(_PH_PROJECT_ROOT, `src`, 'instance-app'), + process.env.PH_INSTANCE_APP_ROOT || join(__dirname, 'mothership-app'), ...paths, ) diff --git a/src/instance-app/migrations/1699198734_pockethost_defaults.js b/packages/pockethost/src/instance-app/migrations/1699198734_pockethost_defaults.js similarity index 100% rename from src/instance-app/migrations/1699198734_pockethost_defaults.js rename to packages/pockethost/src/instance-app/migrations/1699198734_pockethost_defaults.js diff --git a/src/instance-app/pb_hooks/_ph_admin_sync.pb.js b/packages/pockethost/src/instance-app/pb_hooks/_ph_admin_sync.pb.js similarity index 100% rename from src/instance-app/pb_hooks/_ph_admin_sync.pb.js rename to packages/pockethost/src/instance-app/pb_hooks/_ph_admin_sync.pb.js diff --git a/src/instance-app/pb_hooks/_ph_lib.js b/packages/pockethost/src/instance-app/pb_hooks/_ph_lib.js similarity index 100% rename from src/instance-app/pb_hooks/_ph_lib.js rename to packages/pockethost/src/instance-app/pb_hooks/_ph_lib.js diff --git a/src/instance-app/tsconfig.json b/packages/pockethost/src/instance-app/tsconfig.json similarity index 100% rename from src/instance-app/tsconfig.json rename to packages/pockethost/src/instance-app/tsconfig.json diff --git a/src/instance-app/types/goja.d.ts b/packages/pockethost/src/instance-app/types/goja.d.ts similarity index 100% rename from src/instance-app/types/goja.d.ts rename to packages/pockethost/src/instance-app/types/goja.d.ts diff --git a/src/instance-app/types/lib.d.ts b/packages/pockethost/src/instance-app/types/lib.d.ts similarity index 100% rename from src/instance-app/types/lib.d.ts rename to packages/pockethost/src/instance-app/types/lib.d.ts diff --git a/src/instance-app/types/types.d.ts b/packages/pockethost/src/instance-app/types/types.d.ts similarity index 100% rename from src/instance-app/types/types.d.ts rename to packages/pockethost/src/instance-app/types/types.d.ts diff --git a/src/mothership-app/migrations/1705062576_collections_snapshot.js b/packages/pockethost/src/mothership-app/migrations/1705062576_collections_snapshot.js similarity index 100% rename from src/mothership-app/migrations/1705062576_collections_snapshot.js rename to packages/pockethost/src/mothership-app/migrations/1705062576_collections_snapshot.js diff --git a/src/mothership-app/migrations/1705083826_updated_stats.js b/packages/pockethost/src/mothership-app/migrations/1705083826_updated_stats.js similarity index 100% rename from src/mothership-app/migrations/1705083826_updated_stats.js rename to packages/pockethost/src/mothership-app/migrations/1705083826_updated_stats.js diff --git a/src/mothership-app/migrations/1706060446_updated_instances.js b/packages/pockethost/src/mothership-app/migrations/1706060446_updated_instances.js similarity index 100% rename from src/mothership-app/migrations/1706060446_updated_instances.js rename to packages/pockethost/src/mothership-app/migrations/1706060446_updated_instances.js diff --git a/src/mothership-app/migrations/1716628803_updated_instances.js b/packages/pockethost/src/mothership-app/migrations/1716628803_updated_instances.js similarity index 100% rename from src/mothership-app/migrations/1716628803_updated_instances.js rename to packages/pockethost/src/mothership-app/migrations/1716628803_updated_instances.js diff --git a/src/mothership-app/pb_hooks/src/instances-create.pb.js b/packages/pockethost/src/mothership-app/pb_hooks/src/instances-create.pb.js similarity index 100% rename from src/mothership-app/pb_hooks/src/instances-create.pb.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/instances-create.pb.js diff --git a/src/mothership-app/pb_hooks/src/instances-delete.pb.js b/packages/pockethost/src/mothership-app/pb_hooks/src/instances-delete.pb.js similarity index 100% rename from src/mothership-app/pb_hooks/src/instances-delete.pb.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/instances-delete.pb.js diff --git a/src/mothership-app/pb_hooks/src/instances-migrate-versions.pb.js b/packages/pockethost/src/mothership-app/pb_hooks/src/instances-migrate-versions.pb.js similarity index 100% rename from src/mothership-app/pb_hooks/src/instances-migrate-versions.pb.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/instances-migrate-versions.pb.js diff --git a/src/mothership-app/pb_hooks/src/instances-notify-discord-after-create.pb.js b/packages/pockethost/src/mothership-app/pb_hooks/src/instances-notify-discord-after-create.pb.js similarity index 100% rename from src/mothership-app/pb_hooks/src/instances-notify-discord-after-create.pb.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/instances-notify-discord-after-create.pb.js diff --git a/src/mothership-app/pb_hooks/src/instances-notify-on-maintenance-mode.pb.js b/packages/pockethost/src/mothership-app/pb_hooks/src/instances-notify-on-maintenance-mode.pb.js similarity index 100% rename from src/mothership-app/pb_hooks/src/instances-notify-on-maintenance-mode.pb.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/instances-notify-on-maintenance-mode.pb.js diff --git a/src/mothership-app/pb_hooks/src/instances-reset-idle.pb.js b/packages/pockethost/src/mothership-app/pb_hooks/src/instances-reset-idle.pb.js similarity index 100% rename from src/mothership-app/pb_hooks/src/instances-reset-idle.pb.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/instances-reset-idle.pb.js diff --git a/src/mothership-app/pb_hooks/src/instances-update.pb.js b/packages/pockethost/src/mothership-app/pb_hooks/src/instances-update.pb.js similarity index 100% rename from src/mothership-app/pb_hooks/src/instances-update.pb.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/instances-update.pb.js diff --git a/src/mothership-app/pb_hooks/src/instances-validate-before-create.pb.js b/packages/pockethost/src/mothership-app/pb_hooks/src/instances-validate-before-create.pb.js similarity index 100% rename from src/mothership-app/pb_hooks/src/instances-validate-before-create.pb.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/instances-validate-before-create.pb.js diff --git a/src/mothership-app/pb_hooks/src/instances-validate-before-update.pb.js b/packages/pockethost/src/mothership-app/pb_hooks/src/instances-validate-before-update.pb.js similarity index 100% rename from src/mothership-app/pb_hooks/src/instances-validate-before-update.pb.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/instances-validate-before-update.pb.js diff --git a/src/mothership-app/pb_hooks/src/lib.js b/packages/pockethost/src/mothership-app/pb_hooks/src/lib.js similarity index 100% rename from src/mothership-app/pb_hooks/src/lib.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/lib.js diff --git a/src/mothership-app/pb_hooks/src/ls.pb.js b/packages/pockethost/src/mothership-app/pb_hooks/src/ls.pb.js similarity index 100% rename from src/mothership-app/pb_hooks/src/ls.pb.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/ls.pb.js diff --git a/src/mothership-app/pb_hooks/src/mail.pb.js b/packages/pockethost/src/mothership-app/pb_hooks/src/mail.pb.js similarity index 100% rename from src/mothership-app/pb_hooks/src/mail.pb.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/mail.pb.js diff --git a/src/mothership-app/pb_hooks/src/notifications.pb.js b/packages/pockethost/src/mothership-app/pb_hooks/src/notifications.pb.js similarity index 100% rename from src/mothership-app/pb_hooks/src/notifications.pb.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/notifications.pb.js diff --git a/src/mothership-app/pb_hooks/src/random-words.js b/packages/pockethost/src/mothership-app/pb_hooks/src/random-words.js similarity index 100% rename from src/mothership-app/pb_hooks/src/random-words.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/random-words.js diff --git a/src/mothership-app/pb_hooks/src/signup.pb.js b/packages/pockethost/src/mothership-app/pb_hooks/src/signup.pb.js similarity index 100% rename from src/mothership-app/pb_hooks/src/signup.pb.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/signup.pb.js diff --git a/src/mothership-app/pb_hooks/src/sns.pb.js b/packages/pockethost/src/mothership-app/pb_hooks/src/sns.pb.js similarity index 100% rename from src/mothership-app/pb_hooks/src/sns.pb.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/sns.pb.js diff --git a/src/mothership-app/pb_hooks/src/unsubscribe.pb.js b/packages/pockethost/src/mothership-app/pb_hooks/src/unsubscribe.pb.js similarity index 100% rename from src/mothership-app/pb_hooks/src/unsubscribe.pb.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/unsubscribe.pb.js diff --git a/src/mothership-app/pb_hooks/src/user-token.pb.js b/packages/pockethost/src/mothership-app/pb_hooks/src/user-token.pb.js similarity index 100% rename from src/mothership-app/pb_hooks/src/user-token.pb.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/user-token.pb.js diff --git a/src/mothership-app/pb_hooks/src/user-welcome-msg.pb.js b/packages/pockethost/src/mothership-app/pb_hooks/src/user-welcome-msg.pb.js similarity index 100% rename from src/mothership-app/pb_hooks/src/user-welcome-msg.pb.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/user-welcome-msg.pb.js diff --git a/src/mothership-app/pb_hooks/src/versions-route.pb.js b/packages/pockethost/src/mothership-app/pb_hooks/src/versions-route.pb.js similarity index 100% rename from src/mothership-app/pb_hooks/src/versions-route.pb.js rename to packages/pockethost/src/mothership-app/pb_hooks/src/versions-route.pb.js diff --git a/packages/pockethost/src/mothership-app/pb_hooks/src/versions.cjs b/packages/pockethost/src/mothership-app/pb_hooks/src/versions.cjs new file mode 100644 index 00000000..35e99e5e --- /dev/null +++ b/packages/pockethost/src/mothership-app/pb_hooks/src/versions.cjs @@ -0,0 +1,159 @@ +module.exports = [ + '0.22.*', + '0.22.12', + '0.22.11', + '0.22.10', + '0.22.9', + '0.22.8', + '0.22.7', + '0.22.6', + '0.22.5', + '0.22.4', + '0.22.3', + '0.22.2', + '0.22.1', + '0.22.0', + '0.21.*', + '0.21.3', + '0.21.2', + '0.21.1', + '0.21.0', + '0.20.*', + '0.20.7', + '0.20.6', + '0.20.5', + '0.20.4', + '0.20.3', + '0.20.2', + '0.20.1', + '0.20.0', + '0.20.0-rc3', + '0.20.0-rc2', + '0.20.0-rc', + '0.19.*', + '0.19.4', + '0.19.3', + '0.19.2', + '0.19.1', + '0.19.0', + '0.18.*', + '0.18.10', + '0.18.9', + '0.18.8', + '0.18.7', + '0.18.6', + '0.18.5', + '0.18.4', + '0.18.3', + '0.18.2', + '0.18.1', + '0.18.0', + '0.17.*', + '0.17.7', + '0.17.6', + '0.17.5', + '0.17.4', + '0.17.3', + '0.17.2', + '0.17.1', + '0.17.0', + '0.16.*', + '0.16.10', + '0.16.9', + '0.16.8', + '0.16.7', + '0.16.6', + '0.16.5', + '0.16.4', + '0.16.3', + '0.16.2', + '0.16.1', + '0.16.0', + '0.15.*', + '0.15.3', + '0.15.2', + '0.15.1', + '0.15.0', + '0.14.*', + '0.14.5', + '0.14.4', + '0.14.3', + '0.14.2', + '0.14.1', + '0.14.0', + '0.13.*', + '0.13.4', + '0.13.3', + '0.13.2', + '0.13.1', + '0.13.0', + '0.12.*', + '0.12.3', + '0.12.2', + '0.12.1', + '0.12.0', + '0.11.*', + '0.11.4', + '0.11.3', + '0.11.2', + '0.11.1', + '0.11.0', + '0.10.*', + '0.10.4', + '0.10.3', + '0.10.2', + '0.10.1', + '0.10.0', + '0.9.*', + '0.9.2', + '0.9.1', + '0.9.0', + '0.8.*', + '0.8.0', + '0.8.0-rc4', + '0.8.0-rc3', + '0.8.0-rc2', + '0.8.0-rc1', + '0.7.*', + '0.7.10', + '0.7.9', + '0.7.8', + '0.7.7', + '0.7.6', + '0.7.5', + '0.7.4', + '0.7.3', + '0.7.2', + '0.7.1', + '0.7.0', + '0.6.*', + '0.6.0', + '0.5.*', + '0.5.2', + '0.5.1', + '0.5.0', + '0.4.*', + '0.4.2', + '0.4.1', + '0.4.0', + '0.3.*', + '0.3.4', + '0.3.3', + '0.3.2', + '0.3.1', + '0.3.0', + '0.2.*', + '0.2.8', + '0.2.7', + '0.2.6', + '0.2.5', + '0.2.4', + '0.2.3', + '0.2.2', + '0.2.1', + '0.2.0', + '0.1.*', + '0.1.2', + '0.1.1', + '0.1.0', +] diff --git a/src/mothership-app/pb_hooks/types/global.d.ts b/packages/pockethost/src/mothership-app/pb_hooks/types/global.d.ts similarity index 100% rename from src/mothership-app/pb_hooks/types/global.d.ts rename to packages/pockethost/src/mothership-app/pb_hooks/types/global.d.ts diff --git a/src/mothership-app/pb_hooks/types/goja.d.ts b/packages/pockethost/src/mothership-app/pb_hooks/types/goja.d.ts similarity index 100% rename from src/mothership-app/pb_hooks/types/goja.d.ts rename to packages/pockethost/src/mothership-app/pb_hooks/types/goja.d.ts diff --git a/src/mothership-app/pb_hooks/types/lemon.d.ts b/packages/pockethost/src/mothership-app/pb_hooks/types/lemon.d.ts similarity index 100% rename from src/mothership-app/pb_hooks/types/lemon.d.ts rename to packages/pockethost/src/mothership-app/pb_hooks/types/lemon.d.ts diff --git a/src/mothership-app/pb_hooks/types/lib.d.ts b/packages/pockethost/src/mothership-app/pb_hooks/types/lib.d.ts similarity index 100% rename from src/mothership-app/pb_hooks/types/lib.d.ts rename to packages/pockethost/src/mothership-app/pb_hooks/types/lib.d.ts diff --git a/src/mothership-app/pb_hooks/types/types.d.ts b/packages/pockethost/src/mothership-app/pb_hooks/types/types.d.ts similarity index 100% rename from src/mothership-app/pb_hooks/types/types.d.ts rename to packages/pockethost/src/mothership-app/pb_hooks/types/types.d.ts diff --git a/src/mothership-app/ph_app/index.js b/packages/pockethost/src/mothership-app/ph_app/index.js similarity index 100% rename from src/mothership-app/ph_app/index.js rename to packages/pockethost/src/mothership-app/ph_app/index.js diff --git a/src/mothership-app/ph_app/package-lock.json b/packages/pockethost/src/mothership-app/ph_app/package-lock.json similarity index 100% rename from src/mothership-app/ph_app/package-lock.json rename to packages/pockethost/src/mothership-app/ph_app/package-lock.json diff --git a/src/mothership-app/ph_app/package.json b/packages/pockethost/src/mothership-app/ph_app/package.json similarity index 100% rename from src/mothership-app/ph_app/package.json rename to packages/pockethost/src/mothership-app/ph_app/package.json diff --git a/src/services/FtpService/PhFs.ts b/packages/pockethost/src/services/FtpService/PhFs.ts similarity index 100% rename from src/services/FtpService/PhFs.ts rename to packages/pockethost/src/services/FtpService/PhFs.ts diff --git a/src/services/FtpService/fs-async.ts b/packages/pockethost/src/services/FtpService/fs-async.ts similarity index 100% rename from src/services/FtpService/fs-async.ts rename to packages/pockethost/src/services/FtpService/fs-async.ts diff --git a/src/services/FtpService/index.ts b/packages/pockethost/src/services/FtpService/index.ts similarity index 100% rename from src/services/FtpService/index.ts rename to packages/pockethost/src/services/FtpService/index.ts diff --git a/src/services/InstanceLoggerService/index.ts b/packages/pockethost/src/services/InstanceLoggerService/index.ts similarity index 100% rename from src/services/InstanceLoggerService/index.ts rename to packages/pockethost/src/services/InstanceLoggerService/index.ts diff --git a/src/services/InstanceService/index.ts b/packages/pockethost/src/services/InstanceService/index.ts similarity index 100% rename from src/services/InstanceService/index.ts rename to packages/pockethost/src/services/InstanceService/index.ts index 46badd6b..e9f8779b 100644 --- a/src/services/InstanceService/index.ts +++ b/packages/pockethost/src/services/InstanceService/index.ts @@ -5,30 +5,30 @@ import { EDGE_APEX_DOMAIN, INSTANCE_APP_HOOK_DIR, INSTANCE_APP_MIGRATIONS_DIR, + UPGRADE_MODE, mkAppUrl, mkContainerHomePath, mkDocUrl, mkEdgeUrl, - UPGRADE_MODE, } from '$constants' import { InstanceLogger, MothershipAdminClientService, PocketbaseService, PortService, - proxyService, SpawnConfig, + proxyService, } from '$services' import { CLEANUP_PRIORITY_LAST, - createCleanupManager, - createTimerManager, InstanceFields, InstanceId, InstanceStatus, LoggerService, - mkSingleton, SingletonBaseConfig, + createCleanupManager, + createTimerManager, + mkSingleton, } from '$shared' import { asyncExitHook, mkInternalUrl, now } from '$util' import { flatten, map, values } from '@s-libs/micro-dash' diff --git a/src/services/InstanceService/mkInstanceCache.ts b/packages/pockethost/src/services/InstanceService/mkInstanceCache.ts similarity index 100% rename from src/services/InstanceService/mkInstanceCache.ts rename to packages/pockethost/src/services/InstanceService/mkInstanceCache.ts diff --git a/src/services/MothershipAdminClientService/InstanceMIxin.ts b/packages/pockethost/src/services/MothershipAdminClientService/InstanceMIxin.ts similarity index 100% rename from src/services/MothershipAdminClientService/InstanceMIxin.ts rename to packages/pockethost/src/services/MothershipAdminClientService/InstanceMIxin.ts diff --git a/src/services/MothershipAdminClientService/createAdminPbClient.ts b/packages/pockethost/src/services/MothershipAdminClientService/createAdminPbClient.ts similarity index 100% rename from src/services/MothershipAdminClientService/createAdminPbClient.ts rename to packages/pockethost/src/services/MothershipAdminClientService/createAdminPbClient.ts diff --git a/src/services/MothershipAdminClientService/index.ts b/packages/pockethost/src/services/MothershipAdminClientService/index.ts similarity index 100% rename from src/services/MothershipAdminClientService/index.ts rename to packages/pockethost/src/services/MothershipAdminClientService/index.ts diff --git a/src/services/PocketBaseService/index.ts b/packages/pockethost/src/services/PocketBaseService/index.ts similarity index 98% rename from src/services/PocketBaseService/index.ts rename to packages/pockethost/src/services/PocketBaseService/index.ts index 31e48110..2a44a0f3 100644 --- a/src/services/PocketBaseService/index.ts +++ b/packages/pockethost/src/services/PocketBaseService/index.ts @@ -1,18 +1,18 @@ import { APEX_DOMAIN, DOCKER_CONTAINER_HOST, + SYSLOGD_PORT, mkContainerHomePath, mkInstanceDataPath, - SYSLOGD_PORT, } from '$constants' import { PortService } from '$services' import { - createCleanupManager, LoggerService, - mkSingleton, SingletonBaseConfig, + createCleanupManager, + mkSingleton, } from '$shared' -import { asyncExitHook, mkInternalUrl, SyslogLogger, tryFetch } from '$util' +import { SyslogLogger, asyncExitHook, mkInternalUrl, tryFetch } from '$util' import { map } from '@s-libs/micro-dash' import Docker, { Container, ContainerCreateOptions } from 'dockerode' import { existsSync } from 'fs' @@ -104,7 +104,7 @@ export const createPocketbaseService = async ( if (!realVersion) { throw new Error(`No PocketBase version satisfying ${_version}`) } - const binPath = await bot.getBinaryPath(realVersion) + const binPath = await bot.getBinaryFilePath(realVersion) if (!existsSync(binPath)) { throw new Error( `PocketBase binary (${binPath}) not found. Contact pockethost.io.`, diff --git a/src/services/PortService.ts b/packages/pockethost/src/services/PortService.ts similarity index 100% rename from src/services/PortService.ts rename to packages/pockethost/src/services/PortService.ts diff --git a/src/services/ProxyService.ts b/packages/pockethost/src/services/ProxyService.ts similarity index 97% rename from src/services/ProxyService.ts rename to packages/pockethost/src/services/ProxyService.ts index 6dd1492e..1f2d5ddb 100644 --- a/src/services/ProxyService.ts +++ b/packages/pockethost/src/services/ProxyService.ts @@ -2,14 +2,14 @@ import { DAEMON_PORT } from '$constants' import { Logger, LoggerService, - mkSingleton, SingletonBaseConfig, + mkSingleton, } from '$shared' import { asyncExitHook } from '$util' import cors from 'cors' import express, { Request, Response } from 'express' import 'express-async-errors' -import { default as httpProxy, default as Server } from 'http-proxy' +import { default as Server, default as httpProxy } from 'http-proxy' import { AsyncReturnType } from 'type-fest' export type ProxyServiceApi = AsyncReturnType diff --git a/src/services/RealtimeLog.ts b/packages/pockethost/src/services/RealtimeLog.ts similarity index 100% rename from src/services/RealtimeLog.ts rename to packages/pockethost/src/services/RealtimeLog.ts diff --git a/src/services/SqliteService/index.ts b/packages/pockethost/src/services/SqliteService/index.ts similarity index 100% rename from src/services/SqliteService/index.ts rename to packages/pockethost/src/services/SqliteService/index.ts diff --git a/src/services/index.ts b/packages/pockethost/src/services/index.ts similarity index 100% rename from src/services/index.ts rename to packages/pockethost/src/services/index.ts diff --git a/src/shared/CleanupManager.ts b/packages/pockethost/src/shared/CleanupManager.ts similarity index 100% rename from src/shared/CleanupManager.ts rename to packages/pockethost/src/shared/CleanupManager.ts diff --git a/src/shared/Logger.ts b/packages/pockethost/src/shared/Logger.ts similarity index 100% rename from src/shared/Logger.ts rename to packages/pockethost/src/shared/Logger.ts diff --git a/src/shared/TimerManager.ts b/packages/pockethost/src/shared/TimerManager.ts similarity index 100% rename from src/shared/TimerManager.ts rename to packages/pockethost/src/shared/TimerManager.ts diff --git a/src/shared/assert.ts b/packages/pockethost/src/shared/assert.ts similarity index 100% rename from src/shared/assert.ts rename to packages/pockethost/src/shared/assert.ts diff --git a/src/shared/asyncExecutionGuard.ts b/packages/pockethost/src/shared/asyncExecutionGuard.ts similarity index 100% rename from src/shared/asyncExecutionGuard.ts rename to packages/pockethost/src/shared/asyncExecutionGuard.ts diff --git a/src/shared/events.ts b/packages/pockethost/src/shared/events.ts similarity index 100% rename from src/shared/events.ts rename to packages/pockethost/src/shared/events.ts diff --git a/src/shared/index.ts b/packages/pockethost/src/shared/index.ts similarity index 100% rename from src/shared/index.ts rename to packages/pockethost/src/shared/index.ts diff --git a/src/shared/ioc.ts b/packages/pockethost/src/shared/ioc.ts similarity index 100% rename from src/shared/ioc.ts rename to packages/pockethost/src/shared/ioc.ts diff --git a/src/shared/mkSingleton.ts b/packages/pockethost/src/shared/mkSingleton.ts similarity index 100% rename from src/shared/mkSingleton.ts rename to packages/pockethost/src/shared/mkSingleton.ts diff --git a/src/shared/newId.ts b/packages/pockethost/src/shared/newId.ts similarity index 100% rename from src/shared/newId.ts rename to packages/pockethost/src/shared/newId.ts diff --git a/src/shared/pocketbase-client-helpers/RestHelper.ts b/packages/pockethost/src/shared/pocketbase-client-helpers/RestHelper.ts similarity index 96% rename from src/shared/pocketbase-client-helpers/RestHelper.ts rename to packages/pockethost/src/shared/pocketbase-client-helpers/RestHelper.ts index ef993234..bcf4885b 100644 --- a/src/shared/pocketbase-client-helpers/RestHelper.ts +++ b/packages/pockethost/src/shared/pocketbase-client-helpers/RestHelper.ts @@ -1,12 +1,12 @@ import Ajv, { JSONSchemaType } from 'ajv' -import type pocketbaseEs from 'pocketbase' +import type PocketBase from 'pocketbase' import { ClientResponseError } from 'pocketbase' import type { JsonObject } from 'type-fest' import { LoggerService } from '../Logger' import { RestCommands, RestMethods } from '../schema' export type RestHelperConfig = { - client: pocketbaseEs + client: PocketBase } export type RestHelper = ReturnType diff --git a/src/shared/pocketbase-client-helpers/index.ts b/packages/pockethost/src/shared/pocketbase-client-helpers/index.ts similarity index 100% rename from src/shared/pocketbase-client-helpers/index.ts rename to packages/pockethost/src/shared/pocketbase-client-helpers/index.ts diff --git a/src/shared/schema/Instance.ts b/packages/pockethost/src/shared/schema/Instance.ts similarity index 100% rename from src/shared/schema/Instance.ts rename to packages/pockethost/src/shared/schema/Instance.ts diff --git a/src/shared/schema/InstanceLog.ts b/packages/pockethost/src/shared/schema/InstanceLog.ts similarity index 100% rename from src/shared/schema/InstanceLog.ts rename to packages/pockethost/src/shared/schema/InstanceLog.ts diff --git a/src/shared/schema/Rest/CreateInstance.ts b/packages/pockethost/src/shared/schema/Rest/CreateInstance.ts similarity index 100% rename from src/shared/schema/Rest/CreateInstance.ts rename to packages/pockethost/src/shared/schema/Rest/CreateInstance.ts diff --git a/src/shared/schema/Rest/DeleteInstance.ts b/packages/pockethost/src/shared/schema/Rest/DeleteInstance.ts similarity index 100% rename from src/shared/schema/Rest/DeleteInstance.ts rename to packages/pockethost/src/shared/schema/Rest/DeleteInstance.ts diff --git a/src/shared/schema/Rest/GetUserTokenInfo.ts b/packages/pockethost/src/shared/schema/Rest/GetUserTokenInfo.ts similarity index 100% rename from src/shared/schema/Rest/GetUserTokenInfo.ts rename to packages/pockethost/src/shared/schema/Rest/GetUserTokenInfo.ts diff --git a/src/shared/schema/Rest/UpdateInstance.ts b/packages/pockethost/src/shared/schema/Rest/UpdateInstance.ts similarity index 100% rename from src/shared/schema/Rest/UpdateInstance.ts rename to packages/pockethost/src/shared/schema/Rest/UpdateInstance.ts diff --git a/src/shared/schema/Rest/index.ts b/packages/pockethost/src/shared/schema/Rest/index.ts similarity index 100% rename from src/shared/schema/Rest/index.ts rename to packages/pockethost/src/shared/schema/Rest/index.ts diff --git a/src/shared/schema/User.ts b/packages/pockethost/src/shared/schema/User.ts similarity index 100% rename from src/shared/schema/User.ts rename to packages/pockethost/src/shared/schema/User.ts diff --git a/src/shared/schema/index.ts b/packages/pockethost/src/shared/schema/index.ts similarity index 100% rename from src/shared/schema/index.ts rename to packages/pockethost/src/shared/schema/index.ts diff --git a/src/shared/schema/types.ts b/packages/pockethost/src/shared/schema/types.ts similarity index 100% rename from src/shared/schema/types.ts rename to packages/pockethost/src/shared/schema/types.ts diff --git a/src/shared/schema/util.ts b/packages/pockethost/src/shared/schema/util.ts similarity index 100% rename from src/shared/schema/util.ts rename to packages/pockethost/src/shared/schema/util.ts diff --git a/src/util/PromiseAllocator.ts b/packages/pockethost/src/util/PromiseAllocator.ts similarity index 100% rename from src/util/PromiseAllocator.ts rename to packages/pockethost/src/util/PromiseAllocator.ts diff --git a/src/util/Settings.ts b/packages/pockethost/src/util/Settings.ts similarity index 100% rename from src/util/Settings.ts rename to packages/pockethost/src/util/Settings.ts diff --git a/src/util/SyslogLogger.ts b/packages/pockethost/src/util/SyslogLogger.ts similarity index 100% rename from src/util/SyslogLogger.ts rename to packages/pockethost/src/util/SyslogLogger.ts diff --git a/src/util/assert.ts b/packages/pockethost/src/util/assert.ts similarity index 100% rename from src/util/assert.ts rename to packages/pockethost/src/util/assert.ts diff --git a/src/util/discordAlert.ts b/packages/pockethost/src/util/discordAlert.ts similarity index 100% rename from src/util/discordAlert.ts rename to packages/pockethost/src/util/discordAlert.ts diff --git a/src/util/env.ts b/packages/pockethost/src/util/env.ts similarity index 100% rename from src/util/env.ts rename to packages/pockethost/src/util/env.ts diff --git a/src/util/exit.ts b/packages/pockethost/src/util/exit.ts similarity index 100% rename from src/util/exit.ts rename to packages/pockethost/src/util/exit.ts diff --git a/src/util/index.ts b/packages/pockethost/src/util/index.ts similarity index 100% rename from src/util/index.ts rename to packages/pockethost/src/util/index.ts diff --git a/src/util/internal.ts b/packages/pockethost/src/util/internal.ts similarity index 100% rename from src/util/internal.ts rename to packages/pockethost/src/util/internal.ts diff --git a/src/util/mergeConfig.ts b/packages/pockethost/src/util/mergeConfig.ts similarity index 100% rename from src/util/mergeConfig.ts rename to packages/pockethost/src/util/mergeConfig.ts diff --git a/src/util/now.ts b/packages/pockethost/src/util/now.ts similarity index 100% rename from src/util/now.ts rename to packages/pockethost/src/util/now.ts diff --git a/src/util/pexec.ts b/packages/pockethost/src/util/pexec.ts similarity index 100% rename from src/util/pexec.ts rename to packages/pockethost/src/util/pexec.ts diff --git a/src/util/process.ts b/packages/pockethost/src/util/process.ts similarity index 100% rename from src/util/process.ts rename to packages/pockethost/src/util/process.ts diff --git a/src/util/smartFetch.ts b/packages/pockethost/src/util/smartFetch.ts similarity index 100% rename from src/util/smartFetch.ts rename to packages/pockethost/src/util/smartFetch.ts diff --git a/src/util/tryFetch.ts b/packages/pockethost/src/util/tryFetch.ts similarity index 100% rename from src/util/tryFetch.ts rename to packages/pockethost/src/util/tryFetch.ts diff --git a/tsconfig.json b/packages/pockethost/tsconfig.json similarity index 64% rename from tsconfig.json rename to packages/pockethost/tsconfig.json index 0112cf93..bef44041 100644 --- a/tsconfig.json +++ b/packages/pockethost/tsconfig.json @@ -17,12 +17,13 @@ "noEmit": true, "baseUrl": ".", "paths": { - "$util": ["src/util"], - "$services": ["src/services"], - "$constants": ["src/constants"], - "$src/*": ["src/*"], - "$shared": ["src/shared"] + "$util": ["./src/util"], + "$services": ["./src/services"], + "$constants": ["./src/constants"], + "$src/*": ["./src/*"], + "$shared": ["./src/shared"] } }, - "include": ["**/*.ts", ], + "include": ["**/*.ts"], + "exclude": ["./src/mothership-app/**/*", "./src/instance-app/**/*"] } diff --git a/packages/superadmin/package.json b/packages/superadmin/package.json index e6f29995..f380d912 100644 --- a/packages/superadmin/package.json +++ b/packages/superadmin/package.json @@ -30,7 +30,6 @@ "daisyui": "^3.8.1", "date-fns": "^2.30.0", "highlight.js": "^11.8.0", - "pocketbase": "^0.19.0", "sass": "^1.68.0", "svelte": "^4.2.1", "svelte-chartjs": "3.1.2", diff --git a/packages/superadmin/src/routes/+page.svelte b/packages/superadmin/src/routes/+page.svelte index 2f9eb2be..f538f8ba 100644 --- a/packages/superadmin/src/routes/+page.svelte +++ b/packages/superadmin/src/routes/+page.svelte @@ -1,5 +1,5 @@