Skip to content

Remove camelcase-keys, replace with inline utility#7194

Open
ryancbahan wants to merge 1 commit intographite-base/7194from
04-03-04-03-remove-camelcase-keys
Open

Remove camelcase-keys, replace with inline utility#7194
ryancbahan wants to merge 1 commit intographite-base/7194from
04-03-04-03-remove-camelcase-keys

Conversation

@ryancbahan
Copy link
Copy Markdown
Contributor

@ryancbahan ryancbahan commented Apr 3, 2026

Summary

  • Add camelcase-keys.ts (~40 lines) in app-logs/ with parity behavior to the npm package
  • Handles: snake_case, kebab-case, deep recursion, leading underscore stripping, ALL_CAPS normalization, Date/non-plain-object preservation
  • Update 4 import sites (poll-app-logs.ts, utils.ts, and their test files)
  • Remove camelcase-keys from packages/app/package.json

Test plan

  • 16 parity tests covering all edge cases
  • All 57 app-logs tests pass

Copy link
Copy Markdown
Contributor Author

ryancbahan commented Apr 3, 2026

Add a local camelcase-keys.ts with parity behavior: snake_case/kebab-case
to camelCase key conversion, deep recursion, leading underscore stripping,
ALL_CAPS handling, and Date/non-plain-object preservation. Includes 16
parity tests. Update 4 call sites in app-logs to use the local module.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ryancbahan ryancbahan force-pushed the 04-03-04-03-remove-camelcase-keys branch from 1a01cd0 to ffadb6c Compare April 3, 2026 22:37
@ryancbahan ryancbahan marked this pull request as ready for review April 3, 2026 22:39
@ryancbahan ryancbahan requested a review from a team as a code owner April 3, 2026 22:39
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

Caution

DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

/**
* Converts a string from snake_case or kebab-case to camelCase.
*/
function toCamelCase(str: string): string {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We already have a similar function in cli-kit. If you need anything else, I think we should add it to that file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Happy to follow up on this, but i think we should prioritize shipping this to support the supply chain remediation project

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Well, camelcase-keys is pinned to a specific version that we have been using for a long time, so it doesn't look urgent.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree with Gonzalo here, we can use the one from cli-kit. No need to add 2 new files with 100+ changes for something that already exists :thinking_face:
An agent can quickly update this PR to use the camelize function from cli-kit, I don't think there is that much urgency to remove this dependency that prevents us to doing it the right way!

@ryancbahan ryancbahan changed the base branch from 04-03-04-03-remove-ansi-colors to graphite-base/7194 April 6, 2026 21:55
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.

3 participants