Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikqi/product-card-monorepo
https://github.com/mikqi/product-card-monorepo
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/mikqi/product-card-monorepo
- Owner: mikqi
- Created: 2023-03-08T03:16:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-03-10T01:47:41.000Z (over 1 year ago)
- Last Synced: 2023-08-16T17:46:25.909Z (over 1 year ago)
- Language: TypeScript
- Size: 307 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Product Card Monorepo
This is a monorepo that contains multiple packages for building product card components.
## Architecture
The monorepo is organized using **pnpm workspaces**. Each package is contained within its own folder in the packages directory. The packages are:
- `button`: A reusable component for displaying a button.
- `product-card`: A reusable component for displaying a product card with product information.
- `scroll-to-top`: A reusable component for displaying a button that, when clicked, scrolls the page to the top.
- `expander`: A reusable component for displaying a text that can be expanded to show the full content.Each package has its own `package.json` file and can be developed and built independently of the other packages.
## Scripts
The following scripts are available to use within this monorepo:
- `dev`: Starts the development server for each package that has one.
- `build`: Builds all packages.
prepare: Runs before build, test, or publish. Runs pnpm install in each package.
- `changeset`: Runs the changesets CLI.
- `release`: Publishes the updated packages to the npm registry.
- `version`: Updates the version of the packages in the monorepo.## Publishing
This monorepo uses the changesets action to automatically create and manage version bumps for packages that have changed. Once changesets have been created and committed, the GitHub Action will publish the updated packages to the npm registry.
To publish a new version of a package:
1. Make changes to the package code.
1. Run pnpm run changeset to create a new changeset for the package.
1. Push the changes to the remote branch.
1. The GitHub Action will automatically publish the updated package to the npm registry.## Conclusion
This monorepo provides a convenient way to develop, test, and publish multiple related packages within a single repository. The use of pnpm workspaces and the changesets action make it easy to manage dependencies and versioning across the different packages.