Skip to content

Commit 6db41ea

Browse files
committed
BREAKING CHANGE: DEV, SUBMODULES
- the utils package is folded into the server package. it is no longer separate. The code is moved to utils.ts - an improved esbuild process for the client which supports multiple client builds. the public files are moved into the public folder in rootdir, and publicdir is considered cleanable now (although clean still needs to be specified in the esbuild). - the esbuild.context.mjs file format has changed and been renamed to esbuild.options.mjs
1 parent e71446c commit 6db41ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1859
-3402
lines changed

package-lock.json

Lines changed: 1238 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"@prisma/adapter-better-sqlite3": "6.10.1",
5656
"@serenity-kit/opaque": "^0.8.4",
5757
"@tiddlywiki/mws-prisma": "file:prisma/client",
58+
"@types/source-map-support": "^0.5.10",
5859
"source-map-support": "^0.5.21",
5960
"tiddlywiki": "^5.3.2"
6061
},
@@ -70,4 +71,4 @@
7071
"peerDependencies": {
7172
"tiddlywiki": "^5.3.2"
7273
}
73-
}
74+
}

packages/mws/src/RequestState.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { Prisma } from '@tiddlywiki/mws-prisma';
22
import { Types } from '@tiddlywiki/mws-prisma/runtime/library';
33
import { ServerState } from "./ServerState";
4-
import { BodyFormat, ParsedRequest, RouteMatch, Router, ServerRequest, Streamer } from "@tiddlywiki/server";
4+
import { BodyFormat, ParsedRequest, RouteMatch, Router, ServerRequest, Streamer, truthy } from "@tiddlywiki/server";
55
import { SendError, SendErrorReasonData } from "@tiddlywiki/server";
66
import { ServerToReactAdmin } from './services/setupDevServer';
7-
import { truthy } from '@tiddlywiki/utils';
87
import { AuthUser } from './services/sessions';
98

109

@@ -52,8 +51,8 @@ export class StateObject<
5251
this.pluginCache = router.config.pluginCache;
5352

5453
this.asserted = false;
55-
this.sendAdmin = (status: number, response: ServerToReactAdmin) =>
56-
router.sendAdmin(this, status, response);
54+
this.sendAdmin = (status: number, response: ServerToReactAdmin): Promise<typeof STREAM_ENDED> =>
55+
router.sendAdmin(this as ServerRequest<B, M, D>, status, response);
5756

5857
if (this.compressor)
5958
this.compressor.enabled = router.config.enableGzip;

packages/mws/src/commands/build-client.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

packages/mws/src/commands/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import * as load_archive from "./load-archive";
44
import * as init_store from "./init-store";
55
import * as manager from "./manager";
66
import * as tests_complete from "./tests-complete";
7-
import * as build_client from "./build-client";
8-
import * as build_types from "./build-types";
97
import * as listen from "./listen";
108
import { BaseCommand, CommandInfo } from "@tiddlywiki/commander";
119
import { serverEvents } from "@tiddlywiki/events";
@@ -19,8 +17,6 @@ export const commands = {
1917
init_store,
2018
manager,
2119
tests_complete,
22-
build_client,
23-
build_types,
2420
} as const satisfies Record<string, {
2521
info: CommandInfo,
2622
Command: {

packages/mws/src/commands/listen.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11

2-
import { BodyFormat, ListenerHTTP, ListenerHTTPS, Router, startListening, Z2, zod } from "@tiddlywiki/server";
2+
import { Router, startListening, Z2, zod, truthy, createRootRoute } from "@tiddlywiki/server";
33
import { BaseCommand, CommandInfo } from "@tiddlywiki/commander";
4-
5-
import { fromError } from "zod-validation-error";
64
import { serverEvents } from "@tiddlywiki/events";
7-
import { ServerRoute } from "@tiddlywiki/server";
8-
import { createRootRoute } from "@tiddlywiki/server";
9-
import { ServerState } from "../ServerState";
10-
import { truthy } from "@tiddlywiki/utils";
115

126
serverEvents.on("cli.register", (commands) => {
137
commands.listen = { info, Command };

packages/mws/src/commands/load-wiki-folder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { CacheState } from "../services/cache";
44
import { TiddlerFields, TW } from "tiddlywiki";
55
import * as fs from "fs";
66
import * as path from "path";
7-
import { truthy } from "@tiddlywiki/utils";
7+
import { truthy } from "@tiddlywiki/server";
88

99

1010
export const info: CommandInfo = {

packages/mws/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import "./globals";
2-
import "@tiddlywiki/utils";
2+
import { install } from "source-map-support";
3+
install();
34
import { serverEvents } from "@tiddlywiki/events";
45

56
// these all use serverEvents

packages/mws/src/managers/TiddlerStore.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { TiddlerFields } from "tiddlywiki";
2-
import { zod } from "@tiddlywiki/server";
3-
import { SendError } from "@tiddlywiki/server";
4-
import { Tuple } from "@tiddlywiki/utils";
2+
import { zod, SendError, Tuple } from "@tiddlywiki/server";
53

64
/**
75
*

packages/mws/src/managers/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ import "./user-status";
77

88
// other imports
99
import { admin } from "./admin-utils";
10-
import { RouterKeyMap, RouterRouteMap, ServerRoute, registerZodRoutes } from "@tiddlywiki/server";
10+
import { RouterKeyMap, RouterRouteMap, ServerRoute, registerZodRoutes,truthy } from "@tiddlywiki/server";
1111
import { ServerState } from "../ServerState";
1212
import { serverEvents } from "@tiddlywiki/events";
13-
import { truthy } from "@tiddlywiki/utils";
1413

1514
export * from "./admin-recipes";
1615
export * from "./admin-users";

0 commit comments

Comments
 (0)