@contember/create 2.1.0-alpha.2 → 2.1.0-alpha.20

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 (282) hide show
  1. package/dist/development/src/commands/WorkspaceCreateCommand.cjs +37 -23
  2. package/dist/development/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
  3. package/dist/development/src/commands/WorkspaceCreateCommand.js +37 -23
  4. package/dist/development/src/commands/WorkspaceCreateCommand.js.map +1 -1
  5. package/dist/development/src/lib/FileSystem.cjs +1 -0
  6. package/dist/development/src/lib/FileSystem.cjs.map +1 -1
  7. package/dist/development/src/lib/FileSystem.js +1 -0
  8. package/dist/development/src/lib/FileSystem.js.map +1 -1
  9. package/dist/development/src/lib/TemplateInstaller.cjs +24 -5
  10. package/dist/development/src/lib/TemplateInstaller.cjs.map +1 -1
  11. package/dist/development/src/lib/TemplateInstaller.js +24 -5
  12. package/dist/development/src/lib/TemplateInstaller.js.map +1 -1
  13. package/dist/development/src/lib/packageManagerDetector.cjs +22 -0
  14. package/dist/development/src/lib/packageManagerDetector.cjs.map +1 -0
  15. package/dist/development/src/lib/packageManagerDetector.js +22 -0
  16. package/dist/development/src/lib/packageManagerDetector.js.map +1 -0
  17. package/dist/production/src/commands/WorkspaceCreateCommand.cjs +37 -23
  18. package/dist/production/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
  19. package/dist/production/src/commands/WorkspaceCreateCommand.js +37 -23
  20. package/dist/production/src/commands/WorkspaceCreateCommand.js.map +1 -1
  21. package/dist/production/src/lib/FileSystem.cjs +1 -0
  22. package/dist/production/src/lib/FileSystem.cjs.map +1 -1
  23. package/dist/production/src/lib/FileSystem.js +1 -0
  24. package/dist/production/src/lib/FileSystem.js.map +1 -1
  25. package/dist/production/src/lib/TemplateInstaller.cjs +24 -5
  26. package/dist/production/src/lib/TemplateInstaller.cjs.map +1 -1
  27. package/dist/production/src/lib/TemplateInstaller.js +24 -5
  28. package/dist/production/src/lib/TemplateInstaller.js.map +1 -1
  29. package/dist/production/src/lib/packageManagerDetector.cjs +22 -0
  30. package/dist/production/src/lib/packageManagerDetector.cjs.map +1 -0
  31. package/dist/production/src/lib/packageManagerDetector.js +22 -0
  32. package/dist/production/src/lib/packageManagerDetector.js.map +1 -0
  33. package/dist/types/commands/WorkspaceCreateCommand.d.ts +4 -2
  34. package/dist/types/commands/WorkspaceCreateCommand.d.ts.map +1 -1
  35. package/dist/types/lib/FileSystem.d.ts +1 -0
  36. package/dist/types/lib/FileSystem.d.ts.map +1 -1
  37. package/dist/types/lib/TemplateInstaller.d.ts.map +1 -1
  38. package/dist/types/lib/packageManagerDetector.d.ts +3 -0
  39. package/dist/types/lib/packageManagerDetector.d.ts.map +1 -0
  40. package/dist/types/tsconfig.tsbuildinfo +1 -1
  41. package/package.json +7 -3
  42. package/resources/templates/default/.gitignore.dist +154 -0
  43. package/resources/templates/default/README.md +98 -0
  44. package/resources/templates/{template-workspace → default}/admin/.env.development +1 -0
  45. package/resources/templates/{template-workspace → default}/admin/app/components/layout.tsx +7 -3
  46. package/resources/templates/default/admin/app/components/navigation.tsx +85 -0
  47. package/resources/templates/{template-workspace → default}/admin/app/index.tsx +4 -4
  48. package/resources/templates/default/admin/app/pages/tenant.tsx +160 -0
  49. package/resources/templates/default/admin/entrypoint/components/layout.tsx +14 -0
  50. package/resources/templates/default/admin/entrypoint/components/logged-in.tsx +47 -0
  51. package/resources/templates/default/admin/entrypoint/components/login.tsx +103 -0
  52. package/resources/templates/default/admin/entrypoint/config.ts +35 -0
  53. package/resources/templates/default/admin/entrypoint/contexts/login.tsx +18 -0
  54. package/resources/templates/default/admin/entrypoint/index.tsx +12 -0
  55. package/resources/templates/default/admin/entrypoint/login-entrypoint.tsx +24 -0
  56. package/resources/templates/default/admin/entrypoint/pages/index.tsx +48 -0
  57. package/resources/templates/default/admin/entrypoint/pages/magicLink.tsx +56 -0
  58. package/resources/templates/default/admin/entrypoint/pages/magicLinkSent.tsx +63 -0
  59. package/resources/templates/default/admin/entrypoint/pages/passwordReset.tsx +44 -0
  60. package/resources/templates/default/admin/entrypoint/pages/resetRequest.tsx +35 -0
  61. package/resources/templates/default/admin/entrypoint/pages/resetRequestSuccess.tsx +34 -0
  62. package/resources/templates/default/admin/index.css +94 -0
  63. package/resources/templates/{template-workspace → default}/admin/index.html +1 -1
  64. package/resources/templates/{template-workspace → default}/admin/lib/block-repeater/block-repeater.tsx +4 -4
  65. package/resources/templates/{template-workspace → default}/admin/lib/board/board.tsx +3 -3
  66. package/resources/templates/{template-workspace → default}/admin/lib/datagrid/column-header.tsx +1 -1
  67. package/resources/templates/{template-workspace → default}/admin/lib/datagrid/columns.tsx +8 -8
  68. package/resources/templates/default/admin/lib/datagrid/elements.tsx +59 -0
  69. package/resources/templates/{template-workspace → default}/admin/lib/datagrid/empty.tsx +1 -1
  70. package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/date.tsx +4 -4
  71. package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/relation.tsx +1 -1
  72. package/resources/templates/{template-workspace → default}/admin/lib/datagrid/pagination.tsx +1 -1
  73. package/resources/templates/{template-workspace → default}/admin/lib/datagrid/table.tsx +1 -1
  74. package/resources/templates/{template-workspace → default}/admin/lib/datagrid/ui.tsx +4 -4
  75. package/resources/templates/{template-workspace → default}/admin/lib/dict.ts +3 -1
  76. package/resources/templates/{template-workspace → default}/admin/lib/dimensions/dimensions.tsx +2 -2
  77. package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-block-toolbar.tsx +1 -1
  78. package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-canvas.tsx +2 -2
  79. package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-inline-toolbar.tsx +1 -1
  80. package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/BlockElement.tsx +2 -2
  81. package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/TableCellElementRenderer.tsx +1 -1
  82. package/resources/templates/{template-workspace → default}/admin/lib/editor/editor-block.tsx +1 -1
  83. package/resources/templates/{template-workspace → default}/admin/lib/editor/sortable-block.tsx +1 -1
  84. package/resources/templates/{template-workspace → default}/admin/lib/form/upload-repeaters.tsx +61 -28
  85. package/resources/templates/{template-workspace → default}/admin/lib/form/upload.tsx +6 -3
  86. package/resources/templates/{template-workspace → default}/admin/lib/layout/layout-boxed.tsx +4 -4
  87. package/resources/templates/{template-workspace → default}/admin/lib/repeater/repeater.tsx +3 -3
  88. package/resources/templates/{template-workspace → default}/admin/lib/select/ui.tsx +5 -5
  89. package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/common.tsx +1 -1
  90. package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/memberships-control.tsx +1 -1
  91. package/resources/templates/{template-workspace → default}/admin/lib/tenant/otp/otp-setup.tsx +1 -1
  92. package/resources/templates/{template-workspace → default}/admin/lib/toast/toast.tsx +4 -5
  93. package/resources/templates/{template-workspace → default}/admin/lib/ui/button.tsx +6 -6
  94. package/resources/templates/{template-workspace → default}/admin/lib/ui/card.tsx +1 -1
  95. package/resources/templates/{template-workspace → default}/admin/lib/ui/dialog.tsx +2 -2
  96. package/resources/templates/{template-workspace → default}/admin/lib/ui/dropdown.tsx +6 -6
  97. package/resources/templates/{template-workspace → default}/admin/lib/ui/input.tsx +11 -11
  98. package/resources/templates/{template-workspace → default}/admin/lib/ui/overlay.tsx +1 -1
  99. package/resources/templates/{template-workspace → default}/admin/lib/ui/popover.tsx +1 -1
  100. package/resources/templates/{template-workspace → default}/admin/lib/ui/property-list.tsx +3 -3
  101. package/resources/templates/{template-workspace → default}/admin/lib/ui/select.tsx +3 -3
  102. package/resources/templates/{template-workspace → default}/admin/lib/ui/sheet.tsx +4 -4
  103. package/resources/templates/{template-workspace → default}/admin/lib/ui/sidebar.tsx +14 -14
  104. package/resources/templates/{template-workspace → default}/admin/lib/ui/sortable.tsx +1 -1
  105. package/resources/templates/{template-workspace → default}/admin/lib/ui/switch.tsx +1 -1
  106. package/resources/templates/{template-workspace → default}/admin/lib/ui/table.tsx +3 -3
  107. package/resources/templates/{template-workspace → default}/admin/lib/ui/textarea.tsx +3 -3
  108. package/resources/templates/{template-workspace → default}/admin/lib/ui/toggle.tsx +2 -3
  109. package/resources/templates/{template-workspace → default}/admin/lib/ui/tooltip.tsx +2 -2
  110. package/resources/templates/{template-workspace → default}/admin/lib/upload/ui.tsx +4 -4
  111. package/resources/templates/{template-workspace → default}/admin/lib/upload/upload-progress.tsx +1 -1
  112. package/resources/templates/{template-workspace → default}/admin/lib/upload/view.tsx +3 -3
  113. package/resources/templates/{template-workspace → default}/admin/package.json +5 -2
  114. package/resources/templates/default/admin/postcss.config.js +5 -0
  115. package/resources/templates/default/admin/sentry.ts +26 -0
  116. package/resources/templates/{template-workspace → default}/admin/tsconfig.json +1 -9
  117. package/resources/templates/default/admin/vite-env.d.ts +12 -0
  118. package/resources/templates/default/admin/vite.config.ts +11 -0
  119. package/resources/templates/default/api/README.md +87 -0
  120. package/resources/templates/{template-workspace → default}/biome.json +1 -1
  121. package/resources/templates/default/client/README.md +285 -0
  122. package/resources/templates/{template-workspace → default}/contember.template.yaml +5 -0
  123. package/resources/templates/{template-workspace → default}/package.json +1 -1
  124. package/resources/templates/default/scripts/generate-client.sh +7 -0
  125. package/resources/templates/default/scripts/update-ui-lib.sh +344 -0
  126. package/src/commands/WorkspaceCreateCommand.ts +41 -24
  127. package/src/lib/FileSystem.ts +1 -0
  128. package/src/lib/TemplateInstaller.ts +30 -7
  129. package/src/lib/packageManagerDetector.ts +24 -0
  130. package/resources/templates/template-workspace/.gitignore.dist +0 -3
  131. package/resources/templates/template-workspace/admin/app/components/navigation.tsx +0 -1
  132. package/resources/templates/template-workspace/admin/index.css +0 -53
  133. package/resources/templates/template-workspace/admin/index.tsx +0 -268
  134. package/resources/templates/template-workspace/admin/lib/datagrid/elements.tsx +0 -48
  135. package/resources/templates/template-workspace/admin/postcss.config.js +0 -6
  136. package/resources/templates/template-workspace/admin/tailwind.config.js +0 -73
  137. package/resources/templates/template-workspace/admin/vite-env.d.ts +0 -7
  138. package/resources/templates/template-workspace/scripts/generate-client.sh +0 -8
  139. /package/resources/templates/{template-workspace → default}/.github/scripts/setup-actions-variables.sh +0 -0
  140. /package/resources/templates/{template-workspace → default}/.github/workflows/deploy.yaml +0 -0
  141. /package/resources/templates/{template-workspace → default}/admin/app/components/logo.tsx +0 -0
  142. /package/resources/templates/{template-workspace → default}/admin/app/config.ts +0 -0
  143. /package/resources/templates/{template-workspace → default}/admin/app/index.html +0 -0
  144. /package/resources/templates/{template-workspace → default}/admin/app/pages/index.tsx +0 -0
  145. /package/resources/templates/{template-workspace → default}/admin/lib/binding/binding.tsx +0 -0
  146. /package/resources/templates/{template-workspace → default}/admin/lib/binding/delete.tsx +0 -0
  147. /package/resources/templates/{template-workspace → default}/admin/lib/binding/hooks.tsx +0 -0
  148. /package/resources/templates/{template-workspace → default}/admin/lib/binding/identity.tsx +0 -0
  149. /package/resources/templates/{template-workspace → default}/admin/lib/binding/index.ts +0 -0
  150. /package/resources/templates/{template-workspace → default}/admin/lib/binding/navigation-guard-dialog.tsx +0 -0
  151. /package/resources/templates/{template-workspace → default}/admin/lib/binding/persist.tsx +0 -0
  152. /package/resources/templates/{template-workspace → default}/admin/lib/block-repeater/index.ts +0 -0
  153. /package/resources/templates/{template-workspace → default}/admin/lib/board/index.ts +0 -0
  154. /package/resources/templates/{template-workspace → default}/admin/lib/buttons/back-button.tsx +0 -0
  155. /package/resources/templates/{template-workspace → default}/admin/lib/buttons/index.ts +0 -0
  156. /package/resources/templates/{template-workspace → default}/admin/lib/buttons/link-back-button.tsx +0 -0
  157. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/cells.tsx +0 -0
  158. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/column-leaf.tsx +0 -0
  159. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/export.tsx +0 -0
  160. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/boolean.tsx +0 -0
  161. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/common.tsx +0 -0
  162. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/defined.tsx +0 -0
  163. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/enum.tsx +0 -0
  164. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/index.ts +0 -0
  165. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/mobile.tsx +0 -0
  166. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/number.tsx +0 -0
  167. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/text.tsx +0 -0
  168. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/grid.tsx +0 -0
  169. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/index.ts +0 -0
  170. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/labels.tsx +0 -0
  171. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/layout-switcher.tsx +0 -0
  172. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/loader.tsx +0 -0
  173. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/tiles.tsx +0 -0
  174. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/toolbar.tsx +0 -0
  175. /package/resources/templates/{template-workspace → default}/admin/lib/dev/index.ts +0 -0
  176. /package/resources/templates/{template-workspace → default}/admin/lib/dev/login-panel.tsx +0 -0
  177. /package/resources/templates/{template-workspace → default}/admin/lib/dev/todo.tsx +0 -0
  178. /package/resources/templates/{template-workspace → default}/admin/lib/dimensions/index.ts +0 -0
  179. /package/resources/templates/{template-workspace → default}/admin/lib/editor/block-editor.tsx +0 -0
  180. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/baseEditorPlugins.tsx +0 -0
  181. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/buttons.tsx +0 -0
  182. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-editable-canvas.tsx +0 -0
  183. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/AnchorRenderer.tsx +0 -0
  184. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/HeadingRenderer.tsx +0 -0
  185. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/HorizontalRuleRenderer.tsx +0 -0
  186. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/ListItemRenderer.tsx +0 -0
  187. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/OrderedListRenderer.tsx +0 -0
  188. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/ParagraphRenderer.tsx +0 -0
  189. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/ScrollTargetRenderer.tsx +0 -0
  190. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/TableElementRenderer.tsx +0 -0
  191. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/TableRowElementRenderer.tsx +0 -0
  192. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/UnorderedListRenderer.tsx +0 -0
  193. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/index.ts +0 -0
  194. /package/resources/templates/{template-workspace → default}/admin/lib/editor/index.ts +0 -0
  195. /package/resources/templates/{template-workspace → default}/admin/lib/editor/plugins.tsx +0 -0
  196. /package/resources/templates/{template-workspace → default}/admin/lib/editor/rich-text-view.tsx +0 -0
  197. /package/resources/templates/{template-workspace → default}/admin/lib/editor/rich-text.tsx +0 -0
  198. /package/resources/templates/{template-workspace → default}/admin/lib/errors/error-boundary.tsx +0 -0
  199. /package/resources/templates/{template-workspace → default}/admin/lib/errors/index.ts +0 -0
  200. /package/resources/templates/{template-workspace → default}/admin/lib/errors/use-error-formatter.ts +0 -0
  201. /package/resources/templates/{template-workspace → default}/admin/lib/field/formatted-field.tsx +0 -0
  202. /package/resources/templates/{template-workspace → default}/admin/lib/field/index.ts +0 -0
  203. /package/resources/templates/{template-workspace → default}/admin/lib/form/container.tsx +0 -0
  204. /package/resources/templates/{template-workspace → default}/admin/lib/form/index.ts +0 -0
  205. /package/resources/templates/{template-workspace → default}/admin/lib/form/inputs.tsx +0 -0
  206. /package/resources/templates/{template-workspace → default}/admin/lib/form/labels.tsx +0 -0
  207. /package/resources/templates/{template-workspace → default}/admin/lib/form/select.tsx +0 -0
  208. /package/resources/templates/{template-workspace → default}/admin/lib/form/ui.tsx +0 -0
  209. /package/resources/templates/{template-workspace → default}/admin/lib/formatting/formatting.ts +0 -0
  210. /package/resources/templates/{template-workspace → default}/admin/lib/formatting/index.ts +0 -0
  211. /package/resources/templates/{template-workspace → default}/admin/lib/images/formatImageResizeUrl.ts +0 -0
  212. /package/resources/templates/{template-workspace → default}/admin/lib/images/index.ts +0 -0
  213. /package/resources/templates/{template-workspace → default}/admin/lib/labels/enum-labels.ts +0 -0
  214. /package/resources/templates/{template-workspace → default}/admin/lib/labels/field-labels.ts +0 -0
  215. /package/resources/templates/{template-workspace → default}/admin/lib/labels/index.ts +0 -0
  216. /package/resources/templates/{template-workspace → default}/admin/lib/layout/index.ts +0 -0
  217. /package/resources/templates/{template-workspace → default}/admin/lib/layout/layout.tsx +0 -0
  218. /package/resources/templates/{template-workspace → default}/admin/lib/layout/slots.tsx +0 -0
  219. /package/resources/templates/{template-workspace → default}/admin/lib/outdated-application-dialog/index.ts +0 -0
  220. /package/resources/templates/{template-workspace → default}/admin/lib/outdated-application-dialog/outdated-application-dialog.tsx +0 -0
  221. /package/resources/templates/{template-workspace → default}/admin/lib/repeater/index.ts +0 -0
  222. /package/resources/templates/{template-workspace → default}/admin/lib/select/create-new.tsx +0 -0
  223. /package/resources/templates/{template-workspace → default}/admin/lib/select/filter.tsx +0 -0
  224. /package/resources/templates/{template-workspace → default}/admin/lib/select/highlight.tsx +0 -0
  225. /package/resources/templates/{template-workspace → default}/admin/lib/select/index.ts +0 -0
  226. /package/resources/templates/{template-workspace → default}/admin/lib/select/list.tsx +0 -0
  227. /package/resources/templates/{template-workspace → default}/admin/lib/select/multi-select.tsx +0 -0
  228. /package/resources/templates/{template-workspace → default}/admin/lib/select/select.tsx +0 -0
  229. /package/resources/templates/{template-workspace → default}/admin/lib/select/sortable-select.tsx +0 -0
  230. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/change-my-password.tsx +0 -0
  231. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/create-api-key.tsx +0 -0
  232. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/index.ts +0 -0
  233. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/invite.tsx +0 -0
  234. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/login.tsx +0 -0
  235. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/password-reset-request.tsx +0 -0
  236. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/password-reset.tsx +0 -0
  237. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/passwordless-signin-init.tsx +0 -0
  238. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/passwordless-signin.tsx +0 -0
  239. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/update-project-member.tsx +0 -0
  240. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/hooks/useInvite.ts +0 -0
  241. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/hooks/useInviteUser.tsx +0 -0
  242. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/index.ts +0 -0
  243. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/api-key-list.tsx +0 -0
  244. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/index.ts +0 -0
  245. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/member-delete-dialog.tsx +0 -0
  246. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/member-list.tsx +0 -0
  247. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/person-list.tsx +0 -0
  248. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/otp/index.ts +0 -0
  249. /package/resources/templates/{template-workspace → default}/admin/lib/toast/index.ts +0 -0
  250. /package/resources/templates/{template-workspace → default}/admin/lib/toast/toaster.tsx +0 -0
  251. /package/resources/templates/{template-workspace → default}/admin/lib/ui/alert-dialog.tsx +0 -0
  252. /package/resources/templates/{template-workspace → default}/admin/lib/ui/avatar.tsx +0 -0
  253. /package/resources/templates/{template-workspace → default}/admin/lib/ui/collapsible.tsx +0 -0
  254. /package/resources/templates/{template-workspace → default}/admin/lib/ui/divider.tsx +0 -0
  255. /package/resources/templates/{template-workspace → default}/admin/lib/ui/label.tsx +0 -0
  256. /package/resources/templates/{template-workspace → default}/admin/lib/ui/loader.tsx +0 -0
  257. /package/resources/templates/{template-workspace → default}/admin/lib/ui/menu.tsx +0 -0
  258. /package/resources/templates/{template-workspace → default}/admin/lib/ui/progress.tsx +0 -0
  259. /package/resources/templates/{template-workspace → default}/admin/lib/ui/scroll-area.tsx +0 -0
  260. /package/resources/templates/{template-workspace → default}/admin/lib/ui/separator.tsx +0 -0
  261. /package/resources/templates/{template-workspace → default}/admin/lib/ui/skeleton.tsx +0 -0
  262. /package/resources/templates/{template-workspace → default}/admin/lib/ui/toggle-group.tsx +0 -0
  263. /package/resources/templates/{template-workspace → default}/admin/lib/upload/dropzone.tsx +0 -0
  264. /package/resources/templates/{template-workspace → default}/admin/lib/upload/index.ts +0 -0
  265. /package/resources/templates/{template-workspace → default}/admin/lib/upload/repeater.tsx +0 -0
  266. /package/resources/templates/{template-workspace → default}/admin/lib/utils/cn.ts +0 -0
  267. /package/resources/templates/{template-workspace → default}/admin/lib/utils/createComponentOpenHooks.tsx +0 -0
  268. /package/resources/templates/{template-workspace → default}/admin/lib/utils/index.ts +0 -0
  269. /package/resources/templates/{template-workspace → default}/admin/lib/utils/uic.tsx +0 -0
  270. /package/resources/templates/{template-workspace → default}/admin/lib/utils/use-mobile.ts +0 -0
  271. /package/resources/templates/{template-workspace → default}/admin/public/favicon.png +0 -0
  272. /package/resources/templates/{template-workspace → default}/api/index.ts +0 -0
  273. /package/resources/templates/{template-workspace → default}/api/migrations/.gitkeep +0 -0
  274. /package/resources/templates/{template-workspace → default}/api/model/index.ts +0 -0
  275. /package/resources/templates/{template-workspace → default}/api/package.json +0 -0
  276. /package/resources/templates/{template-workspace → default}/api/tsconfig.json +0 -0
  277. /package/resources/templates/{template-workspace → default}/client/package.json +0 -0
  278. /package/resources/templates/{template-workspace → default}/client/src/index.ts +0 -0
  279. /package/resources/templates/{template-workspace → default}/client/tsconfig.json +0 -0
  280. /package/resources/templates/{template-workspace → default}/docker-compose.yaml +0 -0
  281. /package/resources/templates/{template-workspace → default}/tsconfig.json +0 -0
  282. /package/resources/templates/{template-workspace → default}/tsconfig.settings.json +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceCreateCommand.cjs","sources":["../../../../../packages/create/src/commands/WorkspaceCreateCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { join } from 'node:path'\nimport chalk from 'chalk'\nimport { TemplateInstaller } from '../lib/TemplateInstaller'\nimport { getPackageVersion } from '../lib/version'\n\ntype Args = {\n\tworkspaceName: string\n}\n\ntype Options = {\n}\n\nexport class WorkspaceCreateCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly templateInstaller: TemplateInstaller,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Creates a new Contember workspace')\n\t\tconfiguration.argument('workspaceName')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void> {\n\t\tconst workspaceName = input.getArgument('workspaceName')\n\t\tconst workspaceDirectory = join(process.cwd(), workspaceName)\n\t\tawait this.templateInstaller.installTemplate('@contember/template-workspace', workspaceDirectory, {\n\t\t\tversion: await getPackageVersion(),\n\t\t\tprojectName: workspaceName,\n\t\t})\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.log(createDocs(workspaceDirectory, workspaceName))\n\t}\n}\n\nconst createDocs = (workspaceDirectory: string, workspaceName: string) => `\nContember workspace was successfully created inside the directory ${workspaceDirectory}\n\nYou can now enter this directory:\n$ ${chalk.greenBright(`cd ${workspaceName}`)}\n\nInstall NPM dependencies:\n$ ${chalk.greenBright(`yarn install`)}\n\nAnd start the Contember stack:\n$ ${chalk.greenBright('yarn start')}\n\nThe following services will be accessible:\n\n- Contember Admin at http://localhost:1480\n- Contember Engine endpoints at http://localhost:1481 (you can authorize with token 0000000000000000000000000000000000000000)\n- Adminer database management tool at http://localhost:1485\n- Minio local S3 provider at http://localhost:1483 (you can sign in with contember / contember credentials)\n- MailHog testing SMTP at http://localhost:1484\n- PostgreSQL database at localhost:1482 (you can sign in with contember / contember credentials)\n\nIf you have any issues or questions, just ask here: https://github.com/contember/engine/discussions\n`\n"],"names":["Command","join","getPackageVersion"],"mappings":";;;;;;AAaO,MAAM,+BAA+BA,UAAAA,QAAuB;AAAA,EAClE,YACkB,mBAChB;AACK,UAAA;AAFW,SAAA,oBAAA;AAAA,EAAA;AAAA,EAKR,UAAU,eAA0D;AAC7E,kBAAc,YAAY,mCAAmC;AAC7D,kBAAc,SAAS,eAAe;AAAA,EAAA;AAAA,EAGvC,MAAgB,QAAQ,OAA4C;AAC7D,UAAA,gBAAgB,MAAM,YAAY,eAAe;AACvD,UAAM,qBAAqBC,UAAA,KAAK,QAAQ,IAAA,GAAO,aAAa;AAC5D,UAAM,KAAK,kBAAkB,gBAAgB,iCAAiC,oBAAoB;AAAA,MACjG,SAAS,MAAMC,QAAAA,kBAAkB;AAAA,MACjC,aAAa;AAAA,IAAA,CACb;AAED,YAAQ,IAAI,WAAW,oBAAoB,aAAa,CAAC;AAAA,EAAA;AAE3D;AAEA,MAAM,aAAa,CAAC,oBAA4B,kBAA0B;AAAA,oEACN,kBAAkB;AAAA;AAAA;AAAA,IAGlF,MAAM,YAAY,MAAM,aAAa,EAAE,CAAC;AAAA;AAAA;AAAA,IAGxC,MAAM,YAAY,cAAc,CAAC;AAAA;AAAA;AAAA,IAGjC,MAAM,YAAY,YAAY,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;"}
1
+ {"version":3,"file":"WorkspaceCreateCommand.cjs","sources":["../../../../../packages/create/src/commands/WorkspaceCreateCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { join } from 'node:path'\nimport chalk from 'chalk'\nimport { TemplateInstaller } from '../lib/TemplateInstaller'\nimport { getPackageVersion } from '../lib/version'\nimport { detectPackageManager } from '../lib/packageManagerDetector'\n\ntype Args = {\n\tprojectName: string\n}\n\ntype Options = {\n\ttemplate: string\n}\n\nexport class WorkspaceCreateCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly templateInstaller: TemplateInstaller,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Creates a new Contember project')\n\t\tconfiguration.argument('projectName')\n\t\tconfiguration.option('template').shortcut('t').valueRequired().description('Template name or remote source')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void> {\n\t\tconst projectName = input.getArgument('projectName')\n\t\tconst projectDirectory = join(process.cwd(), projectName)\n\t\tconst packageManager = detectPackageManager()\n\t\tconst template = input.getOption('template') ?? 'default'\n\n\t\tawait this.templateInstaller.installTemplate(template, projectDirectory, {\n\t\t\tversion: await getPackageVersion(),\n\t\t\tprojectName: projectName,\n\t\t\tpackageManager: packageManager,\n\t\t})\n\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.log(createDocs(projectDirectory, projectName, packageManager))\n\t}\n}\n\nconst createDocs = (projectDirectory: string, projectName: string, packageManager: string) => `\nContember project successfully created in ${projectDirectory}\n\nNext steps:\n\n1. Navigate to the project directory:\n $ ${chalk.green(`cd ${projectName}`)}\n\n2. Install dependencies:\n $ ${chalk.green(`${packageManager} install`)}\n\n3. Start the Contember stack:\n $ ${chalk.green(`${packageManager} start`)}\n\nAvailable services:\n\n${chalk.bold('UI & Admin')}\n- Contember Admin ${chalk.blue('http://localhost:1480')}\n\n${chalk.bold('API & Backend')}\n- Contember Engine API ${chalk.blue('http://localhost:1481')}\n Auth token: 0000000000000000000000000000000000000000\n\n${chalk.bold('Development Tools')}\n- PostgreSQL database ${chalk.blue('http://localhost:1482')} ${chalk.grey('credentials: contember / contember')}\n- Minio S3 storage ${chalk.blue('http://localhost:1483')}\n- Mailpit SMTP testing ${chalk.blue('http://localhost:1484')}\n- Adminer DB manager ${chalk.blue('http://localhost:1485')}\n- Minio Dashboard ${chalk.blue('http://localhost:1486')} ${chalk.grey('credentials: contember / contember')}\n\n${chalk.bold('Need help?')} Ask the community: https://github.com/orgs/contember/discussions\n`\n"],"names":["Command","join","detectPackageManager","getPackageVersion"],"mappings":";;;;;;;AAeO,MAAM,+BAA+BA,UAAAA,QAAuB;AAAA,EAClE,YACkB,mBAChB;AACK,UAAA;AAFW,SAAA,oBAAA;AAAA,EAAA;AAAA,EAKR,UAAU,eAA0D;AAC7E,kBAAc,YAAY,iCAAiC;AAC3D,kBAAc,SAAS,aAAa;AACtB,kBAAA,OAAO,UAAU,EAAE,SAAS,GAAG,EAAE,cAAA,EAAgB,YAAY,gCAAgC;AAAA,EAAA;AAAA,EAG5G,MAAgB,QAAQ,OAA4C;AAC7D,UAAA,cAAc,MAAM,YAAY,aAAa;AACnD,UAAM,mBAAmBC,UAAA,KAAK,QAAQ,IAAA,GAAO,WAAW;AACxD,UAAM,iBAAiBC,uBAAAA,qBAAqB;AAC5C,UAAM,WAAW,MAAM,UAAU,UAAU,KAAK;AAEhD,UAAM,KAAK,kBAAkB,gBAAgB,UAAU,kBAAkB;AAAA,MACxE,SAAS,MAAMC,QAAAA,kBAAkB;AAAA,MACjC;AAAA,MACA;AAAA,IAAA,CACA;AAGD,YAAQ,IAAI,WAAW,kBAAkB,aAAa,cAAc,CAAC;AAAA,EAAA;AAEvE;AAEA,MAAM,aAAa,CAAC,kBAA0B,aAAqB,mBAA2B;AAAA,4CAClD,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA,OAKrD,MAAM,MAAM,MAAM,WAAW,EAAE,CAAC;AAAA;AAAA;AAAA,OAGhC,MAAM,MAAM,GAAG,cAAc,UAAU,CAAC;AAAA;AAAA;AAAA,OAGxC,MAAM,MAAM,GAAG,cAAc,QAAQ,CAAC;AAAA;AAAA;AAAA;AAAA,EAI3C,MAAM,KAAK,YAAY,CAAC;AAAA,4BACE,MAAM,KAAK,uBAAuB,CAAC;AAAA;AAAA,EAE7D,MAAM,KAAK,eAAe,CAAC;AAAA,4BACD,MAAM,KAAK,uBAAuB,CAAC;AAAA;AAAA;AAAA,EAG7D,MAAM,KAAK,mBAAmB,CAAC;AAAA,4BACL,MAAM,KAAK,uBAAuB,CAAC,OAAO,MAAM,KAAK,oCAAoC,CAAC;AAAA,4BAC1F,MAAM,KAAK,uBAAuB,CAAC;AAAA,4BACnC,MAAM,KAAK,uBAAuB,CAAC;AAAA,4BACnC,MAAM,KAAK,uBAAuB,CAAC;AAAA,4BACnC,MAAM,KAAK,uBAAuB,CAAC,OAAO,MAAM,KAAK,oCAAoC,CAAC;AAAA;AAAA,EAEpH,MAAM,KAAK,YAAY,CAAC;AAAA;;"}
@@ -2,47 +2,61 @@ import { Command } from "@contember/cli-common";
2
2
  import { join } from "node:path";
3
3
  import chalk from "chalk";
4
4
  import { getPackageVersion } from "../lib/version.js";
5
+ import { detectPackageManager } from "../lib/packageManagerDetector.js";
5
6
  class WorkspaceCreateCommand extends Command {
6
7
  constructor(templateInstaller) {
7
8
  super();
8
9
  this.templateInstaller = templateInstaller;
9
10
  }
10
11
  configure(configuration) {
11
- configuration.description("Creates a new Contember workspace");
12
- configuration.argument("workspaceName");
12
+ configuration.description("Creates a new Contember project");
13
+ configuration.argument("projectName");
14
+ configuration.option("template").shortcut("t").valueRequired().description("Template name or remote source");
13
15
  }
14
16
  async execute(input) {
15
- const workspaceName = input.getArgument("workspaceName");
16
- const workspaceDirectory = join(process.cwd(), workspaceName);
17
- await this.templateInstaller.installTemplate("@contember/template-workspace", workspaceDirectory, {
17
+ const projectName = input.getArgument("projectName");
18
+ const projectDirectory = join(process.cwd(), projectName);
19
+ const packageManager = detectPackageManager();
20
+ const template = input.getOption("template") ?? "default";
21
+ await this.templateInstaller.installTemplate(template, projectDirectory, {
18
22
  version: await getPackageVersion(),
19
- projectName: workspaceName
23
+ projectName,
24
+ packageManager
20
25
  });
21
- console.log(createDocs(workspaceDirectory, workspaceName));
26
+ console.log(createDocs(projectDirectory, projectName, packageManager));
22
27
  }
23
28
  }
24
- const createDocs = (workspaceDirectory, workspaceName) => `
25
- Contember workspace was successfully created inside the directory ${workspaceDirectory}
29
+ const createDocs = (projectDirectory, projectName, packageManager) => `
30
+ Contember project successfully created in ${projectDirectory}
26
31
 
27
- You can now enter this directory:
28
- $ ${chalk.greenBright(`cd ${workspaceName}`)}
32
+ Next steps:
29
33
 
30
- Install NPM dependencies:
31
- $ ${chalk.greenBright(`yarn install`)}
34
+ 1. Navigate to the project directory:
35
+ $ ${chalk.green(`cd ${projectName}`)}
32
36
 
33
- And start the Contember stack:
34
- $ ${chalk.greenBright("yarn start")}
37
+ 2. Install dependencies:
38
+ $ ${chalk.green(`${packageManager} install`)}
35
39
 
36
- The following services will be accessible:
40
+ 3. Start the Contember stack:
41
+ $ ${chalk.green(`${packageManager} start`)}
37
42
 
38
- - Contember Admin at http://localhost:1480
39
- - Contember Engine endpoints at http://localhost:1481 (you can authorize with token 0000000000000000000000000000000000000000)
40
- - Adminer database management tool at http://localhost:1485
41
- - Minio local S3 provider at http://localhost:1483 (you can sign in with contember / contember credentials)
42
- - MailHog testing SMTP at http://localhost:1484
43
- - PostgreSQL database at localhost:1482 (you can sign in with contember / contember credentials)
43
+ Available services:
44
44
 
45
- If you have any issues or questions, just ask here: https://github.com/contember/engine/discussions
45
+ ${chalk.bold("UI & Admin")}
46
+ - Contember Admin ${chalk.blue("http://localhost:1480")}
47
+
48
+ ${chalk.bold("API & Backend")}
49
+ - Contember Engine API ${chalk.blue("http://localhost:1481")}
50
+ Auth token: 0000000000000000000000000000000000000000
51
+
52
+ ${chalk.bold("Development Tools")}
53
+ - PostgreSQL database ${chalk.blue("http://localhost:1482")} ${chalk.grey("credentials: contember / contember")}
54
+ - Minio S3 storage ${chalk.blue("http://localhost:1483")}
55
+ - Mailpit SMTP testing ${chalk.blue("http://localhost:1484")}
56
+ - Adminer DB manager ${chalk.blue("http://localhost:1485")}
57
+ - Minio Dashboard ${chalk.blue("http://localhost:1486")} ${chalk.grey("credentials: contember / contember")}
58
+
59
+ ${chalk.bold("Need help?")} Ask the community: https://github.com/orgs/contember/discussions
46
60
  `;
47
61
  export {
48
62
  WorkspaceCreateCommand
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceCreateCommand.js","sources":["../../../../../packages/create/src/commands/WorkspaceCreateCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { join } from 'node:path'\nimport chalk from 'chalk'\nimport { TemplateInstaller } from '../lib/TemplateInstaller'\nimport { getPackageVersion } from '../lib/version'\n\ntype Args = {\n\tworkspaceName: string\n}\n\ntype Options = {\n}\n\nexport class WorkspaceCreateCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly templateInstaller: TemplateInstaller,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Creates a new Contember workspace')\n\t\tconfiguration.argument('workspaceName')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void> {\n\t\tconst workspaceName = input.getArgument('workspaceName')\n\t\tconst workspaceDirectory = join(process.cwd(), workspaceName)\n\t\tawait this.templateInstaller.installTemplate('@contember/template-workspace', workspaceDirectory, {\n\t\t\tversion: await getPackageVersion(),\n\t\t\tprojectName: workspaceName,\n\t\t})\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.log(createDocs(workspaceDirectory, workspaceName))\n\t}\n}\n\nconst createDocs = (workspaceDirectory: string, workspaceName: string) => `\nContember workspace was successfully created inside the directory ${workspaceDirectory}\n\nYou can now enter this directory:\n$ ${chalk.greenBright(`cd ${workspaceName}`)}\n\nInstall NPM dependencies:\n$ ${chalk.greenBright(`yarn install`)}\n\nAnd start the Contember stack:\n$ ${chalk.greenBright('yarn start')}\n\nThe following services will be accessible:\n\n- Contember Admin at http://localhost:1480\n- Contember Engine endpoints at http://localhost:1481 (you can authorize with token 0000000000000000000000000000000000000000)\n- Adminer database management tool at http://localhost:1485\n- Minio local S3 provider at http://localhost:1483 (you can sign in with contember / contember credentials)\n- MailHog testing SMTP at http://localhost:1484\n- PostgreSQL database at localhost:1482 (you can sign in with contember / contember credentials)\n\nIf you have any issues or questions, just ask here: https://github.com/contember/engine/discussions\n`\n"],"names":[],"mappings":";;;;AAaO,MAAM,+BAA+B,QAAuB;AAAA,EAClE,YACkB,mBAChB;AACK,UAAA;AAFW,SAAA,oBAAA;AAAA,EAAA;AAAA,EAKR,UAAU,eAA0D;AAC7E,kBAAc,YAAY,mCAAmC;AAC7D,kBAAc,SAAS,eAAe;AAAA,EAAA;AAAA,EAGvC,MAAgB,QAAQ,OAA4C;AAC7D,UAAA,gBAAgB,MAAM,YAAY,eAAe;AACvD,UAAM,qBAAqB,KAAK,QAAQ,IAAA,GAAO,aAAa;AAC5D,UAAM,KAAK,kBAAkB,gBAAgB,iCAAiC,oBAAoB;AAAA,MACjG,SAAS,MAAM,kBAAkB;AAAA,MACjC,aAAa;AAAA,IAAA,CACb;AAED,YAAQ,IAAI,WAAW,oBAAoB,aAAa,CAAC;AAAA,EAAA;AAE3D;AAEA,MAAM,aAAa,CAAC,oBAA4B,kBAA0B;AAAA,oEACN,kBAAkB;AAAA;AAAA;AAAA,IAGlF,MAAM,YAAY,MAAM,aAAa,EAAE,CAAC;AAAA;AAAA;AAAA,IAGxC,MAAM,YAAY,cAAc,CAAC;AAAA;AAAA;AAAA,IAGjC,MAAM,YAAY,YAAY,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
1
+ {"version":3,"file":"WorkspaceCreateCommand.js","sources":["../../../../../packages/create/src/commands/WorkspaceCreateCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { join } from 'node:path'\nimport chalk from 'chalk'\nimport { TemplateInstaller } from '../lib/TemplateInstaller'\nimport { getPackageVersion } from '../lib/version'\nimport { detectPackageManager } from '../lib/packageManagerDetector'\n\ntype Args = {\n\tprojectName: string\n}\n\ntype Options = {\n\ttemplate: string\n}\n\nexport class WorkspaceCreateCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly templateInstaller: TemplateInstaller,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Creates a new Contember project')\n\t\tconfiguration.argument('projectName')\n\t\tconfiguration.option('template').shortcut('t').valueRequired().description('Template name or remote source')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void> {\n\t\tconst projectName = input.getArgument('projectName')\n\t\tconst projectDirectory = join(process.cwd(), projectName)\n\t\tconst packageManager = detectPackageManager()\n\t\tconst template = input.getOption('template') ?? 'default'\n\n\t\tawait this.templateInstaller.installTemplate(template, projectDirectory, {\n\t\t\tversion: await getPackageVersion(),\n\t\t\tprojectName: projectName,\n\t\t\tpackageManager: packageManager,\n\t\t})\n\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.log(createDocs(projectDirectory, projectName, packageManager))\n\t}\n}\n\nconst createDocs = (projectDirectory: string, projectName: string, packageManager: string) => `\nContember project successfully created in ${projectDirectory}\n\nNext steps:\n\n1. Navigate to the project directory:\n $ ${chalk.green(`cd ${projectName}`)}\n\n2. Install dependencies:\n $ ${chalk.green(`${packageManager} install`)}\n\n3. Start the Contember stack:\n $ ${chalk.green(`${packageManager} start`)}\n\nAvailable services:\n\n${chalk.bold('UI & Admin')}\n- Contember Admin ${chalk.blue('http://localhost:1480')}\n\n${chalk.bold('API & Backend')}\n- Contember Engine API ${chalk.blue('http://localhost:1481')}\n Auth token: 0000000000000000000000000000000000000000\n\n${chalk.bold('Development Tools')}\n- PostgreSQL database ${chalk.blue('http://localhost:1482')} ${chalk.grey('credentials: contember / contember')}\n- Minio S3 storage ${chalk.blue('http://localhost:1483')}\n- Mailpit SMTP testing ${chalk.blue('http://localhost:1484')}\n- Adminer DB manager ${chalk.blue('http://localhost:1485')}\n- Minio Dashboard ${chalk.blue('http://localhost:1486')} ${chalk.grey('credentials: contember / contember')}\n\n${chalk.bold('Need help?')} Ask the community: https://github.com/orgs/contember/discussions\n`\n"],"names":[],"mappings":";;;;;AAeO,MAAM,+BAA+B,QAAuB;AAAA,EAClE,YACkB,mBAChB;AACK,UAAA;AAFW,SAAA,oBAAA;AAAA,EAAA;AAAA,EAKR,UAAU,eAA0D;AAC7E,kBAAc,YAAY,iCAAiC;AAC3D,kBAAc,SAAS,aAAa;AACtB,kBAAA,OAAO,UAAU,EAAE,SAAS,GAAG,EAAE,cAAA,EAAgB,YAAY,gCAAgC;AAAA,EAAA;AAAA,EAG5G,MAAgB,QAAQ,OAA4C;AAC7D,UAAA,cAAc,MAAM,YAAY,aAAa;AACnD,UAAM,mBAAmB,KAAK,QAAQ,IAAA,GAAO,WAAW;AACxD,UAAM,iBAAiB,qBAAqB;AAC5C,UAAM,WAAW,MAAM,UAAU,UAAU,KAAK;AAEhD,UAAM,KAAK,kBAAkB,gBAAgB,UAAU,kBAAkB;AAAA,MACxE,SAAS,MAAM,kBAAkB;AAAA,MACjC;AAAA,MACA;AAAA,IAAA,CACA;AAGD,YAAQ,IAAI,WAAW,kBAAkB,aAAa,cAAc,CAAC;AAAA,EAAA;AAEvE;AAEA,MAAM,aAAa,CAAC,kBAA0B,aAAqB,mBAA2B;AAAA,4CAClD,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA,OAKrD,MAAM,MAAM,MAAM,WAAW,EAAE,CAAC;AAAA;AAAA;AAAA,OAGhC,MAAM,MAAM,GAAG,cAAc,UAAU,CAAC;AAAA;AAAA;AAAA,OAGxC,MAAM,MAAM,GAAG,cAAc,QAAQ,CAAC;AAAA;AAAA;AAAA;AAAA,EAI3C,MAAM,KAAK,YAAY,CAAC;AAAA,4BACE,MAAM,KAAK,uBAAuB,CAAC;AAAA;AAAA,EAE7D,MAAM,KAAK,eAAe,CAAC;AAAA,4BACD,MAAM,KAAK,uBAAuB,CAAC;AAAA;AAAA;AAAA,EAG7D,MAAM,KAAK,mBAAmB,CAAC;AAAA,4BACL,MAAM,KAAK,uBAAuB,CAAC,OAAO,MAAM,KAAK,oCAAoC,CAAC;AAAA,4BAC1F,MAAM,KAAK,uBAAuB,CAAC;AAAA,4BACnC,MAAM,KAAK,uBAAuB,CAAC;AAAA,4BACnC,MAAM,KAAK,uBAAuB,CAAC;AAAA,4BACnC,MAAM,KAAK,uBAAuB,CAAC,OAAO,MAAM,KAAK,oCAAoC,CAAC;AAAA;AAAA,EAEpH,MAAM,KAAK,YAAY,CAAC;AAAA;"}
@@ -31,6 +31,7 @@ class FileSystem {
31
31
  __publicField(this, "readDir", fs__namespace.readdir);
32
32
  __publicField(this, "copy", fsExtra.copy);
33
33
  __publicField(this, "unlink", fs__namespace.unlink);
34
+ __publicField(this, "remove", fs__namespace.rm);
34
35
  __publicField(this, "pathExists", async (path) => {
35
36
  try {
36
37
  await fs.access(path);
@@ -1 +1 @@
1
- {"version":3,"file":"FileSystem.cjs","sources":["../../../../../packages/create/src/lib/FileSystem.ts"],"sourcesContent":["import * as fs from 'node:fs/promises'\nimport { access } from 'node:fs/promises'\nimport { copy } from 'fs-extra'\nimport { tmpdir } from 'node:os'\n\nexport class FileSystem {\n\treadFile = fs.readFile\n\twriteFile = fs.writeFile\n\trename = fs.rename\n\treadDir = fs.readdir\n\tcopy = copy\n\tunlink = fs.unlink\n\tpathExists = async (path: string) => {\n\t\ttry {\n\t\t\tawait access(path)\n\t\t\treturn true\n\t\t} catch {\n\t\t\treturn false\n\t\t}\n\t}\n\tcreateTempDir = async () => {\n\t\treturn await fs.mkdtemp(tmpdir())\n\t}\n}\n"],"names":["fs","copy","access","tmpdir"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAKO,MAAM,WAAW;AAAA,EAAjB,cAAA;AACN,kBAAA,MAAA,YAAWA,cAAG,QAAA;AACd,kBAAA,MAAA,aAAYA,cAAG,SAAA;AACf,kBAAA,MAAA,UAASA,cAAG,MAAA;AACZ,kBAAA,MAAA,WAAUA,cAAG,OAAA;AACN,kBAAA,MAAA,QAAAC,YAAA;AACP,kBAAA,MAAA,UAASD,cAAG,MAAA;AACZ,kBAAA,MAAA,cAAa,OAAO,SAAiB;AAChC,UAAA;AACH,cAAME,GAAAA,OAAO,IAAI;AACV,eAAA;AAAA,MAAA,QACA;AACA,eAAA;AAAA,MAAA;AAAA,IACR,CACD;AACA,kBAAA,MAAA,iBAAgB,YAAY;AAC3B,aAAO,MAAMF,cAAG,QAAQG,GAAAA,QAAQ;AAAA,IAAA,CACjC;AAAA,EAAA;AACD;;"}
1
+ {"version":3,"file":"FileSystem.cjs","sources":["../../../../../packages/create/src/lib/FileSystem.ts"],"sourcesContent":["import * as fs from 'node:fs/promises'\nimport { access } from 'node:fs/promises'\nimport { copy } from 'fs-extra'\nimport { tmpdir } from 'node:os'\n\nexport class FileSystem {\n\treadFile = fs.readFile\n\twriteFile = fs.writeFile\n\trename = fs.rename\n\treadDir = fs.readdir\n\tcopy = copy\n\tunlink = fs.unlink\n\tremove = fs.rm\n\tpathExists = async (path: string) => {\n\t\ttry {\n\t\t\tawait access(path)\n\t\t\treturn true\n\t\t} catch {\n\t\t\treturn false\n\t\t}\n\t}\n\tcreateTempDir = async () => {\n\t\treturn await fs.mkdtemp(tmpdir())\n\t}\n}\n"],"names":["fs","copy","access","tmpdir"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAKO,MAAM,WAAW;AAAA,EAAjB,cAAA;AACN,kBAAA,MAAA,YAAWA,cAAG,QAAA;AACd,kBAAA,MAAA,aAAYA,cAAG,SAAA;AACf,kBAAA,MAAA,UAASA,cAAG,MAAA;AACZ,kBAAA,MAAA,WAAUA,cAAG,OAAA;AACN,kBAAA,MAAA,QAAAC,YAAA;AACP,kBAAA,MAAA,UAASD,cAAG,MAAA;AACZ,kBAAA,MAAA,UAASA,cAAG,EAAA;AACZ,kBAAA,MAAA,cAAa,OAAO,SAAiB;AAChC,UAAA;AACH,cAAME,GAAAA,OAAO,IAAI;AACV,eAAA;AAAA,MAAA,QACA;AACA,eAAA;AAAA,MAAA;AAAA,IACR,CACD;AACA,kBAAA,MAAA,iBAAgB,YAAY;AAC3B,aAAO,MAAMF,cAAG,QAAQG,GAAAA,QAAQ;AAAA,IAAA,CACjC;AAAA,EAAA;AACD;;"}
@@ -13,6 +13,7 @@ class FileSystem {
13
13
  __publicField(this, "readDir", fs.readdir);
14
14
  __publicField(this, "copy", copy);
15
15
  __publicField(this, "unlink", fs.unlink);
16
+ __publicField(this, "remove", fs.rm);
16
17
  __publicField(this, "pathExists", async (path) => {
17
18
  try {
18
19
  await access(path);
@@ -1 +1 @@
1
- {"version":3,"file":"FileSystem.js","sources":["../../../../../packages/create/src/lib/FileSystem.ts"],"sourcesContent":["import * as fs from 'node:fs/promises'\nimport { access } from 'node:fs/promises'\nimport { copy } from 'fs-extra'\nimport { tmpdir } from 'node:os'\n\nexport class FileSystem {\n\treadFile = fs.readFile\n\twriteFile = fs.writeFile\n\trename = fs.rename\n\treadDir = fs.readdir\n\tcopy = copy\n\tunlink = fs.unlink\n\tpathExists = async (path: string) => {\n\t\ttry {\n\t\t\tawait access(path)\n\t\t\treturn true\n\t\t} catch {\n\t\t\treturn false\n\t\t}\n\t}\n\tcreateTempDir = async () => {\n\t\treturn await fs.mkdtemp(tmpdir())\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAKO,MAAM,WAAW;AAAA,EAAjB,cAAA;AACN,kBAAA,MAAA,YAAW,GAAG,QAAA;AACd,kBAAA,MAAA,aAAY,GAAG,SAAA;AACf,kBAAA,MAAA,UAAS,GAAG,MAAA;AACZ,kBAAA,MAAA,WAAU,GAAG,OAAA;AACN,kBAAA,MAAA,QAAA,IAAA;AACP,kBAAA,MAAA,UAAS,GAAG,MAAA;AACZ,kBAAA,MAAA,cAAa,OAAO,SAAiB;AAChC,UAAA;AACH,cAAM,OAAO,IAAI;AACV,eAAA;AAAA,MAAA,QACA;AACA,eAAA;AAAA,MAAA;AAAA,IACR,CACD;AACA,kBAAA,MAAA,iBAAgB,YAAY;AAC3B,aAAO,MAAM,GAAG,QAAQ,QAAQ;AAAA,IAAA,CACjC;AAAA,EAAA;AACD;"}
1
+ {"version":3,"file":"FileSystem.js","sources":["../../../../../packages/create/src/lib/FileSystem.ts"],"sourcesContent":["import * as fs from 'node:fs/promises'\nimport { access } from 'node:fs/promises'\nimport { copy } from 'fs-extra'\nimport { tmpdir } from 'node:os'\n\nexport class FileSystem {\n\treadFile = fs.readFile\n\twriteFile = fs.writeFile\n\trename = fs.rename\n\treadDir = fs.readdir\n\tcopy = copy\n\tunlink = fs.unlink\n\tremove = fs.rm\n\tpathExists = async (path: string) => {\n\t\ttry {\n\t\t\tawait access(path)\n\t\t\treturn true\n\t\t} catch {\n\t\t\treturn false\n\t\t}\n\t}\n\tcreateTempDir = async () => {\n\t\treturn await fs.mkdtemp(tmpdir())\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAKO,MAAM,WAAW;AAAA,EAAjB,cAAA;AACN,kBAAA,MAAA,YAAW,GAAG,QAAA;AACd,kBAAA,MAAA,aAAY,GAAG,SAAA;AACf,kBAAA,MAAA,UAAS,GAAG,MAAA;AACZ,kBAAA,MAAA,WAAU,GAAG,OAAA;AACN,kBAAA,MAAA,QAAA,IAAA;AACP,kBAAA,MAAA,UAAS,GAAG,MAAA;AACZ,kBAAA,MAAA,UAAS,GAAG,EAAA;AACZ,kBAAA,MAAA,cAAa,OAAO,SAAiB;AAChC,UAAA;AACH,cAAM,OAAO,IAAI;AACV,eAAA;AAAA,MAAA,QACA;AACA,eAAA;AAAA,MAAA;AAAA,IACR,CACD;AACA,kBAAA,MAAA,iBAAgB,YAAY;AAC3B,aAAO,MAAM,GAAG,QAAQ,QAAQ;AAAA,IAAA,CACjC;AAAA,EAAA;AACD;"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const node_path = require("node:path");
4
4
  const jsyaml = require("js-yaml");
5
+ const degit = require("degit");
5
6
  var __defProp = Object.defineProperty;
6
7
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
8
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -9,18 +10,33 @@ class TemplateInstaller {
9
10
  constructor(resourceDir, fs) {
10
11
  this.resourceDir = resourceDir;
11
12
  this.fs = fs;
12
- __publicField(this, "localTemplates", {
13
- ["@contember/template-workspace"]: node_path.join(this.resourceDir, "templates/template-workspace")
14
- });
13
+ __publicField(this, "localTemplates");
15
14
  __publicField(this, "installTemplate", async (template, targetDir, variables = {}) => {
16
15
  let removeTemplate = () => {
17
16
  };
18
17
  if (this.localTemplates[template]) {
19
18
  template = this.localTemplates[template];
19
+ } else {
20
+ const tmpDir = await this.fs.createTempDir();
21
+ try {
22
+ const emitter = degit(template, { cache: false, force: true, verbose: true });
23
+ await emitter.clone(tmpDir);
24
+ removeTemplate = () => {
25
+ try {
26
+ this.fs.remove(tmpDir, { recursive: true, force: true });
27
+ } catch (error) {
28
+ console.error(`Failed to clean up template: ${error}`);
29
+ }
30
+ };
31
+ template = tmpDir;
32
+ } catch (error) {
33
+ throw new Error(`Failed to clone template from repository: ${error}`);
34
+ }
20
35
  }
21
36
  const templateConfigFile = node_path.join(template, "contember.template.yaml");
22
37
  if (!await this.fs.pathExists(templateConfigFile)) {
23
- throw `${template} is not a Contember template`;
38
+ removeTemplate();
39
+ throw new Error(`${template} is not a Contember template`);
24
40
  }
25
41
  const config = await this.readYaml(templateConfigFile);
26
42
  const nodeModulesDir = node_path.join(template, "node_modules");
@@ -31,7 +47,7 @@ class TemplateInstaller {
31
47
  await this.fs.copy(template, targetDir, {
32
48
  filter: (src) => !src.startsWith(nodeModulesDir) && !skippedFiles.has(src)
33
49
  });
34
- await removeTemplate();
50
+ removeTemplate();
35
51
  if (config.patchPackageJson) {
36
52
  await this.replaceFileContent(node_path.join(targetDir, "package.json"), (content) => {
37
53
  const {
@@ -74,6 +90,9 @@ class TemplateInstaller {
74
90
  const content = await this.fs.readFile(path, { encoding: "utf8" });
75
91
  return jsyaml.load(content);
76
92
  });
93
+ this.localTemplates = {
94
+ ["default"]: node_path.join(this.resourceDir, "templates/default")
95
+ };
77
96
  }
78
97
  }
79
98
  exports.TemplateInstaller = TemplateInstaller;
@@ -1 +1 @@
1
- {"version":3,"file":"TemplateInstaller.cjs","sources":["../../../../../packages/create/src/lib/TemplateInstaller.ts"],"sourcesContent":["import { join } from 'node:path'\nimport { FileSystem } from './FileSystem'\nimport jsyaml from 'js-yaml'\n\n\nexport class TemplateInstaller {\n\n\tprivate localTemplates: Record<string, string> = {\n\t\t['@contember/template-workspace']: join(this.resourceDir, 'templates/template-workspace'),\n\t}\n\n\tconstructor(\n\t\tprivate readonly resourceDir: string,\n\t\tprivate readonly fs: FileSystem,\n\t) {\n\t}\n\n\tinstallTemplate = async (\n\t\ttemplate: string,\n\t\ttargetDir: string,\n\t\tvariables: Record<string, string> = {},\n\t) => {\n\t\tlet removeTemplate = () => {\n\t\t}\n\t\tif (this.localTemplates[template]) {\n\t\t\ttemplate = this.localTemplates[template]\n\t\t}\n\n\t\tconst templateConfigFile = join(template, 'contember.template.yaml')\n\t\tif (!(await this.fs.pathExists(templateConfigFile))) {\n\t\t\tthrow `${template} is not a Contember template`\n\t\t}\n\t\tconst config = (await this.readYaml(templateConfigFile)) as {\n\t\t\ttype?: string\n\t\t\tremove?: string[]\n\t\t\tpatchPackageJson?: boolean\n\t\t\trename?: Record<string, string>\n\t\t\tcopy?: Record<string, string>\n\t\t\treplaceVariables?: string[]\n\t\t}\n\t\tconst nodeModulesDir = join(template, 'node_modules')\n\t\tconst skippedFiles = new Set([...(config.remove || []).map(it => join(template, it)), templateConfigFile])\n\t\tif (await this.fs.pathExists(targetDir)) {\n\t\t\tthrow `${targetDir} already exists`\n\t\t}\n\t\tawait this.fs.copy(template, targetDir, {\n\t\t\tfilter: src => !src.startsWith(nodeModulesDir) && !skippedFiles.has(src),\n\t\t})\n\t\tawait removeTemplate()\n\n\t\tif (config.patchPackageJson) {\n\t\t\tawait this.replaceFileContent(join(targetDir, 'package.json'), content => {\n\t\t\t\tconst {\n\t\t\t\t\tname,\n\t\t\t\t\tversion,\n\t\t\t\t\t'scripts-template': scripts,\n\t\t\t\t\tscripts: _nullScripts,\n\t\t\t\t\tlicense,\n\t\t\t\t\t...json\n\t\t\t\t} = JSON.parse(content)\n\t\t\t\treturn JSON.stringify({ scripts, ...json }, null, ' ')\n\t\t\t})\n\t\t}\n\t\tfor (const [source, target] of Object.entries(config.rename || {})) {\n\t\t\tawait this.fs.rename(join(targetDir, source), join(targetDir, target))\n\t\t}\n\t\tfor (const [source, target] of Object.entries(config.copy || {})) {\n\t\t\tawait this.fs.copy(join(targetDir, source), join(targetDir, target))\n\t\t}\n\n\t\tfor (const file of config.replaceVariables || []) {\n\t\t\tconst path = join(targetDir, file)\n\t\t\tif (!(await this.fs.pathExists(path))) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tawait this.replaceFileContent(path, content =>\n\t\t\t\tObject.entries(variables).reduce(\n\t\t\t\t\t(content, [key, value]) => content.replace(new RegExp(`\\{${key}\\}`, 'g'), value),\n\t\t\t\t\tcontent,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t}\n\n\tprivate replaceFileContent = async (path: string, replacer: (content: string) => string): Promise<void> => {\n\t\tconst content = await this.fs.readFile(path, { encoding: 'utf8' })\n\t\tconst newContent = replacer(content)\n\t\tawait this.fs.writeFile(path, newContent, { encoding: 'utf8' })\n\t}\n\n\tprivate readYaml = async <T = unknown>(path: string): Promise<T> => {\n\t\tconst content = await this.fs.readFile(path, { encoding: 'utf8' })\n\t\treturn jsyaml.load(content) as unknown as T\n\t}\n}\n"],"names":["join","content"],"mappings":"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"}
1
+ {"version":3,"file":"TemplateInstaller.cjs","sources":["../../../../../packages/create/src/lib/TemplateInstaller.ts"],"sourcesContent":["import { join } from 'node:path'\nimport { FileSystem } from './FileSystem'\nimport jsyaml from 'js-yaml'\nimport degit from 'degit'\n\n\nexport class TemplateInstaller {\n\n\tprivate localTemplates: Record<string, string>\n\n\tconstructor(\n\t\tprivate readonly resourceDir: string,\n\t\tprivate readonly fs: FileSystem,\n\t) {\n\t\tthis.localTemplates = {\n\t\t\t['default']: join(this.resourceDir, 'templates/default'),\n\t\t}\n\t}\n\n\tinstallTemplate = async (\n\t\ttemplate: string,\n\t\ttargetDir: string,\n\t\tvariables: Record<string, string> = {},\n\t) => {\n\t\tlet removeTemplate = () => { }\n\n\t\tif (this.localTemplates[template]) {\n\t\t\ttemplate = this.localTemplates[template]\n\t\t} else {\n\t\t\tconst tmpDir = await this.fs.createTempDir()\n\n\t\t\ttry {\n\t\t\t\tconst emitter = degit(template, { cache: false, force: true, verbose: true })\n\t\t\t\tawait emitter.clone(tmpDir)\n\n\t\t\t\tremoveTemplate = () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.fs.remove(tmpDir, { recursive: true, force: true })\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconsole.error(`Failed to clean up template: ${error}`)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttemplate = tmpDir\n\t\t\t} catch (error) {\n\t\t\t\tthrow new Error(`Failed to clone template from repository: ${error}`)\n\t\t\t}\n\t\t}\n\n\t\tconst templateConfigFile = join(template, 'contember.template.yaml')\n\t\tif (!(await this.fs.pathExists(templateConfigFile))) {\n\t\t\tremoveTemplate()\n\t\t\tthrow new Error(`${template} is not a Contember template`)\n\t\t}\n\t\tconst config = (await this.readYaml(templateConfigFile)) as {\n\t\t\ttype?: string\n\t\t\tremove?: string[]\n\t\t\tpatchPackageJson?: boolean\n\t\t\trename?: Record<string, string>\n\t\t\tcopy?: Record<string, string>\n\t\t\treplaceVariables?: string[]\n\t\t}\n\t\tconst nodeModulesDir = join(template, 'node_modules')\n\t\tconst skippedFiles = new Set([...(config.remove || []).map(it => join(template, it)), templateConfigFile])\n\t\tif (await this.fs.pathExists(targetDir)) {\n\t\t\tthrow `${targetDir} already exists`\n\t\t}\n\t\tawait this.fs.copy(template, targetDir, {\n\t\t\tfilter: src => !src.startsWith(nodeModulesDir) && !skippedFiles.has(src),\n\t\t})\n\n\t\tremoveTemplate()\n\n\t\tif (config.patchPackageJson) {\n\t\t\tawait this.replaceFileContent(join(targetDir, 'package.json'), content => {\n\t\t\t\tconst {\n\t\t\t\t\tname,\n\t\t\t\t\tversion,\n\t\t\t\t\t'scripts-template': scripts,\n\t\t\t\t\tscripts: _nullScripts,\n\t\t\t\t\tlicense,\n\t\t\t\t\t...json\n\t\t\t\t} = JSON.parse(content)\n\t\t\t\treturn JSON.stringify({ scripts, ...json }, null, ' ')\n\t\t\t})\n\t\t}\n\t\tfor (const [source, target] of Object.entries(config.rename || {})) {\n\t\t\tawait this.fs.rename(join(targetDir, source), join(targetDir, target))\n\t\t}\n\t\tfor (const [source, target] of Object.entries(config.copy || {})) {\n\t\t\tawait this.fs.copy(join(targetDir, source), join(targetDir, target))\n\t\t}\n\n\t\tfor (const file of config.replaceVariables || []) {\n\t\t\tconst path = join(targetDir, file)\n\t\t\tif (!(await this.fs.pathExists(path))) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tawait this.replaceFileContent(path, content =>\n\t\t\t\tObject.entries(variables).reduce(\n\t\t\t\t\t(content, [key, value]) => content.replace(new RegExp(`\\{${key}\\}`, 'g'), value),\n\t\t\t\t\tcontent,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t}\n\n\tprivate replaceFileContent = async (path: string, replacer: (content: string) => string): Promise<void> => {\n\t\tconst content = await this.fs.readFile(path, { encoding: 'utf8' })\n\t\tconst newContent = replacer(content)\n\t\tawait this.fs.writeFile(path, newContent, { encoding: 'utf8' })\n\t}\n\n\tprivate readYaml = async <T = unknown>(path: string): Promise<T> => {\n\t\tconst content = await this.fs.readFile(path, { encoding: 'utf8' })\n\t\treturn jsyaml.load(content) as unknown as T\n\t}\n}\n"],"names":["join","content"],"mappings":"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"}
@@ -1,5 +1,6 @@
1
1
  import { join } from "node:path";
2
2
  import jsyaml__default from "js-yaml";
3
+ import degit from "degit";
3
4
  var __defProp = Object.defineProperty;
4
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5
6
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -7,18 +8,33 @@ class TemplateInstaller {
7
8
  constructor(resourceDir, fs) {
8
9
  this.resourceDir = resourceDir;
9
10
  this.fs = fs;
10
- __publicField(this, "localTemplates", {
11
- ["@contember/template-workspace"]: join(this.resourceDir, "templates/template-workspace")
12
- });
11
+ __publicField(this, "localTemplates");
13
12
  __publicField(this, "installTemplate", async (template, targetDir, variables = {}) => {
14
13
  let removeTemplate = () => {
15
14
  };
16
15
  if (this.localTemplates[template]) {
17
16
  template = this.localTemplates[template];
17
+ } else {
18
+ const tmpDir = await this.fs.createTempDir();
19
+ try {
20
+ const emitter = degit(template, { cache: false, force: true, verbose: true });
21
+ await emitter.clone(tmpDir);
22
+ removeTemplate = () => {
23
+ try {
24
+ this.fs.remove(tmpDir, { recursive: true, force: true });
25
+ } catch (error) {
26
+ console.error(`Failed to clean up template: ${error}`);
27
+ }
28
+ };
29
+ template = tmpDir;
30
+ } catch (error) {
31
+ throw new Error(`Failed to clone template from repository: ${error}`);
32
+ }
18
33
  }
19
34
  const templateConfigFile = join(template, "contember.template.yaml");
20
35
  if (!await this.fs.pathExists(templateConfigFile)) {
21
- throw `${template} is not a Contember template`;
36
+ removeTemplate();
37
+ throw new Error(`${template} is not a Contember template`);
22
38
  }
23
39
  const config = await this.readYaml(templateConfigFile);
24
40
  const nodeModulesDir = join(template, "node_modules");
@@ -29,7 +45,7 @@ class TemplateInstaller {
29
45
  await this.fs.copy(template, targetDir, {
30
46
  filter: (src) => !src.startsWith(nodeModulesDir) && !skippedFiles.has(src)
31
47
  });
32
- await removeTemplate();
48
+ removeTemplate();
33
49
  if (config.patchPackageJson) {
34
50
  await this.replaceFileContent(join(targetDir, "package.json"), (content) => {
35
51
  const {
@@ -72,6 +88,9 @@ class TemplateInstaller {
72
88
  const content = await this.fs.readFile(path, { encoding: "utf8" });
73
89
  return jsyaml__default.load(content);
74
90
  });
91
+ this.localTemplates = {
92
+ ["default"]: join(this.resourceDir, "templates/default")
93
+ };
75
94
  }
76
95
  }
77
96
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"TemplateInstaller.js","sources":["../../../../../packages/create/src/lib/TemplateInstaller.ts"],"sourcesContent":["import { join } from 'node:path'\nimport { FileSystem } from './FileSystem'\nimport jsyaml from 'js-yaml'\n\n\nexport class TemplateInstaller {\n\n\tprivate localTemplates: Record<string, string> = {\n\t\t['@contember/template-workspace']: join(this.resourceDir, 'templates/template-workspace'),\n\t}\n\n\tconstructor(\n\t\tprivate readonly resourceDir: string,\n\t\tprivate readonly fs: FileSystem,\n\t) {\n\t}\n\n\tinstallTemplate = async (\n\t\ttemplate: string,\n\t\ttargetDir: string,\n\t\tvariables: Record<string, string> = {},\n\t) => {\n\t\tlet removeTemplate = () => {\n\t\t}\n\t\tif (this.localTemplates[template]) {\n\t\t\ttemplate = this.localTemplates[template]\n\t\t}\n\n\t\tconst templateConfigFile = join(template, 'contember.template.yaml')\n\t\tif (!(await this.fs.pathExists(templateConfigFile))) {\n\t\t\tthrow `${template} is not a Contember template`\n\t\t}\n\t\tconst config = (await this.readYaml(templateConfigFile)) as {\n\t\t\ttype?: string\n\t\t\tremove?: string[]\n\t\t\tpatchPackageJson?: boolean\n\t\t\trename?: Record<string, string>\n\t\t\tcopy?: Record<string, string>\n\t\t\treplaceVariables?: string[]\n\t\t}\n\t\tconst nodeModulesDir = join(template, 'node_modules')\n\t\tconst skippedFiles = new Set([...(config.remove || []).map(it => join(template, it)), templateConfigFile])\n\t\tif (await this.fs.pathExists(targetDir)) {\n\t\t\tthrow `${targetDir} already exists`\n\t\t}\n\t\tawait this.fs.copy(template, targetDir, {\n\t\t\tfilter: src => !src.startsWith(nodeModulesDir) && !skippedFiles.has(src),\n\t\t})\n\t\tawait removeTemplate()\n\n\t\tif (config.patchPackageJson) {\n\t\t\tawait this.replaceFileContent(join(targetDir, 'package.json'), content => {\n\t\t\t\tconst {\n\t\t\t\t\tname,\n\t\t\t\t\tversion,\n\t\t\t\t\t'scripts-template': scripts,\n\t\t\t\t\tscripts: _nullScripts,\n\t\t\t\t\tlicense,\n\t\t\t\t\t...json\n\t\t\t\t} = JSON.parse(content)\n\t\t\t\treturn JSON.stringify({ scripts, ...json }, null, ' ')\n\t\t\t})\n\t\t}\n\t\tfor (const [source, target] of Object.entries(config.rename || {})) {\n\t\t\tawait this.fs.rename(join(targetDir, source), join(targetDir, target))\n\t\t}\n\t\tfor (const [source, target] of Object.entries(config.copy || {})) {\n\t\t\tawait this.fs.copy(join(targetDir, source), join(targetDir, target))\n\t\t}\n\n\t\tfor (const file of config.replaceVariables || []) {\n\t\t\tconst path = join(targetDir, file)\n\t\t\tif (!(await this.fs.pathExists(path))) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tawait this.replaceFileContent(path, content =>\n\t\t\t\tObject.entries(variables).reduce(\n\t\t\t\t\t(content, [key, value]) => content.replace(new RegExp(`\\{${key}\\}`, 'g'), value),\n\t\t\t\t\tcontent,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t}\n\n\tprivate replaceFileContent = async (path: string, replacer: (content: string) => string): Promise<void> => {\n\t\tconst content = await this.fs.readFile(path, { encoding: 'utf8' })\n\t\tconst newContent = replacer(content)\n\t\tawait this.fs.writeFile(path, newContent, { encoding: 'utf8' })\n\t}\n\n\tprivate readYaml = async <T = unknown>(path: string): Promise<T> => {\n\t\tconst content = await this.fs.readFile(path, { encoding: 'utf8' })\n\t\treturn jsyaml.load(content) as unknown as T\n\t}\n}\n"],"names":["content","jsyaml"],"mappings":"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"}
1
+ {"version":3,"file":"TemplateInstaller.js","sources":["../../../../../packages/create/src/lib/TemplateInstaller.ts"],"sourcesContent":["import { join } from 'node:path'\nimport { FileSystem } from './FileSystem'\nimport jsyaml from 'js-yaml'\nimport degit from 'degit'\n\n\nexport class TemplateInstaller {\n\n\tprivate localTemplates: Record<string, string>\n\n\tconstructor(\n\t\tprivate readonly resourceDir: string,\n\t\tprivate readonly fs: FileSystem,\n\t) {\n\t\tthis.localTemplates = {\n\t\t\t['default']: join(this.resourceDir, 'templates/default'),\n\t\t}\n\t}\n\n\tinstallTemplate = async (\n\t\ttemplate: string,\n\t\ttargetDir: string,\n\t\tvariables: Record<string, string> = {},\n\t) => {\n\t\tlet removeTemplate = () => { }\n\n\t\tif (this.localTemplates[template]) {\n\t\t\ttemplate = this.localTemplates[template]\n\t\t} else {\n\t\t\tconst tmpDir = await this.fs.createTempDir()\n\n\t\t\ttry {\n\t\t\t\tconst emitter = degit(template, { cache: false, force: true, verbose: true })\n\t\t\t\tawait emitter.clone(tmpDir)\n\n\t\t\t\tremoveTemplate = () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.fs.remove(tmpDir, { recursive: true, force: true })\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconsole.error(`Failed to clean up template: ${error}`)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttemplate = tmpDir\n\t\t\t} catch (error) {\n\t\t\t\tthrow new Error(`Failed to clone template from repository: ${error}`)\n\t\t\t}\n\t\t}\n\n\t\tconst templateConfigFile = join(template, 'contember.template.yaml')\n\t\tif (!(await this.fs.pathExists(templateConfigFile))) {\n\t\t\tremoveTemplate()\n\t\t\tthrow new Error(`${template} is not a Contember template`)\n\t\t}\n\t\tconst config = (await this.readYaml(templateConfigFile)) as {\n\t\t\ttype?: string\n\t\t\tremove?: string[]\n\t\t\tpatchPackageJson?: boolean\n\t\t\trename?: Record<string, string>\n\t\t\tcopy?: Record<string, string>\n\t\t\treplaceVariables?: string[]\n\t\t}\n\t\tconst nodeModulesDir = join(template, 'node_modules')\n\t\tconst skippedFiles = new Set([...(config.remove || []).map(it => join(template, it)), templateConfigFile])\n\t\tif (await this.fs.pathExists(targetDir)) {\n\t\t\tthrow `${targetDir} already exists`\n\t\t}\n\t\tawait this.fs.copy(template, targetDir, {\n\t\t\tfilter: src => !src.startsWith(nodeModulesDir) && !skippedFiles.has(src),\n\t\t})\n\n\t\tremoveTemplate()\n\n\t\tif (config.patchPackageJson) {\n\t\t\tawait this.replaceFileContent(join(targetDir, 'package.json'), content => {\n\t\t\t\tconst {\n\t\t\t\t\tname,\n\t\t\t\t\tversion,\n\t\t\t\t\t'scripts-template': scripts,\n\t\t\t\t\tscripts: _nullScripts,\n\t\t\t\t\tlicense,\n\t\t\t\t\t...json\n\t\t\t\t} = JSON.parse(content)\n\t\t\t\treturn JSON.stringify({ scripts, ...json }, null, ' ')\n\t\t\t})\n\t\t}\n\t\tfor (const [source, target] of Object.entries(config.rename || {})) {\n\t\t\tawait this.fs.rename(join(targetDir, source), join(targetDir, target))\n\t\t}\n\t\tfor (const [source, target] of Object.entries(config.copy || {})) {\n\t\t\tawait this.fs.copy(join(targetDir, source), join(targetDir, target))\n\t\t}\n\n\t\tfor (const file of config.replaceVariables || []) {\n\t\t\tconst path = join(targetDir, file)\n\t\t\tif (!(await this.fs.pathExists(path))) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tawait this.replaceFileContent(path, content =>\n\t\t\t\tObject.entries(variables).reduce(\n\t\t\t\t\t(content, [key, value]) => content.replace(new RegExp(`\\{${key}\\}`, 'g'), value),\n\t\t\t\t\tcontent,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t}\n\n\tprivate replaceFileContent = async (path: string, replacer: (content: string) => string): Promise<void> => {\n\t\tconst content = await this.fs.readFile(path, { encoding: 'utf8' })\n\t\tconst newContent = replacer(content)\n\t\tawait this.fs.writeFile(path, newContent, { encoding: 'utf8' })\n\t}\n\n\tprivate readYaml = async <T = unknown>(path: string): Promise<T> => {\n\t\tconst content = await this.fs.readFile(path, { encoding: 'utf8' })\n\t\treturn jsyaml.load(content) as unknown as T\n\t}\n}\n"],"names":["content","jsyaml"],"mappings":"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"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const node_fs = require("node:fs");
4
+ const node_path = require("node:path");
5
+ const detectPackageManager = () => {
6
+ const userAgent = process.env.npm_config_user_agent;
7
+ if (userAgent) {
8
+ if (userAgent.startsWith("yarn/")) return "yarn";
9
+ if (userAgent.startsWith("pnpm/")) return "pnpm";
10
+ if (userAgent.startsWith("npm/")) return "npm";
11
+ if (userAgent.startsWith("bun/")) return "bun";
12
+ }
13
+ const cwd = process.cwd();
14
+ if (node_fs.existsSync(node_path.join(cwd, "yarn.lock"))) return "yarn";
15
+ if (node_fs.existsSync(node_path.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
16
+ if (node_fs.existsSync(node_path.join(cwd, "package-lock.json"))) return "npm";
17
+ if (node_fs.existsSync(node_path.join(cwd, "bun.lockb"))) return "bun";
18
+ if (node_fs.existsSync(node_path.join(cwd, "bun.lock"))) return "bun";
19
+ return "npm";
20
+ };
21
+ exports.detectPackageManager = detectPackageManager;
22
+ //# sourceMappingURL=packageManagerDetector.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageManagerDetector.cjs","sources":["../../../../../packages/create/src/lib/packageManagerDetector.ts"],"sourcesContent":["import { existsSync } from 'node:fs'\nimport { join } from 'node:path'\n\nexport type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun'\n\nexport const detectPackageManager = (): PackageManager => {\n\tconst userAgent = process.env.npm_config_user_agent\n\n\tif (userAgent) {\n\t\tif (userAgent.startsWith('yarn/')) return 'yarn'\n\t\tif (userAgent.startsWith('pnpm/')) return 'pnpm'\n\t\tif (userAgent.startsWith('npm/')) return 'npm'\n\t\tif (userAgent.startsWith('bun/')) return 'bun'\n\t}\n\n\tconst cwd = process.cwd()\n\tif (existsSync(join(cwd, 'yarn.lock'))) return 'yarn'\n\tif (existsSync(join(cwd, 'pnpm-lock.yaml'))) return 'pnpm'\n\tif (existsSync(join(cwd, 'package-lock.json'))) return 'npm'\n\tif (existsSync(join(cwd, 'bun.lockb'))) return 'bun'\n\tif (existsSync(join(cwd, 'bun.lock'))) return 'bun'\n\n\treturn 'npm'\n}\n"],"names":["existsSync","join"],"mappings":";;;;AAKO,MAAM,uBAAuB,MAAsB;AACnD,QAAA,YAAY,QAAQ,IAAI;AAE9B,MAAI,WAAW;AACd,QAAI,UAAU,WAAW,OAAO,EAAU,QAAA;AAC1C,QAAI,UAAU,WAAW,OAAO,EAAU,QAAA;AAC1C,QAAI,UAAU,WAAW,MAAM,EAAU,QAAA;AACzC,QAAI,UAAU,WAAW,MAAM,EAAU,QAAA;AAAA,EAAA;AAGpC,QAAA,MAAM,QAAQ,IAAI;AACxB,MAAIA,QAAAA,WAAWC,UAAAA,KAAK,KAAK,WAAW,CAAC,EAAU,QAAA;AAC/C,MAAID,QAAAA,WAAWC,UAAAA,KAAK,KAAK,gBAAgB,CAAC,EAAU,QAAA;AACpD,MAAID,QAAAA,WAAWC,UAAAA,KAAK,KAAK,mBAAmB,CAAC,EAAU,QAAA;AACvD,MAAID,QAAAA,WAAWC,UAAAA,KAAK,KAAK,WAAW,CAAC,EAAU,QAAA;AAC/C,MAAID,QAAAA,WAAWC,UAAAA,KAAK,KAAK,UAAU,CAAC,EAAU,QAAA;AAEvC,SAAA;AACR;;"}
@@ -0,0 +1,22 @@
1
+ import { existsSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ const detectPackageManager = () => {
4
+ const userAgent = process.env.npm_config_user_agent;
5
+ if (userAgent) {
6
+ if (userAgent.startsWith("yarn/")) return "yarn";
7
+ if (userAgent.startsWith("pnpm/")) return "pnpm";
8
+ if (userAgent.startsWith("npm/")) return "npm";
9
+ if (userAgent.startsWith("bun/")) return "bun";
10
+ }
11
+ const cwd = process.cwd();
12
+ if (existsSync(join(cwd, "yarn.lock"))) return "yarn";
13
+ if (existsSync(join(cwd, "pnpm-lock.yaml"))) return "pnpm";
14
+ if (existsSync(join(cwd, "package-lock.json"))) return "npm";
15
+ if (existsSync(join(cwd, "bun.lockb"))) return "bun";
16
+ if (existsSync(join(cwd, "bun.lock"))) return "bun";
17
+ return "npm";
18
+ };
19
+ export {
20
+ detectPackageManager
21
+ };
22
+ //# sourceMappingURL=packageManagerDetector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageManagerDetector.js","sources":["../../../../../packages/create/src/lib/packageManagerDetector.ts"],"sourcesContent":["import { existsSync } from 'node:fs'\nimport { join } from 'node:path'\n\nexport type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun'\n\nexport const detectPackageManager = (): PackageManager => {\n\tconst userAgent = process.env.npm_config_user_agent\n\n\tif (userAgent) {\n\t\tif (userAgent.startsWith('yarn/')) return 'yarn'\n\t\tif (userAgent.startsWith('pnpm/')) return 'pnpm'\n\t\tif (userAgent.startsWith('npm/')) return 'npm'\n\t\tif (userAgent.startsWith('bun/')) return 'bun'\n\t}\n\n\tconst cwd = process.cwd()\n\tif (existsSync(join(cwd, 'yarn.lock'))) return 'yarn'\n\tif (existsSync(join(cwd, 'pnpm-lock.yaml'))) return 'pnpm'\n\tif (existsSync(join(cwd, 'package-lock.json'))) return 'npm'\n\tif (existsSync(join(cwd, 'bun.lockb'))) return 'bun'\n\tif (existsSync(join(cwd, 'bun.lock'))) return 'bun'\n\n\treturn 'npm'\n}\n"],"names":[],"mappings":";;AAKO,MAAM,uBAAuB,MAAsB;AACnD,QAAA,YAAY,QAAQ,IAAI;AAE9B,MAAI,WAAW;AACd,QAAI,UAAU,WAAW,OAAO,EAAU,QAAA;AAC1C,QAAI,UAAU,WAAW,OAAO,EAAU,QAAA;AAC1C,QAAI,UAAU,WAAW,MAAM,EAAU,QAAA;AACzC,QAAI,UAAU,WAAW,MAAM,EAAU,QAAA;AAAA,EAAA;AAGpC,QAAA,MAAM,QAAQ,IAAI;AACxB,MAAI,WAAW,KAAK,KAAK,WAAW,CAAC,EAAU,QAAA;AAC/C,MAAI,WAAW,KAAK,KAAK,gBAAgB,CAAC,EAAU,QAAA;AACpD,MAAI,WAAW,KAAK,KAAK,mBAAmB,CAAC,EAAU,QAAA;AACvD,MAAI,WAAW,KAAK,KAAK,WAAW,CAAC,EAAU,QAAA;AAC/C,MAAI,WAAW,KAAK,KAAK,UAAU,CAAC,EAAU,QAAA;AAEvC,SAAA;AACR;"}
@@ -1,9 +1,11 @@
1
1
  import { Command, CommandConfiguration, Input } from '@contember/cli-common';
2
2
  import { TemplateInstaller } from '../lib/TemplateInstaller';
3
3
  type Args = {
4
- workspaceName: string;
4
+ projectName: string;
5
+ };
6
+ type Options = {
7
+ template: string;
5
8
  };
6
- type Options = {};
7
9
  export declare class WorkspaceCreateCommand extends Command<Args, Options> {
8
10
  private readonly templateInstaller;
9
11
  constructor(templateInstaller: TemplateInstaller);
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceCreateCommand.d.ts","sourceRoot":"","sources":["../../../src/commands/WorkspaceCreateCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAG5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAG5D,KAAK,IAAI,GAAG;IACX,aAAa,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,KAAK,OAAO,GAAG,EACd,CAAA;AAED,qBAAa,sBAAuB,SAAQ,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;IAEhE,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAAjB,iBAAiB,EAAE,iBAAiB;IAKtD,SAAS,CAAC,SAAS,CAAC,aAAa,EAAE,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI;cAK7D,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAUnE"}
1
+ {"version":3,"file":"WorkspaceCreateCommand.d.ts","sourceRoot":"","sources":["../../../src/commands/WorkspaceCreateCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAG5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAI5D,KAAK,IAAI,GAAG;IACX,WAAW,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,KAAK,OAAO,GAAG;IACd,QAAQ,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,qBAAa,sBAAuB,SAAQ,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;IAEhE,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAAjB,iBAAiB,EAAE,iBAAiB;IAKtD,SAAS,CAAC,SAAS,CAAC,aAAa,EAAE,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI;cAM7D,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAenE"}
@@ -7,6 +7,7 @@ export declare class FileSystem {
7
7
  readDir: typeof fs.readdir;
8
8
  copy: typeof copy;
9
9
  unlink: typeof fs.unlink;
10
+ remove: typeof fs.rm;
10
11
  pathExists: (path: string) => Promise<boolean>;
11
12
  createTempDir: () => Promise<string>;
12
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"FileSystem.d.ts","sourceRoot":"","sources":["../../../src/lib/FileSystem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAG/B,qBAAa,UAAU;IACtB,QAAQ,qBAAc;IACtB,SAAS,sBAAe;IACxB,MAAM,mBAAY;IAClB,OAAO,oBAAa;IACpB,IAAI,cAAO;IACX,MAAM,mBAAY;IAClB,UAAU,GAAU,MAAM,MAAM,sBAO/B;IACD,aAAa,wBAEZ;CACD"}
1
+ {"version":3,"file":"FileSystem.d.ts","sourceRoot":"","sources":["../../../src/lib/FileSystem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAG/B,qBAAa,UAAU;IACtB,QAAQ,qBAAc;IACtB,SAAS,sBAAe;IACxB,MAAM,mBAAY;IAClB,OAAO,oBAAa;IACpB,IAAI,cAAO;IACX,MAAM,mBAAY;IAClB,MAAM,eAAQ;IACd,UAAU,GAAU,MAAM,MAAM,sBAO/B;IACD,aAAa,wBAEZ;CACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"TemplateInstaller.d.ts","sourceRoot":"","sources":["../../../src/lib/TemplateInstaller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAIzC,qBAAa,iBAAiB;IAO5B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,EAAE;IANpB,OAAO,CAAC,cAAc,CAErB;gBAGiB,WAAW,EAAE,MAAM,EACnB,EAAE,EAAE,UAAU;IAIhC,eAAe,GACd,UAAU,MAAM,EAChB,WAAW,MAAM,EACjB,YAAW,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,mBA8DtC;IAED,OAAO,CAAC,kBAAkB,CAIzB;IAED,OAAO,CAAC,QAAQ,CAGf;CACD"}
1
+ {"version":3,"file":"TemplateInstaller.d.ts","sourceRoot":"","sources":["../../../src/lib/TemplateInstaller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAKzC,qBAAa,iBAAiB;IAK5B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,EAAE;IAJpB,OAAO,CAAC,cAAc,CAAwB;gBAG5B,WAAW,EAAE,MAAM,EACnB,EAAE,EAAE,UAAU;IAOhC,eAAe,GACd,UAAU,MAAM,EAChB,WAAW,MAAM,EACjB,YAAW,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,mBAmFtC;IAED,OAAO,CAAC,kBAAkB,CAIzB;IAED,OAAO,CAAC,QAAQ,CAGf;CACD"}
@@ -0,0 +1,3 @@
1
+ export type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun';
2
+ export declare const detectPackageManager: () => PackageManager;
3
+ //# sourceMappingURL=packageManagerDetector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageManagerDetector.d.ts","sourceRoot":"","sources":["../../../src/lib/packageManagerDetector.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAA;AAE5D,eAAO,MAAM,oBAAoB,QAAO,cAkBvC,CAAA"}