{"id":25035107,"url":"https://github.com/liinkiing/next-ts-starter","last_synced_at":"2025-04-13T19:24:04.891Z","repository":{"id":47903562,"uuid":"196105182","full_name":"Liinkiing/next-ts-starter","owner":"Liinkiing","description":"A Next.JS powered Typescript starter with styled components, styled-system, framer motion, jest and cypress","archived":false,"fork":false,"pushed_at":"2022-06-13T21:07:07.000Z","size":901,"stargazers_count":28,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T10:06:16.910Z","etag":null,"topics":["cypress","framer-motion","jest","next","nextjs","react","starter","styled-components","styled-system","template","testing","typescript"],"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/Liinkiing.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}},"created_at":"2019-07-10T01:00:01.000Z","updated_at":"2023-06-25T22:03:34.000Z","dependencies_parsed_at":"2022-08-31T15:00:38.317Z","dependency_job_id":null,"html_url":"https://github.com/Liinkiing/next-ts-starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Liinkiing%2Fnext-ts-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Liinkiing%2Fnext-ts-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Liinkiing%2Fnext-ts-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Liinkiing%2Fnext-ts-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Liinkiing","download_url":"https://codeload.github.com/Liinkiing/next-ts-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248766740,"owners_count":21158310,"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":["cypress","framer-motion","jest","next","nextjs","react","starter","styled-components","styled-system","template","testing","typescript"],"created_at":"2025-02-05T23:45:08.910Z","updated_at":"2025-04-13T19:24:04.866Z","avatar_url":"https://github.com/Liinkiing.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Next Starter\n\nA starter to bootstrap your **Next** application (nice pun gg)\n\n## Usage\n\n```bash\n$ yarn\n# install dependencies\n\n$ yarn dev\n# launch Next dev script\n\n$ yarn build\n# launch Next build script\n\n$ yarn start\n# launch Next start script\n\n$ yarn test\n# launch test suite\n\n$ yarn cy:open\n# open cypress (you first need to install deps in cypress folder)\n\n$ yarn ts:check\n# check TypeScript\n\n$ yarn lint\n# run ESLint\n```\n\n## Next config\n\nIt comes already configured with some nice plugin. You can see in `next.config.js` what is\nused. In short, it allows support of importing images files and fonts within webpack.\nIt also comes with **NProgress** support by default, so it shows a small loading bar in top of\nthe page when loading. You can find the component in `~/components/NProgress.tsx`, and it is used in the\ncustom `_app.tsx`\n\n## Styled component\n\nThe template comes with [styled-components](https://github.com/styled-components/styled-components).\nAgain, you can either choose to not use it, this is a personal choice.\nYou can also find a `styles` folder, which contains many related\nstyled-components files to keep things organized. It's also includes all themes-related stuff in here.\nIt's again a personal convention that I follow, feel free to annihilate this directory if you want 😢\n\n## Styled system\n\nIt also comes with [styled-system](https://github.com/styled-system/styled-system). It is a great way to\nbuild reusable UI blocks with a great props API and consistent spaces / typography.\nA lot comes from the theme, provided in `~/styles/themes/base.ts` where we define some\nbreakpoints, spacings and typography stuff. It allows then the custom `AppBox` component (`~/ui/AppBox`)\nto be aware of your theme and then build something amazing with the primitives.\nBy default, this starter provides some basic examples components that uses this pattern, for\nexample the `AppNav` component (`~/components/layout/AppNav`).\n\n🔥 It also supports and provides autocomplete for props that takes source from the theme (e.g `bg`, `zIndex`, `border`...). 🔥\n\n**TypeScript \u003e 4.1** is mandatory because I'm using the new [Template Litteral Types](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#template-literal-types) to\nprovide autocompletion of the color prop based of the nested `colors` object, so when using\n`bg` prop for exemple, you should have autocompletion for `red.xxx, blue.xxx` or anything defined in your `colors.ts`.\nIt supports nested elements with a dot notation! (that's why TS 4.1 is required)\n\n## Framer motion\n\nAgain, personal preference here, but the starter comes with framer motion already configured\nto handle Next pages changes and enable some smooth transitions when navigating. You\ncan find the default variant used for the page transitions in `~/common/framer.ts`.\n\n## Testing\n\n[Jest](https://github.com/facebook/jest) and [@testing-library/react](https://github.com/testing-library/react-testing-library) is used to run your tests. It comes preconfigured\nwith [ts-jest](https://github.com/kulshekhar/ts-jest) so your tests also checks your types.\nYou can look the **jest.config.js** and the file **setupTest.ts** to see what's in there.\n[jest-styled-components](https://github.com/styled-components/jest-styled-components) is also used to have deterministic classNames\nwithin your styled components that you are testing.\n[Cypress](https://cypress.io) starter for e2e tests. Take a look at Cypress config file **cypress.json**\n\n### Cypress\n\nThis starter comes by default with [Cypress](https://cypress.io) and some sensible defaults and a custom plugin which enable you to\ninject your .env\\* files in the Cypress.env helper. It also add support for a per-environment configuration file.\nJust add a cypress.\u003cenv\u003e.json. It uses by default the `cypress.json` and then extend the configuration if you have\na `cypress.\u003cenv\u003e.json`. Take a look at the various configuration file in the `cypress` folder and the custom plugin in `cypress/plugins/index.ts`.\nThis folder is independant and lives by itself, so it has his own dependencies / scripts / tsconfig and do not pollute the\nglobal namespace. [See why an isolated folder](https://basarat.gitbook.io/typescript/intro-1/cypress#installation)\n\nIt also have an opiniated way of interacting with some of your webpages in Cypress. As your application\nwill grow (and pages would become complex), it's recommended to have some sort of \"Page objects\" which allows\nyou to work in a more conveniant way for some complex page. See more here https://basarat.gitbook.io/typescript/intro-1/cypress#tip-creating-page-objects\n\n## Aliases\n\nIt includes by default support for aliases in `tsconfig.json`.\nThey are 1 defaulted alias, ready to use :\n\n```typescript\n// ~ refers to src folder\nimport { something } from '~/file'\n```\n\nYou can also use for your convenience the global `__DEV__` variable, which is\ninjected by webpack with the DefinePlugin (see **next.config.js**).\n\n## @types and extending modules\n\nIt also includes a `@types` directory under **src**, so you can easily\nseparate your types or extends some external modules. They are also included in the `tsconfig.json`\nFor example, if some package named `foo` does not have any types in [DefinitelyTyped](https://definitelytyped.org/), you could\nadd a `index.d.ts` under `src/@types/foo/index.d.ts`. It is just my personal convention, so do as you want!\n\n```typescript\n// src/@types/foo/index.d.ts\n\n// to make sure Typescript get the original types from the module (if any)\nimport * as foo from 'foo'\n\ndeclare module 'foo' {\n  declare function foo(bar: string): boolean\n}\n```\n\nBecause the `@types` directory is declared in `typeRoots`, Typescript will no longer complain if you imported your package with missing types\n\n## Tooling\n\nThe template includes [Prettier](https://prettier.io/), [ESLint](https://eslint.org/) (with [Typescript-eslint](https://github.com/typescript-eslint/typescript-eslint)), [Babel](https://babeljs.io/) and [lint-staged](https://github.com/okonet/lint-staged).\nAll their related configurations are in the `*rc` files (except for lint-staged, which is located in the `package.json`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliinkiing%2Fnext-ts-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliinkiing%2Fnext-ts-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliinkiing%2Fnext-ts-starter/lists"}