express-file-cluster 0.9.2 → 0.9.3
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/dist/cli/index.cjs +25 -23
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +76 -74
- package/dist/cli/index.js.map +1 -1
- package/dist/docs/cli/add.md +1 -1
- package/dist/docs/cli/start.md +1 -1
- package/dist/docs/guides/deployment.md +1 -1
- package/dist/docs/guides/environment-variables.md +1 -1
- package/dist/docs/index.md +1 -1
- package/dist/docs/skills/SKILL.md +1 -1
- package/dist/registry/index.json +1 -1
- package/package.json +1 -1
package/dist/docs/cli/add.md
CHANGED
package/dist/docs/cli/start.md
CHANGED
|
@@ -36,7 +36,7 @@ efc start prod
|
|
|
36
36
|
|
|
37
37
|
- Looks for `dist/src/index.js` (the `efc build prod` layout), then `dist/index.js` (a custom `tsup.config`). If neither exists, prints an error instructing you to run `efc build prod` first.
|
|
38
38
|
- Sets `NODE_ENV=production`.
|
|
39
|
-
-
|
|
39
|
+
- Loads `.env` from the working directory if present; variables already set in the environment (platform secrets) win over it.
|
|
40
40
|
- Spawns `node dist/src/index.js`.
|
|
41
41
|
- Forwards `SIGTERM`/`SIGINT` to the server so `gracefulShutdown()` runs, and exits with the server's exit code.
|
|
42
42
|
- With `NODE_ENV=production`, `ignite()` defaults `cluster` to `true` and forks `os.cpus().length` workers. When the primary receives `SIGTERM` it relays it to every worker, waits for them to drain, then exits.
|
|
@@ -23,7 +23,7 @@ npm start
|
|
|
23
23
|
# → node dist/src/index.js (NODE_ENV=production)
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
`efc start prod` sets `NODE_ENV=production` and spawns the compiled server with `node`.
|
|
26
|
+
`efc start prod` sets `NODE_ENV=production` and spawns the compiled server with `node`. If a `.env` file sits in the working directory it's loaded too, but anything already in the environment wins — so platform-injected secrets always take precedence.
|
|
27
27
|
|
|
28
28
|
Stopping is graceful at every layer: `efc start prod` forwards `SIGTERM`/`SIGINT` to the server, the cluster primary relays it to each worker, and each worker stops accepting connections, finishes in-flight requests and task jobs, then exits. This works whether the signal reaches the whole process group (Ctrl+C) or only PID 1 (`docker stop`, Kubernetes).
|
|
29
29
|
|
|
@@ -103,4 +103,4 @@ SMTP_FROM=you@example.com
|
|
|
103
103
|
|
|
104
104
|
In development (`efc start dev`), the CLI loads `.env` into `process.env` before your app runs, so `efc.config.ts`'s `process.env.X` reads see it. It re-reads `.env` fresh on every `tsx watch` restart — editing `.env` and saving a source file is enough to pick up the change, no need to stop and restart `efc start dev` itself. Variables already present in `process.env` (e.g. real OS-exported vars, CI-injected secrets) take precedence over `.env`.
|
|
105
105
|
|
|
106
|
-
In production (`efc start prod`), `.env` is
|
|
106
|
+
In production (`efc start prod`), `.env` is loaded if one exists in the working directory — handy on a plain VPS. Platforms (Docker, Kubernetes, Railway, Heroku) that inject secrets directly into `process.env` always win: the file only fills in variables that aren't already set.
|
package/dist/docs/index.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**express-file-cluster (EFC)** is an opinionated backend framework built on Express. It removes routing ceremony, saturates every CPU core automatically, and ships a production-grade background-task subsystem — all from a single `ignite()` call.
|
|
4
4
|
|
|
5
|
-
> **Status: v0.9.
|
|
5
|
+
> **Status: v0.9.3 — Beta.** File-based routing (incl. catch-all and optional segments), request validation, clustering, auth, structured logging, MongoDB and PostgreSQL models with types inferred from the schema, PostgreSQL-native `defineTable` (Prisma-style queries and relations: foreign keys, many-to-many, `include`, relation filters, nested writes), query logging, BullMQ and pg-boss tasks with cron and dead-letter tooling, migrations (written for you from model changes: `efc db generate`, plus `efc db pull` and `efc import-prisma`), and the `efc add` feature registry (auth, admin, billing… copied into your app as source you own) are all implemented.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -37,7 +37,7 @@ Load **only** the module the work points to. Each is self-contained.
|
|
|
37
37
|
docs/ ← full documentation
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
## Status (v0.9.
|
|
40
|
+
## Status (v0.9.3 — Beta, Phase 2 complete + defineTable with relations + generated migrations + `efc add` registry)
|
|
41
41
|
|
|
42
42
|
Implemented: file-based router (incl. `[[id]]`, `[...slug]`, `[[...slug]]`), request validation (`export const schema`, Standard Schema), multi-core clustering with graceful shutdown, http-only + localStorage auth (scrypt password hashing built in), structured logging (pino, request IDs), `defineModel` on MongoDB (mongoose) **and** PostgreSQL (Drizzle) with validation, query options, bulk ops, transactions, `sync()`/`drop()`, PostgreSQL-native `defineTable` (Prisma-style queries, foreign keys, many-to-many, `include`, relation filters, nested writes), MongoDB-native `defineCollection` (mongoose vocabulary, BSON types, geo/text, `bulkWrite`, change streams), query logging (`logging.queries`), BullMQ **and** pg-boss task backends with cron schedules and dead-letter CLI, worker_threads for CPU-bound tasks, migrations/seeds/studio (`efc db`) incl. migrations generated from model diffs (`efc db generate`), `efc db pull` and `efc import-prisma`, full CLI.
|
|
43
43
|
|
package/dist/registry/index.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "express-file-cluster",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "Enterprise-grade, zero-boilerplate backend framework with file-based routing and multi-core clustering",
|
|
5
5
|
"homepage": "https://efc.prashantadhikari7.com.np/",
|
|
6
6
|
"repository": {
|