Jesús Pérez c62e967ce3
chore: complete KCL to Nickel migration cleanup and setup pre-commit
Clean up 404 KCL references (99.75% complete):
   - Rename kcl_* variables to schema_*/nickel_* (kcl_path→schema_path, etc.)
   - Update functions: parse_kcl_file→parse_nickel_file
   - Update env vars: KCL_MOD_PATH→NICKEL_IMPORT_PATH
   - Fix cli/providers-install: add has_nickel and nickel_version variables
   - Correct import syntax: .nickel.→.ncl.
   - Update 57 files across core, CLI, config, and utilities

   Configure pre-commit hooks:
   - Activate: nushell-check, nickel-typecheck, markdownlint
   - Comment out: Rust hooks (fmt, clippy, test), check-yaml

   Testing:
   - Module discovery: 9 modules (6 providers, 1 taskserv, 2 clusters) 
   - Syntax validation: 15 core files 
   - Pre-commit hooks: all passing 
2026-01-08 20:08:46 +00:00

74 lines
2.0 KiB
Plaintext

# Development Command Handlers
# Handles: module, layer, version, pack commands
use ../flags.nu *
use ../../lib_provisioning *
# Helper to run module commands
def run_module [
args: string
module: string
option?: string
--exec
] {
let use_debug = if ($env.PROVISIONING_DEBUG? | default false) { "-x" } else { "" }
if $exec {
exec $"($env.PROVISIONING_NAME)" $use_debug -mod $module ($option | default "") $args --notitles
} else {
^$"($env.PROVISIONING_NAME)" $use_debug -mod $module ($option | default "") $args --notitles
}
}
# Main development command dispatcher
export def handle_development_command [
command: string
ops: string
flags: record
] {
set_debug_env $flags
match $command {
"module" => { handle_module $ops $flags }
"layer" => { handle_layer $ops $flags }
"version" => { handle_version $ops $flags }
"pack" => { handle_pack $ops $flags }
_ => {
print $"❌ Unknown development command: ($command)"
print ""
print "Available development commands:"
print " module - Module discovery and management"
print " layer - Layer system (explain, show, test, stats)"
print " version - Version management (check, show, updates)"
print " pack - Packaging (core, provider, list, clean)"
print ""
print "Use 'provisioning help development' for more details"
exit 1
}
}
}
# Module command handler
def handle_module [ops: string, flags: record] {
let args = build_module_args $flags $ops
run_module $args "module" --exec
}
# Layer command handler
def handle_layer [ops: string, flags: record] {
let args = build_module_args $flags $ops
run_module $args "layer" --exec
}
# Version command handler
def handle_version [ops: string, flags: record] {
let args = build_module_args $flags $ops
run_module $args "version" --exec
}
# Pack command handler
def handle_pack [ops: string, flags: record] {
let args = build_module_args $flags $ops
run_module $args "pack" --exec
}