-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cd4d835
commit a562ff9
Showing
9 changed files
with
127 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ preinstall | |
quickfix | ||
shikijs | ||
socio | ||
softprops | ||
Solana | ||
Spatie | ||
stacksjs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { CAC } from 'cac' | ||
import { version } from '../package.json' | ||
import { defaultConfigDir, defaultGeneratedDir, generateConfigTypes } from '../src/config' | ||
|
||
const cli = new CAC('bunfig') | ||
|
||
// Define CLI options interface to match our core types | ||
interface CLIOptions { | ||
configDir?: string | ||
generatedDir?: string | ||
verbose?: boolean | ||
} | ||
|
||
cli | ||
.command('generate', 'Generate the config types') | ||
.option('--config-dir <path>', 'The path to the config directory') | ||
.option('--generated-dir <path>', 'The path to the generated directory') | ||
.option('--verbose', 'Enable verbose logging') | ||
.example('bunfig generate --config-dir ./config --generated-dir ./src/generated') | ||
.action(async (options?: CLIOptions) => { | ||
if (!options?.configDir || !options.generatedDir) { | ||
return generateConfigTypes({ | ||
configDir: options?.configDir || defaultConfigDir, | ||
generatedDir: options?.generatedDir || defaultGeneratedDir, | ||
}) | ||
} | ||
}) | ||
|
||
cli.command('version', 'Show the version of the Bunfig CLI').action(() => { | ||
console.log(version) | ||
}) | ||
|
||
cli.version(version) | ||
cli.help() | ||
cli.parse() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { configDir, generateConfigTypes, generatedDir } from '../src/config' | ||
|
||
try { | ||
generateConfigTypes({ | ||
configDir, | ||
generatedDir, | ||
}) | ||
} | ||
catch (error) { | ||
console.warn('Warning: Could not generate config types:', error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type ConfigNames = string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters