create-voltapp 0.1.0 → 0.1.1

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.
@@ -77,7 +77,7 @@ const walk = (d) => readdirSync(d).flatMap((f) => (statSync(join(d, f)).isDirect
77
77
  for (const file of walk(target)) {
78
78
  if (!/\.(json|ts|tsx|html|md|css)$/.test(file)) continue;
79
79
  const text = readFileSync(file, "utf8");
80
- const next = text.replaceAll("{{name}}", name).replaceAll("{{version}}", pkg.version);
80
+ const next = text.replaceAll("{{name}}", name).replaceAll("{{version}}", pkg.frameworkVersion ?? pkg.version);
81
81
  if (next !== text) writeFileSync(file, next);
82
82
  }
83
83
 
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "create-voltapp",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
+ "frameworkVersion": "0.1.0",
4
5
  "description": "Scaffold a new Volt app: npm create voltapp@latest my-app",
5
6
  "license": "MIT",
6
7
  "type": "module",
@@ -8,7 +8,7 @@
8
8
  */
9
9
  import { createServer } from "node:http";
10
10
  import { existsSync, readFileSync } from "node:fs";
11
- import { fileURLToPath } from "node:url";
11
+ import { fileURLToPath, pathToFileURL } from "node:url";
12
12
  import { dirname, extname, join } from "node:path";
13
13
  import { createApp, logger } from "@prouzbek/server";
14
14
  import { serverFunctions } from "@prouzbek/server/fn";
@@ -31,7 +31,7 @@ if (!isProd) {
31
31
  template = readFileSync(join(here, "index.html"), "utf8");
32
32
  } else {
33
33
  template = readFileSync(join(here, "dist/client/index.html"), "utf8");
34
- renderPage = (await import(join(here, "dist/server/entry-server.js").replace(/\\/g, "/"))).render;
34
+ renderPage = (await import(pathToFileURL(join(here, "dist/server/entry-server.js")).href)).render;
35
35
  }
36
36
 
37
37
  app.get("*", async (c) => {
@@ -5,5 +5,5 @@ export default defineConfig({
5
5
  plugins: [volt()],
6
6
  appType: "custom",
7
7
  server: { middlewareMode: true },
8
- build: { manifest: true, rollupOptions: { input: "/src/entry-client.tsx" } },
8
+ build: { manifest: true },
9
9
  });