{"id":21571605,"url":"https://github.com/zheeeng/hwd","last_synced_at":"2025-03-18T06:16:28.139Z","repository":{"id":80217945,"uuid":"402052017","full_name":"zheeeng/hwd","owner":"zheeeng","description":null,"archived":false,"fork":false,"pushed_at":"2021-09-30T09:03:42.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-24T12:45:56.819Z","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/zheeeng.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-09-01T12:25:50.000Z","updated_at":"2021-09-30T09:03:45.000Z","dependencies_parsed_at":"2023-03-29T19:17:47.418Z","dependency_job_id":null,"html_url":"https://github.com/zheeeng/hwd","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/zheeeng%2Fhwd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zheeeng%2Fhwd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zheeeng%2Fhwd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zheeeng%2Fhwd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zheeeng","download_url":"https://codeload.github.com/zheeeng/hwd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244166760,"owners_count":20409180,"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-24T11:16:48.042Z","updated_at":"2025-03-18T06:16:28.134Z","avatar_url":"https://github.com/zheeeng.png","language":"JavaScript","readme":"# hwd\n\nCreate for pnpm monorepo project. It configs the resolution strategy by using [exports sugar](https://nodejs.org/api/packages.html#packages_exports_sugar). \n\nYou can import the dependent modules in other workspaces, i.e. `import { foo } from '@monorepo/foo/shared/bar'`.  Node(v12.11.0+) and many bundlers  `webpack`, `rollup`, `vite` has already support this feature for resolving the correct package `bar` in the `node_modules` of `@monorepo/foo`.\n\nBy default, the internal workspace is recognized by the pnpm style package version `workspace: *`\n\n## Usage\n\n```shell\n$: pnpx hwd -h                                                                                                                                                                                 \n\nhwd(hoistWorkspaceDependencies): hoist workspace dependencies to the exports field of package.json\n        -h\tprint the help message.\n        -s\tspecify the shared folder alias, default to 'shared'.\n        -n\tspecify the node_modules folder alias, default to 'node_modules'.\n        -w\tspecify the internal workspace package mark, default to the pnpm specification 'workspace', e.g. '\"foo\": \"workspace:*\"'\n        -c\tspecify the package root, default to the current work directory.\n```\n\n## How to configure Typescript declaration?\n\nConfigure the `path` field of the root `tsconfig.json`:\n\n```json\n{\n    \"paths\": {\n        \"@monorepo/foo/shared/*\": [\"./packages/foo/node_modules/*\", \"./packages/foo/node_modules/@types/*\"]\n    }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzheeeng%2Fhwd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzheeeng%2Fhwd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzheeeng%2Fhwd/lists"}