New api: generate mappings from a descriptor object

Not ready to merge
with relative path, no __dirname