rbtr-lang-javascript 2026.9.0.dev0__py3-none-any.whl

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.
Files changed (32) hide show
  1. rbtr_lang_javascript/__init__.py +1 -0
  2. rbtr_lang_javascript/javascript.scm +4 -0
  3. rbtr_lang_javascript/plugin.py +190 -0
  4. rbtr_lang_javascript/py.typed +0 -0
  5. rbtr_lang_javascript/shared.scm +29 -0
  6. rbtr_lang_javascript/tests/__init__.py +0 -0
  7. rbtr_lang_javascript/tests/__snapshots__/test_samples/test_edges_match_snapshot[javascript].json +4 -0
  8. rbtr_lang_javascript/tests/__snapshots__/test_samples/test_edges_match_snapshot[tsx].json +3 -0
  9. rbtr_lang_javascript/tests/__snapshots__/test_samples/test_edges_match_snapshot[typescript].json +6 -0
  10. rbtr_lang_javascript/tests/__snapshots__/test_samples/test_extraction_matches_snapshot[javascript].json +420 -0
  11. rbtr_lang_javascript/tests/__snapshots__/test_samples/test_extraction_matches_snapshot[tsx].json +211 -0
  12. rbtr_lang_javascript/tests/__snapshots__/test_samples/test_extraction_matches_snapshot[typescript].json +610 -0
  13. rbtr_lang_javascript/tests/cases_docstrings.py +225 -0
  14. rbtr_lang_javascript/tests/cases_extraction.py +429 -0
  15. rbtr_lang_javascript/tests/samples/javascript/config.js +2 -0
  16. rbtr_lang_javascript/tests/samples/javascript/javascript.js +46 -0
  17. rbtr_lang_javascript/tests/samples/javascript/styles.css +3 -0
  18. rbtr_lang_javascript/tests/samples/tsx/labels.ts +2 -0
  19. rbtr_lang_javascript/tests/samples/tsx/tsx.tsx +33 -0
  20. rbtr_lang_javascript/tests/samples/typescript/config.ts +2 -0
  21. rbtr_lang_javascript/tests/samples/typescript/types.ts +2 -0
  22. rbtr_lang_javascript/tests/samples/typescript/typescript.ts +68 -0
  23. rbtr_lang_javascript/tests/test_docstrings.py +51 -0
  24. rbtr_lang_javascript/tests/test_extraction.py +80 -0
  25. rbtr_lang_javascript/tests/test_samples.py +95 -0
  26. rbtr_lang_javascript/typescript.scm +36 -0
  27. rbtr_lang_javascript/variables.scm +54 -0
  28. rbtr_lang_javascript-2026.9.0.dev0.dist-info/METADATA +74 -0
  29. rbtr_lang_javascript-2026.9.0.dev0.dist-info/RECORD +32 -0
  30. rbtr_lang_javascript-2026.9.0.dev0.dist-info/WHEEL +4 -0
  31. rbtr_lang_javascript-2026.9.0.dev0.dist-info/entry_points.txt +5 -0
  32. rbtr_lang_javascript-2026.9.0.dev0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,610 @@
1
+ [
2
+ {
3
+ "blob_sha": "sha1",
4
+ "file_path": "config.ts",
5
+ "kind": "comment",
6
+ "name": "",
7
+ "scope": "",
8
+ "language": "typescript",
9
+ "file_language": "typescript",
10
+ "content": "// Locale configuration for the greeter.",
11
+ "line_start": 1,
12
+ "line_end": 1,
13
+ "metadata": {
14
+ "module": "",
15
+ "names": "",
16
+ "dots": "",
17
+ "language_hint": ""
18
+ },
19
+ "id": "b0eec444d8e60c22"
20
+ },
21
+ {
22
+ "blob_sha": "sha1",
23
+ "file_path": "config.ts",
24
+ "kind": "variable",
25
+ "name": "LOCALE",
26
+ "scope": "",
27
+ "language": "typescript",
28
+ "file_language": "typescript",
29
+ "content": "LOCALE = \"en\"",
30
+ "line_start": 2,
31
+ "line_end": 2,
32
+ "metadata": {
33
+ "module": "",
34
+ "names": "",
35
+ "dots": "",
36
+ "language_hint": ""
37
+ },
38
+ "id": "5f9edd7bad619288"
39
+ },
40
+ {
41
+ "blob_sha": "sha1",
42
+ "file_path": "types.ts",
43
+ "kind": "comment",
44
+ "name": "",
45
+ "scope": "",
46
+ "language": "typescript",
47
+ "file_language": "typescript",
48
+ "content": "// Shared greeter types.",
49
+ "line_start": 1,
50
+ "line_end": 1,
51
+ "metadata": {
52
+ "module": "",
53
+ "names": "",
54
+ "dots": "",
55
+ "language_hint": ""
56
+ },
57
+ "id": "b0eec444d8e60c22"
58
+ },
59
+ {
60
+ "blob_sha": "sha1",
61
+ "file_path": "types.ts",
62
+ "kind": "class",
63
+ "name": "Formatter",
64
+ "scope": "",
65
+ "language": "typescript",
66
+ "file_language": "typescript",
67
+ "content": "type Formatter = (name: string) => string;",
68
+ "line_start": 2,
69
+ "line_end": 2,
70
+ "metadata": {
71
+ "module": "",
72
+ "names": "",
73
+ "dots": "",
74
+ "language_hint": ""
75
+ },
76
+ "id": "2e0575e39be1d6e2"
77
+ },
78
+ {
79
+ "blob_sha": "sha1",
80
+ "file_path": "typescript.ts",
81
+ "kind": "comment",
82
+ "name": "",
83
+ "scope": "",
84
+ "language": "typescript",
85
+ "file_language": "typescript",
86
+ "content": "// Greeter — format greetings for named recipients.\n//\n// The TypeScript plugin extracts function declarations, arrow functions\n// bound to consts, classes, module variables, and imports, with\n// namespaces forming a scope. It also captures interfaces, enums, type\n// aliases, and abstract classes (all as classes), and class/interface\n// members as methods, including get/set accessors and abstract method\n// signatures.",
87
+ "line_start": 1,
88
+ "line_end": 8,
89
+ "metadata": {
90
+ "module": "",
91
+ "names": "",
92
+ "dots": "",
93
+ "language_hint": ""
94
+ },
95
+ "id": "f4410e2ed1c60de3"
96
+ },
97
+ {
98
+ "blob_sha": "sha1",
99
+ "file_path": "typescript.ts",
100
+ "kind": "import",
101
+ "name": "import { LOCALE } from \"./config\";",
102
+ "scope": "",
103
+ "language": "typescript",
104
+ "file_language": "typescript",
105
+ "content": "import { LOCALE } from \"./config\";",
106
+ "line_start": 10,
107
+ "line_end": 10,
108
+ "metadata": {
109
+ "module": "config",
110
+ "names": "LOCALE",
111
+ "dots": "1",
112
+ "language_hint": ""
113
+ },
114
+ "id": "54ff9600b7fb43ce"
115
+ },
116
+ {
117
+ "blob_sha": "sha1",
118
+ "file_path": "typescript.ts",
119
+ "kind": "import",
120
+ "name": "import type { Formatter } from \"./types\";",
121
+ "scope": "",
122
+ "language": "typescript",
123
+ "file_language": "typescript",
124
+ "content": "import type { Formatter } from \"./types\";",
125
+ "line_start": 11,
126
+ "line_end": 11,
127
+ "metadata": {
128
+ "module": "types",
129
+ "names": "Formatter",
130
+ "dots": "1",
131
+ "language_hint": ""
132
+ },
133
+ "id": "41f2d22ae2e87ce4"
134
+ },
135
+ {
136
+ "blob_sha": "sha1",
137
+ "file_path": "typescript.ts",
138
+ "kind": "variable",
139
+ "name": "DEFAULT_GREETING",
140
+ "scope": "",
141
+ "language": "typescript",
142
+ "file_language": "typescript",
143
+ "content": "DEFAULT_GREETING: string = \"Hello\"",
144
+ "line_start": 13,
145
+ "line_end": 13,
146
+ "metadata": {
147
+ "module": "",
148
+ "names": "",
149
+ "dots": "",
150
+ "language_hint": ""
151
+ },
152
+ "id": "ff20304e43bdbfaa"
153
+ },
154
+ {
155
+ "blob_sha": "sha1",
156
+ "file_path": "typescript.ts",
157
+ "kind": "comment",
158
+ "name": "",
159
+ "scope": "",
160
+ "language": "typescript",
161
+ "file_language": "typescript",
162
+ "content": "/** Tone of a greeting. */",
163
+ "line_start": 15,
164
+ "line_end": 15,
165
+ "metadata": {
166
+ "module": "",
167
+ "names": "",
168
+ "dots": "",
169
+ "language_hint": ""
170
+ },
171
+ "id": "f64407600d07d5d0"
172
+ },
173
+ {
174
+ "blob_sha": "sha1",
175
+ "file_path": "typescript.ts",
176
+ "kind": "class",
177
+ "name": "Tone",
178
+ "scope": "",
179
+ "language": "typescript",
180
+ "file_language": "typescript",
181
+ "content": "enum Tone {\n Formal,\n Casual,\n}",
182
+ "line_start": 16,
183
+ "line_end": 19,
184
+ "metadata": {
185
+ "module": "",
186
+ "names": "",
187
+ "dots": "",
188
+ "language_hint": ""
189
+ },
190
+ "id": "8926ce2eefea6fdc"
191
+ },
192
+ {
193
+ "blob_sha": "sha1",
194
+ "file_path": "typescript.ts",
195
+ "kind": "variable",
196
+ "name": "Formal",
197
+ "scope": "Tone",
198
+ "language": "typescript",
199
+ "file_language": "typescript",
200
+ "content": "Formal",
201
+ "line_start": 17,
202
+ "line_end": 17,
203
+ "metadata": {
204
+ "module": "",
205
+ "names": "",
206
+ "dots": "",
207
+ "language_hint": ""
208
+ },
209
+ "id": "ed03661cab8ecda0"
210
+ },
211
+ {
212
+ "blob_sha": "sha1",
213
+ "file_path": "typescript.ts",
214
+ "kind": "variable",
215
+ "name": "Casual",
216
+ "scope": "Tone",
217
+ "language": "typescript",
218
+ "file_language": "typescript",
219
+ "content": "Casual",
220
+ "line_start": 18,
221
+ "line_end": 18,
222
+ "metadata": {
223
+ "module": "",
224
+ "names": "",
225
+ "dots": "",
226
+ "language_hint": ""
227
+ },
228
+ "id": "61359ab45e8e5ea9"
229
+ },
230
+ {
231
+ "blob_sha": "sha1",
232
+ "file_path": "typescript.ts",
233
+ "kind": "comment",
234
+ "name": "",
235
+ "scope": "",
236
+ "language": "typescript",
237
+ "file_language": "typescript",
238
+ "content": "/** A function that formats a greeting for a name. */",
239
+ "line_start": 21,
240
+ "line_end": 21,
241
+ "metadata": {
242
+ "module": "",
243
+ "names": "",
244
+ "dots": "",
245
+ "language_hint": ""
246
+ },
247
+ "id": "c8c5c45a50394706"
248
+ },
249
+ {
250
+ "blob_sha": "sha1",
251
+ "file_path": "typescript.ts",
252
+ "kind": "class",
253
+ "name": "GreetingFn",
254
+ "scope": "",
255
+ "language": "typescript",
256
+ "file_language": "typescript",
257
+ "content": "type GreetingFn = (name: string) => string;",
258
+ "line_start": 22,
259
+ "line_end": 22,
260
+ "metadata": {
261
+ "module": "",
262
+ "names": "",
263
+ "dots": "",
264
+ "language_hint": ""
265
+ },
266
+ "id": "69b9646a1d8c1995"
267
+ },
268
+ {
269
+ "blob_sha": "sha1",
270
+ "file_path": "typescript.ts",
271
+ "kind": "comment",
272
+ "name": "",
273
+ "scope": "",
274
+ "language": "typescript",
275
+ "file_language": "typescript",
276
+ "content": "/** Format a greeting for a name. */",
277
+ "line_start": 24,
278
+ "line_end": 24,
279
+ "metadata": {
280
+ "module": "",
281
+ "names": "",
282
+ "dots": "",
283
+ "language_hint": ""
284
+ },
285
+ "id": "07ecb22e31eead78"
286
+ },
287
+ {
288
+ "blob_sha": "sha1",
289
+ "file_path": "typescript.ts",
290
+ "kind": "function",
291
+ "name": "formatGreeting",
292
+ "scope": "",
293
+ "language": "typescript",
294
+ "file_language": "typescript",
295
+ "content": "function formatGreeting(name: string): string {\n return `${DEFAULT_GREETING}, ${name} (${LOCALE})`;\n}",
296
+ "line_start": 25,
297
+ "line_end": 27,
298
+ "metadata": {
299
+ "module": "",
300
+ "names": "",
301
+ "dots": "",
302
+ "language_hint": ""
303
+ },
304
+ "id": "f2b7b3c9f62d2f45"
305
+ },
306
+ {
307
+ "blob_sha": "sha1",
308
+ "file_path": "typescript.ts",
309
+ "kind": "function",
310
+ "name": "cachedDefault",
311
+ "scope": "",
312
+ "language": "typescript",
313
+ "file_language": "typescript",
314
+ "content": "const cachedDefault = (): string => DEFAULT_GREETING;",
315
+ "line_start": 29,
316
+ "line_end": 29,
317
+ "metadata": {
318
+ "module": "",
319
+ "names": "",
320
+ "dots": "",
321
+ "language_hint": ""
322
+ },
323
+ "id": "7eef9204c8d20925"
324
+ },
325
+ {
326
+ "blob_sha": "sha1",
327
+ "file_path": "typescript.ts",
328
+ "kind": "comment",
329
+ "name": "",
330
+ "scope": "",
331
+ "language": "typescript",
332
+ "file_language": "typescript",
333
+ "content": "/** A greeting formatter contract. */",
334
+ "line_start": 31,
335
+ "line_end": 31,
336
+ "metadata": {
337
+ "module": "",
338
+ "names": "",
339
+ "dots": "",
340
+ "language_hint": ""
341
+ },
342
+ "id": "14b22aadb55ea7ac"
343
+ },
344
+ {
345
+ "blob_sha": "sha1",
346
+ "file_path": "typescript.ts",
347
+ "kind": "class",
348
+ "name": "Greeting",
349
+ "scope": "",
350
+ "language": "typescript",
351
+ "file_language": "typescript",
352
+ "content": "interface Greeting {\n text: string;\n format: Formatter;\n render(name: string): string;\n}",
353
+ "line_start": 32,
354
+ "line_end": 36,
355
+ "metadata": {
356
+ "module": "",
357
+ "names": "",
358
+ "dots": "",
359
+ "language_hint": ""
360
+ },
361
+ "id": "d0e4a2c5140f9837"
362
+ },
363
+ {
364
+ "blob_sha": "sha1",
365
+ "file_path": "typescript.ts",
366
+ "kind": "method",
367
+ "name": "render",
368
+ "scope": "Greeting",
369
+ "language": "typescript",
370
+ "file_language": "typescript",
371
+ "content": "render(name: string): string",
372
+ "line_start": 35,
373
+ "line_end": 35,
374
+ "metadata": {
375
+ "module": "",
376
+ "names": "",
377
+ "dots": "",
378
+ "language_hint": ""
379
+ },
380
+ "id": "d3d4f8403e85eb9c"
381
+ },
382
+ {
383
+ "blob_sha": "sha1",
384
+ "file_path": "typescript.ts",
385
+ "kind": "class",
386
+ "name": "AbstractGreeter",
387
+ "scope": "",
388
+ "language": "typescript",
389
+ "file_language": "typescript",
390
+ "content": "/** Base greeter defining the prefix contract. */\nabstract class AbstractGreeter {\n protected x: string = DEFAULT_GREETING;\n\n abstract greet(name: string): string;\n\n get prefix(): string {\n return this.x;\n }\n\n set prefix(value: string) {\n this.x = value;\n }\n}",
391
+ "line_start": 38,
392
+ "line_end": 51,
393
+ "metadata": {
394
+ "module": "",
395
+ "names": "",
396
+ "dots": "",
397
+ "language_hint": ""
398
+ },
399
+ "id": "890fe4a27edf3d3c"
400
+ },
401
+ {
402
+ "blob_sha": "sha1",
403
+ "file_path": "typescript.ts",
404
+ "kind": "method",
405
+ "name": "greet",
406
+ "scope": "AbstractGreeter",
407
+ "language": "typescript",
408
+ "file_language": "typescript",
409
+ "content": "abstract greet(name: string): string",
410
+ "line_start": 42,
411
+ "line_end": 42,
412
+ "metadata": {
413
+ "module": "",
414
+ "names": "",
415
+ "dots": "",
416
+ "language_hint": ""
417
+ },
418
+ "id": "3b001730462bbae2"
419
+ },
420
+ {
421
+ "blob_sha": "sha1",
422
+ "file_path": "typescript.ts",
423
+ "kind": "method",
424
+ "name": "prefix",
425
+ "scope": "AbstractGreeter",
426
+ "language": "typescript",
427
+ "file_language": "typescript",
428
+ "content": "get prefix(): string {\n return this.x;\n }",
429
+ "line_start": 44,
430
+ "line_end": 46,
431
+ "metadata": {
432
+ "module": "",
433
+ "names": "",
434
+ "dots": "",
435
+ "language_hint": ""
436
+ },
437
+ "id": "81d338b5d444b69a"
438
+ },
439
+ {
440
+ "blob_sha": "sha1",
441
+ "file_path": "typescript.ts",
442
+ "kind": "method",
443
+ "name": "prefix",
444
+ "scope": "AbstractGreeter",
445
+ "language": "typescript",
446
+ "file_language": "typescript",
447
+ "content": "set prefix(value: string) {\n this.x = value;\n }",
448
+ "line_start": 48,
449
+ "line_end": 50,
450
+ "metadata": {
451
+ "module": "",
452
+ "names": "",
453
+ "dots": "",
454
+ "language_hint": ""
455
+ },
456
+ "id": "cef81622d6b2bc7f"
457
+ },
458
+ {
459
+ "blob_sha": "sha1",
460
+ "file_path": "typescript.ts",
461
+ "kind": "comment",
462
+ "name": "",
463
+ "scope": "",
464
+ "language": "typescript",
465
+ "file_language": "typescript",
466
+ "content": "/** Stateful greeter holding a prefix. */",
467
+ "line_start": 53,
468
+ "line_end": 53,
469
+ "metadata": {
470
+ "module": "",
471
+ "names": "",
472
+ "dots": "",
473
+ "language_hint": ""
474
+ },
475
+ "id": "d644a19c79a741ec"
476
+ },
477
+ {
478
+ "blob_sha": "sha1",
479
+ "file_path": "typescript.ts",
480
+ "kind": "class",
481
+ "name": "Greeter",
482
+ "scope": "",
483
+ "language": "typescript",
484
+ "file_language": "typescript",
485
+ "content": "class Greeter extends AbstractGreeter {\n greet(name: string): string {\n return `${this.x}, ${name}`;\n }\n}",
486
+ "line_start": 54,
487
+ "line_end": 58,
488
+ "metadata": {
489
+ "module": "",
490
+ "names": "",
491
+ "dots": "",
492
+ "language_hint": ""
493
+ },
494
+ "id": "a87be9f79adf18c9"
495
+ },
496
+ {
497
+ "blob_sha": "sha1",
498
+ "file_path": "typescript.ts",
499
+ "kind": "method",
500
+ "name": "greet",
501
+ "scope": "Greeter",
502
+ "language": "typescript",
503
+ "file_language": "typescript",
504
+ "content": "greet(name: string): string {\n return `${this.x}, ${name}`;\n }",
505
+ "line_start": 55,
506
+ "line_end": 57,
507
+ "metadata": {
508
+ "module": "",
509
+ "names": "",
510
+ "dots": "",
511
+ "language_hint": ""
512
+ },
513
+ "id": "7e513d6aa6306610"
514
+ },
515
+ {
516
+ "blob_sha": "sha1",
517
+ "file_path": "typescript.ts",
518
+ "kind": "class",
519
+ "name": "util",
520
+ "scope": "",
521
+ "language": "typescript",
522
+ "file_language": "typescript",
523
+ "content": "namespace util {\n export function trim(value: string): string {\n return value.trim();\n }\n}",
524
+ "line_start": 60,
525
+ "line_end": 64,
526
+ "metadata": {
527
+ "module": "",
528
+ "names": "",
529
+ "dots": "",
530
+ "language_hint": ""
531
+ },
532
+ "id": "86b1469beecf8c96"
533
+ },
534
+ {
535
+ "blob_sha": "sha1",
536
+ "file_path": "typescript.ts",
537
+ "kind": "function",
538
+ "name": "trim",
539
+ "scope": "util",
540
+ "language": "typescript",
541
+ "file_language": "typescript",
542
+ "content": "function trim(value: string): string {\n return value.trim();\n }",
543
+ "line_start": 61,
544
+ "line_end": 63,
545
+ "metadata": {
546
+ "module": "",
547
+ "names": "",
548
+ "dots": "",
549
+ "language_hint": ""
550
+ },
551
+ "id": "bcab5fad63de22c9"
552
+ },
553
+ {
554
+ "blob_sha": "sha1",
555
+ "file_path": "typescript.ts",
556
+ "kind": "comment",
557
+ "name": "",
558
+ "scope": "",
559
+ "language": "typescript",
560
+ "file_language": "typescript",
561
+ "content": "// Re-exported so a consumer reaches these without naming their file.",
562
+ "line_start": 66,
563
+ "line_end": 66,
564
+ "metadata": {
565
+ "module": "",
566
+ "names": "",
567
+ "dots": "",
568
+ "language_hint": ""
569
+ },
570
+ "id": "c74ac4631f65977e"
571
+ },
572
+ {
573
+ "blob_sha": "sha1",
574
+ "file_path": "typescript.ts",
575
+ "kind": "import",
576
+ "name": "export { Locale } from \"./types\";",
577
+ "scope": "",
578
+ "language": "typescript",
579
+ "file_language": "typescript",
580
+ "content": "export { Locale } from \"./types\";",
581
+ "line_start": 67,
582
+ "line_end": 67,
583
+ "metadata": {
584
+ "module": "types",
585
+ "names": "",
586
+ "dots": "1",
587
+ "language_hint": ""
588
+ },
589
+ "id": "7086161a86e476e1"
590
+ },
591
+ {
592
+ "blob_sha": "sha1",
593
+ "file_path": "typescript.ts",
594
+ "kind": "import",
595
+ "name": "export * from \"./config\";",
596
+ "scope": "",
597
+ "language": "typescript",
598
+ "file_language": "typescript",
599
+ "content": "export * from \"./config\";",
600
+ "line_start": 68,
601
+ "line_end": 68,
602
+ "metadata": {
603
+ "module": "config",
604
+ "names": "",
605
+ "dots": "1",
606
+ "language_hint": ""
607
+ },
608
+ "id": "fbf278e7135316e2"
609
+ }
610
+ ]