From c891351e69853804f7e7fb60727216ebfd5ef193 Mon Sep 17 00:00:00 2001 From: Harvmaster Date: Mon, 27 Jul 2026 10:22:01 +0000 Subject: [PATCH] Rename src to source --- {src => source}/app.ts | 0 {src => source}/constants.ts | 0 {src => source}/errors/application-error.ts | 0 {src => source}/errors/index.ts | 0 {src => source}/errors/unauthorized-error.ts | 0 {src => source}/errors/utils.ts | 0 source/index.ts | 0 {src => source}/routes/resources.ts | 0 {src => source}/routes/types.ts | 0 {src => source}/services/broadcaster.ts | 0 {src => source}/services/config.ts | 0 {src => source}/services/route-stream.ts | 0 {src => source}/services/router.ts | 0 {src => source}/services/server-host.ts | 0 {src => source}/services/storage/database.ts | 0 {src => source}/services/storage/index.ts | 0 {src => source}/services/storage/migrate.ts | 0 .../services/storage/migrations/001-resources.ts | 0 {src => source}/services/storage/tables.ts | 0 {src => source}/services/stream/base-stream.ts | 0 .../services/stream/hono-sse-stream.ts | 0 .../services/stream/http-request-stream.ts | 0 {src => source}/services/stream/ws-stream.ts | 0 .../services/transport/http-transport.ts | 0 .../services/transport/transport-router.ts | 0 .../services/transport/ws-transport.ts | 0 {src => source}/utils/logger.ts | 0 {tests => test}/helpers/test-connection.ts | 2 +- {tests => test}/routes/resources.test.ts | 12 ++++++------ {tests => test}/services/broadcaster.test.ts | 8 ++++---- {tests => test}/services/config.test.ts | 2 +- {tests => test}/services/router.test.ts | 6 +++--- {tests => test}/services/stream/stream.test.ts | 6 +++--- .../services/transports/http-transport.test.ts | 16 ++++++++-------- .../services/transports/ws-transport.test.ts | 6 +++--- {tests => test}/subscription-flow.test.ts | 8 ++++---- {tests => test}/utils/logger.test.ts | 2 +- tsconfig.json | 2 +- 38 files changed, 35 insertions(+), 35 deletions(-) rename {src => source}/app.ts (100%) rename {src => source}/constants.ts (100%) rename {src => source}/errors/application-error.ts (100%) rename {src => source}/errors/index.ts (100%) rename {src => source}/errors/unauthorized-error.ts (100%) rename {src => source}/errors/utils.ts (100%) delete mode 100644 source/index.ts rename {src => source}/routes/resources.ts (100%) rename {src => source}/routes/types.ts (100%) rename {src => source}/services/broadcaster.ts (100%) rename {src => source}/services/config.ts (100%) rename {src => source}/services/route-stream.ts (100%) rename {src => source}/services/router.ts (100%) rename {src => source}/services/server-host.ts (100%) rename {src => source}/services/storage/database.ts (100%) rename {src => source}/services/storage/index.ts (100%) rename {src => source}/services/storage/migrate.ts (100%) rename {src => source}/services/storage/migrations/001-resources.ts (100%) rename {src => source}/services/storage/tables.ts (100%) rename {src => source}/services/stream/base-stream.ts (100%) rename {src => source}/services/stream/hono-sse-stream.ts (100%) rename {src => source}/services/stream/http-request-stream.ts (100%) rename {src => source}/services/stream/ws-stream.ts (100%) rename {src => source}/services/transport/http-transport.ts (100%) rename {src => source}/services/transport/transport-router.ts (100%) rename {src => source}/services/transport/ws-transport.ts (100%) rename {src => source}/utils/logger.ts (100%) rename {tests => test}/helpers/test-connection.ts (94%) rename {tests => test}/routes/resources.test.ts (90%) rename {tests => test}/services/broadcaster.test.ts (96%) rename {tests => test}/services/config.test.ts (98%) rename {tests => test}/services/router.test.ts (94%) rename {tests => test}/services/stream/stream.test.ts (85%) rename {tests => test}/services/transports/http-transport.test.ts (92%) rename {tests => test}/services/transports/ws-transport.test.ts (89%) rename {tests => test}/subscription-flow.test.ts (88%) rename {tests => test}/utils/logger.test.ts (96%) diff --git a/src/app.ts b/source/app.ts similarity index 100% rename from src/app.ts rename to source/app.ts diff --git a/src/constants.ts b/source/constants.ts similarity index 100% rename from src/constants.ts rename to source/constants.ts diff --git a/src/errors/application-error.ts b/source/errors/application-error.ts similarity index 100% rename from src/errors/application-error.ts rename to source/errors/application-error.ts diff --git a/src/errors/index.ts b/source/errors/index.ts similarity index 100% rename from src/errors/index.ts rename to source/errors/index.ts diff --git a/src/errors/unauthorized-error.ts b/source/errors/unauthorized-error.ts similarity index 100% rename from src/errors/unauthorized-error.ts rename to source/errors/unauthorized-error.ts diff --git a/src/errors/utils.ts b/source/errors/utils.ts similarity index 100% rename from src/errors/utils.ts rename to source/errors/utils.ts diff --git a/source/index.ts b/source/index.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/routes/resources.ts b/source/routes/resources.ts similarity index 100% rename from src/routes/resources.ts rename to source/routes/resources.ts diff --git a/src/routes/types.ts b/source/routes/types.ts similarity index 100% rename from src/routes/types.ts rename to source/routes/types.ts diff --git a/src/services/broadcaster.ts b/source/services/broadcaster.ts similarity index 100% rename from src/services/broadcaster.ts rename to source/services/broadcaster.ts diff --git a/src/services/config.ts b/source/services/config.ts similarity index 100% rename from src/services/config.ts rename to source/services/config.ts diff --git a/src/services/route-stream.ts b/source/services/route-stream.ts similarity index 100% rename from src/services/route-stream.ts rename to source/services/route-stream.ts diff --git a/src/services/router.ts b/source/services/router.ts similarity index 100% rename from src/services/router.ts rename to source/services/router.ts diff --git a/src/services/server-host.ts b/source/services/server-host.ts similarity index 100% rename from src/services/server-host.ts rename to source/services/server-host.ts diff --git a/src/services/storage/database.ts b/source/services/storage/database.ts similarity index 100% rename from src/services/storage/database.ts rename to source/services/storage/database.ts diff --git a/src/services/storage/index.ts b/source/services/storage/index.ts similarity index 100% rename from src/services/storage/index.ts rename to source/services/storage/index.ts diff --git a/src/services/storage/migrate.ts b/source/services/storage/migrate.ts similarity index 100% rename from src/services/storage/migrate.ts rename to source/services/storage/migrate.ts diff --git a/src/services/storage/migrations/001-resources.ts b/source/services/storage/migrations/001-resources.ts similarity index 100% rename from src/services/storage/migrations/001-resources.ts rename to source/services/storage/migrations/001-resources.ts diff --git a/src/services/storage/tables.ts b/source/services/storage/tables.ts similarity index 100% rename from src/services/storage/tables.ts rename to source/services/storage/tables.ts diff --git a/src/services/stream/base-stream.ts b/source/services/stream/base-stream.ts similarity index 100% rename from src/services/stream/base-stream.ts rename to source/services/stream/base-stream.ts diff --git a/src/services/stream/hono-sse-stream.ts b/source/services/stream/hono-sse-stream.ts similarity index 100% rename from src/services/stream/hono-sse-stream.ts rename to source/services/stream/hono-sse-stream.ts diff --git a/src/services/stream/http-request-stream.ts b/source/services/stream/http-request-stream.ts similarity index 100% rename from src/services/stream/http-request-stream.ts rename to source/services/stream/http-request-stream.ts diff --git a/src/services/stream/ws-stream.ts b/source/services/stream/ws-stream.ts similarity index 100% rename from src/services/stream/ws-stream.ts rename to source/services/stream/ws-stream.ts diff --git a/src/services/transport/http-transport.ts b/source/services/transport/http-transport.ts similarity index 100% rename from src/services/transport/http-transport.ts rename to source/services/transport/http-transport.ts diff --git a/src/services/transport/transport-router.ts b/source/services/transport/transport-router.ts similarity index 100% rename from src/services/transport/transport-router.ts rename to source/services/transport/transport-router.ts diff --git a/src/services/transport/ws-transport.ts b/source/services/transport/ws-transport.ts similarity index 100% rename from src/services/transport/ws-transport.ts rename to source/services/transport/ws-transport.ts diff --git a/src/utils/logger.ts b/source/utils/logger.ts similarity index 100% rename from src/utils/logger.ts rename to source/utils/logger.ts diff --git a/tests/helpers/test-connection.ts b/test/helpers/test-connection.ts similarity index 94% rename from tests/helpers/test-connection.ts rename to test/helpers/test-connection.ts index 98b37a4..caa318f 100644 --- a/tests/helpers/test-connection.ts +++ b/test/helpers/test-connection.ts @@ -1,7 +1,7 @@ import { BaseStream, type StreamMessage, -} from "../../src/services/stream/base-stream.js"; +} from "../../source/services/stream/base-stream.js"; /** Minimal observable connection used by application and broadcaster tests. */ export class TestConnection extends BaseStream { diff --git a/tests/routes/resources.test.ts b/test/routes/resources.test.ts similarity index 90% rename from tests/routes/resources.test.ts rename to test/routes/resources.test.ts index ec0b7b9..ff6980a 100644 --- a/tests/routes/resources.test.ts +++ b/test/routes/resources.test.ts @@ -1,12 +1,12 @@ import { describe, expect, it, vi } from "vitest"; -import { DataRoute } from "../../src/routes/resources.js"; -import { UnauthorizedError } from "../../src/errors/index.js"; -import { type BaseBroadcaster } from "../../src/services/broadcaster.js"; -import { ApplicationRouteStream } from "../../src/services/route-stream.js"; -import { Database } from "../../src/services/storage/database.js"; +import { DataRoute } from "../../source/routes/resources.js"; +import { UnauthorizedError } from "../../source/errors/index.js"; +import { type BaseBroadcaster } from "../../source/services/broadcaster.js"; +import { ApplicationRouteStream } from "../../source/services/route-stream.js"; +import { Database } from "../../source/services/storage/database.js"; import { TestConnection } from "../helpers/test-connection.js"; -import { HTTP_STATUS_CODE_NOT_ACCEPTED } from "../../src/constants.js"; +import { HTTP_STATUS_CODE_NOT_ACCEPTED } from "../../source/constants.js"; function createBroadcasterStub() { return { diff --git a/tests/services/broadcaster.test.ts b/test/services/broadcaster.test.ts similarity index 96% rename from tests/services/broadcaster.test.ts rename to test/services/broadcaster.test.ts index 24bf5ba..0fc6f3e 100644 --- a/tests/services/broadcaster.test.ts +++ b/test/services/broadcaster.test.ts @@ -1,9 +1,9 @@ import { describe, expect, it, vi } from "vitest"; -import { ApplicationError } from "../../src/errors/index.js"; -import { Broadcaster } from "../../src/services/broadcaster.js"; -import { ApplicationRouteStream } from "../../src/services/route-stream.js"; -import { Logger } from "../../src/utils/logger.js"; +import { ApplicationError } from "../../source/errors/index.js"; +import { Broadcaster } from "../../source/services/broadcaster.js"; +import { ApplicationRouteStream } from "../../source/services/route-stream.js"; +import { Logger } from "../../source/utils/logger.js"; import { TestConnection } from "../helpers/test-connection.js"; function createBroadcaster(): Broadcaster { diff --git a/tests/services/config.test.ts b/test/services/config.test.ts similarity index 98% rename from tests/services/config.test.ts rename to test/services/config.test.ts index 8d96a31..6100e28 100644 --- a/tests/services/config.test.ts +++ b/test/services/config.test.ts @@ -1,6 +1,6 @@ import { describe, expect, test, vi } from 'vitest'; -import { Config } from '../../src/services/config.ts'; +import { Config } from '../../source/services/config.ts'; /** * Tests that the config defaults to a 1 MiB request body limit. diff --git a/tests/services/router.test.ts b/test/services/router.test.ts similarity index 94% rename from tests/services/router.test.ts rename to test/services/router.test.ts index 1a3ac29..222d3e9 100644 --- a/tests/services/router.test.ts +++ b/test/services/router.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from "vitest"; -import type { RouteDefinition, RouteModule } from "../../src/routes/types.js"; -import { ApplicationError } from "../../src/errors/index.js"; -import { ApplicationRouter } from "../../src/services/router.js"; +import type { RouteDefinition, RouteModule } from "../../source/routes/types.js"; +import { ApplicationError } from "../../source/errors/index.js"; +import { ApplicationRouter } from "../../source/services/router.js"; import { TestConnection } from "../helpers/test-connection.js"; function moduleWith(routes: RouteDefinition[]): RouteModule { diff --git a/tests/services/stream/stream.test.ts b/test/services/stream/stream.test.ts similarity index 85% rename from tests/services/stream/stream.test.ts rename to test/services/stream/stream.test.ts index 5dd9571..5b6a055 100644 --- a/tests/services/stream/stream.test.ts +++ b/test/services/stream/stream.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it, vi } from "vitest"; -import { HonoSSEStream } from "../../../src/services/stream/hono-sse-stream.js"; -import { HttpRequestStream } from "../../../src/services/stream/http-request-stream.js"; -import { WSStream } from "../../../src/services/stream/ws-stream.js"; +import { HonoSSEStream } from "../../../source/services/stream/hono-sse-stream.js"; +import { HttpRequestStream } from "../../../source/services/stream/http-request-stream.js"; +import { WSStream } from "../../../source/services/stream/ws-stream.js"; describe("stream lifecycle observers", () => { it("buffers exactly one normal HTTP response", async () => { diff --git a/tests/services/transports/http-transport.test.ts b/test/services/transports/http-transport.test.ts similarity index 92% rename from tests/services/transports/http-transport.test.ts rename to test/services/transports/http-transport.test.ts index d889a6c..fbf213f 100644 --- a/tests/services/transports/http-transport.test.ts +++ b/test/services/transports/http-transport.test.ts @@ -1,15 +1,15 @@ import { Hono } from "hono"; import { describe, expect, it, vi } from "vitest"; -import type { RouteDefinition } from "../../../src/routes/types.js"; -import { ApplicationError } from "../../../src/errors/index.js"; -import { ApplicationRouter } from "../../../src/services/router.js"; -import { Broadcaster } from "../../../src/services/broadcaster.js"; -import { HttpTransportRouter } from "../../../src/services/transport/http-transport.js"; -import type { AppEnv } from "../../../src/services/transport/transport-router.js"; +import type { RouteDefinition } from "../../../source/routes/types.js"; +import { ApplicationError } from "../../../source/errors/index.js"; +import { ApplicationRouter } from "../../../source/services/router.js"; +import { Broadcaster } from "../../../source/services/broadcaster.js"; +import { HttpTransportRouter } from "../../../source/services/transport/http-transport.js"; +import type { AppEnv } from "../../../source/services/transport/transport-router.js"; import { fromExtendedJson, toExtendedJson } from "@xo-cash/utils"; -import { Logger } from "../../../src/utils/logger.js"; -import { ServerHost } from "../../../src/services/server-host.js"; +import { Logger } from "../../../source/utils/logger.js"; +import { ServerHost } from "../../../source/services/server-host.js"; async function createApp( routes: RouteDefinition[] | ((broadcaster: Broadcaster) => RouteDefinition[]), diff --git a/tests/services/transports/ws-transport.test.ts b/test/services/transports/ws-transport.test.ts similarity index 89% rename from tests/services/transports/ws-transport.test.ts rename to test/services/transports/ws-transport.test.ts index eeb8f40..a4fb98a 100644 --- a/tests/services/transports/ws-transport.test.ts +++ b/test/services/transports/ws-transport.test.ts @@ -2,11 +2,11 @@ import { describe, expect, it } from "vitest"; import { z } from "zod"; import { WebSocketServer } from "ws"; -import { ApplicationRouter } from "../../../src/services/router.js"; +import { ApplicationRouter } from "../../../source/services/router.js"; import { WsTransportRouter, -} from "../../../src/services/transport/ws-transport.js"; -import { Logger } from "../../../src/utils/logger.js"; +} from "../../../source/services/transport/ws-transport.js"; +import { Logger } from "../../../source/utils/logger.js"; import { toExtendedJson } from "@xo-cash/utils"; describe("WebSocket request decoding", () => { diff --git a/tests/subscription-flow.test.ts b/test/subscription-flow.test.ts similarity index 88% rename from tests/subscription-flow.test.ts rename to test/subscription-flow.test.ts index b9dec22..79c8400 100644 --- a/tests/subscription-flow.test.ts +++ b/test/subscription-flow.test.ts @@ -1,9 +1,9 @@ import { describe, expect, it, vi } from "vitest"; -import type { RouteDefinition, RouteModule } from "../src/routes/types.js"; -import { ApplicationRouter } from "../src/services/router.js"; -import { Broadcaster } from "../src/services/broadcaster.js"; -import { Logger } from "../src/utils/logger.js"; +import type { RouteDefinition, RouteModule } from "../source/routes/types.js"; +import { ApplicationRouter } from "../source/services/router.js"; +import { Broadcaster } from "../source/services/broadcaster.js"; +import { Logger } from "../source/utils/logger.js"; import { TestConnection } from "./helpers/test-connection.js"; function moduleWith(routes: RouteDefinition[]): RouteModule { diff --git a/tests/utils/logger.test.ts b/test/utils/logger.test.ts similarity index 96% rename from tests/utils/logger.test.ts rename to test/utils/logger.test.ts index 59a3e8d..2a07529 100644 --- a/tests/utils/logger.test.ts +++ b/test/utils/logger.test.ts @@ -1,4 +1,4 @@ -import { Logger } from '../../src/utils/logger.ts'; +import { Logger } from '../../source/utils/logger.ts'; import { expect, describe, test } from 'vitest'; /** diff --git a/tsconfig.json b/tsconfig.json index 779ded5..bae3d55 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "rootDir": "./src", + "rootDir": "./source", "outDir": "./dist", "module": "es2022", "target": "es2022",