@zenithbuild/cli 0.4.11 → 0.5.0-beta.2.12
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/README.md +3 -0
- package/dist/build.js +1475 -0
- package/dist/dev-server.js +214 -0
- package/dist/index.js +175 -0
- package/dist/manifest.js +273 -0
- package/dist/preview.js +655 -0
- package/dist/resolve-components.js +490 -0
- package/dist/server/resolve-request-route.js +169 -0
- package/dist/server-contract.js +146 -0
- package/dist/types/generate-env-dts.js +52 -0
- package/dist/types/generate-routes-dts.js +22 -0
- package/dist/types/index.js +34 -0
- package/dist/ui/env.js +41 -0
- package/dist/ui/format.js +172 -0
- package/dist/ui/logger.js +105 -0
- package/package.json +21 -49
- package/bin/zen-build.ts +0 -2
- package/bin/zen-dev.ts +0 -2
- package/bin/zen-preview.ts +0 -2
- package/bin/zenith.ts +0 -2
- package/dist/zen-build.js +0 -9622
- package/dist/zen-dev.js +0 -9622
- package/dist/zen-preview.js +0 -9622
- package/dist/zenith.js +0 -9622
- package/src/commands/add.ts +0 -37
- package/src/commands/build.ts +0 -36
- package/src/commands/create.ts +0 -702
- package/src/commands/dev.ts +0 -472
- package/src/commands/index.ts +0 -112
- package/src/commands/preview.ts +0 -62
- package/src/commands/remove.ts +0 -33
- package/src/index.ts +0 -10
- package/src/main.ts +0 -101
- package/src/utils/branding.ts +0 -178
- package/src/utils/logger.ts +0 -52
- package/src/utils/plugin-manager.ts +0 -114
- package/src/utils/project.ts +0 -77
package/src/commands/add.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @zenithbuild/cli - Add Command
|
|
3
|
-
*
|
|
4
|
-
* Registers a plugin in the project
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { requireProject } from '../utils/project'
|
|
8
|
-
import { addPlugin, hasPlugin } from '../utils/plugin-manager'
|
|
9
|
-
import * as logger from '../utils/logger'
|
|
10
|
-
|
|
11
|
-
export interface AddOptions {
|
|
12
|
-
options?: Record<string, unknown>
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export async function add(pluginName: string, options: AddOptions = {}): Promise<void> {
|
|
16
|
-
requireProject()
|
|
17
|
-
|
|
18
|
-
logger.header('Add Plugin')
|
|
19
|
-
|
|
20
|
-
if (!pluginName) {
|
|
21
|
-
logger.error('Plugin name required. Usage: zenith add <plugin>')
|
|
22
|
-
process.exit(1)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (hasPlugin(pluginName)) {
|
|
26
|
-
logger.warn(`Plugin "${pluginName}" is already registered`)
|
|
27
|
-
return
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const success = addPlugin(pluginName, options.options)
|
|
31
|
-
|
|
32
|
-
if (success) {
|
|
33
|
-
logger.info(`Plugin "${pluginName}" has been registered.`)
|
|
34
|
-
logger.info('Note: You may need to install the package manually:')
|
|
35
|
-
logger.log(` bun add @zenithbuild/plugin-${pluginName}`)
|
|
36
|
-
}
|
|
37
|
-
}
|
package/src/commands/build.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @zenithbuild/cli - Build Command
|
|
3
|
-
*
|
|
4
|
-
* Builds the application for production using SSG.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { requireProject } from '../utils/project'
|
|
8
|
-
import * as logger from '../utils/logger'
|
|
9
|
-
import { buildSSG } from '@zenithbuild/compiler'
|
|
10
|
-
|
|
11
|
-
export interface BuildOptions {
|
|
12
|
-
outDir?: string
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export async function build(options: BuildOptions = {}): Promise<void> {
|
|
16
|
-
const project = requireProject()
|
|
17
|
-
const outDir = options.outDir || project.distDir
|
|
18
|
-
|
|
19
|
-
logger.header('Zenith Build')
|
|
20
|
-
logger.log(`Source: ${project.pagesDir}`)
|
|
21
|
-
logger.log(`Output: ${outDir}`)
|
|
22
|
-
|
|
23
|
-
try {
|
|
24
|
-
buildSSG({
|
|
25
|
-
pagesDir: project.pagesDir,
|
|
26
|
-
outDir: outDir,
|
|
27
|
-
baseDir: project.root
|
|
28
|
-
})
|
|
29
|
-
logger.success('Build complete!')
|
|
30
|
-
|
|
31
|
-
} catch (err: unknown) {
|
|
32
|
-
const message = err instanceof Error ? err.message : String(err)
|
|
33
|
-
logger.error(`Build failed: ${message}`)
|
|
34
|
-
process.exit(1)
|
|
35
|
-
}
|
|
36
|
-
}
|