Summary
ktext init panics when a repository has devDependencies in package.json but no dependencies field.
Reproduction
Create a minimal repo like:
{
"name": "@acme/demo",
"devDependencies": {
"@acme/tooling": "1.0.0"
}
}
Then run:
Actual behavior
The process panics with:
panic: assignment to entry in nil map
...
internal/scan/scan.go:518
Expected behavior
ktext init should scan the repo normally and never panic on a common package.json shape.
Likely cause
In internal/scan/scan.go, scanDependencies() assigns all := pkg.Dependencies and then writes all[k] = v while merging devDependencies. If dependencies is absent, all is nil and the write panics.
Impact
This makes ktext init crash on valid JavaScript/TypeScript repos that only declare devDependencies.
Summary
ktext initpanics when a repository hasdevDependenciesinpackage.jsonbut nodependenciesfield.Reproduction
Create a minimal repo like:
{ "name": "@acme/demo", "devDependencies": { "@acme/tooling": "1.0.0" } }Then run:
Actual behavior
The process panics with:
Expected behavior
ktext initshould scan the repo normally and never panic on a commonpackage.jsonshape.Likely cause
In
internal/scan/scan.go,scanDependencies()assignsall := pkg.Dependenciesand then writesall[k] = vwhile mergingdevDependencies. Ifdependenciesis absent,allis nil and the write panics.Impact
This makes
ktext initcrash on valid JavaScript/TypeScript repos that only declaredevDependencies.