Skip to content

Conversation

@Sparticuz
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings December 5, 2025 17:37
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 modernizes the project's dependencies, tooling, and configuration for 2025, updating from Node 18 to Node 22 as the baseline, and upgrading all development dependencies to their latest versions. The changes include fixing a bug in the encryption logic, improving type definitions, and updating CI/CD workflows.

Key Changes

  • Updated TypeScript configuration to target Node 22 and reorganized compiler options for better clarity
  • Upgraded all development dependencies (ESLint, Vitest, TypeScript, etc.) and GitHub Actions to newer versions
  • Fixed encryption logic by adding missing continue statement for cleartextMetadata handling
  • Corrected import paths from utils.js to utilities.js and improved type definitions in the encryption API

Reviewed changes

Copilot reviewed 15 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
vitest.config.ts Updated to use mode parameter in loadEnv for proper environment variable loading
tsconfig.json Migrated to @tsconfig/node22, reorganized compiler options, added moduleDetection and target settings
test/info.test.ts Added eslint-disable comment for sonarjs/no-hardcoded-passwords
test/encrypt.test.ts Added eslint-disable comment and removed @ts-expect-error that's no longer needed
test/encrypt-and-decrypt.test.ts Added eslint-disable comment for sonarjs/no-hardcoded-passwords
test/decrypt.test.ts Added eslint-disable comment for sonarjs/no-hardcoded-passwords
src/utilities.ts Simplified boolean return by removing unnecessary double negation
src/spawn.ts Added eslint-disable comment for sonarjs/no-os-command-from-path
src/info.ts Corrected import path from utils.js to utilities.js
src/encrypt.ts Corrected import path, reorganized type definitions, made password properties optional, added continue statement for cleartextMetadata handling
src/decrypt.ts Corrected import path from utils.js to utilities.js
package.json Updated all devDependencies to latest versions (ESLint 9.39.1, Vitest 4.0.15, TypeScript 5.9.3, etc.)
eslint.config.js Changed from typescript-eslint to eslint/config for defineConfig import
.github/workflows/npm-publish.yml Updated GitHub Actions from v4 to v6
.github/workflows/node.js.yml Updated Node.js test matrix, QPDF version, and GitHub Actions to v6
.github/workflows/codeql-analysis.yml Removed entire CodeQL analysis workflow file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


import myConfig from "@sparticuz/eslint-config";
import tseslint from "typescript-eslint";
import { defineConfig } from "eslint/config";
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

The import import { defineConfig } from "eslint/config" may not be valid. As of January 2025, ESLint doesn't export from this path. The typical approach for ESLint flat config is to either:

  1. Use plain objects without a helper function, or
  2. Use TypeScript with JSDoc type annotations for type safety

Please verify that this import path exists in ESLint 9.39.1. If not, consider removing the defineConfig wrapper or using a valid import.

Copilot uses AI. Check for mistakes.
Comment on lines +27 to +28
owner?: string;
user?: string;
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

The owner and user properties are marked as optional, but the runtime validation at lines 107-108 requires both to be defined when using an object. This creates a type-safety issue where TypeScript allows passing { user: "test" } or { owner: "test" }, but the code will throw an error at runtime.

Consider making both properties required when using the object form:

| {
    owner: string;
    user: string;
  }

Or update the runtime logic to handle partial password objects appropriately.

Suggested change
owner?: string;
user?: string;
owner: string;
user: string;

Copilot uses AI. Check for mistakes.
crypto.getRandomValues available in node 17.4.0 and higher
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.

2 participants