Skip to content

Commit e002d17

Browse files
chore: remove test did and backlink comments (#1795)
1 parent 073d631 commit e002d17

File tree

3 files changed

+4
-99
lines changed

3 files changed

+4
-99
lines changed

app/composables/useBlogPostBlueskyLink.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
import { Constellation } from '#shared/utils/constellation'
2-
import { NPMX_SITE } from '#shared/utils/constants'
2+
import { NPMX_SITE, NPMX_DID } from '#shared/utils/constants'
33

44
const BLOG_BACKLINK_TTL_IN_SECONDS = 60 * 5
55

6-
// TODO: Remove did when going live
7-
const TESTING_ROE_DID = 'did:plc:jbeaa5kdaladzwq3r7f5xgwe'
8-
// const TESTING_BACKLINK_URL = 'https://roe.dev/blog/the-golden-thread'
9-
// const NPMX_DID = 'did:plc:u5zp7npt5kpueado77kuihyz'
10-
116
export interface BlogPostBlueskyLink {
127
did: string
138
rkey: string
@@ -21,7 +16,6 @@ export function useBlogPostBlueskyLink(slug: MaybeRefOrGetter<string | null | un
2116
const s = toValue(slug)
2217
if (!s) return null
2318
return `${NPMX_SITE}/blog/${s}`
24-
// return TESTING_BACKLINK_URL
2519
})
2620

2721
return useAsyncData<BlogPostBlueskyLink | null>(
@@ -41,7 +35,7 @@ export function useBlogPostBlueskyLink(slug: MaybeRefOrGetter<string | null | un
4135
1,
4236
undefined,
4337
true,
44-
[[TESTING_ROE_DID]],
38+
[[NPMX_DID]],
4539
BLOG_BACKLINK_TTL_IN_SECONDS,
4640
)
4741

@@ -62,7 +56,7 @@ export function useBlogPostBlueskyLink(slug: MaybeRefOrGetter<string | null | un
6256
1,
6357
undefined,
6458
true,
65-
[[TESTING_ROE_DID]],
59+
[[NPMX_DID]],
6660
BLOG_BACKLINK_TTL_IN_SECONDS,
6761
)
6862

app/pages/blog/index.vue

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -56,99 +56,9 @@ useSeoMeta({
5656
/>
5757
<hr v-if="idx < posts.length - 1" class="border-border-subtle" />
5858
</template>
59-
<!-- :selected="toSuggestionIndex(unifiedSelectedIndex) === idx" -->
60-
<!-- :is-exact-match="
61-
(exactMatchType === 'org' && suggestion.type === 'org') ||
62-
(exactMatchType === 'user' && suggestion.type === 'user')
63-
" -->
64-
<!-- @focus="handleBlogPostSelect" -->
65-
<!-- </div> -->
6659
</article>
6760

6861
<p v-else class="text-center py-20 text-fg-subtle">No posts found.</p>
6962
</article>
7063
</main>
7164
</template>
72-
73-
<!--
74-
// TODO: This should be extracted into a reusable form so search and blog post can both use it
75-
// function scrollToSelectedItem() {
76-
// const pkgIndex = toPackageIndex(unifiedSelectedIndex.value)
77-
// if (pkgIndex !== null) {
78-
// packageListRef.value?.scrollToIndex(pkgIndex)
79-
// }
80-
// }
81-
82-
// function focusSelectedItem() {
83-
// const suggIdx = toSuggestionIndex(unifiedSelectedIndex.value)
84-
// const pkgIdx = toPackageIndex(unifiedSelectedIndex.value)
85-
86-
// nextTick(() => {
87-
// if (suggIdx !== null) {
88-
// const el = document.querySelector<HTMLElement>(`[data-suggestion-index="${suggIdx}"]`)
89-
// el?.focus()
90-
// } else if (pkgIdx !== null) {
91-
// scrollToSelectedItem()
92-
// nextTick(() => {
93-
// const el = document.querySelector<HTMLElement>(`[data-result-index="${pkgIdx}"]`)
94-
// el?.focus()
95-
// })
96-
// }
97-
// })
98-
// }
99-
100-
// function handleResultsKeydown(e: KeyboardEvent) {
101-
// if (totalSelectableCount.value <= 0) return
102-
103-
// const isFromInput = (e.target as HTMLElement).tagName === 'INPUT'
104-
105-
// if (e.key === 'ArrowDown') {
106-
// e.preventDefault()
107-
// userHasNavigated.value = true
108-
// unifiedSelectedIndex.value = clampUnifiedIndex(unifiedSelectedIndex.value + 1)
109-
// if (isFromInput) {
110-
// scrollToSelectedItem()
111-
// } else {
112-
// focusSelectedItem()
113-
// }
114-
// return
115-
// }
116-
117-
// if (e.key === 'ArrowUp') {
118-
// e.preventDefault()
119-
// userHasNavigated.value = true
120-
// unifiedSelectedIndex.value = clampUnifiedIndex(unifiedSelectedIndex.value - 1)
121-
// if (isFromInput) {
122-
// scrollToSelectedItem()
123-
// } else {
124-
// focusSelectedItem()
125-
// }
126-
// return
127-
// }
128-
129-
// if (e.key === 'Enter') {
130-
// if (!resultsMatchQuery.value) return
131-
132-
// const suggIdx = toSuggestionIndex(unifiedSelectedIndex.value)
133-
// const pkgIdx = toPackageIndex(unifiedSelectedIndex.value)
134-
135-
// if (suggIdx !== null) {
136-
// const el = document.querySelector<HTMLElement>(`[data-suggestion-index="${suggIdx}"]`)
137-
// if (el) {
138-
// e.preventDefault()
139-
// el.click()
140-
// }
141-
// } else if (pkgIdx !== null) {
142-
// const el = document.querySelector<HTMLElement>(`[data-result-index="${pkgIdx}"]`)
143-
// if (el) {
144-
// e.preventDefault()
145-
// el.click()
146-
// }
147-
// }
148-
// }
149-
// }
150-
151-
// function handleBlogPostSelect(index: number) {
152-
// // Convert suggestion index to unified index
153-
// unifiedSelectedIndex.value = -(suggestionCount.value - index)
154-
// } -->

shared/utils/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const CACHE_MAX_AGE_ONE_YEAR = 60 * 60 * 24 * 365
1010
// API Strings
1111
export const NPMX_SITE = 'https://npmx.dev'
1212
export const NPMX_DOCS_SITE = 'https://docs.npmx.dev'
13+
export const NPMX_DID = 'did:plc:u5zp7npt5kpueado77kuihyz'
1314
export const BLUESKY_API = 'https://public.api.bsky.app'
1415
export const BLUESKY_COMMENTS_REQUEST = '/api/atproto/bluesky-comments'
1516
export const NPM_REGISTRY = 'https://registry.npmjs.org'

0 commit comments

Comments
 (0)