You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a800a29
Browse filesBrowse the repository at this point in the historyBrowse files
- Remove subpath exports from package.json, keeping only the root @panmdaa/server entry
- Update all docs and README imports to use the root entry
- Restrict tsup to the root entry
- Add self-contained, runnable examples grouped by directory
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Thank you for considering contributing to `@panmdaa/server`.
12
12
-`docs/` — architecture, usage, and subsystem documentation.
13
13
-`.github/workflows/` — CI and release automation.
14
14
15
-
Public entry points use subpath exports — `@panmdaa/server/http`, `@panmdaa/server/router`, `@panmdaa/server/ws`, `@panmdaa/server/middleware`, `@panmdaa/server/error` — with the root `@panmdaa/server` re-exporting everything.
15
+
The package exposes a single entry point — `@panmdaa/server` — which re-exports everything (`error`, `http`, `middleware`, `router`, `ws`).
16
16
17
17
## Ways To Contribute
18
18
@@ -30,7 +30,7 @@ For larger changes, open an issue first so we can align on scope, API design, an
30
30
31
31
Changes that should usually be discussed first:
32
32
33
-
- new public exports or subpath imports
33
+
- new public exports
34
34
- changes to core internal algorithms or data structures
35
35
- changes to public function signatures or return types
> **Modular imports**: each domain has its own subpath — `@panmdaa/server/http`, `@panmdaa/server/router`, `@panmdaa/server/middleware`, `@panmdaa/server/error`, `@panmdaa/server/ws` — and the root`@panmdaa/server` re-exports everything. See [Development](docs/development/tooling.md).
70
+
> **Single entry point**: everything — `Server`, `Router`, middleware, errors, WebSocket helpers — is exported from`@panmdaa/server`. See [Development](docs/development/tooling.md).
72
71
73
72
## Routing
74
73
75
74
Verbs, params, wildcards and composition — all type-checked at compile time:
76
75
77
76
```ts
78
-
import { Server } from"@panmdaa/server/http";
77
+
import { Server } from"@panmdaa/server";
79
78
80
79
const server =newServer();
81
80
@@ -117,8 +116,7 @@ Optional segments are expanded into concrete routes at registration; matching ne
117
116
Middleware is compiled into a single function per route — conditional `await`, shared `next`, short-circuit. It's baked into each route **at registration time**:
> **Modular imports**: `Server`, contexts and handler compilation live in `@panmdaa/server/http`; `Router`/`RadixTree` in `@panmdaa/server/router`; the WebSocket stack in `@panmdaa/server/ws`; errors in `@panmdaa/server/error`; middleware in `@panmdaa/server/middleware`. The root`@panmdaa/server` re-exports everything.
230
+
> **Single entry point**: everything — `Server`, contexts, handler compilation, `Router`/`RadixTree`, the WebSocket stack, errors, middleware — is exported from`@panmdaa/server`.
Copy file name to clipboardExpand all lines: docs/architecture/overview.md
+7-14Lines changed: 7 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,21 +79,14 @@ Both engines follow the same allocation discipline:
79
79
- No logging, no cluster, no static file server (files are streamed with `pipeline`, but there is no middleware doing directory listing).
80
80
- No room/channel management for WebSockets — that is app-level.
81
81
82
-
## Public entry points
82
+
## Public entry point
83
83
84
-
The package exposes **modular subpath imports** (`package.json``exports`): each domain is importable on its own, and the root barrel re-exports everything.
Copy file name to clipboardExpand all lines: docs/development/tooling.md
+6-11Lines changed: 6 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,24 +25,19 @@ Run it via `npm run build` (or `node scripts/run-all.mjs`).
25
25
26
26
## Build
27
27
28
-
-`tsup.config.ts`: entry `src/**/*.ts`, `esnext`, **ESM only**, `minify: true`, `bundle: true`, `treeshake: true`, `clean: true`. tsup preserves the `src/` directory structure in `dist/`, which is what the subpath exports rely on.
Adding a new public module means: (1) create its `src/<name>/index.ts` barrel, (2) add a matching `exports` entry in `package.json`, (3) `export *` it from `src/index.ts` if it should also be in the root barrel.
40
+
Adding a new public module means: (1) create its `src/<name>/index.ts` barrel, (2) `export *` it from `src/index.ts`.
46
41
47
42
> `src/index.ts` is a clean barrel — it must **never** contain executable code (no `new Server()`, no `listen()`), or importing the package would boot a server.
Copy file name to clipboardExpand all lines: docs/usage/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ For the internals (why things work this way, what runs when), see the [architect
19
19
## Key concepts in one minute
20
20
21
21
```ts
22
-
import { Server } from"@panmdaa/server/http";
22
+
import { Server } from"@panmdaa/server";
23
23
24
24
const server =newServer();
25
25
@@ -37,4 +37,4 @@ server.listen(3000);
37
37
-`ctx.body` (JSON, form, raw, stream) is available only on body-capable routes (`POST/PUT/PATCH/DELETE/QUERY`).
38
38
- WebSockets live in their own tree: `server.ws("/path", handler)`.
39
39
40
-
**Imports are modular**: each domain has its own subpath — `@panmdaa/server/http` (Server, contexts), `@panmdaa/server/router`, `@panmdaa/server/ws`, `@panmdaa/server/middleware`, `@panmdaa/server/error` — and the root`@panmdaa/server` re-exports everything. See [Development](../development/tooling.md).
40
+
**One entry point**: everything — `Server`, `Router`, middleware, WebSockets, errors — is exported from`@panmdaa/server`. See [Development](../development/tooling.md).
0 commit comments