jQuery preset for conventional-changelog that provides commit parsing and changelog generation following jQuery's commit message conventions.
npx @tessl/cli install tessl/npm-conventional-changelog-jquery@6.0.0Conventional Changelog jQuery is a preset configuration for conventional-changelog that follows the jQuery project's commit message convention. It provides parsing rules for commit messages with the format "Component: Short Description" and implements semantic version bumping logic based on jQuery's contribution guidelines.
npm install conventional-changelog-jqueryimport createPreset from "conventional-changelog-jquery";For dynamic imports:
const { default: createPreset } = await import("conventional-changelog-jquery");import conventionalChangelogCore from "conventional-changelog-core";
import createPreset from "conventional-changelog-jquery";
// Create the preset configuration
const preset = await createPreset();
// Use with conventional-changelog-core
for await (let chunk of conventionalChangelogCore({
cwd: process.cwd(),
config: preset
})) {
console.log(chunk.toString());
}The conventional-changelog-jquery preset is built around three core components that work together within the conventional-changelog ecosystem:
The preset integrates seamlessly with conventional-changelog-core, which handles git history traversal and calls the appropriate preset methods during changelog generation. Each component can be configured independently while maintaining compatibility with jQuery's established commit message conventions.
The preset expects commits in jQuery's standardized format:
Component: Short Description
Optional Long Description
Fixes #xxx
Closes gh-yyy
Ref #zzzExamples:
Core: Make jQuery objects iterableEvent: Remove an internal argument to the on methodCSS: Don't name the anonymous swap functionCreates a complete preset configuration object for conventional-changelog following jQuery's commit message conventions.
/**
* Creates a jQuery preset configuration for conventional-changelog
* @returns Promise<PresetConfig> - Complete preset configuration object
*/
function createPreset(): Promise<PresetConfig>;
interface PresetConfig {
parser: ParserOptions;
writer: WriterOptions;
whatBump: WhatBumpFunction;
}
interface ParserOptions {
headerPattern: RegExp;
headerCorrespondence: string[];
}
interface WriterOptions {
mainTemplate: string;
headerPartial: string;
commitPartial: string;
transform: TransformFunction;
groupBy: string;
commitGroupsSort: string;
commitsSort: string[];
}
type TransformFunction = (commit: CommitObject) => TransformedCommit | undefined;
type WhatBumpFunction = (commits: CommitObject[]) => BumpResult;
interface BumpResult {
level: number; // 0=major, 1=minor, 2=patch
reason: string; // Explanation of the bump decision
}
interface CommitObject {
notes: BreakingChangeNote[];
type?: string;
component?: string;
references?: ReferenceObject[];
hash?: string;
shortHash?: string;
[key: string]: any;
}
interface BreakingChangeNote {
title: string;
text: string;
}
interface ReferenceObject {
prefix: string;
issue: string;
owner?: string;
repository?: string;
originalIssueTracker?: string;
}
interface TransformedCommit {
shortHash: string;
references: ReferenceObject[];
}The preset configuration includes:
Parser Configuration:
/^(\w*): (.*)$/ to match jQuery commit formatcomponent and shortDesc fieldsWriter Configuration:
# prefixed issues to jQuery bug tracker (https://bugs.jquery.com/ticket/)Version Bump Logic:
The preset includes three Handlebars templates:
Structures the overall changelog layout with header and commit groups.
Generates version headers with optional comparison links:
{{#if isPatch}}##{{else}}#{{/if}} {{version}}{{#if date}} ({{date}}){{/if}}Formats individual commit entries with:
The preset handles multiple reference types:
#xxx: Maps to jQuery bug tracker (https://bugs.jquery.com/ticket/xxx)gh-xxx: Maps to GitHub issues (https://github.com/owner/repo/issues/xxx)user/repo#xxx: Maps to external repository issuesUsage Examples:
Event: Fix delegation bug
Fixes #123, gh-456
Ref jquery/jquery-ui#789The transform function filters out invalid commits:
Complete example showing preset integration with conventional-changelog workflow:
import conventionalChangelogCore from "conventional-changelog-core";
import createPreset from "conventional-changelog-jquery";
import { promisify } from "util";
import { exec } from "child_process";
const execAsync = promisify(exec);
async function generateChangelog() {
// Create preset
const preset = await createPreset();
// Generate changelog
let changelog = '';
for await (const chunk of conventionalChangelogCore({
cwd: process.cwd(),
config: preset
})) {
changelog += chunk.toString();
}
return changelog;
}
// Use in release workflow
const changelog = await generateChangelog();
console.log(changelog);