{"id":17802671,"url":"https://github.com/stefee/npm-workspaces-test","last_synced_at":"2025-04-02T04:41:38.861Z","repository":{"id":103254696,"uuid":"342852705","full_name":"stefee/npm-workspaces-test","owner":"stefee","description":"trying out npm workspaces which were introduced in v7 of npm","archived":false,"fork":false,"pushed_at":"2021-02-27T14:34:06.000Z","size":39845,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T21:11:33.492Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"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/stefee.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-02-27T12:34:36.000Z","updated_at":"2021-02-27T14:34:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"5b65044b-8201-46ef-adc8-c1bf5251b59c","html_url":"https://github.com/stefee/npm-workspaces-test","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/stefee%2Fnpm-workspaces-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefee%2Fnpm-workspaces-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefee%2Fnpm-workspaces-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefee%2Fnpm-workspaces-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefee","download_url":"https://codeload.github.com/stefee/npm-workspaces-test/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246758279,"owners_count":20828919,"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-27T12:44:11.503Z","updated_at":"2025-04-02T04:41:38.834Z","avatar_url":"https://github.com/stefee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# npm-workspaces-test\n\nI am using this repo to test [npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces) which were introduced in v7 of npm.\n\n## Prerequisites\n\n* npm v7 or above\n\n## Installing the workspace\n\n```\nnpm install\n```\n\nThis will install all the dependencies for packaegs in the `packages/*` directory in a single `node_modules` folder at the root of the repository and symlink the local packages.\n\nUnlike other tools such as lerna, this **must** be run from the root directory, otherwise the packages will not be symlinked locally – running `npm install` from one of the package directories will act just like a normal `npm install`.\n\nRunning this will also run the `preinstall`, `postinstalll` and `prepare` scripts in each of the workspace packages if the script is present.\n\n## Testing the workspace\n\n```\nnpm test\n```\n\nThis will run the `test` script in each of the workspace packages if the script is present.\n\n## Adding package dependencies\n\nAny new dependencies need to be added manually to the `package.json` files in the `packages/*` directory. :-(\n\nYou can find the latest version for a package using `npm view` command. For example:\n\n```\n$ npm view express version\n4.17.1\n```\n\n## Implementation\n\nThis currently relies on [Lerna](https://lerna.js.org/) to execute npm scripts for all packages in the workspace. (Lerna is not used for bootstrapping packages as this is now handled by [npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces); only the `lerna exec` command is used when running scripts).\n\nLerna is not a pre-requisite to installing this project for local development as it is installed as a dev-dependency in the root package, and only required in the root package scripts.\n\nIn a [future version of npm](https://github.com/npm/rfcs/blob/8167fa97a266cc2bf60cc545b382d274dc397496/accepted/0000-workspaces-part2.md) Lerna can be removed entirely.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefee%2Fnpm-workspaces-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefee%2Fnpm-workspaces-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefee%2Fnpm-workspaces-test/lists"}