stealjs / transpile

Transpiles from everything to everything else
https://www.npmjs.com/package/transpile
MIT License
25 stars 10 forks source link

File structure #79

Open m-mujica opened 7 years ago

m-mujica commented 7 years ago

This is how the lib folder looks currently

├── amd_amd.js
├── amd_cjs.js
├── amd_slim.js
├── babel_compile.js
├── bfs.js
├── cjs_amd.js
├── cjs_cjs.js
├── cjs_steal.js
├── clean_traceur_compile.js
├── es6_amd.js
├── es6_cjs.js
├── es6_compiler.js
├── generate.js
├── get_ast.js
├── global_amd.js
├── global_slim.js
├── make_transforms_formats_graph.js
├── normalize_cjs.js
├── options_normalize.js
├── source_map_filename.js
├── steal_amd.js
└── traverse.js

My proposal is to separate converters from "other" modules and mimic the graph structure we used to determine whether it's possible to transpile a module from a, to b.

say what?

The file structure would look like this:

├── amd
│   ├── cjs.js
│   ├── global.js
│   └── steal.js
├── cjs
│   ├── cjs.js
│   └── steal.js
├── global
│   └── amd.js
└── steal
    └── amd.js

where the folder name is the source format and the file inside is the "dest" format. We could replica the same structure in the tests.

matthewp commented 7 years ago

the filenames not being distinct makes it harder to search is my only issue.

m-mujica commented 7 years ago

I don't think it would change things a lot: instead of searching for amd_cjs you'd search for amd/cjs.

giphy-downsized-large

matthewp commented 7 years ago

ok, cool