@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.
- package/cli/utils/project.ts +10 -4
- package/dist/cli.js +2 -0
- package/dist/zen-build.js +7 -3
- package/dist/zen-dev.js +7 -3
- package/dist/zen-preview.js +7 -3
- package/dist/zenith.js +7 -3
- package/package.json +1 -1
package/cli/utils/project.ts
CHANGED
|
@@ -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(
|
|
57
|
-
distDir: path.join(
|
|
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
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(
|
|
127
|
-
distDir: path.join(
|
|
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(
|
|
127
|
-
distDir: path.join(
|
|
130
|
+
pagesDir: path.join(appDir, "pages"),
|
|
131
|
+
distDir: path.join(appDir, "dist"),
|
|
128
132
|
hasZenithDeps: true
|
|
129
133
|
};
|
|
130
134
|
}
|
package/dist/zen-preview.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(
|
|
127
|
-
distDir: path.join(
|
|
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(
|
|
127
|
-
distDir: path.join(
|
|
130
|
+
pagesDir: path.join(appDir, "pages"),
|
|
131
|
+
distDir: path.join(appDir, "dist"),
|
|
128
132
|
hasZenithDeps: true
|
|
129
133
|
};
|
|
130
134
|
}
|