rules_js
                                
                                 rules_js copied to clipboard
                                
                                    rules_js copied to clipboard
                            
                            
                            
                        Promote js_image_layer to Public API
js_image_layer should be promoted to public API before 1.0
Not landing this for 1.0 since there are transitive deps on rules_py and rules_pkg that we have to reason about first
As spoken with @thesayyn on Slack, I tested the js_image_layer following the example on the e2e folder and noticed something additional had to be done when importing files. It can be either improved or be part of the docs.
When running the image built using js_image_layer, my Node.js runtime at first wasn't able to find some .proto files that I import. It all works great when using js_binary directly though. But to get the files to be found with this Starlark code I'm importing from the e2e folder, I had to:
- Set the workdirattribute in thecontainer_imageto/app/my_package/start.sh.runfiles/my_workspace_name(/appis the root injs_image_layer). It also works if I set the environment variableJS_BINARY__CHDIRto that same string.
- After setting the workdir as mentioned above, I still need to prefix the file I import with process.cwd(). When I call thejs_binarytarget directly without Docker, I don't need to prefix it.
https://github.com/bazel-contrib/rules_oci/pull/31#discussion_r1030938473 we'll move the python bit to its own file if we can't address #381