@threenine/nuxstr-comments 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,611 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Threenine Consulting Limited
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+ To "modify" a work means to copy from or adapt all or part of the work
23
+ in a fashion requiring copyright permission, other than the making of an
24
+ exact copy. The resulting work is called a "modified version" of the
25
+ earlier work or a work "based on" the earlier work.
26
+
27
+ A "covered work" means either the unmodified Program or a work based
28
+ on the Program.
29
+
30
+ To "propagate" a work means to do anything with it that, without
31
+ permission, would make you directly or secondarily liable for
32
+ infringement under applicable copyright law, except executing it on a
33
+ computer or modifying a private copy. Propagation includes copying,
34
+ distribution (with or without modification), making available to the
35
+ public, and in some countries other activities as well.
36
+
37
+ To "convey" a work means any kind of propagation that enables other
38
+ parties to make or receive copies. Mere interaction with a user through
39
+ a computer network, with no transfer of a copy, is not conveying.
40
+
41
+ An interactive user interface displays "Appropriate Legal Notices"
42
+ to the extent that it includes a convenient and prominently visible
43
+ feature that (1) displays an appropriate copyright notice, and (2)
44
+ tells the user that there is no warranty for the work (except to the
45
+ extent that warranties are provided), that licensees may convey the
46
+ work under this License, and how to view a copy of this License. If
47
+ the interface presents a list of user commands or options, such as a
48
+ menu, a prominent item in the list meets this criterion.
49
+
50
+ 1. Source Code.
51
+
52
+ The "source code" for a work means the preferred form of the work
53
+ for making modifications to it. "Object code" means any non-source
54
+ form of a work.
55
+
56
+ A "Standard Interface" means an interface that either is an official
57
+ standard defined by a recognized standards body, or, in the case of
58
+ interfaces specified for a particular programming language, one that
59
+ is widely used among developers working in that language.
60
+
61
+ The "System Libraries" of an executable work include anything, other
62
+ than the work as a whole, that (a) is included in the normal form of
63
+ packaging a Major Component, but which is not part of that Major
64
+ Component, and (b) serves only to enable use of the work with that
65
+ Major Component, or to implement a Standard Interface for which an
66
+ implementation is available to the public in source code form. A
67
+ "Major Component", in this context, means a major essential component
68
+ (kernel, window system, and so on) of the specific operating system
69
+ (if any) on which the executable work runs, or a compiler used to
70
+ produce the work, or an object code interpreter used to run it.
71
+
72
+ The "Corresponding Source" for a work in object code form means all
73
+ the source code needed to generate, install, and (for an executable
74
+ work) run the object code and to modify the work, including scripts to
75
+ control those activities. However, it does not include the work's
76
+ System Libraries, or general-purpose tools or generally available free
77
+ programs which are used unmodified in performing those activities but
78
+ which are not part of the work. For example, Corresponding Source
79
+ includes interface definition files associated with source files for
80
+ the work, and the source code for shared libraries and dynamically
81
+ linked subprograms that the work is specifically designed to require,
82
+ such as by intimate data communication or control flow between those
83
+ subprograms and other parts of the work.
84
+
85
+ The Corresponding Source need not include anything that users
86
+ can regenerate automatically from other parts of the Corresponding
87
+ Source.
88
+
89
+ The Corresponding Source for a work in source code form is that
90
+ same work.
91
+
92
+ 2. Basic Permissions.
93
+
94
+ All rights granted under this License are granted for the term of
95
+ copyright on the Program, and are irrevocable provided the stated
96
+ conditions are met. This License explicitly affirms your unlimited
97
+ permission to run the unmodified Program. The output from running a
98
+ covered work is covered by this License only if the output, given its
99
+ content, constitutes a covered work. This License acknowledges your
100
+ rights of fair use or other equivalent, as provided by copyright law.
101
+
102
+ You may make, run and propagate covered works that you do not
103
+ convey, without conditions so long as your license otherwise remains
104
+ in force. You may convey covered works to others for the sole purpose
105
+ of having them make modifications exclusively for you, or provide you
106
+ with facilities for running those works, provided that you comply with
107
+ the terms of this License in conveying all material for which you do
108
+ not control copyright. Those thus making or running the covered works
109
+ for you must do so exclusively on your behalf, under your direction
110
+ and control, on terms that prohibit them from making any copies of
111
+ your copyrighted material outside their relationship with you.
112
+
113
+ Conveying under any other circumstances is permitted solely under
114
+ the conditions stated below. Sublicensing is not allowed; section 10
115
+ makes it unnecessary.
116
+
117
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
118
+
119
+ No covered work shall be deemed part of an effective technological
120
+ measure under any applicable law fulfilling obligations under article
121
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
122
+ similar laws prohibiting or restricting circumvention of such
123
+ measures.
124
+
125
+ When you convey a covered work, you waive any legal power to forbid
126
+ circumvention of technological measures to the extent such circumvention
127
+ is effected by exercising rights under this License with respect to
128
+ the covered work, and you disclaim any intention to limit operation or
129
+ modification of the work as a means of enforcing, against the work's
130
+ users, your or third parties' legal rights to forbid circumvention of
131
+ technological measures.
132
+
133
+ 4. Conveying Verbatim Copies.
134
+
135
+ You may convey verbatim copies of the Program's source code as you
136
+ receive it, in any medium, provided that you conspicuously and
137
+ appropriately publish on each copy an appropriate copyright notice;
138
+ keep intact all notices stating that this License and any
139
+ non-permissive terms added in accord with section 7 apply to the code;
140
+ keep intact all notices of the absence of any warranty; and give all
141
+ recipients a copy of this License along with the Program.
142
+
143
+ You may charge any price or no price for each copy that you convey,
144
+ and you may offer support or warranty protection for a fee.
145
+
146
+ 5. Conveying Modified Source Versions.
147
+
148
+ You may convey a work based on the Program, or the modifications to
149
+ produce it from the Program, in the form of source code under the
150
+ terms of section 4, provided that you also meet all of these conditions:
151
+
152
+ a) The work must carry prominent notices stating that you modified
153
+ it, and giving a relevant date.
154
+
155
+ b) The work must carry prominent notices stating that it is
156
+ released under this License and any conditions added under section
157
+ 7. This requirement modifies the requirement in section 4 to
158
+ "keep intact all notices".
159
+
160
+ c) You must license the entire work, as a whole, under this
161
+ License to anyone who comes into possession of a copy. This
162
+ License will therefore apply, along with any applicable section 7
163
+ additional terms, to the whole of the work, and all its parts,
164
+ regardless of how they are packaged. This License gives no
165
+ permission to license the work in any other way, but it does not
166
+ invalidate such permission if you have separately received it.
167
+
168
+ d) If the work has interactive user interfaces, each must display
169
+ Appropriate Legal Notices; however, if the Program has interactive
170
+ interfaces that do not display Appropriate Legal Notices, your
171
+ work need not make them do so.
172
+
173
+ A compilation of a covered work with other separate and independent
174
+ works, which are not by their nature extensions of the covered work,
175
+ and which are not combined with it such as to form a larger program,
176
+ in or on a volume of a storage or distribution medium, is called an
177
+ "aggregate" if the compilation and its resulting copyright are not
178
+ used to limit the access or legal rights of the compilation's users
179
+ beyond what the individual works permit. Inclusion of a covered work
180
+ in an aggregate does not cause this License to apply to the other
181
+ parts of the aggregate.
182
+
183
+ 6. Conveying Non-Source Forms.
184
+
185
+ You may convey a covered work in object code form under the terms
186
+ of sections 4 and 5, provided that you also convey the
187
+ machine-readable Corresponding Source under the terms of this License,
188
+ in one of these ways:
189
+
190
+ a) Convey the object code in, or embodied in, a physical product
191
+ (including a physical distribution medium), accompanied by the
192
+ Corresponding Source fixed on a durable physical medium
193
+ customarily used for software interchange.
194
+
195
+ b) Convey the object code in, or embodied in, a physical product
196
+ (including a physical distribution medium), accompanied by a
197
+ written offer, valid for at least three years and valid for as
198
+ long as you offer spare parts or customer support for that product
199
+ model, to give anyone who possesses the object code either (1) a
200
+ copy of the Corresponding Source for all the software in the
201
+ product that is covered by this License, on a durable physical
202
+ medium customarily used for software interchange, for a price no
203
+ more than your reasonable cost of physically performing this
204
+ conveying of source, or (2) access to copy the
205
+ Corresponding Source from a network server at no charge.
206
+
207
+ c) Convey individual copies of the object code with a copy of the
208
+ written offer to provide the Corresponding Source. This
209
+ alternative is allowed only occasionally and noncommercially, and
210
+ only if you received the object code with such an offer, in accord
211
+ with subsection 6b.
212
+
213
+ d) Convey the object code by offering access from a designated
214
+ place (gratis or for a charge), and offer equivalent access to the
215
+ Corresponding Source in the same way through the same place at no
216
+ further charge. You need not require recipients to copy the
217
+ Corresponding Source along with the object code. If the place to
218
+ copy the object code is a network server, the Corresponding Source
219
+ may be on a different server (operated by you or a third party)
220
+ that supports equivalent copying facilities, provided you maintain
221
+ clear directions next to the object code saying where to find the
222
+ Corresponding Source. Regardless of what server hosts the
223
+ Corresponding Source, you remain obligated to ensure that it is
224
+ available for as long as needed to satisfy these requirements.
225
+
226
+ e) Convey the object code using peer-to-peer transmission, provided
227
+ you inform other peers where the object code and Corresponding
228
+ Source of the work are being offered to the general public at no
229
+ charge under subsection 6d.
230
+
231
+ A separable portion of the object code, whose source code is excluded
232
+ from the Corresponding Source as a System Library, need not be
233
+ included in conveying the object code work.
234
+
235
+ A "Account Product" is either (1) a "consumer product", which means any
236
+ tangible personal property which is normally used for personal, family,
237
+ or household purposes, or (2) anything designed or sold for incorporation
238
+ into a dwelling. In determining whether a product is a consumer product,
239
+ doubtful cases shall be resolved in favor of coverage. For a particular
240
+ product received by a particular user, "normally used" refers to a
241
+ typical or common use of that class of product, regardless of the status
242
+ of the particular user or of the way in which the particular user
243
+ actually uses, or expects or is expected to use, the product. A product
244
+ is a consumer product regardless of whether the product has substantial
245
+ commercial, industrial or non-consumer uses, unless such uses represent
246
+ the only significant mode of use of the product.
247
+
248
+ "Installation Information" for a Account Product means any methods,
249
+ procedures, authorization keys, or other information required to install
250
+ and execute modified versions of a covered work in that Account Product from
251
+ a modified version of its Corresponding Source. The information must
252
+ suffice to ensure that the continued functioning of the modified object
253
+ code is in no case prevented or interfered with solely because
254
+ modification has been made.
255
+
256
+ If you convey an object code work under this section in, or with, or
257
+ specifically for use in, a Account Product, and the conveying occurs as
258
+ part of a transaction in which the right of possession and use of the
259
+ Account Product is transferred to the recipient in perpetuity or for a
260
+ fixed term (regardless of how the transaction is characterized), the
261
+ Corresponding Source conveyed under this section must be accompanied
262
+ by the Installation Information. But this requirement does not apply
263
+ if neither you nor any third party retains the ability to install
264
+ modified object code on the Account Product (for example, the work has
265
+ been installed in ROM).
266
+
267
+ The requirement to provide Installation Information does not include a
268
+ requirement to continue to provide support service, warranty, or updates
269
+ for a work that has been modified or installed by the recipient, or for
270
+ the Account Product in which it has been modified or installed. Access to a
271
+ network may be denied when the modification itself materially and
272
+ adversely affects the operation of the network or violates the rules and
273
+ protocols for communication across the network.
274
+
275
+ Corresponding Source conveyed, and Installation Information provided,
276
+ in accord with this section must be in a format that is publicly
277
+ documented (and with an implementation available to the public in
278
+ source code form), and must require no special password or key for
279
+ unpacking, reading or copying.
280
+
281
+ 7. Additional Terms.
282
+
283
+ "Additional permissions" are terms that supplement the terms of this
284
+ License by making exceptions from one or more of its conditions.
285
+ Additional permissions that are applicable to the entire Program shall
286
+ be treated as though they were included in this License, to the extent
287
+ that they are valid under applicable law. If additional permissions
288
+ apply only to part of the Program, that part may be used separately
289
+ under those permissions, but the entire Program remains governed by
290
+ this License without regard to the additional permissions.
291
+
292
+ When you convey a copy of a covered work, you may at your option
293
+ remove any additional permissions from that copy, or from any part of
294
+ it. (Additional permissions may be written to require their own
295
+ removal in certain cases when you modify the work.) You may place
296
+ additional permissions on material, added by you to a covered work,
297
+ for which you have or can give appropriate copyright permission.
298
+
299
+ Notwithstanding any other provision of this License, for material you
300
+ add to a covered work, you may (if authorized by the copyright holders of
301
+ that material) supplement the terms of this License with terms:
302
+
303
+ a) Disclaiming warranty or limiting liability differently from the
304
+ terms of sections 15 and 16 of this License; or
305
+
306
+ b) Requiring preservation of specified reasonable legal notices or
307
+ author attributions in that material or in the Appropriate Legal
308
+ Notices displayed by works containing it; or
309
+
310
+ c) Prohibiting misrepresentation of the origin of that material, or
311
+ requiring that modified versions of such material be marked in
312
+ reasonable ways as different from the original version; or
313
+
314
+ d) Limiting the use for publicity purposes of names of licensors or
315
+ authors of the material; or
316
+
317
+ e) Declining to grant rights under trademark law for use of some
318
+ trade names, trademarks, or service marks; or
319
+
320
+ f) Requiring indemnification of licensors and authors of that
321
+ material by anyone who conveys the material (or modified versions of
322
+ it) with contractual assumptions of liability to the recipient, for
323
+ any liability that these contractual assumptions directly impose on
324
+ those licensors and authors.
325
+
326
+ All other non-permissive additional terms are considered "further
327
+ restrictions" within the meaning of section 10. If the Program as you
328
+ received it, or any part of it, contains a notice stating that it is
329
+ governed by this License along with a term that is a further
330
+ restriction, you may remove that term. If a license document contains
331
+ a further restriction but permits relicensing or conveying under this
332
+ License, you may add to a covered work material governed by the terms
333
+ of that license document, provided that the further restriction does
334
+ not survive such relicensing or conveying.
335
+
336
+ If you add terms to a covered work in accord with this section, you
337
+ must place, in the relevant source files, a statement of the
338
+ additional terms that apply to those files, or a notice indicating
339
+ where to find the applicable terms.
340
+
341
+ Additional terms, permissive or non-permissive, may be stated in the
342
+ form of a separately written license, or stated as exceptions;
343
+ the above requirements apply either way.
344
+
345
+ 8. Termination.
346
+
347
+ You may not propagate or modify a covered work except as expressly
348
+ provided under this License. Any attempt otherwise to propagate or
349
+ modify it is void, and will automatically terminate your rights under
350
+ this License (including any patent licenses granted under the third
351
+ paragraph of section 11).
352
+
353
+ However, if you cease all violation of this License, then your
354
+ license from a particular copyright holder is reinstated (a)
355
+ provisionally, unless and until the copyright holder explicitly and
356
+ finally terminates your license, and (b) permanently, if the copyright
357
+ holder fails to notify you of the violation by some reasonable means
358
+ prior to 60 days after the cessation.
359
+
360
+ Moreover, your license from a particular copyright holder is
361
+ reinstated permanently if the copyright holder notifies you of the
362
+ violation by some reasonable means, this is the first time you have
363
+ received notice of violation of this License (for any work) from that
364
+ copyright holder, and you cure the violation prior to 30 days after
365
+ your receipt of the notice.
366
+
367
+ Termination of your rights under this section does not terminate the
368
+ licenses of parties who have received copies or rights from you under
369
+ this License. If your rights have been terminated and not permanently
370
+ reinstated, you do not qualify to receive new licenses for the same
371
+ material under section 10.
372
+
373
+ 9. Acceptance Not Required for Having Copies.
374
+
375
+ You are not required to accept this License in order to receive or
376
+ run a copy of the Program. Ancillary propagation of a covered work
377
+ occurring solely as a consequence of using peer-to-peer transmission
378
+ to receive a copy likewise does not require acceptance. However,
379
+ nothing other than this License grants you permission to propagate or
380
+ modify any covered work. These actions infringe copyright if you do
381
+ not accept this License. Therefore, by modifying or propagating a
382
+ covered work, you indicate your acceptance of this License to do so.
383
+
384
+ 10. Automatic Licensing of Downstream Recipients.
385
+
386
+ Each time you convey a covered work, the recipient automatically
387
+ receives a license from the original licensors, to run, modify and
388
+ propagate that work, subject to this License. You are not responsible
389
+ for enforcing compliance by third parties with this License.
390
+
391
+ An "entity transaction" is a transaction transferring control of an
392
+ organization, or substantially all assets of one, or subdividing an
393
+ organization, or merging organizations. If propagation of a covered
394
+ work results from an entity transaction, each party to that
395
+ transaction who receives a copy of the work also receives whatever
396
+ licenses to the work the party's predecessor in interest had or could
397
+ give under the previous paragraph, plus a right to possession of the
398
+ Corresponding Source of the work from the predecessor in interest, if
399
+ the predecessor has it or can get it with reasonable efforts.
400
+
401
+ You may not impose any further restrictions on the exercise of the
402
+ rights granted or affirmed under this License. For example, you may
403
+ not impose a license fee, royalty, or other charge for exercise of
404
+ rights granted under this License, and you may not initiate litigation
405
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
406
+ any patent claim is infringed by making, using, selling, offering for
407
+ sale, or importing the Program or any portion of it.
408
+
409
+ 11. Patents.
410
+
411
+ A "contributor" is a copyright holder who authorizes use under this
412
+ License of the Program or a work on which the Program is based. The
413
+ work thus licensed is called the contributor's "contributor version".
414
+
415
+ A contributor's "essential patent claims" are all patent claims
416
+ owned or controlled by the contributor, whether already acquired or
417
+ hereafter acquired, that would be infringed by some manner, permitted
418
+ by this License, of making, using, or selling its contributor version,
419
+ but do not include claims that would be infringed only as a
420
+ consequence of further modification of the contributor version. For
421
+ purposes of this definition, "control" includes the right to grant
422
+ patent sublicenses in a manner consistent with the requirements of
423
+ this License.
424
+
425
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
426
+ patent license under the contributor's essential patent claims, to
427
+ make, use, sell, offer for sale, import and otherwise run, modify and
428
+ propagate the contents of its contributor version.
429
+
430
+ In the following three paragraphs, a "patent license" is any express
431
+ agreement or commitment, however denominated, not to enforce a patent
432
+ (such as an express permission to practice a patent or covenant not to
433
+ sue for patent infringement). To "grant" such a patent license to a
434
+ party means to make such an agreement or commitment not to enforce a
435
+ patent against the party.
436
+
437
+ If you convey a covered work, knowingly relying on a patent license,
438
+ and the Corresponding Source of the work is not available for anyone
439
+ to copy, free of charge and under the terms of this License, through a
440
+ publicly available network server or other readily accessible means,
441
+ then you must either (1) cause the Corresponding Source to be so
442
+ available, or (2) arrange to deprive yourself of the benefit of the
443
+ patent license for this particular work, or (3) arrange, in a manner
444
+ consistent with the requirements of this License, to extend the patent
445
+ license to downstream recipients. "Knowingly relying" means you have
446
+ actual knowledge that, but for the patent license, your conveying the
447
+ covered work in a country, or your recipient's use of the covered work
448
+ in a country, would infringe one or more identifiable patents in that
449
+ country that you have reason to believe are valid.
450
+
451
+ If, pursuant to or in connection with a single transaction or
452
+ arrangement, you convey, or propagate by procuring conveyance of, a
453
+ covered work, and grant a patent license to some of the parties
454
+ receiving the covered work authorizing them to use, propagate, modify
455
+ or convey a specific copy of the covered work, then the patent license
456
+ you grant is automatically extended to all recipients of the covered
457
+ work and works based on it.
458
+
459
+ A patent license is "discriminatory" if it does not include within
460
+ the scope of its coverage, prohibits the exercise of, or is
461
+ conditioned on the non-exercise of one or more of the rights that are
462
+ specifically granted under this License. You may not convey a covered
463
+ work if you are a party to an arrangement with a third party that is
464
+ in the business of distributing software, under which you make payment
465
+ to the third party based on the extent of your activity of conveying
466
+ the work, and under which the third party grants, to any of the
467
+ parties who would receive the covered work from you, a discriminatory
468
+ patent license (a) in connection with copies of the covered work
469
+ conveyed by you (or copies made from those copies), or (b) primarily
470
+ for and in connection with specific products or compilations that
471
+ contain the covered work, unless you entered into that arrangement,
472
+ or that patent license was granted, prior to 28 March 2007.
473
+
474
+ Nothing in this License shall be construed as excluding or limiting
475
+ any implied license or other defenses to infringement that may
476
+ otherwise be available to you under applicable patent law.
477
+
478
+ 12. No Surrender of Others' Freedom.
479
+
480
+ If conditions are imposed on you (whether by court order, agreement or
481
+ otherwise) that contradict the conditions of this License, they do not
482
+ excuse you from the conditions of this License. If you cannot convey a
483
+ covered work so as to satisfy simultaneously your obligations under this
484
+ License and any other pertinent obligations, then as a consequence you may
485
+ not convey it at all. For example, if you agree to terms that obligate you
486
+ to collect a royalty for further conveying from those to whom you convey
487
+ the Program, the only way you could satisfy both those terms and this
488
+ License would be to refrain entirely from conveying the Program.
489
+
490
+ 13. Remote Network Interaction; Use with the GNU General Public License.
491
+
492
+ Notwithstanding any other provision of this License, if you modify the
493
+ Program, your modified version must prominently offer all users
494
+ interacting with it remotely through a computer network (if your version
495
+ supports such interaction) an opportunity to receive the Corresponding
496
+ Source of your version by providing access to the Corresponding Source
497
+ from a network server at no charge, through some standard or customary
498
+ means of facilitating copying of software. This Corresponding Source
499
+ shall include the Corresponding Source for any work covered by version 3
500
+ of the GNU General Public License that is incorporated pursuant to the
501
+ following paragraph.
502
+
503
+ Notwithstanding any other provision of this License, you have
504
+ permission to link or combine any covered work with a work licensed
505
+ under version 3 of the GNU General Public License into a single
506
+ combined work, and to convey the resulting work. The terms of this
507
+ License will continue to apply to the part which is the covered work,
508
+ but the work with which it is combined will remain governed by version
509
+ 3 of the GNU General Public License.
510
+
511
+ 14. Revised Versions of this License.
512
+
513
+ The Free Software Foundation may publish revised and/or new versions of
514
+ the GNU Affero General Public License from time to time. Such new versions
515
+ will be similar in spirit to the present version, but may differ in detail to
516
+ address new problems or concerns.
517
+
518
+ Each version is given a distinguishing version number. If the
519
+ Program specifies that a certain numbered version of the GNU Affero General
520
+ Public License "or any later version" applies to it, you have the
521
+ option of following the terms and conditions either of that numbered
522
+ version or of any later version published by the Free Software
523
+ Foundation. If the Program does not specify a version number of the
524
+ GNU Affero General Public License, you may choose any version ever published
525
+ by the Free Software Foundation.
526
+
527
+ If the Program specifies that a proxy can decide which future
528
+ versions of the GNU Affero General Public License can be used, that proxy's
529
+ public statement of acceptance of a version permanently authorizes you
530
+ to choose that version for the Program.
531
+
532
+ Later license versions may give you additional or different
533
+ permissions. However, no additional obligations are imposed on any
534
+ author or copyright holder as a result of your choosing to follow a
535
+ later version.
536
+
537
+ 15. Disclaimer of Warranty.
538
+
539
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
540
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
541
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
542
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
543
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
544
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
545
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
546
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
547
+
548
+ 16. Limitation of Liability.
549
+
550
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
551
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
552
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
553
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
554
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
555
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
556
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
557
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
558
+ SUCH DAMAGES.
559
+
560
+ 17. Interpretation of Sections 15 and 16.
561
+
562
+ If the disclaimer of warranty and limitation of liability provided
563
+ above cannot be given local legal effect according to their terms,
564
+ reviewing courts shall apply local law that most closely approximates
565
+ an absolute waiver of all civil liability in connection with the
566
+ Program, unless a warranty or assumption of liability accompanies a
567
+ copy of the Program in return for a fee.
568
+
569
+ END OF TERMS AND CONDITIONS
570
+
571
+ How to Apply These Terms to Your New Programs
572
+
573
+ If you develop a new program, and you want it to be of the greatest
574
+ possible use to the public, the best way to achieve this is to make it
575
+ free software which everyone can redistribute and change under these terms.
576
+
577
+ To do so, attach the following notices to the program. It is safest
578
+ to attach them to the start of each source file to most effectively
579
+ state the exclusion of warranty; and each file should have at least
580
+ the "copyright" line and a pointer to where the full notice is found.
581
+
582
+ <one line to give the program's name and a brief idea of what it does.>
583
+ Copyright (C) <year> <name of author>
584
+
585
+ This program is free software: you can redistribute it and/or modify
586
+ it under the terms of the GNU Affero General Public License as published
587
+ by the Free Software Foundation, either version 3 of the License, or
588
+ (at your option) any later version.
589
+
590
+ This program is distributed in the hope that it will be useful,
591
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
592
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
593
+ GNU Affero General Public License for more details.
594
+
595
+ You should have received a copy of the GNU Affero General Public License
596
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
597
+
598
+ Also add information on how to contact you by electronic and paper mail.
599
+
600
+ If your software can interact with users remotely through a computer
601
+ network, you should also make sure that it provides a way for users to
602
+ get its source. For example, if your program is a web application, its
603
+ interface could display a "Source" link that leads users to an archive
604
+ of the code. There are many ways you could offer source, and different
605
+ solutions will be better for different programs; see section 13 for the
606
+ specific requirements.
607
+
608
+ You should also get your employer (if you work as a programmer) or school,
609
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
610
+ For more information on this, and how to apply and follow the GNU AGPL, see
611
+ <https://www.gnu.org/licenses/>.
package/README.md ADDED
@@ -0,0 +1,118 @@
1
+ <!--
2
+ Get your module up and running quickly.
3
+
4
+ Find and replace all on all files (CMD+SHIFT+F):
5
+ - Name: Nuxstr Comments
6
+ - Package name: @threenine/nuxstr-comments
7
+ - Description: Nuxstr Comments
8
+ -->
9
+
10
+ # Nuxstr Comments
11
+
12
+ [![npm version][npm-version-src]][npm-version-href]
13
+ [![npm downloads][npm-downloads-src]][npm-downloads-href]
14
+ [![License][license-src]][license-href]
15
+ [![Nuxt][nuxt-src]][nuxt-href]
16
+
17
+ Nuxstr Comments for doing amazing things.
18
+
19
+ - [✨ &nbsp;Release Notes](/CHANGELOG.md)
20
+ <!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/@threenine/nuxstr-comments?file=playground%2Fapp.vue) -->
21
+ <!-- - [📖 &nbsp;Documentation](https://example.com) -->
22
+
23
+ ## Features
24
+
25
+ - Nostr-powered comments for Nuxt Content blog posts
26
+ - NIP-07 login prompt if user is not authenticated
27
+ - Comments are written in Markdown and rendered via @nuxt/content's ContentRendererMarkdown
28
+ - Configurable relay list and tagging strategy
29
+
30
+ ## Quick Setup
31
+
32
+ Install the module to your Nuxt application with one command:
33
+
34
+ ```bash
35
+ npx nuxi module add @threenine/nuxstr-comments
36
+ ```
37
+
38
+ That's it! You can now use Nuxstr Comments in your Nuxt app ✨
39
+
40
+ ### Usage
41
+
42
+ 1. Ensure @nuxt/content is enabled and your blog post pages use ContentDoc or render content files.
43
+ 2. Add the comments component where you want comments to appear (usually below a ContentDoc):
44
+
45
+ ```vue
46
+ <template>
47
+ <div>
48
+ <ContentDoc />
49
+ <NuxstrComments />
50
+ </div>
51
+ </template>
52
+ ```
53
+
54
+ By default, the component tags comments by the current route path (e.g., content:/blog/my-post) and fetches them from configured relays.
55
+
56
+ 3. Configuration (nuxt.config.ts):
57
+
58
+ ```ts
59
+ export default defineNuxtConfig({
60
+ modules: [
61
+ '@nuxt/content',
62
+ '@threenine/nuxstr-comments',
63
+ ],
64
+ nuxstrComments: {
65
+ relays: ['wss://relay.damus.io', 'wss://relay.nostr.band'],
66
+ tagStrategy: 'path',
67
+ tagPrefix: 'content:',
68
+ },
69
+ })
70
+ ```
71
+
72
+ When a user attempts to post, they will be prompted to log in with their Nostr browser extension (NIP-07). Comments are published as kind:1 notes tagged with a `t` tag containing the content tag (e.g., `content:/blog/my-post`). Rendering of comment bodies uses @nuxt/content's ContentRendererMarkdown component so users can write markdown.
73
+
74
+
75
+ ## Contribution
76
+
77
+ <details>
78
+ <summary>Local development</summary>
79
+
80
+ ```bash
81
+ # Install dependencies
82
+ npm install
83
+
84
+ # Generate type stubs
85
+ npm run dev:prepare
86
+
87
+ # Develop with the playground
88
+ npm run dev
89
+
90
+ # Build the playground
91
+ npm run dev:build
92
+
93
+ # Run ESLint
94
+ npm run lint
95
+
96
+ # Run Vitest
97
+ npm run test
98
+ npm run test:watch
99
+
100
+ # Release new version
101
+ npm run release
102
+ ```
103
+
104
+ </details>
105
+
106
+
107
+ <!-- Badges -->
108
+ [npm-version-src]: https://img.shields.io/npm/v/@threenine/nuxstr-comments/latest.svg?style=flat&colorA=020420&colorB=00DC82
109
+ [npm-version-href]: https://npmjs.com/package/@threenine/nuxstr-comments
110
+
111
+ [npm-downloads-src]: https://img.shields.io/npm/dm/@threenine/nuxstr-comments.svg?style=flat&colorA=020420&colorB=00DC82
112
+ [npm-downloads-href]: https://npm.chart.dev/@threenine/nuxstr-comments
113
+
114
+ [license-src]: https://img.shields.io/npm/l/@threenine/nuxstr-comments.svg?style=flat&colorA=020420&colorB=00DC82
115
+ [license-href]: https://npmjs.com/package/@threenine/nuxstr-comments
116
+
117
+ [nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js
118
+ [nuxt-href]: https://nuxt.com
@@ -0,0 +1,11 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+
3
+ interface ModuleOptions {
4
+ relays?: string[];
5
+ tagStrategy?: 'path' | 'id' | 'custom';
6
+ tagPrefix?: string;
7
+ }
8
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
9
+
10
+ export { _default as default };
11
+ export type { ModuleOptions };
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "@threenine/nuxstr-comments",
3
+ "configKey": "nuxstrComments",
4
+ "version": "1.0.0",
5
+ "builder": {
6
+ "@nuxt/module-builder": "1.0.2",
7
+ "unbuild": "3.6.1"
8
+ }
9
+ }
@@ -0,0 +1,30 @@
1
+ import { defineNuxtModule, createResolver, addPlugin, addImports, addComponent } from '@nuxt/kit';
2
+ import { defu } from 'defu';
3
+
4
+ const module = defineNuxtModule({
5
+ meta: {
6
+ name: "@threenine/nuxstr-comments",
7
+ configKey: "nuxstrComments"
8
+ },
9
+ // Default configuration options of the Nuxt module
10
+ defaults: {
11
+ relays: ["wss://relay.damus.io", "wss://relay.nostr.band", "wss://nos.lol"],
12
+ tagStrategy: "path",
13
+ tagPrefix: "comment:"
14
+ },
15
+ setup(options, nuxt) {
16
+ const resolver = createResolver(import.meta.url);
17
+ nuxt.options.runtimeConfig.public.nuxstrComments = defu(nuxt.options.runtimeConfig.public.nuxstrComments || {}, options);
18
+ addPlugin(resolver.resolve("./runtime/plugin"));
19
+ addImports([
20
+ { name: "useNuxstr", as: "useNuxstr", from: resolver.resolve("./runtime/composables/useNuxstr") },
21
+ { name: "useNuxstrComments", as: "useNuxstrComments", from: resolver.resolve("./runtime/composables/useNuxstrComments") }
22
+ ]);
23
+ addComponent({
24
+ name: "NuxstrComments",
25
+ filePath: resolver.resolve("./runtime/components/NuxstrComments.vue")
26
+ });
27
+ }
28
+ });
29
+
30
+ export { module as default };
@@ -0,0 +1,119 @@
1
+ <script setup>
2
+ import { ref, onMounted } from "vue";
3
+ import { useNuxstr } from "../composables/useNuxstr";
4
+ import { useNuxstrComments } from "../composables/useNuxstrComments";
5
+ const props = defineProps({
6
+ contentId: { type: String, required: false }
7
+ });
8
+ const { login, isLoggedIn } = useNuxstr();
9
+ const { comments, fetchComments, postComment, loading } = useNuxstrComments(props.contentId);
10
+ const comment = ref("");
11
+ onMounted(() => {
12
+ fetchComments();
13
+ });
14
+ async function handlePost() {
15
+ if (!comment.value.trim()) return;
16
+ const ok = await postComment(comment.value);
17
+ if (ok) comment.value = "";
18
+ }
19
+ function parseContent(html) {
20
+ return { body: createRoot(html) };
21
+ }
22
+ function createRoot(html) {
23
+ return {
24
+ type: "root",
25
+ children: [
26
+ {
27
+ type: "element",
28
+ tag: "div",
29
+ props: { innerHTML: html }
30
+ }
31
+ ]
32
+ };
33
+ }
34
+ </script>
35
+
36
+ <template>
37
+ <div class="nuxstr-comments space-y-4">
38
+ <div class="flex items-center justify-between">
39
+ <h3 class="text-lg font-semibold">
40
+ Comments
41
+ </h3>
42
+ <UButton
43
+ v-if="!isLoggedIn"
44
+ color="primary"
45
+ variant="solid"
46
+ leading-icon="game-icons:ostrich"
47
+ @click="login"
48
+ >
49
+ Login
50
+ </UButton>
51
+ </div>
52
+
53
+ <div
54
+ v-if="loading"
55
+ class="text-sm"
56
+ >
57
+ Loading comments…
58
+ </div>
59
+
60
+ <div
61
+ v-else
62
+ class="space-y-6"
63
+ >
64
+ <div
65
+ v-for="c in comments"
66
+ :key="c.id"
67
+ class="rounded border p-3 mt-2"
68
+ >
69
+ <div class="flex items-center gap-3 mb-3 mt-2">
70
+ <div
71
+ v-if="c.profile?.picture"
72
+ class="flex-shrink-0"
73
+ >
74
+ <UAvatar
75
+ :src="c.profile.picture"
76
+ :alt="c.profile.name || c.profile.display_name || 'User avatar'"
77
+ class="w-8 h-8 rounded-full object-cover"
78
+ />
79
+ </div>
80
+ <div class="flex-1 min-w-0">
81
+ <div class="truncate">
82
+ {{ c.profile?.display_name || c.profile?.name || `${c.pubkey.slice(0, 8)}\u2026` }}
83
+ <span class="text-xs">{{ new Date(c.created_at * 1e3).toLocaleString() }}</span>
84
+ </div>
85
+ </div>
86
+ </div>
87
+ <div class="prose prose-sm prose-invert mt-2">
88
+ <ContentRenderer :value="parseContent(c.content)" />
89
+ </div>
90
+ </div>
91
+ </div>
92
+
93
+ <div
94
+ v-if="isLoggedIn"
95
+ class="space-y-2"
96
+ >
97
+ <UTextarea
98
+ v-model="comment"
99
+ class="w-full"
100
+ placeholder="Write a comment ...."
101
+ :rows="4"
102
+ />
103
+ <div class="flex justify-end">
104
+ <UButton
105
+ color="primary"
106
+ variant="solid"
107
+ :disabled="!comment.trim()"
108
+ @click="handlePost"
109
+ >
110
+ Post Comment
111
+ </UButton>
112
+ </div>
113
+ </div>
114
+ </div>
115
+ </template>
116
+
117
+ <style scoped>
118
+ .nuxstr-comments :deep(pre){white-space:pre-wrap}
119
+ </style>
@@ -0,0 +1,5 @@
1
+ type __VLS_Props = {
2
+ contentId?: string;
3
+ };
4
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import NDK from '@nostr-dev-kit/ndk';
2
+ export declare function useNuxstr(): {
3
+ readonly ndk: NDK;
4
+ connect: () => Promise<NDK>;
5
+ login: () => Promise<void>;
6
+ logout: () => void;
7
+ isLoggedIn: import("vue").ComputedRef<boolean>;
8
+ pubkey: import("vue").Ref<string | null | undefined, string | null | undefined>;
9
+ };
@@ -0,0 +1,74 @@
1
+ import { computed, ref } from "vue";
2
+ import { useRuntimeConfig } from "#imports";
3
+ import NDK, { NDKNip07Signer } from "@nostr-dev-kit/ndk";
4
+ import { useToast } from "#ui/composables/useToast";
5
+ export function useNuxstr() {
6
+ const w = globalThis;
7
+ if (!w.__nuxstr) {
8
+ w.__nuxstr = {
9
+ ndk: null,
10
+ signer: null,
11
+ pubkey: ref(null),
12
+ isConnecting: ref(false),
13
+ isConnected: ref(false)
14
+ };
15
+ }
16
+ const state = w.__nuxstr;
17
+ const config = useRuntimeConfig();
18
+ const opts = config.public?.nuxstrComments || {};
19
+ function initializeNDK() {
20
+ if (!state.ndk) {
21
+ state.ndk = new NDK({ explicitRelayUrls: opts.relays || [] });
22
+ }
23
+ return state.ndk;
24
+ }
25
+ const isLoggedIn = computed(() => !!state.pubkey.value);
26
+ async function connect() {
27
+ const ndk = initializeNDK();
28
+ if (state.isConnected.value) return ndk;
29
+ if (state.isConnecting.value) return ndk;
30
+ state.isConnecting.value = true;
31
+ try {
32
+ await ndk.connect();
33
+ state.isConnected.value = true;
34
+ return ndk;
35
+ } finally {
36
+ state.isConnecting.value = false;
37
+ }
38
+ }
39
+ async function checkExtension() {
40
+ if ("nostr" in window) return true;
41
+ const toast = useToast();
42
+ toast.add({
43
+ title: "Nostr extension not found",
44
+ description: "NIP-07 browser extension not found. Install a Nostr extension like nos2x, Alby, or Coracle.",
45
+ icon: "game-icons:ostrich"
46
+ });
47
+ return false;
48
+ }
49
+ async function login() {
50
+ if (await checkExtension()) {
51
+ const ndk = initializeNDK();
52
+ const signer = new NDKNip07Signer();
53
+ ndk.signer = signer;
54
+ const user = await signer.user();
55
+ state.signer = signer;
56
+ state.pubkey.value = user.pubkey;
57
+ await connect();
58
+ }
59
+ }
60
+ function logout() {
61
+ state.signer = null;
62
+ state.pubkey.value = null;
63
+ }
64
+ return {
65
+ get ndk() {
66
+ return initializeNDK();
67
+ },
68
+ connect,
69
+ login,
70
+ logout,
71
+ isLoggedIn,
72
+ pubkey: state.pubkey
73
+ };
74
+ }
@@ -0,0 +1,33 @@
1
+ import type { NuxstrComment } from '~/src/runtime/types';
2
+ export declare function useNuxstrComments(customContentId?: string): {
3
+ loading: import("vue").Ref<boolean, boolean>;
4
+ error: import("vue").Ref<string | null, string | null>;
5
+ comments: import("vue").Ref<{
6
+ id: string;
7
+ pubkey: string;
8
+ created_at: number;
9
+ content: string;
10
+ profile?: {
11
+ name?: string | undefined;
12
+ display_name?: string | undefined;
13
+ about?: string | undefined;
14
+ picture?: string | undefined;
15
+ nip05?: string | undefined;
16
+ } | undefined;
17
+ }[], NuxstrComment[] | {
18
+ id: string;
19
+ pubkey: string;
20
+ created_at: number;
21
+ content: string;
22
+ profile?: {
23
+ name?: string | undefined;
24
+ display_name?: string | undefined;
25
+ about?: string | undefined;
26
+ picture?: string | undefined;
27
+ nip05?: string | undefined;
28
+ } | undefined;
29
+ }[]>;
30
+ isLoggedIn: import("vue").ComputedRef<boolean>;
31
+ fetchComments: () => Promise<void>;
32
+ postComment: (comment: string) => Promise<boolean>;
33
+ };
@@ -0,0 +1,86 @@
1
+ import { computed, ref } from "vue";
2
+ import { useRoute, useRuntimeConfig } from "#imports";
3
+ import { useNuxstr } from "./useNuxstr.js";
4
+ import { NDKEvent, NDKKind } from "@nostr-dev-kit/ndk";
5
+ export function useNuxstrComments(customContentId) {
6
+ const { ndk, connect, isLoggedIn } = useNuxstr();
7
+ const route = useRoute();
8
+ const config = useRuntimeConfig();
9
+ const opts = config.public?.nuxstrComments || {};
10
+ const loading = ref(false);
11
+ const error = ref(null);
12
+ const comments = ref([]);
13
+ const contentId = computed(() => {
14
+ if (customContentId) return customContentId;
15
+ return route.path;
16
+ });
17
+ function tagValue() {
18
+ const prefix = opts.tagPrefix || "comment:";
19
+ return `${prefix}${contentId.value}`;
20
+ }
21
+ async function fetchProfile(pubkey) {
22
+ try {
23
+ const filter = { kinds: [0], authors: [pubkey] };
24
+ const events = await ndk.fetchEvents(filter);
25
+ const latestEvent = Array.from(events).sort((a, b) => (b.created_at || 0) - (a.created_at || 0))[0];
26
+ if (!latestEvent?.content) return void 0;
27
+ const profileData = JSON.parse(latestEvent.content);
28
+ return {
29
+ name: profileData.name,
30
+ display_name: profileData.display_name,
31
+ about: profileData.about,
32
+ picture: profileData.picture,
33
+ nip05: profileData.nip05
34
+ };
35
+ } catch (error2) {
36
+ console.warn("Failed to fetch profile for", pubkey, error2);
37
+ return void 0;
38
+ }
39
+ }
40
+ async function fetchComments() {
41
+ loading.value = true;
42
+ error.value = null;
43
+ try {
44
+ await connect();
45
+ const filter = { kinds: [NDKKind.GenericReply], ["#t"]: [tagValue()] };
46
+ const events = await ndk.fetchEvents(filter);
47
+ const list = Array.from(events).sort((a, b) => (a.created_at || 0) - (b.created_at || 0));
48
+ const pubkeys = [...new Set(list.map((e) => e.pubkey))];
49
+ const profilePromises = pubkeys.map(async (pubkey) => {
50
+ const profile = await fetchProfile(pubkey);
51
+ return { pubkey, profile };
52
+ });
53
+ const profileResults = await Promise.all(profilePromises);
54
+ const profileMap = new Map(profileResults.map((r) => [r.pubkey, r.profile]));
55
+ comments.value = list.map((e) => ({
56
+ id: e.id,
57
+ pubkey: e.pubkey,
58
+ created_at: e.created_at || 0,
59
+ content: e.content,
60
+ profile: profileMap.get(e.pubkey)
61
+ }));
62
+ } catch (e) {
63
+ error.value = e?.message || String(e);
64
+ } finally {
65
+ loading.value = false;
66
+ }
67
+ }
68
+ async function postComment(comment) {
69
+ await connect();
70
+ const e = new NDKEvent(ndk);
71
+ e.kind = NDKKind.GenericReply;
72
+ e.content = comment;
73
+ e.tags = [
74
+ ["t", tagValue()]
75
+ ];
76
+ const ok = await e.publish().then(() => true).catch((err) => {
77
+ error.value = err?.message || String(err);
78
+ return false;
79
+ });
80
+ if (ok) {
81
+ await fetchComments();
82
+ }
83
+ return ok;
84
+ }
85
+ return { loading, error, comments, isLoggedIn, fetchComments, postComment };
86
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
2
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { defineNuxtPlugin } from "#app";
2
+ export default defineNuxtPlugin(() => {
3
+ });
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "../../../.nuxt/tsconfig.server.json",
3
+ }
@@ -0,0 +1,26 @@
1
+ export type NuxstrProfile = {
2
+ name?: string;
3
+ display_name?: string;
4
+ about?: string;
5
+ picture?: string;
6
+ nip05?: string;
7
+ };
8
+ export type NuxstrComment = {
9
+ id: string;
10
+ pubkey: string;
11
+ created_at: number;
12
+ content: string;
13
+ profile?: NuxstrProfile;
14
+ };
15
+ export interface ElementNode {
16
+ type: 'element';
17
+ tag: string;
18
+ props?: Record<string, unknown>;
19
+ }
20
+ export interface RootNode {
21
+ type: 'root';
22
+ children: ElementNode[];
23
+ }
24
+ export interface HtmlAst {
25
+ body: RootNode;
26
+ }
File without changes
@@ -0,0 +1,3 @@
1
+ export { default } from './module.mjs'
2
+
3
+ export { type ModuleOptions } from './module.mjs'
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@threenine/nuxstr-comments",
3
+ "version": "1.0.0",
4
+ "description": "Nuxstr Comments",
5
+ "repository": "threenine/nuxstr-comments",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/types.d.mts",
11
+ "import": "./dist/module.mjs"
12
+ }
13
+ },
14
+ "main": "./dist/module.mjs",
15
+ "typesVersions": {
16
+ "*": {
17
+ ".": [
18
+ "./dist/types.d.mts"
19
+ ]
20
+ }
21
+ },
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "dependencies": {
26
+ "@nostr-dev-kit/ndk": "^2.14.33",
27
+ "@nuxt/kit": "^4.0.3",
28
+ "nostr-tools": "^2.16.2",
29
+ "defu": "^6.1.4"
30
+ },
31
+ "devDependencies": {
32
+ "@nuxt/content": "3.6.3",
33
+ "@nuxt/devtools": "^2.6.2",
34
+ "@nuxt/eslint": "1.9.0",
35
+ "@nuxt/eslint-config": "^1.9.0",
36
+ "@nuxt/module-builder": "^1.0.2",
37
+ "@nuxt/schema": "^4.0.3",
38
+ "@nuxt/scripts": "0.11.10",
39
+ "@nuxt/test-utils": "^3.19.2",
40
+ "@nuxt/ui": "3.3.2",
41
+ "@testing-library/jest-dom": "^6.8.0",
42
+ "@testing-library/vue": "^8.1.0",
43
+ "@types/node": "latest",
44
+ "@unhead/vue": "^2.0.14",
45
+ "changelogen": "^0.6.2",
46
+ "eslint": "^9.33.0",
47
+ "jsdom": "^26.1.0",
48
+ "nuxt": "^4.0.3",
49
+ "typescript": "~5.9.2",
50
+ "vitest": "^3.2.4",
51
+ "vue-tsc": "^3.0.5"
52
+ },
53
+ "scripts": {
54
+ "dev": "npm run dev:prepare && nuxi dev playground",
55
+ "dev:build": "nuxi build playground",
56
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
57
+ "release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
58
+ "lint": "eslint .",
59
+ "test": "vitest run",
60
+ "test:watch": "vitest watch",
61
+ "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
62
+ }
63
+ }