Skip to content

Commit 6a44d71

Browse files
authored
fix: remove the contributors only warning for connector (#1920)
1 parent 9c5a6cb commit 6a44d71

29 files changed

+38
-159
lines changed

app/components/Header/ConnectorModal.vue

Lines changed: 28 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@ function handleDisconnect() {
2727
disconnect()
2828
}
2929
30-
// function copyCommand() {
31-
// let command = executeNpmxConnectorCommand.value
32-
// if (portInput.value !== '31415') {
33-
// command += ` --port ${portInput.value}`
34-
// }
35-
// copy(command)
36-
// }
37-
38-
// const selectedPM = useSelectedPackageManager()
39-
40-
// const executeNpmxConnectorCommand = computed(() => {
41-
// return getExecuteCommand({
42-
// packageName: 'npmx-connector',
43-
// packageManager: selectedPM.value,
44-
// })
45-
// })
30+
function copyCommand() {
31+
let command = executeNpmxConnectorCommand.value
32+
if (portInput.value !== '31415') {
33+
command += ` --port ${portInput.value}`
34+
}
35+
copy(command)
36+
}
37+
38+
const selectedPM = useSelectedPackageManager()
39+
40+
const executeNpmxConnectorCommand = computed(() => {
41+
return getExecuteCommand({
42+
packageName: 'npmx-connector',
43+
packageManager: selectedPM.value,
44+
})
45+
})
4646
</script>
4747

4848
<template>
@@ -87,26 +87,6 @@ function handleDisconnect() {
8787

8888
<!-- Disconnected state -->
8989
<form v-else class="space-y-4" @submit.prevent="handleConnect">
90-
<!-- Contributor-only notice -->
91-
<div class="p-3 bg-amber-500/10 border border-amber-500/30 rounded-lg">
92-
<div>
93-
<span class="inline-block text-xs font-bold uppercase tracking-wider text-fg rounded">
94-
{{ $t('connector.modal.contributor_badge') }}
95-
</span>
96-
<p class="text-sm text-fg-muted">
97-
<i18n-t keypath="connector.modal.contributor_notice" scope="global">
98-
<template #link>
99-
<LinkBase
100-
to="https://github.com/npmx-dev/npmx.dev/blob/main/CONTRIBUTING.md#local-connector-cli"
101-
>
102-
{{ $t('connector.modal.contributor_link') }}
103-
</LinkBase>
104-
</template>
105-
</i18n-t>
106-
</p>
107-
</div>
108-
</div>
109-
11090
<p class="text-sm text-fg-muted">
11191
{{ $t('connector.modal.run_hint') }}
11292
</p>
@@ -116,43 +96,20 @@ function handleDisconnect() {
11696
dir="ltr"
11797
>
11898
<span class="text-fg-subtle">$</span>
119-
<span class="text-fg-subtle ms-2">npx npmx-connector</span>
120-
<ButtonBase
121-
:aria-label="copied ? $t('connector.modal.copied') : $t('connector.modal.copy_command')"
122-
@click="copy('npx npmx-connector')"
123-
class="ms-auto"
124-
:classicon="copied ? 'i-lucide:check text-green-500' : 'i-lucide:copy'"
125-
/>
99+
<span class="text-fg-subtle ms-2">{{ executeNpmxConnectorCommand }}</span>
100+
<div class="ms-auto flex items-center gap-2">
101+
<!-- Disable teleport in a modal dialog -->
102+
<PackageManagerSelect :teleport="false" />
103+
104+
<ButtonBase
105+
:aria-label="copied ? $t('connector.modal.copied') : $t('connector.modal.copy_command')"
106+
@click="copyCommand"
107+
class="ms-auto"
108+
:classicon="copied ? 'i-lucide:check text-green-500' : 'i-lucide:copy'"
109+
/>
110+
</div>
126111
</div>
127112

128-
<!-- TODO: Uncomment when npmx-connector is published to npm
129-
<div
130-
class="flex items-center p-3 bg-bg-muted border border-border rounded-lg font-mono text-sm"
131-
>
132-
<span class="text-fg-subtle">$</span>
133-
<span class="text-fg-subtle ms-2">{{ executeNpmxConnectorCommand }}</span>
134-
<div class="ms-auto flex items-center gap-2">
135-
<PackageManagerSelect />
136-
137-
<button
138-
type="button"
139-
:aria-label="
140-
copied ? $t('connector.modal.copied') : $t('connector.modal.copy_command')
141-
"
142-
class="ms-auto text-fg-subtle p-1.5 -m-1.5 hover:text-fg transition-colors duration-200 focus-visible:outline-accent/70 rounded"
143-
@click="copyCommand"
144-
>
145-
<span v-if="!copied" class="i-lucide:copy block w-5 h-5" aria-hidden="true" />
146-
<span
147-
v-else
148-
class="i-lucide:check block w-5 h-5 text-green-500"
149-
aria-hidden="true"
150-
/>
151-
</button>
152-
</div>
153-
</div>
154-
-->
155-
156113
<p class="text-sm text-fg-muted">{{ $t('connector.modal.paste_token') }}</p>
157114

158115
<div class="space-y-3">

app/components/Package/ManagerSelect.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
<script setup lang="ts">
22
import { onClickOutside, useEventListener } from '@vueuse/core'
33
4+
withDefaults(
5+
defineProps<{
6+
teleport?: boolean
7+
}>(),
8+
{
9+
teleport: true,
10+
},
11+
)
12+
413
const selectedPM = useSelectedPackageManager()
514
615
const listRef = useTemplateRef('listRef')
@@ -121,7 +130,7 @@ function handleKeydown(event: KeyboardEvent) {
121130
</button>
122131

123132
<!-- Dropdown menu (teleported to body to avoid clipping) -->
124-
<Teleport to="body">
133+
<Teleport to="body" :disabled="!teleport">
125134
<Transition
126135
:enter-active-class="prefersReducedMotion ? '' : 'transition-opacity duration-150'"
127136
:enter-from-class="prefersReducedMotion ? '' : 'opacity-0'"

i18n/locales/ar.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,6 @@
462462
"connector": {
463463
"modal": {
464464
"title": "الموصل المحلي",
465-
"contributor_badge": "للمساهمين فقط",
466-
"contributor_notice": "لم يُنشر الموصل بعد على npm. راجع {link} لمعرفة كيفية التشغيل محليًا.",
467-
"contributor_link": "دليل المساهمة",
468465
"connected": "متصل",
469466
"connected_as_user": "متصل كـ ~{user}",
470467
"connected_hint": "يمكنك الآن إدارة الحزم والمؤسسات من واجهة الويب.",

i18n/locales/az-AZ.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,9 +495,6 @@
495495
"connector": {
496496
"modal": {
497497
"title": "Lokal Konnektor",
498-
"contributor_badge": "Yalnız əməkdaşlar üçün",
499-
"contributor_notice": "Konnektor hələ npm-ə dərc edilməyib. Lokal işə salmaq üçün {link} baxın.",
500-
"contributor_link": "töhfə bələdçisi",
501498
"connected": "Qoşulub",
502499
"connected_as_user": "~{user} kimi qoşulub",
503500
"connected_hint": "İndi veb interfeysdən paketləri və təşkilatları idarə edə bilərsiniz.",

i18n/locales/bg-BG.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,9 +533,6 @@
533533
"connector": {
534534
"modal": {
535535
"title": "Локален конектор",
536-
"contributor_badge": "Само за сътрудници",
537-
"contributor_notice": "Конекторът все още не е публикуван в npm. Вижте {link} за как да го стартирате локално.",
538-
"contributor_link": "ръководство за сътрудничество",
539536
"connected": "Свързан",
540537
"connected_as_user": "Свързан като ~{user}",
541538
"connected_hint": "Сега можете да управлявате пакети и организации от уеб интерфейса.",

i18n/locales/bn-IN.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,6 @@
359359
"connector": {
360360
"modal": {
361361
"title": "স্থানীয় কনেক্টর",
362-
"contributor_badge": "কন্ট্রিবিউটারদের জন্য মাত্র",
363-
"contributor_notice": "কনেক্টর এখনো npm এ প্রকাশিত হয়নি। স্থানীয়ভাবে চালানোর জন্য {link} দেখুন।",
364-
"contributor_link": "অবদানের নির্দেশনা",
365362
"connected": "সংযুক্ত হয়েছে",
366363
"connected_as_user": "~{user} হিসাবে সংযুক্ত",
367364
"connected_hint": "এখন আপনি ওয়েব UI থেকে প্যাকেজ এবং সংস্থাগুলি পরিচালনা করতে পারবেন।",

i18n/locales/cs-CZ.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,9 +511,6 @@
511511
"connector": {
512512
"modal": {
513513
"title": "Lokální konektor",
514-
"contributor_badge": "Pouze přispěvatelé",
515-
"contributor_notice": "Konektor ještě není publikován na npm. Viz {link} pro informace, jak jej spustit lokálně.",
516-
"contributor_link": "příručka pro přispěvatele",
517514
"connected": "Připojeno",
518515
"connected_as_user": "Připojeno jako ~{user}",
519516
"connected_hint": "Nyní můžete spravovat balíčky a organizace z webového rozhraní.",

i18n/locales/de-DE.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,6 @@
577577
"connector": {
578578
"modal": {
579579
"title": "Lokaler Connector",
580-
"contributor_badge": "Nur für Mitwirkende",
581-
"contributor_notice": "Der Connector ist noch nicht auf npm veröffentlicht. Siehe den {link} für Informationen zum lokalen Ausführen.",
582-
"contributor_link": "Leitfaden für Mitwirkende",
583580
"connected": "Verbunden",
584581
"connected_as_user": "Verbunden als ~{user}",
585582
"connected_hint": "Du kannst jetzt Pakete und Organisationen über die Web-Oberfläche verwalten.",

i18n/locales/en.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,6 @@
577577
"connector": {
578578
"modal": {
579579
"title": "Local Connector",
580-
"contributor_badge": "Contributors only",
581-
"contributor_notice": "The connector is not yet published to npm. See the {link} for how to run locally.",
582-
"contributor_link": "contributing guide",
583580
"connected": "Connected",
584581
"connected_as_user": "Connected as ~{user}",
585582
"connected_hint": "You can now manage packages and organizations from the web UI.",

i18n/locales/es.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,9 +533,6 @@
533533
"connector": {
534534
"modal": {
535535
"title": "Conector Local",
536-
"contributor_badge": "Solo colaboradores",
537-
"contributor_notice": "El conector aún no está publicado en npm. Consulta la {link} para saber cómo ejecutarlo localmente.",
538-
"contributor_link": "guía de contribución",
539536
"connected": "Conectado",
540537
"connected_as_user": "Conectado como ~{user}",
541538
"connected_hint": "Ahora puedes gestionar paquetes y organizaciones desde la interfaz web.",

0 commit comments

Comments
 (0)