{"id":15821642,"url":"https://github.com/dgp1130/exported_macros","last_synced_at":"2026-01-11T01:45:43.433Z","repository":{"id":115117196,"uuid":"328325169","full_name":"dgp1130/exported_macros","owner":"dgp1130","description":null,"archived":false,"fork":false,"pushed_at":"2021-01-10T07:13:23.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-05T07:41:06.653Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dgp1130.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-10T07:12:56.000Z","updated_at":"2021-01-10T07:13:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"e35f0946-9a08-40a0-b09a-8b39f072defc","html_url":"https://github.com/dgp1130/exported_macros","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgp1130%2Fexported_macros","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgp1130%2Fexported_macros/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgp1130%2Fexported_macros/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgp1130%2Fexported_macros/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgp1130","download_url":"https://codeload.github.com/dgp1130/exported_macros/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246598181,"owners_count":20802975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-05T07:40:34.995Z","updated_at":"2026-01-11T01:45:43.413Z","avatar_url":"https://github.com/dgp1130.png","language":"Starlark","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Exported Macros\n\nGitHub repository for minimally reproducing a `rules_nodejs` bug.\n\nIn `rules_nodejs` v3, `strict_visibility` is enabled by default. This is great\nto avoid accidentally depending on a transitive dep, but causes other\nchallenges. Most notably, strict deps cannot take into account dependencies from\nmacros originating in Bazel libraries.\n\nIn this example, this workspace provides a [`my_binary()`](/index.bzl) macro\nwhich generates a `nodejs_binary()`. This binary happens to use `yargs` as a\ndependency to parse arguments. It is listed in the `package.json` and works\ncorrectly when used in this workspace's [`BUILD.bazel`](/BUILD.bazel) file.\n\n```\n$ bazel run //:binary -- --foo bar\nbar\n```\n\nHowever, in [`external`](/external/) is a separate workspace which depends on\nthis example via NPM and calls the same macro. Attempting to use it throws an\nerror:\n\n```\n$ bazel run //:pkg.pack \u0026\u0026 \\\n    (cd external/ \u0026\u0026 npm install \u0026\u0026 npm install ../exported_macros-*.tgz \u0026\u0026 bazel run //:binary -- --foo bar)\n# ...\nERROR: /home/dparker/Source/exported_macros/external/BUILD.bazel:3:10: in nodejs_binary rule //:binary: target '@npm//yargs:yargs' is not visible from target '//:binary'. Check the visibility declaration of the former target if you think the dependency is legitimate\nERROR: Analysis of target '//:binary' failed; build aborted: Analysis of target '//:binary' failed\n```\n\nBecause the macro is executed in a separate workspace, and that workspace does\n**not** have a dependency on `yargs`, the generated `nodejs_binary()` fails the\nstrict visibility check.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgp1130%2Fexported_macros","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgp1130%2Fexported_macros","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgp1130%2Fexported_macros/lists"}