@lion/ui 0.0.1 → 0.0.3

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 (279) hide show
  1. package/components/core/test/SlotMixin.test.js +28 -21
  2. package/components/drawer/src/LionDrawer.js +217 -0
  3. package/components/drawer/src/drawerStyle.js +59 -0
  4. package/components/drawer/test/lion-drawer.test.js +109 -0
  5. package/components/localize/src/number/parseNumber.js +15 -36
  6. package/components/localize/test/number/parseNumber.test.js +3 -12
  7. package/custom-elements.json +743 -0
  8. package/dist-types/components/drawer/src/LionDrawer.d.ts +67 -0
  9. package/dist-types/components/drawer/src/LionDrawer.d.ts.map +1 -0
  10. package/dist-types/components/drawer/src/drawerStyle.d.ts +2 -0
  11. package/dist-types/components/drawer/src/drawerStyle.d.ts.map +1 -0
  12. package/dist-types/components/drawer/test/lion-drawer.test.d.ts +3 -0
  13. package/dist-types/components/drawer/test/lion-drawer.test.d.ts.map +1 -0
  14. package/dist-types/components/localize/src/number/parseNumber.d.ts.map +1 -1
  15. package/dist-types/exports/define/lion-drawer.d.ts +2 -0
  16. package/dist-types/exports/define/lion-drawer.d.ts.map +1 -0
  17. package/dist-types/exports/drawer.d.ts +2 -0
  18. package/dist-types/exports/drawer.d.ts.map +1 -0
  19. package/dist-types/tsconfig.tsbuildinfo +1 -1
  20. package/docs/components/accordion/index.md +3 -0
  21. package/docs/components/accordion/overview.md +129 -0
  22. package/docs/components/accordion/reference.md +47 -0
  23. package/docs/components/accordion/use-cases.md +252 -0
  24. package/docs/components/button/examples.md +30 -0
  25. package/docs/components/button/index.md +3 -0
  26. package/docs/components/button/overview.md +30 -0
  27. package/docs/components/button/src/icon.svg.js +5 -0
  28. package/docs/components/button/use-cases.md +106 -0
  29. package/docs/components/calendar/index.md +3 -0
  30. package/docs/components/calendar/overview.md +49 -0
  31. package/docs/components/calendar/use-cases.md +192 -0
  32. package/docs/components/checkbox-group/index.md +3 -0
  33. package/docs/components/checkbox-group/overview.md +40 -0
  34. package/docs/components/checkbox-group/use-cases.md +256 -0
  35. package/docs/components/collapsible/assets/CustomCollapsible.js +113 -0
  36. package/docs/components/collapsible/assets/applyDemoCollapsibleStyles.js +37 -0
  37. package/docs/components/collapsible/examples.md +83 -0
  38. package/docs/components/collapsible/index.md +3 -0
  39. package/docs/components/collapsible/overview.md +39 -0
  40. package/docs/components/collapsible/use-cases.md +79 -0
  41. package/docs/components/combobox/examples.md +153 -0
  42. package/docs/components/combobox/index.md +3 -0
  43. package/docs/components/combobox/overview.md +51 -0
  44. package/docs/components/combobox/src/LinkMixin.js +60 -0
  45. package/docs/components/combobox/src/demo-selection-display.js +191 -0
  46. package/docs/components/combobox/src/gh-combobox/gh-button.js +69 -0
  47. package/docs/components/combobox/src/gh-combobox/gh-combobox.js +508 -0
  48. package/docs/components/combobox/src/google-combobox/assets/google-clear-icon.js +9 -0
  49. package/docs/components/combobox/src/google-combobox/assets/google-search-icon.js +9 -0
  50. package/docs/components/combobox/src/google-combobox/assets/google-voice-search-icon.js +19 -0
  51. package/docs/components/combobox/src/google-combobox/assets/googlelogo_color_272x92dp.png +0 -0
  52. package/docs/components/combobox/src/google-combobox/google-combobox.js +460 -0
  53. package/docs/components/combobox/src/lazyRender.js +29 -0
  54. package/docs/components/combobox/src/levenshtein.js +95 -0
  55. package/docs/components/combobox/src/md-combobox/MdFieldMixin.js +341 -0
  56. package/docs/components/combobox/src/md-combobox/md-combobox.js +89 -0
  57. package/docs/components/combobox/src/md-combobox/md-input.js +5 -0
  58. package/docs/components/combobox/src/md-combobox/style/load-roboto.js +6 -0
  59. package/docs/components/combobox/src/md-combobox/style/md-ripple.js +81 -0
  60. package/docs/components/combobox/src/wa-combobox/wa-combobox.js +368 -0
  61. package/docs/components/combobox/use-cases.md +377 -0
  62. package/docs/components/dialog/index.md +3 -0
  63. package/docs/components/dialog/overview.md +63 -0
  64. package/docs/components/dialog/src/demo-dialog-style.js +3 -0
  65. package/docs/components/dialog/src/demoStyle.js +39 -0
  66. package/docs/components/dialog/src/slots-dialog-content.js +32 -0
  67. package/docs/components/dialog/src/styled-dialog-content.js +38 -0
  68. package/docs/components/dialog/use-cases.md +154 -0
  69. package/docs/components/drawer/index.md +3 -0
  70. package/docs/components/drawer/overview.md +68 -0
  71. package/docs/components/drawer/src/demoStyle.js +71 -0
  72. package/docs/components/drawer/use-cases.md +194 -0
  73. package/docs/components/fieldset/index.md +3 -0
  74. package/docs/components/fieldset/overview.md +49 -0
  75. package/docs/components/fieldset/use-cases.md +185 -0
  76. package/docs/components/form/index.md +3 -0
  77. package/docs/components/form/overview.md +43 -0
  78. package/docs/components/form/use-cases.md +72 -0
  79. package/docs/components/icon/assets/bugs/bug01.svg.js +2 -0
  80. package/docs/components/icon/assets/bugs/bug02.svg.js +2 -0
  81. package/docs/components/icon/assets/bugs/bug05.svg.js +2 -0
  82. package/docs/components/icon/assets/bugs/bug06.svg.js +2 -0
  83. package/docs/components/icon/assets/bugs/bug08.svg.js +2 -0
  84. package/docs/components/icon/assets/bugs/bug12.svg.js +2 -0
  85. package/docs/components/icon/assets/bugs/bug19.svg.js +2 -0
  86. package/docs/components/icon/assets/bugs/bug23.svg.js +2 -0
  87. package/docs/components/icon/assets/bugs/bug24.svg.js +2 -0
  88. package/docs/components/icon/assets/iconset-bugs.js +11 -0
  89. package/docs/components/icon/assets/iconset-misc.js +3 -0
  90. package/docs/components/icon/assets/iconset-space.js +31 -0
  91. package/docs/components/icon/assets/misc/arrowLeft.svg.js +6 -0
  92. package/docs/components/icon/assets/space/aliens-spaceship.svg.js +2 -0
  93. package/docs/components/icon/assets/space/meteor.svg.js +2 -0
  94. package/docs/components/icon/assets/space/moon-flag.svg.js +2 -0
  95. package/docs/components/icon/assets/space/moon.svg.js +2 -0
  96. package/docs/components/icon/assets/space/night.svg.js +2 -0
  97. package/docs/components/icon/assets/space/orbit.svg.js +2 -0
  98. package/docs/components/icon/assets/space/planet.svg.js +2 -0
  99. package/docs/components/icon/assets/space/robot.svg.js +2 -0
  100. package/docs/components/icon/assets/space/rocket.svg.js +2 -0
  101. package/docs/components/icon/assets/space/satellite.svg.js +2 -0
  102. package/docs/components/icon/assets/space/signal.svg.js +2 -0
  103. package/docs/components/icon/assets/space/space-helmet.svg.js +2 -0
  104. package/docs/components/icon/assets/space/sun.svg.js +2 -0
  105. package/docs/components/icon/assets/space/telescope.svg.js +2 -0
  106. package/docs/components/icon/index.md +3 -0
  107. package/docs/components/icon/overview.md +40 -0
  108. package/docs/components/icon/use-cases.md +93 -0
  109. package/docs/components/index.md +7 -0
  110. package/docs/components/input/index.md +3 -0
  111. package/docs/components/input/overview.md +36 -0
  112. package/docs/components/input/use-cases.md +77 -0
  113. package/docs/components/input-amount/index.md +3 -0
  114. package/docs/components/input-amount/overview.md +49 -0
  115. package/docs/components/input-amount/use-cases.md +122 -0
  116. package/docs/components/input-date/index.md +3 -0
  117. package/docs/components/input-date/overview.md +39 -0
  118. package/docs/components/input-date/use-cases.md +83 -0
  119. package/docs/components/input-datepicker/index.md +3 -0
  120. package/docs/components/input-datepicker/overview.md +42 -0
  121. package/docs/components/input-datepicker/use-cases.md +78 -0
  122. package/docs/components/input-email/index.md +3 -0
  123. package/docs/components/input-email/overview.md +32 -0
  124. package/docs/components/input-email/use-cases.md +48 -0
  125. package/docs/components/input-iban/index.md +3 -0
  126. package/docs/components/input-iban/overview.md +37 -0
  127. package/docs/components/input-iban/use-cases.md +102 -0
  128. package/docs/components/input-range/index.md +3 -0
  129. package/docs/components/input-range/overview.md +34 -0
  130. package/docs/components/input-range/use-cases.md +108 -0
  131. package/docs/components/input-stepper/index.md +3 -0
  132. package/docs/components/input-stepper/overview.md +36 -0
  133. package/docs/components/input-stepper/use-cases.md +41 -0
  134. package/docs/components/input-tel/index.md +3 -0
  135. package/docs/components/input-tel/overview.md +62 -0
  136. package/docs/components/input-tel/src/h-region-code-table.js +109 -0
  137. package/docs/components/input-tel/use-cases.md +307 -0
  138. package/docs/components/input-tel-dropdown/examples.md +32 -0
  139. package/docs/components/input-tel-dropdown/index.md +3 -0
  140. package/docs/components/input-tel-dropdown/overview.md +38 -0
  141. package/docs/components/input-tel-dropdown/src/intl-input-tel-dropdown.js +127 -0
  142. package/docs/components/input-tel-dropdown/use-cases.md +159 -0
  143. package/docs/components/listbox/index.md +3 -0
  144. package/docs/components/listbox/overview.md +42 -0
  145. package/docs/components/listbox/src/listboxData.js +65 -0
  146. package/docs/components/listbox/use-cases.md +147 -0
  147. package/docs/components/pagination/index.md +3 -0
  148. package/docs/components/pagination/overview.md +29 -0
  149. package/docs/components/pagination/use-cases.md +99 -0
  150. package/docs/components/progress-indicator/assets/my-determinate-progress-bar.js +30 -0
  151. package/docs/components/progress-indicator/assets/my-indeterminate-progress-spinner.js +55 -0
  152. package/docs/components/progress-indicator/examples.md +125 -0
  153. package/docs/components/progress-indicator/index.md +3 -0
  154. package/docs/components/progress-indicator/overview.md +36 -0
  155. package/docs/components/radio-group/index.md +3 -0
  156. package/docs/components/radio-group/overview.md +46 -0
  157. package/docs/components/radio-group/use-cases.md +140 -0
  158. package/docs/components/select/index.md +3 -0
  159. package/docs/components/select/overview.md +44 -0
  160. package/docs/components/select/use-cases.md +55 -0
  161. package/docs/components/select-rich/examples.md +31 -0
  162. package/docs/components/select-rich/index.md +3 -0
  163. package/docs/components/select-rich/overview.md +46 -0
  164. package/docs/components/select-rich/src/flagStyles.js +1250 -0
  165. package/docs/components/select-rich/src/flags.png +0 -0
  166. package/docs/components/select-rich/src/flags@2x.png +0 -0
  167. package/docs/components/select-rich/src/intl-select-rich.js +194 -0
  168. package/docs/components/select-rich/src/regionMetaList.js +1717 -0
  169. package/docs/components/select-rich/use-cases.md +370 -0
  170. package/docs/components/steps/index.md +3 -0
  171. package/docs/components/steps/overview.md +63 -0
  172. package/docs/components/steps/use-cases.md +163 -0
  173. package/docs/components/switch/index.md +3 -0
  174. package/docs/components/switch/overview.md +75 -0
  175. package/docs/components/switch/reference.md +39 -0
  176. package/docs/components/switch/use-cases.md +76 -0
  177. package/docs/components/tabs/examples.md +23 -0
  178. package/docs/components/tabs/index.md +3 -0
  179. package/docs/components/tabs/overview.md +48 -0
  180. package/docs/components/tabs/src/lea-tab-panel.js +24 -0
  181. package/docs/components/tabs/src/lea-tab.js +45 -0
  182. package/docs/components/tabs/src/lea-tabs.js +28 -0
  183. package/docs/components/tabs/use-cases.md +219 -0
  184. package/docs/components/textarea/index.md +3 -0
  185. package/docs/components/textarea/overview.md +35 -0
  186. package/docs/components/textarea/use-cases.md +95 -0
  187. package/docs/components/tooltip/examples.md +39 -0
  188. package/docs/components/tooltip/index.md +3 -0
  189. package/docs/components/tooltip/overview.md +44 -0
  190. package/docs/components/tooltip/use-cases.md +208 -0
  191. package/docs/fundamentals/index.md +19 -0
  192. package/docs/fundamentals/node-tools/babel-plugin-extend-docs/index.md +1 -0
  193. package/docs/fundamentals/node-tools/babel-plugin-extend-docs/overview.md +233 -0
  194. package/docs/fundamentals/node-tools/index.md +1 -0
  195. package/docs/fundamentals/node-tools/providence-analytics/LocalConfiguration.md +68 -0
  196. package/docs/fundamentals/node-tools/providence-analytics/QueryResult.md +111 -0
  197. package/docs/fundamentals/node-tools/providence-analytics/analyzer.md +69 -0
  198. package/docs/fundamentals/node-tools/providence-analytics/assets/_mermaid.svg.js +1202 -0
  199. package/docs/fundamentals/node-tools/providence-analytics/dashboard.md +22 -0
  200. package/docs/fundamentals/node-tools/providence-analytics/index.md +1 -0
  201. package/docs/fundamentals/node-tools/providence-analytics/overview.md +192 -0
  202. package/docs/fundamentals/node-tools/publish-docs/index.md +1 -0
  203. package/docs/fundamentals/node-tools/publish-docs/overview.md +136 -0
  204. package/docs/fundamentals/node-tools/remark-extend/index.md +1 -0
  205. package/docs/fundamentals/node-tools/remark-extend/overview.md +274 -0
  206. package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/index.md +1 -0
  207. package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +285 -0
  208. package/docs/fundamentals/rationales/TypeScript.md +18 -0
  209. package/docs/fundamentals/rationales/index.md +1 -0
  210. package/docs/fundamentals/rationales/side-effects.md +203 -0
  211. package/docs/fundamentals/rationales/versioning.md +35 -0
  212. package/docs/fundamentals/systems/core/index.md +3 -0
  213. package/docs/fundamentals/systems/core/overview.md +85 -0
  214. package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-1.svg +1 -0
  215. package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-2.svg +1 -0
  216. package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-3.svg +84 -0
  217. package/docs/fundamentals/systems/form/assets/h-output.js +155 -0
  218. package/docs/fundamentals/systems/form/formatting-and-parsing.md +245 -0
  219. package/docs/fundamentals/systems/form/index.md +3 -0
  220. package/docs/fundamentals/systems/form/interaction-states.md +177 -0
  221. package/docs/fundamentals/systems/form/model-value.md +35 -0
  222. package/docs/fundamentals/systems/form/overview.md +82 -0
  223. package/docs/fundamentals/systems/form/styling.md +101 -0
  224. package/docs/fundamentals/systems/form/use-cases.md +156 -0
  225. package/docs/fundamentals/systems/form/validate.md +929 -0
  226. package/docs/fundamentals/systems/icon/index.md +3 -0
  227. package/docs/fundamentals/systems/icon/overview.md +124 -0
  228. package/docs/fundamentals/systems/index.md +1 -0
  229. package/docs/fundamentals/systems/localize/assets/all-locales.js +437 -0
  230. package/docs/fundamentals/systems/localize/assets/en-AU.js +6 -0
  231. package/docs/fundamentals/systems/localize/assets/en-GB.js +6 -0
  232. package/docs/fundamentals/systems/localize/assets/en-US.js +6 -0
  233. package/docs/fundamentals/systems/localize/assets/en.js +4 -0
  234. package/docs/fundamentals/systems/localize/assets/nl-BE.js +6 -0
  235. package/docs/fundamentals/systems/localize/assets/nl-NL.js +6 -0
  236. package/docs/fundamentals/systems/localize/assets/nl.js +4 -0
  237. package/docs/fundamentals/systems/localize/dates.md +195 -0
  238. package/docs/fundamentals/systems/localize/index.md +3 -0
  239. package/docs/fundamentals/systems/localize/numbers.md +217 -0
  240. package/docs/fundamentals/systems/localize/overview.md +48 -0
  241. package/docs/fundamentals/systems/localize/rationale.md +62 -0
  242. package/docs/fundamentals/systems/localize/text.md +125 -0
  243. package/docs/fundamentals/systems/localize/use-cases.md +319 -0
  244. package/docs/fundamentals/systems/overlays/assets/applyDemoOverlayStyles.js +22 -0
  245. package/docs/fundamentals/systems/overlays/assets/demo-overlay-backdrop.js +48 -0
  246. package/docs/fundamentals/systems/overlays/assets/demo-overlay-system.js +42 -0
  247. package/docs/fundamentals/systems/overlays/assets/umbrella-form.js +133 -0
  248. package/docs/fundamentals/systems/overlays/configuration.md +453 -0
  249. package/docs/fundamentals/systems/overlays/form-integration.md +65 -0
  250. package/docs/fundamentals/systems/overlays/index.md +3 -0
  251. package/docs/fundamentals/systems/overlays/overview.md +118 -0
  252. package/docs/fundamentals/systems/overlays/rationale.md +232 -0
  253. package/docs/fundamentals/systems/overlays/scope.md +176 -0
  254. package/docs/fundamentals/systems/overlays/use-cases.md +699 -0
  255. package/docs/fundamentals/tools/ajax/assets/naga.json +9 -0
  256. package/docs/fundamentals/tools/ajax/assets/pabu.json +9 -0
  257. package/docs/fundamentals/tools/ajax/index.md +3 -0
  258. package/docs/fundamentals/tools/ajax/overview.md +128 -0
  259. package/docs/fundamentals/tools/ajax/use-cases.md +456 -0
  260. package/docs/fundamentals/tools/helpers/action-logger.md +165 -0
  261. package/docs/fundamentals/tools/helpers/index.md +3 -0
  262. package/docs/fundamentals/tools/helpers/overview.md +30 -0
  263. package/docs/fundamentals/tools/index.md +1 -0
  264. package/docs/fundamentals/tools/singleton-manager/index.md +3 -0
  265. package/docs/fundamentals/tools/singleton-manager/overview.md +304 -0
  266. package/docs/guides/how-to/create-a-custom-field.md +200 -0
  267. package/docs/guides/how-to/extend-a-native-input.md +66 -0
  268. package/docs/guides/how-to/get-started.md +77 -0
  269. package/docs/guides/how-to/index.md +1 -0
  270. package/docs/guides/index.md +34 -0
  271. package/docs/guides/principles/definitions-and-terms.md +41 -0
  272. package/docs/guides/principles/index.md +26 -0
  273. package/docs/guides/principles/scoped-elements.md +103 -0
  274. package/docs/guides/principles/styling.md +32 -0
  275. package/docs/guides/principles/subclasser-apis.md +28 -0
  276. package/docs/override.js +15 -0
  277. package/exports/define/lion-drawer.js +3 -0
  278. package/exports/drawer.js +1 -0
  279. package/package.json +2 -2
@@ -0,0 +1,22 @@
1
+ # Node Tools >> Providence Analytics >> Dashboard ||30
2
+
3
+ An interactive overview of all aggregated [QueryResults](https://github.com/ing-bank/lion/blob/fbf0bd22378e76aa4261c2a97faf8be4f5fc461e/docs/fundamentals/node-tools/providence-analytics/QueryResult.md) can be found in the dashboard.
4
+ The dashboard is a small nodejs server (based on es-dev-server + middleware) and a frontend
5
+ application.
6
+
7
+ ## Run
8
+
9
+ Start the dashboard via `providence dashboard` to automatically open the browser and start the dashboard.
10
+
11
+ ## Interface
12
+
13
+ - Select all reference projects
14
+ - Select all target projects
15
+
16
+ ### Generate csv
17
+
18
+ When `get csv` is pressed, a `.csv` will be downloaded that can be loaded into Excel.
19
+
20
+ ## Analyzer support
21
+
22
+ Currently, `match-imports` and `match-subclasses` are supported, more analyzers will be added in the future.
@@ -0,0 +1 @@
1
+ # Node Tools >> Providence Analytics ||20
@@ -0,0 +1,192 @@
1
+ # Node Tools >> Providence Analytics >> Overview ||10
2
+
3
+ ```js script
4
+ import { html } from '@mdjs/mdjs-preview';
5
+ import { providenceFlowSvg, providenceInternalFlowSvg } from './assets/_mermaid.svg.js';
6
+ ```
7
+
8
+ Providence is the 'All Seeing Eye' that generates usage statistics by analyzing code.
9
+ It measures the effectivity and popularity of your software.
10
+ With just a few commands you can measure the impact for (breaking) changes, making
11
+ your release process more stable and predictable.
12
+
13
+ Providence can be used as a dev dependency in a project for which metrics
14
+ can be generated via analyzers (see below).
15
+ For instance for a repo "lion-based-ui" that extends @lion/\* we can answer questions like:
16
+
17
+ - **Which subsets of my product are popular?**
18
+ Which exports of reference project @lion/form-core are consumed by target project "lion-based-ui"?
19
+
20
+ - **How do sub classers consume/override my product?**
21
+ Which classes / webcomponents inside target project "lion-based-ui" extend from reference project `@lion/\*`?
22
+ Which of the methods within those classes are overridden?
23
+
24
+ - etc...
25
+
26
+ All the above results can be shown in a dashboard (see below), which allows to sort exports from reference project (@lion) based on popularity, category, consumer etc.
27
+ The dashboard allows to aggregate data from many target projects as well and will show you on a detailed (file) level how those components are being consumed by which projects.
28
+
29
+ ## Setup
30
+
31
+ ### Install providence
32
+
33
+ ```bash
34
+ npm i --save-dev providence-analytics
35
+ ```
36
+
37
+ ### Add a providence script to package.json
38
+
39
+ ```json
40
+ "scripts": {
41
+ "providence:match-imports": "providence analyze match-imports -r 'node_modules/@lion/ui/*.js'",
42
+ }
43
+ ```
44
+
45
+ > The example above illustrates how to run the "match-imports" analyzer for reference project 'lion-based-ui'. Note that it is possible to run other analyzers and configurations supported by providence as well. For a full overview of cli options, run `npx providence --help`. All supported analyzers will be viewed when running `npx providence analyze`
46
+
47
+ You are now ready to use providence in your project. All
48
+ data will be stored in json files in the folder `./providence-output`
49
+
50
+ ![CLI](https://github.com/ing-bank/lion/blob/fbf0bd22378e76aa4261c2a97faf8be4f5fc461e/docs/fundamentals/node-tools/providence-analytics/assets/provicli.gif 'CLI')
51
+
52
+ ## Setup: Dashboard
53
+
54
+ ### Add "providence:dashboard" script to package.json
55
+
56
+ ```js
57
+ ...
58
+ "scripts": {
59
+ ...
60
+ "providence:dashboard": "providence dashboard"
61
+ }
62
+ ```
63
+
64
+ ### Add providence.conf.js
65
+
66
+ ```js
67
+ export default {
68
+ referenceCollections: {
69
+ 'lion-based-ui-collection': [
70
+ './node_modules/lion-based-ui/packages/x',
71
+ './node_modules/lion-based-ui/packages/y',
72
+ ],
73
+ },
74
+ };
75
+ ```
76
+
77
+ Run `npm run providence:dashboard`
78
+
79
+ ![dashboard](https://github.com/ing-bank/lion/blob/fbf0bd22378e76aa4261c2a97faf8be4f5fc461e/docs/fundamentals/node-tools/providence-analytics/assets/providash.gif 'dashboard')
80
+
81
+ ## Setup: about result output
82
+
83
+ All output files will be stored in `./providence-output`.
84
+ This means they will be committed to git, so your colleagues don't have to
85
+ rerun the analysis (for large projects with many dependencies this can be time consuming)
86
+ and can directly start the dashboard usage metrics.
87
+ Also, note that the files serve as cache (they are stored with hashes based on project version and analyzer configuration). This means that an interrupted analysis can be
88
+ resumed later on.
89
+
90
+ ## Conceptual overview
91
+
92
+ Providence performs queries on one or more search targets.
93
+ These search targets consist of one or more software projects (javascript/html repositories)
94
+
95
+ The diagram below shows how `providenceMain` function can be used from an external context.
96
+
97
+ ```js story
98
+ export const providenceFlow = () => providenceFlowSvg;
99
+ ```
100
+
101
+ ## Flow inside providence
102
+
103
+ The diagram below depicts the flow inside the `providenceMain` function.
104
+ It uses:
105
+
106
+ - InputDataService
107
+ Used to create a data structure based on a folder (for instance the search target or
108
+ the references root). The structure creates entries for every file, which get enriched with code,
109
+ ast results, query results etc. Returns `InputData` object.
110
+ - QueryService
111
+ Requires a `queryConfig` and `InputData` object. It will perform a query (grep search or ast analysis)
112
+ and returns a `QueryResult`.
113
+ It also contains helpers for the creation of a `queryConfig`
114
+ - ReportService
115
+ The result gets outputted to the user. Currently, a log to the console and/or a dump to a json file
116
+ are available as output formats.
117
+
118
+ ```js story
119
+ export const providenceInternalFlow = () => providenceInternalFlowSvg;
120
+ ```
121
+
122
+ ## Queries
123
+
124
+ Providence requires a queries as input.
125
+ Queries are defined as objects and can be of two types:
126
+
127
+ - feature-query
128
+ - ast-analyzer
129
+
130
+ A `QueryConfig` is required as input to run the `providenceMain` function.
131
+ This object specifies the type of query and contains the relevant meta
132
+ information that will later be outputted in the `QueryResult` (the JSON object that
133
+ the `providenceMain` function returns.)
134
+
135
+ ## Analyzer Query
136
+
137
+ Analyzer queries are also created via `QueryConfig`s.
138
+
139
+ Analyzers can be described as predefined queries that use AST traversal.
140
+
141
+ Run:
142
+
143
+ ```bash
144
+ providence analyze
145
+ ```
146
+
147
+ Now you will get a list of all predefined analyzers:
148
+
149
+ - find-imports
150
+ - find-exports
151
+ - find-classes
152
+ - match-imports
153
+ - match-subclasses
154
+ - etc...
155
+
156
+ ![Analyzer query](https://github.com/ing-bank/lion/blob/fbf0bd22378e76aa4261c2a97faf8be4f5fc461e/docs/fundamentals/node-tools/providence-analytics/assets/analyzer-query.gif 'Analyzer query')
157
+
158
+ <!--
159
+ ## Running providence from its own repo
160
+
161
+ ### How to add a new search target project
162
+
163
+ ```bash
164
+ git submodule add <git-url> ./providence-input-data/search-targets/<project-name>
165
+ ```
166
+
167
+ ### How to add a reference project
168
+
169
+ By adding a reference project, you can automatically see how code in your reference project is
170
+ used across the search target projects.
171
+ Under the hood, this automatically creates a set of queries for you.
172
+
173
+ ```bash
174
+ git submodule add <git-url> ./providence-input-data/references/<project-name>
175
+ ```
176
+
177
+ ### Updating submodules
178
+
179
+ Please run:
180
+
181
+ ```bash
182
+ git submodule update --init --recursive
183
+ ```
184
+
185
+ ### Removing submodules
186
+
187
+ Please run:
188
+
189
+ ```bash
190
+ sh ./rm-submodule.sh <path/to/submodule>
191
+ ```
192
+ -->
@@ -0,0 +1 @@
1
+ # Node Tools >> Publish Docs ||10
@@ -0,0 +1,136 @@
1
+ # Node Tools >> Publish Docs >> Overview ||10
2
+
3
+ A tool that copies and processes your documentation (in a monorepo) so it can be published/shipped with your package.
4
+
5
+ It will:
6
+
7
+ - copy files into your npm package (which is especially useful for mono repositories)
8
+ - processes all markdown files by replacing all relative links to full absolute urls to the commit sha on GitHub
9
+ - have a document structure that is useable on GitHub
10
+
11
+ ## Installation
12
+
13
+ For a Mono Repository
14
+
15
+ 1. Add dependency
16
+
17
+ ```bash
18
+ npm i -D publish-docs
19
+ ```
20
+
21
+ 2. Add to your `packages/[my-package]/package.json`:
22
+
23
+ ```js
24
+ "scripts": {
25
+ "prepublishOnly": "publish-docs --github-url https://github.com/ing-bank/lion/ --git-root-dir ../../"
26
+ }
27
+ ```
28
+
29
+ 3. Replace you `packages/[my-package]/README.md` with
30
+
31
+ ```md
32
+ # My Pkg
33
+
34
+ [=> See Source <=](https://github.com/ing-bank/lion/blob/fbf0bd22378e76aa4261c2a97faf8be4f5fc461e/docs/fundamentals/docs/deep/dir/overview.md)
35
+ ```
36
+
37
+ ## CLI flags
38
+
39
+ | name | type | description |
40
+ | ------------ | ------ | -------------------------------------------------------------------------------------------- |
41
+ | github-url | string | Defines which GitHub Urls should be generated for relative links (mandatory) |
42
+ | project-dir | string | The directory of your project/package. Defaults to the current working directory |
43
+ | git-root-dir | string | The directory of your git entry point. Defaults to the current working directory |
44
+ | copy-dir | string | Allows to copies the content of a folder into the copy-target (relative to the git-root-dir) |
45
+ | copy-target | string | Copies all files into the target (e.g. flattening the directory structure) |
46
+
47
+ Examples:
48
+
49
+ ```
50
+ cd packages/my-pkg/
51
+ publish-docs --github-url https://github.com/ing-bank/lion/ --git-root-dir ../../
52
+ publish-docs --github-url https://github.com/ing-bank/lion/ --git-root-dir ../../ --copy-dir docs/my-components/assets
53
+ ```
54
+
55
+ ## More Files
56
+
57
+ Often it makes sense to have multiple documentation files. If you want to bring them along you can do so by adding more `[=> See Source <=]` hooks.
58
+
59
+ Bring the `overview.md` in a docs folder along.
60
+
61
+ 👉 `packages/[my-package]/docs/overview.md`
62
+
63
+ ```md
64
+ [=> See Source <=](https://github.com/ing-bank/lion/blob/fbf0bd22378e76aa4261c2a97faf8be4f5fc461e/docs/fundamentals/docs/deep/dir/overview.md)
65
+ ```
66
+
67
+ Add a `use-cases.md`
68
+
69
+ 👉 `packages/[my-package]/docs/use-cases.md`
70
+
71
+ ```md
72
+ [=> See Source <=](https://github.com/ing-bank/lion/blob/fbf0bd22378e76aa4261c2a97faf8be4f5fc461e/docs/fundamentals/docs/deep/dir/use-cases.md)
73
+ ```
74
+
75
+ So you will end up with something like this in your package.
76
+
77
+ ```
78
+ .
79
+ ├── docs
80
+ │ ├── use-cases.md
81
+ │ └── overview.md
82
+ ├── src
83
+ │ ├── my-code.js
84
+ │ └── ...
85
+ ├── package.json
86
+ └── README.md
87
+ ```
88
+
89
+ Each of those md files will have a followable link on GitHub and will be replaced with the actual documentation before you publish it.
90
+
91
+ ## Copying assets
92
+
93
+ On top of markdown documentation, there is often the need to bring along accompanying assets.
94
+
95
+ For that, a copy dir can be provided.
96
+
97
+ Note: This pattern is relative to the `git-root-dir`
98
+
99
+ Therefore given the following tree
100
+
101
+ ```
102
+ .
103
+ ├── docs
104
+ │ ├── green
105
+ │ │ ├── green-data.json
106
+ │ │ └── overview.md
107
+ │ └── red
108
+ │ ├── assets
109
+ │ │ ├── more
110
+ │ │ │ └── red-data.json
111
+ │ │ └── red-data.json
112
+ │ └── overview.md
113
+ └── packages
114
+ └── my-pkg <-- executed here
115
+ ├── docs
116
+ │ └── overview.md
117
+ └── README.md
118
+ ```
119
+
120
+ we can copy the red assets folder by providing the following copy-dir
121
+
122
+ ```js
123
+ "prepublish": "publish-docs --github-url https://github.com/ing-bank/lion/ --git-root-dir ../../ --copy-dir docs/red/assets"
124
+ ```
125
+
126
+ The published package will look like this
127
+
128
+ ```
129
+ ├── docs
130
+ │ ├── assets
131
+ │ │ ├── more
132
+ │ │ │ └── red-data.json
133
+ │ │ └── red-data.json
134
+ │ └── overview.md
135
+ └── README.md
136
+ ```
@@ -0,0 +1 @@
1
+ # Node Tools >> Remark Extend ||30
@@ -0,0 +1,274 @@
1
+ # Node Tools >> Remark Extend >> Overview ||10
2
+
3
+ A plugin for remark to extend markdown by importing from source files.
4
+
5
+ `remark-extend` is build to be integrated within the [unifiedjs](https://unifiedjs.com/) system.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm i -D remark-extend
11
+ ```
12
+
13
+ ````js
14
+ const unified = require('unified');
15
+ const markdown = require('remark-parse');
16
+ const mdStringify = require('remark-html');
17
+
18
+ const { remarkExtend } = require('remark-extend');
19
+
20
+ const sourceMd = [
21
+ //
22
+ '# Headline',
23
+ "```js ::import('@name/pkg/README.md')",
24
+ '```',
25
+ ].join('\n');
26
+
27
+ const parser = unified().use(markdown).use(remarkExtend).use(mdStringify);
28
+ const result = await parser.process(sourceMd);
29
+ ````
30
+
31
+ ## Importing a block
32
+
33
+ In many cases, the full file might be too much so you want to import a "block".
34
+ A block starts with a headline and ends when the next headline of an equal level starts.
35
+
36
+ ```md
37
+ ## Block one
38
+
39
+ Content of block one
40
+
41
+ ## Block two
42
+
43
+ Content of block two
44
+
45
+ ### Sub headline in block two
46
+
47
+ Still content of block two
48
+
49
+ ## Block three
50
+
51
+ Content of block three
52
+ ```
53
+
54
+ Now if you wish to import only block two you can write.
55
+
56
+ ````md
57
+ # Blew you will find Block two
58
+
59
+ ```js ::importBlock('./path/to/file.md', '## Block two')
60
+
61
+ ```
62
+ ````
63
+
64
+ ### Result after import
65
+
66
+ ```md
67
+ # Blew you will find Block two
68
+
69
+ ## Block two
70
+
71
+ Content of block two
72
+
73
+ ### Sub headline in block two
74
+
75
+ Still content of block two
76
+ ```
77
+
78
+ PS: importBlock is a faster way of writing imports for headlines
79
+
80
+ ```md
81
+ ::importBlock('./path/to/file.md', '## red')
82
+ // is the same as
83
+ ::import('./path/to/file.md', 'heading[depth=2]:has([value=red])', 'heading[depth=2]:has([value=red]) ~heading[depth=2]')
84
+ ```
85
+
86
+ ## Block Variations
87
+
88
+ Besides block there are is also `::importBlockContent`, `::importSmallBlock` and `::importSmallBlockContent`.
89
+
90
+ - `::importBlockContent` will take the same block (headline to next headline of equal level) but excludes the headline.
91
+ - `::importSmallBlock` will import a small block (headline to any next headline)
92
+
93
+ Given the following content let's compare what the content would be.
94
+
95
+ ```md
96
+ # My Package
97
+
98
+ Intro to my Package
99
+
100
+ ## Installation
101
+
102
+ How to install my package
103
+ ```
104
+
105
+ ### `::importBlock('./path/to/file.md', '# My Package')`
106
+
107
+ ```md
108
+ # My Package
109
+
110
+ Intro to my Package
111
+
112
+ ## Installation
113
+
114
+ How to install my package
115
+ ```
116
+
117
+ ### `::importBlockContent('./path/to/file.md', '# My Package')`
118
+
119
+ ```md
120
+ Intro to my Package
121
+
122
+ ## Installation
123
+
124
+ How to install my package
125
+ ```
126
+
127
+ ### `::importSmallBlock('./path/to/file.md', '# My Package')`
128
+
129
+ ```md
130
+ # My Package
131
+
132
+ Intro to my Package
133
+ ```
134
+
135
+ ### `::importSmallBlockContent('./path/to/file.md', '# My Package')`
136
+
137
+ ```md
138
+ Intro to my Package
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Adjusting imported content
144
+
145
+ If a function gets placed in the import code block then it does get called for every node from the starting point (including the starting point).
146
+
147
+ Note: does work for `::import` and `::importBlock`
148
+
149
+ ### Adjustment Input File
150
+
151
+ 👉 `file.md`
152
+
153
+ ```md
154
+ ### Red
155
+
156
+ red is the fire
157
+ ```
158
+
159
+ #### Adjustment Extending File
160
+
161
+ The goal is to replace all red with green.
162
+
163
+ ````md
164
+ # Below you will not find any read
165
+
166
+ ```js ::import('./path/to/file.md')
167
+ module.exports.replaceSection = node => {
168
+ if (node.value) {
169
+ node.value = node.value.replace(/red/g, 'green').replace(/Red/g, 'Green');
170
+ }
171
+ return node;
172
+ };
173
+ ```
174
+ ````
175
+
176
+ This function gets called with these nodes in order.
177
+
178
+ 1. root
179
+ 2. heading
180
+ 3. text
181
+ 4. paragraph
182
+ 5. text
183
+
184
+ #### Adjustment Result
185
+
186
+ ```md
187
+ # Below you will not find any 'red'
188
+
189
+ ### Green
190
+
191
+ green is the fire
192
+ ```
193
+
194
+ ---
195
+
196
+ It's also possible to globally define a replace function.
197
+ The example below shows the config object that is provided to the `remarkExtend` function.
198
+ Note that local replacements are run after global replacements.
199
+
200
+ ```js
201
+ { globalReplaceFunction: node => {
202
+ if (node.type === 'link') {
203
+ // All internal links to '/systems/' (like '(../../fundamentals/systems/overlays/configuration.md)'),
204
+ // will be changed into '/web-systems/' ('(../../fundamentals/web-systems/overlays/configuration.md)').
205
+ node.url = node.url.replace(/\systems\/g, '/web-systems/');
206
+ }
207
+ return node;
208
+ }};
209
+ ```
210
+
211
+ ## Import selection
212
+
213
+ For `::import` you can provide a start and end selector based on [unist-util-select](https://github.com/syntax-tree/unist-util-select#support).
214
+
215
+ Some examples are:
216
+
217
+ - `:root` for the top of the markdown file
218
+ - `:scope:last-child` for the end of the markdown file
219
+ - `heading:has([value=Red])` first heading with a text value of Red (e.g. ### Red)
220
+ - `heading[depth=2]` first second level heading (e.g. ## Something)
221
+ - `heading[depth=2]:has([value=Red]) ~ heading[depth=2]` following h2 after h2 with "Red" (e.g. ## Red ... ## Something)
222
+
223
+ ### Markdown AST
224
+
225
+ All adjustments to the markdown file happen via the markdown AST (Abstract Syntax Tree).
226
+
227
+ You can explore it via the [ASTExplorer](https://astexplorer.net/). (> Markdown > remark)
228
+
229
+ ```md
230
+ ### Red
231
+
232
+ red is the fire
233
+ ```
234
+
235
+ Resulting AST.
236
+
237
+ ```json
238
+ {
239
+ "type": "root",
240
+ "children": [
241
+ {
242
+ "type": "heading",
243
+ "depth": 3,
244
+ "children": [
245
+ {
246
+ "type": "text",
247
+ "value": "Red"
248
+ }
249
+ ]
250
+ },
251
+ {
252
+ "type": "paragraph",
253
+ "children": [
254
+ {
255
+ "type": "text",
256
+ "value": "red is the fire"
257
+ }
258
+ ]
259
+ }
260
+ ]
261
+ }
262
+ ```
263
+
264
+ ### Usage in import
265
+
266
+ If you full control of what the start and end selector should be then you can use `::import`.
267
+
268
+ To for example import everything that is between `## Red` and `## More Red` you can use something like this.
269
+
270
+ ````md
271
+ ```::import('./path/to/file.md', 'heading[depth=2]:has([value=Red])', 'heading[depth=2]:has([value=More Red])')
272
+
273
+ ```
274
+ ````
@@ -0,0 +1 @@
1
+ # Node Tools >> Extend Docs ||5