Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING(text): align to single-export file pattern #5428

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented Jul 12, 2024

This PR changes text package to make it adhere to single-export file pattern.

Addresses the feedback in the stabilization review at #5209 (comment)

What's changed

The case utilities (toCamelCase, toKebabCase, toSnakeCase, toPascalCase) are now exported from single-export files, instead of @std/text/case.

Motivation

The standard library generally follows single-export pattern (A single file exports a single API), but these utilities didn't follow that rule without any clear reason. This change makes them follow the pattern to improve the consistency of export structure of the standard library.

Migration

-import {
-  toCamelCase,
-  toKebabCase,
-  toPascalCase,
-  toSnakeCase,
-} from "@std/text/case";
+import { toCamelCase } from "@std/text/to-camel-case";
+import { toKebabCase } from "@std/text/to-kebab-case";
+import { toPascalCase } from "@std/text/to-pascal-case";
+import { toSnakeCase } from "@std/text/to-snake-case";

Note: These utilities are also exported from @std/text (The top-level of the package). If you import them from there, you're not affected by this change.

@github-actions github-actions bot added the text label Jul 12, 2024
Copy link

codecov bot commented Jul 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.35%. Comparing base (1b53ea7) to head (9ec8fb5).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5428   +/-   ##
=======================================
  Coverage   96.35%   96.35%           
=======================================
  Files         458      461    +3     
  Lines       37748    37760   +12     
  Branches     5576     5576           
=======================================
+ Hits        36371    36383   +12     
  Misses       1335     1335           
  Partials       42       42           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

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

Cool. Can you please provide a complete description of the changes? We want to make sure users are absolutely clear on how to what's changed, our motivations, and how to migrate.

@kt3k kt3k merged commit 6391292 into denoland:main Jul 16, 2024
14 checks passed
@kt3k kt3k deleted the breaking-text-single-file-export branch July 16, 2024 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants