@seip/blue-bird 0.9.8 → 1.0.0
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/AGENTS.md +1 -1
- package/README.md +1 -1
- package/core/app.js +12 -11
- package/core/cli/docker.js +5 -5
- package/core/config.js +4 -2
- package/docker/docker-compose.mysql.yml +0 -3
- package/docker/docker-compose.none.yml +0 -3
- package/docker/docker-compose.postgres.yml +0 -3
- package/docker-compose.yml +0 -3
- package/package.json +2 -2
package/AGENTS.md
CHANGED
|
@@ -117,7 +117,7 @@ Production deployments always use Docker for orchestration, running:
|
|
|
117
117
|
|
|
118
118
|
```bash
|
|
119
119
|
# Manage containers using blue-bird CLI
|
|
120
|
-
npx blue-bird docker dev # Starts development
|
|
120
|
+
npx blue-bird docker dev # Starts development database & redis containers. Run npm run dev manually.
|
|
121
121
|
npx blue-bird docker start # Starts production app stack (DB, redis, app, nginx)
|
|
122
122
|
npx blue-bird docker start db # Starts configured database container only (postgres or mysql)
|
|
123
123
|
npx blue-bird docker start redis # Starts Redis container only
|
package/README.md
CHANGED
|
@@ -385,7 +385,7 @@ npx blue-bird docker <command> [options]
|
|
|
385
385
|
|
|
386
386
|
### Supported Actions:
|
|
387
387
|
|
|
388
|
-
- **`npx blue-bird docker dev`**: Boots the development
|
|
388
|
+
- **`npx blue-bird docker dev`**: Boots the development database and Redis containers. Run `npm run dev` locally on your host machine.
|
|
389
389
|
- **`npx blue-bird docker start`**: Boots the production stack (Node.js App + Nginx + Database + Redis).
|
|
390
390
|
- **`npx blue-bird docker start db`** (or `postgres` / `mysql`): Boots the configured database container only (great for local development outside Docker).
|
|
391
391
|
- **`npx blue-bird docker start redis`**: Boots the Redis container only.
|
package/core/app.js
CHANGED
|
@@ -157,15 +157,16 @@ class App {
|
|
|
157
157
|
next();
|
|
158
158
|
});
|
|
159
159
|
|
|
160
|
-
if (this.static.path)
|
|
160
|
+
if (this.static.path || props.debug)
|
|
161
161
|
this.app.use(
|
|
162
|
-
express.static(path.join(__dirname, this.static.path), {
|
|
162
|
+
express.static(path.join(__dirname, this.static.path || "frontend"), {
|
|
163
|
+
extensions: ["html"],
|
|
163
164
|
...this.static.options,
|
|
164
165
|
setHeaders: (res) => {
|
|
165
166
|
res.setHeader("X-Powered-By", "Blue Bird");
|
|
166
167
|
res.setHeader(
|
|
167
168
|
"Cache-Control",
|
|
168
|
-
"public, max-age=31536000, immutable",
|
|
169
|
+
props.debug ? "no-cache" : "public, max-age=31536000, immutable",
|
|
169
170
|
);
|
|
170
171
|
},
|
|
171
172
|
}),
|
|
@@ -336,14 +337,14 @@ class App {
|
|
|
336
337
|
this.server.listen(this.port, () => {
|
|
337
338
|
console.log(
|
|
338
339
|
chalk.bold.blue("Blue Bird Server Online\n") +
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
340
|
+
chalk.bold.cyan("App URL: ") +
|
|
341
|
+
chalk.green(`${this.appUrl}`) +
|
|
342
|
+
"\n" +
|
|
343
|
+
chalk.bold.cyan("Internal: ") +
|
|
344
|
+
chalk.green(`${this.host}:${this.port}`) +
|
|
345
|
+
"\n" +
|
|
346
|
+
(props.debug ? chalk.bold.magenta("Hot Reload: enabled\n") : "") +
|
|
347
|
+
chalk.gray("────────────────────────────────"),
|
|
347
348
|
);
|
|
348
349
|
});
|
|
349
350
|
})
|
package/core/cli/docker.js
CHANGED
|
@@ -148,20 +148,20 @@ async function startCommand(service) {
|
|
|
148
148
|
async function devCommand() {
|
|
149
149
|
checkComposeFile();
|
|
150
150
|
const dbType = getDbType();
|
|
151
|
-
console.log(chalk.cyan("Starting development
|
|
151
|
+
console.log(chalk.cyan("Starting development environment (Database + Redis)..."));
|
|
152
152
|
|
|
153
|
-
const containers = ["redis"
|
|
153
|
+
const containers = ["redis"];
|
|
154
154
|
if (dbType !== "none") {
|
|
155
155
|
containers.unshift(dbType);
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
const code = await runCmd("docker", ["compose", "up", "-d", ...containers]);
|
|
159
159
|
if (code === 0) {
|
|
160
|
-
console.log(chalk.green("Development
|
|
161
|
-
console.log(chalk.cyan("View live logs with: npx blue-bird docker logs"));
|
|
160
|
+
console.log(chalk.green("Development containers started."));
|
|
161
|
+
console.log(chalk.cyan("View live logs with: npx blue-bird docker logs db"));
|
|
162
162
|
console.log(chalk.yellow("Now execute: npm run dev"));
|
|
163
163
|
} else {
|
|
164
|
-
console.error(chalk.red("Error starting development
|
|
164
|
+
console.error(chalk.red("Error starting development environment."));
|
|
165
165
|
process.exit(1);
|
|
166
166
|
}
|
|
167
167
|
}
|
package/core/config.js
CHANGED
|
@@ -42,8 +42,10 @@ class Config {
|
|
|
42
42
|
port: Number.isNaN(portRaw) ? 3000 : portRaw,
|
|
43
43
|
jwtSecret: process.env.JWT_SECRET,
|
|
44
44
|
static: {
|
|
45
|
-
path: process.env.STATIC_PATH || "frontend
|
|
46
|
-
options: {
|
|
45
|
+
path: process.env.STATIC_PATH || "frontend",
|
|
46
|
+
options: {
|
|
47
|
+
extensions: ["html"],
|
|
48
|
+
},
|
|
47
49
|
},
|
|
48
50
|
};
|
|
49
51
|
return _cachedProps;
|
package/docker-compose.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seip/blue-bird",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Express opinionated API framework with built-in JWT auth, validation, and caching",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "core/index.d.ts",
|
|
@@ -63,4 +63,4 @@
|
|
|
63
63
|
"ws": "^8.18.0",
|
|
64
64
|
"xss": "^1.0.15"
|
|
65
65
|
}
|
|
66
|
-
}
|
|
66
|
+
}
|