{"id":16552079,"url":"https://github.com/woliveiras/vite-react-template","last_synced_at":"2025-03-21T10:32:11.504Z","repository":{"id":219438974,"uuid":"749005918","full_name":"woliveiras/vite-react-template","owner":"woliveiras","description":"Vitejs and React starting template using Git Hooks, Vitest and Vitest UI and react-testing-library","archived":false,"fork":false,"pushed_at":"2024-05-27T08:59:33.000Z","size":541,"stargazers_count":12,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T00:37:30.801Z","etag":null,"topics":["vite","vite-react","vite-react-typescript","vite-react-typescript-template","vite-template","vitejs","vitejs-react","vitejs-react-typescript","vitejs-template"],"latest_commit_sha":null,"homepage":"","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/woliveiras.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","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},"funding":{"github":"woliveiras","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2024-01-27T10:00:20.000Z","updated_at":"2024-12-04T10:38:14.000Z","dependencies_parsed_at":"2024-02-27T10:17:55.485Z","dependency_job_id":"228dcf4e-017e-4bac-8441-b972a4140976","html_url":"https://github.com/woliveiras/vite-react-template","commit_stats":null,"previous_names":["woliveiras/vite-react-template"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woliveiras%2Fvite-react-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woliveiras%2Fvite-react-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woliveiras%2Fvite-react-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woliveiras%2Fvite-react-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/woliveiras","download_url":"https://codeload.github.com/woliveiras/vite-react-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244777996,"owners_count":20508827,"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":["vite","vite-react","vite-react-typescript","vite-react-typescript-template","vite-template","vitejs","vitejs-react","vitejs-react-typescript","vitejs-template"],"created_at":"2024-10-11T19:43:53.327Z","updated_at":"2025-03-21T10:32:11.064Z","avatar_url":"https://github.com/woliveiras.png","language":"TypeScript","readme":"# vite-react-template\n\nVitejs and React starting template using Git Hooks, Vitest, and Vitest UI and react-testing-library.\n\n## \u003ca name='ReactTypeScriptVite'\u003e\u003c/a\u003eReact + TypeScript + Vite\n\nThis template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.\n\nBased on default [vite react + typescript template](https://vitejs.dev/guide/).\n\nMaybe you will need help to create some GitHub Actions or another .github configuration. So, you can check my other template for it: [woliveiras/.github](https://github.com/woliveiras/.github)\n\n---\n\n**Table of Contents**\n\n\u003c!-- vscode-markdown-toc --\u003e\n\n- [React + TypeScript + Vite](#ReactTypeScriptVite)\n- [How to use this template](#Howtousethistemplate)\n- [How to run this project](#Howtorunthisproject)\n- [Running the tests](#Runningthetests)\n- [Watching tests in UI mode](#WatchingtestsinUImode)\n\n\u003c!-- vscode-markdown-toc-config\n\tnumbering=false\n\tautoSave=true\n\t/vscode-markdown-toc-config --\u003e\n\u003c!-- /vscode-markdown-toc --\u003e\n\n## \u003ca name='Howtousethistemplate'\u003e\u003c/a\u003eHow to use this template\n\nYou just need to click on the button `Use this template` close to the reppo stars (remember to give me a star to make me happy) and start a new repo or open it in code space.\n\n**It would be good if you knew this before starting**\n\nWe are using:\n\n- [Husky](https://typicode.github.io/husky/) to run the Git Hooks;\n- [NVM](https://github.com/nvm-sh/nvm) to handle the Node versions;\n\nYou can update environment variables in the files:\n\n- [.env](./.env): the base env vile, the variables here will be used in all environments\n- [.env.development](./.env): the development mode, just read in your local environment (npm run dev)\n- [.env.production](./.env): the production mode, will be read in your production environment (npm run build)\n\nAnd you can create new variables with the prefix `VITE_`.\n\nExample: `VITE_EXAMPLE_VAR`.\n\nIn the [App.tsx](./src/App.tsx) you can see the use of `import.meta.env` to import env variables.\n\n## \u003ca name='Howtorunthisproject'\u003e\u003c/a\u003eHow to run this project\n\nFirst of all, let's configure our enviroment.\n\nYou will need NVM installed on your environment. So, get the latest version here: [nvm-sh/nvm](https://github.com/nvm-sh/nvm)\n\nInstall the `.nvmrc` Node version with the following command:\n\n```sh\nnvm install\n```\n\nAfter that, you can use it with:\n\n```sh\nnvm use\n```\n\nNow, we can install the application dependencies and start our dev-server with the commands below:\n\n```sh\nnpm i\nnpm run dev\n```\n\n## \u003ca name='Runningthetests'\u003e\u003c/a\u003eRunning the tests\n\nRunning all tests:\n\n```sh\nnpm t\n```\n\nWatching all tests:\n\n```sh\nnpm run test:watch\n```\n\nTo watch one file, you just need to add the path in the watch command:\n\n```sh\nnpm run test:watch src/components/Example/Example.test.tsx\n```\n\nTo run the coverage, you just need this command:\n\n```sh\nnpm run coverage\n```\n\n## \u003ca name='WatchingtestsinUImode'\u003e\u003c/a\u003eWatching tests in UI mode\n\nIf you don't know, we can use a UI to run our tests and check dependency graph like the following screenshots.\n\nYou just need to run the command:\n\n```sh\nnpm run test:ui\n```\n\n| Screenshots                                                        |\n| ------------------------------------------------------------------ |\n| ![Vitest UI Dashboard](.github/doc/img/vites-ui-dashboard.png)     |\n| ![Vitest UI Test File](.github/doc/img/vitest-ui-test-file.png)    |\n| ![Vitest UI Dependency Graph](.github/doc/img/vitest-ui-graph.png) |\n","funding_links":["https://github.com/sponsors/woliveiras"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoliveiras%2Fvite-react-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwoliveiras%2Fvite-react-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoliveiras%2Fvite-react-template/lists"}