{"id":26132309,"url":"https://github.com/joaofaveri/template-package","last_synced_at":"2026-04-05T22:06:04.924Z","repository":{"id":279733401,"uuid":"939652067","full_name":"joaofaveri/template-package","owner":"joaofaveri","description":"A comprehensive template for building production-ready npm packages with modern TypeScript.   Features include a fully configured TypeScript environment, automated semantic versioning and release, and standardized code quality tools including ESLint and Prettier","archived":false,"fork":false,"pushed_at":"2025-03-10T15:31:26.000Z","size":542,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T15:31:57.020Z","etag":null,"topics":["commitizen","commitlint","eslint","husky","lint-staged","npm","package","prettier","release-it","tsup","typescript"],"latest_commit_sha":null,"homepage":"https://www.legislato.com.br","language":"TypeScript","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/joaofaveri.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2025-02-26T22:08:34.000Z","updated_at":"2025-03-10T15:31:29.000Z","dependencies_parsed_at":"2025-02-27T05:39:40.649Z","dependency_job_id":"df87586e-534b-4120-81d4-310f474ac679","html_url":"https://github.com/joaofaveri/template-package","commit_stats":null,"previous_names":["joaofaveri/template-package"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaofaveri%2Ftemplate-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaofaveri%2Ftemplate-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaofaveri%2Ftemplate-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaofaveri%2Ftemplate-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joaofaveri","download_url":"https://codeload.github.com/joaofaveri/template-package/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242940015,"owners_count":20209883,"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":["commitizen","commitlint","eslint","husky","lint-staged","npm","package","prettier","release-it","tsup","typescript"],"created_at":"2025-03-10T23:00:59.387Z","updated_at":"2025-12-31T00:47:53.698Z","avatar_url":"https://github.com/joaofaveri.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Production-Ready TypeScript Package Template\n\nThis repository provides a basic template for creating Node.js packages with TypeScript, Jest, and ESLint.\n\n## Features\n\n* **TypeScript:** The project is configured to use TypeScript, ensuring static typing and improving code quality.\n* **Jest:** Unit tests are configured with Jest to ensure code reliability.\n* **ESLint:** ESLint is configured to maintain code consistency and follow best practices.\n* **Simplified Configuration:** The template offers a simplified initial configuration to facilitate the development of new packages.\n* **Husky:** Configured to run scripts on Git hooks.\n* **lint-staged:** Configured to run linters on staged files.\n* **commitlint:** Configured to enforce conventional commit message formats.\n* **release-it:** Configured to automate package releases.\n\n## How to Use\n\n1.  **Clone the repository:**\n\n    ```bash\n    git clone https://github.com/joaofaveri/template-package.git\n    cd template-package\n    ```\n\n2.  **Install dependencies:**\n\n    ```bash\n    npm install\n    ```\n3.  **Configure environment variables:**\n    * Copy `env-example` to `.env`.\n    * Replace `GITHUB_TOKEN` with your GitHub Personal Access Token.\n    * This token is required to automate GitHub operations, including creating releases and tags.\n\n4.  **Develop:**\n\n    * Modify the `src/` files with your package's code.\n    * Create unit tests in `tests/`.\n\n5.  **Run tests:**\n\n    ```bash\n    npm run test\n    ```\n\n6.  **Build the package:**\n\n    ```bash\n    npm run build\n    ```\n\n7.  **Publish the package (optional):**\n\n    ```bash\n    npm run release\n    ```\n\n## Configurations\n\n* **TypeScript:** TypeScript settings can be adjusted in the `tsconfig.json` file.\n* **Jest:** Jest settings can be adjusted in the `jest.config.js` file.\n* **ESLint:** ESLint settings can be adjusted in the `.eslintrc.json` file.\n* **Husky:** Husky settings can be adjusted in the `.husky` directory and `package.json` file.\n* **lint-staged:** lint-staged settings can be adjusted in the `package.json` and `.lintstagedrc.json` files.\n* **commitlint:** commitlint settings can be adjusted in the `commitlint.config.js` file.\n* **release-it:** release-it settings can be adjusted in the `.release-it.ts` and `changelog.config.cjs` files.\n\n### commitlint\n\n* The `commitlint.config.js` file allows you to customize the commit message format.\n    * It uses the `conventional-changelog-conventionalcommits` preset, which enforces a standardized commit message format.\n    * You can define rules to enforce specific conventions for commit message headers, scopes, and types.\n    * **Available Rules:**\n        * `header-case`: Enforces the case of the commit header (e.g., lowercase, uppercase).\n        * `header-full-stop`: Enforces or prohibits a full stop at the end of the commit header.\n        * `header-max-length`: Enforces a maximum length for the commit header.\n        * `header-min-length`: Enforces a minimum length for the commit header.\n        * `body-case`: Enforces the case of the commit body.\n        * `body-full-stop`: Enforces or prohibits a full stop at the end of the commit body.\n        * `body-leading-blank`: Enforces or prohibits a leading blank line for the commit body.\n        * `body-max-line-length`: Enforces a maximum line length for the commit body.\n        * `body-min-line-length`: Enforces a minimum line length for the commit body.\n        * `footer-case`: Enforces the case of the commit footer.\n        * `footer-full-stop`: Enforces or prohibits a full stop at the end of the commit footer.\n        * `footer-leading-blank`: Enforces or prohibits a leading blank line for the commit footer.\n        * `footer-max-line-length`: Enforces a maximum line length for the commit footer.\n        * `footer-min-line-length`: Enforces a minimum line length for the commit footer.\n        * `scope-case`: Enforces the case of the commit scope.\n        * `scope-empty`: Enforces or prohibits an empty commit scope.\n        * `scope-enum`: Enforces specific values for the commit scope.\n        * `scope-max-length`: Enforces a maximum length for the commit scope.\n        * `scope-min-length`: Enforces a minimum length for the commit scope.\n        * `subject-case`: Enforces the case of the commit subject.\n        * `subject-empty`: Enforces or prohibits an empty commit subject.\n        * `subject-full-stop`: Enforces or prohibits a full stop at the end of the commit subject.\n        * `subject-max-length`: Enforces a maximum length for the commit subject.\n        * `subject-min-length`: Enforces a minimum length for the commit subject.\n        * `type-case`: Enforces the case of the commit type.\n        * `type-empty`: Enforces or prohibits an empty commit type.\n        * `type-enum`: Enforces specific values for the commit type.\n    * Example: Enforce a specific format for commit message headers.\n\n### lint-staged\n\n* The `lint-staged` configuration in `.lintstagedrc.json` defines which linters to run on staged files.\n    * All staged files will be checked by `eslint --fix` to automatically fix linting errors.\n    * You can specify different linters for different file types.\n    * Example: Run ESLint on staged `.ts` files and Prettier on staged `.js` and `.json` files.\n\n### Changelog\n\n* The `release-it` configuration in `.release-it.ts` automates changelog generation.\n    * It uses `@release-it/conventional-changelog` and `conventionalcommits` preset to generate a changelog based on commit messages.\n    * The `template` folder contains templates for changelog generation, allowing for customization of the output format.\n    * You can customize the changelog format and content.\n* When using `release-it` the changelog is auto generated during releases.\n* For a better commit prompt experience, this package use `commitizen` and `git-cz` to trigger the interactive commit prompt.\n* The `changelog.config.cjs` file allows you to configure the commit prompt, including possible scopes.\n\n## Scripts\n\n* `npm run build`: Compiles TypeScript code to JavaScript.\n* `npm run test`: Runs unit tests with Jest.\n\n## Contribution\n\nContributions are welcome! Feel free to open issues and pull requests.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoaofaveri%2Ftemplate-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoaofaveri%2Ftemplate-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoaofaveri%2Ftemplate-package/lists"}