sourcey 3.5.7 → 3.5.8

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.js CHANGED
@@ -110,6 +110,11 @@ const dev = defineCommand({
110
110
  description: "Port to listen on",
111
111
  default: "4400",
112
112
  },
113
+ host: {
114
+ type: "string",
115
+ description: "Address to bind to (e.g. 0.0.0.0 to expose externally; defaults to 127.0.0.1, or $HOST if set)",
116
+ required: false,
117
+ },
113
118
  config: {
114
119
  type: "string",
115
120
  alias: ["c"],
@@ -126,6 +131,7 @@ const dev = defineCommand({
126
131
  const { startDevServer } = await import("./dev-server.js");
127
132
  await startDevServer({
128
133
  port: parseInt(args.port, 10),
134
+ host: args.host ?? process.env.HOST,
129
135
  config: args.config,
130
136
  strictChangelog: args.strictChangelog,
131
137
  });
@@ -1,5 +1,6 @@
1
1
  export interface DevServerOptions {
2
2
  port: number;
3
+ host?: string;
3
4
  config?: string;
4
5
  strictChangelog?: boolean;
5
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dev-server.d.ts","sourceRoot":"","sources":["../src/dev-server.ts"],"names":[],"mappings":"AA+CA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAsB,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuZ7E"}
1
+ {"version":3,"file":"dev-server.d.ts","sourceRoot":"","sources":["../src/dev-server.ts"],"names":[],"mappings":"AA+CA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAsB,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyZ7E"}
@@ -37,7 +37,7 @@ function shortPath(path) {
37
37
  return relative(process.cwd(), path) || basename(path);
38
38
  }
39
39
  export async function startDevServer(options) {
40
- const { port } = options;
40
+ const { port, host } = options;
41
41
  let config = await loadConfig(options.config);
42
42
  const configPath = options.config?.endsWith(".ts")
43
43
  ? resolve(options.config)
@@ -328,6 +328,7 @@ export async function startDevServer(options) {
328
328
  root: process.cwd(),
329
329
  server: {
330
330
  port,
331
+ host,
331
332
  strictPort: true,
332
333
  hmr: true,
333
334
  fs: {
@@ -382,7 +383,8 @@ export async function startDevServer(options) {
382
383
  });
383
384
  });
384
385
  await vite.listen();
385
- console.log(`\n Sourcey dev server running at http://localhost:${port}${config.baseUrl || "/"}`);
386
+ const displayHost = !host || host === "127.0.0.1" || host === "localhost" ? "localhost" : host;
387
+ console.log(`\n Sourcey dev server running at http://${displayHost}:${port}${config.baseUrl || "/"}`);
386
388
  console.log(` Watching: ${watchPaths.length} content file${watchPaths.length === 1 ? "" : "s"} + components + CSS (HMR)`);
387
389
  console.log(` Press Ctrl+C to stop\n`);
388
390
  fullRebuild().catch((err) => {
@@ -1 +1 @@
1
- {"version":3,"file":"site-url.d.ts","sourceRoot":"","sources":["../src/site-url.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAMzD;AAED,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAoBrE;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,SAAK,EAAE,UAAU,GAAE,UAAkB,GAAG,MAAM,CAsBrG;AAED,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAK1E;AAED,wBAAgB,WAAW,CACzB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,SAAK,EACZ,UAAU,GAAE,UAAkB,GAC7B,MAAM,CAER;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,SAAK,GAAG,MAAM,CAcnE"}
1
+ {"version":3,"file":"site-url.d.ts","sourceRoot":"","sources":["../src/site-url.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAMzD;AAED,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAoBrE;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,SAAK,EAAE,UAAU,GAAE,UAAkB,GAAG,MAAM,CAyBrG;AAED,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAK1E;AAED,wBAAgB,WAAW,CACzB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,SAAK,EACZ,UAAU,GAAE,UAAkB,GAC7B,MAAM,CAER;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,SAAK,GAAG,MAAM,CAcnE"}
package/dist/site-url.js CHANGED
@@ -32,6 +32,9 @@ export function toPublicPath(outputPath, baseUrl = "", prettyUrls = false) {
32
32
  const prefix = normalizedBase || "/";
33
33
  const cleanOutputPath = outputPath.replace(/^\/+/, "");
34
34
  if (!cleanOutputPath || cleanOutputPath === "index.html") {
35
+ if (prettyUrls === "strip" && normalizedBase) {
36
+ return normalizedBase.slice(0, -1);
37
+ }
35
38
  return prefix;
36
39
  }
37
40
  if (cleanOutputPath.endsWith("/index.html")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sourcey",
3
- "version": "3.5.7",
3
+ "version": "3.5.8",
4
4
  "description": "Precision documentation from OpenAPI, MCP, Doxygen, godoc, and Markdown. Static HTML you own.",
5
5
  "type": "module",
6
6
  "engines": {