zambezi / ez-build

Zambezi build tool
MIT License
2 stars 1 forks source link

When setting lib to project root, don't introduce extra slashes #25

Closed mstade closed 8 years ago

mstade commented 8 years ago

If you specify -L <project root> when running ez-build, you'll run into the situation of module names including an extra slash. To fix this we simply check if opts.lib is set (it'll always be relative to project root, so it'll be empty) and if not we only use the project name as the module root.

mstade commented 8 years ago

@FabienDeshayes this should solve your problem.

FabienDeshayes commented 8 years ago

:+1:

Poetro commented 8 years ago

:+1:

FabienDeshayes commented 8 years ago

I think there are 3 issues with this release (I'm on 0.3.1-fix-extra-slash-in-module-root.1):

[
  "am-authentication/c:/dev/work/authentication/a2",
  "am-authentication/c:/dev/work/authentication/ez-build-debug",
  "am-authentication/c:/dev/work/authentication/from-params",
  "am-authentication/c:/dev/work/authentication/hello",
  "am-authentication/c:/dev/work/authentication/README",
  "am-authentication/c:/dev/work/authentication/to-params"
]
Rejection #1:
{ [Error: ENOENT: no such file or directory, open 'c:\dev\work\authentication\s']
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'c:\\dev\\work\\authentication\\s',
  build: { input: 's' } }

//etc 12 times, with a different letter each time
require('my-project/hello-world') // Object {}

Not sure about that last one as the output seems correct.

TBC next week..

mstade commented 8 years ago

Thanks @FabienDeshayes.

  1. The modules part of the optimised-modules.json moniker is a bit of a misnomer – it's really just a listing of everything. Because you're not putting the output files in a dedicated lib directory, it'll include other files like the README and such as well. The paths however are obviously incorrect, they should be logical names, not absolute paths and certainly not in the middle of everything – I'll fix that. But other than that, it's not really doing anything wrong at this point.
  2. I'm unable to repro this, anything else you can think of to trigger this?
  3. I don't really know what this means, can you elaborate?
mstade commented 8 years ago

Bumping the minor version, since this adds new features (albeit backwards compatible.)