@constela/start 1.2.29 → 1.3.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/dist/{chunk-HMNS6TTL.js → chunk-2P567CIH.js} +11 -1
- package/dist/cli/index.js +18 -3
- package/dist/index.d.ts +17 -1
- package/dist/index.js +3 -1
- package/package.json +4 -4
|
@@ -3049,6 +3049,15 @@ async function resolveConfig(fileConfig, cliOptions) {
|
|
|
3049
3049
|
return result;
|
|
3050
3050
|
}
|
|
3051
3051
|
|
|
3052
|
+
// src/utils/terminal.ts
|
|
3053
|
+
function hyperlink(url, text) {
|
|
3054
|
+
const displayText = text ?? url;
|
|
3055
|
+
if (process.env["NO_COLOR"]) {
|
|
3056
|
+
return displayText;
|
|
3057
|
+
}
|
|
3058
|
+
return `\x1B]8;;${url}\x1B\\${displayText}\x1B]8;;\x1B\\`;
|
|
3059
|
+
}
|
|
3060
|
+
|
|
3052
3061
|
export {
|
|
3053
3062
|
filePathToPattern,
|
|
3054
3063
|
scanRoutes,
|
|
@@ -3073,5 +3082,6 @@ export {
|
|
|
3073
3082
|
createDevServer,
|
|
3074
3083
|
build2 as build,
|
|
3075
3084
|
loadConfig,
|
|
3076
|
-
resolveConfig
|
|
3085
|
+
resolveConfig,
|
|
3086
|
+
hyperlink
|
|
3077
3087
|
};
|
package/dist/cli/index.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
build,
|
|
3
3
|
createDevServer,
|
|
4
|
+
hyperlink,
|
|
4
5
|
loadConfig,
|
|
5
6
|
resolveConfig
|
|
6
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-2P567CIH.js";
|
|
7
8
|
import "../chunk-CYMS3K6V.js";
|
|
8
9
|
|
|
9
10
|
// src/cli/index.ts
|
|
10
11
|
import { Command } from "commander";
|
|
11
12
|
var devHandler = async (options) => {
|
|
13
|
+
const startTime = performance.now();
|
|
12
14
|
const port = parseInt(options.port, 10);
|
|
13
15
|
const host = options.host ?? "localhost";
|
|
14
16
|
const server = await createDevServer({
|
|
@@ -18,7 +20,13 @@ var devHandler = async (options) => {
|
|
|
18
20
|
...options.layoutsDir ? { layoutsDir: options.layoutsDir } : {}
|
|
19
21
|
});
|
|
20
22
|
await server.listen();
|
|
21
|
-
|
|
23
|
+
const elapsed = Math.round(performance.now() - startTime);
|
|
24
|
+
const url = `http://${host}:${server.port}`;
|
|
25
|
+
console.log(`
|
|
26
|
+
Constela Dev Server
|
|
27
|
+
- Local: ${hyperlink(url)}
|
|
28
|
+
|
|
29
|
+
Ready in ${elapsed}ms (Ctrl+Click to open)`);
|
|
22
30
|
process.on("SIGINT", async () => {
|
|
23
31
|
console.log("\nShutting down server...");
|
|
24
32
|
await server.close();
|
|
@@ -37,6 +45,7 @@ var buildHandler = async (options) => {
|
|
|
37
45
|
console.log("Build complete");
|
|
38
46
|
};
|
|
39
47
|
var startHandler = async (options) => {
|
|
48
|
+
const startTime = performance.now();
|
|
40
49
|
const port = parseInt(options.port, 10);
|
|
41
50
|
const host = options.host ?? "0.0.0.0";
|
|
42
51
|
const server = await createDevServer({
|
|
@@ -46,7 +55,13 @@ var startHandler = async (options) => {
|
|
|
46
55
|
...options.layoutsDir ? { layoutsDir: options.layoutsDir } : {}
|
|
47
56
|
});
|
|
48
57
|
await server.listen();
|
|
49
|
-
|
|
58
|
+
const elapsed = Math.round(performance.now() - startTime);
|
|
59
|
+
const url = `http://${host}:${server.port}`;
|
|
60
|
+
console.log(`
|
|
61
|
+
Constela Production Server
|
|
62
|
+
- Local: ${hyperlink(url)}
|
|
63
|
+
|
|
64
|
+
Ready in ${elapsed}ms (Ctrl+Click to open)`);
|
|
50
65
|
process.on("SIGINT", async () => {
|
|
51
66
|
console.log("\nShutting down server...");
|
|
52
67
|
await server.close();
|
package/dist/index.d.ts
CHANGED
|
@@ -557,4 +557,20 @@ declare function loadConfig(projectRoot: string): Promise<ConstelaConfigFile>;
|
|
|
557
557
|
*/
|
|
558
558
|
declare function resolveConfig(fileConfig: ConstelaConfigFile, cliOptions?: CLIOptions): Promise<ConstelaConfigFile>;
|
|
559
559
|
|
|
560
|
-
|
|
560
|
+
/**
|
|
561
|
+
* Terminal utility functions for ANSI escape sequences.
|
|
562
|
+
*/
|
|
563
|
+
/**
|
|
564
|
+
* Generate an OSC 8 hyperlink escape sequence for terminal output.
|
|
565
|
+
*
|
|
566
|
+
* OSC 8 format: \x1b]8;;URL\x1b\TEXT\x1b]8;;\x1b\
|
|
567
|
+
*
|
|
568
|
+
* Respects the NO_COLOR environment variable and returns plain text when set.
|
|
569
|
+
*
|
|
570
|
+
* @param url - The URL to link to
|
|
571
|
+
* @param text - The display text (defaults to URL if not provided)
|
|
572
|
+
* @returns The formatted OSC 8 hyperlink string, or plain text if NO_COLOR is set
|
|
573
|
+
*/
|
|
574
|
+
declare function hyperlink(url: string, text?: string): string;
|
|
575
|
+
|
|
576
|
+
export { type APIContext, type APIModule, type BuildOptions, type CLIOptions, type ComponentDef$1 as ComponentDef, type ConstelaConfig, type ConstelaConfigFile, DataLoader, type DevServerOptions, type GenerateStaticPagesOptions, type GlobResult, type LayoutInfo, LayoutResolver, type MDXToConstelaOptions, type MdxGlobResult, type Middleware, type MiddlewareContext, type MiddlewareNext, type PageExportFunction, type PageModule, type ScannedLayout, type ScannedRoute, type StaticFileResult, type StaticPath, type StaticPathEntry, type StaticPathsProvider, type StaticPathsResult, build, createAPIHandler, createAdapter, createDevServer, createMiddlewareChain, filePathToPattern, generateStaticPages, generateStaticPaths, getMimeType, hyperlink, isPageExportFunction, isPathSafe, loadApi, loadComponentDefinitions, loadConfig, loadFile, loadGlob, loadLayout, mdxContentToNode, mdxToConstela, resolveConfig, resolveLayout, resolvePageExport, resolveStaticFile, scanLayouts, scanRoutes, transformCsv, transformMdx, transformYaml };
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
filePathToPattern,
|
|
7
7
|
generateStaticPaths,
|
|
8
8
|
getMimeType,
|
|
9
|
+
hyperlink,
|
|
9
10
|
isPathSafe,
|
|
10
11
|
loadApi,
|
|
11
12
|
loadComponentDefinitions,
|
|
@@ -23,7 +24,7 @@ import {
|
|
|
23
24
|
transformCsv,
|
|
24
25
|
transformMdx,
|
|
25
26
|
transformYaml
|
|
26
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-2P567CIH.js";
|
|
27
28
|
import {
|
|
28
29
|
generateHydrationScript,
|
|
29
30
|
renderPage,
|
|
@@ -347,6 +348,7 @@ export {
|
|
|
347
348
|
generateStaticPages,
|
|
348
349
|
generateStaticPaths,
|
|
349
350
|
getMimeType,
|
|
351
|
+
hyperlink,
|
|
350
352
|
isPageExportFunction,
|
|
351
353
|
isPathSafe,
|
|
352
354
|
loadApi,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constela/start",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Meta-framework for Constela applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"@tailwindcss/postcss": "^4.0.0",
|
|
45
45
|
"tailwindcss": "^4.0.0",
|
|
46
46
|
"@constela/compiler": "0.8.0",
|
|
47
|
-
"@constela/router": "9.0.0",
|
|
48
47
|
"@constela/core": "0.8.0",
|
|
49
|
-
"@constela/
|
|
50
|
-
"@constela/runtime": "0.11.1"
|
|
48
|
+
"@constela/router": "9.0.0",
|
|
49
|
+
"@constela/runtime": "0.11.1",
|
|
50
|
+
"@constela/server": "4.1.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/mdast": "^4.0.4",
|