### RLSR Scope to Package Name Mapping Example (Bash) Source: https://context7.com/xing/rlsr/llms.txt This example demonstrates how different commit scopes (`btn`, `old-button`, `@myorg/button`) can all be configured to target the same package (`@myorg/button`) using the `scopeToNameMap`. ```bash # These commits all affect @myorg/button git commit -m "fix(btn): resolve hover state" git commit -m "feat(old-button): add variant prop" git commit -m "fix(@myorg/button): fix accessibility" ``` -------------------------------- ### RLSR Additional Release Scope Example (Bash) Source: https://context7.com/xing/rlsr/llms.txt This example illustrates the outcome of configuring `additionalReleaseScope`. Packages will be published under their original name and also with the specified scoped name, e.g., `button` and `@mycompany/button`. ```bash # Packages are published as both: # - button (original) # - @mycompany/button (scoped) ``` -------------------------------- ### Install RLSR CLI Tool Source: https://github.com/xing/rlsr/blob/master/readme.md Installs the rlsr package as a development dependency using npm. This command should be run in the root of your project. ```sh npm install -D rlsr ``` -------------------------------- ### Format Conventional Commits for Versioning Source: https://context7.com/xing/rlsr/llms.txt Examples of commit messages that trigger different semantic versioning increments. RLSR parses these to determine if a patch, minor, or major release is required. ```bash # Patch release git commit -m "fix(my-package): resolve null pointer exception" # Minor release git commit -m "feat(button): add loading state support" # Major release git commit -m "feat(api): redesign authentication flow\n\nBREAKING CHANGE: API endpoints now require OAuth tokens" ``` -------------------------------- ### Manage Dependencies with RLSR Source: https://context7.com/xing/rlsr/llms.txt Demonstrates the use of the rlsr-latest placeholder for internal dependencies and configuring versioning strategies between exact and range-based modes. ```json { "name": "@myorg/button", "version": "2.0.0", "dependencies": { "@myorg/icons": "rlsr-latest", "@myorg/theme": "rlsr-latest" } } ``` ```json { "rlsr": { "exactRelations": false } } ``` -------------------------------- ### RLSR Configuration Options in package.json Source: https://github.com/xing/rlsr/blob/master/readme.md Demonstrates how to configure RLSR within the 'rlsr' section of your package.json. Options include enabling verbose logging, specifying the package directory, choosing dependency management paradigms, and mapping commit scopes. ```json { "rlsr": { "verbose": true, "packagePath": "./packages", "exactRelations": true, "scopeToNameMap": { "my-pkg": "my-actual-package-name" }, "additionalReleaseScope": "@my-org" } } ``` -------------------------------- ### Implement Custom RLSR Plugins Source: https://context7.com/xing/rlsr/llms.txt Shows how to create a plugin that hooks into the persist phase of the release process to perform side effects, such as sending notifications. ```javascript const slackNotify = async (env) => { const releasedPackages = Object.entries(env.packages || {}) .filter(([_, pkg]) => pkg.determinedIncrementLevel >= 0) .map(([name, pkg]) => `${name}@${pkg.incrementedVersion}`); if (releasedPackages.length > 0) { await fetch(process.env.SLACK_WEBHOOK_URL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ text: `Released packages: ${releasedPackages.join(', ')}` }) }); } return env; }; module.exports = { persist: slackNotify }; ``` -------------------------------- ### Configure RLSR State and Plugins Source: https://context7.com/xing/rlsr/llms.txt Defines the structure of the rlsr.json status file for tracking package versions and demonstrates how to register custom plugins to hook into the release lifecycle. ```json { "lastReleaseHash": "abc123def456", "packages": { "@myorg/button": { "version": "2.1.0", "dependencies": { "@myorg/icons": { "name": "@myorg/icons", "type": "default", "range": ">=1.0.0 <2.0.0" } } } } } ``` ```json { "rlsr": { "plugins": ["rlsr-plugin-slack-notify"] } } ``` -------------------------------- ### Execute RLSR Release Commands Source: https://context7.com/xing/rlsr/llms.txt Commands to trigger production, beta, or canary releases. Supports flags like --dryrun and --verify for testing release impacts. ```bash # Full production release rlsr production # Beta release rlsr beta # Canary release from current branch rlsr canary # Options rlsr --dryrun rlsr --verify rlsr --force ``` -------------------------------- ### Configure RLSR Release Scripts in package.json Source: https://github.com/xing/rlsr/blob/master/readme.md Adds 'prerelease' and 'release' scripts to your project's package.json file. 'prerelease' runs a dry run, while 'release' performs the full release process including git commits, tags, and npm publishing. ```json { "scripts": { "prerelease": "rlsr pre", "release": "rlsr perform" } } ``` -------------------------------- ### RLSR Additional Release Scope Configuration (JSON) Source: https://context7.com/xing/rlsr/llms.txt The `additionalReleaseScope` configuration enables publishing packages under both their original name and a specified scoped name. This is beneficial during organizational transitions or when introducing new naming conventions. ```json { "rlsr": { "additionalReleaseScope": "@mycompany" } } ``` -------------------------------- ### RLSR Latest Version Placeholder in package.json Source: https://github.com/xing/rlsr/blob/master/readme.md Shows how to use 'rlsr-latest' as a dependency version in a package.json file. This allows dependent packages to automatically use the latest version of a specified dependency from the monorepo. ```json { "my-package": { "dependencies": { "my-dependency": "rlsr-latest" } } } ``` -------------------------------- ### Changelog JSON Format Source: https://context7.com/xing/rlsr/llms.txt The structure of the generated changelog file, which organizes release history by version, including commit metadata and dependency change logs. ```json { "2.1.0": [ { "hash": "abc123", "date": "2024-01-15T10:30:00Z", "level": "minor", "text": "feat(button): add loading state support" } ] } ``` -------------------------------- ### RLSR Scope to Package Name Mapping (JSON) Source: https://context7.com/xing/rlsr/llms.txt The `scopeToNameMap` configuration allows mapping shorter or aliased scope names in commit messages to their actual package names. This is useful for simplifying commit messages or managing package renames. ```json { "rlsr": { "scopeToNameMap": { "btn": "@myorg/button", "icons": "@myorg/icons", "old-button": "@myorg/button" } } } ``` -------------------------------- ### Configure RLSR in package.json Source: https://context7.com/xing/rlsr/llms.txt Defines the structure for the rlsr configuration object within a package.json file. It controls monorepo paths, registry settings, and branch policies. ```json { "name": "my-monorepo", "version": "1.0.0", "rlsr": { "debug": true, "packagePath": "./packages", "registry": "https://registry.npmjs.org/", "mode": "independent", "productionBranch": "production", "betaBranch": "master", "plugins": ["rlsr-plugin-slack-notify"] } } ``` -------------------------------- ### Define Default Configuration Object Source: https://context7.com/xing/rlsr/llms.txt The TypeScript interface and default values used by the RLSR configuration module. These values are merged with user-provided settings. ```typescript const defaultConfig: Config = { remote: 'origin', branch: 'master', packagePath: './packages', changelogPath: './changelogs', metadataPath: './', registry: 'https://registry.npmjs.org/', mode: 'independent', debug: false, impact: 'full', tag: 'latest', betaTag: 'beta', betaBranch: 'master', productionBranch: 'master', mainBranch: 'master', plugins: [], }; ``` -------------------------------- ### RLSR Weekly Changelog Format (JSON) Source: https://context7.com/xing/rlsr/llms.txt This JSON structure represents the aggregated weekly changelog for a project, detailing package releases, versions, and commit messages. It's used for project-wide visibility of package updates. ```json { "2024-03": [ { "package": "@myorg/button", "version": "2.1.0", "determinedIncrementLevel": "minor", "messages": [ { "level": "minor", "text": "feat(button): add loading state support" } ] }, { "package": "@myorg/icons", "version": "1.5.0", "determinedIncrementLevel": "patch", "messages": [ { "level": "patch", "text": "fix(icons): correct SVG viewBox dimensions" } ] } ] } ``` -------------------------------- ### Define version and dependency data in rlsr.json Source: https://github.com/xing/rlsr/blob/master/new-version.md The rlsr.json file acts as the central source of truth for package versions and their respective dependency ranges. This file is committed to the repository and tracks the last commit hash associated with the script. ```json { "@xingternal/button": { "version": "30.1.1", "dependencies": { "@xingternal/typography": "20 - 23", "@xingternal/icons": "29 - 40" } } } ``` -------------------------------- ### Determine Semantic Versioning Level from Commits Source: https://context7.com/xing/rlsr/llms.txt Maps conventional commit types to semantic versioning levels. BREAKING changes trigger major versions, while specific types like feat or fix trigger minor or patch increments. ```typescript const addLevel = (message: MessageConventionalCommit): Message => { const msg: Message = { ...message, level: 'misc' }; if (msg.text?.includes('BREAKING')) { msg.level = 'major'; } else { switch (msg.type) { case 'feat': msg.level = 'minor'; break; case 'fix': case 'refactor': case 'perf': case 'revert': msg.level = 'patch'; break; default: msg.level = 'misc'; } } return msg; }; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.