bosia 0.6.11 → 0.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bosia",
3
- "version": "0.6.11",
3
+ "version": "0.6.13",
4
4
  "type": "module",
5
5
  "description": "A fast, batteries-included fullstack framework — SSR · Svelte 5 Runes · Bun · ElysiaJS. File-based routing inspired by SvelteKit. No Node.js, no Vite, no adapters.",
6
6
  "keywords": [
package/src/cli/create.ts CHANGED
@@ -32,16 +32,24 @@ export async function runCreate(name: string | undefined, args: string[] = []) {
32
32
  process.exit(1);
33
33
  }
34
34
 
35
- // Parse --template flag
35
+ // Parse --template flag (supports `--template foo` and `--template=foo`)
36
36
  let template: string | undefined;
37
- const templateIdx = args.indexOf("--template");
38
- if (templateIdx !== -1 && args[templateIdx + 1]) {
39
- template = args[templateIdx + 1];
37
+ const templateEq = args.find((a) => a.startsWith("--template="));
38
+ if (templateEq) {
39
+ template = templateEq.slice("--template=".length);
40
+ } else {
41
+ const templateIdx = args.indexOf("--template");
42
+ if (templateIdx !== -1 && args[templateIdx + 1]) {
43
+ template = args[templateIdx + 1];
44
+ }
40
45
  }
41
46
 
42
47
  // Parse --local flag
43
48
  const isLocal = args.includes("--local");
44
49
 
50
+ // Parse --no-install flag (skip final `bun install`)
51
+ const skipInstall = args.includes("--no-install");
52
+
45
53
  // If no --template flag, prompt interactively
46
54
  if (!template) {
47
55
  template = await promptTemplate();
@@ -93,6 +101,16 @@ export async function runCreate(name: string | undefined, args: string[] = []) {
93
101
 
94
102
  console.log(`\n✅ Project created at ${targetDir}\n`);
95
103
 
104
+ if (skipInstall) {
105
+ console.log(`Skipped \`bun install\` (--no-install).\n\ncd ${name} && bun install\n`);
106
+ const instPath = join(templateDir, "instructions.txt");
107
+ if (existsSync(instPath)) {
108
+ const instructions = readFileSync(instPath, "utf-8").trimEnd();
109
+ if (instructions) console.log(instructions);
110
+ }
111
+ return;
112
+ }
113
+
96
114
  console.log("Installing dependencies...");
97
115
  const proc = spawn(["bun", "install"], {
98
116
  stdout: "inherit",
package/src/cli/index.ts CHANGED
@@ -12,8 +12,25 @@ const [, , command, ...args] = process.argv;
12
12
  async function main() {
13
13
  switch (command) {
14
14
  case "create": {
15
+ // Name is the first non-flag token; --template consumes the next arg as its value
16
+ // (also accepts --template=value form).
17
+ let name: string | undefined;
18
+ const rest: string[] = [];
19
+ for (let i = 0; i < args.length; i++) {
20
+ const a = args[i];
21
+ if (a === "--template" && args[i + 1]) {
22
+ rest.push(a, args[i + 1]);
23
+ i++;
24
+ continue;
25
+ }
26
+ if (!name && !a.startsWith("-")) {
27
+ name = a;
28
+ continue;
29
+ }
30
+ rest.push(a);
31
+ }
15
32
  const { runCreate } = await import("./create.ts");
16
- await runCreate(args[0], args.slice(1));
33
+ await runCreate(name, rest);
17
34
  break;
18
35
  }
19
36
  case "dev": {
@@ -163,7 +163,11 @@ export function inspector(options: InspectorOptions = {}): BosiaPlugin | false {
163
163
  if (process.env.NODE_ENV === "production") return false;
164
164
  const editor = options.editor ?? "code";
165
165
  const endpoint = options.endpoint ?? "/__bosia/locate";
166
- const aiEndpoint = options.aiEndpoint;
166
+ // Env override lets hosts (e.g. bosapi running the app inside a podman
167
+ // container) point inspector POSTs at an address reachable from inside
168
+ // the sandbox, since the URL baked into bosia.config.ts resolves to the
169
+ // container's own loopback there.
170
+ const aiEndpoint = process.env.BOSIA_INSPECTOR_AI_ENDPOINT?.trim() || options.aiEndpoint;
167
171
  const errorsEnabled = options.errorsEnabled !== false;
168
172
 
169
173
  return {