Skip to content

Commit 6c3c57a

Browse files
committed
Merge branch 'fix-deps-version-union-links' of https://github.com/alex-key/npmx.dev into fix-deps-version-union-links
2 parents 55396f2 + 541e7d9 commit 6c3c57a

57 files changed

Lines changed: 2013 additions & 544 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "\U0001F41E Bug report"
2+
description: Create a report to help us improve npmx
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: |
7+
Please carefully read the contribution docs before creating a bug report
8+
👉 https://github.com/npmx-dev/npmx.dev/blob/main/CONTRIBUTING.md
9+
- type: textarea
10+
id: bug-description
11+
attributes:
12+
label: Describe the bug
13+
description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks!
14+
placeholder: Bug description
15+
validations:
16+
required: true
17+
- type: textarea
18+
id: additional
19+
attributes:
20+
label: Additional context
21+
description: If applicable, add any other context about the problem here
22+
- type: textarea
23+
id: logs
24+
attributes:
25+
label: Logs
26+
description: |
27+
Optional if you have reproduction steps. Please try not to insert an image but copy paste the log text.
28+
render: shell-script

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: 📚 npmx documentation
4+
url: https://docs.npmx.dev/
5+
about: Check the documentation for usage of npmx
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: '🚀 Feature request'
2+
description: Suggest a feature that will improve npmx
3+
labels: ['pending triage']
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thank you for taking the time to fill out this feature request!
9+
10+
Please carefully read the contribution docs before suggesting a new feature
11+
👉 https://github.com/npmx-dev/npmx.dev/blob/main/CONTRIBUTING.md
12+
- type: textarea
13+
id: feature-description
14+
attributes:
15+
label: Describe the feature
16+
description: A clear and concise description of what you think would be a helpful addition to npmx, including the possible use cases and alternatives you have considered. If you have a working prototype or module that implements it, please include a link.
17+
placeholder: Feature description
18+
validations:
19+
required: true
20+
- type: checkboxes
21+
id: additional-info
22+
attributes:
23+
label: Additional information
24+
description: Additional information that helps us decide how to proceed.
25+
options:
26+
- label: Would you be willing to help implement this feature?
27+
- type: checkboxes
28+
id: required-info
29+
attributes:
30+
label: Final checks
31+
description: Before submitting, please make sure you do the following
32+
options:
33+
- label: Read the [contribution guide](https://github.com/npmx-dev/npmx.dev/blob/main/CONTRIBUTING.md).
34+
required: true
35+
- label: Check existing [issues](https://github.com/npmx-dev/npmx.dev/issues).
36+
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
### 🔗 Linked issue
2+
3+
<!-- Please ensure there is an open issue and mention its number. For example, "resolves #123" -->
4+
5+
### 🧭 Context
6+
7+
<!-- Brief background and why this change is needed -->
8+
9+
<!-- High-level summary of what changed -->
10+
11+
### 📚 Description
12+
13+
<!-- Describe your changes in detail. Why is this change required? What problem does it solve? -->
14+
15+
<!-- If you used AI tools to help with this contribution, please ensure the PR description and code reflect your own understanding.
16+
Write in your own voice rather than copying AI-generated text. -->
17+
18+
<!----------------------------------------------------------------------
19+
Before creating the pull request, please make sure you do the following:
20+
21+
- Check that there isn't already a PR that solves the problem the same way. If you find a duplicate, please help us reviewing it.
22+
- Ensure that PR title follows conventional commits (https://www.conventionalcommits.org)
23+
- Update the corresponding documentation if needed.
24+
- Include relevant tests that fail without this PR but pass with it.
25+
- Add any additional context, tradeoffs, follow-ups, or things reviewers should be aware of.
26+
27+
Thank you for contributing to npmx!
28+
----------------------------------------------------------------------->

app/components/Button/Base.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<script setup lang="ts">
2+
import type { IconClass } from '~/types'
3+
24
const props = withDefaults(
35
defineProps<{
46
disabled?: boolean
@@ -8,7 +10,7 @@ const props = withDefaults(
810
ariaKeyshortcuts?: string
911
block?: boolean
1012
11-
classicon?: string
13+
classicon?: IconClass
1214
}>(),
1315
{
1416
type: 'button',

app/components/CallToAction.vue

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ const socialLinks = computed(() => [
2525
ctaKey: $t('about.get_involved.follow.cta'),
2626
},
2727
])
28+
29+
function handleCardClick(event: MouseEvent) {
30+
if ((event.target as HTMLElement).closest(':any-link')) return
31+
if (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) return
32+
33+
const selection = window.getSelection()
34+
if (selection && selection.type === 'Range') return
35+
36+
const card = event.currentTarget as HTMLElement
37+
const link = card.querySelector('a')
38+
link?.click()
39+
}
2840
</script>
2941

3042
<template>
@@ -37,15 +49,16 @@ const socialLinks = computed(() => [
3749
<div
3850
v-for="link in socialLinks"
3951
:key="link.id"
40-
class="group relative grid gap-3 p-4 rounded-lg bg-bg-subtle hover:bg-bg-elevated border border-border hover:border-border-hover transition-all duration-200 sm:grid-rows-subgrid sm:row-span-3 focus-within:ring-2 focus-within:ring-accent/50"
52+
@click="handleCardClick"
53+
class="cursor-pointer group relative grid gap-3 p-4 rounded-lg bg-bg-subtle hover:bg-bg-elevated border border-border hover:border-border-hover transition-all duration-200 sm:grid-rows-subgrid sm:row-span-3 focus-within:ring-2 focus-within:ring-accent/50"
4154
>
42-
<h3 class="z-1 flex gap-2">
55+
<h3 class="flex gap-2">
4356
<span :class="link.icon" class="shrink-0 mt-1 w-5 h-5 text-fg" aria-hidden="true" />
4457
<span class="font-medium text-fg">
4558
{{ link.titleKey }}
4659
</span>
4760
</h3>
48-
<p class="z-1 text-sm text-fg-muted leading-relaxed">
61+
<p class="text-sm text-fg-muted leading-relaxed">
4962
{{ link.descriptionKey }}
5063
</p>
5164
<a
@@ -56,7 +69,6 @@ const socialLinks = computed(() => [
5669
>
5770
{{ link.ctaKey }}
5871
<span class="i-lucide:arrow-right rtl-flip w-3 h-3" aria-hidden="true" />
59-
<span class="absolute z-0 inset-0" aria-hidden="true" />
6072
</a>
6173
</div>
6274
</div>

app/components/Code/DirectoryListing.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,7 @@ const bytesFormatter = useBytesFormatter()
120120
</svg>
121121
<span class="w-full flex justify-self-stretch items-center gap-2">
122122
<span class="flex-1">{{ node.name }}</span>
123-
<span
124-
v-if="node.type === 'file' && node.size"
125-
class="text-end text-xs text-fg-subtle"
126-
>
123+
<span v-if="typeof node.size === 'number'" class="text-end text-xs text-fg-subtle">
127124
{{ bytesFormatter.format(node.size) }}
128125
</span>
129126
</span>

app/components/Compare/PackageSelector.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,20 @@ function handleKeydown(e: KeyboardEvent) {
105105
case 'ArrowDown':
106106
e.preventDefault()
107107
if (count === 0) return
108-
highlightedIndex.value = Math.min(highlightedIndex.value + 1, count - 1)
108+
if (highlightedIndex.value < count - 1) {
109+
highlightedIndex.value++
110+
} else {
111+
highlightedIndex.value = 0
112+
}
109113
break
110114
111115
case 'ArrowUp':
112116
e.preventDefault()
113117
if (count === 0) return
114118
if (highlightedIndex.value > 0) {
115119
highlightedIndex.value--
120+
} else {
121+
highlightedIndex.value = count - 1
116122
}
117123
break
118124

app/components/Link/Base.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup lang="ts">
22
import type { NuxtLinkProps } from '#app'
3+
import type { IconClass } from '~/types'
34
45
const props = withDefaults(
56
defineProps<
@@ -26,7 +27,7 @@ const props = withDefaults(
2627
*/
2728
rel?: never
2829
29-
classicon?: string
30+
classicon?: IconClass
3031
3132
to?: NuxtLinkProps['to']
3233

app/components/Package/ClaimPackageModal.vue

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { checkPackageName } from '~/utils/package-name'
33
44
const props = defineProps<{
55
packageName: string
6+
packageScope?: string | null
7+
canPublishToScope: boolean
68
}>()
79
810
const {
@@ -221,9 +223,19 @@ const previewPackageJson = computed(() => {
221223
</div>
222224

223225
<!-- Availability status -->
224-
<div v-if="checkResult.valid">
226+
<template v-if="checkResult.valid">
225227
<div
226-
v-if="checkResult.available"
228+
v-if="isConnected && !canPublishToScope"
229+
class="flex items-center gap-3 p-4 bg-red-500/10 border border-red-500/20 rounded-lg"
230+
>
231+
<span class="i-lucide:x text-red-500 w-5 h-5" aria-hidden="true" />
232+
<p class="font-mono text-sm text-fg">
233+
{{ $t('claim.modal.missing_permission', { scope: packageScope }) }}
234+
</p>
235+
</div>
236+
237+
<div
238+
v-else-if="checkResult.available"
227239
class="flex items-center gap-3 p-4 bg-green-500/10 border border-green-500/20 rounded-lg"
228240
>
229241
<span class="i-lucide:check text-green-500 w-5 h-5" aria-hidden="true" />
@@ -237,10 +249,10 @@ const previewPackageJson = computed(() => {
237249
<span class="i-lucide:x text-red-500 w-5 h-5" aria-hidden="true" />
238250
<p class="font-mono text-sm text-fg">{{ $t('claim.modal.taken') }}</p>
239251
</div>
240-
</div>
252+
</template>
241253

242254
<!-- Similar packages warning -->
243-
<div v-if="checkResult.similarPackages?.length && checkResult.available">
255+
<template v-if="checkResult.similarPackages?.length && checkResult.available">
244256
<div
245257
:class="
246258
hasDangerousSimilarPackages
@@ -290,7 +302,7 @@ const previewPackageJson = computed(() => {
290302
</li>
291303
</ul>
292304
</div>
293-
</div>
305+
</template>
294306

295307
<!-- Error message -->
296308
<div
@@ -336,7 +348,7 @@ const previewPackageJson = computed(() => {
336348
</div>
337349

338350
<!-- Claim button -->
339-
<div v-else class="space-y-3">
351+
<div v-else-if="isConnected && canPublishToScope" class="space-y-3">
340352
<p class="text-sm text-fg-muted">
341353
{{ $t('claim.modal.publish_hint') }}
342354
</p>

0 commit comments

Comments
 (0)