elm-ssr 0.6.0 → 0.6.2

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/elm-ssr.mjs CHANGED
@@ -36,7 +36,14 @@ const findWorkspaceRoot = async (startPath) => {
36
36
  };
37
37
 
38
38
  const userRoot = findFlagValue("--root");
39
- const rootPath = resolve(userRoot ?? await findWorkspaceRoot(defaultRootPath));
39
+ let rootPath;
40
+ if (userRoot) {
41
+ rootPath = resolve(userRoot);
42
+ } else if (["new", "init", "migrate", "help"].includes(command)) {
43
+ rootPath = defaultRootPath;
44
+ } else {
45
+ rootPath = resolve(await findWorkspaceRoot(defaultRootPath));
46
+ }
40
47
  const packageJsonPath = resolve(rootPath, "package.json");
41
48
 
42
49
  let packageJson = { name: "unknown" };
package/lib/scaffold.mjs CHANGED
@@ -15,13 +15,13 @@ const toPascalCase = (value) =>
15
15
 
16
16
  const ensureValidName = (name) => {
17
17
  if (!/^[a-z0-9-]+$/.test(name)) {
18
- throw new Error("Example name must use lowercase letters, numbers, and dashes only.");
18
+ throw new Error("App name must use lowercase letters, numbers, and dashes only.");
19
19
  }
20
20
  };
21
21
 
22
22
  const ensureAppMissing = (config, name) => {
23
23
  if (config.apps.some((app) => app.name === name)) {
24
- throw new Error(`Example "${name}" already exists in elm-ssr.config.json.`);
24
+ throw new Error(`App "${name}" already exists in elm-ssr.config.json. If you want to recreate it, remove its entry from elm-ssr.config.json first.`);
25
25
  }
26
26
  };
27
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elm-ssr",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Elm-first SSR library and framework for Cloudflare Workers (and Bun): file-based routes/islands, backend-neutral effect adapters (KV/D1/Redis/Postgres), background tasks (waitUntil/Queues), SQL-file migrations, CLI scaffold + build.",
5
5
  "license": "MIT",
6
6
  "author": "Michał Majchrzak <michmajchrzak@gmail.com>",