### Rush Monorepo Setup and Commands (Bash) Source: https://context7.com/hcengineering/huly.utils/llms.txt Commands for setting up and managing a monorepo using Rush. This includes global installation of Rush, cloning the repository, installing dependencies, building packages, and common Rush commands for updating, building, versioning, and publishing. ```bash # Install Rush globally npm install -g @microsoft/rush # Clone and setup the repository git clone https://github.com/hcengineering/huly.utils.git cd huly.utils # Install dependencies for all packages rush install # Build all packages rush build ``` ```bash # Common Rush commands: # rush update - Update package dependencies # rush rebuild - Clean and rebuild all packages # rush version - Bump versions for publishing # rush publish - Publish packages to npm ``` -------------------------------- ### Install Dependencies with Rush Source: https://github.com/hcengineering/huly.utils/blob/main/README.md Installs all project dependencies using Rush, the monorepo management tool. This command should be run after cloning the repository. ```bash rush install ``` -------------------------------- ### Clone Huly Utils Repository Source: https://github.com/hcengineering/huly.utils/blob/main/README.md Clones the Huly Utils repository from GitHub. This is the first step to setting up the project locally. It requires Git to be installed. ```bash git clone https://github.com/hcengineering/huly.utils.git cd huly.utils ``` -------------------------------- ### Build Huly Utils Repository with Rush Source: https://github.com/hcengineering/huly.utils/blob/main/README.md Builds all projects within the Huly Utils monorepo. This command compiles all packages and prepares them for use or testing. ```bash rush build ``` -------------------------------- ### Run Tests with Rush Source: https://github.com/hcengineering/huly.utils/blob/main/README.md Executes all defined tests for the projects within the Huly Utils monorepo. This ensures the integrity and correctness of the codebase. ```bash rush test ``` -------------------------------- ### Project Configuration Profiles (JSON) Source: https://context7.com/hcengineering/huly.utils/llms.txt Pre-configured profiles for different project types that provide standardized TypeScript and ESLint settings. These profiles are located within the 'node_modules/@hcengineering/platform-rig/profiles/' directory and can be extended in project-specific configuration files. ```json // File: .eslintrc.js module.exports = { "extends": ["./node_modules/@hcengineering/platform-rig/profiles/default/eslint.config.json"], "parserOptions": { "project": "./tsconfig.json" } } ``` ```json // File: tsconfig.json { "extends": "./node_modules/@hcengineering/platform-rig/profiles/default/tsconfig.json", "compilerOptions": { "rootDir": "./src", "outDir": "./lib" } } ``` -------------------------------- ### Synchronize ESLint Dependencies with sync-eslint-deps Source: https://context7.com/hcengineering/huly.utils/llms.txt Synchronizes ESLint-related devDependencies from platform-rig to all Rush packages, ensuring a consistent linting configuration across the monorepo. It identifies ESLint dependencies in platform-rig and updates them in individual packages if necessary. ```javascript const { execSync } = require('child_process'); execSync('sync-eslint-deps', { stdio: 'inherit' }); ``` -------------------------------- ### Format Code - JavaScript Source: https://context7.com/hcengineering/huly.utils/llms.txt Automatically formats and lints TypeScript, JavaScript, and Svelte files using Prettier and ESLint. It supports hash-based change detection for performance and can force format all files. The tool generates logs for Prettier and ESLint, and stores file hashes for change detection. ```javascript const { execSync } = require('child_process'); try { // Format with change detection (only processes modified files) execSync('format ./src', { stdio: 'inherit' }); // Force format all files regardless of changes execSync('format ./src --force', { stdio: 'inherit' }); console.log('Formatting completed successfully'); } catch (error) { console.error('Formatting failed:', error.message); process.exit(1); } ``` -------------------------------- ### Compile Code - JavaScript Source: https://context7.com/hcengineering/huly.utils/llms.txt Compiles TypeScript and Svelte files using esbuild with multiple build modes for UI components, transpilation, and type validation. It supports full builds, UI-specific builds with Svelte, transpilation-only, and type validation-only modes. The default configuration generates CommonJS modules, links source maps, and uses SSR for Svelte components. ```javascript const { execSync } = require('child_process'); // Full build with transpilation and validation execSync('compile', { stdio: 'inherit' }); // Build UI package with Svelte support execSync('compile ui-esbuild', { stdio: 'inherit' }); // Transpile only (no type checking) execSync('compile transpile src', { stdio: 'inherit' }); // Type validation only (no transpilation) execSync('compile validate', { stdio: 'inherit' }); ``` -------------------------------- ### Update NPM Dependencies with update-deps Source: https://context7.com/hcengineering/huly.utils/llms.txt Scans Rush packages for @hcengineering dependencies and updates them to the latest published versions from the npm registry. It preserves version prefixes (like '^') and updates package.json files in place. This tool skips workspace dependencies. ```javascript const { execSync } = require('child_process'); // Dry run mode - shows what would be updated execSync('update-deps --dry-run', { stdio: 'inherit' }); // Apply updates to all packages execSync('update-deps', { stdio: 'inherit' }); ``` -------------------------------- ### Bump Package Version - JavaScript Source: https://context7.com/hcengineering/huly.utils/llms.txt Automatically updates the package.json version based on the latest git tag, automating version management in CI/CD pipelines. It retrieves the latest tag, extracts the version number, and uses npm to set the package version. ```javascript const { execSync } = require('child_process'); // Get latest git tag and update package.json // Example: git tag v1.2.3 -> npm version 1.2.3 execSync('bump-package-version', { stdio: 'inherit' }); // Manual equivalent: const gitTag = execSync('git describe --tags --abbrev=0').toString().trim(); const version = gitTag.replace('v', '').replace('u', '').replace('s', ''); const [major, minor, patch] = version.split('.'); console.log(`Setting version to ${major}.${minor}.${patch}`); execSync(`npm version ${major}.${minor}.${patch}`); ``` -------------------------------- ### Check Svelte Types - Bash Source: https://context7.com/hcengineering/huly.utils/llms.txt Validates Svelte components for type errors using svelte-check. It supports default output, console streaming, and custom configurations via workspace and threshold settings. The tool logs output and errors to specific directories and files. ```bash # Run Svelte type checking with default output do-svelte-check # Run with console output streaming do-svelte-check --console # Run with custom svelte-check options do-svelte-check --workspace src --threshold warning ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.