From ddff5b428f7811f1192ad80ec323253baa0533e0 Mon Sep 17 00:00:00 2001 From: Krsiak Daniel Date: Wed, 25 Dec 2024 23:34:12 +0100 Subject: [PATCH] =?UTF-8?q?docs(readme):=20=F0=9F=93=9D=20update=20develop?= =?UTF-8?q?ment=20info?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-development.md | 81 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 74 insertions(+), 7 deletions(-) diff --git a/README-development.md b/README-development.md index 582b49e0..6deff559 100644 --- a/README-development.md +++ b/README-development.md @@ -7,10 +7,12 @@ Development environment for the project. - [Development](#development) - [💻 Commands](#-commands) - [Install dependencies](#install-dependencies) - - [Update outdated dependencies](#update-outdated-dependencies) - - [Manually](#manually) - - [Using `npm-check-updates` tool](#using-npm-check-updates-tool) + - [Update outdated dependencies](#update-outdated-dependencies) + - [Manually](#manually) + - [Using tool `npm-check-updates`](#using-tool-npm-check-updates) - [💅 Prettier](#-prettier) + - [Imports Sorting Order](#imports-sorting-order) + - [Import Example](#import-example) --- @@ -34,11 +36,11 @@ npm run dev Open [http://localhost:3000](http://localhost:3000) to view project in browser. -### Update outdated dependencies +## Update outdated dependencies There are 2 ways to do this. -#### Manually +### Manually Find what packages are outdated and upgrade to latest version if possible. @@ -46,9 +48,9 @@ Find what packages are outdated and upgrade to latest version if possible. npm outdated ``` -#### Using `npm-check-updates` tool +### Using tool `npm-check-updates` -To update the outdated packages in package.json, you can use the [npm-check-updates](https://www.npmjs.com/package/npm-check-updates) (ncu) tool. +To update the outdated packages in package.json, you can use the NCU tool: [npm-check-updates](https://www.npmjs.com/package/npm-check-updates) Install `npm-check-updates` globally. @@ -93,3 +95,68 @@ Format the code via Prettier. ```bash npm run prettier:fix ``` + +## Imports Sorting Order + +Sorting order for imports in files: + +1. Third-Party Library Imports +2. Custom Hooks +3. Components +4. Data +5. Utils +6. Interfaces and Helpers +7. Images +8. CSS + +## Import Example + +```ts +// Third-Party Library Imports +import type { Metadata } from 'next' +import { Inter } from 'next/font/google' +import { ReactNode } from 'react' +``` + +```ts +// Custom Hooks +import { useScrollProgress } from '@/hooks/useScrollProgress' +``` + +```ts +// Components +import PageContainer from '@/components/layout/PageContainer' +import PageNavigation from '@/components/page-navigation/PageNavigation' +import Header from '@/components/header/Header' +import Footer from '@/components/footer/Footer' +``` + +```ts +// Data +import { mindset } from '@/data/expertise/mindset' +import { iconsSkills1 } from '@/data/skills/skillsMain' +``` + +```ts +// Utils +import { TEXT } from '@/localization/english' +import { DATA_TEST_IDS } from '@/utils/constants/ids/dataTestIds' +import { PAGES_URL } from '@/utils/constants/urls/pageUrls' +``` + +```ts +// Interfaces and Helpers +import { getGoBackLinkID } from '@/utils/helpers/getGoBackLink' +import { HeaderSectionProps } from '@/utils/interfaces/componentProps' +import { NavigationDirectionEnum } from '@/utils/interfaces/enums' +``` + +```ts +// Images +import logo from '@/public/images/webp/logo.webp' +``` + +```ts +// CSS +import '@/app/custom.css' +```