@zenithbuild/core 0.3.1 → 0.3.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.
@@ -28,8 +28,8 @@ export function findProjectRoot(startDir: string = process.cwd()): string | null
28
28
  const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))
29
29
  const deps = { ...pkg.dependencies, ...pkg.devDependencies }
30
30
 
31
- // Check for any @zenith/* dependency
32
- const hasZenith = Object.keys(deps).some(d => d.startsWith('@zenith/'))
31
+ // Check for any @zenith/* or @zenithbuild/* dependency
32
+ const hasZenith = Object.keys(deps).some(d => d.startsWith('@zenith/') || d.startsWith('@zenithbuild/'))
33
33
  if (hasZenith) {
34
34
  return current
35
35
  }
@@ -51,10 +51,16 @@ export function getProject(cwd: string = process.cwd()): ZenithProject | null {
51
51
  const root = findProjectRoot(cwd)
52
52
  if (!root) return null
53
53
 
54
+ // Support both app/ and src/ directory structures
55
+ let appDir = path.join(root, 'app')
56
+ if (!fs.existsSync(appDir)) {
57
+ appDir = path.join(root, 'src')
58
+ }
59
+
54
60
  return {
55
61
  root,
56
- pagesDir: path.join(root, 'app/pages'),
57
- distDir: path.join(root, 'app/dist'),
62
+ pagesDir: path.join(appDir, 'pages'),
63
+ distDir: path.join(appDir, 'dist'),
58
64
  hasZenithDeps: true
59
65
  }
60
66
  }
package/dist/cli.js CHANGED
@@ -2,6 +2,8 @@
2
2
  #!/usr/bin/env bun
3
3
  #!/usr/bin/env bun
4
4
  #!/usr/bin/env bun
5
+ #!/usr/bin/env bun
6
+ #!/usr/bin/env bun
5
7
  // @bun
6
8
  var __create = Object.create;
7
9
  var __getProtoOf = Object.getPrototypeOf;
package/dist/zen-build.js CHANGED
@@ -107,7 +107,7 @@ function findProjectRoot(startDir = process.cwd()) {
107
107
  try {
108
108
  const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
109
109
  const deps = { ...pkg.dependencies, ...pkg.devDependencies };
110
- const hasZenith = Object.keys(deps).some((d) => d.startsWith("@zenith/"));
110
+ const hasZenith = Object.keys(deps).some((d) => d.startsWith("@zenith/") || d.startsWith("@zenithbuild/"));
111
111
  if (hasZenith) {
112
112
  return current;
113
113
  }
@@ -121,10 +121,14 @@ function getProject(cwd = process.cwd()) {
121
121
  const root = findProjectRoot(cwd);
122
122
  if (!root)
123
123
  return null;
124
+ let appDir = path.join(root, "app");
125
+ if (!fs.existsSync(appDir)) {
126
+ appDir = path.join(root, "src");
127
+ }
124
128
  return {
125
129
  root,
126
- pagesDir: path.join(root, "app/pages"),
127
- distDir: path.join(root, "app/dist"),
130
+ pagesDir: path.join(appDir, "pages"),
131
+ distDir: path.join(appDir, "dist"),
128
132
  hasZenithDeps: true
129
133
  };
130
134
  }
package/dist/zen-dev.js CHANGED
@@ -107,7 +107,7 @@ function findProjectRoot(startDir = process.cwd()) {
107
107
  try {
108
108
  const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
109
109
  const deps = { ...pkg.dependencies, ...pkg.devDependencies };
110
- const hasZenith = Object.keys(deps).some((d) => d.startsWith("@zenith/"));
110
+ const hasZenith = Object.keys(deps).some((d) => d.startsWith("@zenith/") || d.startsWith("@zenithbuild/"));
111
111
  if (hasZenith) {
112
112
  return current;
113
113
  }
@@ -121,10 +121,14 @@ function getProject(cwd = process.cwd()) {
121
121
  const root = findProjectRoot(cwd);
122
122
  if (!root)
123
123
  return null;
124
+ let appDir = path.join(root, "app");
125
+ if (!fs.existsSync(appDir)) {
126
+ appDir = path.join(root, "src");
127
+ }
124
128
  return {
125
129
  root,
126
- pagesDir: path.join(root, "app/pages"),
127
- distDir: path.join(root, "app/dist"),
130
+ pagesDir: path.join(appDir, "pages"),
131
+ distDir: path.join(appDir, "dist"),
128
132
  hasZenithDeps: true
129
133
  };
130
134
  }
@@ -107,7 +107,7 @@ function findProjectRoot(startDir = process.cwd()) {
107
107
  try {
108
108
  const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
109
109
  const deps = { ...pkg.dependencies, ...pkg.devDependencies };
110
- const hasZenith = Object.keys(deps).some((d) => d.startsWith("@zenith/"));
110
+ const hasZenith = Object.keys(deps).some((d) => d.startsWith("@zenith/") || d.startsWith("@zenithbuild/"));
111
111
  if (hasZenith) {
112
112
  return current;
113
113
  }
@@ -121,10 +121,14 @@ function getProject(cwd = process.cwd()) {
121
121
  const root = findProjectRoot(cwd);
122
122
  if (!root)
123
123
  return null;
124
+ let appDir = path.join(root, "app");
125
+ if (!fs.existsSync(appDir)) {
126
+ appDir = path.join(root, "src");
127
+ }
124
128
  return {
125
129
  root,
126
- pagesDir: path.join(root, "app/pages"),
127
- distDir: path.join(root, "app/dist"),
130
+ pagesDir: path.join(appDir, "pages"),
131
+ distDir: path.join(appDir, "dist"),
128
132
  hasZenithDeps: true
129
133
  };
130
134
  }
package/dist/zenith.js CHANGED
@@ -107,7 +107,7 @@ function findProjectRoot(startDir = process.cwd()) {
107
107
  try {
108
108
  const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
109
109
  const deps = { ...pkg.dependencies, ...pkg.devDependencies };
110
- const hasZenith = Object.keys(deps).some((d) => d.startsWith("@zenith/"));
110
+ const hasZenith = Object.keys(deps).some((d) => d.startsWith("@zenith/") || d.startsWith("@zenithbuild/"));
111
111
  if (hasZenith) {
112
112
  return current;
113
113
  }
@@ -121,10 +121,14 @@ function getProject(cwd = process.cwd()) {
121
121
  const root = findProjectRoot(cwd);
122
122
  if (!root)
123
123
  return null;
124
+ let appDir = path.join(root, "app");
125
+ if (!fs.existsSync(appDir)) {
126
+ appDir = path.join(root, "src");
127
+ }
124
128
  return {
125
129
  root,
126
- pagesDir: path.join(root, "app/pages"),
127
- distDir: path.join(root, "app/dist"),
130
+ pagesDir: path.join(appDir, "pages"),
131
+ distDir: path.join(appDir, "dist"),
128
132
  hasZenithDeps: true
129
133
  };
130
134
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenithbuild/core",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Core library for the Zenith framework",
5
5
  "license": "MIT",
6
6
  "type": "module",