Skip to content

[compiler] Move capitalize to compiler #7199

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

Merged
merged 8 commits into from
May 2, 2025

Conversation

maorleger
Copy link
Member

@maorleger maorleger commented May 1, 2025

Follow-up from #7153 (comment) - we noticed that many packages have their own copy of this helper so this PR moves it to the compiler where packages can use it.

Copy link
Contributor

github-actions bot commented May 1, 2025

All changed packages have been documented.

  • @typespec/compiler
  • @typespec/openapi3
  • @typespec/protobuf
Show changes

@typespec/compiler - feature ✏️

Add "capitalize" string helper to compiler

@typespec/openapi3 - feature ✏️

Add "capitalize" string helper to compiler

@typespec/protobuf - feature ✏️

Add "capitalize" string helper to compiler

@azure-sdk
Copy link
Collaborator

azure-sdk commented May 1, 2025

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@bterlson
Copy link
Member

bterlson commented May 1, 2025

I wonder, should we consider a separate export path for name utils? Could also include case conversions, which is also VERY commonly needed.

@timotheeguerin
Copy link
Member

talked with @bterlson and while exporting more right now (like rexporting change-case library) would be too risky of a change, we can plan for th future and include this funciton in /casing subexport instead

import {captialize} from "@typespec/compiler/casing";

@maorleger maorleger disabled auto-merge May 1, 2025 19:39
@maorleger
Copy link
Member Author

talked with @bterlson and while exporting more right now (like rexporting change-case library) would be too risky of a change, we can plan for th future and include this funciton in /casing subexport instead

import {captialize} from "@typespec/compiler/casing";

Makes sense, and just to be clear this means we want to add a new entry to package.json for this subpath export correct? Happy to do so, just wanted to make sure I understand 👍

@timotheeguerin
Copy link
Member

talked with @bterlson and while exporting more right now (like rexporting change-case library) would be too risky of a change, we can plan for th future and include this funciton in /casing subexport instead

import {captialize} from "@typespec/compiler/casing";

Makes sense, and just to be clear this means we want to add a new entry to package.json for this subpath export correct? Happy to do so, just wanted to make sure I understand 👍

yep

@maorleger maorleger enabled auto-merge May 2, 2025 17:52
@maorleger maorleger added this pull request to the merge queue May 2, 2025
Merged via the queue into microsoft:main with commit 06c33a5 May 2, 2025
22 checks passed
@maorleger maorleger deleted the capitalize-util branch May 2, 2025 18:34
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.

4 participants