Skip to content

Commit 40eed21

Browse files
Merge branch 'main' into jy/fix-incorrect-readme
2 parents 81a37f9 + ec10662 commit 40eed21

53 files changed

Lines changed: 1118 additions & 266 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.oxlintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"no-console": "warn",
1111
"no-await-in-loop": "off",
1212
"unicorn/no-array-sort": "off",
13-
"no-restricted-globals": "error"
13+
"no-restricted-globals": "error",
14+
"typescript/consistent-type-imports": "error"
1415
},
1516
"ignorePatterns": [
1617
".output/**",

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ The aim of [npmx.dev](https://npmx.dev) is to provide a better browser for the n
1818
- **URL compatible** – Replace `npmjs.com` with `xnpmjs.com` or `npmx.dev` in any URL and it just works.
1919
- **Simplicity** – No noise, cluttered display, or confusing UI. If in doubt: choose simplicity.
2020

21+
## Shortcuts
22+
23+
> [!IMPORTANT]
24+
> We're keeping the website, repository, and our discord community low-profile until the browser is polished enough. We'll do a formal announcement at that point. Please avoid sharing the website or the invite link to discord on social media directly. The repo is public, so people who care about the project can easily find it and join us. Anyone who wants to help is more than welcome to [join the community](https://chat.npm.dev). If you know others who would be interested, please invite them too!
25+
26+
- [chat.npmx.dev](https://chat.npmx.dev) - Discord Server
27+
- [social.npmx.dev](https://social.npmx.dev) - Bluesky Profile
28+
- [repo.npmx.dev](https://repo.npmx.dev) - GitHub Repository
29+
- [issues.npmx.dev](https://issues.npmx.dev) - GitHub Issues
30+
- [coc.npmx.dev](https://coc.npmx.dev) - Code of Conduct
31+
- [contributing.npmx.dev](https://contributing.npmx.dev) - Contributing Guide
32+
2133
## Features
2234

2335
### Package browsing

app/app.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ button {
195195
margin-top: 2rem;
196196
margin-bottom: 1rem;
197197
line-height: 1.3;
198+
199+
a {
200+
text-decoration: none;
201+
}
198202
}
199203
200204
/* Visual styling based on original README heading level */

app/components/AppFooter.vue

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<script setup lang="ts">
2-
const isMounted = ref(false)
3-
const isVisible = ref(false)
4-
const isScrollable = ref(true)
5-
const lastScrollY = ref(0)
6-
const footerRef = ref<HTMLElement>()
2+
const isMounted = shallowRef(false)
3+
const isVisible = shallowRef(false)
4+
const isScrollable = shallowRef(true)
5+
const lastScrollY = shallowRef(0)
6+
const footerRef = useTemplateRef('footerRef')
77
88
// Check if CSS scroll-state container queries are supported
99
// Once this becomes baseline, we can remove the JS scroll handling entirely
10-
const supportsScrollStateQueries = ref(false)
10+
const supportsScrollStateQueries = useSupported(() => {
11+
return isMounted.value && CSS.supports('container-type', 'scroll-state')
12+
})
1113
1214
function checkScrollable() {
1315
return document.documentElement.scrollHeight > window.innerHeight
@@ -48,26 +50,17 @@ function onResize() {
4850
updateFooterPadding()
4951
}
5052
51-
onMounted(() => {
52-
// Feature detect CSS scroll-state container queries (Chrome 133+)
53-
// @see https://developer.mozilla.org/en-US/docs/Web/CSS/@container#scroll-state_container_descriptors
54-
supportsScrollStateQueries.value = CSS.supports('container-type', 'scroll-state')
53+
useEventListener('scroll', onScroll, { passive: true })
54+
useEventListener('resize', onResize, { passive: true })
5555
56+
onMounted(() => {
5657
nextTick(() => {
5758
lastScrollY.value = window.scrollY
5859
isScrollable.value = checkScrollable()
5960
updateFooterPadding()
6061
// Only apply dynamic classes after mount to avoid hydration mismatch
6162
isMounted.value = true
6263
})
63-
64-
window.addEventListener('scroll', onScroll, { passive: true })
65-
window.addEventListener('resize', onResize, { passive: true })
66-
})
67-
68-
onUnmounted(() => {
69-
window.removeEventListener('scroll', onScroll)
70-
window.removeEventListener('resize', onResize)
7164
})
7265
</script>
7366

@@ -97,19 +90,25 @@ onUnmounted(() => {
9790
<p class="text-xs text-fg-muted m-0 sm:hidden">not affiliated with npm, Inc.</p>
9891
<div class="flex items-center gap-4 sm:gap-6">
9992
<a
100-
href="https://github.com/npmx-dev/npmx.dev"
93+
href="https://repo.npmx.dev"
10194
rel="noopener noreferrer"
102-
class="link-subtle font-mono text-xs min-h-11 min-w-11 flex items-center"
95+
class="link-subtle font-mono text-xs min-h-11 min-w- flex items-center"
10396
>
10497
source
10598
</a>
106-
<span class="text-border">|</span>
10799
<a
108-
href="https://roe.dev"
100+
href="https://social.npmx.dev"
101+
rel="noopener noreferrer"
102+
class="link-subtle font-mono text-xs min-h-11 min-w-11 flex items-center"
103+
>
104+
social
105+
</a>
106+
<a
107+
href="https://chat.npmx.dev"
109108
rel="noopener noreferrer"
110109
class="link-subtle font-mono text-xs min-h-11 min-w-11 flex items-center"
111110
>
112-
@danielroe
111+
chat
113112
</a>
114113
</div>
115114
</div>

app/components/AppTooltip.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const props = defineProps<{
66
position?: 'top' | 'bottom' | 'left' | 'right'
77
}>()
88
9-
const isVisible = ref(false)
9+
const isVisible = shallowRef(false)
1010
const tooltipId = useId()
1111
1212
const positionClasses: Record<string, string> = {

app/components/ClaimPackageModal.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ const {
1919
} = useConnector()
2020
2121
// Fetch name availability when modal opens
22-
const checkResult = ref<CheckNameResult | null>(null)
22+
const checkResult = shallowRef<CheckNameResult | null>(null)
2323
24-
const isChecking = ref(false)
25-
const isPublishing = ref(false)
26-
const publishError = ref<string | null>(null)
27-
const publishSuccess = ref(false)
24+
const isChecking = shallowRef(false)
25+
const isPublishing = shallowRef(false)
26+
const publishError = shallowRef<string | null>(null)
27+
const publishSuccess = shallowRef(false)
2828
2929
async function checkAvailability() {
3030
isChecking.value = true
@@ -125,7 +125,7 @@ const previewPackageJson = computed(() => {
125125
}
126126
})
127127
128-
const connectorModalOpen = ref(false)
128+
const connectorModalOpen = shallowRef(false)
129129
</script>
130130

131131
<template>

app/components/CodeMobileTreeDrawer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defineProps<{
77
baseUrl: string
88
}>()
99
10-
const isOpen = ref(false)
10+
const isOpen = shallowRef(false)
1111
1212
// Close drawer on navigation
1313
const route = useRoute()

app/components/CodeViewer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const emit = defineEmits<{
99
lineClick: [lineNum: number, event: MouseEvent]
1010
}>()
1111
12-
const codeRef = ref<HTMLElement>()
12+
const codeRef = useTemplateRef('codeRef')
1313
1414
// Generate line numbers array
1515
const lineNumbers = computed(() => {

app/components/ConnectorModal.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ const open = defineModel<boolean>('open', { default: false })
44
const { isConnected, isConnecting, npmUser, error, hasOperations, connect, disconnect } =
55
useConnector()
66
7-
const tokenInput = ref('')
8-
const portInput = ref('31415')
9-
const copied = ref(false)
7+
const tokenInput = shallowRef('')
8+
const portInput = shallowRef('31415')
9+
const copied = shallowRef(false)
1010
1111
async function handleConnect() {
1212
const port = Number.parseInt(portInput.value, 10) || 31415

app/components/ConnectorStatus.client.vue

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
<script setup lang="ts">
2-
const { isConnected, isConnecting, npmUser, error, activeOperations, hasPendingOperations } =
3-
useConnector()
2+
const {
3+
isConnected,
4+
isConnecting,
5+
npmUser,
6+
avatar,
7+
error,
8+
activeOperations,
9+
hasPendingOperations,
10+
} = useConnector()
411
5-
const showModal = ref(false)
6-
const showTooltip = ref(false)
12+
const showModal = shallowRef(false)
13+
const showTooltip = shallowRef(false)
714
815
const statusText = computed(() => {
916
if (isConnecting.value) return 'connecting…'
@@ -41,8 +48,16 @@ const ariaLabel = computed(() => {
4148
@focus="showTooltip = true"
4249
@blur="showTooltip = false"
4350
>
44-
<!-- Status dot -->
51+
<!-- Avatar (when connected with avatar) -->
52+
<img
53+
v-if="isConnected && avatar"
54+
:src="avatar"
55+
:alt="`${npmUser}'s avatar`"
56+
class="w-6 h-6 rounded-full"
57+
/>
58+
<!-- Status dot (when not connected or no avatar) -->
4559
<span
60+
v-else
4661
class="w-2.5 h-2.5 rounded-full transition-colors duration-200"
4762
:class="statusColor"
4863
aria-hidden="true"

0 commit comments

Comments
 (0)