spec-up-t 1.0.91 → 1.1.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.
Files changed (51) hide show
  1. package/assets/compiled/body.js +1 -1
  2. package/assets/compiled/head.css +1 -1
  3. package/assets/css/index.css +202 -150
  4. package/index.js +0 -3
  5. package/package.json +2 -1
  6. package/src/add-remove-xref-source.js +171 -0
  7. package/src/{get-xtrefs-data.js → collect-external-references.js} +13 -42
  8. package/src/collectExternalReferences/fetchTermsFromGitHubRepository.js +237 -0
  9. package/src/{get-xtrefs-data → collectExternalReferences}/matchTerm.js +4 -3
  10. package/src/collectExternalReferences/processXTrefsData.js +53 -0
  11. package/src/config/paths.js +1 -0
  12. package/src/configure.js +96 -0
  13. package/src/init.js +2 -8
  14. package/src/install-from-boilerplate/add-scripts-keys.js +48 -0
  15. package/src/install-from-boilerplate/boilerplate/.env.example +2 -0
  16. package/src/install-from-boilerplate/boilerplate/.github/workflows/fetch-and-push-xrefs.yml +42 -0
  17. package/src/install-from-boilerplate/boilerplate/.github/workflows/render-specs.yml +47 -0
  18. package/src/install-from-boilerplate/boilerplate/README.md +3 -0
  19. package/src/install-from-boilerplate/boilerplate/assets/test.json +5 -0
  20. package/src/install-from-boilerplate/boilerplate/assets/test.text +1 -0
  21. package/src/install-from-boilerplate/boilerplate/gitignore +10 -0
  22. package/src/install-from-boilerplate/boilerplate/help.txt +6 -0
  23. package/src/install-from-boilerplate/boilerplate/main.sh +103 -0
  24. package/src/install-from-boilerplate/boilerplate/spec/example-markup-in-markdown.md +384 -0
  25. package/src/install-from-boilerplate/boilerplate/spec/spec-body.md +3 -0
  26. package/src/install-from-boilerplate/boilerplate/spec/spec-head.md +7 -0
  27. package/src/install-from-boilerplate/boilerplate/spec/terms-and-definitions-intro.md +5 -0
  28. package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/term-1.md +13 -0
  29. package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/term-2.md +3 -0
  30. package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/term-3.md +3 -0
  31. package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/term-4.md +3 -0
  32. package/src/install-from-boilerplate/boilerplate/specs.json +41 -0
  33. package/src/install-from-boilerplate/boilerplate/static/favicon.ico +0 -0
  34. package/src/install-from-boilerplate/boilerplate/static/logo.svg +236 -0
  35. package/src/install-from-boilerplate/config-scripts-keys.js +16 -0
  36. package/src/install-from-boilerplate/copy-boilerplate.js +22 -0
  37. package/src/install-from-boilerplate/install.js +8 -0
  38. package/src/install-from-boilerplate/postinstall-message.js +15 -0
  39. package/src/prepare-tref.js +21 -4
  40. package/src/utils/doesUrlExist.js +18 -10
  41. package/src/utils/isLineWithDefinition.js +13 -0
  42. package/src/get-xtrefs-data/matchTerm.1.js +0 -23
  43. package/src/get-xtrefs-data/searchGitHubCode.1.js +0 -69
  44. package/src/get-xtrefs-data/searchGitHubCode.2.js +0 -77
  45. package/src/get-xtrefs-data/searchGitHubCode.3.js +0 -85
  46. package/src/get-xtrefs-data/searchGitHubCode.4.js +0 -92
  47. package/src/get-xtrefs-data/searchGitHubCode.5.js +0 -97
  48. package/src/get-xtrefs-data/searchGitHubCode.6.js +0 -101
  49. package/src/get-xtrefs-data/searchGitHubCode.js +0 -97
  50. /package/src/{get-xtrefs-data → collectExternalReferences}/checkRateLimit.js +0 -0
  51. /package/src/{get-xtrefs-data → collectExternalReferences}/setupFetchHeaders.js +0 -0
@@ -0,0 +1,236 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" id="svg3368" width="242.589" height="108.4" version="1.1">
2
+ <g id="g3355">
3
+ <style id="style2" type="text/css">
4
+ .st1 {
5
+ fill: #a9dde0
6
+ }
7
+
8
+ .st2 {
9
+ fill: #2589ca
10
+ }
11
+
12
+ .st3 {
13
+ fill: #3653a4
14
+ }
15
+ </style>
16
+ <g id="g187">
17
+ <radialGradient id="SVGID_1_" cx="-885.783" cy="352.247" r="3.374"
18
+ gradientTransform="translate(14279.635 -5602.752) scale(16.0596)" gradientUnits="userSpaceOnUse">
19
+ <stop id="stop12" offset="0" style="stop-color:#01579b" />
20
+ <stop id="stop14" offset="1" style="stop-color:#03a9f4" />
21
+ </radialGradient>
22
+ <path id="path17"
23
+ d="M54.5 64.4c-5.7 0-10.4-4.6-10.4-10.3 0-5.7 4.6-10.4 10.3-10.4 5.7 0 10.4 4.6 10.4 10.3 0 2.8-1.1 5.4-3 7.4s-4.5 3-7.3 3z"
24
+ style="fill:url(#SVGID_1_)" />
25
+ <radialGradient id="SVGID_2_" cx="-879.674" cy="358.976" r="3.72"
26
+ gradientTransform="matrix(14.5677 0 0 14.5676 12869.116 -5175.213)" gradientUnits="userSpaceOnUse">
27
+ <stop id="stop19" offset="0" style="stop-color:#01579b" />
28
+ <stop id="stop21" offset="1" style="stop-color:#03a9f4" />
29
+ </radialGradient>
30
+ <path id="path24"
31
+ d="M54.5 87.6c-3.8 0-7.2-2.3-8.7-5.8-1.5-3.5-.7-7.5 2-10.2 2.7-2.7 6.8-3.5 10.3-2 3.5 1.5 5.8 4.9 5.8 8.7 0 5.1-4.2 9.3-9.4 9.3z"
32
+ style="fill:url(#SVGID_2_)" />
33
+ <radialGradient id="SVGID_3_" cx="-877.914" cy="360.871" r="3.746"
34
+ gradientTransform="translate(12754.668 -5166.342) scale(14.4665)" gradientUnits="userSpaceOnUse">
35
+ <stop id="stop26" offset="0" style="stop-color:#01579b" />
36
+ <stop id="stop28" offset="1" style="stop-color:#03a9f4" />
37
+ </radialGradient>
38
+ <path id="path31"
39
+ d="M20.9 53.9c0-3.8 2.3-7.1 5.8-8.6s7.5-.6 10.2 2.1c2.7 2.7 3.4 6.7 1.9 10.2-1.5 3.5-4.9 5.7-8.7 5.7-2.5 0-4.9-1-6.6-2.8-1.7-1.7-2.7-4.1-2.6-6.6z"
40
+ style="fill:url(#SVGID_3_)" />
41
+ <radialGradient id="SVGID_4_" cx="-879.111" cy="362.735" r="3.826"
42
+ gradientTransform="translate(12504.983 -5083.149) scale(14.1628)" gradientUnits="userSpaceOnUse">
43
+ <stop id="stop33" offset="0" style="stop-color:#01579b" />
44
+ <stop id="stop35" offset="1" style="stop-color:#03a9f4" />
45
+ </radialGradient>
46
+ <path id="path38"
47
+ d="M87.7 54c0 5-4.1 9.1-9.2 9.1S69.4 59 69.4 54s4.1-9.1 9.2-9.1c2.4 0 4.8 1 6.5 2.7 1.7 1.7 2.7 4 2.6 6.4z"
48
+ style="fill:url(#SVGID_4_)" />
49
+ <radialGradient id="SVGID_5_" cx="-877.437" cy="364.531" r="3.847"
50
+ gradientTransform="matrix(14.0876 0 0 14.0877 12415.329 -5081.21)" gradientUnits="userSpaceOnUse">
51
+ <stop id="stop40" offset="0" style="stop-color:#01579b" />
52
+ <stop id="stop42" offset="1" style="stop-color:#03a9f4" />
53
+ </radialGradient>
54
+ <path id="path45"
55
+ d="M54.4 39.1c-5-.1-9-4.2-9-9.2.1-5 4.2-9 9.2-8.9 5 .1 9 4.2 9 9.2 0 2.4-1 4.7-2.7 6.4-1.7 1.6-4.1 2.5-6.5 2.5z"
56
+ style="fill:url(#SVGID_5_)" />
57
+ <radialGradient id="SVGID_6_" cx="-872.009" cy="367.059" r="4.074"
58
+ gradientTransform="translate(11654.73 -4828.824) scale(13.3031)" gradientUnits="userSpaceOnUse">
59
+ <stop id="stop47" offset="0" style="stop-color:#01579b" />
60
+ <stop id="stop49" offset="1" style="stop-color:#03a9f4" />
61
+ </radialGradient>
62
+ <path id="path52"
63
+ d="M30.2 86.8c-3.5 0-6.6-2.1-7.9-5.3-1.3-3.2-.6-6.9 1.9-9.3 2.5-2.4 6.2-3.2 9.4-1.8 3.2 1.3 5.3 4.5 5.3 7.9-.1 4.7-4 8.5-8.7 8.5z"
64
+ style="fill:url(#SVGID_6_)" />
65
+ <radialGradient id="SVGID_7_" cx="-873.457" cy="368.865" r="4.153"
66
+ gradientTransform="translate(11452.818 -4759.468) scale(13.0499)" gradientUnits="userSpaceOnUse">
67
+ <stop id="stop54" offset="0" style="stop-color:#01579b" />
68
+ <stop id="stop56" offset="1" style="stop-color:#03a9f4" />
69
+ </radialGradient>
70
+ <path id="path59"
71
+ d="M78.7 69.8c4.7 0 8.4 3.8 8.4 8.5 0 4.6-3.8 8.4-8.5 8.3-4.7 0-8.4-3.8-8.4-8.5.1-4.6 3.8-8.3 8.5-8.3z"
72
+ style="fill:url(#SVGID_7_)" />
73
+ <radialGradient id="SVGID_8_" cx="-870.149" cy="372.307" r="4.177"
74
+ gradientTransform="translate(11343.728 -4776.147) scale(12.9741)" gradientUnits="userSpaceOnUse">
75
+ <stop id="stop61" offset="0" style="stop-color:#01579b" />
76
+ <stop id="stop63" offset="1" style="stop-color:#03a9f4" />
77
+ </radialGradient>
78
+ <path id="path66"
79
+ d="M30.2 38.3c-4.6 0-8.4-3.8-8.4-8.4 0-4.6 3.8-8.3 8.4-8.3 4.6 0 8.4 3.8 8.4 8.4 0 4.6-3.8 8.3-8.4 8.3z"
80
+ style="fill:url(#SVGID_8_)" />
81
+ <radialGradient id="SVGID_9_" cx="-871.154" cy="374.866" r="4.285"
82
+ gradientTransform="translate(11070.364 -4686.093) scale(12.6453)" gradientUnits="userSpaceOnUse">
83
+ <stop id="stop68" offset="0" style="stop-color:#01579b" />
84
+ <stop id="stop70" offset="1" style="stop-color:#03a9f4" />
85
+ </radialGradient>
86
+ <path id="path73"
87
+ d="M86.8 30c0 4.5-3.7 8.1-8.2 8.1-4.5 0-8.2-3.6-8.2-8.1s3.7-8.1 8.2-8.1c4.5 0 8.1 3.6 8.2 8.1z"
88
+ style="fill:url(#SVGID_9_)" />
89
+ <radialGradient id="SVGID_10_" cx="-857.346" cy="386.195" r="4.983"
90
+ gradientTransform="translate(9377.96 -4145.677) scale(10.875)" gradientUnits="userSpaceOnUse">
91
+ <stop id="stop75" offset="0" style="stop-color:#01579b" />
92
+ <stop id="stop77" offset="1" style="stop-color:#03a9f4" />
93
+ </radialGradient>
94
+ <path id="path80"
95
+ d="M54.5 108.4c-3.9 0-7-3.1-7.1-6.9 0-3.9 3.1-7 7-7.1 3.9 0 7 3.1 7.1 6.9 0 1.9-.7 3.7-2 5-1.3 1.3-3.1 2.1-5 2.1z"
96
+ style="fill:url(#SVGID_10_)" />
97
+ <radialGradient id="SVGID_11_" cx="-853.967" cy="389.578" r="4.983"
98
+ gradientTransform="translate(9341.21 -4182.464) scale(10.875)" gradientUnits="userSpaceOnUse">
99
+ <stop id="stop82" offset="0" style="stop-color:#01579b" />
100
+ <stop id="stop84" offset="1" style="stop-color:#03a9f4" />
101
+ </radialGradient>
102
+ <path id="path87" d="M7 61c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7z" style="fill:url(#SVGID_11_)" />
103
+ <radialGradient id="SVGID_12_" cx="-852.267" cy="399.827" r="5.264"
104
+ gradientTransform="translate(8817.304 -4056.828) scale(10.282)" gradientUnits="userSpaceOnUse">
105
+ <stop id="stop89" offset="0" style="stop-color:#01579b" />
106
+ <stop id="stop91" offset="1" style="stop-color:#03a9f4" />
107
+ </radialGradient>
108
+ <path id="path94"
109
+ d="M54.5 0c1.8 0 3.5.6 4.8 1.9 1.3 1.2 2 3 1.9 4.7 0 2.4-1.3 4.6-3.3 5.7-2.1 1.2-4.6 1.2-6.6 0S47.9 9 47.9 6.6c0-1.8.7-3.5 1.9-4.7C51 .7 52.7 0 54.5 0Z"
110
+ style="fill:url(#SVGID_12_)" />
111
+ <radialGradient id="SVGID_13_" cx="-855.95" cy="396.104" r="5.264"
112
+ gradientTransform="translate(8865.556 -4023.343) scale(10.2941)" gradientUnits="userSpaceOnUse">
113
+ <stop id="stop96" offset="0" style="stop-color:#01579b" />
114
+ <stop id="stop98" offset="1" style="stop-color:#03a9f4" />
115
+ </radialGradient>
116
+ <path id="path101"
117
+ d="M102 47.4c3.7 0 6.6 3 6.6 6.6 0 3.7-3 6.6-6.6 6.6-3.6 0-6.6-3-6.6-6.6 0-1.8.7-3.5 1.9-4.7 1.3-1.3 3-2 4.7-1.9z"
118
+ style="fill:url(#SVGID_13_)" />
119
+ <radialGradient id="SVGID_14_" cx="-847.164" cy="396.76" r="5.452"
120
+ gradientTransform="translate(8474.734 -3889.398) scale(9.9395)" gradientUnits="userSpaceOnUse">
121
+ <stop id="stop103" offset="0" style="stop-color:#01579b" />
122
+ <stop id="stop105" offset="1" style="stop-color:#03a9f4" />
123
+ </radialGradient>
124
+ <path id="path108"
125
+ d="M30.2 95c2.6 0 4.9 1.6 5.9 4s.4 5.2-1.4 7c-1.8 1.8-4.6 2.4-7 1.4-2.4-1-4-3.3-3.9-5.9 0-1.7.7-3.3 1.9-4.5 1.2-1.2 2.8-2 4.5-2z"
126
+ style="fill:url(#SVGID_14_)" />
127
+ <radialGradient id="SVGID_15_" cx="-844.841" cy="399.227" r="5.48"
128
+ gradientTransform="translate(8408.668 -3893.643) scale(9.8887)" gradientUnits="userSpaceOnUse">
129
+ <stop id="stop110" offset="0" style="stop-color:#01579b" />
130
+ <stop id="stop112" offset="1" style="stop-color:#03a9f4" />
131
+ </radialGradient>
132
+ <path id="path115"
133
+ d="M6.9 84.4C3.4 84.4.5 81.5.5 78c0-3.5 2.9-6.4 6.4-6.3 3.5.1 6.4 2.9 6.4 6.4 0 1.7-.7 3.3-1.9 4.5-1.1 1.1-2.8 1.8-4.5 1.8z"
134
+ style="fill:url(#SVGID_15_)" />
135
+ <radialGradient id="SVGID_16_" cx="-848.468" cy="399.968" r="5.595"
136
+ gradientTransform="translate(8272.994 -3820.1) scale(9.6865)" gradientUnits="userSpaceOnUse">
137
+ <stop id="stop117" offset="0" style="stop-color:#01579b" />
138
+ <stop id="stop119" offset="1" style="stop-color:#03a9f4" />
139
+ </radialGradient>
140
+ <path id="path122"
141
+ d="M78.6 107.6c-3.4 0-6.2-2.8-6.2-6.3s2.8-6.2 6.3-6.2c3.4 0 6.2 2.8 6.2 6.3 0 1.7-.7 3.3-1.9 4.4-1.1 1.2-2.8 1.8-4.4 1.8z"
142
+ style="fill:url(#SVGID_16_)" />
143
+ <radialGradient id="SVGID_17_" cx="-842.011" cy="406.734" r="5.498"
144
+ gradientTransform="translate(8146.474 -3854.719) scale(9.6105)" gradientUnits="userSpaceOnUse">
145
+ <stop id="stop124" offset="0" style="stop-color:#01579b" />
146
+ <stop id="stop126" offset="1" style="stop-color:#03a9f4" />
147
+ </radialGradient>
148
+ <path id="path129"
149
+ d="M13.2 30c0 1.6-.6 3.2-1.8 4.4-1.2 1.2-2.8 1.8-4.4 1.8-2.3.1-4.5-1-5.6-3-1.1-2-1.2-4.4 0-6.4s3.3-3.1 5.6-3c1.7 0 3.2.6 4.4 1.8 1.1 1.2 1.8 2.8 1.8 4.4z"
150
+ style="fill:url(#SVGID_17_)" />
151
+ <radialGradient id="SVGID_18_" cx="-839.577" cy="414.251" r="5.815"
152
+ gradientTransform="translate(7799.596 -3767.348) scale(9.2252)" gradientUnits="userSpaceOnUse">
153
+ <stop id="stop131" offset="0" style="stop-color:#01579b" />
154
+ <stop id="stop133" offset="1" style="stop-color:#03a9f4" />
155
+ </radialGradient>
156
+ <path id="path136" d="M30.2.6c1.6 0 3.1.6 4.2 1.7s1.8 2.6 1.8 4.2c0 3.3-2.7 6-6 6s-6-2.7-6-6 2.7-5.9 6-5.9z"
157
+ style="fill:url(#SVGID_18_)" />
158
+ <radialGradient id="SVGID_19_" cx="-846.461" cy="407.039" r="5.822"
159
+ gradientTransform="translate(7932.355 -3734.11) scale(9.307)" gradientUnits="userSpaceOnUse">
160
+ <stop id="stop138" offset="0" style="stop-color:#01579b" />
161
+ <stop id="stop140" offset="1" style="stop-color:#03a9f4" />
162
+ </radialGradient>
163
+ <path id="path143"
164
+ d="M102.1 84.2c-3.3 0-6-2.7-6-6s2.6-6 6-6 6 2.6 6.1 5.9c0 1.6-.6 3.1-1.7 4.3-1.3 1.2-2.8 1.8-4.4 1.8z"
165
+ style="fill:url(#SVGID_19_)" />
166
+ <radialGradient id="SVGID_20_" cx="-843.42" cy="415.274" r="6.002"
167
+ gradientTransform="translate(7670.064 -3695.568) scale(9.0296)" gradientUnits="userSpaceOnUse">
168
+ <stop id="stop145" offset="0" style="stop-color:#01579b" />
169
+ <stop id="stop147" offset="1" style="stop-color:#03a9f4" />
170
+ </radialGradient>
171
+ <path id="path150"
172
+ d="M101.9 35.8c-2.4-.1-4.5-1.5-5.3-3.7-.8-2.2-.3-4.7 1.4-6.3 1.7-1.6 4.2-2 6.4-1.1 2.2 1 3.5 3.1 3.4 5.5 0 1.5-.7 3-1.8 4-1.1 1.1-2.6 1.7-4.1 1.6z"
173
+ style="fill:url(#SVGID_20_)" />
174
+ <radialGradient id="SVGID_21_" cx="-841.546" cy="417.095" r="5.994"
175
+ gradientTransform="translate(7663.091 -3716.93) scale(9.0414)" gradientUnits="userSpaceOnUse">
176
+ <stop id="stop152" offset="0" style="stop-color:#01579b" />
177
+ <stop id="stop154" offset="1" style="stop-color:#03a9f4" />
178
+ </radialGradient>
179
+ <path id="path157"
180
+ d="M84.4 6.7c0 3.2-2.6 5.8-5.8 5.8-3.2 0-5.8-2.6-5.8-5.8 0-3.2 2.6-5.8 5.8-5.8 3.2 0 5.8 2.5 5.8 5.8z"
181
+ style="fill:url(#SVGID_21_)" />
182
+ <radialGradient id="SVGID_22_" cx="-797.586" cy="455.396" r="8.056"
183
+ gradientTransform="translate(5420.165 -3009.524) scale(6.7276)" gradientUnits="userSpaceOnUse">
184
+ <stop id="stop159" offset="0" style="stop-color:#01579b" />
185
+ <stop id="stop161" offset="1" style="stop-color:#03a9f4" />
186
+ </radialGradient>
187
+ <path id="path164"
188
+ d="M11.4 101.4c0 2.4-1.9 4.3-4.3 4.3s-4.4-1.9-4.4-4.3S4.6 97.1 7 97c1.2 0 2.3.4 3.1 1.2.8.8 1.3 2 1.3 3.2z"
189
+ style="fill:url(#SVGID_22_)" />
190
+ <radialGradient id="SVGID_23_" cx="-796.17" cy="471.761" r="8.782"
191
+ gradientTransform="translate(4967.579 -2857.087) scale(6.1711)" gradientUnits="userSpaceOnUse">
192
+ <stop id="stop166" offset="0" style="stop-color:#01579b" />
193
+ <stop id="stop168" offset="1" style="stop-color:#03a9f4" />
194
+ </radialGradient>
195
+ <path id="path171"
196
+ d="M106 101.4c0 1.6-1 3.1-2.4 3.7-1.5.6-3.2.3-4.3-.9-1.1-1.1-1.5-2.8-.9-4.3s2.1-2.5 3.7-2.5c1.1 0 2.1.4 2.8 1.1.7.8 1.1 1.8 1.1 2.9z"
197
+ style="fill:url(#SVGID_23_)" />
198
+ <radialGradient id="SVGID_24_" cx="-780.865" cy="488.079" r="8.966"
199
+ gradientTransform="translate(4774.133 -2895.903) scale(6.0443)" gradientUnits="userSpaceOnUse">
200
+ <stop id="stop173" offset="0" style="stop-color:#01579b" />
201
+ <stop id="stop175" offset="1" style="stop-color:#03a9f4" />
202
+ </radialGradient>
203
+ <path id="path178"
204
+ d="M6.9 10.5C4.8 10.5 3 8.7 3 6.6c0-2.1 1.8-3.9 3.9-3.9 2.1 0 3.9 1.7 3.9 3.9 0 1-.4 2-1.2 2.8-.6.7-1.6 1.1-2.7 1.1Z"
205
+ style="fill:url(#SVGID_24_)" />
206
+ <radialGradient id="SVGID_25_" cx="-781.927" cy="503.72" r="9.652"
207
+ gradientTransform="translate(4458.785 -2783.157) scale(5.6328)" gradientUnits="userSpaceOnUse">
208
+ <stop id="stop180" offset="0" style="stop-color:#01579b" />
209
+ <stop id="stop182" offset="1" style="stop-color:#03a9f4" />
210
+ </radialGradient>
211
+ <path id="path185"
212
+ d="M102.1 10.2c-2 0-3.7-1.6-3.7-3.6 0-1.3.7-2.5 1.8-3.1 1.1-.6 2.5-.6 3.6 0s1.8 1.8 1.8 3.1c.1 2-1.5 3.6-3.5 3.6z"
213
+ style="fill:url(#SVGID_25_)" />
214
+ </g>
215
+ </g>
216
+ <g id="g3366" transform="translate(132.677) scale(.26157)">
217
+ <path id="path3224"
218
+ d="M272 10.313c13.6-7.8 25.9-8.5 34.7-3.1l98.6 57.4c.2.1.3.2.5.3-8.8-5.2-21.1-4.6-34.6 3.2l-177 101.8-173.7-101.1c-27.3-15.8-27.3-41.3 0-57 27.3-15.8 71.5-15.7 98.8 0l75.6 43.1 77.1-44.6"
219
+ class="st1" />
220
+ <path id="path3226"
221
+ d="M99.5 57.413c-16.4 9.4-42.9 9.4-59.3 0-16.4-9.5-16.4-24.8 0-34.2 16.4-9.4 42.9-9.4 59.3 0 16.4 9.5 16.4 24.8 0 34.2"
222
+ class="st2" />
223
+ <path id="path3228"
224
+ d="M295.2 312.113c0 15.8-5.5 27-14.3 32.2l-100.8 57.9s-.1 0-.1.1c8.8-5.3 14.3-16.4 14.3-32.2v-200.2l177-101.8c27-15.6 48.9-2.6 48.9 29s-21.9 69.9-48.9 85.5l-76.1 43.9z"
225
+ class="st3" />
226
+ <path id="path3230"
227
+ d="M341.9 142.313c0 19 13.1 26.8 29.3 17.4 16.2-9.4 29.3-32.3 29.3-51.3s-13.1-26.8-29.3-17.4c-16.1 9.3-29.3 32.3-29.3 51.3"
228
+ class="st1" />
229
+ <path id="path3232"
230
+ d="M96.5 313.513c0 31.6 21.9 69.9 48.9 85.5 27 15.6 48.9 2.6 48.9-29v-200.1L20.5 68.813C6.8 61.013 0 50.613 0 40.313v115.7c0 10.3 6.8 20.6 20.5 28.5l76 43.8z"
231
+ class="st2" />
232
+ <path id="path3234"
233
+ d="M174.7 358.713c0 19-13.1 26.8-29.3 17.4-16.2-9.4-29.3-32.3-29.3-51.3s13.1-26.8 29.3-17.4c16.2 9.3 29.3 32.3 29.3 51.3"
234
+ class="st3" />
235
+ </g>
236
+ </svg>
@@ -0,0 +1,16 @@
1
+ const configScriptsKeys = {
2
+ "edit": "node -e \"require('spec-up-t')()\"",
3
+ "render": "node --no-warnings -e \"require('spec-up-t/index.js')({ nowatch: true })\"",
4
+ "dev": "node -e \"require('spec-up-t')({ dev: true })\"",
5
+ "collectExternalReferencesCache": "node --no-warnings -e \"require('spec-up-t/src/collect-external-references.js').collectExternalReferences({cache: true})\"",
6
+ "collectExternalReferencesNoCache": "node --no-warnings -e \"require('spec-up-t/src/collect-external-references.js').collectExternalReferences({cache: false})\"",
7
+ "topdf": "node -e \"require('spec-up-t/src/create-pdf.js')\"",
8
+ "freeze": "node -e \"require('spec-up-t/src/freeze.js')\"",
9
+ "references": "node -e \"require('spec-up-t/src/references.js')\"",
10
+ "help": "cat help.txt",
11
+ "menu": "bash ./main.sh",
12
+ "addremovexrefsource": "node --no-warnings -e \"require('spec-up-t/src/add-remove-xref-source.js')\"",
13
+ "configure": "node --no-warnings -e \"require('spec-up-t/src/configure.js')\""
14
+ };
15
+
16
+ module.exports = { configScriptsKeys };
@@ -0,0 +1,22 @@
1
+ const fs = require('fs-extra');
2
+ const path = require('path');
3
+
4
+ function copyBoilerplate() {
5
+ const sourceDir = path.join(__dirname, './', 'boilerplate');
6
+ const items = fs.readdirSync(sourceDir);
7
+ items.forEach(item => {
8
+ const srcPath = path.join(sourceDir, item);
9
+ // Root of the project
10
+ const destPath = path.join(__dirname, '../../../../', item);
11
+ fs.cpSync(srcPath, destPath, { recursive: true });
12
+ });
13
+
14
+ // Rename the copied gitignore file to .gitignore
15
+ const gitignorePath = path.join(__dirname, '../../../../', 'gitignore');
16
+ const gitignoreDestPath = path.join(__dirname, '../../../../', '.gitignore');
17
+ fs.renameSync(gitignorePath, gitignoreDestPath);
18
+
19
+ console.log('✅ Copied spec-up-t-boilerplate to current directory.');
20
+ }
21
+
22
+ module.exports = copyBoilerplate;
@@ -0,0 +1,8 @@
1
+ const copyBoilerplate = require('./copy-boilerplate');
2
+ const { configScriptsKeys } = require('./config-scripts-keys');
3
+ const addScriptsKeys = require('./add-scripts-keys');
4
+
5
+ copyBoilerplate();
6
+ addScriptsKeys(configScriptsKeys);
7
+
8
+ require('./postinstall-message');
@@ -0,0 +1,15 @@
1
+ // load path module
2
+ const path = require('path');
3
+ // get current directory name
4
+ const dirName = path.basename(path.resolve(__dirname, '../../../../'));
5
+
6
+
7
+ process.nextTick(() => {
8
+ console.log(`
9
+ *************
10
+ Next:
11
+ * 1: Type the following and press ENTER: cd ${dirName}
12
+ * 2: Type the following and press ENTER: npm run menu
13
+ *************
14
+ `);
15
+ });
@@ -10,6 +10,7 @@
10
10
 
11
11
  const fs = require('fs');
12
12
  const path = require('path');
13
+ const dedent = require('dedent');
13
14
 
14
15
  function getLocalXTrefContent(externalSpec, term) {
15
16
  const filePath = path.join('output', 'xtrefs-data.json');
@@ -18,7 +19,14 @@ function getLocalXTrefContent(externalSpec, term) {
18
19
 
19
20
  for (const xtref of xtrefs) {
20
21
  if (xtref.externalSpec === externalSpec && xtref.term === term) {
21
- return {content: xtref.content, commitHash: xtref.commitHash};
22
+ return {
23
+ content: xtref.content,
24
+ commitHash: xtref.commitHash,
25
+ owner: xtref.owner,
26
+ repo: xtref.repo,
27
+ repoUrl: xtref.repoUrl,
28
+ avatarUrl: xtref.avatarUrl
29
+ };
22
30
  }
23
31
  }
24
32
 
@@ -67,7 +75,6 @@ function prepareTref(directory) {
67
75
  if (match) {
68
76
  const result = match[1].split(',').map(term => term.trim());
69
77
  localXTrefContent = getLocalXTrefContent(result[0], result[1]);
70
-
71
78
  /*
72
79
 
73
80
  Remove the `[[def: ...]]:` lines from the content.
@@ -85,12 +92,22 @@ function prepareTref(directory) {
85
92
 
86
93
  localXTrefContent.content = localXTrefContent.content.replace(defPart, '');
87
94
 
88
- fs.writeFileSync(itemPath, match[0] + '\n\n' + '<!-- This is a copy of the saved remote text. Remove it if you like. It is automatically (re)generated --><span class="transcluded-xref-term">transcluded xref</span>' + '\n\n~ Commit Hash: ' + localXTrefContent.commitHash + '\n\n\n' + localXTrefContent.content, 'utf8');
95
+ const readyForWrite = dedent`
96
+ ${match[0]}
97
+
98
+ <!-- This is a copy of the saved remote text. Remove it if you like. It is automatically (re)generated -->
99
+
100
+ ~ <span class="meta-info"><span>![avatar](${localXTrefContent.avatarUrl}) ${localXTrefContent.owner}</span> <span>[${localXTrefContent.repo}](${localXTrefContent.repoUrl})</span> <span class="commit-hash">Commit Hash: ${localXTrefContent.commitHash}</span></span>
101
+
102
+ ${localXTrefContent.content}
103
+ `;
104
+
105
+ fs.writeFileSync(itemPath, readyForWrite, 'utf8');
89
106
  }
90
107
  }
91
108
  }
92
109
  } catch (err) {
93
- fs.writeFileSync(itemPath, match[0] + '\n\n' + '<!-- This is a copy of the saved remote text. Remove it if you like. It is automatically (re)generated --> Nothing found, so nothing to show.', 'utf8');
110
+ fs.writeFileSync(itemPath, match[0] + '\n\n' + '<!-- This is a copy of the saved remote text. Remove it if you like. It is automatically (re)generated -->\n\nNothing found, so nothing to show.', 'utf8');
94
111
  // console.error(`\n SPEC-UP-T: Error reading or writing file ${item.name}: ${err}` + "\n");
95
112
  }
96
113
  }
@@ -1,15 +1,23 @@
1
- async function doesUrlExist(repo, termsDir) {
2
- const url = `${repo}/blob/main/${termsDir}`;
1
+ const axios = require('axios');
2
+
3
+ /**
4
+ * Checks if a URL returns a 200 status code.
5
+ * @param {string} url - The URL to check.
6
+ * @returns {Promise<boolean>} - True if the URL exists (200), false otherwise.
7
+ */
8
+ async function doesUrlExist(url) {
3
9
  try {
4
- const response = await fetch(url, { method: 'HEAD' });
5
- if (response.ok) {
6
- return true;
7
- } else {
8
- return false;
9
- }
10
+ const response = await axios.head(url, { timeout: 5000 });
11
+ return response.status === 200;
10
12
  } catch (error) {
11
- console.log('Error:', error);
13
+ if (error.response && error.response.status === 404) {
14
+ return false; // URL does not exist
15
+ }
16
+ if (error.code === 'ENOTFOUND' || error.code === 'ECONNABORTED') {
17
+ return false; // Network issues
18
+ }
19
+ return false; // Fail-safe return
12
20
  }
13
21
  }
14
22
 
15
- exports.doesUrlExist = doesUrlExist;
23
+ module.exports = { doesUrlExist };
@@ -0,0 +1,13 @@
1
+ async function isLineWithDefinition(line) {
2
+ line = line.trim();
3
+ // Check if the string starts with `[[def:` and ends with `]]`
4
+ if (line.startsWith('[[def:') && line.endsWith(']]')) {
5
+ // console.log('String starts with `[[def:` and ends with `]]`');
6
+ return true;
7
+ } else {
8
+ // console.log('String does not start with `[[def:` or end with `]]`');
9
+ return false;
10
+ }
11
+ }
12
+
13
+ exports.isLineWithDefinition = isLineWithDefinition;
@@ -1,23 +0,0 @@
1
- function matchTerm(text, term) {
2
- if (text && typeof text === 'string') {
3
- const firstLine = text.split('\n')[0].trim();
4
-
5
- // Check if the string starts with `[[def:` and ends with `]]`
6
- if (!firstLine.startsWith('[[def:') || !firstLine.endsWith(']]')) {
7
- console.log('String does not start with `[[def:` or end with `]]`');
8
- return false;
9
- }
10
-
11
- // Remove `[[def:` from the beginning and `]]` from the end
12
- let relevantPart = firstLine.slice(7, -2);
13
-
14
- // Split the string on `,` and trim the array elements
15
- let termsArray = relevantPart.split(',').map(term => term.trim());
16
-
17
- // Check if the term is in the array
18
- return termsArray.includes(term);
19
- } else {
20
- console.error('Invalid text:', text);
21
- }
22
- }
23
- exports.matchTerm = matchTerm;
@@ -1,69 +0,0 @@
1
- async function searchGitHubCode(GITHUB_API_TOKEN, searchString, owner, repo, subdirectory) {
2
- const { Octokit } = await import("octokit");
3
- const { throttling } = await import("@octokit/plugin-throttling");
4
-
5
- // Create a throttled Octokit instance
6
- const ThrottledOctokit = Octokit.plugin(throttling);
7
- const octokit = new ThrottledOctokit({
8
- auth: GITHUB_API_TOKEN,
9
- throttle: {
10
- onRateLimit: (retryAfter, options) => {
11
- console.warn(`Request quota exhausted for request ${options.method} ${options.url}`);
12
- if (options.request.retryCount <= 1) {
13
- console.log(`Retrying after ${retryAfter} seconds...`);
14
- return true;
15
- }
16
- },
17
- onAbuseLimit: (retryAfter, options) => {
18
- console.warn(`Abuse detected for request ${options.method} ${options.url}`);
19
- },
20
- onSecondaryRateLimit: (retryAfter, options) => {
21
- console.warn(`Secondary rate limit hit for request ${options.method} ${options.url}`);
22
- if (options.request.retryCount <= 1) {
23
- console.log(`Retrying after ${retryAfter} seconds...`);
24
- return true;
25
- }
26
- },
27
- },
28
- });
29
-
30
- try {
31
- // Perform the search using Octokit with exact match
32
- const searchResponse = await octokit.rest.search.code({
33
- // q: `${searchString} repo:${owner}/${repo}`, // Fuzzy search
34
- q: `"${searchString}" repo:${owner}/${repo} path:${subdirectory}`, // Use quotation marks for exact match
35
- // q: `"${searchString}" repo:${owner}/${repo} case:true`, // DOES NOT WORK Use quotation marks for exact match. Case sensitive search
36
- });
37
-
38
- // Log the search results
39
- console.log("Total results:", searchResponse.data.total_count);
40
-
41
- // const rateLimitResponse = await octokit.rest.rateLimit.get();
42
- // console.log("Rate limit:", rateLimitResponse.data);
43
-
44
- // Fetch the content of each file
45
- for (const item of searchResponse.data.items) {
46
- let content = "";
47
- const fileContentResponse = await octokit.rest.repos.getContent({
48
- owner: item.repository.owner.login, // Repository owner
49
- repo: item.repository.name, // Repository name
50
- path: item.path, // File path
51
- });
52
-
53
- // Decode the file content (it's base64-encoded)
54
- if (fileContentResponse.data.content) {
55
- content = Buffer.from(fileContentResponse.data.content, "base64").toString("utf-8");
56
- } else {
57
- // If the file is larger than 1 MB, GitHub's API will return a download URL instead of the content.
58
- console.log("File is too large. Download URL:", fileContentResponse.data.download_url);
59
- }
60
-
61
- item.content = content;
62
- }
63
- return searchResponse;
64
- } catch (error) {
65
- console.error("Error searching GitHub or fetching file content:", error);
66
- }
67
- }
68
-
69
- exports.searchGitHubCode = searchGitHubCode;
@@ -1,77 +0,0 @@
1
- async function searchGitHubCode(GITHUB_API_TOKEN, searchString, owner, repo, subdirectory) {
2
- const { Octokit } = await import("octokit");
3
- const { throttling } = await import("@octokit/plugin-throttling");
4
-
5
- // Create a throttled Octokit instance
6
- const ThrottledOctokit = Octokit.plugin(throttling);
7
- const octokit = new ThrottledOctokit({
8
- auth: GITHUB_API_TOKEN,
9
- throttle: {
10
- onRateLimit: (retryAfter, options) => {
11
- console.warn(`Request quota exhausted for request ${options.method} ${options.url}`);
12
- if (options.request.retryCount <= 1) {
13
- console.log(`Retrying after ${retryAfter} seconds...`);
14
- return true;
15
- }
16
- },
17
- onAbuseLimit: (retryAfter, options) => {
18
- console.warn(`Abuse detected for request ${options.method} ${options.url}`);
19
- },
20
- onSecondaryRateLimit: (retryAfter, options) => {
21
- console.warn(`Secondary rate limit hit for request ${options.method} ${options.url}`);
22
- if (options.request.retryCount <= 1) {
23
- console.log(`Retrying after ${retryAfter} seconds...`);
24
- return true;
25
- }
26
- },
27
- },
28
- });
29
-
30
- try {
31
- // Perform the search using Octokit with exact match
32
- const searchResponse = await octokit.rest.search.code({
33
- q: `"${searchString}" repo:${owner}/${repo} path:${subdirectory}`, // Exact match in subdirectory
34
- });
35
-
36
- // Log the search results
37
- console.log("Total results:", searchResponse.data.total_count);
38
-
39
- // Fetch the content of each file
40
- for (const item of searchResponse.data.items) {
41
- // Check if the match is in the first line using text_matches
42
- const isFirstLineMatch = item.text_matches.some(match =>
43
- match.fragment.split("\n")[0].includes(searchString)
44
- );
45
-
46
- if (!isFirstLineMatch) {
47
- console.log(`Skipping ${item.path}: Match not in the first line.`);
48
- continue; // Skip this file
49
- }
50
-
51
- // Fetch file content
52
- let content = "";
53
- const fileContentResponse = await octokit.rest.repos.getContent({
54
- owner: item.repository.owner.login, // Repository owner
55
- repo: item.repository.name, // Repository name
56
- path: item.path, // File path
57
- });
58
-
59
- // Decode the file content (it's base64-encoded)
60
- if (fileContentResponse.data.content) {
61
- content = Buffer.from(fileContentResponse.data.content, "base64").toString("utf-8");
62
- } else {
63
- // If the file is larger than 1 MB, GitHub's API will return a download URL instead of the content.
64
- console.log("File is too large. Download URL:", fileContentResponse.data.download_url);
65
- }
66
-
67
- // Attach the content to the item
68
- item.content = content;
69
- }
70
-
71
- return searchResponse;
72
- } catch (error) {
73
- console.error("Error searching GitHub or fetching file content:", error);
74
- }
75
- }
76
-
77
- exports.searchGitHubCode = searchGitHubCode;