Skip to content

Conversation

@AndrewHanasiro
Copy link
Member

@AndrewHanasiro AndrewHanasiro commented Dec 17, 2025

Summary by CodeRabbit

  • Chores

    • Removed browser-specific testing addons from dev dependencies, retaining the core test framework.
    • Added a Makefile with convenience targets for cleaning, installing, building checks, and running tests.
  • Tests

    • Enabled global test APIs to simplify test syntax.
    • Standardized on the base testing-library matchers and removed browser-specific type references.
    • Updated TypeScript testing typings for better IDE/type support.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 17, 2025

Walkthrough

Remove Vitest browser-specific packages and type references; add Vitest globals configuration and global test setup changes; introduce a Makefile. Core Vitest dependency remains.

Changes

Cohort / File(s) Change Summary
Package & test deps
package.json
Removed browser-specific Vitest devDependencies (@vitest/browser, @vitest/browser-playwright, vitest-browser-svelte variants); kept core vitest
TS config
tsconfig.json
Added "vitest/globals" to the types array (ambient typings for Vitest globals)
Vitest client setup
vitest-setup-client.ts, vitest-setup.js
vitest-setup-client.ts: removed triple-slash references to @vitest/browser types; vitest-setup.js: replaced Vitest-specific Jest DOM import with @testing-library/jest-dom
Vite/Vitest test config
vite.config.ts
Enabled globals: true in Vitest test config to expose test APIs globally
CI / dev scripts
Makefile
Added Makefile with clean/test, clean/node, and ci phony targets for cleaning, installing, building checks, and running tests

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to package.json removal impact on any e2e/browser tests or CI that previously relied on those packages.
  • Verify tsconfig.json typings and vite.config.ts globals setting align with test code imports/usages.
  • Confirm vitest-setup.js matcher imports match current test matcher usage.
  • Review new Makefile targets for platform-specific assumptions and CI compatibility.

Possibly related PRs

  • feat: update #14: Adds/configures @vitest/browser and Playwright-related test types — directly related and opposite in approach.

Poem

🐰
I hopped through code with tiny feet,
Cleared browser crumbs and made things neat,
Vitest stays, the globals hum,
New Makefile hops — tests can run! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is completely empty, missing all required sections from the template including Proposal and Links. Add a comprehensive description following the repository template with a proposal section explaining why these changes are needed and any relevant links or issue references.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: removing unused browser-related packages and updating TypeScript configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/remove-packages

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@AndrewHanasiro AndrewHanasiro merged commit 8725919 into main Dec 18, 2025
5 of 7 checks passed
@AndrewHanasiro AndrewHanasiro deleted the feature/remove-packages branch December 18, 2025 01:55
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
Makefile (1)

1-16: Consider adding conventional Makefile targets.

While not required, adding conventional phony targets (all, clean, test) improves discoverability and aligns with common Makefile patterns. You could alias them to your namespaced targets.

🔎 Example additions:
.PHONY: all
all: ci

.PHONY: clean
clean: clean/test

.PHONY: test
test:
	npm run test
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fc6378e and 6bb1e75.

📒 Files selected for processing (4)
  • Makefile (1 hunks)
  • tsconfig.json (1 hunks)
  • vite.config.ts (1 hunks)
  • vitest-setup.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tsconfig.json
🧰 Additional context used
🪛 checkmake (0.2.2)
Makefile

[warning] 10-10: Missing required phony target "all"

(minphony)


[warning] 10-10: Missing required phony target "clean"

(minphony)


[warning] 10-10: Missing required phony target "test"

(minphony)

🔇 Additional comments (3)
Makefile (1)

10-16: CI orchestration looks good, pending fixes to clean targets.

The CI workflow appropriately sequences cleanup, installation, build checks, and tests. However, this depends on resolving the issues in the clean targets (sudo usage and package-lock.json removal).

vitest-setup.js (1)

1-1: LGTM! The switch to standard Jest DOM matchers is correct and aligns with removing Vitest browser-specific packages. @testing-library/jest-dom is properly listed in devDependencies.

vite.config.ts (1)

8-8: LGTM! Configuration is correct.

The addition of globals: true enables global test APIs without imports and is properly paired with "vitest/globals" in the tsconfig.json types array.

@@ -0,0 +1,16 @@
.PHONY: clean/test
clean/test:
sudo rm -rf coverage build .svelte-kit test-results results-e2e.xml
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Remove sudo from the clean command.

Using sudo in build/test scripts is a security and operational concern:

  • It masks underlying permission problems that should be fixed at the source
  • Coverage and build directories should not require elevated privileges
  • CI environments should not need sudo for cleanup operations

If the directories are owned by root, fix the permission issue where they're created rather than elevating privileges to delete them.

🔎 Apply this diff to remove sudo:
-	sudo rm -rf coverage build .svelte-kit test-results results-e2e.xml
+	rm -rf coverage build .svelte-kit test-results results-e2e.xml
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
sudo rm -rf coverage build .svelte-kit test-results results-e2e.xml
rm -rf coverage build .svelte-kit test-results results-e2e.xml
🤖 Prompt for AI Agents
In Makefile around line 3, the clean command uses sudo which should be removed;
update the line to remove the leading "sudo" so the command runs without
elevated privileges (e.g., change "sudo rm -rf ..." to "rm -rf ..."), and if CI
or local runs fail afterwards, ensure the directories are created with correct
ownership or change the creator steps to avoid root-owned artifacts rather than
reintroducing sudo.

Comment on lines +7 to +8
rm -rf node_modules
rm package-lock.json
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Removing package-lock.json breaks reproducible builds.

The clean/node target removes package-lock.json, but this causes issues:

  • The ci target runs npm ci, which requires package-lock.json to exist
  • Removing the lock file defeats the purpose of npm ci (reproducible, deterministic installs)
  • This can lead to version drift and inconsistent builds

Consider either keeping the lock file or using npm install instead of npm ci (though npm ci is preferred for CI).

🔎 Apply this diff to preserve package-lock.json:
 .PHONY: clean/node
 clean/node:
 	rm -rf node_modules
-	rm package-lock.json
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
rm -rf node_modules
rm package-lock.json
rm -rf node_modules
🤖 Prompt for AI Agents
In Makefile around lines 7-8, the clean/node target deletes package-lock.json
which breaks reproducible CI installs; remove the line that deletes
package-lock.json (or make it conditional via a CLEAN_LOCK variable) so the
lockfile is preserved and npm ci can run deterministically; alternatively, if
you really need to remove the lock in local cleans, add a separate target
(clean-local) that removes package-lock.json while keeping the default
clean/node only remove node_modules.

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