@zenithbuild/cli 0.4.11 → 0.5.0-beta.2.4

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.
@@ -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
- }
@@ -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
- }