{"id":23086979,"url":"https://github.com/severo/try-npm-workspaces","last_synced_at":"2025-04-03T16:28:07.098Z","repository":{"id":267871747,"uuid":"902603330","full_name":"severo/try-npm-workspaces","owner":"severo","description":"A test to try the npm workspaces, in particular publishing packages to npm.","archived":false,"fork":false,"pushed_at":"2024-12-13T14:11:56.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T05:16:51.313Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/severo.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":"2024-12-12T22:32:15.000Z","updated_at":"2024-12-13T14:12:00.000Z","dependencies_parsed_at":"2024-12-13T00:33:20.375Z","dependency_job_id":null,"html_url":"https://github.com/severo/try-npm-workspaces","commit_stats":null,"previous_names":["severo/try-npm-workspaces"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/severo%2Ftry-npm-workspaces","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/severo%2Ftry-npm-workspaces/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/severo%2Ftry-npm-workspaces/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/severo%2Ftry-npm-workspaces/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/severo","download_url":"https://codeload.github.com/severo/try-npm-workspaces/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247036151,"owners_count":20872907,"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-12-16T19:40:03.853Z","updated_at":"2025-04-03T16:28:07.067Z","avatar_url":"https://github.com/severo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Try npm workspaces\n\nInstall:\n\n```bash\nnpm i\n```\n\nBuild:\n\n```bash\nnpm run build -ws\n```\n\nRun the app:\n\n```bash\nnpm run dev -w app\n```\n\nIf you do a change in one of the dependencies, you need to rebuild it, and the app too. The easiest way to do it is to rebuild everything with:\n\n```bash\nnpm run build -ws\n```\n\nThe versions must match: if the selector for \"theme\" in the \"components\" package is `^1.0.0`, the version of \"theme\" must be `1.0.0` or higher. If you increment the version of `theme` to `2.0.0`, you need to update the dependencies in `components` to `^2.0.0`, or `2.0.0`, or any other matching expression. Once done, don't forget to run:\n\n- check that the versions are correct in the `package.json` files by installing again: `npm i`\n- rebuild everything: `npm run build -ws`\n\nThe advantage of such setup is that we can update multiple packages in the same PR and test them together. Once merged to main, we can publish all the packages to npm (in order).\n\nReferences:\n\n- official doc: https://docs.npmjs.com/cli/v10/using-npm/workspaces\n- an overview: https://medium.com/@ruben.alapont/npm-workspaces-managing-multi-package-projects-28538fe40d1d\n- how to ensure the same dependency in all the workspaces: https://tobiasedwards.co.uk/blog/unifying-dependency-versions-across-npm-workspaces/\n\nLimitations:\n\n- a workspace can access dependencies of another workspace, without the dependency being explicit: https://edrickleong.hashnode.dev/why-you-shouldnt-use-npm-workspaces\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsevero%2Ftry-npm-workspaces","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsevero%2Ftry-npm-workspaces","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsevero%2Ftry-npm-workspaces/lists"}