Skip to content

Commit fcf1827

Browse files
authored
Merge pull request #13 from threenine/develop
develop
2 parents cb05f6e + a6366b3 commit fcf1827

File tree

17 files changed

+294
-137
lines changed

17 files changed

+294
-137
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ Find and replace all on all files (CMD+SHIFT+F):
66
- Package name: @threenine/nuxstr-comments
77
- Description: Nuxstr Comments
88
-->
9-
9+
![Nuxt Fathom module](https://res.cloudinary.com/threenine-co-uk/image/upload/v1733252921/nuxstr-comments_rk7pig.png)
1010
# Nuxstr Comments
1111

1212
[![npm version][npm-version-src]][npm-version-href]
1313
[![npm downloads][npm-downloads-src]][npm-downloads-href]
1414
[![License][license-src]][license-href]
1515
[![Nuxt][nuxt-src]][nuxt-href]
1616

17+
![]()
1718
Enable [nostr protocol](https://nostr.com/) based comment system on your Nuxt 4 based applications.
1819

1920
- [ Release Notes](/CHANGELOG.md)

eslint.config.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ export default createConfigForNuxt({
1717
})
1818
.append(
1919
{
20-
ignores: ['playground/**/*'],
20+
rules: {
21+
'vue/multi-word-component-names': 'off',
22+
},
2123

2224
},
2325
// your custom flat config here...

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,20 @@
4141
"@nuxt/devtools": "^2.6.2",
4242
"@nuxt/eslint": "1.9.0",
4343
"@nuxt/eslint-config": "^1.9.0",
44-
"@nuxt/kit": "^4.2.1",
44+
"@nuxt/kit": "^4.3.1",
4545
"@nuxt/module-builder": "^1.0.2",
4646
"@nuxt/schema": "^4.2.1",
4747
"@nuxt/scripts": "0.11.10",
4848
"@nuxt/test-utils": "^3.19.2",
49-
"@nuxt/ui": "^4.3.0",
49+
"@nuxt/ui": "^4.5.1",
5050
"@testing-library/jest-dom": "^6.8.0",
5151
"@testing-library/vue": "^8.1.0",
5252
"@types/node": "latest",
5353
"@unhead/vue": "^2.0.14",
5454
"changelogen": "^0.6.2",
5555
"eslint": "^9.35.0",
5656
"jsdom": "^26.1.0",
57-
"nuxt": "^4.2.1",
57+
"nuxt": "^4.3.1",
5858
"typescript": "~5.9.2",
5959
"vitest": "^3.2.4",
6060
"vue-tsc": "^3.0.6"

playground/app/app.config.ts

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,84 @@
11
export default defineAppConfig({
22

3-
ui: {
4-
colors: {
5-
primary: 'orange',
6-
neutral: 'neutral'
3+
ui: {
4+
colors: {
5+
primary: 'orange',
6+
neutral: 'neutral',
7+
},
8+
chip: {
9+
slots: {
10+
root: 'relative inline-flex items-center justify-center shrink-0',
11+
base: 'rounded-full ring ring-bg flex items-center justify-center text-inverted font-medium whitespace-nowrap',
712
},
8-
chip: {
9-
slots: {
10-
root: 'relative inline-flex items-center justify-center shrink-0',
11-
base: 'rounded-full ring ring-bg flex items-center justify-center text-inverted font-medium whitespace-nowrap'
13+
variants: {
14+
color: {
15+
primary: 'bg-primary',
16+
secondary: 'bg-secondary',
17+
success: 'bg-success',
18+
info: 'bg-info',
19+
warning: 'bg-warning',
20+
error: 'bg-error',
21+
neutral: 'bg-inverted',
22+
},
23+
size: {
24+
'3xs': 'h-[4px] min-w-[4px] text-[4px]',
25+
'2xs': 'h-[5px] min-w-[5px] text-[5px]',
26+
'xs': 'h-[6px] min-w-[6px] text-[6px]',
27+
'sm': 'h-[7px] min-w-[7px] text-[7px]',
28+
'md': 'h-[8px] min-w-[8px] text-[8px]',
29+
'lg': 'h-[9px] min-w-[9px] text-[9px]',
30+
'xl': 'h-[10px] min-w-[10px] text-[10px]',
31+
'2xl': 'h-[11px] min-w-[11px] text-[11px]',
32+
'3xl': 'h-[12px] min-w-[12px] text-[12px]',
33+
},
34+
position: {
35+
'top-right': 'top-0 right-0',
36+
'bottom-right': 'bottom-0 right-0',
37+
'top-left': 'top-0 left-0',
38+
'bottom-left': 'bottom-0 left-0',
1239
},
13-
variants: {
14-
color: {
15-
primary: 'bg-primary',
16-
secondary: 'bg-secondary',
17-
success: 'bg-success',
18-
info: 'bg-info',
19-
warning: 'bg-warning',
20-
error: 'bg-error',
21-
neutral: 'bg-inverted'
22-
},
23-
size: {
24-
'3xs': 'h-[4px] min-w-[4px] text-[4px]',
25-
'2xs': 'h-[5px] min-w-[5px] text-[5px]',
26-
xs: 'h-[6px] min-w-[6px] text-[6px]',
27-
sm: 'h-[7px] min-w-[7px] text-[7px]',
28-
md: 'h-[8px] min-w-[8px] text-[8px]',
29-
lg: 'h-[9px] min-w-[9px] text-[9px]',
30-
xl: 'h-[10px] min-w-[10px] text-[10px]',
31-
'2xl': 'h-[11px] min-w-[11px] text-[11px]',
32-
'3xl': 'h-[12px] min-w-[12px] text-[12px]'
33-
},
34-
position: {
35-
'top-right': 'top-0 right-0',
36-
'bottom-right': 'bottom-0 right-0',
37-
'top-left': 'top-0 left-0',
38-
'bottom-left': 'bottom-0 left-0'
39-
},
40-
inset: {
41-
false: ''
42-
},
43-
standalone: {
44-
false: 'absolute'
45-
}
40+
inset: {
41+
false: '',
42+
},
43+
standalone: {
44+
false: 'absolute',
4645
},
47-
compoundVariants: [
48-
{
49-
position: 'top-right',
50-
inset: false,
51-
class: '-translate-y-1/2 translate-x-1/2 transform'
52-
},
53-
{
54-
position: 'bottom-right',
55-
inset: false,
56-
class: 'translate-y-1/2 translate-x-1/2 transform'
57-
},
58-
{
59-
position: 'top-left',
60-
inset: false,
61-
class: '-translate-y-1/2 -translate-x-1/2 transform'
62-
},
63-
{
64-
position: 'bottom-left',
65-
inset: false,
66-
class: 'translate-y-1/2 -translate-x-1/2 transform'
67-
}
68-
],
69-
defaultVariants: {
70-
size: 'md',
71-
color: 'primary',
72-
position: 'top-right'
73-
}
7446
},
47+
compoundVariants: [
48+
{
49+
position: 'top-right',
50+
inset: false,
51+
class: '-translate-y-1/2 translate-x-1/2 transform',
52+
},
53+
{
54+
position: 'bottom-right',
55+
inset: false,
56+
class: 'translate-y-1/2 translate-x-1/2 transform',
57+
},
58+
{
59+
position: 'top-left',
60+
inset: false,
61+
class: '-translate-y-1/2 -translate-x-1/2 transform',
62+
},
63+
{
64+
position: 'bottom-left',
65+
inset: false,
66+
class: 'translate-y-1/2 -translate-x-1/2 transform',
67+
},
68+
],
69+
defaultVariants: {
70+
size: 'md',
71+
color: 'primary',
72+
position: 'top-right',
73+
},
74+
},
7575
icons: {
7676
light: 'i-ph-sun',
77-
dark: 'i-ph-moon'
77+
dark: 'i-ph-moon',
7878
},
7979
skeleton: {
80-
base: 'animate-pulse rounded-md bg-elevated'
81-
}
80+
base: 'animate-pulse rounded-md bg-elevated',
81+
},
8282

8383
},
8484
})

playground/app/pages/another-page.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22

33
<template>
44
<div>
5-
<nuxt-link to="/" class="text-primary">Back</nuxt-link>
6-
<nuxt-link to="/another" class="text-primary">Another</nuxt-link>
5+
<nuxt-link
6+
to="/"
7+
class="text-primary"
8+
>Back</nuxt-link>
9+
<nuxt-link
10+
to="/another"
11+
class="text-primary"
12+
>Another</nuxt-link>
713
<nuxstr-comments />
814
</div>
915
</template>

playground/app/pages/another/deeper/index.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
</script>
44

55
<template>
6-
76
<nuxstr-comments />
87
</template>
98

playground/app/pages/another/index.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
</script>
44

55
<template>
6-
76
<div>
8-
9-
<nuxt-link to="/another/deeper" class="text-primary">Another deeper</nuxt-link>
10-
<u-separator></u-separator>
7+
<nuxt-link
8+
to="/another/deeper"
9+
class="text-primary"
10+
>Another deeper</nuxt-link>
11+
<u-separator />
1112
<nuxstr-comments />
1213
</div>
13-
1414
</template>
1515

1616
<style scoped>

playground/app/pages/index.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
<template>
55
<nuxt-layout name="default-layout">
66
<UContainer>
7-
<h1>Playground</h1>
8-
<p>Index Page</p> <nuxt-link
9-
to="another-page"
10-
class="text-primary"
11-
> Another Page</nuxt-link>
12-
<NuxstrComments />
7+
<h1>Playground</h1>
8+
<p>Index Page</p> <nuxt-link
9+
to="another-page"
10+
class="text-primary"
11+
> Another Page</nuxt-link>
12+
<NuxstrComments />
1313
</UContainer>
1414
</nuxt-layout>
1515
</template>

playground/nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ export default defineNuxtConfig({
44
css: ['~/assets/css/main.css'],
55
compatibilityDate: '2025-08-19',
66
nuxstrComments: {
7-
relays: ['wss://relay.threenine.services']
7+
relays: ['ws://localhost:10547'],
88
},
99
})

src/module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ export default defineNuxtModule<ModuleOptions>({
5757
nuxt.hook('nitro:config', (nitroConfig) => {
5858
nitroConfig.externals = nitroConfig.externals || {}
5959
nitroConfig.externals.inline = nitroConfig.externals.inline || []
60-
nitroConfig.externals.inline.push('tseep', 'nostr-tools', 'defu')
60+
nitroConfig.externals.inline.push('nostr-tools', 'defu')
6161
})
6262

6363
// Build transpilation (you already had this)
6464
nuxt.options.build.transpile = nuxt.options.build.transpile || []
65-
nuxt.options.build.transpile.push('tseep', 'nostr-tools', 'defu')
65+
nuxt.options.build.transpile.push('nostr-tools', 'defu')
6666

6767
// Expose runtime config to plugin
6868
nuxt.options.runtimeConfig.public.nuxstrComments = defu(nuxt.options.runtimeConfig.public.nuxstrComments || {}, options)

0 commit comments

Comments
 (0)