Skip to content

Conversation

@egordidenko
Copy link
Contributor

Description

Checklist

@egordidenko egordidenko requested a review from Copilot May 23, 2025 11:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new quality-insights package to the monorepo, including build configuration, TypeScript setup, core utilities, API services, and package metadata.

  • Registers packages/quality-insights in ship.config.mjs
  • Adds Vite and TS configuration plus initial source files (utils, schema, services)
  • Creates package.json, .env, and .gitignore for the new package

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
ship.config.mjs Registers new package and version update hook
packages/quality-insights/vite.config.js Configures Vite build and alias for the library
packages/quality-insights/tsconfig.json TypeScript compiler settings for the package
packages/quality-insights/src/version.ts Initializes package version export
packages/quality-insights/src/utils/keysOfBodyToCamelToSnake.ts Adds utility to convert camelCase keys to snake_case
packages/quality-insights/src/shared/schema/telemetry.ts Defines request/response schemas with Zod
packages/quality-insights/src/shared/lib/zod.ts Implements safe parsing helper wrappers
packages/quality-insights/src/shared/lib/Result.ts Introduces a Result type for operations
packages/quality-insights/src/api/TelemetryAPI.ts Implements the telemetry API service
packages/quality-insights/src/api/BaseService.ts Core HTTP service with GET/POST methods
packages/quality-insights/src/main.ts Exposes public API exports
packages/quality-insights/package.json Package metadata and scripts
packages/quality-insights/index.html Development HTML entry
packages/quality-insights/.gitignore Ignored files for the package
packages/quality-insights/.env.staging Staging environment variables
packages/quality-insights/.env.production Production environment variables
Comments suppressed due to low confidence (3)

packages/quality-insights/src/utils/keysOfBodyToCamelToSnake.ts:1

  • [nitpick] The filename and function name are verbose and a bit inconsistent. Consider renaming the file to 'snakeCaseKeys.ts' and the function to 'toSnakeCase' for clarity.
function camelToSnake(str: string): string {

@@ -0,0 +1 @@
export default '6.14.3'
Copy link

Copilot AI May 23, 2025

Choose a reason for hiding this comment

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

The hardcoded version does not match the package.json version (0.1.0-alpha.0). Either initialize it to the same version or let the versionUpdated hook overwrite it at publish time.

Copilot uses AI. Check for mistakes.
export const safeParseAsync = async <TOutput, TInput>(
schema: ZodSchema<TOutput, ZodTypeDef, TInput> | undefined,
data: unknown
): Promise<SafeParseReturnType<TInput, TOutput>> => {
Copy link

Copilot AI May 23, 2025

Choose a reason for hiding this comment

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

The generic parameters for SafeParseReturnType appear inverted. It should likely be SafeParseReturnType<TOutput, TInput> to reflect parsing output as TOutput.

Suggested change
): Promise<SafeParseReturnType<TInput, TOutput>> => {
): Promise<SafeParseReturnType<TOutput, TInput>> => {

Copilot uses AI. Check for mistakes.
Comment on lines 44 to 48
"vite": "^6.3.1",
"zod": "^3.24.3"
},
"dependencies": {
"vite-plugin-dts": "^4.5.3"
Copy link

Copilot AI May 23, 2025

Choose a reason for hiding this comment

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

Zod is imported at runtime in your schemas, so it should be listed under 'dependencies' rather than 'devDependencies' to ensure it’s included in production installs.

Suggested change
"vite": "^6.3.1",
"zod": "^3.24.3"
},
"dependencies": {
"vite-plugin-dts": "^4.5.3"
"vite": "^6.3.1"
},
"dependencies": {
"vite-plugin-dts": "^4.5.3",
"zod": "^3.24.3"

Copilot uses AI. Check for mistakes.
@uploadcare uploadcare deleted a comment from Copilot AI May 23, 2025
@uploadcare uploadcare deleted a comment from Copilot AI May 23, 2025
@uploadcare uploadcare deleted a comment from Copilot AI May 23, 2025
}

public async sendEvent(body: TelemetryRequest, options?: RequestInit) {
const parseResult = await safeParseAsync(
Copy link
Member

Choose a reason for hiding this comment

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

Are we sure that zod isn't bundled into the production bundle? I wish we could add size-limit here just to be sure that it will not be bundled in the future.

@egordidenko egordidenko merged commit d2d3208 into master Jun 19, 2025
3 checks passed
@egordidenko egordidenko deleted the feat/quality-insights branch June 19, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants