@spfn/core 0.1.0-alpha.11 → 0.1.0-alpha.13
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/{auto-loader-C44TcLmM.d.ts → auto-loader-Pq1wY1qz.d.ts} +2 -0
- package/dist/client/index.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +24 -4
- package/dist/index.js.map +1 -1
- package/dist/route/index.d.ts +1 -1
- package/dist/route/index.js +6 -2
- package/dist/route/index.js.map +1 -1
- package/dist/server/index.js +24 -4
- package/dist/server/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -86,6 +86,8 @@ declare class AutoRouteLoader {
|
|
|
86
86
|
* - users/index.ts → /users
|
|
87
87
|
* - users/[id].ts → /users/:id
|
|
88
88
|
* - posts/[...slug].ts → /posts/*
|
|
89
|
+
* - users/index.js → /users (production)
|
|
90
|
+
* - users/[id].js → /users/:id (production)
|
|
89
91
|
*/
|
|
90
92
|
private fileToPath;
|
|
91
93
|
/**
|
package/dist/client/index.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { AppFactory, ServerConfig, createServer, startServer } from './server/index.js';
|
|
2
|
-
export { A as AutoRouteLoader, R as RouteInfo, a as RouteStats, l as loadRoutes } from './auto-loader-
|
|
2
|
+
export { A as AutoRouteLoader, R as RouteInfo, a as RouteStats, l as loadRoutes } from './auto-loader-Pq1wY1qz.js';
|
|
3
3
|
export { b as bind } from './bind-pssq1NRT.js';
|
|
4
4
|
export { d as HttpMethod, I as InferContract, c as RouteContext, R as RouteContract, a as RouteHandler, i as isHttpMethod } from './types-SlzTr8ZO.js';
|
|
5
5
|
import { K as DatabaseError } from './postgres-errors-CY_Es8EJ.js';
|
package/dist/index.js
CHANGED
|
@@ -2684,7 +2684,9 @@ var AutoRouteLoader = class {
|
|
|
2684
2684
|
* Check if file is a valid route file
|
|
2685
2685
|
*/
|
|
2686
2686
|
isValidRouteFile(fileName) {
|
|
2687
|
-
|
|
2687
|
+
const isTypeScriptFile = fileName.endsWith(".ts") && !fileName.endsWith(".test.ts") && !fileName.endsWith(".spec.ts") && !fileName.endsWith(".d.ts") && fileName !== "contract.ts";
|
|
2688
|
+
const isJavaScriptFile = fileName.endsWith(".js") && !fileName.endsWith(".test.js") && !fileName.endsWith(".spec.js") && !fileName.endsWith(".d.js") && fileName !== "contract.js" && !fileName.endsWith(".map");
|
|
2689
|
+
return isTypeScriptFile || isJavaScriptFile;
|
|
2688
2690
|
}
|
|
2689
2691
|
/**
|
|
2690
2692
|
* Load and register a single route
|
|
@@ -2791,9 +2793,11 @@ var AutoRouteLoader = class {
|
|
|
2791
2793
|
* - users/index.ts → /users
|
|
2792
2794
|
* - users/[id].ts → /users/:id
|
|
2793
2795
|
* - posts/[...slug].ts → /posts/*
|
|
2796
|
+
* - users/index.js → /users (production)
|
|
2797
|
+
* - users/[id].js → /users/:id (production)
|
|
2794
2798
|
*/
|
|
2795
2799
|
fileToPath(filePath) {
|
|
2796
|
-
let path = filePath.replace(/\.ts$/, "");
|
|
2800
|
+
let path = filePath.replace(/\.(ts|js)$/, "");
|
|
2797
2801
|
const segments = path.split("/");
|
|
2798
2802
|
if (segments[segments.length - 1] === "index") {
|
|
2799
2803
|
segments.pop();
|
|
@@ -3206,8 +3210,24 @@ async function startServer(config2) {
|
|
|
3206
3210
|
keepAlive: `${keepAliveTimeout}ms`,
|
|
3207
3211
|
headers: `${headersTimeout}ms`
|
|
3208
3212
|
});
|
|
3209
|
-
console.log(
|
|
3210
|
-
console.log(
|
|
3213
|
+
console.log("");
|
|
3214
|
+
console.log(" \u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E");
|
|
3215
|
+
console.log(" \u2502 _____ ____ ______ _ _ \u2502");
|
|
3216
|
+
console.log(" \u2502 / ____| _ \\| ____| \\ | | \u2502");
|
|
3217
|
+
console.log(" \u2502 | (___ | |_) | |__ | \\| | \u2502");
|
|
3218
|
+
console.log(" \u2502 \\___ \\| __/| __| | . ` | \u2502");
|
|
3219
|
+
console.log(" \u2502 ____) | | | | | |\\ | \u2502");
|
|
3220
|
+
console.log(" \u2502 |_____/|_| |_| |_| \\_| \u2502");
|
|
3221
|
+
console.log(" \u2502 \u2502");
|
|
3222
|
+
console.log(` \u2502 Mode: ${(debug ? "Development" : "Production").padEnd(26)}\u2502`);
|
|
3223
|
+
console.log(" \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F");
|
|
3224
|
+
console.log("");
|
|
3225
|
+
if (host === "0.0.0.0") {
|
|
3226
|
+
console.log(` \u25B2 Local: http://localhost:${port}`);
|
|
3227
|
+
console.log(` \u25B2 Network: http://${host}:${port}`);
|
|
3228
|
+
} else {
|
|
3229
|
+
console.log(` \u25B2 Local: http://${host}:${port}`);
|
|
3230
|
+
}
|
|
3211
3231
|
console.log("");
|
|
3212
3232
|
const shutdownServer = async () => {
|
|
3213
3233
|
serverLogger.debug("Closing HTTP server...");
|