Skip to content

npm updates#227

Merged
michaelbonner merged 10 commits intomasterfrom
chore/npm-updates
Jun 14, 2025
Merged

npm updates#227
michaelbonner merged 10 commits intomasterfrom
chore/npm-updates

Conversation

@michaelbonner
Copy link
Copy Markdown
Owner

@michaelbonner michaelbonner commented Jun 14, 2025

↑ @eslint/js 9.28.0 → 9.29.0
↑ @sveltejs/kit 2.21.4 → 2.21.5
↑ eslint 9.28.0 → 9.29.0
↑ svelte 5.34.1 → 5.34.3

Summary by CodeRabbit

  • Chores
    • Added new scripts to streamline testing and dependency updates.
    • Introduced automated end-to-end testing with Playwright.
    • Updated development dependencies for improved stability and compatibility.
    • Enhanced GitHub Actions workflow to run Playwright tests on code changes.
    • Updated sitemap with new blog entries and adjusted update frequencies.
    • Added environment variable toggle to control analytics initialization.
    • Improved CSS structure for better style scoping.

↑ @eslint/js 9.28.0 → 9.29.0
↑ @sveltejs/kit 2.21.4 → 2.21.5
↑ eslint 9.28.0 → 9.29.0
↑ svelte 5.34.1 → 5.34.3
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
michaelbonner-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 14, 2025 7:25pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 14, 2025

Walkthrough

This change adds Playwright end-to-end testing setup including new npm test scripts, a Playwright configuration file, and a GitHub Actions workflow to run tests on pushes and pull requests. It also updates several devDependencies, modifies the sitemap.xml, updates .gitignore to exclude test artifacts, adds environment variable toggling for PostHog analytics, and adjusts CSS formatting and PostCSS configuration files.

Changes

File(s) Change Summary
package.json Added "up", "test:e2e", and "test" scripts; added @playwright/test devDependency; updated versions of several devDependencies.
.github/workflows/playwright.yml Added new GitHub Actions workflow to run Playwright tests on pushes and PRs to master, including setup, test run, and artifact upload.
.gitignore Added test-results and playwright-report to ignore test output directories.
e2e/around-the-world.test.ts Added new Playwright end-to-end test covering multiple site pages, verifying main heading visibility.
playwright.config.ts Added Playwright configuration specifying web server commands, test directory, and output directory for reports.
static/sitemap.xml Added two new blog URLs and changed change frequency of multiple URLs from daily to weekly.
.env.example Added PUBLIC_POSTHOG_ENABLED environment variable with default false.
src/routes/+layout.svelte Added conditional initialization of PostHog analytics based on PUBLIC_POSTHOG_ENABLED environment variable.
src/app.css Fixed CSS block scoping and indentation inside @layer base and media queries.
postcss.config.cjs Added new empty PostCSS configuration export.
postcss.config.mjs Removed old empty PostCSS configuration export.

Poem

🐰 Hopping through the code with glee,
New tests arrive for all to see!
Playwright scripts and workflows too,
Keeping bugs away for me and you.
PostHog toggled, styles aligned,
Our code now dances, well-defined!
🌟🎉

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@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: 0

🧹 Nitpick comments (1)
package.json (1)

14-14: Document the new up script in README.
Please update the project’s documentation (e.g. README or CONTRIBUTING) to describe how and when to use npm run up (which runs bun update).

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d6e3450 and a83d5a0.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • package.json (2 hunks)
🔇 Additional comments (4)
package.json (4)

19-19: Bump @eslint/js to v9.29.0.
Patch update looks good.


22-22: Bump @sveltejs/kit to v2.21.5.
Minor release with no breaking changes noted upstream.


29-29: Bump eslint to v9.29.0.
Patch update is safe.


38-38: Bump svelte to v5.34.3.
Patch release—please ensure the full test suite and a quick manual smoke-test pass with this version.

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Jun 14, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​playwright/​test@​1.53.01001001009980

View full report

Copy link
Copy Markdown

@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: 1

🧹 Nitpick comments (3)
playwright.config.ts (1)

4-7: Add reuseExistingServer and explicit startup timeout for stability

Playwright may leave orphaned processes or hang if the server is already running or takes longer than the default 30 s to boot (common with a full bun run build && bun run preview).
Consider extending the config:

  webServer: {
 		command: 'bun run build && bun run preview',
 		port: 4173,
+		reuseExistingServer: !process.env.CI,
+		timeout: 120 * 1000          // 2 min gives the build time to finish
  },

This keeps local runs snappy while preventing CI flakes.

e2e/around-the-world.test.ts (2)

3-36: Collapse repetitive navigation into a data-driven loop

The test repeats the same three lines for every route, which is verbose and hard to maintain. Use an array and for…of:

-test('can load all pages', async ({ page }) => {
-  await page.goto('/');
-  await expect(page.locator('h1')).toBeVisible();
-
-  await page.goto('/policies');
-  await expect(page.locator('h1')).toBeVisible();
-});
+const routes = [
+  '/',
+  '/blog',
+  '/blog/screenshot-maker',
+  '/blog/pagespeed-testing',
+  '/blog/github-repositories-viewer-app',
+  '/blog/git-branch-name-raycast-extension',
+  '/blog/i-made-an-extension',
+  '/blog/getting-started-as-a-web-developer-in-2022',
+  '/blog/set-up-some-aliases',
+  '/uses',
+  '/policies'
+];
+
+test('all pages render an <h1>', async ({ page }) => {
+  for (const path of routes) {
+    await page.goto(path);
+    await expect(page.locator('h1'), path).toBeVisible();
+  }
+});

Benefits: easier additions/removals, single failure pinpoints failing route.


3-36: Assert heading text, not just visibility, for stronger guarantee

Visibility alone doesn’t catch wrong template/render errors where an empty <h1> is injected.
Consider asserting expected text for each route, e.g.:

await expect(page.locator('h1')).toHaveText(/Around the World/i);

(or keep a map of route → expected text).

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a83d5a0 and 4b57ce6.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • .github/workflows/playwright.yml (1 hunks)
  • .gitignore (2 hunks)
  • e2e/around-the-world.test.ts (1 hunks)
  • package.json (2 hunks)
  • playwright.config.ts (1 hunks)
  • static/sitemap.xml (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • .gitignore
  • .github/workflows/playwright.yml
  • static/sitemap.xml
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: test
🔇 Additional comments (1)
e2e/around-the-world.test.ts (1)

3-36: Tie test timeout to navigation instead of global default

Some blog pages may load heavy assets and occasionally exceed the Playwright default 30 s test timeout. Explicitly set navigation timeout or rely on expect().toBeVisible({ timeout: … }) to avoid flaky failures.

Comment thread playwright.config.ts Outdated
Copy link
Copy Markdown

@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: 1

🔭 Outside diff range comments (1)
src/routes/+layout.svelte (1)

38-48: ⚠️ Potential issue

Analytics enabled by default – potential privacy & compliance issue

Current logic:

if (PUBLIC_POSTHOG_ENABLED !== 'false' && browser) {  }

Problems

  1. Missing or mistyped env var ⇒ analytics ON (unexpected in staging / CI).
  2. Empty PUBLIC_POSTHOG_API_KEY still calls posthog.init(''), wasting bytes and logging console errors.

Recommended change:

-if (PUBLIC_POSTHOG_ENABLED !== 'false' && browser) {
+if (browser && PUBLIC_POSTHOG_ENABLED === 'true' && PUBLIC_POSTHOG_API_KEY) {

Optionally defer the heavy dependency:

if (browser && PUBLIC_POSTHOG_ENABLED === 'true' && PUBLIC_POSTHOG_API_KEY) {
	const { default: posthog } = await import('posthog-js');
	posthog.init(PUBLIC_POSTHOG_API_KEY, { /* … */ });
}

This guarantees explicit opt-in, avoids accidental PII capture, and trims ~20 kB from the default bundle.

🧹 Nitpick comments (2)
.env.example (1)

2-2: Minor: add trailing newline

The dotenv-linter warning is valid; append a blank line to keep linters quiet.

🧰 Tools
🪛 dotenv-linter (3.3.0)

[warning] 2-2: [EndingBlankLine] No blank line at the end of the file

src/routes/+layout.svelte (1)

7-8: Import order / unused import check

PUBLIC_POSTHOG_API_KEY is only referenced inside the analytics block.
If you decide to lazy-load PostHog (see next comment) you can also move this import into that branch to keep the main bundle smaller.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4b57ce6 and 9e8c82a.

📒 Files selected for processing (7)
  • .env.example (1 hunks)
  • .github/workflows/playwright.yml (1 hunks)
  • playwright.config.ts (1 hunks)
  • postcss.config.cjs (1 hunks)
  • postcss.config.mjs (0 hunks)
  • src/app.css (1 hunks)
  • src/routes/+layout.svelte (2 hunks)
💤 Files with no reviewable changes (1)
  • postcss.config.mjs
✅ Files skipped from review due to trivial changes (2)
  • postcss.config.cjs
  • src/app.css
🚧 Files skipped from review as they are similar to previous changes (2)
  • playwright.config.ts
  • .github/workflows/playwright.yml
🧰 Additional context used
🪛 dotenv-linter (3.3.0)
.env.example

[warning] 2-2: [EndingBlankLine] No blank line at the end of the file

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: test

Comment thread .env.example
Comment on lines +1 to +2
PUBLIC_POSTHOG_API_KEY=
PUBLIC_POSTHOG_ENABLED=false No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Default-off toggle can back-fire if the variable is missing

In +layout.svelte analytics are enabled unless PUBLIC_POSTHOG_ENABLED === 'false'.
If this line is absent from a real .env file (easy to forget when onboarding or in CI) PostHog will be turned on unintentionally. Safer pattern:

-PUBLIC_POSTHOG_ENABLED=false
+# Explicitly opt-in. Any value other than “true” disables analytics.
+PUBLIC_POSTHOG_ENABLED=true

and flip the check in the Svelte file to === 'true'.

This prevents accidental PII leakage and makes the intent crystal-clear.

📝 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
PUBLIC_POSTHOG_API_KEY=
PUBLIC_POSTHOG_ENABLED=false
PUBLIC_POSTHOG_API_KEY=
# Explicitly opt-in. Any value other than “true” disables analytics.
PUBLIC_POSTHOG_ENABLED=true
🧰 Tools
🪛 dotenv-linter (3.3.0)

[warning] 2-2: [EndingBlankLine] No blank line at the end of the file

🤖 Prompt for AI Agents
In the .env.example file at lines 1 to 2, change the default value of
PUBLIC_POSTHOG_ENABLED from false to true or remove it so that the variable must
be explicitly set to 'true' to enable analytics. Then, update the check in
+layout.svelte to enable analytics only when PUBLIC_POSTHOG_ENABLED === 'true'.
This ensures analytics are off by default and only enabled intentionally.

@michaelbonner michaelbonner merged commit a5fbbab into master Jun 14, 2025
7 checks passed
@michaelbonner michaelbonner deleted the chore/npm-updates branch June 14, 2025 19:47
This was referenced Aug 27, 2025
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