{"id":21630570,"url":"https://github.com/catsmiaow/node-monorepo-workspaces","last_synced_at":"2025-04-11T01:02:05.054Z","repository":{"id":80519749,"uuid":"582286186","full_name":"CatsMiaow/node-monorepo-workspaces","owner":"CatsMiaow","description":"Node.js Monorepo example with npm Workspaces","archived":false,"fork":false,"pushed_at":"2025-04-04T03:55:06.000Z","size":577,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T06:56:47.631Z","etag":null,"topics":["monorepo","nest","nestjs","node","nodejs","npm-workspaces","typescript","workspaces"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CatsMiaow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-12-26T10:38:40.000Z","updated_at":"2025-04-04T03:55:10.000Z","dependencies_parsed_at":"2024-11-25T02:11:36.183Z","dependency_job_id":"e4cea209-eba6-4178-839f-c932be04066c","html_url":"https://github.com/CatsMiaow/node-monorepo-workspaces","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/CatsMiaow%2Fnode-monorepo-workspaces","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CatsMiaow%2Fnode-monorepo-workspaces/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CatsMiaow%2Fnode-monorepo-workspaces/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CatsMiaow%2Fnode-monorepo-workspaces/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CatsMiaow","download_url":"https://codeload.github.com/CatsMiaow/node-monorepo-workspaces/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322600,"owners_count":21084336,"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":["monorepo","nest","nestjs","node","nodejs","npm-workspaces","typescript","workspaces"],"created_at":"2024-11-25T02:11:28.727Z","updated_at":"2025-04-11T01:02:05.028Z","avatar_url":"https://github.com/CatsMiaow.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-monorepo-workspaces\n\nNode.js Monorepo example with npm Workspaces\n\n## Introduction\n\nMonorepo structure of TypeScript and [NestJS](https://nestjs.com) project using [Nx](https://nx.dev) and [npm Workspaces](https://docs.npmjs.com/cli/v10/using-npm/workspaces)\n\n- Not using NestJS [monorepo mode](https://docs.nestjs.com/cli/monorepo).\n- Use Nx on top of the npm workspace.\n- Nx alone can handle [releases](https://nx.dev/features/manage-releases) (`versioning` → `changelog` → `publishing`), so it's more scalable than using `Turborepo` or `Lerna` alone.\n\n## Continuous Integration\n\n```sh\nnpm ci\nnpm run lint\nnpm run test\nnpm run build\n# The above command can also be used like this:\nnpx nx run-many -t=lint,test,build\n\n# Run tasks affected\nnpx nx affected -t=build\n```\n\n## Development\n\n```sh\n# package manage to a specific workspace\nnpm i -w sample-nestjs-app install-package\nnpm un -w sample-nestjs-app uninstall-package\nnpm ci -w sample-nestjs-app\n\n# launch the development process\nnpx nx run sample-nestjs-app:dev\n\n# execute npm tasks\nnpx nx run workspace-name:any-task\nnpx nx exec ---projects workspace-name -- any-task\nnpm run any-task -w workspace-name\n```\n\n## Production\n\n```sh\n# https://docs.npmjs.com/cli/v9/commands/npm-ci#omit\nnpm ci -w sample-nestjs-app --omit=dev\n```\n\n## Create a new workspace (apps or packages)\n\n- See \u003chttps://docs.npmjs.com/cli/v9/commands/npm-init#workspaces-support\u003e\n- Modify workspace by refer to the sample code. or edit after copy-paste\n\n### Apps\n\n- `npm init -w apps/app-name`\n  - [TypeScript simple sample-app](./apps/sample-app)\n  - [NestJS server sample-app](./apps/sample-nestjs-app)\n\n### Packages\n\n- `npm init -w packages/package-name`\n  - [TypeScript simple sample-package](./packages/sample-lib)\n  - [NestJS module sample-package](./packages/sample-nestjs-lib)\n- Modify the [pah mapping](https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping) in [tsconfig.json](./tsconfig.json).\n\n## Folders\n\n```js\n+-- apps\n|   +-- sample-app // TypeScript simple sample-app\n|   +-- sample-nestjs-app // NestJS server sample-app\n+-- packages\n|   +-- sample-lib // TypeScript simple sample-package\n|   +-- sample-nestjs-lib // NestJS module sample-package\n+-- eslint.config.mjs // ESLint common configuration\n+-- vitest.config.ts // Vitest common configuration\n+-- nx.json // Nx task pipeline configuration\n```\n\n### Links\n\n- [Monorepo tools](https://monorepo.tools)\n- [npm Workspaces](https://docs.npmjs.com/cli/v9/using-npm/workspaces)\n- [Nx](https://nx.dev)\n  - [Nx Commands](https://nx.dev/reference/nx-commands)\n  - [Get Started with Nx Release](https://nx.dev/recipes/nx-release/get-started-with-nx-release)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatsmiaow%2Fnode-monorepo-workspaces","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatsmiaow%2Fnode-monorepo-workspaces","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatsmiaow%2Fnode-monorepo-workspaces/lists"}