Skip to content

Feat: Documentation site with Nextra (Next.js)#311

Open
Jeong-jj wants to merge 19 commits intomainfrom
feat/docs-site
Open

Feat: Documentation site with Nextra (Next.js)#311
Jeong-jj wants to merge 19 commits intomainfrom
feat/docs-site

Conversation

@Jeong-jj
Copy link
Member

@Jeong-jj Jeong-jj commented Mar 2, 2026

Description

Set up a documentation site for Mincho.js using Nextra 4.x with Next.js App Router.

Site Structure

  • Getting Started — Installation and basic usage guide
  • Literal CSS — Core CSS API with CSS Methods section
  • Theme — Theme API with Coming Soon methods section
  • Rules — Rules (variant) API documentation
  • Styled Components — Styled component utilities
  • Class Name Utilitiescx(), cx.with(), cx.multiple() documentation
  • Define Rules — Property Constraints and Shortcuts (implemented), Conditions and Theme integration (Coming Soon)

Infrastructure

  • Initialized Nextra 4.x documentation site with TypeScript
  • Integrated site into yarn workspace as mincho-docs
  • Added site to root tsconfig project references
  • Added nextra peerDependencies extension for typescript in .yarnrc.yml
  • Security updates for Next.js vulnerabilities (GHSA-9g9p-9gw9-jx7f, GHSA-h25m-26qc-wcjf)

Related Issue

Summary by CodeRabbit

  • New Features

    • Launched comprehensive documentation website for Mincho.js, featuring guides on Getting Started, Literal CSS, Rules, Theme system, Styled Components, Class Name utilities, and Rule Definition.
    • Added landing page with project introduction and quick access to documentation.
  • Chores

    • Configured monorepo structure with new site workspace and updated build tooling.

Additional context

The defineRules() documentation has been updated to reflect the current implementation status — Property Constraints and Shortcuts are now documented with working examples based on the actual API, while Conditions, Theme integration, and other planned features remain marked as Coming Soon.

Checklist

  • Documentation site builds successfully (yarn workspace mincho-docs build)
  • All CI checks pass (peer dependencies, package audit, project references)
  • No changes to core library packages

Jeong-jj added 19 commits March 2, 2026 01:34
- Set up Next.js 15 + Nextra 4 + nextra-theme-docs
- Add basic project structure (src/app, src/content)
- Create sample documentation pages (Introduction, Getting Started)
Add suppressHydrationWarning to <body> to prevent false warnings caused by
browser extensions (e.g., ColorZilla) that modify DOM attributes.

This only suppresses warnings for the element itself, not its children,
so actual hydration errors in content will still be reported.

Ref: https://nextjs.org/docs/messages/react-hydration-error
- Convert all .jsx files to .tsx
- Add tsconfig.json with strict mode
- Add TypeScript and type dependencies
- Rename _meta.js to _meta.ts for TypeScript consistency
- Fix Vite plugin export name: mincho → minchoVitePlugin
- Add @vanilla-extract/css to installation command
- Expand getting-started with practical examples and key features
Comprehensive documentation for Mincho.js Literal CSS features:
- Merge Values ($ and _ suffixes)
- Simply Important (! suffix)
- CSS Variables ($ prefix)
- Simple/Complex Pseudo Selectors
- Toplevel Selectors
- Nested Selectors and At-Rules
- Property Reference (@)
- Nested Properties (uppercase keys)
- Property Conditions (base keyword)
- Anonymous At-Rules (keyframes, fontface)
- Variant Reference (%)

All examples verified against actual implementation test cases.
- Add site to monorepo workspaces configuration
- Change nodeLinker from pnpm to node-modules for Next.js compatibility
- Remove npm package-lock.json (now managed by yarn)
- Add type: module to site/package.json
- Next.js: ^15.0.0 → ^15.5.7
- React/React-DOM: ^19.0.0 → ^19.2.1
- Nextra/Nextra-theme-docs: ^4.0.0 → ^4.6.1

Update mdx-components.tsx and page.tsx for Nextra 4.6.x compatibility.
- rules() function with variants, toggles, props
- Compound variants with function-based conditions
- Multiple rules with rules.multiple()
- Type constraints with rules.with()
- Limitations and workarounds section
- Add theme.mdx covering theme() and globalTheme() functions
- Document token types: primitive, arrays, nested objects, unit values
- Document DTCG token definitions: color, fontFamily, duration, cubicBezier, fontWeight, number, dimension
- Document semantic tokens with getters, fallbackVar(), alias(), raw()
- Document composite values, CSS layers, multiple themes
- Update _meta.ts to include theme page
- Add css.raw() documentation for object passthrough
- Add css.multiple() documentation for creating multiple class names
- Add css.with() documentation for type restrictions and mixin patterns
- Document chaining with raw() and multiple() methods
- Document planned theme.raw(), theme.with(), theme.multiple() methods
- Note that these are under development for API consistency with css and rules
- Next.js: ^15.5.7 → ^15.5.10 (resolved to 15.5.12)
- GHSA-9g9p-9gw9-jx7f: Image Optimizer DoS via remotePatterns (moderate)
- GHSA-h25m-26qc-wcjf: HTTP request deserialization DoS (high)
@Jeong-jj Jeong-jj requested a review from black7375 March 2, 2026 15:17
@Jeong-jj Jeong-jj self-assigned this Mar 2, 2026
@changeset-bot
Copy link

changeset-bot bot commented Mar 2, 2026

⚠️ No Changeset found

Latest commit: e541ae9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

Triggered from #311 by @​Jeong-jj.

Checking if we can fast forward main (64d891e) to feat/docs-site (e541ae9).

Target branch (main):

commit 64d891eeda0fe99572e9372a78ad2c1e5df46c18 (HEAD -> main, origin/main)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Mon Feb 16 00:00:00 2026 +0900

    chore: tsconfig - strict module syntax

Pull request (feat/docs-site):

commit e541ae950206ce45eb6e063d53eae3e4496d8c9c (pull_request/feat/docs-site)
Author: JeongJun <rgfdds98@gmail.com>
Date:   Mon Mar 2 23:55:20 2026 +0900

    Chore: add site to root tsconfig project references

It is possible to fast forward main (64d891e) to feat/docs-site (e541ae9). If you have write access to the target repository, you can add a comment with /fast-forward to fast forward main to feat/docs-site.

@coderabbitai
Copy link

coderabbitai bot commented Mar 2, 2026

📝 Walkthrough

Walkthrough

This PR establishes a new documentation site for the Mincho.js project within the monorepo. It adds configuration updates to support a "site" workspace, creates a Next.js application with Nextra integration for MDX-based documentation, and introduces comprehensive docs covering getting started, API features (literal CSS, rules, styled components, theming), class name utilities, and define rules functionality.

Changes

Cohort / File(s) Summary
Root Configuration
.gitignore, .yarnrc.yml, package.json, tsconfig.json
Updated to register "site" as a workspace, configured yarn node-modules linker with nextra packageExtensions and outdated plugin spec, and added root TypeScript reference to site's tsconfig.
Site Setup & Configuration
site/package.json, site/tsconfig.json, site/next.config.mjs, site/next-env.d.ts
Initialized Next.js project manifest with dev/build/start scripts, Next.js and Nextra dependencies, TypeScript configuration for Next.js with path aliases, and type definitions for Next.js integration.
Site Layout & Components
site/src/app/layout.tsx, site/src/app/page.tsx, site/mdx-components.tsx
Implemented root layout with Nextra Head/Layout/Navbar/Footer components, home page with landing copy, and custom MDX component hook for merging Nextra components.
Dynamic MDX Routing
site/src/app/docs/[[...mdxPath]]/page.tsx
Added catch-all route for dynamic MDX page rendering with static parameter generation, metadata extraction, and Wrapper component integration for documentation structure.
Documentation Content
site/src/content/_meta.ts, site/src/content/*.mdx
Created navigation metadata and comprehensive MDX documentation files covering introduction, getting started, literal CSS, rules, theme, styled components, class name utilities, and define rules with usage examples and API references.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

dependencies

Suggested reviewers

  • black7375

Poem

🐰 A docs site springs to life with Nextra's might,
Through MDX paths and pages bathed in light,
Next.js scaffolding and TypeScript's grace,
Mincho.js finds its proper place! ✨📚

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding a documentation site using Nextra with Next.js, which aligns with the comprehensive changeset.
Description check ✅ Passed The description follows the template structure with clear Description, Related Issue, Additional context, and Checklist sections, providing comprehensive details about site structure, infrastructure changes, and verification that builds and CI checks pass.

✏️ 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 feat/docs-site

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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: 7

🧹 Nitpick comments (1)
site/src/app/page.tsx (1)

1-23: Use next/link for internal navigation to /docs.

The /docs route is internal to the App Router. Using Link enables client-side navigation, automatic prefetching, and better performance—while plain <a> is reserved for external URLs and non-route navigation.

♻️ Proposed refactor
+import Link from 'next/link'
+
 export default function IndexPage() {
   return (
@@
-      <a
+      <Link
         href="/docs"
         style={{
           display: 'inline-block',
@@
       >
         Get Started
-      </a>
+      </Link>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@site/src/app/page.tsx` around lines 1 - 23, The IndexPage uses a plain <a
href="/docs"> for an internal route; import Link from 'next/link' and replace
the anchor with the Next.js Link component (keeping the same styling/props and
inner text) so navigation to "/docs" uses client-side navigation and
prefetching; update the IndexPage function to import Link and return <Link
href="/docs">...styled content...</Link> instead of the raw <a>.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@site/next-env.d.ts`:
- Line 3: Remove the hard-coded triple-slash reference to the generated routes
types in next-env.d.ts (the line /// <reference path="./.next/types/routes.d.ts"
/>); delete that line so TypeScript won't error on clean checkouts before Next
has generated .next, or replace it with a non-blocking runtime-generated types
strategy if you need the reference later. Ensure the file now only contains the
standard Next.js ambient declarations and no direct reference to .next-generated
routes.

In `@site/src/content/define-rules.mdx`:
- Line 3: Replace the user-facing typo "high-order" with the correct term
"higher-order" in the API description for defineRules(); specifically update the
sentence that currently reads "`defineRules()` is a high-order definition
API..." to use "higher-order" so the documentation for defineRules() uses the
correct terminology.
- Around line 397-404: The Selector Conditions example in defineRules uses
invalid object syntax like selector: '&:is(... )': {} which breaks
TypeScript/JS; update the conditions block (symbols: defineRules, conditions,
hover, focus, checked, css) so each condition's selector is a string value
(e.g., selector: '&:is(:hover, [data-hover])') without the trailing ": {}"
object—ensure all selector properties are plain strings to make the snippet
valid and copy-pasteable.

In `@site/src/content/getting-started.mdx`:
- Around line 125-131: The snippet passed to the css(...) call contains an
object with a nested padding property but is missing a trailing comma after the
closing brace of the padding object; update the snippet inside the css call (the
padding object in the css(...) argument) to add a trailing comma after the
padding object's closing brace so the object literal is valid JSON/JS/TS (i.e.,
ensure the padding: { Block: 16, Inline: 24 }, line ends with a comma before the
next token/comment).

In `@site/src/content/literal.mdx`:
- Line 3: In the sentence mentioning the `css()` function that currently reads
"Vanilla Extract compatible styles", change the compound adjective to "Vanilla
Extract-compatible styles" (update the phrase "Vanilla Extract compatible" to
"Vanilla Extract-compatible"); search for and fix any other occurrences of the
same unhyphenated phrase in the same doc to keep grammar consistent.

In `@site/src/content/styled.mdx`:
- Around line 74-92: The example redeclares the variable Button twice; rename
the second declaration to a different identifier (e.g., ButtonAlt or
ButtonComponent) so the function-call example (const Button = styled('button',
...)) and the property-access example (const Button = styled.button(...)) do not
conflict—update the second const declaration that uses styled.button to use the
new name and ensure any explanatory text refers to that new identifier.

In `@site/tsconfig.json`:
- Around line 2-24: Add "composite": true to the compilerOptions in this
project's tsconfig.json so the project can be used with TypeScript project
references (tsc --build); update the compilerOptions object (the same block
containing "target", "lib", "strict", etc.) to include composite: true to ensure
compatibility with the root tsconfig.json references.

---

Nitpick comments:
In `@site/src/app/page.tsx`:
- Around line 1-23: The IndexPage uses a plain <a href="/docs"> for an internal
route; import Link from 'next/link' and replace the anchor with the Next.js Link
component (keeping the same styling/props and inner text) so navigation to
"/docs" uses client-side navigation and prefetching; update the IndexPage
function to import Link and return <Link href="/docs">...styled
content...</Link> instead of the raw <a>.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 64d891e and e541ae9.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (21)
  • .gitignore
  • .yarnrc.yml
  • package.json
  • site/mdx-components.tsx
  • site/next-env.d.ts
  • site/next.config.mjs
  • site/package.json
  • site/src/app/docs/[[...mdxPath]]/page.tsx
  • site/src/app/layout.tsx
  • site/src/app/page.tsx
  • site/src/content/_meta.ts
  • site/src/content/classname.mdx
  • site/src/content/define-rules.mdx
  • site/src/content/getting-started.mdx
  • site/src/content/index.mdx
  • site/src/content/literal.mdx
  • site/src/content/rules.mdx
  • site/src/content/styled.mdx
  • site/src/content/theme.mdx
  • site/tsconfig.json
  • tsconfig.json

@@ -0,0 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" />
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
set -euo pipefail

echo "Check for hard-coded generated route reference:"
rg -n 'reference path="\./\.next/types/routes\.d\.ts"' site/next-env.d.ts || true

echo
echo "Check if generated route file exists in repository checkout:"
if [ -f site/.next/types/routes.d.ts ]; then
  echo "FOUND: site/.next/types/routes.d.ts"
else
  echo "MISSING: site/.next/types/routes.d.ts"
fi

echo
echo "Display full content of site/next-env.d.ts:"
cat -n site/next-env.d.ts

Repository: mincho-js/mincho

Length of output: 609


Remove the direct reference to generated .next route types.

Line 3 hard-codes a reference to a generated file that does not exist in the repository. This will cause TypeScript type-checking failures in clean checkouts before next dev/build generates .next.

Proposed fix
 /// <reference types="next" />
 /// <reference types="next/image-types/global" />
-/// <reference path="./.next/types/routes.d.ts" />
 
 // NOTE: This file should not be edited
 // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
📝 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
/// <reference path="./.next/types/routes.d.ts" />
/// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@site/next-env.d.ts` at line 3, Remove the hard-coded triple-slash reference
to the generated routes types in next-env.d.ts (the line /// <reference
path="./.next/types/routes.d.ts" />); delete that line so TypeScript won't error
on clean checkouts before Next has generated .next, or replace it with a
non-blocking runtime-generated types strategy if you need the reference later.
Ensure the file now only contains the standard Next.js ambient declarations and
no direct reference to .next-generated routes.

@@ -0,0 +1,580 @@
# Define Rules

`defineRules()` is a high-order definition API that creates constrained style functions with property constraints and shortcuts.
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

Use “higher-order” instead of “high-order.”

This is a user-facing terminology typo in the API description.

✏️ Suggested doc fix
-`defineRules()` is a high-order definition API that creates constrained style functions with property constraints and shortcuts.
+`defineRules()` is a higher-order definition API that creates constrained style functions with property constraints 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()` is a high-order definition API that creates constrained style functions with property constraints and shortcuts.
`defineRules()` is a higher-order definition API that creates constrained style functions with property constraints and shortcuts.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@site/src/content/define-rules.mdx` at line 3, Replace the user-facing typo
"high-order" with the correct term "higher-order" in the API description for
defineRules(); specifically update the sentence that currently reads
"`defineRules()` is a high-order definition API..." to use "higher-order" so the
documentation for defineRules() uses the correct terminology.

Comment on lines +397 to +404
```typescript
// Future API
const { css } = defineRules({
conditions: {
hover: { selector: '&:is(:hover, [data-hover])': {} },
focus: { selector: '&:is(:focus, [data-focus])': {} },
checked: { selector: '&:is(:checked, [data-checked], [aria-checked=true])': {} }
}
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

🧩 Analysis chain

🏁 Script executed:

cat -n site/src/content/define-rules.mdx | sed -n '397,404p'

Repository: mincho-js/mincho

Length of output: 398


🏁 Script executed:

# Find type definitions or documentation for defineRules
find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.d.ts" \) | xargs grep -l "defineRules" | head -5

Repository: mincho-js/mincho

Length of output: 167


🏁 Script executed:

# Check the types definition for defineRules conditions
cat ./packages/css/src/defineRules/types.ts

Repository: mincho-js/mincho

Length of output: 21215


🏁 Script executed:

# Search for conditions type or interface definition
grep -rn "conditions" ./packages/css/src/defineRules/ --include="*.ts" -A 3 | head -50

Repository: mincho-js/mincho

Length of output: 42


🏁 Script executed:

cat ./packages/css/src/defineRules/index.ts

Repository: mincho-js/mincho

Length of output: 14424


🏁 Script executed:

# Search for "conditions" in the entire codebase
rg -n "conditions" --type typescript --type mdx -B 2 -A 2 | head -100

Repository: mincho-js/mincho

Length of output: 94


🏁 Script executed:

# Search for "conditions" in the entire codebase
rg -n "conditions" -B 2 -A 2 | head -150

Repository: mincho-js/mincho

Length of output: 5389


🏁 Script executed:

# Search for conditions in documentation and source files
find . -type f \( -name "*.mdx" -o -name "*.ts" -o -name "*.tsx" \) ! -path "*/node_modules/*" ! -path "*/.yarn/*" -exec grep -l "conditions" {} \; | head -20

Repository: mincho-js/mincho

Length of output: 378


🏁 Script executed:

# Check the rules implementation for conditions API
grep -n "conditions" ./packages/css/src/rules/index.ts -B 3 -A 3 | head -50

Repository: mincho-js/mincho

Length of output: 514


🏁 Script executed:

# Search for the conditions property definition in rules
rg "conditions\s*:" ./packages/css/src/rules/index.ts -B 2 -A 2

Repository: mincho-js/mincho

Length of output: 42


🏁 Script executed:

# Check the transform-to-vanilla style-rule types
cat ./packages/transform-to-vanilla/src/types/style-rule.ts

Repository: mincho-js/mincho

Length of output: 17454


🏁 Script executed:

# Check the rules documentation file
grep -n "conditions" ./site/src/content/rules.mdx -B 5 -A 10 | head -100

Repository: mincho-js/mincho

Length of output: 649


🏁 Script executed:

# Look at more context in the define-rules.mdx file around the problematic code
cat -n ./site/src/content/define-rules.mdx | sed -n '385,420p'

Repository: mincho-js/mincho

Length of output: 1201


Fix invalid TypeScript syntax in the Selector Conditions example.

The snippet uses selector: '...': {}syntax, which is not valid JavaScript/TypeScript and will break copy-paste usage. The object values should be strings only, not have a trailing: {}`.

🛠️ Suggested doc fix
 const { css } = defineRules({
   conditions: {
-    hover: { selector: '&:is(:hover, [data-hover])': {} },
-    focus: { selector: '&:is(:focus, [data-focus])': {} },
-    checked: { selector: '&:is(:checked, [data-checked], [aria-checked=true])': {} }
+    hover: { selector: '&:is(:hover, [data-hover])' },
+    focus: { selector: '&:is(:focus, [data-focus])' },
+    checked: { selector: '&:is(:checked, [data-checked], [aria-checked=true])' }
   }
 });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@site/src/content/define-rules.mdx` around lines 397 - 404, The Selector
Conditions example in defineRules uses invalid object syntax like selector:
'&:is(... )': {} which breaks TypeScript/JS; update the conditions block
(symbols: defineRules, conditions, hover, focus, checked, css) so each
condition's selector is a string value (e.g., selector: '&:is(:hover,
[data-hover])') without the trailing ": {}" object—ensure all selector
properties are plain strings to make the snippet valid and copy-pasteable.

Comment on lines +125 to +131
css({
padding: {
Block: 16,
Inline: 24
}
// → padding-block: 16px; padding-inline: 24px;
})
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

🧩 Analysis chain

🏁 Script executed:

# Check if file exists
ls -la site/src/content/getting-started.mdx

Repository: mincho-js/mincho

Length of output: 145


🏁 Script executed:

# Read lines 125-131 from the file
sed -n '125,131p' site/src/content/getting-started.mdx

Repository: mincho-js/mincho

Length of output: 165


🏁 Script executed:

# Get context: read a broader range to understand the snippet purpose
sed -n '120,140p' site/src/content/getting-started.mdx

Repository: mincho-js/mincho

Length of output: 391


Fix invalid object literal in the nested-properties snippet.

Line 129 needs a trailing comma after the padding object; without it, the code snippet contains a syntax error and will fail if copied into TypeScript/JavaScript code.

Suggested fix
 css({
   padding: {
     Block: 16,
     Inline: 24
-  }
+  },
   // → padding-block: 16px; padding-inline: 24px;
 })
📝 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
css({
padding: {
Block: 16,
Inline: 24
}
// → padding-block: 16px; padding-inline: 24px;
})
css({
padding: {
Block: 16,
Inline: 24
},
// → padding-block: 16px; padding-inline: 24px;
})
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@site/src/content/getting-started.mdx` around lines 125 - 131, The snippet
passed to the css(...) call contains an object with a nested padding property
but is missing a trailing comma after the closing brace of the padding object;
update the snippet inside the css call (the padding object in the css(...)
argument) to add a trailing comma after the padding object's closing brace so
the object literal is valid JSON/JS/TS (i.e., ensure the padding: { Block: 16,
Inline: 24 }, line ends with a comma before the next token/comment).

@@ -0,0 +1,1162 @@
# Literal CSS

Mincho.js provides a natural way to write CSS in TypeScript. The `css()` function transforms intuitive syntax into Vanilla Extract compatible styles at build time.
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

Hyphenate “Vanilla Extract-compatible.”

Use a compound adjective here for correct grammar in user-facing docs.

✏️ Suggested doc fix
-Mincho.js provides a natural way to write CSS in TypeScript. The `css()` function transforms intuitive syntax into Vanilla Extract compatible styles at build time.
+Mincho.js provides a natural way to write CSS in TypeScript. The `css()` function transforms intuitive syntax into Vanilla Extract-compatible styles at build time.
📝 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
Mincho.js provides a natural way to write CSS in TypeScript. The `css()` function transforms intuitive syntax into Vanilla Extract compatible styles at build time.
Mincho.js provides a natural way to write CSS in TypeScript. The `css()` function transforms intuitive syntax into Vanilla Extract-compatible styles at build time.
🧰 Tools
🪛 LanguageTool

[grammar] ~3-~3: Use a hyphen to join words.
Context: ...ms intuitive syntax into Vanilla Extract compatible styles at build time. ## Ove...

(QB_NEW_EN_HYPHEN)

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

In `@site/src/content/literal.mdx` at line 3, In the sentence mentioning the
`css()` function that currently reads "Vanilla Extract compatible styles",
change the compound adjective to "Vanilla Extract-compatible styles" (update the
phrase "Vanilla Extract compatible" to "Vanilla Extract-compatible"); search for
and fix any other occurrences of the same unhyphenated phrase in the same doc to
keep grammar consistent.

Comment on lines +74 to +92
```tsx
import { styled } from '@mincho-js/react';

// Function call syntax (primary approach)
const Button = styled('button', {
base: {
padding: '10px 20px',
borderRadius: '4px',
},
});

// Property accessor syntax (styled-components-like)
const Button = styled.button({
base: {
padding: '10px 20px',
borderRadius: '4px',
},
});
```
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

🧩 Analysis chain

🏁 Script executed:

# Check if the file exists and read the relevant lines
if [ -f "site/src/content/styled.mdx" ]; then
  echo "=== File found: site/src/content/styled.mdx ==="
  echo "=== Lines 74-92 ==="
  sed -n '74,92p' site/src/content/styled.mdx | cat -n
else
  # Try to find the file if path is different
  echo "=== Searching for styled.mdx ==="
  find . -name "styled.mdx" -type f 2>/dev/null
fi

Repository: mincho-js/mincho

Length of output: 619


Rename the second Button declaration to avoid duplicate variable error.
This code block redeclares Button on lines 78 and 86, which causes a TypeScript/JavaScript compile error when users copy and paste it. Since the two syntaxes are presented as alternatives, rename the second declaration for clarity.

Suggested fix
 // Function call syntax (primary approach)
 const Button = styled('button', {
   base: {
     padding: '10px 20px',
     borderRadius: '4px',
   },
 });

 // Property accessor syntax (styled-components-like)
-const Button = styled.button({
+const ButtonByAccessor = styled.button({
   base: {
     padding: '10px 20px',
     borderRadius: '4px',
   },
 });
📝 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
```tsx
import { styled } from '@mincho-js/react';
// Function call syntax (primary approach)
const Button = styled('button', {
base: {
padding: '10px 20px',
borderRadius: '4px',
},
});
// Property accessor syntax (styled-components-like)
const Button = styled.button({
base: {
padding: '10px 20px',
borderRadius: '4px',
},
});
```
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@site/src/content/styled.mdx` around lines 74 - 92, The example redeclares the
variable Button twice; rename the second declaration to a different identifier
(e.g., ButtonAlt or ButtonComponent) so the function-call example (const Button
= styled('button', ...)) and the property-access example (const Button =
styled.button(...)) do not conflict—update the second const declaration that
uses styled.button to use the new name and ensure any explanatory text refers to
that new identifier.

Comment on lines +2 to +24
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"]
}
},
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
set -euo pipefail

python - <<'PY'
import json
from pathlib import Path

root = json.loads(Path("tsconfig.json").read_text())
site_ref = any(ref.get("path") == "site" for ref in root.get("references", []))

site_cfg = json.loads(Path("site/tsconfig.json").read_text())
composite = site_cfg.get("compilerOptions", {}).get("composite")

print(f"root references 'site': {site_ref}")
print(f"site compilerOptions.composite: {composite}")
if site_ref and composite is not True:
    print("RESULT: referenced project is missing composite=true")
PY

Repository: mincho-js/mincho

Length of output: 178


Add composite: true for project-reference compatibility.

Since the root tsconfig.json references this project, it requires composite: true in compilerOptions for TypeScript's tsc --build to function correctly.

🛠️ Proposed fix
   "compilerOptions": {
     "jsx": "preserve",
     "incremental": true,
+    "composite": true,
     "plugins": [
📝 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
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"]
}
},
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"composite": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"]
}
},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@site/tsconfig.json` around lines 2 - 24, Add "composite": true to the
compilerOptions in this project's tsconfig.json so the project can be used with
TypeScript project references (tsc --build); update the compilerOptions object
(the same block containing "target", "lib", "strict", etc.) to include
composite: true to ensure compatibility with the root tsconfig.json references.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant