Rename src to source

This commit is contained in:
2026-07-27 10:22:01 +00:00
parent ff0aacc9b4
commit c891351e69
38 changed files with 35 additions and 35 deletions
View File
View File
@@ -1,7 +1,7 @@
import { import {
BaseStream, BaseStream,
type StreamMessage, 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. */ /** Minimal observable connection used by application and broadcaster tests. */
export class TestConnection extends BaseStream { export class TestConnection extends BaseStream {
@@ -1,12 +1,12 @@
import { describe, expect, it, vi } from "vitest"; import { describe, expect, it, vi } from "vitest";
import { DataRoute } from "../../src/routes/resources.js"; import { DataRoute } from "../../source/routes/resources.js";
import { UnauthorizedError } from "../../src/errors/index.js"; import { UnauthorizedError } from "../../source/errors/index.js";
import { type BaseBroadcaster } from "../../src/services/broadcaster.js"; import { type BaseBroadcaster } from "../../source/services/broadcaster.js";
import { ApplicationRouteStream } from "../../src/services/route-stream.js"; import { ApplicationRouteStream } from "../../source/services/route-stream.js";
import { Database } from "../../src/services/storage/database.js"; import { Database } from "../../source/services/storage/database.js";
import { TestConnection } from "../helpers/test-connection.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() { function createBroadcasterStub() {
return { return {
@@ -1,9 +1,9 @@
import { describe, expect, it, vi } from "vitest"; import { describe, expect, it, vi } from "vitest";
import { ApplicationError } from "../../src/errors/index.js"; import { ApplicationError } from "../../source/errors/index.js";
import { Broadcaster } from "../../src/services/broadcaster.js"; import { Broadcaster } from "../../source/services/broadcaster.js";
import { ApplicationRouteStream } from "../../src/services/route-stream.js"; import { ApplicationRouteStream } from "../../source/services/route-stream.js";
import { Logger } from "../../src/utils/logger.js"; import { Logger } from "../../source/utils/logger.js";
import { TestConnection } from "../helpers/test-connection.js"; import { TestConnection } from "../helpers/test-connection.js";
function createBroadcaster(): Broadcaster { function createBroadcaster(): Broadcaster {
@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from 'vitest'; 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. * Tests that the config defaults to a 1 MiB request body limit.
@@ -1,8 +1,8 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vitest";
import type { RouteDefinition, RouteModule } from "../../src/routes/types.js"; import type { RouteDefinition, RouteModule } from "../../source/routes/types.js";
import { ApplicationError } from "../../src/errors/index.js"; import { ApplicationError } from "../../source/errors/index.js";
import { ApplicationRouter } from "../../src/services/router.js"; import { ApplicationRouter } from "../../source/services/router.js";
import { TestConnection } from "../helpers/test-connection.js"; import { TestConnection } from "../helpers/test-connection.js";
function moduleWith(routes: RouteDefinition[]): RouteModule { function moduleWith(routes: RouteDefinition[]): RouteModule {
@@ -1,8 +1,8 @@
import { describe, expect, it, vi } from "vitest"; import { describe, expect, it, vi } from "vitest";
import { HonoSSEStream } from "../../../src/services/stream/hono-sse-stream.js"; import { HonoSSEStream } from "../../../source/services/stream/hono-sse-stream.js";
import { HttpRequestStream } from "../../../src/services/stream/http-request-stream.js"; import { HttpRequestStream } from "../../../source/services/stream/http-request-stream.js";
import { WSStream } from "../../../src/services/stream/ws-stream.js"; import { WSStream } from "../../../source/services/stream/ws-stream.js";
describe("stream lifecycle observers", () => { describe("stream lifecycle observers", () => {
it("buffers exactly one normal HTTP response", async () => { it("buffers exactly one normal HTTP response", async () => {
@@ -1,15 +1,15 @@
import { Hono } from "hono"; import { Hono } from "hono";
import { describe, expect, it, vi } from "vitest"; import { describe, expect, it, vi } from "vitest";
import type { RouteDefinition } from "../../../src/routes/types.js"; import type { RouteDefinition } from "../../../source/routes/types.js";
import { ApplicationError } from "../../../src/errors/index.js"; import { ApplicationError } from "../../../source/errors/index.js";
import { ApplicationRouter } from "../../../src/services/router.js"; import { ApplicationRouter } from "../../../source/services/router.js";
import { Broadcaster } from "../../../src/services/broadcaster.js"; import { Broadcaster } from "../../../source/services/broadcaster.js";
import { HttpTransportRouter } from "../../../src/services/transport/http-transport.js"; import { HttpTransportRouter } from "../../../source/services/transport/http-transport.js";
import type { AppEnv } from "../../../src/services/transport/transport-router.js"; import type { AppEnv } from "../../../source/services/transport/transport-router.js";
import { fromExtendedJson, toExtendedJson } from "@xo-cash/utils"; import { fromExtendedJson, toExtendedJson } from "@xo-cash/utils";
import { Logger } from "../../../src/utils/logger.js"; import { Logger } from "../../../source/utils/logger.js";
import { ServerHost } from "../../../src/services/server-host.js"; import { ServerHost } from "../../../source/services/server-host.js";
async function createApp( async function createApp(
routes: RouteDefinition[] | ((broadcaster: Broadcaster) => RouteDefinition[]), routes: RouteDefinition[] | ((broadcaster: Broadcaster) => RouteDefinition[]),
@@ -2,11 +2,11 @@ import { describe, expect, it } from "vitest";
import { z } from "zod"; import { z } from "zod";
import { WebSocketServer } from "ws"; import { WebSocketServer } from "ws";
import { ApplicationRouter } from "../../../src/services/router.js"; import { ApplicationRouter } from "../../../source/services/router.js";
import { import {
WsTransportRouter, WsTransportRouter,
} from "../../../src/services/transport/ws-transport.js"; } from "../../../source/services/transport/ws-transport.js";
import { Logger } from "../../../src/utils/logger.js"; import { Logger } from "../../../source/utils/logger.js";
import { toExtendedJson } from "@xo-cash/utils"; import { toExtendedJson } from "@xo-cash/utils";
describe("WebSocket request decoding", () => { describe("WebSocket request decoding", () => {
@@ -1,9 +1,9 @@
import { describe, expect, it, vi } from "vitest"; import { describe, expect, it, vi } from "vitest";
import type { RouteDefinition, RouteModule } from "../src/routes/types.js"; import type { RouteDefinition, RouteModule } from "../source/routes/types.js";
import { ApplicationRouter } from "../src/services/router.js"; import { ApplicationRouter } from "../source/services/router.js";
import { Broadcaster } from "../src/services/broadcaster.js"; import { Broadcaster } from "../source/services/broadcaster.js";
import { Logger } from "../src/utils/logger.js"; import { Logger } from "../source/utils/logger.js";
import { TestConnection } from "./helpers/test-connection.js"; import { TestConnection } from "./helpers/test-connection.js";
function moduleWith(routes: RouteDefinition[]): RouteModule { function moduleWith(routes: RouteDefinition[]): RouteModule {
@@ -1,4 +1,4 @@
import { Logger } from '../../src/utils/logger.ts'; import { Logger } from '../../source/utils/logger.ts';
import { expect, describe, test } from 'vitest'; import { expect, describe, test } from 'vitest';
/** /**
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"rootDir": "./src", "rootDir": "./source",
"outDir": "./dist", "outDir": "./dist",
"module": "es2022", "module": "es2022",
"target": "es2022", "target": "es2022",