{"id":18686776,"url":"https://github.com/leon/labs-nx-buildable-libs","last_synced_at":"2025-06-27T13:35:38.825Z","repository":{"id":142075594,"uuid":"382352119","full_name":"leon/labs-nx-buildable-libs","owner":"leon","description":"A Bug/Labs about nx buildable libs and problems with inter dependencies","archived":false,"fork":false,"pushed_at":"2021-07-02T13:38:56.000Z","size":262,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-18T19:08:37.415Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/leon.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-07-02T13:18:06.000Z","updated_at":"2021-07-02T13:27:56.000Z","dependencies_parsed_at":"2023-07-09T05:31:40.810Z","dependency_job_id":null,"html_url":"https://github.com/leon/labs-nx-buildable-libs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leon/labs-nx-buildable-libs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon%2Flabs-nx-buildable-libs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon%2Flabs-nx-buildable-libs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon%2Flabs-nx-buildable-libs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon%2Flabs-nx-buildable-libs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leon","download_url":"https://codeload.github.com/leon/labs-nx-buildable-libs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon%2Flabs-nx-buildable-libs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262265802,"owners_count":23284575,"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-11-07T10:29:02.396Z","updated_at":"2025-06-27T13:35:38.804Z","avatar_url":"https://github.com/leon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Buildable Libs\n\n## Setup was\n\ncreate empty nx-workspace\ncreate the two buildable libs, with these settings\n\n```\nng generate @nrwl/workspace:library --name=domain --directory=shared --buildable --skipBabelrc --standaloneConfig --strict --testEnvironment=node --no-interactive\nng generate @nrwl/workspace:library --name=auth --directory=shared --buildable --skipBabelrc --standaloneConfig --strict --testEnvironment=node --no-interactive\n```\n\nthen create a interface in domain\nthen a function that uses the domain\n\n## Problem\n\nBuild the domain goes well, and I can see the correct output in dist.\n\n```\nnx build shared-domain\n```\n\nnow we want to build shared auth which depends on domain\n\n```\nnx build shared-auth\n\n// also tried, same result\nnx build shared-auth --with-deps\n```\n\n**Error**\n\n```\nFile '/Users/leon/Temp/labs-buildable-libs/libs/shared/domain/src/index.ts' is not under 'rootDir' 'libs/shared/auth'. 'rootDir' is expected to contain all source files.\nimport { User } from '@myorg/shared/domain';\n```\n\nAccording to the NX Cloud 2.0 video --with-deps was needed before, but not any longer.\nsince nx.json knows this itself by the new targetDependencies.\n\n```\n\"targetDependencies\": {\n    \"build\": [\n      {\n        \"target\": \"build\",\n        \"projects\": \"dependencies\"\n      }\n    ]\n  },\n```\n\nnx dep-graph shows the correct relationship\n\nCould it be that `@nrwl/workspace:tsc` doesn't know how to use the buildable libs?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleon%2Flabs-nx-buildable-libs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleon%2Flabs-nx-buildable-libs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleon%2Flabs-nx-buildable-libs/lists"}