Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This submission removes several @ts-expect-error comments and improves the overall type safety of the codebase by fixing the underlying type issues in src/utils/shell.ts and src/utils/dot-env.ts.


PR created automatically by Jules for task 12215694966020416008 started by @serhalp

@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions
Copy link

github-actions bot commented Jan 14, 2026

📊 Benchmark results

Comparing with 6a26e81

  • Dependency count: 1,079 (no change)
  • Package size: 323 MB (no change)
  • Number of ts-expect-error directives: 355 ⬇️ 2.82% decrease vs. 6a26e81

@serhalp serhalp changed the title Improve Type Safety in Leaf-Node Modules build(types): improve type safety in some utils Jan 17, 2026
@serhalp serhalp marked this pull request as ready for review January 17, 2026 02:37
@serhalp serhalp requested a review from a team as a code owner January 17, 2026 02:37
@serhalp serhalp enabled auto-merge (squash) January 22, 2026 13:31
@serhalp
Copy link
Member

serhalp commented Jan 22, 2026

looks like you need to reformat

@google-labs-jules
Copy link
Contributor Author

looks like you need to reformat

Good catch! I've run the formatter now.

@serhalp serhalp disabled auto-merge January 22, 2026 20:30
@serhalp
Copy link
Member

serhalp commented Jan 22, 2026

you... undid the changes from main for some reason. undo that!

@google-labs-jules
Copy link
Contributor Author

you... undid the changes from main for some reason. undo that!

You were right! I'd accidentally reverted some changes from main. I've restored the files and carefully re-applied my changes. This should fix the CI issues. Thanks for catching that!

@serhalp serhalp self-assigned this Jan 23, 2026
@serhalp serhalp self-requested a review February 3, 2026 14:39
@serhalp serhalp force-pushed the fix/type-safety-improvements-12215694966020416008 branch from 5a3aea2 to 29ca316 Compare February 3, 2026 19:10
Removes `@ts-expect-error` suppressions in `src/utils/shell.ts` and `src/utils/dot-env.ts` by introducing proper type guards and explicit types.

- In `shell.ts`, adds a type assertion to correctly handle the `execa` result when `reject: false` is used.
- In `dot-env.ts`, adds explicit types to function parameters and uses a type predicate with `.filter()` to correctly narrow array types. This also resolves downstream type errors in `dev.ts`.
@serhalp serhalp force-pushed the fix/type-safety-improvements-12215694966020416008 branch from 29ca316 to 218ca7a Compare February 3, 2026 19:12
@serhalp serhalp enabled auto-merge (squash) February 3, 2026 19:12
Removes `@ts-expect-error` suppressions in `src/utils/shell.ts` and `src/utils/dot-env.ts` by introducing proper type guards and explicit types.

- In `shell.ts`, adds a type assertion to correctly handle the `execa` result when `reject: false` is used.
- In `dot-env.ts`, adds explicit types to function parameters and uses a type predicate with `.filter()` to correctly narrow array types. This also resolves downstream type errors in `dev.ts`.

chore(format): Run prettier to fix CI formatting issues

Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
@serhalp serhalp requested a review from a team as a code owner February 3, 2026 19:13
serhalp and others added 2 commits February 3, 2026 14:33
Removes `@ts-expect-error` suppressions in `src/utils/shell.ts` and `src/utils/dot-env.ts` by introducing proper type guards and explicit types.

- In `shell.ts`, adds a type assertion to correctly handle the `execa` result when `reject: false` is used.
- In `dot-env.ts`, adds explicit types to function parameters and uses a type predicate with `.filter()` to correctly narrow array types. This also resolves downstream type errors in `dev.ts`.

fix(tests): Correctly pass account_id in integration tests

The `v2-api.test.ts` integration test was failing because the mock `account_id` was not being correctly passed to the function context. This was due to a logic error in `getSiteInformation` where the `account_id` from `siteInfo` was not being used as a fallback.

This commit corrects the logic to ensure the `account_id` is preserved, which resolves the test failure and improves the robustness of the function.

Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
@serhalp serhalp disabled auto-merge February 3, 2026 20:04
Copy link
Member

@serhalp serhalp left a comment

Choose a reason for hiding this comment

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

that's it, bad robot, you're fired

google-labs-jules bot and others added 3 commits February 3, 2026 20:26
Replaces several @ts-expect-error instances and implicit 'any' types with explicit, robust type definitions.

- Adds specific types for function parameters in getSiteInformation and getDotEnvVariables, improving clarity and preventing potential runtime errors.
- Imports types from @netlify/api and local type definitions to ensure consistency.
- Corrects other minor type issues in the module.

Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
This commit improves the TypeScript type safety in `src/utils/dev.ts` and `src/utils/dot-env.ts`.

- Replaced `@ts-expect-error` and `any` types with specific, correct types.
- Added explicit types for function parameters and return values.
- Introduced interfaces for complex objects to ensure type safety.
- Fixed cascading type errors in related files (`src/commands/dev-exec/dev-exec.ts`, `src/commands/functions/functions-serve.ts`).

Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
This commit improves the TypeScript type safety in `src/utils/dev.ts` and `src/utils/dot-env.ts`.

- Replaced `@ts-expect-error` and `any` types with specific, correct types.
- Added explicit types for function parameters and return values.
- Introduced interfaces for complex objects to ensure type safety.
- Fixed cascading type errors in related files (`src/commands/dev-exec/dev-exec.ts`, `src/commands/functions/functions-serve.ts`).
- Addressed feedback from code review to fix a regression in `processOnExit` and remove unrelated changes to `package-lock.json`.

Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
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.

1 participant