From b603393c7a15079b2ad3073d9fc99b20c7f08594 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Wed, 29 Apr 2026 09:40:18 -0400 Subject: [PATCH 01/10] spelling: safe Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- server/api/registry/org/[org]/packages.get.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/api/registry/org/[org]/packages.get.ts b/server/api/registry/org/[org]/packages.get.ts index 85c07bee03..ffddf1c930 100644 --- a/server/api/registry/org/[org]/packages.get.ts +++ b/server/api/registry/org/[org]/packages.get.ts @@ -1,7 +1,7 @@ import { CACHE_MAX_AGE_ONE_HOUR, NPM_REGISTRY } from '#shared/utils/constants' import { FetchError } from 'ofetch' -// Validation pattern for npm org names - url-sage symbol and not start with a dot (incl. ~test24214. or -ex~-) +// Validation pattern for npm org names - url-safe symbol and not start with a dot (incl. ~test24214. or -ex~-) const NPM_ORG_NAME_RE = /^[\w~-][\w.~-]*$/ function validateOrgName(name: string): void { From 57d889f9e0b244a1f9ba9575fcfaf28a384e4346 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Wed, 29 Apr 2026 09:40:44 -0400 Subject: [PATCH 02/10] spelling: though Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- server/api/auth/session.delete.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/api/auth/session.delete.ts b/server/api/auth/session.delete.ts index 7bfce2e686..8f534912c2 100644 --- a/server/api/auth/session.delete.ts +++ b/server/api/auth/session.delete.ts @@ -1,5 +1,5 @@ export default eventHandlerWithOAuthSession(async (event, oAuthSession, serverSession) => { - // Even tho the signOut also clears part of the server cache should be done in order + // Even though the signOut also clears part of the server cache should be done in order // to let the OAuth package do any other clean up it may need await oAuthSession?.signOut() await serverSession.clear() From 3f5de58135cc610275a2f387b59799211af0df6a Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Wed, 29 Apr 2026 09:40:00 -0400 Subject: [PATCH 03/10] chore: deduplicate getPackageBaseName per coderabbitai https://github.com/npmx-dev/npmx.dev/pull/2651#pullrequestreview-4193968638 Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- app/utils/run-command.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/utils/run-command.ts b/app/utils/run-command.ts index b97debebe0..a3c6e9c54f 100644 --- a/app/utils/run-command.ts +++ b/app/utils/run-command.ts @@ -14,6 +14,13 @@ export interface ExecutableInfo { hasExecutable: boolean } +/** + * Extract basename from package + */ +function getPackageBaseName(packageName: string): string { + return packageName.startsWith('@') ? packageName.split('/')[1] : packageName +} + /** * Extract executable command information from a package's bin field. * Handles both string format ("bin": "./cli.js") and object format ("bin": { "cmd": "./cli.js" }). @@ -43,7 +50,7 @@ export function getExecutableInfo( } // Prefer command matching package name if it exists; otherwise, use first - const baseName = packageName.startsWith('@') ? packageName.split('/')[1] : packageName + const baseName = getPackageBaseName(packageName) const primaryCommand = baseName && commands.includes(baseName) ? baseName : firstCommand return { @@ -87,9 +94,7 @@ export function getRunCommandParts(options: RunCommandOptions): string[] { // For local execute with specific command name different from package name // e.g., `pnpm exec tsc` for typescript package if (options.command && options.command !== options.packageName) { - const baseName = options.packageName.startsWith('@') - ? options.packageName.split('/')[1] - : options.packageName + const baseName = getPackageBaseName(options.packageName) // If command matches base package name, use the package spec if (options.command === baseName) { return [...executeParts, spec] From d6c6c87624bb54e39420fa75d83df9f9250796b5 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Wed, 29 Apr 2026 09:58:25 -0400 Subject: [PATCH 04/10] chore: correct description per coderabbitai https://github.com/npmx-dev/npmx.dev/pull/2651#pullrequestreview-4193968638 Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- app/utils/charts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/utils/charts.ts b/app/utils/charts.ts index 357e298cbb..d9524f4ac1 100644 --- a/app/utils/charts.ts +++ b/app/utils/charts.ts @@ -340,7 +340,7 @@ export function computeLineChartAnalysis(values: Array): LineChar /** * Coefficient of variation : relative volatility - * - expressed in % + * - expressed as a value in the range 0 ... 1.00 * - calculation: standard deviation / mean * |---------------|----------------------------------------------------------| * | VALUE | INTERPRETATION | From dd60f92132515ff53d6df8843907db513e7647af Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Wed, 29 Apr 2026 10:10:29 -0400 Subject: [PATCH 05/10] chore: clarifying description per coderabbitai https://github.com/npmx-dev/npmx.dev/pull/2651#pullrequestreview-4193968638 Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- server/utils/atproto/utils/likes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/utils/atproto/utils/likes.ts b/server/utils/atproto/utils/likes.ts index 8667256e27..47a5a8c68f 100644 --- a/server/utils/atproto/utils/likes.ts +++ b/server/utils/atproto/utils/likes.ts @@ -107,7 +107,7 @@ export class PackageLikesUtils { } /** - * Gets the likes for a npm package on npmx. Tries a local cache first, if not found uses constellation + * Gets the likes for a npm package on npmx. Tries a local cache first; if not found, uses constellation * @param packageName * @param usersDid * @returns From a25346e14995521b4babebd3b883e7c98db6e898 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Wed, 29 Apr 2026 10:13:02 -0400 Subject: [PATCH 06/10] chore: clarifying description per coderabbitai https://github.com/npmx-dev/npmx.dev/pull/2651#pullrequestreview-4193968638 Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- server/utils/atproto/utils/likes.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/utils/atproto/utils/likes.ts b/server/utils/atproto/utils/likes.ts index 47a5a8c68f..ec0e0dd7bb 100644 --- a/server/utils/atproto/utils/likes.ts +++ b/server/utils/atproto/utils/likes.ts @@ -168,8 +168,8 @@ export class PackageLikesUtils { } /** - * It is assumed it has been checked by this point that if a user has liked a package and the new like was made as a record - * to the user's atproto repository + * Assumes the caller has already verified that a user's like for a package was stored as a record in the user's AT Protocol + * repository (atUri refers to that like record). * @param packageName * @param usersDid * @param atUri - The URI of the like record From 6b3d3d62bbe18ec9b1828d7ab87104088de90e90 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Wed, 29 Apr 2026 10:13:45 -0400 Subject: [PATCH 07/10] chore: improve grammar per coderabbitai https://github.com/npmx-dev/npmx.dev/pull/2651#pullrequestreview-4193968638 Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- server/utils/atproto/utils/likes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/utils/atproto/utils/likes.ts b/server/utils/atproto/utils/likes.ts index ec0e0dd7bb..0a547fb6f1 100644 --- a/server/utils/atproto/utils/likes.ts +++ b/server/utils/atproto/utils/likes.ts @@ -54,7 +54,7 @@ export class PackageLikesUtils { this.constellation = deps?.constellation ?? new Constellation( - // Passes in a fetch wrapped as CachedFetch since are already doing some heavy caching here + // Passes in a fetch wrapped as CachedFetch because we're already doing some heavy caching here async ( url: string, options: Parameters[1] = {}, From 1b7328cf556904de3ed9902b4a968432e523f16a Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Wed, 29 Apr 2026 10:32:26 -0400 Subject: [PATCH 08/10] Fix return type Co-authored-by: Roman --- app/utils/run-command.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/utils/run-command.ts b/app/utils/run-command.ts index a3c6e9c54f..265acbf7af 100644 --- a/app/utils/run-command.ts +++ b/app/utils/run-command.ts @@ -17,7 +17,7 @@ export interface ExecutableInfo { /** * Extract basename from package */ -function getPackageBaseName(packageName: string): string { +function getPackageBaseName(packageName: string): string | undefined { return packageName.startsWith('@') ? packageName.split('/')[1] : packageName } From 86bdf906f389671aa56c19686c240076324f6be8 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Wed, 29 Apr 2026 11:05:11 -0400 Subject: [PATCH 09/10] Apply suggestions from code review Co-authored-by: Roman --- app/utils/charts.ts | 2 +- server/api/auth/session.delete.ts | 4 ++-- server/api/registry/org/[org]/packages.get.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/utils/charts.ts b/app/utils/charts.ts index d9524f4ac1..3cdbe3fd34 100644 --- a/app/utils/charts.ts +++ b/app/utils/charts.ts @@ -340,7 +340,7 @@ export function computeLineChartAnalysis(values: Array): LineChar /** * Coefficient of variation : relative volatility - * - expressed as a value in the range 0 ... 1.00 + * - expressed as a decimal from 0 to 1 * - calculation: standard deviation / mean * |---------------|----------------------------------------------------------| * | VALUE | INTERPRETATION | diff --git a/server/api/auth/session.delete.ts b/server/api/auth/session.delete.ts index 8f534912c2..c7a1d49779 100644 --- a/server/api/auth/session.delete.ts +++ b/server/api/auth/session.delete.ts @@ -1,6 +1,6 @@ export default eventHandlerWithOAuthSession(async (event, oAuthSession, serverSession) => { - // Even though the signOut also clears part of the server cache should be done in order - // to let the OAuth package do any other clean up it may need + // Even though the signOut also clears part of the server cache, this should be done in order +// to let the OAuth package do any other clean up it may need await oAuthSession?.signOut() await serverSession.clear() return 'Session cleared' diff --git a/server/api/registry/org/[org]/packages.get.ts b/server/api/registry/org/[org]/packages.get.ts index ffddf1c930..47b7a7f011 100644 --- a/server/api/registry/org/[org]/packages.get.ts +++ b/server/api/registry/org/[org]/packages.get.ts @@ -1,7 +1,7 @@ import { CACHE_MAX_AGE_ONE_HOUR, NPM_REGISTRY } from '#shared/utils/constants' import { FetchError } from 'ofetch' -// Validation pattern for npm org names - url-safe symbol and not start with a dot (incl. ~test24214. or -ex~-) +// Validation pattern for npm org names - should be a url-safe symbol and not start with a dot (incl. ~test24214. or -ex~-) const NPM_ORG_NAME_RE = /^[\w~-][\w.~-]*$/ function validateOrgName(name: string): void { From e4dcdbab6ce25185876e65093b023be94b12169c Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Wed, 29 Apr 2026 15:06:30 +0000 Subject: [PATCH 10/10] [autofix.ci] apply automated fixes --- server/api/auth/session.delete.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/api/auth/session.delete.ts b/server/api/auth/session.delete.ts index c7a1d49779..34957d76ec 100644 --- a/server/api/auth/session.delete.ts +++ b/server/api/auth/session.delete.ts @@ -1,6 +1,6 @@ export default eventHandlerWithOAuthSession(async (event, oAuthSession, serverSession) => { // Even though the signOut also clears part of the server cache, this should be done in order -// to let the OAuth package do any other clean up it may need + // to let the OAuth package do any other clean up it may need await oAuthSession?.signOut() await serverSession.clear() return 'Session cleared'