### Install @cloud-ru/ft-solidarity Source: https://github.com/cloud-ru-tech/frontend-tools/blob/master/packages/solidarity/README.md Install the package using npm. ```bash npm i @cloud-ru/ft-solidarity ``` -------------------------------- ### Configuration File Example Source: https://github.com/cloud-ru-tech/frontend-tools/blob/master/packages/deps-validator/README.md Configure the validator using a deps-validator.config.json file in your repository's root. Settings here have lower priority than CLI arguments. ```json { "rootPackagesFolderPattern": "packages/*", "ignoredPackagesFolderFiles": ["packages/tsconfig.cjs.json"], "ignoreFilePatterns": ["dist", "__tests__"], "ignorePackagePatterns": ["react", "react-dom"], "packages": { "package-name": { "ignoreFilePatterns": ["build"], "ignorePackagePatterns": ["@some/package"] } } } ``` -------------------------------- ### Install @cloud-ru/ft-deps-validator Source: https://github.com/cloud-ru-tech/frontend-tools/blob/master/packages/deps-validator/README.md Install the dependency validator package using npm. ```bash npm i @cloud-ru/ft-deps-validator ``` -------------------------------- ### Import and Use Formatters Source: https://github.com/cloud-ru-tech/frontend-tools/blob/master/packages/formatters/README.md Import and use various formatting functions from the package. Examples include formatting bytes, truncating strings, converting to Uint8Array, formatting dates and numbers, and base64 conversions. ```typescript import { truncateString, formatBytes, toUint8Array, formatNumber, formatDate, } from '@cloud-ru/ft-formatters'; formatBytes(764456); // output: 764.46 КБ formatBytes(764456, formatBytes.languages.En); // output: 764.46 KB truncateString('very long text will be truncated to 7 symbols and 3 dots', 10); // output: very lo... toUint8Array('inputBase64Str'); // output: Uint8Array formatDate('2023-01-20T11:15:00', formatDate.formatters.DateTime); // output: 20.01.2023 11:15:00 formatNumber(-10.55555, { softPrecision: 3 }); // output: -10.56 stringToBase64('string'); // output: c3RyaW5n base64ToString('c3RyaW5n'); // output: string ``` -------------------------------- ### Install and Configure Storybook Dependencies Graph Addon Source: https://github.com/cloud-ru-tech/frontend-tools/blob/master/packages/storybook-deps-graph-addon/README.md Install the addon using npm and add it to your Storybook configuration file (.storybook/main.js). ```bash npm i @cloud-ru/ft-storybook-dependencies-graph-addon ``` ```javascript // .storybook/main.js в массив addons добавить запись addons: [ '@cloud-ru/ft-storybook-dependencies-graph-addon', ...другие аддоны ] ``` -------------------------------- ### Importing Debug Mode Utilities Source: https://github.com/cloud-ru-tech/frontend-tools/blob/master/packages/debug-mode/README.md Demonstrates how to import the main functions from the @cloud-ru/ft-debug-mode package. ```APIDOC import { isDebugModeEnabled, enableDebugMode, disableDebugMode, configureDevAlerts } from '@cloud-ru/ft-debug-mode'; ``` -------------------------------- ### Run Solidarity Validation Source: https://github.com/cloud-ru-tech/frontend-tools/blob/master/packages/solidarity/README.md After creating a .solidarity file in your project root, run the validation using npx. ```bash npx solidarity ``` -------------------------------- ### Configuring and Using Development Alerts Source: https://github.com/cloud-ru-tech/frontend-tools/blob/master/packages/debug-mode/README.md Shows how to configure development alerts with a specific scope and use the returned error/warning functions to log messages conditionally. ```APIDOC const { error, warning } = configureDevAlerts('someScope'); const condition = somethingThatIsBoolean; // boolean condition /* the message in console will be shown only if condition === true */ error(condition, 'message'); // DEV_ALERT(someScope): message warning(condition, 'message'); // DEV_ALERT(someScope): message ``` -------------------------------- ### Configure and Use Dev Alerts Source: https://github.com/cloud-ru-tech/frontend-tools/blob/master/packages/debug-mode/README.md Import necessary functions, configure development alerts for a specific scope, and then use the returned error and warning functions to log messages conditionally. The messages are only displayed in the console if the provided condition is true. ```typescript import { isDebugModeEnabled, enableDebugMode, disableDebugMode, configureDevAlerts } from '@cloud-ru/ft-debug-mode'; const { error, warning } = configureDevAlerts('someScope'); const condition = somethingThatIsBoolean; // boolean condition /* the message in console will be shown only if condition === true */ error(condition, 'message'); // DEV_ALERT(someScope): message warning(condition, 'message'); // DEV_ALERT(someScope): message ``` -------------------------------- ### Basic Usage via npx Source: https://github.com/cloud-ru-tech/frontend-tools/blob/master/packages/deps-validator/README.md Run the dependency validator from the root of your repository using npx. It automatically detects monorepo structure. ```bash npx @cloud-ru/ft-deps-validator ``` -------------------------------- ### Lerna Configuration for Changelog Source: https://github.com/cloud-ru-tech/frontend-tools/blob/master/packages/conventional-changelog/README.md Configure lerna to use this conventional changelog preset for generating version and changelog information. Set changelogPreset to '@cloud-ru/ft-conventional-changelog'. ```json { "packages": [ "packages/*" ], "version": "independent", "command": { "publish": { "ignoreChanges": ["ignored-file", "*.md"], "message": "[ci skip] Version bump", "registry": "TODO://" }, "version": { "changelogPreset": "@cloud-ru/ft-conventional-changelog", // <--- HERE "ignoreChanges": [ "**/*.md", "**/*.MD", "**/*.mdx", "**/*.MDX", "./scripts/**/*" ] }, "create": { "license": "Apache-2.0" } } } ``` -------------------------------- ### Custom Packages Folder Pattern Source: https://github.com/cloud-ru-tech/frontend-tools/blob/master/packages/deps-validator/README.md If your monorepo's packages are located in a non-standard directory, use the --rootPackagesFolderPattern or -p option. ```bash npx @cloud-ru/ft-deps-validator --rootPackagesFolderPattern "apps/*" ``` ```bash npx @cloud-ru/ft-deps-validator -p "apps/*" ``` -------------------------------- ### Specify Working Directory Source: https://github.com/cloud-ru-tech/frontend-tools/blob/master/packages/deps-validator/README.md Execute the validator from a different directory by specifying the --cwd or -d option. ```bash npx @cloud-ru/ft-deps-validator --cwd /path/to/your/repo ``` ```bash npx @cloud-ru/ft-deps-validator -d /path/to/your/repo ``` -------------------------------- ### Semantic Release Configuration Source: https://github.com/cloud-ru-tech/frontend-tools/blob/master/packages/conventional-changelog/README.md Configure semantic-release to use this conventional changelog preset. Ensure the config property points to '@cloud-ru/ft-conventional-changelog'. ```javascript export const defaultReleaseConfig = (config?: ReleaseConfig) => ({ tagFormat: 'npm${version}', branches: ['master'], plugins: [ '@semantic-release/commit-analyzer', [ '@semantic-release/release-notes-generator', { config: '@cloud-ru/ft-conventional-changelog', // <--- HERE }, ], ... ``` -------------------------------- ### Ignore Specific File Patterns Source: https://github.com/cloud-ru-tech/frontend-tools/blob/master/packages/deps-validator/README.md Use the --ignoreFilePatterns option to exclude specific directories or files from being checked for unused dependencies. ```bash npx @cloud-ru/ft-deps-validator --ignoreFilePatterns "stories" "dist" "__tests__" ``` -------------------------------- ### Ignore Specific Packages Source: https://github.com/cloud-ru-tech/frontend-tools/blob/master/packages/deps-validator/README.md Use the --ignorePackagePatterns option to exclude specific packages from being flagged as unused or missing. ```bash npx @cloud-ru/ft-deps-validator --ignorePackagePatterns "react" "react-dom" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.