{"id":15632708,"url":"https://github.com/timmikeladze/typescript-react-package-starter","last_synced_at":"2025-04-04T08:04:59.158Z","repository":{"id":37018230,"uuid":"494546167","full_name":"TimMikeladze/typescript-react-package-starter","owner":"TimMikeladze","description":"📦 Develop \u0026 publish Typescript or React packages with ease. PostCSS, Vitest, Biome \u0026 Storybook support out of the box. Integrates with Github releases and automatically publishes to NPM. Code is built using tsup.","archived":false,"fork":false,"pushed_at":"2025-03-25T15:06:38.000Z","size":3769,"stargazers_count":199,"open_issues_count":2,"forks_count":20,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-28T07:02:22.611Z","etag":null,"topics":["boilerplate","package-starter","package-template","react","react-boilerplate","react-package","react-starter","reactjs","starter-kit","starter-project","storybook","tsup","tsup-starter","typescript","typescript-library","typescript-package","typescript-starter"],"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/TimMikeladze.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"ko_fi":"linesofcodedev","custom":["https://www.paypal.me/TimMikeladze"]}},"created_at":"2022-05-20T17:06:07.000Z","updated_at":"2025-03-25T06:46:02.000Z","dependencies_parsed_at":"2022-07-14T06:30:31.700Z","dependency_job_id":"caccb91e-d194-495f-ade1-7a94f51c4015","html_url":"https://github.com/TimMikeladze/typescript-react-package-starter","commit_stats":{"total_commits":179,"total_committers":6,"mean_commits":"29.833333333333332","dds":0.5251396648044693,"last_synced_commit":"8ac6e1380c46090b3ad7bc8ba594e75771c007f5"},"previous_names":["timmikeladze/typescript-react-package-starter"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimMikeladze%2Ftypescript-react-package-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimMikeladze%2Ftypescript-react-package-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimMikeladze%2Ftypescript-react-package-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimMikeladze%2Ftypescript-react-package-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimMikeladze","download_url":"https://codeload.github.com/TimMikeladze/typescript-react-package-starter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247136882,"owners_count":20889761,"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":["boilerplate","package-starter","package-template","react","react-boilerplate","react-package","react-starter","reactjs","starter-kit","starter-project","storybook","tsup","tsup-starter","typescript","typescript-library","typescript-package","typescript-starter"],"created_at":"2024-10-03T10:45:02.831Z","updated_at":"2025-04-04T08:04:59.134Z","avatar_url":"https://github.com/TimMikeladze.png","language":"TypeScript","readme":"# 📦 Typescript • React • Package Starter\n\nA slightly opinionated starter kit for developing TypeScript and/or React NPM packages. It comes with a several pre-configured tools, so you could focus on coding instead of configuring a project for the nth time. From building to releasing a package, this starter kit has you covered.\n\n\u003e 👋 Hello there! Follow me [@linesofcode](https://twitter.com/linesofcode) or visit [linesofcode.dev](https://linesofcode.dev) for more cool projects like this one.\n\n## 🏃 Getting started\n\n```console\nnpx degit TimMikeladze/typescript-react-package-starter my-package\n\ncd my-package \u0026\u0026 git init\n\npnpm install \u0026\u0026 pnpm dev\n```\n\n❗Important note: This project uses [pnpm](https://pnpm.io/) for managing dependencies. If you want to use another package manager, remove the `pnpm-lock.yaml` and control-f for usages of `pnpm` in the project and replace them with your package manager of choice. If you don't have `pnpm` installed and want to use it, you can install it by running `npm install -g pnpm`.\n\n## What's included?\n\n- ⚡️ [tsup](https://github.com/egoist/tsup) - The simplest and fastest way to bundle your TypeScript libraries. Used to bundle package as ESM and CJS modules. Supports TypeScript, Code Splitting, PostCSS, and more out of the box.\n- 📖 [Storybook](https://storybook.js.org/) - Build UI components and pages in isolation. It streamlines UI development, testing, and documentation.\n- 🧪 [Vitest](https://vitest.dev/) - A testing framework for JavaScript. Preconfigured to work with TypeScript and JSX.\n- ✅ [Biome](https://biomejs.dev/) - Format, lint, and more in a fraction of a second.\n- 🪝 [Lefthook](https://github.com/evilmartians/lefthook) — Run pre-commit hooks, lints staged files, executes tests, and more.\n- 🔼 [Release-it](https://github.com/release-it/release-it/) - release-it is a command line tool to automatically generate a new GitHub Release and populates it with the changes (commits) made since the last release.\n- 🐙 [Test \u0026 Publish via Github Actions](https://docs.github.com/en/actions) - CI/CD workflows for your package. Run tests on every commit plus integrate with Github Releases to automate publishing package to NPM and Storybook to Github Pages.\n- 🤖 [Dependabot](https://docs.github.com/en/code-security/dependabot) - Github powered dependency update tool that fits into your workflows. Configured to periodically check your dependencies for updates and send automated pull requests.\n- 🏃‍♀️‍➡️ [TSX](https://github.com/privatenumber/tsx) - Execute TypeScript files with zero-config in a Node.js environment.\n\n## Usage\n\n### 💻 Developing\n\nWatch and rebuild code with `tsup` and runs Storybook to preview your UI during development.\n\n```console\npnpm dev\n```\n\nRun all tests and watch for changes\n\n```console\npnpm test\n```\n\n### 🏗️ Building\n\nBuild package with `tsup` for production.\n\n```console\npnpm build\n```\n\n### ▶️ Running files written in TypeScript\n\nTo execute a file written in TypeScript inside a Node.js environment, use the `tsx` command. This will detect your `tsconfig.json` and run the file with the correct configuration. This is perfect for running custom scripts while remaining type-safe.\n\n```console\npnpm tsx ./path/to/file.ts\n```\n\nThis is useful for running scripts, starting a server, or any other code you want to run while remaining type-safe.\n\n### 🖇️ Linking\n\nOften times you want to `link` this package to another project when developing locally, circumventing the need to publish to NPM to consume it.\n\nIn a project where you want to consume your package run:\n\n```console\npnpm link my-package --global\n```\n\nLearn more about package linking [here](https://pnpm.io/cli/link).\n\n### 📩 Committing\n\nWhen you are ready to commit simply run the following command to get a well formatted commit message. All staged files will automatically be linted and fixed as well.\n\n```console\npnpm commit\n```\n\n### ✅ Linting\n\nTo lint and reformat your code at any time, simply run the following command. Under the hood, this uses [Biome](https://biomejs.dev/). If you use VSCode, I suggest installing the official [biome extension](https://marketplace.visualstudio.com/items?itemName=biomejs.biome).\n\n```console\npnpm lint\n```\n\n### 🔖 Releasing, tagging \u0026 publishing to NPM\n\nCreate a semantic version tag and publish to Github Releases. When a new release is detected a Github Action will automatically build the package and publish it to NPM. Additionally, a Storybook will be published to Github pages.\n\nLearn more about how to use the `release-it` command [here](https://github.com/release-it/release-it).\n\n```console\npnpm release\n```\n\nWhen you are ready to publish to NPM simply run the following command:\n\n```console\npnpm publish\n```\n\n#### 🤖 Auto publish after Github Release (or manually by dispatching the Publish workflow)\n\n❗Important note: in order to automatically publish a Storybook on Github Pages you need to open your repository settings, navigate to \"Actions\" and enable **\"Read \u0026 write permissions\"** for Workflows. Then navigate to \"Pages\" and choose **\"GitHub Actions\"** as the source for the Build and Deployment. After a successful deployment you can find your Storybook at `https://\u003cyour-github-username\u003e.github.io/\u003cyour-repository-name\u003e/`.\n\n❗Important note: in order to publish package to NPM you must add your token as a Github Action secret. Learn more on how to configure your repository and publish packages through Github Actions [here](https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages).\n\n## 🎨 CSS \u0026 PostCSS\n\nTo bundle CSS files with your package that you intend on users to import within their own project, a few extra steps are required.\n\n1. Add your CSS files to the `src` directory. For example, `src/styles.css`.\n2. Modify `tsup.config.ts` file to include your CSS file as an entry point. For example:\n\n```ts\nimport { defineConfig } from \"tsup\";\n\nexport default defineConfig({\n\tentry: [\"src/index.ts\", \"src/styles.css\"],\n\t// ...\n});\n```\n\n3. Modify `package.json` to include the CSS file as an `exports` entry. For example:\n\n```json\n{\n\t\"exports\": {\n\t\t\"./styles.css\": \"./dist/styles.css\"\n\t}\n}\n```\n\n4. Now consumers of your package can import your CSS file anywhere in their project. For example:\n\n```ts\nimport \"your-package/styles.css\";\n```\n\nAlternatively, if your package has a hard dependency on a CSS file and you want it to always be loaded when your package is imported, you can import it anywhere within your package's code and it will be bundled with-in your package.\n\n[tsup](https://github.com/egoist/tsup) supports PostCSS out of the box. Simply run `pnpm add postcss -D` add a `postcss.config.js` file to the root of your project, then add any plugins you need. Learn more how to configure PostCSS [here](https://tsup.egoist.dev/#css-support).\n\nAdditionally consider using the [tsup](https://github.com/egoist/tsup) configuration option `injectStyle` to inject the CSS directly into your Javascript bundle instead of outputting a separate CSS file.\n\n## 🚀 Built something using this starter-kit?\n\nThat's awesome! Feel free to add it to the list.\n\n🗃️ **[Next Upload](https://github.com/TimMikeladze/next-upload)** - Turn-key solution for integrating Next.js with signed \u0026 secure file-uploads to an S3 compliant storage service such as R2, AWS, or Minio.\n\n🏁 **[Next Flag](https://github.com/TimMikeladze/next-flag)** - Feature flags powered by GitHub issues and NextJS. Toggle the features of your app by ticking a checkbox in a GitHub issue. Supports server-side rendering, multiple environments, and can be deployed as a stand-alone feature flag server.\n\n🔒 **[Next Protect](https://github.com/TimMikeladze/next-protect)** - Password protect a Next.js site. Supports App Router, Middleware and Edge Runtime.\n\n📮 **[Next Invite](https://github.com/TimMikeladze/next-invite)** - A drop-in invite system for your Next.js app. Generate and share invite links for users to join your app.\n\n🔐 **[Next Auth MUI](https://github.com/TimMikeladze/next-auth-mui)** - Sign-in dialog component for NextAuth built with Material UI and React. Detects configured OAuth and Email providers and renders buttons or input fields for each respectively. Fully themeable, extensible and customizable to support custom credential flows.\n\n⌚️ **[Next Realtime](https://github.com/TimMikeladze/next-realtime)** - Experimental drop-in solution for real-time data leveraging the Next.js Data Cache.\n\n✅ **[Mui Joy Confirm](https://github.com/TimMikeladze/mui-joy-confirm)** - Confirmation dialogs built on top of [@mui/joy](https://mui.com/joy-ui/getting-started/) and react hooks.\n\n🗂️ **[Use FS](https://github.com/TimMikeladze/use-fs)** - A React hook for integrating with the File System Access API.\n\n🐙 **[Use Octokit](https://github.com/TimMikeladze/use-octokit)** - A data-fetching hook built on top of the Octokit and SWR for interacting with the Github API. Use this inside a React component for a type-safe, data-fetching experience with caching, polling, and more.\n\n🐌 **[Space Slug](https://github.com/TimMikeladze/space-slug)** - Generate unique slugs, usernames, numbers, custom words, and more using an intuitive api with zero dependencies.\n\n🌡️ **[TSC Baseline](https://github.com/TimMikeladze/tsc-baseline/)** - Save a baseline of TypeScript errors and compare new errors against it. Useful for type-safe feature development in TypeScript projects that have a lot of errors. This tool will filter out errors that are already in the baseline and only show new errors.\n\n✅ **[react-ai-translator](https://github.com/CodeThicket/react-ai-translator)** - A React hook for local, secure, on-demand translations powered by the Xenova/nllb-200-distilled-600M model. This package utilizes the WebGPU capabilities of the device on which the app runs, ensuring data privacy and enabling you to translate text without sending data to third-party APIs.\n\n♾️ **[react-infinite-observer](https://github.com/Tasin5541/react-infinite-observer)** - A simple hook to implement infinite scroll in react component, with full control over the behavior. Implemented with IntersectionObserver.\n\n\u003c/\u003e **[react-simple-devicons](https://github.com/shawilly/react-simple-devicons)** - A straightforward React implementation that provides access to SVG dev icons from (devicon.dev)[https://devicon.dev], allowing customization of color, size, and styling.\n\n🎋 **[GitHub Issue to Branch](https://github.com/TimMikeladze/github-issue-to-branch)** - CLI tool to quickly create well-named branches from GitHub issues.\n\n📏 **[React DevBar](https://github.com/TimMikeladze/react-devbar/)** - A customizable floating toolbar for React applications. Build and integrate your own dev tools with a draggable interface inspired by the Vercel toolbar. Perfect for adding debugging panels, theme controls, and other development utilities for your app.\n\n⏲️ **[Fake Time Series](https://github.com/TimMikeladze/fake-time-series/)** - A flexible CLI tool and library for generating fake time series data. Perfect for testing, development, and demonstration purposes.\n\n📡 **[Install Command](https://github.com/TimMikeladze/react-install-command/)** - A React component for rendering a 'npm install \u003cpackage name\u003e' command block. Supports multiple package managers.\n","funding_links":["https://ko-fi.com/linesofcodedev","https://www.paypal.me/TimMikeladze"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimmikeladze%2Ftypescript-react-package-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimmikeladze%2Ftypescript-react-package-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimmikeladze%2Ftypescript-react-package-starter/lists"}