whopper 0.5.4 → 0.5.7

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 (236) hide show
  1. package/README.md +12 -4
  2. package/dist/analyzer/apply.d.ts.map +1 -1
  3. package/dist/analyzer/apply.js +9 -15
  4. package/dist/analyzer/apply.js.map +1 -1
  5. package/dist/analyzer/apply.test.js +28 -7
  6. package/dist/analyzer/apply.test.js.map +1 -1
  7. package/dist/analyzer/match.d.ts +8 -4
  8. package/dist/analyzer/match.d.ts.map +1 -1
  9. package/dist/analyzer/match.js +19 -2
  10. package/dist/analyzer/match.js.map +1 -1
  11. package/dist/analyzer/match.test.js +46 -10
  12. package/dist/analyzer/match.test.js.map +1 -1
  13. package/dist/commands/active_scan_runner.d.ts.map +1 -1
  14. package/dist/commands/active_scan_runner.js +12 -4
  15. package/dist/commands/active_scan_runner.js.map +1 -1
  16. package/dist/commands/active_scan_runner.test.js +113 -3
  17. package/dist/commands/active_scan_runner.test.js.map +1 -1
  18. package/dist/main.js +0 -0
  19. package/dist/signatures/_types.d.ts +2 -2
  20. package/dist/signatures/_types.d.ts.map +1 -1
  21. package/dist/signatures/signatures.test.js +4 -2
  22. package/dist/signatures/signatures.test.js.map +1 -1
  23. package/dist/signatures/technologies/akismet.js +1 -1
  24. package/dist/signatures/technologies/akismet.js.map +1 -1
  25. package/dist/signatures/technologies/akismet.test.d.ts +2 -0
  26. package/dist/signatures/technologies/akismet.test.d.ts.map +1 -0
  27. package/dist/signatures/technologies/akismet.test.js +43 -0
  28. package/dist/signatures/technologies/akismet.test.js.map +1 -0
  29. package/dist/signatures/technologies/ant_design.js +3 -4
  30. package/dist/signatures/technologies/ant_design.js.map +1 -1
  31. package/dist/signatures/technologies/ant_design.test.d.ts +2 -0
  32. package/dist/signatures/technologies/ant_design.test.d.ts.map +1 -0
  33. package/dist/signatures/technologies/ant_design.test.js +156 -0
  34. package/dist/signatures/technologies/ant_design.test.js.map +1 -0
  35. package/dist/signatures/technologies/bootstrap.js +2 -2
  36. package/dist/signatures/technologies/bootstrap.js.map +1 -1
  37. package/dist/signatures/technologies/bootstrap.test.js +59 -0
  38. package/dist/signatures/technologies/bootstrap.test.js.map +1 -1
  39. package/dist/signatures/technologies/cart_functionality.js +8 -8
  40. package/dist/signatures/technologies/cart_functionality.js.map +1 -1
  41. package/dist/signatures/technologies/cart_functionality.test.d.ts +2 -0
  42. package/dist/signatures/technologies/cart_functionality.test.d.ts.map +1 -0
  43. package/dist/signatures/technologies/cart_functionality.test.js +109 -0
  44. package/dist/signatures/technologies/cart_functionality.test.js.map +1 -0
  45. package/dist/signatures/technologies/colibri_wp.js +1 -1
  46. package/dist/signatures/technologies/colibri_wp.js.map +1 -1
  47. package/dist/signatures/technologies/colibri_wp.test.d.ts +2 -0
  48. package/dist/signatures/technologies/colibri_wp.test.d.ts.map +1 -0
  49. package/dist/signatures/technologies/colibri_wp.test.js +43 -0
  50. package/dist/signatures/technologies/colibri_wp.test.js.map +1 -0
  51. package/dist/signatures/technologies/cs_cart.js +1 -1
  52. package/dist/signatures/technologies/cs_cart.js.map +1 -1
  53. package/dist/signatures/technologies/cs_cart.test.d.ts +2 -0
  54. package/dist/signatures/technologies/cs_cart.test.d.ts.map +1 -0
  55. package/dist/signatures/technologies/cs_cart.test.js +43 -0
  56. package/dist/signatures/technologies/cs_cart.test.js.map +1 -0
  57. package/dist/signatures/technologies/cyberchimps_responsive.js +2 -2
  58. package/dist/signatures/technologies/cyberchimps_responsive.js.map +1 -1
  59. package/dist/signatures/technologies/cyberchimps_responsive.test.d.ts +2 -0
  60. package/dist/signatures/technologies/cyberchimps_responsive.test.d.ts.map +1 -0
  61. package/dist/signatures/technologies/cyberchimps_responsive.test.js +54 -0
  62. package/dist/signatures/technologies/cyberchimps_responsive.test.js.map +1 -0
  63. package/dist/signatures/technologies/elementor_header_footer_builder.js +1 -1
  64. package/dist/signatures/technologies/elementor_header_footer_builder.js.map +1 -1
  65. package/dist/signatures/technologies/elementor_header_footer_builder.test.d.ts +2 -0
  66. package/dist/signatures/technologies/elementor_header_footer_builder.test.d.ts.map +1 -0
  67. package/dist/signatures/technologies/elementor_header_footer_builder.test.js +43 -0
  68. package/dist/signatures/technologies/elementor_header_footer_builder.test.js.map +1 -0
  69. package/dist/signatures/technologies/essential_addons_for_elementor.js +1 -1
  70. package/dist/signatures/technologies/essential_addons_for_elementor.js.map +1 -1
  71. package/dist/signatures/technologies/essential_addons_for_elementor.test.d.ts +2 -0
  72. package/dist/signatures/technologies/essential_addons_for_elementor.test.d.ts.map +1 -0
  73. package/dist/signatures/technologies/essential_addons_for_elementor.test.js +43 -0
  74. package/dist/signatures/technologies/essential_addons_for_elementor.test.js.map +1 -0
  75. package/dist/signatures/technologies/flying_pages.js +1 -1
  76. package/dist/signatures/technologies/flying_pages.js.map +1 -1
  77. package/dist/signatures/technologies/flying_pages.test.d.ts +2 -0
  78. package/dist/signatures/technologies/flying_pages.test.d.ts.map +1 -0
  79. package/dist/signatures/technologies/flying_pages.test.js +43 -0
  80. package/dist/signatures/technologies/flying_pages.test.js.map +1 -0
  81. package/dist/signatures/technologies/formidable_form.js +1 -1
  82. package/dist/signatures/technologies/formidable_form.js.map +1 -1
  83. package/dist/signatures/technologies/formidable_form.test.d.ts +2 -0
  84. package/dist/signatures/technologies/formidable_form.test.d.ts.map +1 -0
  85. package/dist/signatures/technologies/formidable_form.test.js +43 -0
  86. package/dist/signatures/technologies/formidable_form.test.js.map +1 -0
  87. package/dist/signatures/technologies/godaddy_coblocks.js +1 -1
  88. package/dist/signatures/technologies/godaddy_coblocks.js.map +1 -1
  89. package/dist/signatures/technologies/godaddy_coblocks.test.d.ts +2 -0
  90. package/dist/signatures/technologies/godaddy_coblocks.test.d.ts.map +1 -0
  91. package/dist/signatures/technologies/godaddy_coblocks.test.js +43 -0
  92. package/dist/signatures/technologies/godaddy_coblocks.test.js.map +1 -0
  93. package/dist/signatures/technologies/gtranslate.js +2 -2
  94. package/dist/signatures/technologies/gtranslate.js.map +1 -1
  95. package/dist/signatures/technologies/gtranslate.test.d.ts +2 -0
  96. package/dist/signatures/technologies/gtranslate.test.d.ts.map +1 -0
  97. package/dist/signatures/technologies/gtranslate.test.js +65 -0
  98. package/dist/signatures/technologies/gtranslate.test.js.map +1 -0
  99. package/dist/signatures/technologies/intercom.js +1 -1
  100. package/dist/signatures/technologies/intercom.js.map +1 -1
  101. package/dist/signatures/technologies/intercom.test.d.ts +2 -0
  102. package/dist/signatures/technologies/intercom.test.d.ts.map +1 -0
  103. package/dist/signatures/technologies/intercom.test.js +54 -0
  104. package/dist/signatures/technologies/intercom.test.js.map +1 -0
  105. package/dist/signatures/technologies/jetpack.js +1 -1
  106. package/dist/signatures/technologies/jetpack.js.map +1 -1
  107. package/dist/signatures/technologies/jetpack.test.d.ts +2 -0
  108. package/dist/signatures/technologies/jetpack.test.d.ts.map +1 -0
  109. package/dist/signatures/technologies/jetpack.test.js +43 -0
  110. package/dist/signatures/technologies/jetpack.test.js.map +1 -0
  111. package/dist/signatures/technologies/lodash.d.ts.map +1 -1
  112. package/dist/signatures/technologies/lodash.js +21 -3
  113. package/dist/signatures/technologies/lodash.js.map +1 -1
  114. package/dist/signatures/technologies/lodash.test.js +35 -5
  115. package/dist/signatures/technologies/lodash.test.js.map +1 -1
  116. package/dist/signatures/technologies/machothemes_newsmag.js +1 -1
  117. package/dist/signatures/technologies/machothemes_newsmag.js.map +1 -1
  118. package/dist/signatures/technologies/machothemes_newsmag.test.d.ts +2 -0
  119. package/dist/signatures/technologies/machothemes_newsmag.test.d.ts.map +1 -0
  120. package/dist/signatures/technologies/machothemes_newsmag.test.js +43 -0
  121. package/dist/signatures/technologies/machothemes_newsmag.test.js.map +1 -0
  122. package/dist/signatures/technologies/magento.js +2 -2
  123. package/dist/signatures/technologies/magento.js.map +1 -1
  124. package/dist/signatures/technologies/magento.test.js +3 -3
  125. package/dist/signatures/technologies/magento.test.js.map +1 -1
  126. package/dist/signatures/technologies/opencart.js +1 -1
  127. package/dist/signatures/technologies/opencart.js.map +1 -1
  128. package/dist/signatures/technologies/opencart.test.d.ts +2 -0
  129. package/dist/signatures/technologies/opencart.test.d.ts.map +1 -0
  130. package/dist/signatures/technologies/opencart.test.js +43 -0
  131. package/dist/signatures/technologies/opencart.test.js.map +1 -0
  132. package/dist/signatures/technologies/php.d.ts.map +1 -1
  133. package/dist/signatures/technologies/php.js +9 -0
  134. package/dist/signatures/technologies/php.js.map +1 -1
  135. package/dist/signatures/technologies/php.test.d.ts +2 -0
  136. package/dist/signatures/technologies/php.test.d.ts.map +1 -0
  137. package/dist/signatures/technologies/php.test.js +119 -0
  138. package/dist/signatures/technologies/php.test.js.map +1 -0
  139. package/dist/signatures/technologies/salesforce_desk.js +1 -1
  140. package/dist/signatures/technologies/salesforce_desk.js.map +1 -1
  141. package/dist/signatures/technologies/salesforce_desk.test.d.ts +2 -0
  142. package/dist/signatures/technologies/salesforce_desk.test.d.ts.map +1 -0
  143. package/dist/signatures/technologies/salesforce_desk.test.js +43 -0
  144. package/dist/signatures/technologies/salesforce_desk.test.js.map +1 -0
  145. package/dist/signatures/technologies/seedprod_coming_soon.js +1 -1
  146. package/dist/signatures/technologies/seedprod_coming_soon.js.map +1 -1
  147. package/dist/signatures/technologies/seedprod_coming_soon.test.d.ts +2 -0
  148. package/dist/signatures/technologies/seedprod_coming_soon.test.d.ts.map +1 -0
  149. package/dist/signatures/technologies/seedprod_coming_soon.test.js +43 -0
  150. package/dist/signatures/technologies/seedprod_coming_soon.test.js.map +1 -0
  151. package/dist/signatures/technologies/svg_support.js +1 -1
  152. package/dist/signatures/technologies/svg_support.js.map +1 -1
  153. package/dist/signatures/technologies/svg_support.test.d.ts +2 -0
  154. package/dist/signatures/technologies/svg_support.test.d.ts.map +1 -0
  155. package/dist/signatures/technologies/svg_support.test.js +43 -0
  156. package/dist/signatures/technologies/svg_support.test.js.map +1 -0
  157. package/dist/signatures/technologies/swiper.js +1 -1
  158. package/dist/signatures/technologies/swiper.js.map +1 -1
  159. package/dist/signatures/technologies/swiper.test.d.ts +2 -0
  160. package/dist/signatures/technologies/swiper.test.d.ts.map +1 -0
  161. package/dist/signatures/technologies/swiper.test.js +69 -0
  162. package/dist/signatures/technologies/swiper.test.js.map +1 -0
  163. package/dist/signatures/technologies/tailwind_css.js +2 -2
  164. package/dist/signatures/technologies/tailwind_css.js.map +1 -1
  165. package/dist/signatures/technologies/tailwind_css.test.js +11 -0
  166. package/dist/signatures/technologies/tailwind_css.test.js.map +1 -1
  167. package/dist/signatures/technologies/the_events_calendar.js +1 -1
  168. package/dist/signatures/technologies/the_events_calendar.js.map +1 -1
  169. package/dist/signatures/technologies/the_events_calendar.test.d.ts +2 -0
  170. package/dist/signatures/technologies/the_events_calendar.test.d.ts.map +1 -0
  171. package/dist/signatures/technologies/the_events_calendar.test.js +43 -0
  172. package/dist/signatures/technologies/the_events_calendar.test.js.map +1 -0
  173. package/dist/signatures/technologies/underscore_js.d.ts.map +1 -1
  174. package/dist/signatures/technologies/underscore_js.js +5 -3
  175. package/dist/signatures/technologies/underscore_js.js.map +1 -1
  176. package/dist/signatures/technologies/underscore_js.test.js +12 -2
  177. package/dist/signatures/technologies/underscore_js.test.js.map +1 -1
  178. package/dist/signatures/technologies/webfactory_maintenance.js +1 -1
  179. package/dist/signatures/technologies/webfactory_maintenance.js.map +1 -1
  180. package/dist/signatures/technologies/webfactory_maintenance.test.d.ts +2 -0
  181. package/dist/signatures/technologies/webfactory_maintenance.test.d.ts.map +1 -0
  182. package/dist/signatures/technologies/webfactory_maintenance.test.js +43 -0
  183. package/dist/signatures/technologies/webfactory_maintenance.test.js.map +1 -0
  184. package/dist/signatures/technologies/woocommerce_stripe_payment_gateway.js +1 -1
  185. package/dist/signatures/technologies/woocommerce_stripe_payment_gateway.js.map +1 -1
  186. package/dist/signatures/technologies/woocommerce_stripe_payment_gateway.test.d.ts +2 -0
  187. package/dist/signatures/technologies/woocommerce_stripe_payment_gateway.test.d.ts.map +1 -0
  188. package/dist/signatures/technologies/woocommerce_stripe_payment_gateway.test.js +43 -0
  189. package/dist/signatures/technologies/woocommerce_stripe_payment_gateway.test.js.map +1 -0
  190. package/dist/signatures/technologies/wp_statistics.js +1 -1
  191. package/dist/signatures/technologies/wp_statistics.js.map +1 -1
  192. package/dist/signatures/technologies/wp_statistics.test.d.ts +2 -0
  193. package/dist/signatures/technologies/wp_statistics.test.d.ts.map +1 -0
  194. package/dist/signatures/technologies/wp_statistics.test.js +43 -0
  195. package/dist/signatures/technologies/wp_statistics.test.js.map +1 -0
  196. package/package.json +8 -2
  197. package/dist/analyzer/util.d.ts +0 -3
  198. package/dist/analyzer/util.d.ts.map +0 -1
  199. package/dist/analyzer/util.js +0 -10
  200. package/dist/analyzer/util.js.map +0 -1
  201. package/dist/commands/hello.d.ts +0 -3
  202. package/dist/commands/hello.d.ts.map +0 -1
  203. package/dist/commands/hello.js +0 -12
  204. package/dist/commands/hello.js.map +0 -1
  205. package/dist/commands/version.d.ts +0 -3
  206. package/dist/commands/version.d.ts.map +0 -1
  207. package/dist/commands/version.js +0 -10
  208. package/dist/commands/version.js.map +0 -1
  209. package/dist/commands/version.test.d.ts +0 -2
  210. package/dist/commands/version.test.d.ts.map +0 -1
  211. package/dist/commands/version.test.js +0 -27
  212. package/dist/commands/version.test.js.map +0 -1
  213. package/dist/detector/index.d.ts +0 -5
  214. package/dist/detector/index.d.ts.map +0 -1
  215. package/dist/detector/index.js +0 -16
  216. package/dist/detector/index.js.map +0 -1
  217. package/dist/detector/matcher.d.ts +0 -5
  218. package/dist/detector/matcher.d.ts.map +0 -1
  219. package/dist/detector/matcher.js +0 -50
  220. package/dist/detector/matcher.js.map +0 -1
  221. package/dist/detector/types.d.ts +0 -10
  222. package/dist/detector/types.d.ts.map +0 -1
  223. package/dist/detector/types.js +0 -2
  224. package/dist/detector/types.js.map +0 -1
  225. package/dist/signatures/nginx.d.ts +0 -3
  226. package/dist/signatures/nginx.d.ts.map +0 -1
  227. package/dist/signatures/nginx.js +0 -12
  228. package/dist/signatures/nginx.js.map +0 -1
  229. package/dist/signatures/technologies/microsoft_asp.d.ts +0 -3
  230. package/dist/signatures/technologies/microsoft_asp.d.ts.map +0 -1
  231. package/dist/signatures/technologies/microsoft_asp.js +0 -20
  232. package/dist/signatures/technologies/microsoft_asp.js.map +0 -1
  233. package/dist/signatures/technologies/spiwer.d.ts +0 -3
  234. package/dist/signatures/technologies/spiwer.d.ts.map +0 -1
  235. package/dist/signatures/technologies/spiwer.js +0 -10
  236. package/dist/signatures/technologies/spiwer.js.map +0 -1
@@ -0,0 +1,69 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import { applySignature } from "../../analyzer/apply.js";
3
+ import { swiperSignature } from "./swiper.js";
4
+ function createMockContext(overrides = {}) {
5
+ return {
6
+ browser: {},
7
+ page: {},
8
+ urls: [],
9
+ responses: [],
10
+ cookies: [],
11
+ javascriptVariables: {},
12
+ timeoutMs: 30000,
13
+ timeoutOccurred: false,
14
+ ...overrides,
15
+ };
16
+ }
17
+ function createMockResponse(overrides = {}) {
18
+ return {
19
+ url: "https://example.com",
20
+ host: "example.com",
21
+ isFirstParty: true,
22
+ status: 200,
23
+ headers: { "content-type": "text/html" },
24
+ body: "",
25
+ ...overrides,
26
+ };
27
+ }
28
+ describe("swiperSignature", () => {
29
+ describe("body matching", () => {
30
+ it("detects Swiper from the version banner comment", () => {
31
+ const context = createMockContext({
32
+ responses: [
33
+ createMockResponse({
34
+ body: "/**\n * Swiper 11.1.14\n * Most modern mobile touch slider\n */",
35
+ }),
36
+ ],
37
+ });
38
+ const result = applySignature(context, swiperSignature);
39
+ expect(result).toBeDefined();
40
+ expect(result?.evidences?.some((e) => e.version === "11.1.14")).toBe(true);
41
+ });
42
+ it("does not detect Swiper from prose that merely mentions the product name", () => {
43
+ const context = createMockContext({
44
+ responses: [
45
+ createMockResponse({
46
+ body: "<p>We compared Swiper and other carousel libraries on our blog.</p>",
47
+ }),
48
+ ],
49
+ });
50
+ const result = applySignature(context, swiperSignature);
51
+ expect(result).toBeUndefined();
52
+ });
53
+ });
54
+ describe("URL matching", () => {
55
+ it("detects Swiper from CDN URL with version", () => {
56
+ const context = createMockContext({
57
+ responses: [
58
+ createMockResponse({
59
+ url: "https://cdn.example.com/swiper@11.1.14/swiper-bundle.min.js",
60
+ }),
61
+ ],
62
+ });
63
+ const result = applySignature(context, swiperSignature);
64
+ expect(result).toBeDefined();
65
+ expect(result?.evidences?.some((e) => e.version === "11.1.14")).toBe(true);
66
+ });
67
+ });
68
+ });
69
+ //# sourceMappingURL=swiper.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swiper.test.js","sourceRoot":"","sources":["../../../src/signatures/technologies/swiper.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,SAAS,iBAAiB,CACxB,YAAiD,EAAE;IAEnD,OAAO;QACL,OAAO,EAAE,EAAwB;QACjC,IAAI,EAAE,EAAqB;QAC3B,IAAI,EAAE,EAAE;QACR,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;QACX,mBAAmB,EAAE,EAAE;QACvB,SAAS,EAAE,KAAK;QAChB,eAAe,EAAE,KAAK;QACtB,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,YAA+B,EAAE;IAC3D,OAAO;QACL,GAAG,EAAE,qBAAqB;QAC1B,IAAI,EAAE,aAAa;QACnB,YAAY,EAAE,IAAI;QAClB,MAAM,EAAE,GAAG;QACX,OAAO,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE;QACxC,IAAI,EAAE,EAAE;QACR,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,QAA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C;YAC7B,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAClE,IAAI,CACL,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -5,8 +5,8 @@ export const tailwindCssSignature = {
5
5
  confidence: "high",
6
6
  bodies: [
7
7
  "--tw-(?:rotate|translate|space-x|text-opacity|border-opacity)",
8
- "href[^>]+tailwindcss[@|/](?:\\^)?([\\d.]+)(?:/[a-z]+)?/(?:tailwind|base|components|utilities)(?:\\.min)?\\.css",
9
- "href[^>]+tailwind",
8
+ "<link[^>]+href=[\"'][^\"']*tailwindcss[@/](?:\\^)?([\\d.]+)(?:/[a-z]+)?/(?:tailwind|base|components|utilities)(?:\\.min)?\\.css",
9
+ "<link[^>]+href=[\"'][^\"']*tailwind[^\"']*\\.css",
10
10
  ],
11
11
  urls: ["\\.tailwindcss(?:tailwind-config-cdn)?\\.(?:com|js)"],
12
12
  javascriptVariables: {
@@ -1 +1 @@
1
- {"version":3,"file":"tailwind_css.js","sourceRoot":"","sources":["../../../src/signatures/technologies/tailwind_css.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oBAAoB,GAAc;IAC7C,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,4CAA4C;IACzD,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE;YACN,+DAA+D;YAC/D,gHAAgH;YAChH,mBAAmB;SACpB;QACD,IAAI,EAAE,CAAC,qDAAqD,CAAC;QAC7D,mBAAmB,EAAE;YACnB,QAAQ,EAAE,EAAE;SACb;KACF;CACF,CAAC"}
1
+ {"version":3,"file":"tailwind_css.js","sourceRoot":"","sources":["../../../src/signatures/technologies/tailwind_css.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oBAAoB,GAAc;IAC7C,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,4CAA4C;IACzD,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE;YACN,+DAA+D;YAC/D,iIAAiI;YACjI,kDAAkD;SACnD;QACD,IAAI,EAAE,CAAC,qDAAqD,CAAC;QAC7D,mBAAmB,EAAE;YACnB,QAAQ,EAAE,EAAE;SACb;KACF;CACF,CAAC"}
@@ -72,6 +72,17 @@ describe("tailwindCssSignature", () => {
72
72
  const result = applySignature(context, tailwindCssSignature);
73
73
  expect(result).toBeUndefined();
74
74
  });
75
+ it("does not detect Tailwind from an anchor tag that merely links to a page about Tailwind", () => {
76
+ const context = createMockContext({
77
+ responses: [
78
+ createMockResponse({
79
+ body: '<a href="/blog/category/tailwind-tips">Tailwind Tips</a>',
80
+ }),
81
+ ],
82
+ });
83
+ const result = applySignature(context, tailwindCssSignature);
84
+ expect(result).toBeUndefined();
85
+ });
75
86
  });
76
87
  });
77
88
  //# sourceMappingURL=tailwind_css.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tailwind_css.test.js","sourceRoot":"","sources":["../../../src/signatures/technologies/tailwind_css.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,SAAS,iBAAiB,CACxB,YAAiD,EAAE;IAEnD,OAAO;QACL,OAAO,EAAE,EAAwB;QACjC,IAAI,EAAE,EAAqB;QAC3B,IAAI,EAAE,EAAE;QACR,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;QACX,mBAAmB,EAAE,EAAE;QACvB,SAAS,EAAE,KAAK;QAChB,eAAe,EAAE,KAAK;QACtB,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,SAAS,kB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AAO,GAAG,iBAAiB,CAAC;gBAChC,SAAS,EAAE;oBACT,kBAAkB,CAAC;wBACjB,IAAI,EAAE,yDAAyD;qBAChE,CAAC;iBACH;aACF,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;YAC7D,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;YACjE,MAAM,OAAO,GAAG,iBAAiB,CAAC;gBAChC,SAAS,EAAE;oBACT,kBAAkB,CAAC;wBACjB,IAAI,EAAE,oFAAoF;qBAC3F,CAAC;iBACH;aACF,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;YAC7D,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"tailwind_css.test.js","sourceRoot":"","sources":["../../../src/signatures/technologies/tailwind_css.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,SAAS,iBAAiB,CACxB,YAAiD,EAAE;IAEnD,OAAO;QACL,OAAO,EAAE,EAAwB;QACjC,IAAI,EAAE,EAAqB;QAC3B,IAAI,EAAE,EAAE;QACR,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;QACX,mBAAmB,EAAE,EAAE;QACvB,SAAS,EAAE,KAAK;QAChB,eAAe,EAAE,KAAK;QACtB,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,SAAS,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,OAAO,GAAG,iBAAiB,CAAC;gBAChC,SAAS,EAAE;oBACT,kBAAkB,CAAC;wBACjB,IAAI,EAAE,yDAAyD;qBAChE,CAAC;iBACH;aACF,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;YAC7D,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;YACjE,MAAM,OAAO,GAAG,iBAAiB,CAAC;gBAChC,SAAS,EAAE;oBACT,kBAAkB,CAAC;wBACjB,IAAI,EAAE,oFAAoF;qBAC3F,CAAC;iBACH;aACF,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;YAC7D,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,CAAC;QACjC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wFAAwF,EAAE,GAAG,EAAE;YAChG,MAAM,OAAO,GAAG,iBAAiB,CAAC;gBAChC,SAAS,EAAE;oBACT,kBAAkB,CAAC;wBACjB,IAAI,EAAE,0DAA0D;qBACjE,CAAC;iBACH;aACF,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;YAC7D,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -5,7 +5,7 @@ export const theEventsCalendarSignature = {
5
5
  rule: {
6
6
  confidence: "high",
7
7
  bodies: [
8
- "href[^>]+\\/wp\\-content\\/plugins\\/the\\-events\\-calendar\\/",
8
+ "<link\\b[^>]*\\s+href=[\"'][^\"']*\\/wp\\-content\\/plugins\\/the\\-events\\-calendar\\/",
9
9
  ],
10
10
  urls: [
11
11
  "/wp-content/plugins/the-events-calendar(?:-pro)?/",
@@ -1 +1 @@
1
- {"version":3,"file":"the_events_calendar.js","sourceRoot":"","sources":["../../../src/signatures/technologies/the_events_calendar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,0BAA0B,GAAc;IACnD,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,sEAAsE;IACnF,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE;YACN,iEAAiE;SAClE;QACD,IAAI,EAAE;YACJ,mDAAmD;SACpD;QACD,mBAAmB,EAAE;YACnB,eAAe,EAAE,EAAE;YACnB,uBAAuB,EAAE,EAAE;SAC5B;KACF;IACD,gBAAgB,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC;CAC5C,CAAC"}
1
+ {"version":3,"file":"the_events_calendar.js","sourceRoot":"","sources":["../../../src/signatures/technologies/the_events_calendar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,0BAA0B,GAAc;IACnD,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,sEAAsE;IACnF,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE;YACN,0FAA0F;SAC3F;QACD,IAAI,EAAE;YACJ,mDAAmD;SACpD;QACD,mBAAmB,EAAE;YACnB,eAAe,EAAE,EAAE;YACnB,uBAAuB,EAAE,EAAE;SAC5B;KACF;IACD,gBAAgB,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC;CAC5C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=the_events_calendar.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"the_events_calendar.test.d.ts","sourceRoot":"","sources":["../../../src/signatures/technologies/the_events_calendar.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,43 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import { applySignature } from "../../analyzer/apply.js";
3
+ import { theEventsCalendarSignature } from "./the_events_calendar.js";
4
+ function createMockContext(overrides = {}) {
5
+ return {
6
+ browser: {},
7
+ page: {},
8
+ urls: [],
9
+ responses: [],
10
+ cookies: [],
11
+ javascriptVariables: {},
12
+ timeoutMs: 30000,
13
+ timeoutOccurred: false,
14
+ ...overrides,
15
+ };
16
+ }
17
+ function createMockResponse(overrides = {}) {
18
+ return {
19
+ url: "https://example.com",
20
+ host: "example.com",
21
+ isFirstParty: true,
22
+ status: 200,
23
+ headers: { "content-type": "text/html" },
24
+ body: "",
25
+ ...overrides,
26
+ };
27
+ }
28
+ describe("theEventsCalendarSignature", () => {
29
+ describe("body matching", () => {
30
+ it("detects The Events Calendar from a <link> stylesheet under the plugin path", () => {
31
+ const context = createMockContext({
32
+ responses: [
33
+ createMockResponse({
34
+ body: '<link rel="stylesheet" href="/wp-content/plugins/the-events-calendar/src/resources/css/tribe-events-full.css">',
35
+ }),
36
+ ],
37
+ });
38
+ const result = applySignature(context, theEventsCalendarSignature);
39
+ expect(result).toBeDefined();
40
+ });
41
+ });
42
+ });
43
+ //# sourceMappingURL=the_events_calendar.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"the_events_calendar.test.js","sourceRoot":"","sources":["../../../src/signatures/technologies/the_events_calendar.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAEtE,SAAS,iBAAiB,CACxB,YAAiD,EAAE;IAEnD,OAAO;QACL,OAAO,EAAE,EAAwB;QACjC,IAAI,EAAE,EAAqB;QAC3B,IAAI,EAAE,EAAE;QACR,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;QACX,mBAAmB,EAAE,EAAE;QACvB,SAAS,EAAE,KAAK;QAChB,eAAe,EAAE,KAAK;QACtB,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,YAA+B,EAAE;IAC3D,OAAO;QACL,GAAG,EAAE,qBAAqB;QAC1B,IAAI,EAAE,aAAa;QACnB,YAAY,EAAE,IAAI;QAClB,MAAM,EAAE,GAAG;QACX,OAAO,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE;QACxC,IAAI,EAAE,EAAE;QACR,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;QAC7B,EAAE,CAAC,4EAA4E,EAAE,GAAG,EAAE;YACpF,MAAM,OAAO,GAAG,iBAAiB,CAAC;gBAChC,SAAS,EAAE;oBACT,kBAAkB,CAAC;wBACjB,IAAI,EAAE,gHAAgH;qBACvH,CAAC;iBACH;aACF,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,0BAA0B,CAAC,CAAC;YACnE,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"underscore_js.d.ts","sourceRoot":"","sources":["../../../src/signatures/technologies/underscore_js.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,eAAO,MAAM,qBAAqB,EAAE,SAcnC,CAAC"}
1
+ {"version":3,"file":"underscore_js.d.ts","sourceRoot":"","sources":["../../../src/signatures/technologies/underscore_js.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,eAAO,MAAM,qBAAqB,EAAE,SAgBnC,CAAC"}
@@ -6,10 +6,12 @@ export const underscoreJsSignature = {
6
6
  confidence: "high",
7
7
  urls: ["underscore.*\\.js(?:\\?ver=([\\d.]+))?"],
8
8
  javascriptVariables: {
9
- "_.VERSION": "^(.+)$",
10
- "_.restArguments": "",
9
+ "_.VERSION": "(.+)",
10
+ "_.mapObject": "",
11
+ "_.matcher": "",
12
+ "_.allKeys": "",
11
13
  },
12
- requiredJavascriptVariables: ["_.restArguments"],
14
+ requireAnyOfJavascriptVariables: ["_.mapObject", "_.matcher", "_.allKeys"],
13
15
  },
14
16
  };
15
17
  //# sourceMappingURL=underscore_js.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"underscore_js.js","sourceRoot":"","sources":["../../../src/signatures/technologies/underscore_js.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,qBAAqB,GAAc;IAC9C,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,wQAAwQ;IAC1Q,GAAG,EAAE,gCAAgC;IACrC,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,CAAC,wCAAwC,CAAC;QAChD,mBAAmB,EAAE;YACnB,WAAW,EAAE,QAAQ;YACrB,iBAAiB,EAAE,EAAE;SACtB;QACD,2BAA2B,EAAE,CAAC,iBAAiB,CAAC;KACjD;CACF,CAAC"}
1
+ {"version":3,"file":"underscore_js.js","sourceRoot":"","sources":["../../../src/signatures/technologies/underscore_js.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,qBAAqB,GAAc;IAC9C,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,wQAAwQ;IAC1Q,GAAG,EAAE,gCAAgC;IACrC,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,CAAC,wCAAwC,CAAC;QAChD,mBAAmB,EAAE;YACnB,WAAW,EAAE,MAAM;YACnB,aAAa,EAAE,EAAE;YACjB,WAAW,EAAE,EAAE;YACf,WAAW,EAAE,EAAE;SAChB;QACD,+BAA+B,EAAE,CAAC,aAAa,EAAE,WAAW,EAAE,WAAW,CAAC;KAC3E;CACF,CAAC"}
@@ -53,11 +53,11 @@ describe("underscoreJsSignature", () => {
53
53
  });
54
54
  });
55
55
  describe("JavaScript variable matching", () => {
56
- it("should detect Underscore.js when _.VERSION and _.restArguments are present", () => {
56
+ it("should detect Underscore.js when an underscore-only marker and _.VERSION are present", () => {
57
57
  const context = createMockContext({
58
58
  javascriptVariables: {
59
+ "_.mapObject": "[Function]",
59
60
  "_.VERSION": "1.13.6",
60
- "_.restArguments": "function",
61
61
  },
62
62
  });
63
63
  const result = applySignature(context, underscoreJsSignature);
@@ -89,6 +89,16 @@ describe("underscoreJsSignature", () => {
89
89
  const result = applySignature(context, underscoreJsSignature);
90
90
  expect(result).toBeUndefined();
91
91
  });
92
+ it("should detect Underscore.js when only the required underscore-only marker is present", () => {
93
+ const context = createMockContext({
94
+ javascriptVariables: {
95
+ "_.mapObject": "[Function]",
96
+ },
97
+ });
98
+ const result = applySignature(context, underscoreJsSignature);
99
+ expect(result).toBeDefined();
100
+ expect(result?.evidences?.some((e) => e.type === "script")).toBe(true);
101
+ });
92
102
  });
93
103
  });
94
104
  //# sourceMappingURL=underscore_js.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"underscore_js.test.js","sourceRoot":"","sources":["../../../src/signatures/technologies/underscore_js.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,SAAS,iBAAiB,CACxB,YAEI,EAAE;IAEN,OAAO;QACL,OAAO,EAAE,EAAwB;QACjC,IAAI,EAAE,EAAqB;QAC3B,IAAI,EAAE,EAAE;QACR,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;Q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AC,IAAI,CAAC,CAAC;YACpE,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnG,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;YACxE,MAAM,OAAO,GAAG,iBAAiB,CAAC;gBAChC,mBAAmB,EAAE;oBACnB,WAAW,EAAE,QAAQ;iBACtB;aACF,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC;YAC9D,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"underscore_js.test.js","sourceRoot":"","sources":["../../../src/signatures/technologies/underscore_js.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,SAAS,iBAAiB,CACxB,YAAyE,EAAE;IAE3E,OAAO;QACL,OAAO,EAAE,EAAwB;QACjC,IAAI,EAAE,EAAqB;QAC3B,IAAI,EAAE,EAAE;QACR,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;QACX,mBAAmB,EAAE,EAAE;QACvB,SAAS,EAAE,KAAK;QAChB,eAAe,EAAE,KAAK;QACtB,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,YAA+B,EAAE;IAC3D,OAAO;QACL,GAAG,EAAE,qBAAqB;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IAAI,CAAC,IAAI,CAAC,CAAC;QACf,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;YACxE,MAAM,OAAO,GAAG,iBAAiB,CAAC;gBAChC,mBAAmB,EAAE;oBACnB,WAAW,EAAE,QAAQ;iBACtB;aACF,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC;YAC9D,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,CAAC;QACjC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,sFAAsF,EAAE,GAAG,EAAE;YAC9F,MAAM,OAAO,GAAG,iBAAiB,CAAC;gBAChC,mBAAmB,EAAE;oBACnB,aAAa,EAAE,YAAY;iBAC5B;aACF,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC;YAC9D,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;YAC7B,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -5,7 +5,7 @@ export const webfactoryMaintenanceSignature = {
5
5
  rule: {
6
6
  confidence: "high",
7
7
  bodies: [
8
- "href[^>]+\\/wp\\-content\\/plugins\\/maintenance\\/",
8
+ "<link\\b[^>]*\\s+href=[\"'][^\"']*\\/wp\\-content\\/plugins\\/maintenance\\/",
9
9
  ],
10
10
  javascriptVariables: {
11
11
  "mtnc_front_options": "",
@@ -1 +1 @@
1
- {"version":3,"file":"webfactory_maintenance.js","sourceRoot":"","sources":["../../../src/signatures/technologies/webfactory_maintenance.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,8BAA8B,GAAc;IACvD,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,8FAA8F;IAC3G,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE;YACN,qDAAqD;SACtD;QACD,mBAAmB,EAAE;YACnB,oBAAoB,EAAE,EAAE;SACzB;KACF;IACD,gBAAgB,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC;CAC5C,CAAC"}
1
+ {"version":3,"file":"webfactory_maintenance.js","sourceRoot":"","sources":["../../../src/signatures/technologies/webfactory_maintenance.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,8BAA8B,GAAc;IACvD,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,8FAA8F;IAC3G,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE;YACN,8EAA8E;SAC/E;QACD,mBAAmB,EAAE;YACnB,oBAAoB,EAAE,EAAE;SACzB;KACF;IACD,gBAAgB,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC;CAC5C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=webfactory_maintenance.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webfactory_maintenance.test.d.ts","sourceRoot":"","sources":["../../../src/signatures/technologies/webfactory_maintenance.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,43 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import { applySignature } from "../../analyzer/apply.js";
3
+ import { webfactoryMaintenanceSignature } from "./webfactory_maintenance.js";
4
+ function createMockContext(overrides = {}) {
5
+ return {
6
+ browser: {},
7
+ page: {},
8
+ urls: [],
9
+ responses: [],
10
+ cookies: [],
11
+ javascriptVariables: {},
12
+ timeoutMs: 30000,
13
+ timeoutOccurred: false,
14
+ ...overrides,
15
+ };
16
+ }
17
+ function createMockResponse(overrides = {}) {
18
+ return {
19
+ url: "https://example.com",
20
+ host: "example.com",
21
+ isFirstParty: true,
22
+ status: 200,
23
+ headers: { "content-type": "text/html" },
24
+ body: "",
25
+ ...overrides,
26
+ };
27
+ }
28
+ describe("webfactoryMaintenanceSignature", () => {
29
+ describe("body matching", () => {
30
+ it("detects WebFactory Maintenance from a <link> stylesheet under the plugin path", () => {
31
+ const context = createMockContext({
32
+ responses: [
33
+ createMockResponse({
34
+ body: '<link rel="stylesheet" href="/wp-content/plugins/maintenance/css/style.css">',
35
+ }),
36
+ ],
37
+ });
38
+ const result = applySignature(context, webfactoryMaintenanceSignature);
39
+ expect(result).toBeDefined();
40
+ });
41
+ });
42
+ });
43
+ //# sourceMappingURL=webfactory_maintenance.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webfactory_maintenance.test.js","sourceRoot":"","sources":["../../../src/signatures/technologies/webfactory_maintenance.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAE7E,SAAS,iBAAiB,CACxB,YAAiD,EAAE;IAEnD,OAAO;QACL,OAAO,EAAE,EAAwB;QACjC,IAAI,EAAE,EAAqB;QAC3B,IAAI,EAAE,EAAE;QACR,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;QACX,mBAAmB,EAAE,EAAE;QACvB,SAAS,EAAE,KAAK;QAChB,eAAe,EAAE,KAAK;QACtB,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,YAA+B,EAAE;IAC3D,OAAO;QACL,GAAG,EAAE,qBAAqB;QAC1B,IAAI,EAAE,aAAa;QACnB,YAAY,EAAE,IAAI;QAClB,MAAM,EAAE,GAAG;QACX,OAAO,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE;QACxC,IAAI,EAAE,EAAE;QACR,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;QAC7B,EAAE,CAAC,+EAA+E,EAAE,GAAG,EAAE;YACvF,MAAM,OAAO,GAAG,iBAAiB,CAAC;gBAChC,SAAS,EAAE;oBACT,kBAAkB,CAAC;wBACjB,IAAI,EAAE,8EAA8E;qBACrF,CAAC;iBACH;aACF,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,8BAA8B,CAAC,CAAC;YACvE,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -6,7 +6,7 @@ export const woocommerceStripePaymentGatewaySignature = {
6
6
  rule: {
7
7
  confidence: "high",
8
8
  bodies: [
9
- "href[^>]+\\/wp\\-content\\/plugins\\/woocommerce\\-gateway\\-stripe\\/",
9
+ "<link\\b[^>]*\\s+href=[\"'][^\"']*\\/wp\\-content\\/plugins\\/woocommerce\\-gateway\\-stripe\\/",
10
10
  ],
11
11
  urls: [
12
12
  "/wp-content/plugins/woocommerce-gateway-stripe/",
@@ -1 +1 @@
1
- {"version":3,"file":"woocommerce_stripe_payment_gateway.js","sourceRoot":"","sources":["../../../src/signatures/technologies/woocommerce_stripe_payment_gateway.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,wCAAwC,GAAc;IACjE,IAAI,EAAE,oCAAoC;IAC1C,WAAW,EAAE,sIAAsI;IACnJ,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE;YACN,wEAAwE;SACzE;QACD,IAAI,EAAE;YACJ,iDAAiD;SAClD;KACF;IACD,gBAAgB,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE,kBAAkB,CAAC,IAAI,CAAC;CAClE,CAAC"}
1
+ {"version":3,"file":"woocommerce_stripe_payment_gateway.js","sourceRoot":"","sources":["../../../src/signatures/technologies/woocommerce_stripe_payment_gateway.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,wCAAwC,GAAc;IACjE,IAAI,EAAE,oCAAoC;IAC1C,WAAW,EAAE,sIAAsI;IACnJ,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE;YACN,iGAAiG;SAClG;QACD,IAAI,EAAE;YACJ,iDAAiD;SAClD;KACF;IACD,gBAAgB,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE,kBAAkB,CAAC,IAAI,CAAC;CAClE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=woocommerce_stripe_payment_gateway.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"woocommerce_stripe_payment_gateway.test.d.ts","sourceRoot":"","sources":["../../../src/signatures/technologies/woocommerce_stripe_payment_gateway.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,43 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import { applySignature } from "../../analyzer/apply.js";
3
+ import { woocommerceStripePaymentGatewaySignature } from "./woocommerce_stripe_payment_gateway.js";
4
+ function createMockContext(overrides = {}) {
5
+ return {
6
+ browser: {},
7
+ page: {},
8
+ urls: [],
9
+ responses: [],
10
+ cookies: [],
11
+ javascriptVariables: {},
12
+ timeoutMs: 30000,
13
+ timeoutOccurred: false,
14
+ ...overrides,
15
+ };
16
+ }
17
+ function createMockResponse(overrides = {}) {
18
+ return {
19
+ url: "https://example.com",
20
+ host: "example.com",
21
+ isFirstParty: true,
22
+ status: 200,
23
+ headers: { "content-type": "text/html" },
24
+ body: "",
25
+ ...overrides,
26
+ };
27
+ }
28
+ describe("woocommerceStripePaymentGatewaySignature", () => {
29
+ describe("body matching", () => {
30
+ it("detects WooCommerce Stripe Payment Gateway from a <link> stylesheet under the plugin path", () => {
31
+ const context = createMockContext({
32
+ responses: [
33
+ createMockResponse({
34
+ body: '<link rel="stylesheet" href="/wp-content/plugins/woocommerce-gateway-stripe/assets/css/stripe-styles.css">',
35
+ }),
36
+ ],
37
+ });
38
+ const result = applySignature(context, woocommerceStripePaymentGatewaySignature);
39
+ expect(result).toBeDefined();
40
+ });
41
+ });
42
+ });
43
+ //# sourceMappingURL=woocommerce_stripe_payment_gateway.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"woocommerce_stripe_payment_gateway.test.js","sourceRoot":"","sources":["../../../src/signatures/technologies/woocommerce_stripe_payment_gateway.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,wCAAwC,EAAE,MAAM,yCAAyC,CAAC;AAEnG,SAAS,iBAAiB,CACxB,YAAiD,EAAE;IAEnD,OAAO;QACL,OAAO,EAAE,EAAwB;QACjC,IAAI,EAAE,EAAqB;QAC3B,IAAI,EAAE,EAAE;QACR,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;QACX,mBAAmB,EAAE,EAAE;QACvB,SAAS,EAAE,KAAK;QAChB,eAAe,EAAE,KAAK;QACtB,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,YAA+B,EAAE;IAC3D,OAAO;QACL,GAAG,EAAE,qBAAqB;QAC1B,IAAI,EAAE,aAAa;QACnB,YAAY,EAAE,IAAI;QAClB,MAAM,EAAE,GAAG;QACX,OAAO,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE;QACxC,IAAI,EAAE,EAAE;QACR,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,0CAA0C,EAAE,GAAG,EAAE;IACxD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;QAC7B,EAAE,CAAC,2FAA2F,EAAE,GAAG,EAAE;YACnG,MAAM,OAAO,GAAG,iBAAiB,CAAC;gBAChC,SAAS,EAAE;oBACT,kBAAkB,CAAC;wBACjB,IAAI,EAAE,4GAA4G;qBACnH,CAAC;iBACH;aACF,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,cAAc,CAC3B,OAAO,EACP,wCAAwC,CACzC,CAAC;YACF,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -6,7 +6,7 @@ export const wpStatisticsSignature = {
6
6
  confidence: "high",
7
7
  bodies: [
8
8
  "<!-- Analytics by WP-Statistics v([\\d\\.]+)",
9
- "href[^>]+\\/wp\\-content\\/plugins\\/wp\\-statistics\\/",
9
+ "<link\\b[^>]*\\s+href=[\"'][^\"']*\\/wp\\-content\\/plugins\\/wp\\-statistics\\/",
10
10
  ],
11
11
  javascriptVariables: {
12
12
  "WP_Statistics_http": "",
@@ -1 +1 @@
1
- {"version":3,"file":"wp_statistics.js","sourceRoot":"","sources":["../../../src/signatures/technologies/wp_statistics.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,qBAAqB,GAAc;IAC9C,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,uFAAuF;IACpG,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE;YACN,8CAA8C;YAC9C,yDAAyD;SAC1D;QACD,mBAAmB,EAAE;YACnB,oBAAoB,EAAE,EAAE;YACxB,uBAAuB,EAAE,EAAE;SAC5B;KACF;IACD,gBAAgB,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC;CAC5C,CAAC"}
1
+ {"version":3,"file":"wp_statistics.js","sourceRoot":"","sources":["../../../src/signatures/technologies/wp_statistics.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,qBAAqB,GAAc;IAC9C,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,uFAAuF;IACpG,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE;YACN,8CAA8C;YAC9C,kFAAkF;SACnF;QACD,mBAAmB,EAAE;YACnB,oBAAoB,EAAE,EAAE;YACxB,uBAAuB,EAAE,EAAE;SAC5B;KACF;IACD,gBAAgB,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC;CAC5C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=wp_statistics.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wp_statistics.test.d.ts","sourceRoot":"","sources":["../../../src/signatures/technologies/wp_statistics.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,43 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import { applySignature } from "../../analyzer/apply.js";
3
+ import { wpStatisticsSignature } from "./wp_statistics.js";
4
+ function createMockContext(overrides = {}) {
5
+ return {
6
+ browser: {},
7
+ page: {},
8
+ urls: [],
9
+ responses: [],
10
+ cookies: [],
11
+ javascriptVariables: {},
12
+ timeoutMs: 30000,
13
+ timeoutOccurred: false,
14
+ ...overrides,
15
+ };
16
+ }
17
+ function createMockResponse(overrides = {}) {
18
+ return {
19
+ url: "https://example.com",
20
+ host: "example.com",
21
+ isFirstParty: true,
22
+ status: 200,
23
+ headers: { "content-type": "text/html" },
24
+ body: "",
25
+ ...overrides,
26
+ };
27
+ }
28
+ describe("wpStatisticsSignature", () => {
29
+ describe("body matching", () => {
30
+ it("detects WP-Statistics from a <link> stylesheet under the plugin path", () => {
31
+ const context = createMockContext({
32
+ responses: [
33
+ createMockResponse({
34
+ body: '<link rel="stylesheet" href="/wp-content/plugins/wp-statistics/assets/css/admin.css">',
35
+ }),
36
+ ],
37
+ });
38
+ const result = applySignature(context, wpStatisticsSignature);
39
+ expect(result).toBeDefined();
40
+ });
41
+ });
42
+ });
43
+ //# sourceMappingURL=wp_statistics.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wp_statistics.test.js","sourceRoot":"","sources":["../../../src/signatures/technologies/wp_statistics.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,SAAS,iBAAiB,CACxB,YAAiD,EAAE;IAEnD,OAAO;QACL,OAAO,EAAE,EAAwB;QACjC,IAAI,EAAE,EAAqB;QAC3B,IAAI,EAAE,EAAE;QACR,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;QACX,mBAAmB,EAAE,EAAE;QACvB,SAAS,EAAE,KAAK;QAChB,eAAe,EAAE,KAAK;QACtB,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,YAA+B,EAAE;IAC3D,OAAO;QACL,GAAG,EAAE,qBAAqB;QAC1B,IAAI,EAAE,aAAa;QACnB,YAAY,EAAE,IAAI;QAClB,MAAM,EAAE,GAAG;QACX,OAAO,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE;QACxC,IAAI,EAAE,EAAE;QACR,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;QAC7B,EAAE,CAAC,sEAAsE,EAAE,GAAG,EAAE;YAC9E,MAAM,OAAO,GAAG,iBAAiB,CAAC;gBAChC,SAAS,EAAE;oBACT,kBAAkB,CAAC;wBACjB,IAAI,EAAE,uFAAuF;qBAC9F,CAAC;iBACH;aACF,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC;YAC9D,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,14 +1,20 @@
1
1
  {
2
2
  "name": "whopper",
3
- "version": "0.5.4",
3
+ "version": "0.5.7",
4
4
  "description": "Whopper is a CLI tool that discovers and detects web technologies used on websites.",
5
5
  "scripts": {
6
6
  "build": "tsc -p tsconfig.json",
7
+ "clean": "rm -rf dist",
7
8
  "dev": "node --enable-source-maps ./dist/main.js",
8
9
  "start": "npm run build && node ./dist/main.js",
9
10
  "lint": "eslint . --ext .ts",
10
11
  "format": "prettier --write .",
11
- "test": "vitest run --coverage"
12
+ "test": "vitest run --coverage",
13
+ "prepublishOnly": "npm run clean && npm run lint && npm test && npm run build",
14
+ "release": "git push --follow-tags && npm publish",
15
+ "release:patch": "npm version patch && git push --follow-tags && npm publish",
16
+ "release:minor": "npm version minor && git push --follow-tags && npm publish",
17
+ "release:major": "npm version major && git push --follow-tags && npm publish"
12
18
  },
13
19
  "bin": {
14
20
  "whopper": "./dist/main.js"
@@ -1,3 +0,0 @@
1
- import type { Confidence } from "../signatures/_types.js";
2
- export declare const maxConfidence: (confidences: Confidence[]) => Confidence;
3
- //# sourceMappingURL=util.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/analyzer/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,eAAO,MAAM,aAAa,GAAI,aAAa,UAAU,EAAE,KAAG,UAQzD,CAAC"}
@@ -1,10 +0,0 @@
1
- export const maxConfidence = (confidences) => {
2
- if (confidences.includes("high")) {
3
- return "high";
4
- }
5
- if (confidences.includes("medium")) {
6
- return "medium";
7
- }
8
- return "low";
9
- };
10
- //# sourceMappingURL=util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/analyzer/util.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,WAAyB,EAAc,EAAE;IACrE,IAAI,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACnC,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Command } from "commander";
2
- export declare const helloCommand: () => Command;
3
- //# sourceMappingURL=hello.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hello.d.ts","sourceRoot":"","sources":["../../src/commands/hello.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,eAAO,MAAM,YAAY,QAAO,OAQ/B,CAAC"}
@@ -1,12 +0,0 @@
1
- import { Command } from "commander";
2
- import chalk from "chalk";
3
- export const helloCommand = () => {
4
- return new Command("hello")
5
- .description("Prints a greeting message")
6
- .option("-n, --name <name>", "Name to greet")
7
- .action((options) => {
8
- const name = options.name || "World";
9
- console.log(chalk.green(`Hello, ${name}!`));
10
- });
11
- };
12
- //# sourceMappingURL=hello.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hello.js","sourceRoot":"","sources":["../../src/commands/hello.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,MAAM,CAAC,MAAM,YAAY,GAAG,GAAY,EAAE;IACxC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;SACxB,WAAW,CAAC,2BAA2B,CAAC;SACxC,MAAM,CAAC,mBAAmB,EAAE,eAAe,CAAC;SAC5C,MAAM,CAAC,CAAC,OAAgB,EAAE,EAAE;QAC3B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC;QACrC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Command } from "commander";
2
- export declare const versionCommand: () => Command;
3
- //# sourceMappingURL=version.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/commands/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,eAAO,MAAM,cAAc,QAAO,OAMjC,CAAC"}
@@ -1,10 +0,0 @@
1
- import { Command } from "commander";
2
- import { VERSION } from "../cli.js";
3
- export const versionCommand = () => {
4
- return new Command("version")
5
- .description("Displays the current version of the CLI tool.")
6
- .action(() => {
7
- console.log(VERSION);
8
- });
9
- };
10
- //# sourceMappingURL=version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/commands/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAY,EAAE;IAC1C,OAAO,IAAI,OAAO,CAAC,SAAS,CAAC;SAC1B,WAAW,CAAC,+CAA+C,CAAC;SAC5D,MAAM,CAAC,GAAG,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=version.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.test.d.ts","sourceRoot":"","sources":["../../src/commands/version.test.ts"],"names":[],"mappings":""}