Need a way to change the output directory from lib (as that is already reserved by certain other build systems, like mix), but was not able to find one through a cursory search in the code here. :-)
is it a serious issue? currently we use lib/js, lib/amdjs, lib/ocaml, lib/bs and lib/goog, in the future we may need lib/es6,
renaming directories is not technically challenging but it requires lots of coordination work
It is conflicting with the 'lib' being the source code storage directory for Elixir servers is my issue. ^.^
It also makes writing out the javascript path in javascript pretty long as you can see at http://blog.overminddl1.com/posts/setting-up-bucklescript-with-phoenix/#using-bucklescript for this:
import "lib/js/web/bucklescript/my_file"
Where if we could set the output then for Elixir projects it would be set to "web/static/js" or so, which would make the above import actually:
import "web/bucklescript/my_file"
And if there was an option in the bsconfig to not add on extra paths before the watched directory then it would just become:
import "my_file"
Speaking of, bucklescript source root for Elixir/Phoenix projects is "web/bucklescript", so why is bsb prepending "web/bucklescript" to every file written to the output directory?
@OvermindDL1 is it a high priority, do you find some work around? I will close it, but feel free to leave comments here if it is a blocking issue, thanks
@OvermindDL1 is it a high priority, do you find some work around? I will close it, but feel free to leave comments here if it is a blocking issue, thanks
@bobzhang One thing I've noticed (thankfully git rolled it back fine as I'd not edited those files yet) is when Elixir has a, say, 'js' module (used for javascript build helpers and such) then all that source code gets wiped out when bsb -clean-world is run, which is definitely not user friendly. ;-)
So yeah, any time I run bsb clean I have to roll back the git state for my source code, would that be considered high priority especially as I would have lost any changes made to those files if not committed yet? ^.^
Atom packages also put their code in lib/ by default, making it a mess with bsb. Not a very pressing issue, but it would be nice to have this on some todo list somewhere.
would you mind describe your problem a little clearer? (I have zero knowledge on how Elixir work)
Is there any way I can help without changing the output directory?
[email protected] At: 03/08/17 10:31:52" data-digest="From: [email protected] At: 03/08/17 10:31:52" style="">
From: [email protected] At: 03/08/17 10:31:52
To: [email protected]
Cc: Hongbo Zhang (BLOOMBERG/ 731 LEX), [email protected]
Subject: Re: [bloomberg/bucklescript] Need a change output directory in bsconfig.json (#1124)
@OvermindDL1 is it a high priority, do you find some work around? I will close it, but feel free to leave comments here if it is a blocking issue, thanks
@bobzhang One thing I've noticed (thankfully git rolled it back fine as I'd not edited those files yet) is when Elixir has a, say, 'js' module (used for javascript build helpers and such) then all that source code gets wiped out when bsb -clean-world is run, which is definitely not user friendly. ;-)
So yeah, any time I run bsb clean I have to roll back the git state for my source code, would that be considered high priority? ^.^
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
why bsb clean would remove your source code? I am happy to refine bsb clean to make it less aggressive
[email protected] At: 03/08/17 10:31:52" data-digest="From: [email protected] At: 03/08/17 10:31:52" style="">
From: [email protected] At: 03/08/17 10:31:52
To: [email protected]
Cc: Hongbo Zhang (BLOOMBERG/ 731 LEX), [email protected]
Subject: Re: [bloomberg/bucklescript] Need a change output directory in bsconfig.json (#1124)
@OvermindDL1 is it a high priority, do you find some work around? I will close it, but feel free to leave comments here if it is a blocking issue, thanks
@bobzhang One thing I've noticed (thankfully git rolled it back fine as I'd not edited those files yet) is when Elixir has a, say, 'js' module (used for javascript build helpers and such) then all that source code gets wiped out when bsb -clean-world is run, which is definitely not user friendly. ;-)
So yeah, any time I run bsb clean I have to roll back the git state for my source code, would that be considered high priority? ^.^
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
why bsb clean would remove your source code? I am happy to refine
bsb cleanto make it less aggressive
Just tested and it is still doing it. Basically given this file structure:
- _build
- dev
- consolidated
- ...othersLotsOfCompiledProtocolsOfElixir
- lib
- ...othersLotsOfOthersCompiledOutputOfElixirAndErlang
- prod
- ...othersSameAs'dev'
- ...othersEnvironments
- lib
- someFiles.ex
- ...othersMoreBaseExFiles
- module_directories
- ...othersModulesFullOfExFilesWithMoreSubModuleDirectories
- ...othersMoreModuleDirectories
- test
- ...othersLotsOfTestingCodeAndMoreModulesDirectories
- ...others
Basically the lib/module_directories are directories named after their modules, contexts, or groupings, so my lib directory has things like:
- lib
- my_server
- ...lotsOfExFilesToHandleEndpoint
- js
- ...lotsOfExFilesToHandleJsLoadingInEndpoint
- web
- ...lotsOfExFilesAndHtmlTemplatesAsExFiles
- ...lotsOfOthersToo
And right now if I run npm run clean it calls bsb -clean-world, which among other things is completely deleting my lib/js directory and all the source code of the *.ex files and *.js files and *.js.eex files and just everything in there.
Bucklescript really really badly should not be outputting files into the source (lib) directory, in this project it should be outputting into _build/<environment>/bsb or so where the environment is something like prod or dev or whatever is based in this project (passed on the system environment, should default to dev if not specified) for it to fit in best. ^.^
But at the very least it should not be wiping my elixir/eex/js/etc. source files. ;-)
And right now if I run npm run clean it calls bsb -clean-world, which among other things is completely deleting my lib/js directory and all the source code of the *.ex files and *.js files and *.js.eex files and just everything in there.
Currently bsb -clean only wiped out lib/js or lib/amdjs, why would that remove *.ex files?
Note I picked up lib since the core distribution also used lib/ocaml as a location for binary artifacts
Currently bsb -clean only wiped out lib/js or lib/amdjs, why would that remove *.ex files?
Great question! But it does, it deletes the entire 'js' directory in full. :-)
Note I picked up lib since the core distribution also used lib/ocaml as a location for binary artifacts
Erlang uses src for source, Elixir uses lib for source (though elixir can compile Erlang too from lib).
Erlang uses ebin for binary artifacts and cache, Elixir uses _build for binary artifacts and cache.
Erlang uses rel for final binary release output, Elixir also uses rel for final binary release output.
Lots of different patterns even for two languages on the same VM. ^.^
Also, for more comparisons, C++ and Rust both uses lib for external libraries and Java often uses lib for external jar libraries, none of which use them as output. I cannot think of any language off-hand besides OCaml that uses lib as anything but some 'input' (ruby, javascript, the 5-thousand javascript transpilers, rust, etc... etc...). Since BS is being built to compile to Javascript these issues will pop up in many places as lib should only ever be an input, not an output directory for almost all languages. :-)
Great question! But it does, it deletes the entire 'js' directory in full. :-)
So ,bsb -cleanis a good citizen, no?
So ,
bsb -cleanis a good citizen, no?
Not tried it, when I clean I tend to like to clean everything. ^.^
Testing it now after committing my current work... ^.^
And nope, it wipes my lib/js directory and all the *.ex and *.js.eex and *.js files in it too... :-(
hmm, I get lost, wiping lib/js is expected behavior, did it do more than that?
[email protected] At: 03/08/17 16:37:47" data-digest="From: [email protected] At: 03/08/17 16:37:47" style="">
From: [email protected] At: 03/08/17 16:37:47
To: [email protected]
Cc: Hongbo Zhang (BLOOMBERG/ 731 LEX), [email protected]
Subject: Re: [bloomberg/bucklescript] Need a change output directory in bsconfig.json (#1124)
So , bsb -clean is a good citizen, no?
Not tried it, when I clean I tend to like to clean everything. ^.^
Testing it now after committing my current work... ^.^
And nope, it wipes my lib/js directory and all the *.ex and *.js.eex and *.js files in it too... :-(
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
hmm, I get lost,
wiping lib/jsis expected behavior, did it do more than that?
Yes, it is also wiping out my elixir source code that is also in lib/js since that is where Elixir puts its source code. ;-)
Curious why you out elixir inside lib/js ?
Curious why you out elixir inside lib/js ?
Because there is a module called 'JS' that helps dynamically build user-specific Javascript, it is an old project. ^.^
All Elixir code goes in lib, top-level module-less code goes in lib itself, module code goes in the same-named subdirectory in lib, and in subdirectories inside that for submodules and so forth.
so you only put elixir files inside lib/js, if we only remove js files in lib/js, would that make your life easier?
[email protected] At: 03/09/17 10:01:06" data-digest="From: [email protected] At: 03/09/17 10:01:06" style="">
From: [email protected] At: 03/09/17 10:01:06
To: [email protected]
Cc: Hongbo Zhang (BLOOMBERG/ 731 LEX), [email protected]
Subject: Re: [bloomberg/bucklescript] Need a change output directory in bsconfig.json (#1124)
Curious why you out elixir inside lib/js ?
Because there is a module called 'JS' that helps dynamically build user-specific Javascript, it is an old project. ^.^
All Elixir code goes in lib, top-level module-less code goes in lib itself, module code goes in the same-named subdirectory in lib, and in subdirectories inside that for submodules and so forth.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
so you only put elixir files inside
lib/js, if we only removejsfiles inlib/js, would that make your life easier?
Not just elixir, but also templates, templates are named in the form of "
OCaml is definitely the odd system out, every other language I know uses a 'lib' directory as an input, not an output. ^.^
Recently, we support in-source build, and we are going to allow users to add a special suffix .bs.js so that bucklescript generated js file is highlighted. Hope it will mitigate your issues, it is less likely that we will support customizing outputdir in the near future, having a common convention makes both user and developer's life easier
Hello! I'm experiencing the same issue. Has this been resolved?
What should I do if I really want to customize my output directory?
I am also hamstrung by a lack of an ability to pick the output directory. Would welcome any tips or fix here.
Adding an option to bsconfig.json seems like the best solution.
Unable to change the output directory is not a problem, until IT IS A PROBLEM.
I thought I had no problem with this, but then, who knows, now I'm back at this thread.
Come on, please at least acknowledge that this is a problem and reopen this issue again.
i want to use create-react-app alongside with reasonreact without ejecting react-scripts, i know we can use in-source: true and code .re in /src folder, but it'll be a mess,
i think the solution must somehow at configuration in bsconfig, change compile result of "es6" to folder /src instead /lib/es6
how i can achieve this?
thank you
@putrasurya
https://bucklescript.github.io/docs/en/build-configuration#package-specs
"The output directory is not configurable otherwise."
However, you can have a post compilation script move your files.
https://bucklescript.github.io/docs/en/build-configuration#js-post-build
I don't think that's close to a sane decision.
Is there any movement on this?
It's purely a bucklescript configuration thing. I 'think' they have configurations for it now, should be in it's manual I'd hope. :-)
Most helpful comment
Unable to change the output directory is not a problem, until IT IS A PROBLEM.
I thought I had no problem with this, but then, who knows, now I'm back at this thread.
Come on, please at least acknowledge that this is a problem and reopen this issue again.