Remove camelcase-keys, replace with inline utility#7194
Conversation
1a01cd0 to
ffadb6c
Compare
|
We detected some changes at 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 { |
There was a problem hiding this comment.
We already have a similar function in cli-kit. If you need anything else, I think we should add it to that file.
There was a problem hiding this comment.
Happy to follow up on this, but i think we should prioritize shipping this to support the supply chain remediation project
There was a problem hiding this comment.
Well, camelcase-keys is pinned to a specific version that we have been using for a long time, so it doesn't look urgent.
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
I'll update this to use camelize. The urgency here is founded IMO -- the js community has had two major supply chain attacks in two weeks. Removing deps is a company-wide effort right now, and the cost of consolidation is cheap in comparison. That being said, it's fair feedback that we can just do the centralization now.
There was a problem hiding this comment.
@gonzaloriestra true, but we don't always use --frozen-lockfile and minor version resolutions can transitively lead to major version changes in other deps
0f7fea3 to
afe68a1
Compare
ffadb6c to
806663c
Compare
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/monorail.d.ts@@ -66,10 +66,6 @@ export interface Schemas {
cmd_app_linked_config_uses_cli_managed_urls?: Optional<boolean>;
cmd_app_warning_api_key_deprecation_displayed?: Optional<boolean>;
cmd_app_deployment_mode?: Optional<string>;
- cmd_app_validate_json?: Optional<boolean>;
- cmd_app_validate_valid?: Optional<boolean>;
- cmd_app_validate_issue_count?: Optional<number>;
- cmd_app_validate_file_count?: Optional<number>;
cmd_dev_tunnel_type?: Optional<string>;
cmd_dev_tunnel_custom_hash?: Optional<string>;
cmd_dev_urls_updated?: Optional<boolean>;
|
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>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
806663c to
da3245f
Compare

Summary
camelcase-keys.ts(~40 lines) inapp-logs/with parity behavior to the npm packagepoll-app-logs.ts,utils.ts, and their test files)camelcase-keysfrompackages/app/package.jsonTest plan