create-zenith 0.2.0 → 0.2.3

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.
@@ -0,0 +1,54 @@
1
+ # Zenith Logos
2
+
3
+ This directory contains the Zenith framework logo assets.
4
+
5
+ ## Logo Files
6
+
7
+ Based on the logo designs, you should place the following files here:
8
+
9
+ 1. **zenith-logo-icon.png** (or .svg) - The file icon version with the folded corner and ".ZENITH" button
10
+ 2. **zenith-logo-z.png** (or .svg) - The stylized "Z" logo with gradient and light trails
11
+ 3. **zenith-logo-full.png** (or .svg) - The full logo with "ZENITH" text below
12
+ 4. **zenith-logo-soon.png** (or .svg) - The logo variant with "Soon" text
13
+
14
+ ## File Icon for .zen Files
15
+
16
+ The SVG logo has been converted to a macOS `.icns` file to use as the file icon for `.zen` files.
17
+
18
+ ### Setting the Icon
19
+
20
+ **Option 1: Use the automated script (recommended)**
21
+ ```bash
22
+ cd assets/logos
23
+ ./set-zen-icon.sh path/to/your/file.zen
24
+ ```
25
+
26
+ **Option 2: Set icon for all .zen files in a directory**
27
+ ```bash
28
+ cd assets/logos
29
+ find ../app -name "*.zen" -exec ./set-zen-icon.sh {} \;
30
+ ```
31
+
32
+ **Option 3: Manual method**
33
+ 1. Open Finder and navigate to a `.zen` file
34
+ 2. Right-click the file and select "Get Info"
35
+ 3. Drag `zen.icns` onto the small icon in the top-left of the Get Info window
36
+ 4. Close the Get Info window
37
+
38
+ ### Recreating the .icns File
39
+
40
+ If you update the SVG and need to regenerate the `.icns` file:
41
+ ```bash
42
+ cd assets/logos
43
+ ./create-zen-icon.sh
44
+ ```
45
+
46
+ ## Usage
47
+
48
+ These logos can be used in:
49
+ - Documentation (`docs/`)
50
+ - README files
51
+ - Website/marketing materials
52
+ - Framework branding
53
+ - File type icons (`.zen` files)
54
+
Binary file
Binary file
Binary file
package/index.js CHANGED
@@ -9,15 +9,47 @@
9
9
  * It is a permanent proxy and should never grow features.
10
10
  */
11
11
 
12
- import { spawn } from "node:child_process";
12
+ import { spawn, spawnSync } from "node:child_process";
13
+ import { existsSync } from "node:fs";
14
+ import { dirname, join } from "node:path";
15
+ import { fileURLToPath } from "node:url";
13
16
 
17
+ const __dirname = dirname(fileURLToPath(import.meta.url));
14
18
  const args = process.argv.slice(2);
15
19
 
16
- // Always invoke "create" command with any additional arguments
17
- const child = spawn(
18
- process.platform === "win32" ? "npx.cmd" : "npx",
19
- ["@zenithbuild/cli", "create", ...args],
20
- { stdio: "inherit" }
21
- );
20
+ // Check if we're in the monorepo development context
21
+ // (zenith-cli is a sibling directory)
22
+ function getLocalCLIPath() {
23
+ const monorepoCliPath = join(__dirname, "..", "zenith-cli", "bin", "zenith");
24
+ if (existsSync(monorepoCliPath)) {
25
+ return monorepoCliPath;
26
+ }
27
+ return null;
28
+ }
22
29
 
23
- child.on("exit", (code) => process.exit(code ?? 0));
30
+ // Detect if Bun is available
31
+ function hasBun() {
32
+ try {
33
+ const result = spawnSync("bun", ["--version"], { stdio: "pipe" });
34
+ return result.status === 0;
35
+ } catch {
36
+ return false;
37
+ }
38
+ }
39
+
40
+ // Try to find the zenith CLI
41
+ const localCLI = getLocalCLIPath();
42
+
43
+ if (localCLI) {
44
+ // Development mode: use local CLI directly
45
+ const child = spawn("bun", [localCLI, "create", ...args], { stdio: "inherit" });
46
+ child.on("exit", (code) => process.exit(code ?? 0));
47
+ } else {
48
+ // Production mode: use package manager to resolve @zenithbuild/cli
49
+ const useBun = hasBun();
50
+ const runner = useBun ? "bunx" : (process.platform === "win32" ? "npx.cmd" : "npx");
51
+ const runnerArgs = ["@zenithbuild/cli", "create", ...args];
52
+
53
+ const child = spawn(runner, runnerArgs, { stdio: "inherit" });
54
+ child.on("exit", (code) => process.exit(code ?? 0));
55
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-zenith",
3
- "version": "0.2.0",
3
+ "version": "0.2.3",
4
4
  "description": "Thin resolver for bun/npm create zenith - delegates to @zenithbuild/cli",
5
5
  "bin": {
6
6
  "create-zenith": "./index.js"
@@ -19,6 +19,6 @@
19
19
  "cli"
20
20
  ],
21
21
  "dependencies": {
22
- "@zenithbuild/cli": "^0.2.0"
22
+ "@zenithbuild/cli": "github:zenithbuild/zenith-cli"
23
23
  }
24
- }
24
+ }