Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
branches:
- main

# cancel in-progress runs on new commits to same PR (gitub.event.number)
# cancel in-progress runs on new commits to same PR (github.event.number)
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
Expand Down
2 changes: 1 addition & 1 deletion .storybook/.public/mockServiceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ async function handleRequest(event, requestId, requestInterceptedAt) {
const response = await getResponse(event, client, requestId, requestInterceptedAt)

// Send back the response clone for the "response:*" life-cycle events.
// Ensure MSW is active and ready to handle the message, otherwise
// Ensure MSW is active and ready to handle the message; otherwise,
// this message will pend indefinitely.
if (client && activeClientIds.has(client.id)) {
const serializedRequest = await serializeRequest(requestCloneForEvents)
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ If you're working on admin features (org management, package access controls, op
pnpm mock-connector
```

This starts a mock connector server pre-populated with sample data (orgs, teams, members, packages). No npm login is required — operations succeed immediately without making real npm CLI calls.
This starts a mock connector server prepopulated with sample data (orgs, teams, members, packages). No npm login is required — operations succeed immediately without making real npm CLI calls.

The mock connector prints a connection URL to the terminal, just like the real connector. Click it (or paste the token manually) to connect the UI.

Expand All @@ -242,7 +242,7 @@ The mock connector prints a connection URL to the terminal, just like the real c
pnpm mock-connector # default: port 31415, user "mock-user", sample data
pnpm mock-connector --port 9999 # custom port
pnpm mock-connector --user alice # custom username
pnpm mock-connector --empty # start with no pre-populated data
pnpm mock-connector --empty # start with no prepopulated data
```

**Default sample data:**
Expand Down
2 changes: 1 addition & 1 deletion app/components/Chart/SplitSparkline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const configs = computed(() => {
? Array.from(new Set([...(unit.dashIndices ?? []), lastIndex]))
: unit.dashIndices

// Ensure we loop through available palette colours when the series count is higher than the avalable palette
// Ensure we loop through available palette colours when the series count is higher than the available palette
const fallbackColor = palette[i] ?? palette[i % palette.length] ?? palette[0]!
const seriesColor = unit.color ?? fallbackColor
const lightenedSeriesColor: string = unit.color
Expand Down
2 changes: 1 addition & 1 deletion app/components/Header/MobileMenu.client.vue
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ onUnmounted(deactivate)
<template v-for="(group, index) in links">
<div
v-if="group.type === 'separator'"
:key="`seperator-${index}`"
:key="`separator-${index}`"
class="mx-4 my-2 border-t border-border"
/>

Expand Down
2 changes: 1 addition & 1 deletion app/components/Noodle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type Noodle = {
timezone?: string
// Date for the noodle
date?: string
// Date to for the noodle
// `Date to` for the noodle
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

While Date for the noodle reads properly in English, Date to for the noodle really doesn't. I'm suggesting adding ` to make it readable...

dateTo?: string
// Logo for the noodle - could be any component. Relative parent - intro section
logo: Component
Expand Down
8 changes: 4 additions & 4 deletions app/components/Package/TrendsChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@
const lastDateMs = chartData.value.dates.at(-1) ?? 0
const isAbsoluteMetric = selectedMetric.value === 'contributors'

return (chartData.value.dataset || []).map(d => {

Check warning on line 1080 in app/components/Package/TrendsChart.vue

View workflow job for this annotation

GitHub Actions / 🔠 Lint project

oxc(no-map-spread)

Spreading to modify object properties in `map` calls is inefficient

Check warning on line 1080 in app/components/Package/TrendsChart.vue

View workflow job for this annotation

GitHub Actions / 🤖 Autofix code

oxc(no-map-spread)

Spreading to modify object properties in `map` calls is inefficient
const series = applyDataPipeline(
d.series.map(v => v ?? 0),
{
Expand Down Expand Up @@ -1190,7 +1190,7 @@

/**
* The following svg elements are injected in the #svg slot of VueUiXy:
* - a line overlay covering the plain path bewteen the last datapoint and its ancestor
* - a line overlay covering the plain path between the last datapoint and its ancestor
* - a dashed line connecting the last datapoint to its ancestor
* - a circle for the last datapoint
*/
Expand Down Expand Up @@ -1280,9 +1280,9 @@

/**
* Build and return a legend to be injected during the SVG export only, since the custom legend is
* displayed as an independant div, content has to be injected within the chart's viewBox.
* displayed as an independent div, content has to be injected within the chart's viewBox.
*
* Legend items are displayed in a column, on the top left of the chart.
* Legend items are displayed in a column, at the top left of the chart.
*/
function drawSvgPrintLegend(svg: Record<string, any>) {
const data = Array.isArray(svg?.data) ? svg.data : []
Expand Down Expand Up @@ -1416,7 +1416,7 @@
svg: $t('package.trends.download_file', { fileType: 'SVG' }),
annotator: $t('package.trends.toggle_annotator'),
stack: $t('package.trends.toggle_stack_mode'),
altCopy: $t('package.trends.copy_alt.button_label'), // Do not make this text dependant on the `copied` variable, since this would re-render the component, which is undesirable if the minimap was used to select a time frame.
altCopy: $t('package.trends.copy_alt.button_label'), // Do not make this text dependent on the `copied` variable, since this would re-render the component, which is undesirable if the minimap was used to select a time frame.
open: $t('package.trends.open_options'),
close: $t('package.trends.close_options'),
},
Expand Down
2 changes: 1 addition & 1 deletion app/components/Package/VersionDistribution.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ const chartConfig = computed<VueUiXyConfig>(() => {
img: $t('package.trends.download_file', { fileType: 'PNG' }),
svg: $t('package.trends.download_file', { fileType: 'SVG' }),
annotator: $t('package.trends.toggle_annotator'),
altCopy: $t('package.trends.copy_alt.button_label'), // Do not make this text dependant on the `copied` variable, since this would re-render the component, which is undesirable if the minimap was used to select a time frame.
altCopy: $t('package.trends.copy_alt.button_label'), // Do not make this text dependent on the `copied` variable, since this would re-render the component, which is undesirable if the minimap was used to select a time frame.
open: $t('package.trends.open_options'),
close: $t('package.trends.close_options'),
},
Expand Down
2 changes: 1 addition & 1 deletion app/components/PaginationControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const pageSizeSelectValue = computed(() => String(pageSize.value))
// Whether we should show pagination controls (table view always uses pagination)
const shouldShowControls = computed(() => props.viewMode === 'table' || mode.value === 'paginated')

// Table view forces pagination mode, otherwise use the provided mode
// Table view forces pagination mode; otherwise, use the provided mode
const effectiveMode = computed<PaginationMode>(() =>
shouldShowControls.value ? 'paginated' : 'infinite',
)
Expand Down
2 changes: 1 addition & 1 deletion app/components/User/Avatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const { data: gravatarUrl } = useLazyFetch(
:height="sizePixels"
class="w-full h-full object-cover"
/>
<!-- Else fallback to initials (use svg to avoid underline styling) -->
<!-- Else fall back to initials (use svg to avoid underline styling) -->
<svg
v-else
xmlns="http://www.w3.org/2000/svg"
Expand Down
2 changes: 1 addition & 1 deletion app/composables/useChartWatermark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface WatermarkColors {

/**
* Build and return legend as SVG for export
* Legend items are displayed in a column, on the top left of the chart.
* Legend items are displayed in a column, at the top left of the chart.
*/
export function drawSvgPrintLegend(svg: Record<string, any>, colors: WatermarkColors) {
const data = Array.isArray(svg?.data) ? svg.data : []
Expand Down
2 changes: 1 addition & 1 deletion app/composables/useRepoMeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const githubAdapter: ProviderAdapter = {
},

async fetchMeta(cachedFetch, ref, links, options = {}) {
// Using UNGH to avoid API limitations of the Github API
// Using UNGH to avoid API limitations of the GitHub API
let res: UnghRepoResponse | null = null
try {
const { data } = await cachedFetch<UnghRepoResponse>(
Expand Down
6 changes: 3 additions & 3 deletions app/pages/package/[[org]]/[name].vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if (import.meta.server) {
assertValidPackageName(packageName.value)
}

// Fetch README for specific version if requested, otherwise latest
// Fetch README for specific version if requested; otherwise, latest
const { data: readmeData, status: readmeStatus } = useLazyFetch<ReadmeResponse>(
() => {
const base = `/api/registry/readme/${packageName.value}`
Expand Down Expand Up @@ -234,7 +234,7 @@ useCommandPalettePackageCommands(commandPalettePackageContext)
// 1. SPA fallback (200.html): No real content was server-rendered.
// → Show skeleton while data fetches on the client.
//
// 2. SSR-rendered HTML with missing payload: Content was rendered but the external _payload.json
// 2. SSR-rendered HTML missing payload: Content was rendered but the external _payload.json
// returned an ISR fallback.
// → Preserve the server-rendered DOM, don't flash to skeleton.
const nuxtApp = useNuxtApp()
Expand Down Expand Up @@ -526,7 +526,7 @@ const showSkeleton = shallowRef(false)
</DevOnly>
<main v-if="!isVersionsRoute" class="flex-1 pb-8">
<!-- Scenario 1: SPA fallback — show skeleton (no real content to preserve) -->
<!-- Scenario 2: SSR with missing payload — preserve server DOM, skip skeleton -->
<!-- Scenario 2: SSR missing payload — preserve server DOM, skip skeleton -->
<PackageSkeleton
v-if="isSpaFallback || (!hasServerContentOnly && (showSkeleton || status === 'pending'))"
/>
Expand Down
2 changes: 1 addition & 1 deletion app/pages/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ watch(searchProvider, provider => {
})

// Use incremental search with client-side caching + org/user suggestions
// committedQuery only updates on Enter when instant search is off, otherwise tracks query as user types
// committedQuery only updates on Enter when instant search is off; otherwise, tracks query as user types
const {
data: results,
status,
Expand Down
2 changes: 1 addition & 1 deletion app/utils/chart-data-prediction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function linearProject(pts: number[]): number | null {
* Estimate the full-period value for a partially-complete last bucket.
*
* Uses linear projection when enough complete lookback points are available
* (`>= predictionPoints`), otherwise falls back to proportional scale-up.
* (`>= predictionPoints`); otherwise, falls back to proportional scale-up.
* Returns the raw last value when the period is already complete or prediction is disabled.
*/
export function extrapolateLastValue(params: {
Expand Down
2 changes: 1 addition & 1 deletion app/utils/charts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export function computeLineChartAnalysis(values: Array<number | null>): LineChar
/**
* Coefficient of variation : relative volatility
* - expressed in %
* - calculation: standard devialtion / mean
* - calculation: standard deviation / mean
* |---------------|----------------------------------------------------------|
* | VALUE | INTERPRETATION |
* |---------------|----------------------------------------------------------|
Expand Down
2 changes: 1 addition & 1 deletion app/utils/publish-security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function detectPublishSecurityDowngradeForVersion(
}
}

// Use same-major for recommendation if available, otherwise any-major for detection only
// Use same-major for recommendation if available; otherwise, any-major for detection only
const strongestOlder = strongestOlderSameMajor ?? strongestOlderAny
if (!strongestOlder || strongestOlder.trustRank <= current.trustRank) return null

Expand Down
2 changes: 1 addition & 1 deletion app/utils/run-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function getExecutableInfo(
return { primaryCommand: '', commands: [], hasExecutable: false }
}

// Prefer command matching package name if it exists, otherwise use first
// Prefer command matching package name if it exists; otherwise, use first
const baseName = packageName.startsWith('@') ? packageName.split('/')[1] : packageName
const primaryCommand = baseName && commands.includes(baseName) ? baseName : firstCommand

Expand Down
8 changes: 4 additions & 4 deletions cli/src/mock-server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
/**
* Mock connector CLI — starts a pre-populated mock server for developing
* Mock connector CLI — starts a prepopulated mock server for developing
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm making this suggestion because the CONTRIBUTING guide uses the en-US flavor for Prerequisites:

- [Prerequisites](#prerequisites)

(It's mostly an outlier in that regard -- the rest of the project feels like it's en-GB, but I'm favoring contributing since I was expected to read it.)

* authenticated features without a real npm account.
*/

Expand All @@ -25,7 +25,7 @@ function generateToken(): string {
}

/**
* Pre-populate with sample data using real npm orgs so the registry
* Prepopulate with sample data using real npm orgs so the registry
* API calls don't 404. Members/teams are fictional.
*/
function populateDefaultData(stateManager: MockConnectorStateManager): void {
Expand Down Expand Up @@ -107,7 +107,7 @@ const main = defineCommand({
},
empty: {
type: 'boolean',
description: 'Start with empty state (no pre-populated data)',
description: 'Start with empty state (no prepopulated data)',
default: false,
},
},
Expand All @@ -130,7 +130,7 @@ const main = defineCommand({

if (!empty) {
populateDefaultData(stateManager)
p.log.info(`Pre-populated with sample data for ${styleText('cyan', npmUser)}`)
p.log.info(`Prepopulated with sample data for ${styleText('cyan', npmUser)}`)
p.log.info(styleText('dim', ` Orgs: @nuxt (4 members, 3 teams), @unjs (2 members, 1 team)`))
p.log.info(styleText('dim', ` Packages: @nuxt/kit, @nuxt/schema, @unjs/nitro`))
} else {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/npm-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export interface ExecNpmOptions {
/**
* PTY-based npm execution for interactive commands (uses node-pty).
*
* - Web OTP - either open URL in browser if openUrls is true or passes the URL to frontend. If no auth happend within AUTH_URL_TIMEOUT_MS kills the process to unlock the connector.
* - Web OTP - either open URL in browser if openUrls is true or passes the URL to frontend. If no auth happened within AUTH_URL_TIMEOUT_MS kills the process to unlock the connector.
*
* - CLI OTP - if we get a classic OTP prompt will either return OTP request to the frontend or will pass sent OTP if its provided
*/
Expand Down
2 changes: 1 addition & 1 deletion lexicons/app/bsky/actor/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@
},
"isValid": {
"type": "boolean",
"description": "True if the verification passes validation, otherwise false."
"description": "True if the verification passes validation; otherwise, false."
},
"createdAt": {
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion lexicons/app/bsky/richtext/facet.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"minimum": 0
}
},
"description": "Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets."
"description": "Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like JavaScript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets."
}
},
"$type": "com.atproto.lexicon.schema",
Expand Down
2 changes: 1 addition & 1 deletion lexicons/com/atproto/identity/resolveHandle.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
}
},
"description": "Resolves an atproto handle (hostname) to a DID. Does not necessarily bi-directionally verify against the the DID document."
"description": "Resolves an atproto handle (hostname) to a DID. Does not necessarily bi-directionally verify against the DID document."
}
},
"$type": "com.atproto.lexicon.schema",
Expand Down
2 changes: 1 addition & 1 deletion lunaria/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function collapsePath(path: string) {
export const Page = (
config: LunariaConfig,
status: I18nStatus,
_lunaria: LunariaInstance, // currenly not in use
_lunaria: LunariaInstance, // currently not in use
): string => {
return html`
<!doctype html>
Expand Down
2 changes: 1 addition & 1 deletion lunaria/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export const BaseStyles = html`
margin-left: 1rem;
}

/* Progress deatils per locale */
/* Progress details per locale */
.progress-details {
border: 1px solid var(--ln-color-gray-6);
margin-bottom: 1.25rem;
Expand Down
4 changes: 2 additions & 2 deletions server/api/auth/atproto.get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export default defineEventHandler(async event => {
const redirectUrl = await event.context.oauthClient.authorize(query.handle, {
scope,
prompt: query.create ? 'create' : undefined,
// TODO: I do not beleive this is working as expected on
// a unsupported locale on the PDS. Gives Invalid at body.ui_locales
// TODO: I do not believe this is working as expected on
// an unsupported locale on the PDS. Gives Invalid at body.ui_locales
// Commenting out for now
// ui_locales: query.locale?.toString(),
state: encodeOAuthState(event, { redirectPath }),
Expand Down
2 changes: 1 addition & 1 deletion server/api/auth/session.delete.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default eventHandlerWithOAuthSession(async (event, oAuthSession, serverSession) => {
// Even tho 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
// to let the OAuth package do any other clean up it may need
await oAuthSession?.signOut()
await serverSession.clear()
return 'Session cleared'
Expand Down
2 changes: 1 addition & 1 deletion server/api/contributors.get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default defineCachedEventHandler(
async (): Promise<GitHubContributor[]> => {
const githubToken = useRuntimeConfig().github.orgToken

// Fetch team members dynamically if token is available, otherwise use fallback
// Fetch team members dynamically if token is available; otherwise, use fallback
const teams: TeamMembers = await (async () => {
if (githubToken) {
const fetched = await fetchTeamMembers(githubToken)
Expand Down
2 changes: 1 addition & 1 deletion server/api/registry/org/[org]/packages.get.ts
Original file line number Diff line number Diff line change
@@ -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 symbold and not start with a dot (incl. ~test24214. or -ex~-)
// Validation pattern for npm org names - url-sage symbol and not start with a dot (incl. ~test24214. or -ex~-)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's possible that symbold is intentional, but there wasn't any obvious support for it...

Comment thread
jsoref marked this conversation as resolved.
const NPM_ORG_NAME_RE = /^[\w~-][\w.~-]*$/

function validateOrgName(name: string): void {
Expand Down
13 changes: 6 additions & 7 deletions server/utils/atproto/utils/likes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 since are already doing some heavy caching here
async <T = unknown>(
url: string,
options: Parameters<typeof $fetch>[1] = {},
Expand Down Expand Up @@ -107,13 +107,13 @@ export class PackageLikesUtils {
}

/**
* Gets the likes for a npm package on npmx. Tries a local cahce 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
*/
async getLikes(packageName: string, usersDid?: string | undefined): Promise<PackageLikes> {
//TODO: May need to do some clean up on the package name, and maybe even hash it? some of the charcteres may be a bit odd as keys
//TODO: May need to do some clean up on the package name, and maybe even hash it? some of the characters may be a bit odd as keys
const totalLikesKey = CACHE_PACKAGE_TOTAL_KEY(packageName)
const subjectRef = PACKAGE_SUBJECT_REF(packageName)

Expand Down Expand Up @@ -168,8 +168,8 @@ export class PackageLikesUtils {
}

/**
* It is asummed 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 repostiory
* 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
* @param packageName
* @param usersDid
* @param atUri - The URI of the like record
Expand All @@ -195,10 +195,9 @@ export class PackageLikesUtils {
rkey,
}

// We store the backlink incase a user is liking and unlikign rapidly. constellation takes a few seconds to capture the backlink
// We store the backlink in case a user is liking and unliking rapidly. constellation takes a few seconds to capture the backlink
const usersBackLinkKey = CACHE_USERS_BACK_LINK(packageName, usersDid)
await this.cache.set(usersBackLinkKey, backLink, CACHE_MAX_AGE)

let totalLikes = await this.cache.get<number>(totalLikesKey)
if (!totalLikes) {
totalLikes = await this.constellationLikes(subjectRef)
Expand Down
Loading
Loading