Skip to content

Feat: defineRules - properties and shorcuts#308

Merged
github-actions[bot] merged 4 commits intomainfrom
define-rules
Feb 24, 2026
Merged

Feat: defineRules - properties and shorcuts#308
github-actions[bot] merged 4 commits intomainfrom
define-rules

Conversation

@black7375
Copy link
Contributor

@black7375 black7375 commented Feb 24, 2026

Description

property & shorcut support

Related Issue

Summary by CodeRabbit

  • New Features

    • Added a CSS rule-definition utility with support for custom properties, shortcuts, and flexible input shapes; exported related type definitions.
  • Chores

    • Added changeset entries documenting a minor version bump and notes.
    • Minor editor and project config formatting updates (spell-check word and compiler types).

Additional context

Checklist

@changeset-bot
Copy link

changeset-bot bot commented Feb 24, 2026

🦋 Changeset detected

Latest commit: d601036

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@mincho-js/css Minor
@mincho-js/react Patch
@mincho-js/vite Patch
react-babel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

Triggered from #308 by @​black7375.

Checking if we can fast forward main (d245af3) to define-rules (0fcc79b).

Target branch (main):

commit d245af329da086591d564171e10f939e053a84f7 (HEAD -> main, origin/main)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Tue Dec 2 00:00:00 2025 +0900

    chore: update deps

Pull request (define-rules):

commit 0fcc79b1193fe498f7c637262f7b0e84a4a7f879 (pull_request/define-rules)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Sun Feb 15 00:00:00 2026 +0900

    Feat: `defineRules` - funtional properties and shortcuts

It is possible to fast forward main (d245af3) to define-rules (0fcc79b). If you have write access to the target repository, you can add a comment with /fast-forward to fast forward main to define-rules.

@coderabbitai
Copy link

coderabbitai bot commented Feb 24, 2026

📝 Walkthrough

Walkthrough

Adds a new defineRules utility (implementation + extensive TypeScript types) to the CSS package, updates package exports to expose it, and includes two changeset metadata files; also adds a spell-check word in VSCode settings.

Changes

Cohort / File(s) Summary
Changesets
\.changeset/big-hands-rescue.md, \.changeset/six-coins-ask.md
Two new changeset entries documenting a minor version bump for @mincho-js/css and noting the defineRules feature.
Editor config
\.vscode/settings.json
Added "bivariance" to the cSpell.words array.
defineRules implementation
packages/css/src/defineRules/index.ts
New exported function defineRules added; runtime logic for resolving properties, shortcuts, arrays/objects/functions, and circular reference detection (compilation and CSS object builders).
defineRules types
packages/css/src/defineRules/types.ts
Comprehensive TypeScript type system added: DefineRulesProperties, DefineRulesShortcuts, DefineRulesCtx, DefineRulesCssInput, DefineRulesInlineCssInput, DefineRulesComplexCssInput, and helper/resolve types for properties and shortcuts.
Public re-exports
packages/css/src/index.ts
Exports defineRules and re-exports related types (DefineRulesCtx, DefineRulesCssInput, DefineRulesComplexCssInput) from the package entry.
Examples/tsconfig
examples/react-babel/tsconfig.app.json
Formatting changes to lib/include entries and addition of types compiler option (vitest/importMeta, vite/client).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 I hop through rules with nimble paws and cheer,
I stitch shortcuts and properties near,
defineRules hums, arranging style with care,
No circular loop will catch me unaware,
Tiny rabbit coder, tidy and sincere.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description is incomplete. While it mentions the feature and links to issue #307, it lacks clear details about what was changed and only has placeholder comments from the template. Expand the description section with specific details about the properties and shortcuts functionality added, remove template placeholders, and fill in the Additional context and Checklist sections.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title mentions 'defineRules - properties and shorcuts' which directly matches the main feature being added. However, there is a typo: 'shorcuts' should be 'shortcuts'.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch define-rules

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.changeset/big-hands-rescue.md:
- Line 5: Update the changeset summary line to correct the typo: replace
"shorcuts" with "shortcuts" so the note reads "`defineRules`: Properties and
shortcuts"; edit the .changeset/big-hands-rescue.md file and update the text
accordingly.

In @.changeset/six-coins-ask.md:
- Line 5: Update the changeset note to fix the spelling mistake: replace the
word "shorcuts" with "shortcuts" in the sentence that lists `defineRules` so the
release note reads "`defineRules` - functional properties and shortcuts".

In `@packages/css/src/defineRules/index.ts`:
- Around line 139-142: The code currently assigns disabled properties (propDef
=== false) because only isPlainObject(propDef) is checked; update the branch to
skip assignment when propDef is strictly false by adding an explicit check
before assigning to out: if (propDef === false) return; then keep the existing
isPlainObject check and assignment for non-object defs. Adjust the block around
isPlainObject(propDef), propDef, prop, value, and out so that disabled defs are
not applied at runtime (or optionally throw instead of returning if you prefer
failing fast).

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d245af3 and 0fcc79b.

📒 Files selected for processing (6)
  • .changeset/big-hands-rescue.md
  • .changeset/six-coins-ask.md
  • .vscode/settings.json
  • packages/css/src/defineRules/index.ts
  • packages/css/src/defineRules/types.ts
  • packages/css/src/index.ts

"@mincho-js/css": minor
---

- `defineRules` - functional properties and shorcuts
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix the typo in the changeset note.

“shorcuts” → “shortcuts” for release-note clarity.

✏️ Suggested fix
- `defineRules` - functional properties and shorcuts
+ `defineRules` - functional properties and shortcuts
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- `defineRules` - functional properties and shorcuts
- `defineRules` - functional properties and shortcuts
🧰 Tools
🪛 LanguageTool

[grammar] ~5-~5: Ensure spelling is correct
Context: ...efineRules` - functional properties and shorcuts

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.changeset/six-coins-ask.md at line 5, Update the changeset note to fix the
spelling mistake: replace the word "shorcuts" with "shortcuts" in the sentence
that lists `defineRules` so the release note reads "`defineRules` - functional
properties and shortcuts".

Comment on lines +139 to +142
// just assign => last one wins
if (isPlainObject(propDef) === false) {
(out as Record<string, unknown>)[prop] = value;
return;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Disabled properties (false) are still applied at runtime.

This conflicts with the type contract where false means “no values allowed.” Consider skipping assignment (or throwing) when the property is disabled.

🔧 Suggested fix
-  // just assign => last one wins
-  if (isPlainObject(propDef) === false) {
+  if (propDef === false) {
+    return;
+  }
+  // just assign => last one wins
+  if (isPlainObject(propDef) === false) {
     (out as Record<string, unknown>)[prop] = value;
     return;
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// just assign => last one wins
if (isPlainObject(propDef) === false) {
(out as Record<string, unknown>)[prop] = value;
return;
if (propDef === false) {
return;
}
// just assign => last one wins
if (isPlainObject(propDef) === false) {
(out as Record<string, unknown>)[prop] = value;
return;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/css/src/defineRules/index.ts` around lines 139 - 142, The code
currently assigns disabled properties (propDef === false) because only
isPlainObject(propDef) is checked; update the branch to skip assignment when
propDef is strictly false by adding an explicit check before assigning to out:
if (propDef === false) return; then keep the existing isPlainObject check and
assignment for non-object defs. Adjust the block around isPlainObject(propDef),
propDef, prop, value, and out so that disabled defs are not applied at runtime
(or optionally throw instead of returning if you prefer failing fast).

@github-actions
Copy link
Contributor

Triggered from #308 by @​black7375.

Checking if we can fast forward main (d245af3) to define-rules (d601036).

Target branch (main):

commit d245af329da086591d564171e10f939e053a84f7 (HEAD -> main, origin/main)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Tue Dec 2 00:00:00 2025 +0900

    chore: update deps

Pull request (define-rules):

commit d60103698a0cfe301d13a972de1d2ffdcc024fd2 (pull_request/define-rules)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Sun Feb 15 00:00:00 2026 +0900

    Feat: `defineRules` - funtional properties and shortcuts

It is possible to fast forward main (d245af3) to define-rules (d601036). If you have write access to the target repository, you can add a comment with /fast-forward to fast forward main to define-rules.

@black7375
Copy link
Contributor Author

/fast-forward

@github-actions
Copy link
Contributor

Triggered from #308 (comment) by @​black7375.

Trying to fast forward main (d245af3) to define-rules (d601036).

Target branch (main):

commit d245af329da086591d564171e10f939e053a84f7 (HEAD -> main, origin/main)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Tue Dec 2 00:00:00 2025 +0900

    chore: update deps

Pull request (define-rules):

commit d60103698a0cfe301d13a972de1d2ffdcc024fd2 (pull_request/define-rules)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Sun Feb 15 00:00:00 2026 +0900

    Feat: `defineRules` - funtional properties and shortcuts

Fast forwarding main (d245af3) to define-rules (d601036).

$ git push origin d60103698a0cfe301d13a972de1d2ffdcc024fd2:main
To https://github.com/mincho-js/mincho.git
   d245af3..d601036  d60103698a0cfe301d13a972de1d2ffdcc024fd2 -> main

@github-actions github-actions bot merged commit d601036 into main Feb 24, 2026
12 checks passed
@github-actions github-actions bot deleted the define-rules branch February 24, 2026 01:01
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@examples/react-babel/tsconfig.app.json`:
- Line 17: The tsconfig types array includes "vitest/importMeta" but the
examples/react-babel project doesn't list vitest as a dependency; either add
vitest to devDependencies in package.json (so the "vitest/importMeta" type
reference resolves) or remove "vitest/importMeta" from the "types" array in
tsconfig.app.json; locate the "types" entry and update it accordingly to keep
only installed type packages (e.g., keep "vite/client" or add "vitest" to
devDependencies).

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0fcc79b and d601036.

📒 Files selected for processing (6)
  • .changeset/big-hands-rescue.md
  • .changeset/six-coins-ask.md
  • .vscode/settings.json
  • examples/react-babel/tsconfig.app.json
  • packages/css/src/defineRules/index.ts
  • packages/css/src/defineRules/types.ts
✅ Files skipped from review due to trivial changes (1)
  • .changeset/six-coins-ask.md
🚧 Files skipped from review as they are similar to previous changes (4)
  • .changeset/big-hands-rescue.md
  • packages/css/src/defineRules/index.ts
  • .vscode/settings.json
  • packages/css/src/defineRules/types.ts

"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",
"types": ["vitest/importMeta", "vite/client"],
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check for vitest/vite dependencies across repo package.json files
fd package.json -x rg -n '"vitest"|"vite"' {}

Repository: mincho-js/mincho

Length of output: 112


🏁 Script executed:

cat -n examples/react-babel/tsconfig.app.json

Repository: mincho-js/mincho

Length of output: 1296


🏁 Script executed:

cat -n examples/react-babel/package.json 2>/dev/null || echo "No package.json in examples/react-babel"

Repository: mincho-js/mincho

Length of output: 2072


🏁 Script executed:

head -50 package.json

Repository: mincho-js/mincho

Length of output: 2750


Add vitest to devDependencies or remove vitest/importMeta from types array.

The vite/client type is available (vite is in devDependencies), but vitest/importMeta references a package not listed in examples/react-babel's dependencies. Declare vitest as a devDependency or remove the reference from the types array.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/react-babel/tsconfig.app.json` at line 17, The tsconfig types array
includes "vitest/importMeta" but the examples/react-babel project doesn't list
vitest as a dependency; either add vitest to devDependencies in package.json (so
the "vitest/importMeta" type reference resolves) or remove "vitest/importMeta"
from the "types" array in tsconfig.app.json; locate the "types" entry and update
it accordingly to keep only installed type packages (e.g., keep "vite/client" or
add "vitest" to devDependencies).

@github-actions github-actions bot mentioned this pull request Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant