@tulipes/core 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,11 +8,11 @@ Tulipes exists so you never rewrite Express boilerplate again. You write **modul
8
8
  // app.ts — the whole entrypoint
9
9
  import { boot } from "@tulipes/core/boot";
10
10
 
11
- await boot({ rootDir: import.meta.dirname, mode: "web" });
11
+ await boot({ rootDir: import.meta.dirname, mode: "backend" });
12
12
  ```
13
13
 
14
14
  ```
15
- ▲ my-api development · web mode
15
+ ▲ my-api development · backend mode
16
16
 
17
17
  ➜ Server http://localhost:4000 ● listening
18
18
  ➜ Database mongodb://127.0.0.1:27017/my-api ● connected
@@ -29,7 +29,7 @@ await boot({ rootDir: import.meta.dirname, mode: "web" });
29
29
 
30
30
  - **Modules, not layers.** A feature lives in one folder: its routes, models, config, permissions, background jobs, and env contract. Delete the folder, the feature is gone.
31
31
  - **Fail-closed everywhere.** Missing env vars, dependency cycles, duplicate ACL grants, colliding queue names — all crash the boot with a full report. Reading an undeclared variable or model throws at the call site. Unknown roles deny. Unrouted requests 404. Unexpected errors never leak internals outside development.
32
- - **One process, two modes.** The same codebase boots as a `web` server or a queue-consuming `worker` — same modules, same config, forked at the last pipeline phase.
32
+ - **One process, two modes.** The same codebase boots as a `backend` server or a queue-consuming `worker` — same modules, same config, forked at the last pipeline phase.
33
33
  - **Types generated, not hand-written.** `tulipes sync` reads your modules and emits a `config.d.ts` that types every env variable and every config namespace — enum variables become literal unions, config shapes are inferred from your factories' return types.
34
34
  - **The framework stays out of your request path.** Core mounts *no* middleware. Your sys-tier modules own the pipeline head; core only guarantees the tail (404 + terminal error handler).
35
35
 
@@ -49,7 +49,7 @@ yarn add @tulipes/core
49
49
 
50
50
  ```
51
51
  my-api/
52
- ├── app.ts # boot({ mode: "web" })
52
+ ├── app.ts # boot({ mode: "backend" })
53
53
  ├── worker.ts # boot({ mode: "worker" })
54
54
  ├── config/
55
55
  │ └── app.config.ts # optional: seeds global config before any module
@@ -148,7 +148,7 @@ ctx.Environment.get("TYPO_NAME"); // throws: never declared by any modul
148
148
  6. Database connect Mongoose → model store → bootstrap tasks
149
149
  7. Queues every *.queues.ts registers in BOTH modes
150
150
  8. ── mode fork ──
151
- web module routers (load order) → 404 → error handler → listen
151
+ backend module routers (load order) → 404 → error handler → listen
152
152
  worker start a BullMQ worker per registered processor
153
153
  9. onReady hooks in load order → startup banner
154
154
  shutdown SIGTERM/SIGINT → onShutdown hooks in REVERSE order →
@@ -168,8 +168,8 @@ interface Ctx {
168
168
  acl?: Acl; // after phase 5
169
169
  models?: ModelStore; // after phase 6
170
170
  queues?: QueueManager; // after phase 7
171
- sockets?: SocketManager; // web only
172
- app?: Express; // web only
171
+ sockets?: SocketManager; // backend only
172
+ app?: Express; // backend only
173
173
  }
174
174
  ```
175
175
 
@@ -247,19 +247,20 @@ router.get("/users/:id", async (req) => {
247
247
  ## The CLI
248
248
 
249
249
  ```
250
- tulipes init [dir] scaffold a new application boots with zero infrastructure
251
- tulipes init [dir] --full ...plus models, bootstrap tasks and queues (needs mongo + redis)
250
+ tulipes init [dir] scaffold a new application (needs mongo + redis)
252
251
  tulipes sync regenerate types/config.d.ts and .env.example
253
252
  tulipes env:check validate env against every meta contract — CI gate, exit 1 on failure
254
253
  tulipes new module <name> scaffold a module (scope auto-detected from siblings)
254
+ tulipes update upgrade @tulipes/core to the latest release, everywhere
255
+ tulipes -v print the installed core version
255
256
  tulipes dev [entry] sync, then run the entry under tsx watch
256
257
  ```
257
258
 
258
259
  The scaffolded `modules/hello` is a worked example of every module
259
260
  contract — config factory with lifecycle hooks, ACL grants, routes with
260
- `HttpError` and permission checks, a controller, a pure helper, and a
261
- socket namespace. `--full` adds the three that need infrastructure: a
262
- model, an idempotent bootstrap task, and a queue with its processor.
261
+ `HttpError` and permission checks, a controller, a pure helper, a model,
262
+ an idempotent bootstrap task, a queue with its processor, and a socket
263
+ namespace. The generated app expects mongo and redis to be running.
263
264
 
264
265
  ### Built for AI-assisted work
265
266
 
@@ -297,4 +298,4 @@ Express 5 · Mongoose 8 · BullMQ 5 · ioredis 5 · Socket.IO 4 · Zod. Delibera
297
298
 
298
299
  ## Well-known variables
299
300
 
300
- Core reads three variable names when present (declare them in your sys core module): `PORT` (web listen port, default 3000), `MONGO_URI` (required if any module ships models), `REDIS_URL` (required if any module ships queues). No models and no `MONGO_URI` is a valid database-less app; models without `MONGO_URI` is a boot refusal.
301
+ Core reads three variable names when present (declare them in your sys core module): `PORT` (backend listen port, default 3000), `MONGO_URI` (required if any module ships models), `REDIS_URL` (required if any module ships queues). No models and no `MONGO_URI` is a valid database-less app; models without `MONGO_URI` is a boot refusal.
@@ -3,12 +3,12 @@ import type { Connection } from "mongoose";
3
3
  import { type Express } from "express";
4
4
  import { Environment, type AppEnv } from "../env/environment.js";
5
5
  import type { Ctx } from "./contracts.js";
6
- export declare const processModes: readonly ["web", "worker"];
6
+ export declare const processModes: readonly ["backend", "worker"];
7
7
  export type ProcessMode = (typeof processModes)[number];
8
8
  export interface BootOptions {
9
9
  /** App root — the directory containing `modules/` and `.envs/`. */
10
10
  rootDir: string;
11
- /** Defaults to process.env.PROCESS_MODE, then "web". */
11
+ /** Defaults to process.env.PROCESS_MODE, then "backend". */
12
12
  mode?: ProcessMode;
13
13
  appEnv?: AppEnv;
14
14
  /** Skip SIGTERM/SIGINT wiring — for tests that manage shutdown themselves. */
@@ -26,7 +26,7 @@ export interface BootHandle {
26
26
  /**
27
27
  * The whole run workflow, in the order the POC pins down:
28
28
  * environment → module graph → exploration → global config → (acl, db —
29
- * future steps) → mode fork (web | worker) → onReady. Each phase crashes
29
+ * future steps) → mode fork (backend | worker) → onReady. Each phase crashes
30
30
  * with its aggregate report before the next begins.
31
31
  */
32
32
  export declare function boot(options: BootOptions): Promise<BootHandle>;
package/dist/boot/boot.js CHANGED
@@ -15,11 +15,11 @@ import { errorHandler, notFoundHandler } from "../http/error-handler.js";
15
15
  import { loadAppConfigSeed } from "./app-files.js";
16
16
  import { printStartupBanner } from "./banner.js";
17
17
  import { importFile } from "./import-file.js";
18
- export const processModes = ["web", "worker"];
18
+ export const processModes = ["backend", "worker"];
19
19
  /**
20
20
  * The whole run workflow, in the order the POC pins down:
21
21
  * environment → module graph → exploration → global config → (acl, db —
22
- * future steps) → mode fork (web | worker) → onReady. Each phase crashes
22
+ * future steps) → mode fork (backend | worker) → onReady. Each phase crashes
23
23
  * with its aggregate report before the next begins.
24
24
  */
25
25
  export async function boot(options) {
@@ -64,8 +64,8 @@ export async function boot(options) {
64
64
  const queueReport = new BootReport();
65
65
  await initQueues(explored, ctx, queueReport);
66
66
  queueReport.throwIfAny("queues");
67
- if (mode === "web") {
68
- await startWeb(handle, explored);
67
+ if (mode === "backend") {
68
+ await startBackend(handle, explored);
69
69
  }
70
70
  else {
71
71
  const workerReport = new BootReport();
@@ -104,14 +104,17 @@ export async function boot(options) {
104
104
  return handle;
105
105
  }
106
106
  function resolveMode(override) {
107
- const raw = override ?? process.env.PROCESS_MODE ?? "web";
107
+ const raw = override ?? process.env.PROCESS_MODE ?? "backend";
108
108
  if (!processModes.includes(raw)) {
109
- throw new Error(`PROCESS_MODE "${raw}" is invalid expected one of: ${processModes.join(", ")}`);
109
+ // "web" was this mode's name before 0.1.5; name the replacement rather
110
+ // than leaving an upgrader to guess from the valid-values list.
111
+ const hint = raw === "web" ? ' — "web" was renamed to "backend"' : "";
112
+ throw new Error(`PROCESS_MODE "${raw}" is invalid — expected one of: ${processModes.join(", ")}${hint}`);
110
113
  }
111
114
  return raw;
112
115
  }
113
116
  /**
114
- * Phases 9w11w: express, module routes, http server.
117
+ * Phases 9b11b: express, module routes, http server.
115
118
  *
116
119
  * The request pipeline, in order:
117
120
  * 1. every module router (load order — sys modules first, so their
@@ -128,7 +131,7 @@ function resolveMode(override) {
128
131
  * escapes unrouted or unhandled. @tulipes/core/http ships only that tail's
129
132
  * building blocks (HttpError, notFoundHandler, errorHandler).
130
133
  */
131
- async function startWeb(handle, explored) {
134
+ async function startBackend(handle, explored) {
132
135
  const app = express();
133
136
  handle.app = app;
134
137
  handle.ctx.app = app;
@@ -171,7 +174,7 @@ async function startWeb(handle, explored) {
171
174
  : 3000;
172
175
  const server = createServer(app);
173
176
  handle.server = server;
174
- // Phase 11w — sockets attach before listen() so no client can connect
177
+ // Phase 11b — sockets attach before listen() so no client can connect
175
178
  // to a namespace that isn't wired yet.
176
179
  const socketReport = new BootReport();
177
180
  await initSockets(explored, handle.ctx, server, socketReport);
@@ -1 +1 @@
1
- {"version":3,"file":"boot.js","sourceRoot":"","sources":["../../src/boot/boot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,WAAW,CAAC;AAEtD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,OAAO,EAAE,EAAgB,MAAM,SAAS,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAe,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAoB,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa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AAe,CAAC,OAAO,EAAE,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;IAED,yEAAyE;IACzE,uCAAuC;IACvC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;IAE5B,IAAI,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC;QAC7B,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC1C,MAAM,CAAC,MAAO,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACL,CAAC;IAED,yEAAyE;IACzE,yEAAyE;IACzE,+CAA+C;IAC/C,MAAM,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;IACjC,MAAM,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC;IAEjC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,+BAA+B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxE,CAAC;AACH,CAAC"}
@@ -8,7 +8,7 @@ import type { SocketManager } from "../sockets/socket-manager.js";
8
8
  /**
9
9
  * The context object threaded through every module-authored function.
10
10
  * Later-phase members only exist once their phase has run: config factories
11
- * (phase 6) see neither `acl` (phase 7) nor `app` (web branch, phase 9).
11
+ * (phase 6) see neither `acl` (phase 7) nor `app` (backend branch, phase 9).
12
12
  */
13
13
  export interface Ctx {
14
14
  Environment: Environment;
@@ -40,7 +40,7 @@ export interface ModuleLifecycle {
40
40
  onShutdown?: LifecycleHook;
41
41
  }
42
42
  /**
43
- * Default export of `routes/*.routes.ts` (web branch only). May mount
43
+ * Default export of `routes/*.routes.ts` (backend branch only). May mount
44
44
  * directly on `ctx.app`, or return a Router for core to `app.use()` —
45
45
  * returning one is the recommended style.
46
46
  */
@@ -1,21 +1,14 @@
1
- export interface InitOptions {
2
- /** Also scaffold the contracts that need mongo and redis. */
3
- full?: boolean;
4
- }
5
1
  /**
6
- * `tulipes init [dir] [--full]` — scaffold a complete application.
2
+ * `tulipes init [dir]` — scaffold a complete application.
7
3
  *
8
4
  * Three modules ship: core (sys 0 — env contract, roles, request ids),
9
5
  * security (sys 10 — helmet, cors, logging, body parsing) and hello, a
10
- * worked example of every module contract.
6
+ * worked example of EVERY module contract: config with lifecycle hooks,
7
+ * ACL grants, routes, a controller, a helper, a model, a bootstrap task,
8
+ * a queue with its processor, and a socket namespace.
11
9
  *
12
- * By default the app boots with ZERO infrastructure: no MONGO_URI or
13
- * REDIS_URL is declared, and with no models and no queue files the
14
- * pipeline skips both engines legitimately, so `yarn install && yarn dev`
15
- * always succeeds on a bare machine.
16
- *
17
- * `--full` adds the contracts that cannot work without infrastructure —
18
- * models, bootstrap tasks and queues — along with the variables they
19
- * require. That app needs mongo and redis running to boot.
10
+ * The generated app therefore needs mongo and redis running — models and
11
+ * queues cannot work without them, and the boot refuses rather than
12
+ * degrading quietly.
20
13
  */
21
- export declare function runInit(rootDir: string, target?: string, options?: InitOptions): Promise<void>;
14
+ export declare function runInit(rootDir: string, target?: string): Promise<void>;
package/dist/cli/init.js CHANGED
@@ -1,33 +1,29 @@
1
1
  import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
2
2
  import { basename, dirname, join, resolve } from "node:path";
3
- import { fileURLToPath } from "node:url";
3
+ import { coreVersion, packageRoot } from "./package-info.js";
4
4
  /**
5
- * `tulipes init [dir] [--full]` — scaffold a complete application.
5
+ * `tulipes init [dir]` — scaffold a complete application.
6
6
  *
7
7
  * Three modules ship: core (sys 0 — env contract, roles, request ids),
8
8
  * security (sys 10 — helmet, cors, logging, body parsing) and hello, a
9
- * worked example of every module contract.
9
+ * worked example of EVERY module contract: config with lifecycle hooks,
10
+ * ACL grants, routes, a controller, a helper, a model, a bootstrap task,
11
+ * a queue with its processor, and a socket namespace.
10
12
  *
11
- * By default the app boots with ZERO infrastructure: no MONGO_URI or
12
- * REDIS_URL is declared, and with no models and no queue files the
13
- * pipeline skips both engines legitimately, so `yarn install && yarn dev`
14
- * always succeeds on a bare machine.
15
- *
16
- * `--full` adds the contracts that cannot work without infrastructure —
17
- * models, bootstrap tasks and queues — along with the variables they
18
- * require. That app needs mongo and redis running to boot.
13
+ * The generated app therefore needs mongo and redis running — models and
14
+ * queues cannot work without them, and the boot refuses rather than
15
+ * degrading quietly.
19
16
  */
20
- export async function runInit(rootDir, target, options = {}) {
17
+ export async function runInit(rootDir, target) {
21
18
  const dir = resolve(rootDir, target ?? ".");
22
19
  const name = sanitizeName(basename(dir));
23
- const full = options.full ?? false;
24
20
  if (existsSync(dir) && readdirSync(dir).some((entry) => entry !== ".git")) {
25
21
  console.error(`refusing to init: ${dir} is not empty`);
26
22
  process.exitCode = 1;
27
23
  return;
28
24
  }
29
- const coreVersion = ownVersion();
30
- const files = renderProject(name, coreVersion, full);
25
+ const version = coreVersion();
26
+ const files = renderProject(name, version);
31
27
  for (const [relPath, content] of files) {
32
28
  const filePath = join(dir, relPath);
33
29
  mkdirSync(dirname(filePath), { recursive: true });
@@ -46,23 +42,11 @@ export async function runInit(rootDir, target, options = {}) {
46
42
  "",
47
43
  " → http://localhost:3000/hello",
48
44
  "",
49
- full
50
- ? "Needs mongo and redis running (MONGO_URI / REDIS_URL in .envs/.env.development).\nRun `yarn worker` in a second terminal to consume queued jobs."
51
- : "No database or redis needed to boot — add MONGO_URI / REDIS_URL to\nmodules/core/meta.variables.json when your first model or queue lands,\nor scaffold them now with `tulipes init --full`.",
45
+ "Needs mongo and redis running — see MONGO_URI / REDIS_URL in",
46
+ ".envs/.env.development. Run `yarn worker` in a second terminal to",
47
+ "consume queued jobs.",
52
48
  ].filter((line) => line !== undefined).join("\n"));
53
49
  }
54
- /**
55
- * The version of the core running this CLI. Resolved relative to this file
56
- * (src/cli or dist/cli — both sit two levels below the package root) since
57
- * the exports map deliberately doesn't expose package.json.
58
- */
59
- function ownVersion() {
60
- const pkg = JSON.parse(readFileSync(join(packageRoot(), "package.json"), "utf8"));
61
- return pkg.version;
62
- }
63
- function packageRoot() {
64
- return join(dirname(fileURLToPath(import.meta.url)), "..", "..");
65
- }
66
50
  /**
67
51
  * Instructions for AI coding agents working in the generated app: an
68
52
  * always-loaded CLAUDE.md plus task-scoped skills. They ship as real
@@ -95,7 +79,7 @@ function sanitizeName(raw) {
95
79
  return name || "tulipes-app";
96
80
  }
97
81
  const json = (value) => JSON.stringify(value, null, 2) + "\n";
98
- function renderProject(name, coreVersion, full) {
82
+ function renderProject(name, coreVersion) {
99
83
  const core = `^${coreVersion}`;
100
84
  const files = [
101
85
  ["package.json", json({
@@ -167,7 +151,7 @@ function renderProject(name, coreVersion, full) {
167
151
  ["app.ts", [
168
152
  `import { boot } from "@tulipes/core/boot";`,
169
153
  ``,
170
- `await boot({ rootDir: import.meta.dirname, mode: "web" });`,
154
+ `await boot({ rootDir: import.meta.dirname, mode: "backend" });`,
171
155
  ``,
172
156
  ].join("\n")],
173
157
  ["worker.ts", [
@@ -346,13 +330,9 @@ function renderProject(name, coreVersion, full) {
346
330
  `# none; "*" allows any but forbids credentials.`,
347
331
  `CORS_ORIGINS=http://localhost:5173`,
348
332
  ``,
349
- ...(full
350
- ? [
351
- `MONGO_URI=mongodb://127.0.0.1:27017/${name}`,
352
- `REDIS_URL=redis://127.0.0.1:6379`,
353
- ``,
354
- ]
355
- : []),
333
+ `MONGO_URI=mongodb://127.0.0.1:27017/${name}`,
334
+ `REDIS_URL=redis://127.0.0.1:6379`,
335
+ ``,
356
336
  ].join("\n")],
357
337
  // ── modules/core — sys tier, priority 0: the very first router ─────────
358
338
  ["modules/core/package.json", json({
@@ -369,29 +349,25 @@ function renderProject(name, coreVersion, full) {
369
349
  name: "PORT",
370
350
  type: "number",
371
351
  group: "http",
372
- description: "HTTP port the web process listens on",
352
+ description: "HTTP port the backend process listens on",
373
353
  default: 3000,
374
354
  },
375
355
  // Infra connection strings live in the sys core module because every
376
356
  // feature shares them — one owner per variable, no duplicates.
377
- ...(full
378
- ? [
379
- {
380
- name: "MONGO_URI",
381
- type: "url",
382
- group: "database",
383
- required: true,
384
- description: "MongoDB connection string",
385
- },
386
- {
387
- name: "REDIS_URL",
388
- type: "url",
389
- group: "redis",
390
- required: true,
391
- description: "Redis connection string (queues, cache)",
392
- },
393
- ]
394
- : []),
357
+ {
358
+ name: "MONGO_URI",
359
+ type: "url",
360
+ group: "database",
361
+ required: true,
362
+ description: "MongoDB connection string",
363
+ },
364
+ {
365
+ name: "REDIS_URL",
366
+ type: "url",
367
+ group: "redis",
368
+ required: true,
369
+ description: "Redis connection string (queues, cache)",
370
+ },
395
371
  ],
396
372
  })],
397
373
  ["modules/core/module.acl.ts", [
@@ -617,7 +593,7 @@ function renderProject(name, coreVersion, full) {
617
593
  dependencies: {
618
594
  "@tulipes/core": core,
619
595
  express: "^5",
620
- ...(full ? { mongoose: "^8" } : {}),
596
+ mongoose: "^8",
621
597
  },
622
598
  })],
623
599
  ["modules/hello/meta.variables.json", json({
@@ -756,7 +732,7 @@ function renderProject(name, coreVersion, full) {
756
732
  `import type { SocketRegistry } from "@tulipes/core/sockets";`,
757
733
  ``,
758
734
  `/**`,
759
- ` * Web mode only. A namespace is claimed by exactly one module; emit`,
735
+ ` * Backend mode only. A namespace is claimed by exactly one module; emit`,
760
736
  ` * from anywhere with \`ctx.sockets!.of("/hello")\`.`,
761
737
  ` *`,
762
738
  ` * Try it: wscat -c ws://localhost:3000/hello`,
@@ -776,119 +752,117 @@ function renderProject(name, coreVersion, full) {
776
752
  ``,
777
753
  ].join("\n")],
778
754
  ];
779
- // ── --full only: the contracts that need a database or redis ───────────
780
- if (full) {
781
- files.push(["modules/hello/models/greeting.model.ts", [
782
- `import { Schema } from "mongoose";`,
783
- `import type { ModelDef } from "@tulipes/core/db";`,
784
- ``,
785
- `/**`,
786
- ` * A model file is a DECLARATION, never a registration: the framework`,
787
- ` * compiles the schema on its own connection and puts it in the model`,
788
- ` * store. Never call mongoose.model() yourself.`,
789
- ` *`,
790
- ` * Read it anywhere the context reaches: models!.get("Greeting").`,
791
- ` */`,
792
- `const greetingSchema = new Schema(`,
793
- ` {`,
794
- ` name: { type: String, required: true, unique: true, lowercase: true, trim: true },`,
795
- ` message: { type: String, required: true },`,
796
- ` timesUsed: { type: Number, default: 0, min: 0 },`,
797
- ` },`,
798
- ` { timestamps: true },`,
799
- `);`,
800
- ``,
801
- `export default { name: "Greeting", schema: greetingSchema } satisfies ModelDef;`,
802
- ``,
803
- ].join("\n")], ["modules/hello/bootstrap/seed-greetings.bootstrap.ts", [
804
- `import type { Ctx } from "@tulipes/core/boot";`,
805
- ``,
806
- `/**`,
807
- ` * Runs after models are registered and before the server accepts`,
808
- ` * traffic — the place for indexes, seed rows and defaults.`,
809
- ` *`,
810
- ` * MUST be idempotent: it runs on every boot of every process, web and`,
811
- ` * worker alike. Upsert; never blind-insert.`,
812
- ` */`,
813
- `export default async function seedGreetings({ models }: Ctx): Promise<void> {`,
814
- ` const Greeting = models!.get("Greeting");`,
815
- ``,
816
- ` await Greeting.updateOne(`,
817
- ` { name: "world" },`,
818
- ` { $setOnInsert: { name: "world", message: "Hello, world!" } },`,
819
- ` { upsert: true },`,
820
- ` );`,
821
- `}`,
822
- ``,
823
- ].join("\n")], ["modules/hello/queues/hello.queues.ts", [
824
- `import type { Ctx } from "@tulipes/core/boot";`,
825
- `import type { QueueRegistry } from "@tulipes/core/queues";`,
826
- ``,
827
- `/**`,
828
- ` * ONE file describes both sides. The web process registers the queue`,
829
- ` * so routes can produce into it; \`yarn worker\` turns the processor`,
830
- ` * into a live consumer. Never duplicate the definition.`,
831
- ` *`,
832
- ` * Queue names use "." — BullMQ reserves ":" as its redis separator.`,
833
- ` */`,
834
- `export default function helloQueues({ models }: Ctx, queues: QueueRegistry): void {`,
835
- ` queues.define("hello.count-greeting");`,
836
- ``,
837
- ` queues.process("hello.count-greeting", async (job) => {`,
838
- ` // Jobs retry, so processors must be idempotent-safe. Pass ids in`,
839
- ` // job.data and re-read state here rather than shipping documents.`,
840
- ` const { name } = job.data as { name: string };`,
841
- ` await models!.get("Greeting").updateOne({ name }, { $inc: { timesUsed: 1 } });`,
842
- ` return { counted: name };`,
843
- ` });`,
844
- `}`,
845
- ``,
846
- ].join("\n")], ["modules/hello/routes/greetings.routes.ts", [
847
- `import { Router } from "express";`,
848
- `import type { Ctx } from "@tulipes/core/boot";`,
849
- `import { HttpError } from "@tulipes/core/http";`,
850
- ``,
851
- `/**`,
852
- ` * A module may ship several routes files; each is discovered and`,
853
- ` * mounted independently. This one shows the database and the queue.`,
854
- ` */`,
855
- `export default function greetingsRoutes({ config, models, queues }: Ctx): Router {`,
856
- ` const router = Router();`,
857
- ` const base = String(config.api?.prefix ?? "");`,
858
- ``,
859
- ` router.get(\`\${base}/greetings\`, async (req, res) => {`,
860
- ` // Pagination bounds are app-wide, so every list endpoint clamps`,
861
- ` // the same way and no caller can ask for the whole table.`,
862
- ` const { defaultLimit = 20, maxLimit = 100 } = config.pagination ?? {};`,
863
- ` const asked = Number(req.query.limit ?? defaultLimit);`,
864
- ` const limit = Math.min(Number.isFinite(asked) ? asked : defaultLimit, maxLimit);`,
865
- ``,
866
- ` const greetings = await models!`,
867
- ` .get("Greeting")`,
868
- ` .find()`,
869
- ` .select("name message timesUsed -_id")`,
870
- ` .limit(limit)`,
871
- ` .lean();`,
872
- ``,
873
- ` res.json({ count: greetings.length, limit, greetings });`,
874
- ` });`,
875
- ``,
876
- ` router.post(\`\${base}/greetings/:name/use\`, async (req, res) => {`,
877
- ` const { name } = req.params;`,
878
- ` const greeting = await models!.get("Greeting").findOne({ name }).lean();`,
879
- ` if (!greeting) throw new HttpError(404, \`no greeting named "\${name}"\`);`,
880
- ``,
881
- ` // Slow or retryable work belongs in a job, not in the request.`,
882
- ` // Run \`yarn worker\` in another terminal to see it processed.`,
883
- ` await queues!.add("hello.count-greeting", "count", { name });`,
884
- ` res.status(202).json({ name, queued: true });`,
885
- ` });`,
886
- ``,
887
- ` return router;`,
888
- `}`,
889
- ``,
890
- ].join("\n")]);
891
- }
755
+ // ── the contracts that need a database or redis ────────────────────────
756
+ files.push(["modules/hello/models/greeting.model.ts", [
757
+ `import { Schema } from "mongoose";`,
758
+ `import type { ModelDef } from "@tulipes/core/db";`,
759
+ ``,
760
+ `/**`,
761
+ ` * A model file is a DECLARATION, never a registration: the framework`,
762
+ ` * compiles the schema on its own connection and puts it in the model`,
763
+ ` * store. Never call mongoose.model() yourself.`,
764
+ ` *`,
765
+ ` * Read it anywhere the context reaches: models!.get("Greeting").`,
766
+ ` */`,
767
+ `const greetingSchema = new Schema(`,
768
+ ` {`,
769
+ ` name: { type: String, required: true, unique: true, lowercase: true, trim: true },`,
770
+ ` message: { type: String, required: true },`,
771
+ ` timesUsed: { type: Number, default: 0, min: 0 },`,
772
+ ` },`,
773
+ ` { timestamps: true },`,
774
+ `);`,
775
+ ``,
776
+ `export default { name: "Greeting", schema: greetingSchema } satisfies ModelDef;`,
777
+ ``,
778
+ ].join("\n")], ["modules/hello/bootstrap/seed-greetings.bootstrap.ts", [
779
+ `import type { Ctx } from "@tulipes/core/boot";`,
780
+ ``,
781
+ `/**`,
782
+ ` * Runs after models are registered and before the server accepts`,
783
+ ` * traffic the place for indexes, seed rows and defaults.`,
784
+ ` *`,
785
+ ` * MUST be idempotent: it runs on every boot of every process, backend and`,
786
+ ` * worker alike. Upsert; never blind-insert.`,
787
+ ` */`,
788
+ `export default async function seedGreetings({ models }: Ctx): Promise<void> {`,
789
+ ` const Greeting = models!.get("Greeting");`,
790
+ ``,
791
+ ` await Greeting.updateOne(`,
792
+ ` { name: "world" },`,
793
+ ` { $setOnInsert: { name: "world", message: "Hello, world!" } },`,
794
+ ` { upsert: true },`,
795
+ ` );`,
796
+ `}`,
797
+ ``,
798
+ ].join("\n")], ["modules/hello/queues/hello.queues.ts", [
799
+ `import type { Ctx } from "@tulipes/core/boot";`,
800
+ `import type { QueueRegistry } from "@tulipes/core/queues";`,
801
+ ``,
802
+ `/**`,
803
+ ` * ONE file describes both sides. The backend process registers the queue`,
804
+ ` * so routes can produce into it; \`yarn worker\` turns the processor`,
805
+ ` * into a live consumer. Never duplicate the definition.`,
806
+ ` *`,
807
+ ` * Queue names use "." — BullMQ reserves ":" as its redis separator.`,
808
+ ` */`,
809
+ `export default function helloQueues({ models }: Ctx, queues: QueueRegistry): void {`,
810
+ ` queues.define("hello.count-greeting");`,
811
+ ``,
812
+ ` queues.process("hello.count-greeting", async (job) => {`,
813
+ ` // Jobs retry, so processors must be idempotent-safe. Pass ids in`,
814
+ ` // job.data and re-read state here rather than shipping documents.`,
815
+ ` const { name } = job.data as { name: string };`,
816
+ ` await models!.get("Greeting").updateOne({ name }, { $inc: { timesUsed: 1 } });`,
817
+ ` return { counted: name };`,
818
+ ` });`,
819
+ `}`,
820
+ ``,
821
+ ].join("\n")], ["modules/hello/routes/greetings.routes.ts", [
822
+ `import { Router } from "express";`,
823
+ `import type { Ctx } from "@tulipes/core/boot";`,
824
+ `import { HttpError } from "@tulipes/core/http";`,
825
+ ``,
826
+ `/**`,
827
+ ` * A module may ship several routes files; each is discovered and`,
828
+ ` * mounted independently. This one shows the database and the queue.`,
829
+ ` */`,
830
+ `export default function greetingsRoutes({ config, models, queues }: Ctx): Router {`,
831
+ ` const router = Router();`,
832
+ ` const base = String(config.api?.prefix ?? "");`,
833
+ ``,
834
+ ` router.get(\`\${base}/greetings\`, async (req, res) => {`,
835
+ ` // Pagination bounds are app-wide, so every list endpoint clamps`,
836
+ ` // the same way and no caller can ask for the whole table.`,
837
+ ` const { defaultLimit = 20, maxLimit = 100 } = config.pagination ?? {};`,
838
+ ` const asked = Number(req.query.limit ?? defaultLimit);`,
839
+ ` const limit = Math.min(Number.isFinite(asked) ? asked : defaultLimit, maxLimit);`,
840
+ ``,
841
+ ` const greetings = await models!`,
842
+ ` .get("Greeting")`,
843
+ ` .find()`,
844
+ ` .select("name message timesUsed -_id")`,
845
+ ` .limit(limit)`,
846
+ ` .lean();`,
847
+ ``,
848
+ ` res.json({ count: greetings.length, limit, greetings });`,
849
+ ` });`,
850
+ ``,
851
+ ` router.post(\`\${base}/greetings/:name/use\`, async (req, res) => {`,
852
+ ` const { name } = req.params;`,
853
+ ` const greeting = await models!.get("Greeting").findOne({ name }).lean();`,
854
+ ` if (!greeting) throw new HttpError(404, \`no greeting named "\${name}"\`);`,
855
+ ``,
856
+ ` // Slow or retryable work belongs in a job, not in the request.`,
857
+ ` // Run \`yarn worker\` in another terminal to see it processed.`,
858
+ ` await queues!.add("hello.count-greeting", "count", { name });`,
859
+ ` res.status(202).json({ name, queued: true });`,
860
+ ` });`,
861
+ ``,
862
+ ` return router;`,
863
+ `}`,
864
+ ``,
865
+ ].join("\n")]);
892
866
  files.push(["README.md", [
893
867
  `# ${name}`,
894
868
  ``,
@@ -899,22 +873,12 @@ function renderProject(name, coreVersion, full) {
899
873
  "```sh",
900
874
  `corepack enable # once per machine — activates the pinned yarn 4`,
901
875
  `yarn install`,
902
- `yarn dev # boot the web process → http://localhost:3000/hello`,
876
+ `yarn dev # boot the backend process → http://localhost:3000/hello`,
903
877
  "```",
904
878
  ``,
905
- ...(full
906
- ? [
907
- `Needs mongo and redis running — see \`MONGO_URI\` and \`REDIS_URL\``,
908
- `in \`.envs/.env.development\`. Run \`yarn worker\` in a second`,
909
- `terminal to consume queued jobs.`,
910
- ]
911
- : [
912
- `Boots with no database and no redis: the pipeline skips engines no`,
913
- `module asks for. When your first model lands, declare \`MONGO_URI\``,
914
- `(type \`url\`, required) in \`modules/core/meta.variables.json\` and`,
915
- `set it in \`.envs/.env.development\`; same with \`REDIS_URL\` for`,
916
- `queues. \`tulipes init --full\` scaffolds all of that up front.`,
917
- ]),
879
+ `Needs mongo and redis running — see \`MONGO_URI\` and \`REDIS_URL\` in`,
880
+ `\`.envs/.env.development\`. Run \`yarn worker\` in a second terminal to`,
881
+ `consume queued jobs.`,
918
882
  ``,
919
883
  `## The hello module`,
920
884
  ``,
@@ -930,23 +894,20 @@ function renderProject(name, coreVersion, full) {
930
894
  `| \`controllers/\` | the work; imported by routes, never scanned |`,
931
895
  `| \`helpers/\` | pure logic, no framework |`,
932
896
  `| \`sockets/*.sockets.ts\` | a claimed Socket.IO namespace |`,
933
- ...(full
934
- ? [
935
- `| \`models/*.model.ts\` | a schema declaration for the model store |`,
936
- `| \`bootstrap/*.bootstrap.ts\` | idempotent seeding, before traffic |`,
937
- `| \`queues/*.queues.ts\` | a job definition and its processor |`,
938
- ]
939
- : []),
897
+ `| \`models/*.model.ts\` | a schema declaration for the model store |`,
898
+ `| \`bootstrap/*.bootstrap.ts\` | idempotent seeding, before traffic |`,
899
+ `| \`queues/*.queues.ts\` | a job definition and its processor |`,
940
900
  ``,
941
901
  `## Daily commands`,
942
902
  ``,
943
903
  `| command | does |`,
944
904
  `|---|---|`,
945
- `| \`yarn dev\` | regenerate types, run web process under tsx watch |`,
905
+ `| \`yarn dev\` | regenerate types, run backend process under tsx watch |`,
946
906
  `| \`yarn worker\` | run the queue-consumer process (needs a queue first) |`,
947
907
  `| \`yarn sync\` | regenerate \`types/config.d.ts\` + \`.env.example\` |`,
948
908
  `| \`yarn check\` | validate env against every module contract — CI gate |`,
949
909
  `| \`yarn tulipes new module <name>\` | scaffold a module |`,
910
+ `| \`yarn tulipes update\` | upgrade the framework everywhere it is declared |`,
950
911
  ``,
951
912
  ].join("\n")]);
952
913
  return files;
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClG,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE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,mEAAmE;gBACnE,mDAAmD;gBACnD,OAAO;gBACP,EAAE;gBACF,kBAAkB;gBAClB,GAAG;gBACH,EAAE;aACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CACd,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,IAAI,CACR,CAAC,WAAW,EAAE;YACZ,KAAK,IAAI,EAAE;YACX,EAAE;YACF,uEAAuE;YACvE,EAAE;YACF,QAAQ;YACR,EAAE;YACF,OAAO;YACP,oEAAoE;YACpE,cAAc;YACd,wEAAwE;YACxE,KAAK;YACL,EAAE;YACF,GAAG,CAAC,IAAI;gBACN,CAAC,CAAC;oBACE,qEAAqE;oBACrE,gEAAgE;oBAChE,kCAAkC;iBACnC;gBACH,CAAC,CAAC;oBACE,oEAAoE;oBACpE,qEAAqE;oBACrE,sEAAsE;oBACtE,mEAAmE;oBACnE,iEAAiE;iBAClE,CAAC;YACN,EAAE;YACF,qBAAqB;YACrB,EAAE;YACF,0EAA0E;YAC1E,0BAA0B;YAC1B,EAAE;YACF,qBAAqB;YACrB,WAAW;YACX,iEAAiE;YACjE,gFAAgF;YAChF,0DAA0D;YAC1D,mEAAmE;YACnE,oEAAoE;YACpE,6CAA6C;YAC7C,8DAA8D;YAC9D,GAAG,CAAC,IAAI;gBACN,CAAC,CAAC;oBACE,sEAAsE;oBACtE,uEAAuE;oBACvE,iEAAiE;iBAClE;gBACH,CAAC,CAAC,EAAE,CAAC;YACP,EAAE;YACF,mBAAmB;YACnB,EAAE;YACF,oBAAoB;YACpB,WAAW;YACX,sEAAsE;YACtE,4EAA4E;YAC5E,yEAAyE;YACzE,2EAA2E;YAC3E,4DAA4D;YAC5D,EAAE;SACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CACd,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAA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E;YACzE,2EAA2E;YAC3E,4DAA4D;YAC5D,+EAA+E;YAC/E,EAAE;SACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CACd,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC"}
package/dist/cli/main.js CHANGED
@@ -3,34 +3,36 @@ import { runSync } from "./sync.js";
3
3
  import { runEnvCheck } from "./env-check.js";
4
4
  import { runNewModule } from "./new-module.js";
5
5
  import { runDev } from "./dev.js";
6
+ import { runUpdate } from "./update.js";
7
+ import { coreVersion } from "./package-info.js";
6
8
  /**
7
- * The `tulipes` CLI. Deliberately dependency-free argument handling — four
8
- * commands don't justify a parser library.
9
+ * The `tulipes` CLI. Deliberately dependency-free argument handling — a
10
+ * handful of commands don't justify a parser library.
9
11
  * All commands operate on the app in the current working directory.
10
12
  */
11
13
  const HELP = `tulipes — module-based express framework
12
14
 
13
15
  Usage:
14
- tulipes init [dir] scaffold a new application (boots with zero infrastructure)
15
- tulipes init [dir] --full ...and the contracts needing mongo + redis (models, queues)
16
+ tulipes init [dir] scaffold a new application (needs mongo + redis)
17
+ tulipes dev [entry] run with tsx in watch mode (default entry: app.ts), sync first
16
18
  tulipes sync regenerate types/config.d.ts and .env.example
17
19
  tulipes env:check validate env against every meta.variables.json (CI-friendly)
18
20
  tulipes new module <name> scaffold a module under ./modules
19
- tulipes dev [entry] run with tsx in watch mode (default entry: app.ts), sync first
21
+ tulipes update upgrade @tulipes/core to the latest release, everywhere
22
+ tulipes -v print the installed core version
20
23
  `;
21
24
  export async function main(argv) {
22
25
  const [command, ...rest] = argv;
23
26
  const rootDir = process.cwd();
24
27
  switch (command) {
25
- case "init": {
26
- const full = rest.includes("--full");
27
- const target = rest.find((arg) => !arg.startsWith("-"));
28
- return runInit(rootDir, target, { full });
29
- }
28
+ case "init":
29
+ return runInit(rootDir, rest[0]);
30
30
  case "sync":
31
31
  return runSync(rootDir);
32
32
  case "env:check":
33
33
  return runEnvCheck(rootDir);
34
+ case "update":
35
+ return runUpdate(rootDir);
34
36
  case "new":
35
37
  if (rest[0] !== "module" || !rest[1]) {
36
38
  console.error('Usage: tulipes new module <name>');
@@ -40,6 +42,11 @@ export async function main(argv) {
40
42
  return runNewModule(rootDir, rest[1]);
41
43
  case "dev":
42
44
  return runDev(rootDir, rest[0] ?? "app.ts");
45
+ case "-v":
46
+ case "--version":
47
+ case "version":
48
+ console.log(coreVersion());
49
+ return;
43
50
  case undefined:
44
51
  case "help":
45
52
  case "--help":
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;;GAIG;AACH,MAAM,IAAI,GAAG;;;;;;;;;CASZ,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,IAAuB;IAChD,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAChC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAE9B,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACrC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;YACxD,OAAO,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5C,CAAC;QACD,KAAK,MAAM;YACT,OAA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CAAC;YACzD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACzB,CAAC;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The installed core's own package root. Resolved relative to this file —
3
+ * src/cli and dist/cli both sit two levels below it — because the exports
4
+ * map deliberately does not expose package.json.
5
+ */
6
+ export declare function packageRoot(): string;
7
+ /** Version of the @tulipes/core running this CLI. */
8
+ export declare function coreVersion(): string;
@@ -0,0 +1,17 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { dirname, join } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ /**
5
+ * The installed core's own package root. Resolved relative to this file —
6
+ * src/cli and dist/cli both sit two levels below it — because the exports
7
+ * map deliberately does not expose package.json.
8
+ */
9
+ export function packageRoot() {
10
+ return join(dirname(fileURLToPath(import.meta.url)), "..", "..");
11
+ }
12
+ /** Version of the @tulipes/core running this CLI. */
13
+ export function coreVersion() {
14
+ const pkg = JSON.parse(readFileSync(join(packageRoot(), "package.json"), "utf8"));
15
+ return pkg.version;
16
+ }
17
+ //# sourceMappingURL=package-info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-info.js","sourceRoot":"","sources":["../../src/cli/package-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;GAIG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACnE,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,WAAW;IACzB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAE/E,CAAC;IACF,OAAO,GAAG,CAAC,OAAO,CAAC;AACrB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * `tulipes update` — move the app to the latest published core.
3
+ *
4
+ * The framework is depended on in more than one place: the app root and
5
+ * every module, since modules are workspace packages that declare their
6
+ * own dependencies. Bumping them by hand is the tedium this removes —
7
+ * and a module left behind on an older range is exactly the kind of
8
+ * split-version install that produces baffling type errors.
9
+ */
10
+ export declare function runUpdate(rootDir: string): Promise<void>;
@@ -0,0 +1,143 @@
1
+ import { spawn } from "node:child_process";
2
+ import { existsSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
3
+ import { join, relative } from "node:path";
4
+ import { coreVersion } from "./package-info.js";
5
+ const PACKAGE = "@tulipes/core";
6
+ const REGISTRY = "https://registry.npmjs.org";
7
+ /**
8
+ * `tulipes update` — move the app to the latest published core.
9
+ *
10
+ * The framework is depended on in more than one place: the app root and
11
+ * every module, since modules are workspace packages that declare their
12
+ * own dependencies. Bumping them by hand is the tedium this removes —
13
+ * and a module left behind on an older range is exactly the kind of
14
+ * split-version install that produces baffling type errors.
15
+ */
16
+ export async function runUpdate(rootDir) {
17
+ const current = coreVersion();
18
+ let latest;
19
+ try {
20
+ latest = await fetchLatest();
21
+ }
22
+ catch (error) {
23
+ console.error(`could not reach the npm registry: ${error.message}`);
24
+ process.exitCode = 1;
25
+ return;
26
+ }
27
+ const manifests = findManifests(rootDir);
28
+ if (manifests.length === 0) {
29
+ console.error(`no package.json in ${rootDir} depends on ${PACKAGE} — run this from an app root`);
30
+ process.exitCode = 1;
31
+ return;
32
+ }
33
+ const range = `^${latest}`;
34
+ const changed = manifests.filter(({ path }) => rewrite(path, range));
35
+ if (changed.length === 0) {
36
+ console.log(`already on ${PACKAGE}@${range} (installed ${current}, latest ${latest})`);
37
+ return;
38
+ }
39
+ for (const { path } of changed) {
40
+ console.log(` update ${relative(rootDir, path) || "package.json"} → ${range}`);
41
+ }
42
+ console.log(`\n${PACKAGE}: ${current} → ${latest}\n`);
43
+ await install(rootDir);
44
+ }
45
+ async function fetchLatest() {
46
+ // The scoped name has to be encoded for the registry's document route.
47
+ const response = await fetch(`${REGISTRY}/${PACKAGE.replace("/", "%2f")}/latest`);
48
+ if (!response.ok) {
49
+ throw new Error(`registry responded ${response.status}`);
50
+ }
51
+ const body = (await response.json());
52
+ if (typeof body.version !== "string") {
53
+ throw new Error("registry returned no version");
54
+ }
55
+ return body.version;
56
+ }
57
+ /** The app root plus every module — anywhere the framework is depended on. */
58
+ function findManifests(rootDir) {
59
+ const candidates = [join(rootDir, "package.json")];
60
+ const modulesDir = join(rootDir, "modules");
61
+ try {
62
+ for (const entry of readdirSync(modulesDir, { withFileTypes: true })) {
63
+ if (entry.isDirectory()) {
64
+ candidates.push(join(modulesDir, entry.name, "package.json"));
65
+ }
66
+ }
67
+ }
68
+ catch {
69
+ // No modules directory: still a valid target if the root depends on core.
70
+ }
71
+ return candidates
72
+ .filter((path) => existsSync(path) && dependsOnCore(path))
73
+ .map((path) => ({ path }));
74
+ }
75
+ function dependsOnCore(path) {
76
+ try {
77
+ const manifest = JSON.parse(readFileSync(path, "utf8"));
78
+ return Boolean(manifest.dependencies?.[PACKAGE] ?? manifest.devDependencies?.[PACKAGE]);
79
+ }
80
+ catch {
81
+ return false;
82
+ }
83
+ }
84
+ /** Returns true when the file actually changed. */
85
+ function rewrite(path, range) {
86
+ const raw = readFileSync(path, "utf8");
87
+ const manifest = JSON.parse(raw);
88
+ let touched = false;
89
+ for (const field of ["dependencies", "devDependencies"]) {
90
+ const deps = manifest[field];
91
+ if (deps?.[PACKAGE] !== undefined && deps[PACKAGE] !== range) {
92
+ deps[PACKAGE] = range;
93
+ touched = true;
94
+ }
95
+ }
96
+ if (!touched)
97
+ return false;
98
+ writeFileSync(path, JSON.stringify(manifest, null, 2) + "\n");
99
+ return true;
100
+ }
101
+ /**
102
+ * Rewriting manifests without installing would leave the app claiming a
103
+ * version it does not have, so the install is part of the command rather
104
+ * than a step to remember.
105
+ */
106
+ async function install(rootDir) {
107
+ const manager = detectManager(rootDir);
108
+ console.log(`running ${manager} install…\n`);
109
+ const code = await new Promise((resolve) => {
110
+ const child = spawn(manager, ["install"], { cwd: rootDir, stdio: "inherit" });
111
+ child.on("error", () => resolve(-1));
112
+ child.on("exit", (status) => resolve(status ?? 1));
113
+ });
114
+ if (code === -1) {
115
+ console.error(`\ncould not run "${manager}" — manifests are updated, install manually`);
116
+ process.exitCode = 1;
117
+ }
118
+ else if (code !== 0) {
119
+ process.exitCode = code;
120
+ }
121
+ }
122
+ function detectManager(rootDir) {
123
+ if (existsSync(join(rootDir, "yarn.lock")))
124
+ return "yarn";
125
+ if (existsSync(join(rootDir, "pnpm-lock.yaml")))
126
+ return "pnpm";
127
+ if (existsSync(join(rootDir, "package-lock.json")))
128
+ return "npm";
129
+ // No lockfile yet (a fresh scaffold): fall back to the pinned manager.
130
+ try {
131
+ const manifest = JSON.parse(readFileSync(join(rootDir, "package.json"), "utf8"));
132
+ const pinned = manifest.packageManager ?? "";
133
+ if (pinned.startsWith("pnpm"))
134
+ return "pnpm";
135
+ if (pinned.startsWith("npm"))
136
+ return "npm";
137
+ }
138
+ catch {
139
+ // fall through
140
+ }
141
+ return "yarn";
142
+ }
143
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/cli/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,GAAG,eAAe,CAAC;AAChC,MAAM,QAAQ,GAAG,4BAA4B,CAAC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,CAAC;QAAE,OAAO,KAAK,CAAC;IAEjE,uEAAuE;IACvE,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CACzB,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CACxC,CAAC;QACd,MAAM,MAAM,GAAG,QAAQ,CAAC,cAAc,IAAI,EAAE,CAAC;QAC7C,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC;YAAE,OAAO,MAAM,CAAC;QAC7C,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,eAAe;IACjB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -5,7 +5,7 @@ import { BootReport } from "../errors/boot-error.js";
5
5
  * run in BOTH modes — definitions and processors are always registered — and
6
6
  * the mode decides what happens with them:
7
7
  *
8
- * web → queues produce; processors are registered but never started
8
+ * backend → queues produce; processors are registered but never started
9
9
  * worker → `startWorkers()` turns every registered processor into a
10
10
  * consuming BullMQ Worker
11
11
  *
@@ -6,7 +6,7 @@ import { BootReport } from "../errors/boot-error.js";
6
6
  * run in BOTH modes — definitions and processors are always registered — and
7
7
  * the mode decides what happens with them:
8
8
  *
9
- * web → queues produce; processors are registered but never started
9
+ * backend → queues produce; processors are registered but never started
10
10
  * worker → `startWorkers()` turns every registered processor into a
11
11
  * consuming BullMQ Worker
12
12
  *
@@ -3,10 +3,10 @@ import { BootReport } from "../errors/boot-error.js";
3
3
  import type { Ctx } from "../boot/contracts.js";
4
4
  import type { ModuleFiles } from "../modules/explorer.js";
5
5
  import { SocketManager, type SocketRegistry } from "./socket-manager.js";
6
- /** Default export of `sockets/*.sockets.ts` (web branch only). */
6
+ /** Default export of `sockets/*.sockets.ts` (backend branch only). */
7
7
  export type SocketsFn = (ctx: Ctx, sockets: SocketRegistry) => void | Promise<void>;
8
8
  /**
9
- * Phase 11w: attach Socket.IO to the http server and run every
9
+ * Phase 11b: attach Socket.IO to the http server and run every
10
10
  * `*.sockets.ts` in load order. No socket files → no Socket.IO server at
11
11
  * all; websockets are opt-in per app, not a standing cost.
12
12
  */
@@ -2,7 +2,7 @@ import { BootReport } from "../errors/boot-error.js";
2
2
  import { importFile } from "../boot/import-file.js";
3
3
  import { SocketManager } from "./socket-manager.js";
4
4
  /**
5
- * Phase 11w: attach Socket.IO to the http server and run every
5
+ * Phase 11b: attach Socket.IO to the http server and run every
6
6
  * `*.sockets.ts` in load order. No socket files → no Socket.IO server at
7
7
  * all; websockets are opt-in per app, not a standing cost.
8
8
  */
@@ -2,7 +2,7 @@ import type { Server as HttpServer } from "node:http";
2
2
  import { Server, type Namespace, type ServerOptions } from "socket.io";
3
3
  import { BootReport } from "../errors/boot-error.js";
4
4
  /**
5
- * Wraps the process-wide Socket.IO server (web branch only, phase 11w).
5
+ * Wraps the process-wide Socket.IO server (backend branch only, phase 11b).
6
6
  *
7
7
  * Namespaces are the socket-side equivalent of route prefixes, and get the
8
8
  * same ownership rule as everything else in Tulipes: a module claims its
@@ -1,7 +1,7 @@
1
1
  import { Server } from "socket.io";
2
2
  import { BootReport } from "../errors/boot-error.js";
3
3
  /**
4
- * Wraps the process-wide Socket.IO server (web branch only, phase 11w).
4
+ * Wraps the process-wide Socket.IO server (backend branch only, phase 11b).
5
5
  *
6
6
  * Namespaces are the socket-side equivalent of route prefixes, and get the
7
7
  * same ownership rule as everything else in Tulipes: a module claims its
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tulipes/core",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Module-based Express framework: convention-driven boot pipeline, env contracts, ACL, queues, sockets and CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -56,12 +56,13 @@ queues → routes. If code needs something another module provides, declare
56
56
 
57
57
  | Command | Use |
58
58
  |---|---|
59
- | `yarn dev` | run the web process (regenerates types first) |
59
+ | `yarn dev` | run the backend process (regenerates types first) |
60
60
  | `yarn worker` | run the queue-consumer process |
61
61
  | `yarn sync` | regenerate `types/config.d.ts` + `.env.example` |
62
62
  | `yarn check` | validate the environment without booting |
63
63
  | `yarn typecheck` | typecheck the whole app |
64
64
  | `yarn tulipes new module <name>` | scaffold a module |
65
+ | `yarn tulipes update` | upgrade the framework in the root and every module |
65
66
 
66
67
  ## Verifying your work
67
68
 
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: tulipes-queue
3
- description: Use when adding background work to a Tulipes app — emails, webhooks, exports, scheduled retries — or when a request handler is doing something slow. Covers the queues contract, producing jobs, and the web/worker process split.
3
+ description: Use when adding background work to a Tulipes app — emails, webhooks, exports, scheduled retries — or when a request handler is doing something slow. Covers the queues contract, producing jobs, and the backend/worker process split.
4
4
  ---
5
5
 
6
6
  # Adding a background job
7
7
 
8
8
  One file declares both sides of a queue, and the process mode decides what
9
- happens with it: the **web** process registers the queue so routes can
9
+ happens with it: the **backend** process registers the queue so routes can
10
10
  produce into it; the **worker** process turns the processor into a live
11
11
  consumer. Never duplicate the definition.
12
12
 
@@ -27,7 +27,7 @@ export default function billingSockets({ config }: Ctx, sockets: SocketRegistry)
27
27
  ```
28
28
 
29
29
  Emit from anywhere with the context — a route, a bootstrap task, a queue
30
- processor in the web process:
30
+ processor in the backend process:
31
31
 
32
32
  ```ts
33
33
  ctx.sockets!.of("/billing").to(`invoice:${id}`).emit("invoice:paid", payload);
@@ -40,16 +40,16 @@ ctx.sockets!.of("/billing").to(`invoice:${id}`).emit("invoice:paid", payload);
40
40
  - `sockets.of()` throws on a namespace nobody claimed. Socket.IO's raw
41
41
  `io.of()` would silently create it and emit into the void — use the
42
42
  framework accessor so typos surface.
43
- - Sockets exist in **web mode only**. `ctx.sockets` is undefined in the
43
+ - Sockets exist in **backend mode only**. `ctx.sockets` is undefined in the
44
44
  worker process, so a queue processor cannot emit directly — publish to
45
- Redis, or have the web process subscribe.
45
+ Redis, or have the backend process subscribe.
46
46
  - Namespace names are lowercase kebab-case with a leading slash.
47
47
 
48
48
  ## Gotchas
49
49
 
50
50
  - Authenticate in namespace middleware (`nsp.use(...)`), not per event —
51
51
  the framework's HTTP pipeline does not run for socket connections.
52
- - Scaling past one web process needs the Socket.IO Redis adapter;
52
+ - Scaling past one backend process needs the Socket.IO Redis adapter;
53
53
  otherwise an emit only reaches clients connected to that instance.
54
54
  - Socket handlers run outside the request pipeline: no `HttpError`, no
55
55
  request logging. Handle failures explicitly and emit an error event.