@aklinker1/aframe 0.4.7 → 0.4.9

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/bin/aframe.ts CHANGED
@@ -11,16 +11,18 @@ async function dev(root?: string) {
11
11
  const config = await resolveConfig(root, "serve", "development");
12
12
  const devServer = await createServer(config);
13
13
  await devServer.listen();
14
-
15
- console.log(`${GREEN}✔${RESET} Dev servers started in ${devServerTimer()}`);
16
- console.log(
17
- ` ${BOLD}${GREEN}→${RESET} ${BOLD}App${RESET} ${DIM}@${RESET} ${UNDERLINE}http://localhost:${config.appPort}${RESET}`,
18
- );
19
14
  console.log(
20
- ` ${BOLD}${GREEN}→${RESET} ${BOLD}Server Proxy${RESET} ${DIM}@${RESET} ${UNDERLINE}http://localhost:${config.appPort}/api${RESET}`,
15
+ `${BOLD}${GREEN}✓${RESET} Dev servers started in ${devServerTimer()}`,
21
16
  );
17
+ devServer.printUrls();
18
+
19
+ config.proxyPaths.forEach((path) => {
20
+ console.log(
21
+ ` ${GREEN}→${RESET} ${BOLD}Server:${RESET} ${CYAN}http://localhost${BOLD}:${config.appPort}${RESET}${CYAN}${path}${RESET}`,
22
+ );
23
+ });
22
24
  console.log(
23
- ` ${BOLD}${GREEN}→${RESET} ${BOLD}Server${RESET} ${DIM}@${RESET} ${UNDERLINE}http://localhost:${config.serverPort}${RESET}`,
25
+ ` ${GREEN}→${RESET} ${BOLD}Server:${RESET} ${CYAN}http://localhost${BOLD}:${config.serverPort}${RESET}${CYAN}${RESET}`,
24
26
  );
25
27
  }
26
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aklinker1/aframe",
3
- "version": "0.4.7",
3
+ "version": "0.4.9",
4
4
  "packageManager": "bun@1.2.5",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/config.ts CHANGED
@@ -12,6 +12,8 @@ export type UserConfig = {
12
12
  proxyPaths?: string[];
13
13
  prerenderedRoutes?: string[];
14
14
  prerenderer?: PrerendererConfig | false;
15
+ appPort?: number;
16
+ serverPort?: number;
15
17
  };
16
18
 
17
19
  export type PrerendererConfig = {
@@ -38,6 +40,7 @@ export type ResolvedConfig = {
38
40
  serverModule: string;
39
41
  serverEntry: string;
40
42
  prerenderToDir: string;
43
+ proxyPaths: string[];
41
44
  outDir: string;
42
45
  serverOutDir: string;
43
46
  appOutDir: string;
@@ -67,8 +70,6 @@ export async function resolveConfig(
67
70
  const appOutDir = join(outDir, "public");
68
71
  const serverOutDir = outDir;
69
72
  const prerenderToDir = appOutDir;
70
- const appPort = 3000;
71
- const serverPort = 3001;
72
73
 
73
74
  // Ensure required directories exist
74
75
  await mkdir(prerenderToDir, { recursive: true });
@@ -79,6 +80,9 @@ export async function resolveConfig(
79
80
  relativeConfigFile
80
81
  );
81
82
 
83
+ const appPort = userConfig.appPort || 3000;
84
+ const serverPort = userConfig.serverPort || 3001;
85
+
82
86
  let viteConfig = await vite.defineConfig((await userConfig.vite) ?? {});
83
87
  if (typeof viteConfig === "function") {
84
88
  viteConfig = await viteConfig({ command, mode });
@@ -111,7 +115,7 @@ export async function resolveConfig(
111
115
  viteConfig,
112
116
  // Overrides
113
117
  {
114
- logLevel: "warn",
118
+ // logLevel: "warn",
115
119
  configFile: false,
116
120
  root: appDir,
117
121
  publicDir,
@@ -140,6 +144,7 @@ export async function resolveConfig(
140
144
  prerenderToDir,
141
145
  appPort,
142
146
  serverPort,
147
+ proxyPaths,
143
148
 
144
149
  prerenderedRoutes: userConfig.prerenderedRoutes ?? ["/"],
145
150
  vite: viteConfig,