Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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.


.PHONY: clean/node
clean/node:
rm -rf node_modules
rm package-lock.json
Comment on lines +7 to +8
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.


.PHONY: ci
ci:
make clean/node
make clean/test
npm ci
npm run build:check
npm run test
70 changes: 3 additions & 67 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
"@testing-library/svelte": "^5.2.9",
"@types/node": "^24.10.3",
"@types/qrcode": "^1.5.6",
"@vitest/browser": "^4.0.16",
"@vitest/browser-playwright": "^4.0.16",
"@vitest/coverage-v8": "^4.0.16",
"eslint": "^9.39.2",
"eslint-config-prettier": "^10.1.8",
Expand All @@ -47,8 +45,7 @@
"typescript": "^5.9.2",
"typescript-eslint": "^8.50.0",
"vite": "^7.3.0",
"vitest": "^4.0.16",
"vitest-browser-svelte": "^2.0.1"
"vitest": "^4.0.16"
},
"dependencies": {
"otplib": "^12.0.1",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"sourceMap": true,
"strict": true,
"moduleResolution": "bundler",
"types": ["@testing-library/jest-dom"]
"types": ["@testing-library/jest-dom", "vitest/globals"]
}
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { svelteTesting } from '@testing-library/svelte/vite'
export default defineConfig({
plugins: [sveltekit(), svelteTesting()],
test: {
globals: true,
coverage: {
provider: 'v8',
include: ['src/**/*.{svelte,ts}', '!src/**/*.d.ts'],
Expand Down
2 changes: 0 additions & 2 deletions vitest-setup-client.ts

This file was deleted.

2 changes: 1 addition & 1 deletion vitest-setup.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import '@testing-library/jest-dom/vitest'
import '@testing-library/jest-dom'
Loading