Skip to content

Release v0.2.0 cli#13

Merged
CarlosEduJs merged 5 commits intodevfrom
release/v0.2.0-cli
Feb 4, 2026
Merged

Release v0.2.0 cli#13
CarlosEduJs merged 5 commits intodevfrom
release/v0.2.0-cli

Conversation

@CarlosEduJs
Copy link
Copy Markdown
Owner

Description

Add gradient generation support to bdsg-cli, enabling OKLCH-based color gradient creation from the command line. This aligns the CLI with bdsg v0.2.0 features.

Type of Change

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation only
  • refactor: Code refactoring (no functional changes)
  • perf: Performance improvement
  • test: Adding or updating tests
  • chore: Maintenance (dependencies, config, etc.)

Changes

  • Add bdsg generate gradient command with OKLCH interpolation
  • Support easing functions: linear, easeIn, easeOut, easeInOut
  • Support hue direction control: shorter, longer, increasing, decreasing
  • Output CSS variables with gradient stops and CSS gradient strings
  • JSON export with full gradient metadata
  • Update bdsg dependency from ^0.1.3 to ^0.2.0
  • Bump CLI version to 0.2.0
  • Update README.md with gradient command documentation
  • Update CHANGELOG.md with v0.2.0 release notes

Testing

  • Tests pass (bun test)
  • Types are correct (bun run check-types)
  • Code is formatted (bun run check)
  • Manual testing: bdsg generate gradient "#FF0000" "#0000FF" -s 5

Breaking Changes

  • This PR introduces breaking changes

Checklist

  • PR title follows Conventional Commits format
  • Code follows the project's style guidelines
  • Self-review completed
  • Documentation updated (if needed)
  • Tests added/updated (if needed)

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds gradient generation support to bdsg-cli, aligning it with the bdsg v0.2.0 library release. The new generate gradient command enables OKLCH-based color gradient creation with easing functions and hue direction control.

Changes:

  • Added bdsg generate gradient command with OKLCH interpolation, easing functions (linear, easeIn, easeOut, easeInOut), and hue direction control (shorter, longer, increasing, decreasing)
  • Updated bdsg dependency from ^0.1.3 to ^0.2.0 and bumped CLI version to 0.2.0
  • Updated README.md and CHANGELOG.md with v0.2.0 release documentation

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/bdsg-cli/src/commands/generate.ts Added new gradient command with options for name, steps, easing, direction, output directory, and format
packages/bdsg-cli/package.json Bumped version to 0.2.0 and updated bdsg dependency to ^0.2.0
packages/bdsg-cli/README.md Added gradient command documentation with usage examples and available options
CHANGELOG.md Added v0.2.0 release notes for bdsg-cli with gradient command features

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +264 to +266
const easingFn =
EASING[options.easing as keyof typeof EASING] || EASING.linear;

Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The easing option validation should fail with a clear error message when an invalid value is provided, rather than silently falling back to EASING.linear. This could confuse users who make typos or provide invalid easing function names. Consider validating the easing option against the valid values (linear, easeIn, easeOut, easeInOut) and throwing an error if invalid.

Suggested change
const easingFn =
EASING[options.easing as keyof typeof EASING] || EASING.linear;
const validEasings = ["linear", "easeIn", "easeOut", "easeInOut"] as const;
if (!validEasings.includes(options.easing)) {
throw new Error(
`Invalid easing option "${options.easing}". Valid options are: ${validEasings.join(
", ",
)}.`,
);
}
const easingFn = EASING[options.easing as keyof typeof EASING];

Copilot uses AI. Check for mistakes.
const spinner = ora("Generating gradient...").start();

try {
const steps = Number.parseInt(options.steps, 10);
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The steps option should be validated before parsing to ensure it's a valid numeric string. If a user provides a non-numeric value, Number.parseInt will return NaN, which will cause a less user-friendly error message from the library validation. Consider adding validation to check if options.steps is a valid number string and provide a clear error message if not.

Suggested change
const steps = Number.parseInt(options.steps, 10);
const stepsRaw = options.steps;
if (!/^\d+$/.test(stepsRaw)) {
throw new Error(
`Invalid value for --steps: "${stepsRaw}". Please provide a positive integer.`,
);
}
const steps = Number.parseInt(stepsRaw, 10);

Copilot uses AI. Check for mistakes.
Comment on lines +274 to +290
if (options.format === "json") {
const gradient: Record<string, unknown> = {
name: options.name,
start: startColor,
end: endColor,
steps,
colors,
css: {
linear: toCssGradient("linear", colors, 90),
radial: toCssGradient("radial", colors),
},
};
await writeFile(
join(options.output, `${options.name}.json`),
JSON.stringify({ gradient }, null, 2),
);
} else {
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The format option should be validated to ensure it's either "css" or "json". If a user provides an invalid format value, the code currently defaults to CSS output without any warning to the user. Consider validating the format option and providing a clear error message for invalid values.

Copilot uses AI. Check for mistakes.
@CarlosEduJs CarlosEduJs merged commit a97d270 into dev Feb 4, 2026
2 checks passed
CarlosEduJs added a commit that referenced this pull request Feb 4, 2026
* Release v0.2.0 bdsg (#11)

* feat(bdsg): add okloch color space, feat palettes with olock, gradient system - two colors and multi colors; reorder imports in others files

* generate test file

* chore: add suport validation zod in gradient file

* refactor: remove zod schemas from files and centralized in a single file

* chore: biome write files

* chore: move gradient tests out of oklch tests

* docs(bdsg): update readme

* docs: update changelog

* tests: generate new tests suites

* docs: update readme

* refactor: remove unused interpolation property and fix version notation

* ci: add dev branch to workflow

* Release v0.2.0 cli (#13)

* feat(bdsg-cli): add new options and new outputs css variables + gradients linear/radials

* docs: update readme

* docs: update changelog

* docs: update version to reflet package

* feat(bdsg-cli): add gradient command and input validation
@CarlosEduJs CarlosEduJs mentioned this pull request Feb 4, 2026
CarlosEduJs added a commit that referenced this pull request Feb 4, 2026
* Release v0.2.0 bdsg (#11)

* feat(bdsg): add okloch color space, feat palettes with olock, gradient system - two colors and multi colors; reorder imports in others files

* generate test file

* chore: add suport validation zod in gradient file

* refactor: remove zod schemas from files and centralized in a single file

* chore: biome write files

* chore: move gradient tests out of oklch tests

* docs(bdsg): update readme

* docs: update changelog

* tests: generate new tests suites

* docs: update readme

* refactor: remove unused interpolation property and fix version notation

* ci: add dev branch to workflow

* Release v0.2.0 cli (#13)

* feat(bdsg-cli): add new options and new outputs css variables + gradients linear/radials

* docs: update readme

* docs: update changelog

* docs: update version to reflet package

* feat(bdsg-cli): add gradient command and input validation
@CarlosEduJs CarlosEduJs deleted the release/v0.2.0-cli branch February 4, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants