@duetds/cli 2.6.11 → 2.7.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 (249) hide show
  1. package/package.json +7 -8
  2. package/src/index.js +21 -0
  3. package/src/main.js +19 -19
  4. package/templates/angular/12.2.16/.browserlistrc +16 -0
  5. package/templates/angular/12.2.16/.depcheckrc +2 -0
  6. package/templates/angular/12.2.16/.editorconfig +16 -0
  7. package/templates/angular/12.2.16/.eslintrc.json +51 -0
  8. package/templates/angular/{.prettierignore → 12.2.16/.prettierignore} +0 -0
  9. package/templates/angular/12.2.16/.prettierrc +14 -0
  10. package/templates/angular/12.2.16/LICENSE.md +29 -0
  11. package/templates/angular/{README.md → 12.2.16/README.md} +5 -3
  12. package/templates/angular/{angular.json → 12.2.16/angular.json} +15 -4
  13. package/templates/angular/12.2.16/config/jest.base.ts +17 -0
  14. package/templates/angular/12.2.16/config/jest.setup.ts +24 -0
  15. package/templates/angular/12.2.16/package.file +58 -0
  16. package/templates/angular/12.2.16/playwright.config.ts +26 -0
  17. package/templates/angular/12.2.16/src/app/agreement.model.ts +3 -0
  18. package/templates/angular/12.2.16/src/app/app-routing.module.ts +11 -0
  19. package/templates/angular/{src → 12.2.16/src}/app/app.component.html +0 -0
  20. package/templates/angular/{src → 12.2.16/src}/app/app.component.scss +0 -0
  21. package/templates/angular/{src → 12.2.16/src}/app/app.component.ts +1 -1
  22. package/templates/angular/{src → 12.2.16/src}/app/app.module.ts +5 -11
  23. package/templates/angular/12.2.16/src/app/currency-formatter.service.ts +12 -0
  24. package/templates/angular/12.2.16/src/app/footer/footer.component.html +22 -0
  25. package/templates/angular/{src → 12.2.16/src}/app/footer/footer.component.scss +0 -0
  26. package/templates/angular/{src → 12.2.16/src}/app/footer/footer.component.ts +1 -1
  27. package/templates/angular/12.2.16/src/app/header/header.component.html +1 -0
  28. package/templates/angular/{src/app/index-page/index-page.component.scss → 12.2.16/src/app/header/header.component.scss} +0 -0
  29. package/templates/angular/12.2.16/src/app/header/header.component.ts +10 -0
  30. package/templates/angular/12.2.16/src/app/index-page/index-page.component.html +49 -0
  31. package/templates/angular/{src/app/injuries-page/injuries-page.component.scss → 12.2.16/src/app/index-page/index-page.component.scss} +0 -0
  32. package/templates/angular/12.2.16/src/app/index-page/index-page.component.ts +61 -0
  33. package/templates/angular/12.2.16/src/app/investment-amount/investment-amount.component.html +87 -0
  34. package/templates/angular/{src/app/insurance-page/insurance-page.component.scss → 12.2.16/src/app/investment-amount/investment-amount.component.scss} +0 -0
  35. package/templates/angular/12.2.16/src/app/investment-amount/investment-amount.component.ts +31 -0
  36. package/templates/angular/12.2.16/src/app/investment-origin/investment-origin.component.html +12 -0
  37. package/templates/angular/{src/assets/.gitkeep → 12.2.16/src/app/investment-origin/investment-origin.component.scss} +0 -0
  38. package/templates/angular/12.2.16/src/app/investment-origin/investment-origin.component.ts +24 -0
  39. package/templates/angular/12.2.16/src/app/summary/summary.component.html +74 -0
  40. package/templates/angular/12.2.16/src/app/summary/summary.component.scss +0 -0
  41. package/templates/angular/12.2.16/src/app/summary/summary.component.ts +16 -0
  42. package/templates/angular/12.2.16/src/assets/.gitkeep +0 -0
  43. package/templates/angular/{src → 12.2.16/src}/assets/img/android-chrome-192x192.png +0 -0
  44. package/templates/angular/{src → 12.2.16/src}/assets/img/apple-touch-icon-180x180.png +0 -0
  45. package/templates/angular/{src → 12.2.16/src}/assets/img/splash-screen-icon-512x512.png +0 -0
  46. package/templates/angular/{src → 12.2.16/src}/environments/environment.prod.ts +1 -1
  47. package/templates/angular/{src → 12.2.16/src}/environments/environment.ts +1 -1
  48. package/templates/angular/{src → 12.2.16/src}/favicon.ico +0 -0
  49. package/templates/angular/{src → 12.2.16/src}/index.html +1 -1
  50. package/templates/angular/{src → 12.2.16/src}/main.ts +0 -0
  51. package/templates/angular/{src → 12.2.16/src}/manifest.json +0 -0
  52. package/templates/angular/{src → 12.2.16/src}/polyfills.ts +0 -0
  53. package/templates/angular/{src → 12.2.16/src}/styles.scss +0 -0
  54. package/templates/angular/12.2.16/src/tests/app.test.ts +13 -0
  55. package/templates/angular/12.2.16/src/tests/playwright/playwright.test.ts +54 -0
  56. package/templates/angular/12.2.16/src/tests/playwright/playwright.test.ts-snapshots/angular-13-2-4-1-chromium-darwin.png +0 -0
  57. package/templates/angular/12.2.16/src/tests/playwright/playwright.test.ts-snapshots/angular-13-2-4-2-chromium-darwin.png +0 -0
  58. package/templates/angular/12.2.16/src/tests/playwright/playwright.test.ts-snapshots/angular-13-2-4-3-chromium-darwin.png +0 -0
  59. package/templates/angular/12.2.16/src/tests/playwright/playwright.test.ts-snapshots/angular-13-2-4-4-chromium-darwin.png +0 -0
  60. package/templates/angular/12.2.16/src/tests/playwright/playwright.test.ts-snapshots/angular-13-2-4-5-chromium-darwin.png +0 -0
  61. package/templates/angular/12.2.16/src/tests/playwright/playwright.test.ts-snapshots/code-chromium-darwin.json +16 -0
  62. package/templates/angular/12.2.16/src/utils/string.utils.ts +1 -0
  63. package/templates/angular/{tsconfig.app.json → 12.2.16/tsconfig.app.json} +0 -1
  64. package/templates/angular/{tsconfig.base.json → 12.2.16/tsconfig.base.json} +1 -1
  65. package/templates/angular/12.2.16/tsconfig.json +8 -0
  66. package/templates/angular/12.2.16/tsconfig.spec.json +15 -0
  67. package/templates/angular/{tslint.json → 12.2.16/tslint.json} +0 -0
  68. package/templates/angular/13.2.4/.browserlistrc +16 -0
  69. package/templates/angular/13.2.4/.depcheckrc +2 -0
  70. package/templates/angular/13.2.4/.editorconfig +16 -0
  71. package/templates/angular/13.2.4/.eslintrc.json +51 -0
  72. package/templates/{html → angular/13.2.4}/.prettierignore +0 -0
  73. package/templates/angular/13.2.4/.prettierrc +14 -0
  74. package/templates/angular/13.2.4/LICENSE.md +29 -0
  75. package/templates/angular/13.2.4/README.md +32 -0
  76. package/templates/angular/13.2.4/angular.json +122 -0
  77. package/templates/angular/13.2.4/config/jest.base.ts +17 -0
  78. package/templates/angular/13.2.4/config/jest.setup.ts +24 -0
  79. package/templates/angular/13.2.4/package.file +59 -0
  80. package/templates/angular/13.2.4/playwright.config.ts +26 -0
  81. package/templates/angular/13.2.4/src/app/agreement.model.ts +3 -0
  82. package/templates/angular/13.2.4/src/app/app-routing.module.ts +11 -0
  83. package/templates/angular/13.2.4/src/app/app.component.html +5 -0
  84. package/templates/angular/13.2.4/src/app/app.component.scss +0 -0
  85. package/templates/angular/13.2.4/src/app/app.component.ts +10 -0
  86. package/templates/angular/13.2.4/src/app/app.module.ts +21 -0
  87. package/templates/angular/13.2.4/src/app/currency-formatter.service.ts +12 -0
  88. package/templates/angular/13.2.4/src/app/footer/footer.component.html +22 -0
  89. package/templates/angular/13.2.4/src/app/footer/footer.component.scss +0 -0
  90. package/templates/angular/13.2.4/src/app/footer/footer.component.ts +10 -0
  91. package/templates/angular/13.2.4/src/app/header/header.component.html +1 -0
  92. package/templates/angular/13.2.4/src/app/header/header.component.scss +0 -0
  93. package/templates/angular/13.2.4/src/app/header/header.component.ts +10 -0
  94. package/templates/angular/13.2.4/src/app/index-page/index-page.component.html +49 -0
  95. package/templates/angular/13.2.4/src/app/index-page/index-page.component.scss +0 -0
  96. package/templates/angular/13.2.4/src/app/index-page/index-page.component.ts +61 -0
  97. package/templates/angular/13.2.4/src/app/investment-amount/investment-amount.component.html +87 -0
  98. package/templates/angular/13.2.4/src/app/investment-amount/investment-amount.component.scss +0 -0
  99. package/templates/angular/13.2.4/src/app/investment-amount/investment-amount.component.ts +31 -0
  100. package/templates/angular/13.2.4/src/app/investment-origin/investment-origin.component.html +12 -0
  101. package/templates/angular/13.2.4/src/app/investment-origin/investment-origin.component.scss +0 -0
  102. package/templates/angular/13.2.4/src/app/investment-origin/investment-origin.component.ts +24 -0
  103. package/templates/angular/13.2.4/src/app/summary/summary.component.html +74 -0
  104. package/templates/angular/13.2.4/src/app/summary/summary.component.scss +0 -0
  105. package/templates/angular/13.2.4/src/app/summary/summary.component.ts +16 -0
  106. package/templates/angular/13.2.4/src/assets/.gitkeep +0 -0
  107. package/templates/{eleventy-ssr → angular/13.2.4}/src/assets/img/android-chrome-192x192.png +0 -0
  108. package/templates/{eleventy-ssr → angular/13.2.4}/src/assets/img/apple-touch-icon-180x180.png +0 -0
  109. package/templates/{eleventy-ssr → angular/13.2.4}/src/assets/img/splash-screen-icon-512x512.png +0 -0
  110. package/templates/angular/13.2.4/src/environments/environment.prod.ts +3 -0
  111. package/templates/angular/13.2.4/src/environments/environment.ts +16 -0
  112. package/templates/{eleventy-ssr → angular/13.2.4}/src/favicon.ico +0 -0
  113. package/templates/angular/13.2.4/src/index.html +24 -0
  114. package/templates/angular/13.2.4/src/main.ts +13 -0
  115. package/templates/{react/public → angular/13.2.4/src}/manifest.json +0 -0
  116. package/templates/angular/13.2.4/src/polyfills.ts +62 -0
  117. package/templates/angular/13.2.4/src/styles.scss +3 -0
  118. package/templates/angular/13.2.4/src/tests/app.test.ts +13 -0
  119. package/templates/angular/13.2.4/src/tests/playwright/playwright.test.ts +54 -0
  120. package/templates/angular/13.2.4/src/tests/playwright/playwright.test.ts-snapshots/angular-13-2-4-1-chromium-darwin.png +0 -0
  121. package/templates/angular/13.2.4/src/tests/playwright/playwright.test.ts-snapshots/angular-13-2-4-2-chromium-darwin.png +0 -0
  122. package/templates/angular/13.2.4/src/tests/playwright/playwright.test.ts-snapshots/angular-13-2-4-3-chromium-darwin.png +0 -0
  123. package/templates/angular/13.2.4/src/tests/playwright/playwright.test.ts-snapshots/angular-13-2-4-4-chromium-darwin.png +0 -0
  124. package/templates/angular/13.2.4/src/tests/playwright/playwright.test.ts-snapshots/angular-13-2-4-5-chromium-darwin.png +0 -0
  125. package/templates/angular/13.2.4/src/tests/playwright/playwright.test.ts-snapshots/code-chromium-darwin.json +16 -0
  126. package/templates/angular/13.2.4/src/utils/string.utils.ts +1 -0
  127. package/templates/angular/13.2.4/tsconfig.app.json +9 -0
  128. package/templates/angular/13.2.4/tsconfig.base.json +17 -0
  129. package/templates/angular/13.2.4/tsconfig.json +8 -0
  130. package/templates/angular/13.2.4/tsconfig.spec.json +15 -0
  131. package/templates/eleventy/{.eleventy.js → 0.10.0/.eleventy.js} +0 -0
  132. package/templates/eleventy/{.prettierignore → 0.10.0/.prettierignore} +0 -0
  133. package/templates/eleventy/{README.md → 0.10.0/README.md} +0 -0
  134. package/templates/eleventy/{gulpfile.js → 0.10.0/gulpfile.js} +0 -0
  135. package/templates/eleventy/{package.file → 0.10.0/package.file} +0 -0
  136. package/templates/{react/public → eleventy/0.10.0/src}/assets/img/android-chrome-192x192.png +0 -0
  137. package/templates/{react/public → eleventy/0.10.0/src}/assets/img/apple-touch-icon-180x180.png +0 -0
  138. package/templates/{react/public → eleventy/0.10.0/src}/assets/img/splash-screen-icon-512x512.png +0 -0
  139. package/templates/eleventy/{src → 0.10.0/src}/css/main.scss +0 -0
  140. package/templates/eleventy/{src → 0.10.0/src}/css/partials/_example.scss +0 -0
  141. package/templates/eleventy/{src → 0.10.0/src}/data/duet.js +0 -0
  142. package/templates/{html → eleventy/0.10.0}/src/favicon.ico +0 -0
  143. package/templates/eleventy/{src → 0.10.0/src}/includes/footer.njk +0 -0
  144. package/templates/eleventy/{src → 0.10.0/src}/includes/header.njk +0 -0
  145. package/templates/eleventy/{src → 0.10.0/src}/includes/layout.njk +0 -0
  146. package/templates/eleventy/{src → 0.10.0/src}/index.njk +0 -0
  147. package/templates/eleventy/{src → 0.10.0/src}/js/scripts.js +0 -0
  148. package/templates/eleventy/{src → 0.10.0/src}/manifest.json +0 -0
  149. package/templates/eleventy/{src → 0.10.0/src}/robots.txt +0 -0
  150. package/templates/eleventy/{src → 0.10.0/src}/vahinkoasiat.njk +0 -0
  151. package/templates/eleventy/{src → 0.10.0/src}/vakuutukset.njk +0 -0
  152. package/templates/eleventy-ssr/{.eleventy.js → 0.10.0/.eleventy.js} +0 -0
  153. package/templates/eleventy-ssr/{.prettierignore → 0.10.0/.prettierignore} +0 -0
  154. package/templates/eleventy-ssr/{README.md → 0.10.0/README.md} +0 -0
  155. package/templates/eleventy-ssr/{gulpfile.js → 0.10.0/gulpfile.js} +0 -0
  156. package/templates/eleventy-ssr/{package.file → 0.10.0/package.file} +0 -0
  157. package/templates/{eleventy → eleventy-ssr/0.10.0}/src/assets/img/android-chrome-192x192.png +0 -0
  158. package/templates/{eleventy → eleventy-ssr/0.10.0}/src/assets/img/apple-touch-icon-180x180.png +0 -0
  159. package/templates/{eleventy → eleventy-ssr/0.10.0}/src/assets/img/splash-screen-icon-512x512.png +0 -0
  160. package/templates/eleventy-ssr/{src → 0.10.0/src}/css/main.scss +0 -0
  161. package/templates/eleventy-ssr/{src → 0.10.0/src}/css/partials/_example.scss +0 -0
  162. package/templates/eleventy-ssr/{src → 0.10.0/src}/data/duet.js +0 -0
  163. package/templates/{eleventy → eleventy-ssr/0.10.0}/src/favicon.ico +0 -0
  164. package/templates/eleventy-ssr/{src → 0.10.0/src}/includes/footer.njk +0 -0
  165. package/templates/eleventy-ssr/{src → 0.10.0/src}/includes/header.njk +0 -0
  166. package/templates/eleventy-ssr/{src → 0.10.0/src}/includes/layout.njk +0 -0
  167. package/templates/eleventy-ssr/{src → 0.10.0/src}/index.njk +0 -0
  168. package/templates/eleventy-ssr/{src → 0.10.0/src}/js/scripts.js +0 -0
  169. package/templates/eleventy-ssr/{src → 0.10.0/src}/manifest.json +0 -0
  170. package/templates/eleventy-ssr/{src → 0.10.0/src}/robots.txt +0 -0
  171. package/templates/eleventy-ssr/{src → 0.10.0/src}/vahinkoasiat.njk +0 -0
  172. package/templates/eleventy-ssr/{src → 0.10.0/src}/vakuutukset.njk +0 -0
  173. package/templates/{react → html/2.0.0}/.prettierignore +0 -0
  174. package/templates/html/{README.md → 2.0.0/README.md} +0 -0
  175. package/templates/html/{package.file → 2.0.0/package.file} +0 -0
  176. package/templates/{react/public → html/2.0.0/src}/favicon.ico +0 -0
  177. package/templates/html/{src → 2.0.0/src}/index.html +0 -0
  178. package/templates/react/16.14.0/.prettierignore +3 -0
  179. package/templates/react/16.14.0/LICENSE.md +29 -0
  180. package/templates/react/{README.md → 16.14.0/README.md} +2 -2
  181. package/templates/react/16.14.0/package-lock.json +15324 -0
  182. package/templates/react/16.14.0/package.file +39 -0
  183. package/templates/react/16.14.0/playwright.config.mjs +26 -0
  184. package/templates/react/16.14.0/public/assets/img/android-chrome-192x192.png +0 -0
  185. package/templates/react/16.14.0/public/assets/img/apple-touch-icon-180x180.png +0 -0
  186. package/templates/react/16.14.0/public/assets/img/splash-screen-icon-512x512.png +0 -0
  187. package/templates/react/16.14.0/public/favicon.ico +0 -0
  188. package/templates/react/{public → 16.14.0/public}/index.html +1 -1
  189. package/templates/react/16.14.0/public/manifest.json +19 -0
  190. package/templates/react/16.14.0/src/App.js +138 -0
  191. package/templates/react/16.14.0/src/components/Footer.js +24 -0
  192. package/templates/react/16.14.0/src/components/Header.js +7 -0
  193. package/templates/react/16.14.0/src/components/InvestmentAmount.js +139 -0
  194. package/templates/react/16.14.0/src/components/InvestmentOrigin.js +89 -0
  195. package/templates/react/16.14.0/src/components/Summary.js +96 -0
  196. package/templates/react/{src → 16.14.0/src}/index.js +0 -0
  197. package/templates/react/{src → 16.14.0/src}/index.scss +0 -0
  198. package/templates/react/{src → 16.14.0/src}/serviceWorker.js +0 -0
  199. package/templates/react/16.14.0/src/tests/playwright/playwright.test.mjs +54 -0
  200. package/templates/react/16.14.0/src/tests/playwright/playwright.test.mjs-snapshots/app-1-chromium-darwin.png +0 -0
  201. package/templates/react/16.14.0/src/tests/playwright/playwright.test.mjs-snapshots/app-2-chromium-darwin.png +0 -0
  202. package/templates/react/16.14.0/src/tests/playwright/playwright.test.mjs-snapshots/app-3-chromium-darwin.png +0 -0
  203. package/templates/react/16.14.0/src/tests/playwright/playwright.test.mjs-snapshots/app-4-chromium-darwin.png +0 -0
  204. package/templates/react/16.14.0/src/tests/playwright/playwright.test.mjs-snapshots/app-5-chromium-darwin.png +0 -0
  205. package/templates/react/16.14.0/src/tests/playwright/playwright.test.mjs-snapshots/code-chromium-darwin.json +16 -0
  206. package/templates/react/17.0.2/LICENSE.md +29 -0
  207. package/templates/react/17.0.2/README.md +54 -0
  208. package/templates/react/17.0.2/package-lock.json +10713 -0
  209. package/templates/react/17.0.2/package.file +39 -0
  210. package/templates/react/17.0.2/playwright.config.mjs +26 -0
  211. package/templates/react/17.0.2/public/assets/img/android-chrome-192x192.png +0 -0
  212. package/templates/react/17.0.2/public/assets/img/apple-touch-icon-180x180.png +0 -0
  213. package/templates/react/17.0.2/public/assets/img/splash-screen-icon-512x512.png +0 -0
  214. package/templates/react/17.0.2/public/favicon.ico +0 -0
  215. package/templates/react/17.0.2/public/index.html +48 -0
  216. package/templates/react/17.0.2/public/manifest.json +19 -0
  217. package/templates/react/17.0.2/src/App.js +138 -0
  218. package/templates/react/17.0.2/src/components/Footer.js +24 -0
  219. package/templates/react/17.0.2/src/components/Header.js +7 -0
  220. package/templates/react/17.0.2/src/components/InvestmentAmount.js +139 -0
  221. package/templates/react/17.0.2/src/components/InvestmentOrigin.js +89 -0
  222. package/templates/react/17.0.2/src/components/Summary.js +96 -0
  223. package/templates/react/17.0.2/src/index.js +17 -0
  224. package/templates/react/17.0.2/src/index.scss +2 -0
  225. package/templates/react/17.0.2/src/serviceWorker.js +141 -0
  226. package/templates/react/17.0.2/src/tests/playwright/playwright.test.mjs +54 -0
  227. package/templates/react/17.0.2/src/tests/playwright/playwright.test.mjs-snapshots/app-1-chromium-darwin.png +0 -0
  228. package/templates/react/17.0.2/src/tests/playwright/playwright.test.mjs-snapshots/app-2-chromium-darwin.png +0 -0
  229. package/templates/react/17.0.2/src/tests/playwright/playwright.test.mjs-snapshots/app-3-chromium-darwin.png +0 -0
  230. package/templates/react/17.0.2/src/tests/playwright/playwright.test.mjs-snapshots/app-4-chromium-darwin.png +0 -0
  231. package/templates/react/17.0.2/src/tests/playwright/playwright.test.mjs-snapshots/app-5-chromium-darwin.png +0 -0
  232. package/templates/react/17.0.2/src/tests/playwright/playwright.test.mjs-snapshots/code-chromium-darwin.json +16 -0
  233. package/templates/angular/package.file +0 -49
  234. package/templates/angular/src/app/app-routing.module.ts +0 -17
  235. package/templates/angular/src/app/footer/footer.component.html +0 -15
  236. package/templates/angular/src/app/header/header.component.html +0 -22
  237. package/templates/angular/src/app/header/header.component.scss +0 -3
  238. package/templates/angular/src/app/header/header.component.ts +0 -54
  239. package/templates/angular/src/app/index-page/index-page.component.html +0 -53
  240. package/templates/angular/src/app/index-page/index-page.component.ts +0 -30
  241. package/templates/angular/src/app/injuries-page/injuries-page.component.html +0 -37
  242. package/templates/angular/src/app/injuries-page/injuries-page.component.ts +0 -18
  243. package/templates/angular/src/app/insurance-page/insurance-page.component.html +0 -43
  244. package/templates/angular/src/app/insurance-page/insurance-page.component.ts +0 -18
  245. package/templates/angular/tsconfig.json +0 -14
  246. package/templates/react/package.file +0 -48
  247. package/templates/react/src/App.js +0 -67
  248. package/templates/react/src/components/Footer.js +0 -17
  249. package/templates/react/src/components/Header.js +0 -38
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@duetds/cli",
3
- "version": "2.6.11",
3
+ "version": "2.7.0",
4
4
  "description": "This package includes Duet Design System CLI.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "LocalTapiola Services Ltd <duetdesignsystem@lahitapiola.fi>",
7
7
  "main": "src/index.js",
8
8
  "bin": {
9
9
  "@duetds/cli": "bin/create-duet-app",
10
+ "cda": "bin/create-duet-app",
10
11
  "create-duet-app": "bin/create-duet-app"
11
12
  },
12
13
  "files": [
@@ -21,17 +22,15 @@
21
22
  "test:ci": "echo no cli tests yet"
22
23
  },
23
24
  "dependencies": {
24
- "arg": "4.1.3",
25
- "chalk": "3.0.0",
25
+ "arg": "5.0.1",
26
+ "chalk": "5.0.0",
26
27
  "esm": "3.2.25",
27
- "execa": "4.0.0",
28
- "inquirer": "7.0.4",
28
+ "inquirer": "8.2.0",
29
29
  "listr": "0.14.3",
30
- "ncp": "2.0.0",
31
- "pkg-install": "1.0.0"
30
+ "ncp": "2.0.0"
32
31
  },
33
32
  "publishConfig": {
34
33
  "access": "public"
35
34
  },
36
- "gitHead": "82c1e6f02105189828663a62d980e570239f3e33"
35
+ "gitHead": "e010002361f155b3b27f8d7b52bc3c4ebdebd2e6"
37
36
  }
package/src/index.js CHANGED
@@ -1,16 +1,28 @@
1
1
  import arg from "arg"
2
+ import fs from "fs"
2
3
  import inquirer from "inquirer"
4
+
3
5
  import { createProject } from "./main"
4
6
 
7
+ const isVersioned = ["angular", "react", "eleventy","eleventy-ssr","html"]
8
+ const versionObject = isVersioned.reduce((a, v) => ({ ...a, [v]: v}), {})
9
+ // load directory names of /templates/
10
+ for (const [key, value] of Object.entries(versionObject)) {
11
+ const versions = fs.readdirSync(`./templates/${key}`).filter(f => !f.startsWith("."))
12
+ versionObject[key] =versions
13
+ }
14
+
5
15
  function parseArgumentsIntoOptions(rawArgs) {
6
16
  const args = arg(
7
17
  {
8
18
  "--git": Boolean,
9
19
  "--install": Boolean,
10
20
  "--title": String,
21
+ "--version": String,
11
22
  "-g": "--git",
12
23
  "-i": "--install",
13
24
  "-t": "--title",
25
+ "-v": "--version",
14
26
  },
15
27
  {
16
28
  argv: rawArgs.slice(2),
@@ -21,6 +33,7 @@ function parseArgumentsIntoOptions(rawArgs) {
21
33
  title: args._[0],
22
34
  template: args._[0],
23
35
  runInstall: args["--install"] || true,
36
+ version: args["--version"] || false,
24
37
  }
25
38
  }
26
39
 
@@ -47,6 +60,13 @@ async function promptForMissingOptions(options) {
47
60
  })
48
61
  }
49
62
 
63
+ questions.push({
64
+ type: "list",
65
+ name: "version",
66
+ message: "Which version would you like to use?",
67
+ choices: (answers)=>(versionObject[answers.template.toLowerCase()])
68
+ })
69
+
50
70
  questions.push({
51
71
  type: "input",
52
72
  name: "title",
@@ -68,6 +88,7 @@ async function promptForMissingOptions(options) {
68
88
  ...options,
69
89
  template: options.template || answers.template,
70
90
  targetDirectory: options.title || answers.title,
91
+ version: options.version || answers.version,
71
92
  git: options.git || answers.git,
72
93
  }
73
94
  }
package/src/main.js CHANGED
@@ -1,16 +1,15 @@
1
1
  import chalk from "chalk"
2
2
  import fs from "fs"
3
+ import Listr from "listr"
3
4
  import ncp from "ncp"
4
5
  import path from "path"
5
6
  import { fileURLToPath } from "url"
6
7
  import { promisify } from "util"
7
- import execa from "execa"
8
- import Listr from "listr"
9
- import { projectInstall } from "pkg-install"
10
8
 
11
9
  const access = promisify(fs.access)
12
10
  const rename = promisify(fs.rename)
13
11
  const copy = promisify(ncp)
12
+ const execSync = promisify(require("child_process").exec)
14
13
 
15
14
  async function copyTemplateFiles(options) {
16
15
  return copy(options.templateDirectory, options.targetDirectory, {
@@ -31,17 +30,14 @@ async function createDeployAutomation(options) {
31
30
  }
32
31
 
33
32
  async function initGit(options) {
34
- const createRepo = await execa("git", ["init"], {
35
- cwd: options.targetDirectory,
36
- })
33
+
34
+ const createRepo = await execSync("git init", { encoding: "utf8", cwd: options.targetDirectory })
37
35
 
38
36
  if (createRepo.failed) {
39
37
  throw new Error("Failed to initialize git")
40
38
  }
41
39
 
42
- const renameBranch = await execa("git", ["checkout", "-b", "main"], {
43
- cwd: options.targetDirectory,
44
- })
40
+ const renameBranch = await execSync("git checkout -b main", { encoding: "utf8", cwd: options.targetDirectory })
45
41
 
46
42
  if (renameBranch.failed) {
47
43
  throw new Error("Failed to create main branch")
@@ -57,7 +53,14 @@ export async function createProject(options) {
57
53
  // this normalises path in windows and unix environments
58
54
  const currentFilePath = fileURLToPath(import.meta.url)
59
55
 
60
- const templateDir = path.resolve(currentFilePath, "..", "..", "templates", options.template.toLowerCase())
56
+ const templateDir = path.resolve(
57
+ currentFilePath,
58
+ "..",
59
+ "..",
60
+ "templates",
61
+ options.template.toLowerCase(),
62
+ options.version
63
+ )
61
64
  const actionsDir = path.join(path.resolve(currentFilePath, "..", ".."), ".github")
62
65
  const sharedDir = path.resolve(currentFilePath, "..", "..", "shared")
63
66
  options.templateDirectory = templateDir
@@ -72,7 +75,7 @@ export async function createProject(options) {
72
75
  process.exit(1)
73
76
  }
74
77
 
75
- try {
78
+ try {
76
79
  await access(actionsDir, fs.constants.R_OK)
77
80
  } catch (err) {
78
81
  console.log(err)
@@ -83,15 +86,15 @@ export async function createProject(options) {
83
86
  const tasks = new Listr([
84
87
  {
85
88
  title: "Copy project files",
86
- task: () => copyTemplateFiles(options),
89
+ task: async () => await copyTemplateFiles(options),
87
90
  },
88
91
  {
89
92
  title: "Copy Github Actions files",
90
- task: () => copyActionsFiles(options),
93
+ task: async () => await copyActionsFiles(options),
91
94
  },
92
95
  {
93
96
  title: "Create build and deploy automation",
94
- task: () => createDeployAutomation(options),
97
+ task: async () => await createDeployAutomation(options),
95
98
  },
96
99
  {
97
100
  title: "Configure git, npm, prettier, package.json",
@@ -104,15 +107,12 @@ export async function createProject(options) {
104
107
  },
105
108
  {
106
109
  title: "Initialize git",
107
- task: () => initGit(options),
110
+ task: async () => await initGit(options),
108
111
  enabled: () => options.git,
109
112
  },
110
113
  {
111
114
  title: "Install dependencies",
112
- task: () =>
113
- projectInstall({
114
- cwd: options.targetDirectory,
115
- }),
115
+ task: async () => await execSync(`npm i --legacy-peer-deps`, { encoding: "utf8", cwd: options.targetDirectory }),
116
116
  skip: () => (!options.runInstall ? "Pass --install to automatically install dependencies" : undefined),
117
117
  },
118
118
  ])
@@ -0,0 +1,16 @@
1
+ # This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2
+ # For additional information regarding the format and rule options, please see:
3
+ # https://github.com/browserslist/browserslist#queries
4
+
5
+ # For the full list of supported browsers by the Angular framework, please see:
6
+ # https://angular.io/guide/browser-support
7
+
8
+ # You can see what browsers were selected by your queries by running:
9
+ # npx browserslist
10
+
11
+ last 1 Chrome version
12
+ last 1 Firefox version
13
+ last 2 Edge major versions
14
+ last 2 Safari major versions
15
+ last 2 iOS major versions
16
+ Firefox ESR
@@ -0,0 +1,2 @@
1
+ ignores: ["eslint*", "@angular-eslint/*","ngx-toastr","@types/*","husky","prettier", " @typescript-eslint/*"]
2
+ skip-missing: true
@@ -0,0 +1,16 @@
1
+ # Editor configuration, see https://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ charset = utf-8
6
+ indent_style = space
7
+ indent_size = 2
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
10
+
11
+ [*.ts]
12
+ quote_type = single
13
+
14
+ [*.md]
15
+ max_line_length = off
16
+ trim_trailing_whitespace = false
@@ -0,0 +1,51 @@
1
+ {
2
+ "root": true,
3
+ "ignorePatterns": [
4
+ "projects/**/*"
5
+ ],
6
+ "overrides": [
7
+ {
8
+ "files": [
9
+ "*.ts"
10
+ ],
11
+ "parserOptions": {
12
+ "project": [
13
+ "tsconfig.json"
14
+ ],
15
+ "createDefaultProgram": true
16
+ },
17
+ "extends": [
18
+ "plugin:@angular-eslint/recommended",
19
+ "plugin:@angular-eslint/template/process-inline-templates"
20
+ ],
21
+ "rules": {
22
+ "@angular-eslint/directive-selector": [
23
+ "error",
24
+ {
25
+ "type": "attribute",
26
+ "prefix": "app",
27
+ "style": "camelCase"
28
+ }
29
+ ],
30
+ "@angular-eslint/component-selector": [
31
+ "error",
32
+ {
33
+ "type": "element",
34
+ "prefix": "app",
35
+ "style": "kebab-case"
36
+ }
37
+ ],
38
+ "@angular-eslint/no-empty-lifecycle-method": "off"
39
+ }
40
+ },
41
+ {
42
+ "files": [
43
+ "*.html"
44
+ ],
45
+ "extends": [
46
+ "plugin:@angular-eslint/template/recommended"
47
+ ],
48
+ "rules": {}
49
+ }
50
+ ]
51
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "printWidth": 120,
3
+ "singleQuote": false,
4
+ "trailingComma": "none",
5
+ "bracketSpacing": true,
6
+ "jsxBracketSameLine": false,
7
+ "semi": false,
8
+ "requirePragma": false,
9
+ "insertPragma": false,
10
+ "useTabs": false,
11
+ "tabWidth": 2,
12
+ "arrowParens": "avoid",
13
+ "proseWrap": "preserve"
14
+ }
@@ -0,0 +1,29 @@
1
+ # License
2
+
3
+ ## Authorization to access
4
+
5
+ Subject to these terms of use, LocalTapiola Services Ltd, on behalf of itself and the companies belonging to the same financial conglomerate (hereafter, individually and collectively, “LocalTapiola”) hereby grants you a limited, non-exclusive, revocable license to access and use the Duet Design System (the “Package”) solely for the purpose of performing your duties for and on behalf of LocalTapiola (the “Purpose”).
6
+
7
+ Except for the Purpose, you may not access or use the Package or reproduce, retransmit, disseminate, sell, publish, broadcast or use any of the information, content or materials available through it for any reason.
8
+
9
+ By accessing and using this Package, you agree to be bound by these terms of use.
10
+
11
+ ## Copyright
12
+
13
+ LocalTapiola reserves all copyrights, trademarks and other intellectual property rights in and to the Package and all content on the Package, as well as to any information or materials derived from them. All content and material available through the Package are the copyrighted property of LocalTapiola.
14
+
15
+ ## Trademarks
16
+
17
+ “Duet Design System” is a registered trademark of LocalTapiola. All other marks, whether registered or not, that are associated with any LocalTapiola or Turva product or service are trademarks or service marks of LocalTapiola Services Ltd. All non-LocalTapiola names or marks, if any, appearing in the Package are the property of their respective owners.
18
+
19
+ ## Disclaimer
20
+
21
+ The use of the Package is at the sole responsibility of the user. The Package is provided “as is” and “as available” without express or implied warranty or condition of any kind. LocalTapiola may at any time make changes to the Package or any of its features or functionalities. LocalTapiola also reserves the right to modify or discontinue, temporarily or permanently, functions and features of the Package, with or without notice, all without liability to you, except where prohibited by law, for any interruption, modification, or discontinuation of the Package or any of its features or functionalities.
22
+
23
+ ## Limitation of liability
24
+
25
+ To the fullest extent permitted by law, LocalTapiola accepts no liability to user or any third party for any damages, including without limitation, indirect or consequential damages or any damages whatsoever arising from use or loss of use of the Package or its content.
26
+
27
+ ## Governing law
28
+
29
+ These Terms and your use of the Package shall be governed by and construed in accordance with the substantive laws of Finland.
@@ -1,6 +1,6 @@
1
- # Duet Angular Template
1
+ # Duet Angular Example
2
2
 
3
- This an Angular project (generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.0.4) template for [Duet Design System](https://www.duetds.com). This starter template comes with support for [Duet Web Components](https://www.duetds.com/components/).
3
+ An example app built with [@duetds/angular](https://www.npmjs.com/package/@duetds/angular), demonstrating basic form handling.
4
4
 
5
5
  ## Features
6
6
 
@@ -21,10 +21,12 @@ Run `ng generate component component-name` to generate a new component. You can
21
21
 
22
22
  Run `npm run build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
23
23
 
24
+ ## Notes
25
+ This has been tested using latest node at version 17.6.0, you may need to use `npm i --legacy-peer-deps` in order to complete installation
24
26
  ## Further help
25
27
 
26
28
  To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
27
29
 
28
30
  ## Copyright
29
31
 
30
- Copyright © 2020 LocalTapiola Services Ltd. For license, please see LICENSE.md.
32
+ Copyright © 2020 LocalTapiola Services Ltd. For license, please see LICENSE.md.
@@ -83,7 +83,8 @@
83
83
  "serve": {
84
84
  "builder": "@angular-devkit/build-angular:dev-server",
85
85
  "options": {
86
- "browserTarget": "duet-angular-template:build"
86
+ "browserTarget": "duet-angular-template:build",
87
+ "port": 4200
87
88
  },
88
89
  "configurations": {
89
90
  "production": {
@@ -98,10 +99,20 @@
98
99
  }
99
100
  },
100
101
  "lint": {
101
- "builder": "@angular-devkit/build-angular:tslint",
102
+ "builder": "@angular-eslint/builder:lint",
103
+ "options": {
104
+ "lintFilePatterns": [
105
+ "src/**/*.ts",
106
+ "src/**/*.html"
107
+ ]
108
+ }
109
+ },
110
+ "test": {
111
+ "builder": "@angular-builders/jest:run",
102
112
  "options": {
103
- "tsConfig": ["tsconfig.app.json"],
104
- "exclude": ["**/node_modules/**"]
113
+ "tsConfig": "tsconfig.spec.json",
114
+ "configPath" : "config/jest.base.ts",
115
+ "globalMocks": ["getComputedStyle", "doctype", "styleTransform", "matchMedia"]
105
116
  }
106
117
  }
107
118
  }
@@ -0,0 +1,17 @@
1
+ const { pathsToModuleNameMapper } = require('ts-jest');
2
+ const { compilerOptions } = require('../tsconfig.spec.json');
3
+
4
+ module.exports = {
5
+ preset: 'jest-preset-angular',
6
+ roots: ['<rootDir>/src/'],
7
+ setupFilesAfterEnv: ["<rootDir>/config/jest.setup.ts"],
8
+ collectCoverage: true,
9
+ coverageReporters: ['html'],
10
+ coverageDirectory: 'coverage/my-app',
11
+ moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths || {}, {
12
+ prefix: '<rootDir>/'
13
+ }),
14
+ testPathIgnorePatterns : [
15
+ "<rootDir>/src/tests/playwright/"
16
+ ]
17
+ };
@@ -0,0 +1,24 @@
1
+ import 'jest-preset-angular/setup-jest';
2
+
3
+
4
+ Object.defineProperty(window, 'CSS', {value: null});
5
+ Object.defineProperty(window, 'getComputedStyle', {
6
+ value: () => {
7
+ return {
8
+ display: 'none',
9
+ appearance: ['-webkit-appearance']
10
+ };
11
+ }
12
+ });
13
+
14
+ Object.defineProperty(document, 'doctype', {
15
+ value: '<!DOCTYPE html>'
16
+ });
17
+ Object.defineProperty(document.body.style, 'transform', {
18
+ value: () => {
19
+ return {
20
+ enumerable: true,
21
+ configurable: true
22
+ };
23
+ }
24
+ });
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "duet-angular-template",
3
+ "version": "13.2.4",
4
+ "scripts": {
5
+ "ng": "ng",
6
+ "start": "ng lint; npm run serve",
7
+ "serve": "ng serve --host=0.0.0.0 --poll 500 --disableHostCheck=true",
8
+ "serve:daemon": "ng serve --host=0.0.0.0 --poll 500 --disableHostCheck=true &",
9
+ "build": "ng build",
10
+ "test": "ng test --watch=true --source-map=true --code-coverage --browsers Chrome",
11
+ "test:ci": "DEBUG=pw:webserver npx playwright test",
12
+ "lint": "ng lint"
13
+ },
14
+ "private": true,
15
+ "dependencies": {
16
+ "@angular/animations": "12.2.16",
17
+ "@angular/common": "12.2.16",
18
+ "@angular/compiler": "12.2.16",
19
+ "@angular/core": "12.2.16",
20
+ "@angular/forms": "12.2.16",
21
+ "@angular/platform-browser": "12.2.16",
22
+ "@angular/platform-browser-dynamic": "12.2.16",
23
+ "@angular/router": "12.2.16",
24
+ "@duetds/angular": "latest",
25
+ "@duetds/css": "latest",
26
+ "@duetds/icons": "latest",
27
+ "@duetds/tokens": "latest",
28
+ "rxjs": "7.5.4",
29
+ "tslib": "2.3.1",
30
+ "zone.js": "0.11.4"
31
+ },
32
+ "devDependencies": {
33
+ "@angular-builders/jest": "12.1.2",
34
+ "@angular-devkit/build-angular": "12.2.16",
35
+ "@angular-eslint/builder": "12.7.0",
36
+ "@angular-eslint/eslint-plugin": "12.7.0",
37
+ "@angular-eslint/eslint-plugin-template": "12.7.0",
38
+ "@angular-eslint/schematics": "12.7.0",
39
+ "@angular-eslint/template-parser": "12.7.0",
40
+ "@angular/cli": "12.2.16",
41
+ "@angular/compiler-cli": "12.2.16",
42
+ "@playwright/test": "1.19.2",
43
+ "@types/jest": "27.4.1",
44
+ "@types/node": "17.0.21",
45
+ "@typescript-eslint/eslint-plugin": "5.13.0",
46
+ "@typescript-eslint/parser": "5.13.0",
47
+ "codelyzer": "6.0.2",
48
+ "eslint": "8.10.0",
49
+ "eslint-config-prettier": "8.4.0",
50
+ "eslint-plugin-import": "2.25.4",
51
+ "eslint-plugin-prefer-arrow": "1.2.3",
52
+ "eslint-plugin-prettier": "4.0.0",
53
+ "eslint-plugin-unused-imports": "2.0.0",
54
+ "jest": "27.5.1",
55
+ "ts-node": "10.6.0",
56
+ "typescript": "4.3.5"
57
+ }
58
+ }
@@ -0,0 +1,26 @@
1
+ // playwright.config.ts
2
+ import { PlaywrightTestConfig, devices } from '@playwright/test';
3
+
4
+ const config: PlaywrightTestConfig = {
5
+ testDir:"src/tests/playwright",
6
+ retries: process.env.CI ? 2 : 0,
7
+ use: {
8
+ trace: 'on-first-retry',
9
+ viewport: { width: 2080, height: 2020 },
10
+ ignoreHTTPSErrors: true,
11
+ video: 'on-first-retry'
12
+ },
13
+ webServer: {
14
+ command: 'npx ng serve',
15
+ url:"http://localhost:4200/#/",
16
+ timeout: 120 * 1000,
17
+ reuseExistingServer: false
18
+ },
19
+ projects: [
20
+ {
21
+ name: 'chromium',
22
+ use: { ...devices['Desktop Chrome'] },
23
+ }
24
+ ],
25
+ };
26
+ export default config;
@@ -0,0 +1,3 @@
1
+ export class Agreement {
2
+ constructor(public readonly label: string, public readonly price: number) {}
3
+ }
@@ -0,0 +1,11 @@
1
+ import { NgModule } from "@angular/core"
2
+ import { Routes, RouterModule } from "@angular/router"
3
+ import { IndexPageComponent } from "./index-page/index-page.component"
4
+
5
+ const routes: Routes = [{ path: "", component: IndexPageComponent }]
6
+
7
+ @NgModule({
8
+ imports: [RouterModule.forRoot(routes, { scrollPositionRestoration: "enabled", useHash: true })],
9
+ exports: [RouterModule]
10
+ })
11
+ export class AppRoutingModule {}
@@ -3,7 +3,7 @@ import { Component } from "@angular/core"
3
3
  @Component({
4
4
  selector: "app-root",
5
5
  templateUrl: "./app.component.html",
6
- styleUrls: ["./app.component.scss"],
6
+ styleUrls: ["./app.component.scss"]
7
7
  })
8
8
  export class AppComponent {
9
9
  constructor() {}
@@ -6,22 +6,16 @@ import { AppRoutingModule } from "./app-routing.module"
6
6
  import { AppComponent } from "./app.component"
7
7
  import { FormsModule, ReactiveFormsModule } from "@angular/forms"
8
8
  import { IndexPageComponent } from "./index-page/index-page.component"
9
- import { InjuriesPageComponent } from "./injuries-page/injuries-page.component"
10
- import { InsurancePageComponent } from "./insurance-page/insurance-page.component"
11
9
  import { HeaderComponent } from "./header/header.component"
12
10
  import { FooterComponent } from "./footer/footer.component"
11
+ import { InvestmentAmountComponent } from './investment-amount/investment-amount.component';
12
+ import { InvestmentOriginComponent } from './investment-origin/investment-origin.component';
13
+ import { SummaryComponent } from './summary/summary.component'
13
14
 
14
15
  @NgModule({
15
- declarations: [
16
- AppComponent,
17
- IndexPageComponent,
18
- InjuriesPageComponent,
19
- InsurancePageComponent,
20
- HeaderComponent,
21
- FooterComponent,
22
- ],
16
+ declarations: [AppComponent, IndexPageComponent, HeaderComponent, FooterComponent, InvestmentAmountComponent, InvestmentOriginComponent, SummaryComponent],
23
17
  imports: [BrowserModule, FormsModule, ReactiveFormsModule, DuetComponents, AppRoutingModule],
24
18
  providers: [],
25
- bootstrap: [AppComponent],
19
+ bootstrap: [AppComponent]
26
20
  })
27
21
  export class AppModule {}
@@ -0,0 +1,12 @@
1
+ import { Injectable } from "@angular/core"
2
+ import { currencyFormatFI } from "../utils/string.utils"
3
+
4
+ @Injectable({
5
+ providedIn: "root"
6
+ })
7
+ export class CurrencyFormatterService {
8
+
9
+ format(value: number) {
10
+ return currencyFormatFI.format(value)
11
+ }
12
+ }
@@ -0,0 +1,22 @@
1
+ <duet-footer
2
+ variation="simple"
3
+ language="fi"
4
+ [menu]="[
5
+ {
6
+ label: 'Turvallisuus ja käyttöehdot',
7
+ href: '#',
8
+ external: 'true'
9
+ },
10
+ {
11
+ label: 'Evästeet',
12
+ href: '#',
13
+ external: 'true'
14
+ },
15
+ {
16
+ label: 'Henkilötietojen käsittely',
17
+ href: '#',
18
+ external: 'true'
19
+ }
20
+ ]"
21
+ >
22
+ </duet-footer>
@@ -3,7 +3,7 @@ import { Component } from "@angular/core"
3
3
  @Component({
4
4
  selector: "app-footer",
5
5
  templateUrl: "./footer.component.html",
6
- styleUrls: ["./footer.component.scss"],
6
+ styleUrls: ["./footer.component.scss"]
7
7
  })
8
8
  export class FooterComponent {
9
9
  constructor() {}
@@ -0,0 +1 @@
1
+ <duet-header logo-href="" [back]="{ label: 'Takaisin', href: '/' }"></duet-header>
@@ -0,0 +1,10 @@
1
+ import { Component } from "@angular/core"
2
+
3
+ @Component({
4
+ selector: "app-header",
5
+ templateUrl: "./header.component.html",
6
+ styleUrls: ["./header.component.scss"]
7
+ })
8
+ export class HeaderComponent {
9
+ constructor() {}
10
+ }