Skip to content

Chore: Seperate vanilla extract API to ./compat#219

Merged
github-actions[bot] merged 1 commit intomainfrom
ve-compat-entry
Jul 19, 2025
Merged

Chore: Seperate vanilla extract API to ./compat#219
github-actions[bot] merged 1 commit intomainfrom
ve-compat-entry

Conversation

@black7375
Copy link
Contributor

@black7375 black7375 commented Jul 19, 2025

Description

Separate API for Vanilla Extract into /compat.

Related Issue

Summary by CodeRabbit

  • Chores

    • Updated usage of style functions in example projects to new API names for consistency.
    • Extended supported API list for extraction utilities.
    • Updated build configuration to include a new compatibility entry point.
    • Added a new export subpath for compatibility modules in the package exports.
  • Refactor

    • Removed deprecated style function aliases and related exports.
    • Streamlined and reduced exported APIs, removing unused or duplicate exports.
  • New Features

    • Introduced a compatibility module consolidating exports from multiple CSS utility libraries for easier integration.

Additional context

Checklist

@changeset-bot
Copy link

changeset-bot bot commented Jul 19, 2025

🦋 Changeset detected

Latest commit: 90cde80

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

This PR includes changesets to release 7 packages
Name Type
@mincho-js/babel Minor
@mincho-js/css Minor
@mincho-js/integration Patch
@mincho-js/react Patch
@mincho-js/vite Patch
react-babel Patch
@mincho-js/esbuild 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

@coderabbitai
Copy link

coderabbitai bot commented Jul 19, 2025

Walkthrough

This change removes the style, globalStyle, and styleVariants aliases from the CSS module, updates all code to use css, globalCss, and cssVariants directly, and eliminates the recipe alias for rules. Exports and build configurations are adjusted to reflect these changes, with updated entry points and type exports. A new compatibility module is added re-exporting renamed functions and types for legacy support.

Changes

File(s) Change Summary
examples/react-swc/src/App.css.ts, examples/react-swc/src/index.css.ts Replaced all usage and imports of style/globalStyle with css/globalCss in CSS style definitions.
packages/babel/src/styled.ts Changed import registration in Babel plugin from "recipe" to "rules" for @mincho-js/css.
packages/babel/src/utils.ts Added "css", "cssVariants", "globalCss", and "rules" to the extractionAPIs array.
packages/css/package.json Added new export subpath "./compat" with ESM/CJS module and type declaration paths.
packages/css/src/css/index.ts Removed exported aliases: globalStyle, style, and styleVariants. Updated tests to use css.
packages/css/src/index.ts Reduced exports: only globalCss, css, cssVariants, and rules remain; removed type and alias exports.
packages/css/src/rules/index.ts Removed exported alias: recipe = rules.
packages/css/vite.config.ts Added "compat" entry point to library build configuration.
packages/css/src/compat.ts Added new compatibility module re-exporting renamed CSS functions and types for legacy support.

Sequence Diagram(s)

sequenceDiagram
    participant ReactApp
    participant MinchoCSS
    ReactApp->>MinchoCSS: import { css, globalCss }
    ReactApp->>MinchoCSS: use css() and globalCss() for styling
Loading
sequenceDiagram
    participant BabelPlugin
    participant MinchoCSS
    BabelPlugin->>MinchoCSS: registerImportMethod("rules")
    BabelPlugin->>MinchoCSS: transform styled components using "rules"
Loading
sequenceDiagram
    participant CompatModule
    participant VanillaExtract
    participant LocalCSS
    CompatModule->>VanillaExtract: re-export CSS utilities and types
    CompatModule->>LocalCSS: re-export renamed css functions (style, globalStyle, styleVariants)
    CompatModule->>MinchoCSSRules: re-export rules as recipe
Loading

Possibly related PRs

Poem

🐇
Out with the aliases, clean and new,
css and globalCss—that’s our cue!
No more style or globalStyle in sight,
Exports trimmed down, the future is bright.
With rules in hand, we hop along,
Our CSS garden growing strong!
🌿✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

yarn install v1.22.22
[1/4] Resolving packages...
(node:16047) [DEP0169] DeprecationWarning: url.parse() behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for url.parse() vulnerabilities.
(Use node --trace-deprecation ... to show where the warning was created)
error Couldn't find any versions for "eslint-config-custom" that matches "workspace:^"
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

✨ Finishing Touches
  • 📝 Docstrings were successfully generated. (🔄 Check again to generate docstrings again)

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Contributor

Triggered from #219 by @​black7375.

Checking if we can fast forward main (e770e4c) to ve-compat-entry (5b56ad0).

Target branch (main):

commit e770e4c9d801828b548ee8bf44c6a499ccd8255e (HEAD -> main, origin/main)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Sat Jun 7 03:58:05 2025 +0900

    Chore: Seperate package check CI

Pull request (ve-compat-entry):

commit 5b56ad0b8dc12de8f892f3cc83bf984500f9164c (pull_request/ve-compat-entry)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Mon Jun 9 00:00:00 2025 +0900

    Chore: Seperate vanilla extract API to `./compat`

It is possible to fast forward main (e770e4c) to ve-compat-entry (5b56ad0). If you have write access to the target repository, you can add a comment with /fast-forward to fast forward main to ve-compat-entry.

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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e770e4c and 5b56ad0.

📒 Files selected for processing (9)
  • examples/react-swc/src/App.css.ts (3 hunks)
  • examples/react-swc/src/index.css.ts (3 hunks)
  • packages/babel/src/styled.ts (1 hunks)
  • packages/babel/src/utils.ts (1 hunks)
  • packages/css/package.json (1 hunks)
  • packages/css/src/css/index.ts (2 hunks)
  • packages/css/src/index.ts (2 hunks)
  • packages/css/src/rules/index.ts (0 hunks)
  • packages/css/vite.config.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/css/src/rules/index.ts
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
examples/react-swc/src/index.css.ts (2)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
Learnt from: black7375
PR: mincho-js/mincho#134
File: packages/transform-to-vanilla/src/transform.ts:49-51
Timestamp: 2024-12-03T11:16:32.528Z
Learning: In projects that target both CommonJS and ES modules, adjusting the TypeScript `module` option may not be feasible. Therefore, using `@ts-ignore` comments to suppress TypeScript errors related to `import.meta` is acceptable.
packages/babel/src/utils.ts (1)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
packages/babel/src/styled.ts (1)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
packages/css/vite.config.ts (2)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
Learnt from: black7375
PR: mincho-js/mincho#134
File: packages/transform-to-vanilla/src/transform.ts:49-51
Timestamp: 2024-12-03T11:16:32.528Z
Learning: In projects that target both CommonJS and ES modules, adjusting the TypeScript `module` option may not be feasible. Therefore, using `@ts-ignore` comments to suppress TypeScript errors related to `import.meta` is acceptable.
examples/react-swc/src/App.css.ts (2)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
Learnt from: black7375
PR: mincho-js/mincho#134
File: packages/transform-to-vanilla/src/transform.ts:49-51
Timestamp: 2024-12-03T11:16:32.528Z
Learning: In projects that target both CommonJS and ES modules, adjusting the TypeScript `module` option may not be feasible. Therefore, using `@ts-ignore` comments to suppress TypeScript errors related to `import.meta` is acceptable.
packages/css/src/css/index.ts (3)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
Learnt from: black7375
PR: mincho-js/mincho#110
File: packages/css/src/rules/types.ts:25-29
Timestamp: 2024-09-29T14:13:13.977Z
Learning: For `ToggleVariantMap`, only the `true` state is needed for toggle variants.
Learnt from: black7375
PR: mincho-js/mincho#110
File: packages/css/src/rules/types.ts:25-29
Timestamp: 2024-10-09T13:00:38.449Z
Learning: For `ToggleVariantMap`, only the `true` state is needed for toggle variants.
packages/css/package.json (2)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
Learnt from: black7375
PR: mincho-js/mincho#134
File: packages/transform-to-vanilla/src/transform.ts:49-51
Timestamp: 2024-12-03T11:16:32.528Z
Learning: In projects that target both CommonJS and ES modules, adjusting the TypeScript `module` option may not be feasible. Therefore, using `@ts-ignore` comments to suppress TypeScript errors related to `import.meta` is acceptable.
packages/css/src/index.ts (2)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
Learnt from: black7375
PR: mincho-js/mincho#134
File: packages/transform-to-vanilla/src/transform.ts:49-51
Timestamp: 2024-12-03T11:16:32.528Z
Learning: In projects that target both CommonJS and ES modules, adjusting the TypeScript `module` option may not be feasible. Therefore, using `@ts-ignore` comments to suppress TypeScript errors related to `import.meta` is acceptable.
🧬 Code Graph Analysis (2)
examples/react-swc/src/index.css.ts (2)
packages/css/src/index.ts (1)
  • globalCss (28-28)
packages/css/src/css/index.ts (1)
  • globalCss (18-40)
examples/react-swc/src/App.css.ts (1)
packages/css/src/css/index.ts (2)
  • globalCss (18-40)
  • css (104-106)
🔇 Additional comments (9)
examples/react-swc/src/index.css.ts (1)

1-69: LGTM! Clean API migration from globalStyle to globalCss.

The migration is consistent across all global style declarations, maintaining the same function signatures and styling logic while using the updated API names.

packages/babel/src/utils.ts (1)

73-76: LGTM! Correct addition of new extraction APIs.

The new API names (css, cssVariants, globalCss, rules) are properly added to the extraction list, ensuring babel tooling recognizes these identifiers for CSS extraction.

packages/css/vite.config.ts (1)

13-14: LGTM! Proper addition of compat entry point.

The build configuration correctly adds the new compat entry point, enabling separate builds for the compatibility module as intended by the PR objectives.

examples/react-swc/src/App.css.ts (1)

1-49: LGTM! Consistent API migration from aliases to direct function names.

The migration from globalStyle/style to globalCss/css is applied consistently throughout the file while preserving all styling logic and export names.

packages/babel/src/styled.ts (1)

58-58: LGTM! Correct migration from recipe alias to rules.

The change from "recipe" to "rules" aligns with the broader API migration to remove aliases in favor of direct function names, ensuring the babel plugin imports the correct identifier.

packages/css/src/css/index.ts (2)

203-203: LGTM: Test updated to use direct API.

The test correctly uses css instead of the removed style alias, maintaining consistency with the API cleanup.


244-244: LGTM: Test updated to use direct API.

The test correctly uses css instead of the removed style alias, maintaining consistency with the API cleanup.

packages/css/package.json (1)

45-54: LGTM: Compat export properly configured.

The new ./compat export follows the established pattern with proper ESM/CJS dual-mode support and type declarations. This correctly supports the separation of Vanilla Extract API to the compat directory.

packages/css/src/index.ts (1)

1-6: LGTM: Type re-exports improve module organization.

Converting from import type to export type for CSS-related types improves the module's public API by making these types directly available to consumers.

Comment on lines +28 to +29
export { globalCss, css, cssVariants } from "./css/index.js";
export { rules } from "./rules/index.js";
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify removed exports are available in compat module.

The export reduction correctly removes Vanilla Extract aliases (globalStyle, style, styleVariants) and recipe/createRuntimeFn, aligning with the PR objective to separate these APIs. However, please ensure these removed functions are properly exported from the new ./compat module for backward compatibility.


🏁 Script executed:

#!/bin/bash
# Description: Verify that removed exports are available in the compat module
# Expected: compat.ts should export the removed aliases and functions

# Check if compat.ts exists and contains the expected exports
fd -t f "compat.ts" packages/css/src/ --exec cat {} \; | head -20

# Search for the removed function exports in compat module
rg -A 3 "export.*(?:globalStyle|style|styleVariants|recipe|createRuntimeFn)" packages/css/src/

Length of output: 699


Missing backward‐compat exports in the compat module

I didn’t find a compat.ts (or compat/index.ts) exporting the removed aliases and functions. To preserve backwards compatibility, please add or update that file under packages/css/src/ so it re‐exports:

  • globalStyle (alias for globalCss)
  • style (alias for css)
  • styleVariants (alias for cssVariants)
  • recipe (from ./rules)
  • createRuntimeFn (from ./rules/createRuntimeFn)

Example implementation:

// packages/css/src/compat.ts
export { globalCss as globalStyle, css as style, cssVariants as styleVariants } from "./css/index.js";
export { recipe } from "./rules/index.js";
export { createRuntimeFn } from "./rules/createRuntimeFn.js";

Please ensure this file is included in your package entrypoints so consumers relying on the old API continue to work.

🤖 Prompt for AI Agents
In packages/css/src/compat.ts, create a new file that re-exports the
backward-compatible aliases and functions: export globalCss as globalStyle, css
as style, and cssVariants as styleVariants from "./css/index.js"; export recipe
from "./rules/index.js"; and export createRuntimeFn from
"./rules/createRuntimeFn.js". Then update the package entrypoints to include
this compat.ts file so that consumers relying on the old API continue to work
without issues.

@github-actions
Copy link
Contributor

Triggered from #219 by @​black7375.

Checking if we can fast forward main (e770e4c) to ve-compat-entry (9fcf794).

Target branch (main):

commit e770e4c9d801828b548ee8bf44c6a499ccd8255e (HEAD -> main, origin/main)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Sat Jun 7 03:58:05 2025 +0900

    Chore: Seperate package check CI

Pull request (ve-compat-entry):

commit 9fcf794f490ae60e4d0632195f10ddfa70a7d5d4 (pull_request/ve-compat-entry)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Mon Jun 9 00:00:00 2025 +0900

    Chore: Seperate vanilla extract API to `./compat`

It is possible to fast forward main (e770e4c) to ve-compat-entry (9fcf794). If you have write access to the target repository, you can add a comment with /fast-forward to fast forward main to ve-compat-entry.

@github-actions
Copy link
Contributor

Triggered from #219 by @​black7375.

Checking if we can fast forward main (e770e4c) to ve-compat-entry (90cde80).

Target branch (main):

commit e770e4c9d801828b548ee8bf44c6a499ccd8255e (HEAD -> main, origin/main)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Sat Jun 7 03:58:05 2025 +0900

    Chore: Seperate package check CI

Pull request (ve-compat-entry):

commit 90cde801cc0133649869bfed9c2e053aa600f6db (pull_request/ve-compat-entry)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Sat Jul 19 21:37:30 2025 +0900

    Chore: Seperate vanilla extract API to `./compat`

It is possible to fast forward main (e770e4c) to ve-compat-entry (90cde80). If you have write access to the target repository, you can add a comment with /fast-forward to fast forward main to ve-compat-entry.

@black7375
Copy link
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Jul 19, 2025

✅ Actions performed

Full review triggered.

@black7375
Copy link
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Jul 19, 2025

✅ Actions performed

Full review triggered.

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

🧹 Nitpick comments (1)
packages/babel/src/utils.ts (1)

70-108: Consider cleaning up duplicate entries.

The extractionAPIs array contains duplicate entries for vanilla-extract APIs (lines 78-95 and 92-105). While this doesn't break functionality, it could be cleaned up for maintainability.

export const extractionAPIs = [
  // @mincho-js/css
  "mincho$",
  "css",
  "cssVariants", 
  "globalCss",
  "rules",
  // @vanilla-extract/css
  "style",
  "styleVariants",
  "globalStyle",
  "createTheme",
  "createGlobalTheme",
  "createThemeContract",
  "createGlobalThemeContract",
  "assignVars",
  "createVar",
  "fallbackVar",
  "fontFace",
  "globalFontFace",
  "keyframes",
  "globalKeyframes",
-  "style",
-  "styleVariants",
-  "globalStyle",
-  "createTheme",
-  "createGlobalTheme",
-  "createThemeContract",
-  "createGlobalThemeContract",
-  "assignVars",
-  "createVar",
-  "fallbackVar",
-  "fontFace",
-  "globalFontFace",
-  "keyframes",
-  "globalKeyframes",
  // @vanilla-extract/recipes
  "recipe"
];
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e770e4c and 90cde80.

📒 Files selected for processing (11)
  • .changeset/calm-heads-care.md (1 hunks)
  • examples/react-swc/src/App.css.ts (3 hunks)
  • examples/react-swc/src/index.css.ts (3 hunks)
  • packages/babel/src/styled.ts (1 hunks)
  • packages/babel/src/utils.ts (1 hunks)
  • packages/css/package.json (1 hunks)
  • packages/css/src/compat.ts (1 hunks)
  • packages/css/src/css/index.ts (2 hunks)
  • packages/css/src/index.ts (2 hunks)
  • packages/css/src/rules/index.ts (0 hunks)
  • packages/css/vite.config.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/css/src/rules/index.ts
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
Learnt from: black7375
PR: mincho-js/mincho#134
File: packages/transform-to-vanilla/src/transform.ts:49-51
Timestamp: 2024-12-03T11:16:32.528Z
Learning: In projects that target both CommonJS and ES modules, adjusting the TypeScript `module` option may not be feasible. Therefore, using `@ts-ignore` comments to suppress TypeScript errors related to `import.meta` is acceptable.
packages/css/vite.config.ts (2)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
Learnt from: black7375
PR: mincho-js/mincho#134
File: packages/transform-to-vanilla/src/transform.ts:49-51
Timestamp: 2024-12-03T11:16:32.528Z
Learning: In projects that target both CommonJS and ES modules, adjusting the TypeScript `module` option may not be feasible. Therefore, using `@ts-ignore` comments to suppress TypeScript errors related to `import.meta` is acceptable.
examples/react-swc/src/index.css.ts (1)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
packages/babel/src/styled.ts (1)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
packages/babel/src/utils.ts (1)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
examples/react-swc/src/App.css.ts (2)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
Learnt from: black7375
PR: mincho-js/mincho#134
File: packages/transform-to-vanilla/src/transform.ts:49-51
Timestamp: 2024-12-03T11:16:32.528Z
Learning: In projects that target both CommonJS and ES modules, adjusting the TypeScript `module` option may not be feasible. Therefore, using `@ts-ignore` comments to suppress TypeScript errors related to `import.meta` is acceptable.
packages/css/src/css/index.ts (3)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
Learnt from: black7375
PR: mincho-js/mincho#110
File: packages/css/src/rules/types.ts:25-29
Timestamp: 2024-09-29T14:13:13.977Z
Learning: For `ToggleVariantMap`, only the `true` state is needed for toggle variants.
Learnt from: black7375
PR: mincho-js/mincho#110
File: packages/css/src/rules/types.ts:25-29
Timestamp: 2024-10-09T13:00:38.449Z
Learning: For `ToggleVariantMap`, only the `true` state is needed for toggle variants.
packages/css/package.json (2)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
Learnt from: black7375
PR: mincho-js/mincho#134
File: packages/transform-to-vanilla/src/transform.ts:49-51
Timestamp: 2024-12-03T11:16:32.528Z
Learning: In projects that target both CommonJS and ES modules, adjusting the TypeScript `module` option may not be feasible. Therefore, using `@ts-ignore` comments to suppress TypeScript errors related to `import.meta` is acceptable.
.changeset/calm-heads-care.md (1)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
packages/css/src/compat.ts (2)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
Learnt from: black7375
PR: mincho-js/mincho#134
File: packages/transform-to-vanilla/src/transform.ts:49-51
Timestamp: 2024-12-03T11:16:32.528Z
Learning: In projects that target both CommonJS and ES modules, adjusting the TypeScript `module` option may not be feasible. Therefore, using `@ts-ignore` comments to suppress TypeScript errors related to `import.meta` is acceptable.
packages/css/src/index.ts (2)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
Learnt from: black7375
PR: mincho-js/mincho#134
File: packages/transform-to-vanilla/src/transform.ts:49-51
Timestamp: 2024-12-03T11:16:32.528Z
Learning: In projects that target both CommonJS and ES modules, adjusting the TypeScript `module` option may not be feasible. Therefore, using `@ts-ignore` comments to suppress TypeScript errors related to `import.meta` is acceptable.
🧬 Code Graph Analysis (1)
examples/react-swc/src/App.css.ts (3)
packages/css/src/compat.ts (2)
  • globalCss (22-22)
  • css (23-23)
packages/css/src/index.ts (2)
  • globalCss (28-28)
  • css (28-28)
packages/css/src/css/index.ts (2)
  • globalCss (18-40)
  • css (104-106)
🔇 Additional comments (12)
.changeset/calm-heads-care.md (1)

1-7: LGTM! Clear changeset documentation.

The changeset properly documents the minor version updates for both affected packages and clearly describes the separation of the vanilla extract API to the ./compat directory.

examples/react-swc/src/index.css.ts (2)

1-1: LGTM! Proper migration to canonical API.

The import has been correctly updated from globalStyle to globalCss, aligning with the removal of legacy aliases from the main package exports.


3-69: LGTM! Consistent function call updates.

All globalStyle function calls have been systematically replaced with globalCss while preserving the CSS content and logic. This change properly reflects the API standardization.

packages/css/vite.config.ts (1)

13-14: LGTM! Proper multi-entry build configuration.

The build configuration correctly adds the new compat entry point while enabling the main index entry. This supports the separation of the vanilla extract API into a dedicated compatibility module.

packages/babel/src/utils.ts (1)

73-76: LGTM! Extraction APIs updated for new canonical names.

The addition of "css", "cssVariants", "globalCss", and "rules" correctly reflects the new canonical API identifiers that replace the legacy aliases.

examples/react-swc/src/App.css.ts (2)

1-1: LGTM! Import updated to canonical API names.

The import statement correctly replaces globalStyle and style with globalCss and css, reflecting the removal of legacy aliases from the main package exports.


3-49: LGTM! Function calls consistently updated.

All globalStyle and style function calls have been systematically replaced with globalCss and css respectively, while preserving all CSS content, animations, and styling logic. This properly completes the migration to the canonical API.

packages/babel/src/styled.ts (1)

56-60: LGTM! Correctly updated to use the direct export name.

The change from "recipe" to "rules" aligns with the removal of the recipe alias and the move to use base function names directly. This ensures the babel plugin works with the updated API surface.

packages/css/src/css/index.ts (1)

203-203: LGTM! Tests correctly updated to use base function names.

The test cases have been properly updated from style() to css(), aligning with the removal of the alias and the move to use base function names directly.

Also applies to: 244-244

packages/css/package.json (1)

45-54: LGTM! Properly configured compat module export.

The new "./compat" export subpath correctly provides dual module format support (ESM and CommonJS) with appropriate type declarations, enabling consumers to access the backward-compatible aliases.

packages/css/src/index.ts (1)

28-29: LGTM! Export reduction correctly implemented with compat module available.

The removal of aliases (globalStyle, style, styleVariants, recipe) from the main exports is correctly implemented. The backward compatibility concern from previous reviews is now addressed by the new compat.ts module that provides these aliases.

packages/css/src/compat.ts (1)

1-49: LGTM! Excellent backward compatibility implementation.

This compat module perfectly addresses the backward compatibility concerns raised in previous reviews. It correctly:

  • Re-exports vanilla-extract functions that were moved out of main exports
  • Provides aliases for renamed functions (globalCss as globalStyle, css as style, cssVariants as styleVariants)
  • Re-exports rules as recipe to maintain the old API
  • Includes all necessary type exports with appropriate renaming

This ensures consumers relying on the old API can continue to work by importing from @mincho-js/css/compat.

coderabbitai bot added a commit that referenced this pull request Jul 19, 2025
Docstrings generation was requested by @black7375.

* #219 (comment)

The following files were modified:

* `packages/babel/src/styled.ts`
* `packages/css/src/css/index.ts`
* `packages/css/src/rules/index.ts`
@coderabbitai
Copy link

coderabbitai bot commented Jul 19, 2025

Note

Generated docstrings for this pull request at #220

@black7375
Copy link
Contributor Author

/fast-forward

@github-actions
Copy link
Contributor

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

Trying to fast forward main (e770e4c) to ve-compat-entry (90cde80).

Target branch (main):

commit e770e4c9d801828b548ee8bf44c6a499ccd8255e (HEAD -> main, origin/main)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Sat Jun 7 03:58:05 2025 +0900

    Chore: Seperate package check CI

Pull request (ve-compat-entry):

commit 90cde801cc0133649869bfed9c2e053aa600f6db (pull_request/ve-compat-entry)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Sat Jul 19 21:37:30 2025 +0900

    Chore: Seperate vanilla extract API to `./compat`

Fast forwarding main (e770e4c) to ve-compat-entry (90cde80).

$ git push origin 90cde801cc0133649869bfed9c2e053aa600f6db:main
To https://github.com/mincho-js/mincho.git
   e770e4c..90cde80  90cde801cc0133649869bfed9c2e053aa600f6db -> main

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