@gracile/engine
Advanced tools
Comparing version 0.2.0-next.4 to 0.2.0-next.5
@@ -8,3 +8,3 @@ import { join } from 'node:path'; | ||
import { createDevHandler } from './dev/dev.js'; | ||
import { nodeAdapter } from './server/node.js'; | ||
import { nodeAdapter } from './server/adapters/node.js'; | ||
import { buildRoutes } from './vite/plugins/build-routes.js'; | ||
@@ -11,0 +11,0 @@ import { virtualRoutes } from './vite/plugins/virtual-routes.js'; |
@@ -5,2 +5,3 @@ import type { IncomingMessage, Server, ServerResponse } from 'node:http'; | ||
address?: string; | ||
port?: number; | ||
}): void; | ||
@@ -23,3 +24,2 @@ export declare function notFoundHandler(req: IncomingMessage, res: ServerResponse): void; | ||
}) => boolean) => BasicAuthUser; | ||
export declare function getClientDistPath(root: string): string; | ||
//# sourceMappingURL=utils.d.ts.map |
// NOTE: Util. to pretty print for user provided server. | ||
import { fileURLToPath } from 'node:url'; | ||
// import type { AddressInfo } from 'node:net'; | ||
@@ -7,3 +6,3 @@ import { logger } from '@gracile/internal-utils/logger'; | ||
import c from 'picocolors'; | ||
import { CLIENT_DIST_DIR, IP_EXPOSED } from './env.js'; | ||
import { IP_EXPOSED } from './env.js'; | ||
export function printAddressInfos(options) { | ||
@@ -18,3 +17,3 @@ let address = null; | ||
else if (options.address) { | ||
address = options.address; | ||
address = `http://${options.address}${options.port ? `:${String(options.port)}` : ''}`; | ||
} | ||
@@ -26,9 +25,11 @@ if (!address) | ||
}); | ||
logger.info(` | ||
${c.dim('┃')} Local ${c.cyan(address.replace(/::1?/, 'localhost'))}` + | ||
`${address?.includes(IP_EXPOSED) | ||
if (address?.includes(IP_EXPOSED)) | ||
logger.info(`${address?.includes(IP_EXPOSED) | ||
? `\n${c.dim('┃')} Network ${c.cyan(address)}` | ||
: ''} | ||
`); | ||
: ''}`); | ||
else | ||
logger.info(` | ||
${c.dim('┃')} Local ${c.cyan(address.replace(/::1?/, 'localhost'))}`); | ||
} | ||
// NOTE: UNUSED (keep?) | ||
function sendHtml(res, payload) { | ||
@@ -77,4 +78,1 @@ res.setHeader('content/type', 'text/html'); | ||
}; | ||
export function getClientDistPath(root) { | ||
return fileURLToPath(new URL(CLIENT_DIST_DIR, root)); | ||
} |
{ | ||
"name": "@gracile/engine", | ||
"version": "0.2.0-next.4", | ||
"version": "0.2.0-next.5", | ||
"description": "A thin, full-stack, web framework", | ||
@@ -78,3 +78,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "79b1951fb7faf857deb5f361169fea20b7e4ef62" | ||
"gitHead": "73b565d94552da78e776b8925533f569b1886e9c" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138721
68
1821