Skip to content

Instantly share code, notes, and snippets.

@Ligalaiz
Ligalaiz / text.md
Last active April 13, 2022 14:53
Conventional Branches

Regular Git Branches

  • master - The master branch tracks released code only. The only commits to master are merges from release branches and hotfix branches.
  • release - containы all of the new stuff that has been finished.
  • develop - is the main development branch. The dev branch’s idea is to make changes in it and restrict the developers from making any changes in the master branch directly. Changes in the dev branch undergo reviews and, after testing, get merged with the master branch.
  • qa OR test - contains all the code for QA testing and automation testing of all changes implemented. Before any change goes to the production environment, it must undergo the QA testing to get a stable codebase.

Temporary Git Branches

  • bug – Bug branches will be created when there is a bug on the live site that should be fixed and merged into the next deployment.
@Ligalaiz
Ligalaiz / commit-msg
Last active March 19, 2022 16:16
Git hooks
#!/bin/bash
commitRegex='^(feat|fix|docs|refactor|test|build|ci|perf|style|test|init)'
if ! grep -qE "$commitRegex" "$1"; then
echo "Aborting according commit message policy. Please specify type commit issue 'feat' or another."
exit 1
fi
commitRegex='(STARDB-[0-9])'
if ! grep -qE "$commitRegex" "$1"; then
@Ligalaiz
Ligalaiz / text.md
Last active March 19, 2022 09:11
Conventional Commits

<type>[optional scope]: [JIRA task] <description>

Type

Must be one of the following:

  • init: Start project
  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • docs: Documentation only changes
  • feat: A new feature
#1
query {
topic(name:"graphql") {
relatedTopics{
name
}
}
}
#2

TypeScript Deep Partial Interface

export type DeepPartial<T> = T extends Function ? T : (T extends object ? { [P in keyof T]?: DeepPartial<T[P]>; } : T);
@Ligalaiz
Ligalaiz / .browserslistrc
Created November 8, 2021 12:41
instead of CRA
last 2 version
> 0.25%
not dead
// Файл "tsconfig.json":
// - устанавливает корневой каталог проекта TypeScript;
// - выполняет настройку параметров компиляции;
// - устанавливает файлы проекта.
// Присутствие файла "tsconfig.json" в папке указывает TypeScript, что это корневая папка проекта.
// Внутри "tsconfig.json" указываются настройки компилятора TypeScript и корневые файлы проекта.
// Программа компилятора "tsc" ищет файл "tsconfig.json" сначала в папке, где она расположена, затем поднимается выше и ищет в родительских папках согласно их вложенности друг в друга.
// Команда "tsc --project C:\path\to\my\project\folder" берет файл "tsconfig.json" из папки, расположенной по данному пути.
// Файл "tsconfig.json" может быть полностью пустым, тогда компилятор скомпилирует все файлы с настройками заданными по умолчанию.
// Опции компилятора, перечисленные в командной строке перезаписывают собой опции, заданные в файле "tsconfig.json".
'use strict';
// Требует node.js и пакета mkdirp
// Пакет mkdirp: https://www.npmjs.com/package/mkdirp#install — установить глобально или прописать установку в package.json, в секции devDependencies
// Использование:
// - поместить этот файл в корень проекта
// - исправить пути к генерируемым папкам и файлам, если блоки проекта лежат не в ./src/blocks/
// - в терминале, будучи в корневой папке проекта, выполнить node createBlock.js [имя блока] [доп. расширения через пробел]
const fs = require('fs'); // будем работать с файловой системой