create-appraisejs 0.3.1-alpha.0 → 0.3.1-alpha.1

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 (503) hide show
  1. package/README.md +17 -17
  2. package/dist/cli.e2e.test.d.ts +2 -2
  3. package/dist/cli.e2e.test.js +74 -72
  4. package/dist/config.d.ts.map +1 -1
  5. package/dist/config.js.map +1 -1
  6. package/dist/config.test.d.ts +2 -2
  7. package/dist/config.test.js +64 -64
  8. package/dist/copy-template.test.d.ts +2 -2
  9. package/dist/copy-template.test.js +70 -70
  10. package/dist/download-repo.test.d.ts +2 -2
  11. package/dist/download-repo.test.js +15 -13
  12. package/dist/install.test.d.ts +2 -2
  13. package/dist/install.test.js +115 -114
  14. package/dist/prepare-template-utils.d.ts.map +1 -1
  15. package/dist/prepare-template-utils.js.map +1 -1
  16. package/dist/prompts.d.ts.map +1 -1
  17. package/dist/prompts.js +2 -2
  18. package/dist/prompts.js.map +1 -1
  19. package/dist/prompts.test.d.ts +2 -2
  20. package/dist/prompts.test.js +54 -54
  21. package/dist/sync-templates-utils.d.ts.map +1 -1
  22. package/dist/sync-templates-utils.js +1 -5
  23. package/dist/sync-templates-utils.js.map +1 -1
  24. package/package.json +1 -1
  25. package/templates/blank/.editorconfig +11 -0
  26. package/templates/blank/.gitattributes +21 -0
  27. package/templates/blank/.gitconfig.appraise +14 -0
  28. package/templates/blank/.prettierrc +13 -0
  29. package/templates/blank/.vscode/settings.json +2 -0
  30. package/templates/blank/README.md +12 -12
  31. package/templates/blank/components.json +24 -24
  32. package/templates/blank/cucumber.mjs +16 -16
  33. package/templates/blank/e2e/README.md +56 -0
  34. package/templates/blank/e2e/apply-migrations.mjs +76 -0
  35. package/templates/blank/e2e/appraise-smoke.spec.ts +78 -0
  36. package/templates/blank/e2e/authoring.spec.ts +53 -0
  37. package/templates/blank/e2e/crud-configuration.spec.ts +138 -0
  38. package/templates/blank/e2e/crud-tests.spec.ts +76 -0
  39. package/templates/blank/e2e/helpers/forms.ts +186 -0
  40. package/templates/blank/e2e/helpers/navigation.ts +27 -0
  41. package/templates/blank/e2e/helpers/table.ts +45 -0
  42. package/templates/blank/e2e/helpers/test-data.ts +549 -0
  43. package/templates/blank/e2e/helpers/ui.ts +41 -0
  44. package/templates/blank/e2e/navigation.spec.ts +101 -0
  45. package/templates/blank/e2e/runs-and-reports.spec.ts +82 -0
  46. package/templates/blank/e2e/settings-sync.spec.ts +39 -0
  47. package/templates/blank/e2e/start-server.mjs +61 -0
  48. package/templates/blank/eslint.config.mjs +4 -4
  49. package/templates/blank/gitignore +0 -3
  50. package/templates/blank/next-env.d.ts +1 -1
  51. package/templates/blank/package-lock.json +58 -102
  52. package/templates/blank/package.json +10 -9
  53. package/templates/blank/packages/cucumber-runtime/package.json +13 -13
  54. package/templates/blank/packages/cucumber-runtime/src/cache.util.ts +93 -93
  55. package/templates/blank/packages/cucumber-runtime/src/cli.ts +77 -68
  56. package/templates/blank/packages/cucumber-runtime/src/environment.util.ts +21 -21
  57. package/templates/blank/packages/cucumber-runtime/src/executor.ts +32 -32
  58. package/templates/blank/packages/cucumber-runtime/src/index.ts +17 -17
  59. package/templates/blank/packages/cucumber-runtime/src/locator.util.ts +234 -234
  60. package/templates/blank/packages/cucumber-runtime/src/parameter-types.ts +7 -7
  61. package/templates/blank/packages/cucumber-runtime/src/random-data.util.ts +35 -35
  62. package/templates/blank/packages/cucumber-runtime/src/types.ts +13 -13
  63. package/templates/blank/packages/cucumber-runtime/src/world.ts +44 -44
  64. package/templates/blank/packages/cucumber-runtime/tsconfig.json +11 -11
  65. package/templates/blank/packages/locator-picker-companion/dist/cli.js +1 -1
  66. package/templates/blank/packages/locator-picker-companion/dist/index.d.ts +3 -3
  67. package/templates/blank/packages/locator-picker-companion/dist/index.js +3 -3
  68. package/templates/blank/packages/locator-picker-companion/dist/injected-picker-script.js +13 -3
  69. package/templates/blank/packages/locator-picker-companion/dist/selector-generator.d.ts +6 -3
  70. package/templates/blank/packages/locator-picker-companion/dist/selector-generator.js +233 -229
  71. package/templates/blank/packages/locator-picker-companion/src/cli.ts +1 -7
  72. package/templates/blank/packages/locator-picker-companion/src/injected-picker-script.ts +26 -5
  73. package/templates/blank/packages/locator-picker-companion/src/launcher.ts +1 -3
  74. package/templates/blank/packages/locator-picker-companion/src/session-file.ts +4 -15
  75. package/templates/blank/packages/locator-picker-companion/src/types.ts +1 -8
  76. package/templates/blank/playwright.config.ts +46 -0
  77. package/templates/blank/postcss.config.mjs +8 -8
  78. package/templates/blank/prisma/dev.db +0 -0
  79. package/templates/blank/scripts/configure-git-line-endings.mjs +91 -0
  80. package/templates/blank/scripts/install-template-step.ts +5 -1
  81. package/templates/blank/scripts/lib/step-matcher.test.ts +3 -3
  82. package/templates/blank/scripts/lib/step-matcher.ts +5 -1
  83. package/templates/blank/scripts/lib/template-step-installer.test.ts +4 -2
  84. package/templates/blank/scripts/lib/template-step-installer.ts +16 -4
  85. package/templates/blank/scripts/lib/template-step-registry.test.ts +1 -1
  86. package/templates/blank/scripts/lib/template-step-registry.ts +4 -1
  87. package/templates/blank/scripts/run-fallow-commit.mjs +4 -6
  88. package/templates/blank/scripts/sync-all.ts +7 -6
  89. package/templates/blank/scripts/sync-appraise-base-template.ts +84 -77
  90. package/templates/blank/scripts/sync-environments.ts +47 -44
  91. package/templates/blank/scripts/sync-locator-groups.ts +67 -76
  92. package/templates/blank/scripts/sync-locators.ts +50 -53
  93. package/templates/blank/scripts/sync-modules.ts +42 -42
  94. package/templates/blank/scripts/sync-tags.ts +51 -51
  95. package/templates/blank/scripts/sync-template-step-groups.ts +34 -32
  96. package/templates/blank/scripts/sync-template-steps.ts +97 -97
  97. package/templates/blank/scripts/sync-test-cases.ts +65 -74
  98. package/templates/blank/scripts/sync-test-suites.ts +85 -80
  99. package/templates/blank/src/actions/server-action-boundary.test.ts +1 -7
  100. package/templates/blank/src/actions/settings/sync-actions.ts +3 -1
  101. package/templates/blank/src/actions/tags/tag-actions.ts +1 -7
  102. package/templates/blank/src/actions/template-test-case/template-test-case-actions.ts +3 -1
  103. package/templates/blank/src/app/(base)/environments/create/page.tsx +28 -28
  104. package/templates/blank/src/app/(base)/environments/environment-form.tsx +3 -2
  105. package/templates/blank/src/app/(base)/environments/environment-helpers.ts +4 -1
  106. package/templates/blank/src/app/(base)/layout.tsx +10 -10
  107. package/templates/blank/src/app/(base)/locator-groups/locator-group-form.tsx +5 -3
  108. package/templates/blank/src/app/(base)/locator-groups/locator-group-table-columns.tsx +77 -77
  109. package/templates/blank/src/app/(base)/locator-groups/locator-group-table.tsx +28 -28
  110. package/templates/blank/src/app/(base)/locator-groups/modify/[id]/page.tsx +46 -46
  111. package/templates/blank/src/app/(base)/locator-groups/page.tsx +9 -19
  112. package/templates/blank/src/app/(base)/locators/create/create-locator-workspace-helpers.test.ts +3 -6
  113. package/templates/blank/src/app/(base)/locators/create/create-locator-workspace-response.ts +22 -5
  114. package/templates/blank/src/app/(base)/locators/create/create-locator-workspace-state.ts +5 -1
  115. package/templates/blank/src/app/(base)/locators/create/use-locator-workspace.ts +7 -2
  116. package/templates/blank/src/app/(base)/locators/locator-file-sync.ts +1 -5
  117. package/templates/blank/src/app/(base)/locators/locator-helpers.ts +2 -12
  118. package/templates/blank/src/app/(base)/locators/locator-table-columns.tsx +59 -60
  119. package/templates/blank/src/app/(base)/modules/module-form.tsx +3 -1
  120. package/templates/blank/src/app/(base)/reports/overview-chart.tsx +49 -49
  121. package/templates/blank/src/app/(base)/reports/test-cases/test-cases-metric-table-columns.tsx +114 -115
  122. package/templates/blank/src/app/(base)/reports/test-cases/test-cases-metric-table.tsx +27 -27
  123. package/templates/blank/src/app/(base)/reports/test-suites/test-suites-metric-table-columns.tsx +80 -79
  124. package/templates/blank/src/app/(base)/reports/test-suites/test-suites-metric-table.tsx +29 -27
  125. package/templates/blank/src/app/(base)/settings/settings-sync-panel-helpers.test.tsx +4 -6
  126. package/templates/blank/src/app/(base)/settings/settings-sync-panel.tsx +22 -23
  127. package/templates/blank/src/app/(base)/tags/tag-form.test.tsx +2 -10
  128. package/templates/blank/src/app/(base)/tags/tag-form.tsx +5 -3
  129. package/templates/blank/src/app/(base)/tags/tag-table-columns.tsx +63 -63
  130. package/templates/blank/src/app/(base)/tags/tag-table.tsx +29 -29
  131. package/templates/blank/src/app/(base)/template-step-groups/create/page.tsx +28 -28
  132. package/templates/blank/src/app/(base)/template-step-groups/template-step-group-form.tsx +3 -1
  133. package/templates/blank/src/app/(base)/template-step-groups/template-step-group-helpers.ts +4 -1
  134. package/templates/blank/src/app/(base)/template-steps/paramChip.tsx +6 -10
  135. package/templates/blank/src/app/(base)/template-steps/template-step-form-helpers.ts +4 -2
  136. package/templates/blank/src/app/(base)/template-steps/template-step-helpers.test.ts +19 -1
  137. package/templates/blank/src/app/(base)/template-steps/template-step-helpers.ts +1 -5
  138. package/templates/blank/src/app/(base)/template-steps/template-step-row-guards.ts +1 -5
  139. package/templates/blank/src/app/(base)/template-steps/template-step-types.ts +1 -5
  140. package/templates/blank/src/app/(base)/template-test-cases/create-template-test-case-page-data.test.ts +4 -1
  141. package/templates/blank/src/app/(base)/template-test-cases/create-template-test-case-page-data.ts +1 -2
  142. package/templates/blank/src/app/(base)/template-test-cases/modify/[id]/page.tsx +1 -0
  143. package/templates/blank/src/app/(base)/template-test-cases/template-test-case-flow.test.tsx +0 -1
  144. package/templates/blank/src/app/(base)/template-test-cases/template-test-case-form.tsx +3 -1
  145. package/templates/blank/src/app/(base)/template-test-cases/template-test-case-table-columns.tsx +76 -76
  146. package/templates/blank/src/app/(base)/template-test-cases/template-test-case-table.tsx +32 -32
  147. package/templates/blank/src/app/(base)/test-cases/create/page.tsx +1 -5
  148. package/templates/blank/src/app/(base)/test-cases/create-from-template/create-from-template-selection-helpers.ts +1 -4
  149. package/templates/blank/src/app/(base)/test-cases/create-from-template/page.test.tsx +2 -2
  150. package/templates/blank/src/app/(base)/test-cases/inline-tag-creation-dialog.tsx +1 -7
  151. package/templates/blank/src/app/(base)/test-cases/inline-test-suite-creation-dialog.tsx +1 -7
  152. package/templates/blank/src/app/(base)/test-cases/modify/[id]/page.tsx +1 -5
  153. package/templates/blank/src/app/(base)/test-cases/test-case-form.tsx +63 -78
  154. package/templates/blank/src/app/(base)/test-cases/test-case-route-helpers.test.ts +2 -7
  155. package/templates/blank/src/app/(base)/test-suites/editable-test-suite-helpers.ts +1 -6
  156. package/templates/blank/src/app/(base)/test-suites/test-suite-form.test.tsx +2 -10
  157. package/templates/blank/src/app/(dashboard-components)/data-card-grid.tsx +10 -10
  158. package/templates/blank/src/app/api/test-runs/[runId]/download/route.ts +1 -4
  159. package/templates/blank/src/app/api/test-runs/[runId]/trace/[testCaseId]/route.test.ts +18 -9
  160. package/templates/blank/src/assets/icons/empty-tube.tsx +23 -23
  161. package/templates/blank/src/assets/icons/tube-plus.tsx +29 -29
  162. package/templates/blank/src/components/data-visualization/info-card.tsx +56 -70
  163. package/templates/blank/src/components/data-visualization/info-grid.tsx +22 -22
  164. package/templates/blank/src/components/diagram/add-node-prompt-node.tsx +1 -1
  165. package/templates/blank/src/components/diagram/dynamic-parameters-helpers.ts +4 -3
  166. package/templates/blank/src/components/diagram/dynamic-parameters.test.tsx +4 -1
  167. package/templates/blank/src/components/diagram/dynamic-parameters.tsx +0 -1
  168. package/templates/blank/src/components/diagram/flow-diagram-block-dialog.test.tsx +26 -0
  169. package/templates/blank/src/components/diagram/flow-diagram-block-dialog.tsx +3 -1
  170. package/templates/blank/src/components/diagram/flow-diagram-connection-guards.ts +24 -6
  171. package/templates/blank/src/components/diagram/flow-diagram-helpers.test.ts +27 -0
  172. package/templates/blank/src/components/diagram/flow-diagram-node-search.tsx +65 -65
  173. package/templates/blank/src/components/diagram/flow-diagram-toolbar.tsx +1 -3
  174. package/templates/blank/src/components/diagram/flow-diagram-view.tsx +1 -7
  175. package/templates/blank/src/components/diagram/flow-node-data-helpers.ts +1 -1
  176. package/templates/blank/src/components/diagram/node-form-fields-content.tsx +9 -2
  177. package/templates/blank/src/components/diagram/node-form-helpers.test.ts +3 -1
  178. package/templates/blank/src/components/diagram/node-form-helpers.ts +1 -4
  179. package/templates/blank/src/components/diagram/node-form-template-step-selection.ts +1 -4
  180. package/templates/blank/src/components/diagram/node-form.test.tsx +25 -0
  181. package/templates/blank/src/components/diagram/node-form.tsx +2 -12
  182. package/templates/blank/src/components/diagram/options-header-node.test.tsx +4 -1
  183. package/templates/blank/src/components/diagram/options-header-node.tsx +140 -130
  184. package/templates/blank/src/components/diagram/use-flow-diagram.ts +1 -2
  185. package/templates/blank/src/components/form/error-message.tsx +7 -7
  186. package/templates/blank/src/components/loading-skeleton/form/button-skeleton.tsx +8 -8
  187. package/templates/blank/src/components/loading-skeleton/form/text-input-skeleton.tsx +8 -8
  188. package/templates/blank/src/components/loading-skeleton/visualization/table-skeleton.tsx +14 -14
  189. package/templates/blank/src/components/navigation/entity-search-command.tsx +3 -9
  190. package/templates/blank/src/components/navigation/nav-link.tsx +60 -60
  191. package/templates/blank/src/components/test-case/test-case-form-helpers.test.ts +1 -5
  192. package/templates/blank/src/components/test-case/test-case-form-helpers.ts +1 -5
  193. package/templates/blank/src/components/test-case/test-case-picker-helpers.ts +8 -7
  194. package/templates/blank/src/components/test-case/test-case-picker.tsx +2 -6
  195. package/templates/blank/src/components/test-run/log-viewer.test.tsx +25 -0
  196. package/templates/blank/src/components/test-run/log-viewer.tsx +2 -2
  197. package/templates/blank/src/components/test-run/test-run-details-guards.ts +10 -1
  198. package/templates/blank/src/components/test-run/test-run-details.test.tsx +9 -19
  199. package/templates/blank/src/components/test-run/use-log-viewer.ts +2 -8
  200. package/templates/blank/src/components/test-run/use-test-run-header.ts +1 -4
  201. package/templates/blank/src/components/test-suite/test-suite-picker.tsx +1 -1
  202. package/templates/blank/src/components/theme/theme-provider.tsx +7 -1
  203. package/templates/blank/src/components/typography/page-header-subtitle.tsx +7 -7
  204. package/templates/blank/src/components/typography/page-header.tsx +7 -7
  205. package/templates/blank/src/components/ui/chart.tsx +2 -8
  206. package/templates/blank/src/components/ui/command.tsx +2 -5
  207. package/templates/blank/src/components/ui/data-table-column-header.tsx +3 -3
  208. package/templates/blank/src/components/ui/data-table.test.tsx +1 -8
  209. package/templates/blank/src/components/ui/dialog.tsx +1 -4
  210. package/templates/blank/src/components/ui/select.tsx +2 -2
  211. package/templates/blank/src/components/ui/separator.tsx +5 -1
  212. package/templates/blank/src/components/ui/skeleton.tsx +7 -7
  213. package/templates/blank/src/components/ui/table.tsx +1 -1
  214. package/templates/blank/src/components/ui/toaster.tsx +26 -26
  215. package/templates/blank/src/components/ui/tooltip.tsx +1 -1
  216. package/templates/blank/src/constants/form-opts/locator-group-form-opts.ts +1 -1
  217. package/templates/blank/src/lib/locator-group-file-utils.ts +5 -1
  218. package/templates/blank/src/lib/locator-picker/session-manager.ts +1 -2
  219. package/templates/blank/src/lib/metrics/metric-calculator.test.ts +105 -6
  220. package/templates/blank/src/lib/metrics/metric-calculator.ts +39 -40
  221. package/templates/blank/src/lib/sync/sync-executor.ts +1 -4
  222. package/templates/blank/src/lib/sync/sync-pending-counts.test.ts +201 -7
  223. package/templates/blank/src/lib/sync/sync-pending-counts.ts +81 -13
  224. package/templates/blank/src/lib/template-automation-paths.ts +1 -1
  225. package/templates/blank/src/lib/template-sync-utils.d.ts +14 -7
  226. package/templates/blank/src/lib/test-case-utils.ts +6 -6
  227. package/templates/blank/src/lib/test-run/log-formatter.ts +82 -83
  228. package/templates/blank/src/lib/test-run/report-parser.ts +352 -352
  229. package/templates/blank/src/lib/transformers/gherkin-converter.ts +42 -42
  230. package/templates/blank/src/lib/transformers/key-to-icon-transformer.tsx +95 -95
  231. package/templates/blank/src/lib/utils/node-param-validation.ts +81 -81
  232. package/templates/blank/src/lib/utils/template-step-file-generator.ts +5 -3
  233. package/templates/blank/src/lib/utils/template-step-file-manager-intelligent.ts +11 -1
  234. package/templates/blank/src/services/dashboard/dashboard-service.test.ts +28 -1
  235. package/templates/blank/src/services/dashboard/dashboard-service.ts +2 -0
  236. package/templates/blank/src/services/locator/locator-service.test.ts +1 -3
  237. package/templates/blank/src/services/locator/locator-service.ts +3 -1
  238. package/templates/blank/src/services/locator/locator-sync-utils.test.ts +1 -4
  239. package/templates/blank/src/services/module/module-service.ts +1 -4
  240. package/templates/blank/src/services/report/report-service.test.ts +70 -6
  241. package/templates/blank/src/services/report/report-service.ts +52 -9
  242. package/templates/blank/src/services/shared/errors.ts +2 -4
  243. package/templates/blank/src/services/template-step/template-step-service.ts +3 -1
  244. package/templates/blank/src/services/template-step-group/template-step-group-service.ts +3 -1
  245. package/templates/blank/src/services/test-case/test-case-service.ts +0 -5
  246. package/templates/blank/src/services/test-run/test-run-service.test.ts +3 -6
  247. package/templates/blank/src/services/test-run/test-run-service.ts +12 -7
  248. package/templates/blank/src/services/test-suite/test-suite-service.test.ts +1 -5
  249. package/templates/blank/src/services/test-suite/test-suite-service.ts +2 -4
  250. package/templates/blank/src/types/form/actionHandler.ts +1 -5
  251. package/templates/blank/tsconfig.json +8 -8
  252. package/templates/default/packages/locator-picker-companion/dist/cli.d.ts +1 -1
  253. package/templates/default/packages/locator-picker-companion/dist/cli.js +313 -279
  254. package/templates/default/packages/locator-picker-companion/dist/index.d.ts +3 -3
  255. package/templates/default/packages/locator-picker-companion/dist/index.js +3 -3
  256. package/templates/default/packages/locator-picker-companion/dist/injected-picker-script.d.ts +1 -1
  257. package/templates/default/packages/locator-picker-companion/dist/injected-picker-script.js +526 -481
  258. package/templates/default/packages/locator-picker-companion/dist/launcher.d.ts +13 -10
  259. package/templates/default/packages/locator-picker-companion/dist/launcher.js +47 -48
  260. package/templates/default/packages/locator-picker-companion/dist/selector-generator.d.ts +6 -3
  261. package/templates/default/packages/locator-picker-companion/dist/selector-generator.js +233 -229
  262. package/templates/default/packages/locator-picker-companion/dist/session-file.d.ts +30 -22
  263. package/templates/default/packages/locator-picker-companion/dist/session-file.js +116 -104
  264. package/templates/default/packages/locator-picker-companion/dist/types.d.ts +25 -25
  265. package/templates/default/packages/locator-picker-companion/dist/types.js +1 -1
  266. package/templates/starter/.editorconfig +11 -0
  267. package/templates/starter/.gitattributes +21 -0
  268. package/templates/starter/.gitconfig.appraise +14 -0
  269. package/templates/starter/.prettierrc +13 -0
  270. package/templates/starter/.vscode/settings.json +2 -0
  271. package/templates/starter/README.md +12 -12
  272. package/templates/starter/automation/steps/actions/click.step.ts +56 -58
  273. package/templates/starter/automation/steps/actions/hover.step.ts +25 -27
  274. package/templates/starter/automation/steps/actions/input.step.ts +85 -108
  275. package/templates/starter/automation/steps/actions/navigation.step.ts +67 -70
  276. package/templates/starter/automation/steps/actions/random_data.step.ts +149 -143
  277. package/templates/starter/automation/steps/actions/store.step.ts +69 -1
  278. package/templates/starter/automation/steps/actions/wait.step.ts +84 -1
  279. package/templates/starter/automation/steps/validations/active_state_assertion.step.ts +28 -30
  280. package/templates/starter/automation/steps/validations/navigation_assertion.step.ts +20 -22
  281. package/templates/starter/automation/steps/validations/text_assertion.step.ts +67 -107
  282. package/templates/starter/automation/steps/validations/visibility_assertion.step.ts +24 -26
  283. package/templates/starter/components.json +24 -24
  284. package/templates/starter/cucumber.mjs +16 -16
  285. package/templates/starter/e2e/README.md +56 -0
  286. package/templates/starter/e2e/apply-migrations.mjs +76 -0
  287. package/templates/starter/e2e/appraise-smoke.spec.ts +78 -0
  288. package/templates/starter/e2e/authoring.spec.ts +53 -0
  289. package/templates/starter/e2e/crud-configuration.spec.ts +138 -0
  290. package/templates/starter/e2e/crud-tests.spec.ts +76 -0
  291. package/templates/starter/e2e/helpers/forms.ts +186 -0
  292. package/templates/starter/e2e/helpers/navigation.ts +27 -0
  293. package/templates/starter/e2e/helpers/table.ts +45 -0
  294. package/templates/starter/e2e/helpers/test-data.ts +549 -0
  295. package/templates/starter/e2e/helpers/ui.ts +41 -0
  296. package/templates/starter/e2e/navigation.spec.ts +101 -0
  297. package/templates/starter/e2e/runs-and-reports.spec.ts +82 -0
  298. package/templates/starter/e2e/settings-sync.spec.ts +39 -0
  299. package/templates/starter/e2e/start-server.mjs +61 -0
  300. package/templates/starter/eslint.config.mjs +4 -4
  301. package/templates/starter/gitignore +0 -3
  302. package/templates/starter/next-env.d.ts +1 -1
  303. package/templates/starter/package-lock.json +58 -102
  304. package/templates/starter/package.json +10 -9
  305. package/templates/starter/packages/cucumber-runtime/package.json +13 -13
  306. package/templates/starter/packages/cucumber-runtime/src/cache.util.ts +93 -93
  307. package/templates/starter/packages/cucumber-runtime/src/cli.ts +77 -68
  308. package/templates/starter/packages/cucumber-runtime/src/environment.util.ts +21 -21
  309. package/templates/starter/packages/cucumber-runtime/src/executor.ts +32 -32
  310. package/templates/starter/packages/cucumber-runtime/src/index.ts +17 -17
  311. package/templates/starter/packages/cucumber-runtime/src/locator.util.ts +234 -234
  312. package/templates/starter/packages/cucumber-runtime/src/parameter-types.ts +7 -7
  313. package/templates/starter/packages/cucumber-runtime/src/random-data.util.ts +35 -35
  314. package/templates/starter/packages/cucumber-runtime/src/types.ts +13 -13
  315. package/templates/starter/packages/cucumber-runtime/src/world.ts +44 -44
  316. package/templates/starter/packages/cucumber-runtime/tsconfig.json +11 -11
  317. package/templates/starter/packages/locator-picker-companion/dist/cli.js +1 -1
  318. package/templates/starter/packages/locator-picker-companion/dist/index.d.ts +3 -3
  319. package/templates/starter/packages/locator-picker-companion/dist/index.js +3 -3
  320. package/templates/starter/packages/locator-picker-companion/dist/injected-picker-script.js +13 -3
  321. package/templates/starter/packages/locator-picker-companion/dist/selector-generator.d.ts +6 -3
  322. package/templates/starter/packages/locator-picker-companion/dist/selector-generator.js +233 -229
  323. package/templates/starter/packages/locator-picker-companion/src/cli.ts +1 -7
  324. package/templates/starter/packages/locator-picker-companion/src/injected-picker-script.ts +26 -5
  325. package/templates/starter/packages/locator-picker-companion/src/launcher.ts +1 -3
  326. package/templates/starter/packages/locator-picker-companion/src/session-file.ts +4 -15
  327. package/templates/starter/packages/locator-picker-companion/src/types.ts +1 -8
  328. package/templates/starter/playwright.config.ts +46 -0
  329. package/templates/starter/postcss.config.mjs +8 -8
  330. package/templates/starter/prisma/dev.db +0 -0
  331. package/templates/starter/scripts/configure-git-line-endings.mjs +91 -0
  332. package/templates/starter/scripts/install-template-step.ts +5 -1
  333. package/templates/starter/scripts/lib/step-matcher.test.ts +3 -3
  334. package/templates/starter/scripts/lib/step-matcher.ts +5 -1
  335. package/templates/starter/scripts/lib/template-step-installer.test.ts +4 -2
  336. package/templates/starter/scripts/lib/template-step-installer.ts +16 -4
  337. package/templates/starter/scripts/lib/template-step-registry.test.ts +1 -1
  338. package/templates/starter/scripts/lib/template-step-registry.ts +4 -1
  339. package/templates/starter/scripts/run-fallow-commit.mjs +4 -6
  340. package/templates/starter/scripts/sync-all.ts +7 -6
  341. package/templates/starter/scripts/sync-appraise-base-template.ts +84 -77
  342. package/templates/starter/scripts/sync-environments.ts +47 -44
  343. package/templates/starter/scripts/sync-locator-groups.ts +67 -76
  344. package/templates/starter/scripts/sync-locators.ts +50 -53
  345. package/templates/starter/scripts/sync-modules.ts +42 -42
  346. package/templates/starter/scripts/sync-tags.ts +51 -51
  347. package/templates/starter/scripts/sync-template-step-groups.ts +34 -32
  348. package/templates/starter/scripts/sync-template-steps.ts +97 -97
  349. package/templates/starter/scripts/sync-test-cases.ts +65 -74
  350. package/templates/starter/scripts/sync-test-suites.ts +85 -80
  351. package/templates/starter/src/actions/server-action-boundary.test.ts +1 -7
  352. package/templates/starter/src/actions/settings/sync-actions.ts +3 -1
  353. package/templates/starter/src/actions/tags/tag-actions.ts +1 -7
  354. package/templates/starter/src/actions/template-test-case/template-test-case-actions.ts +3 -1
  355. package/templates/starter/src/app/(base)/environments/create/page.tsx +28 -28
  356. package/templates/starter/src/app/(base)/environments/environment-form.tsx +3 -2
  357. package/templates/starter/src/app/(base)/environments/environment-helpers.ts +4 -1
  358. package/templates/starter/src/app/(base)/layout.tsx +10 -10
  359. package/templates/starter/src/app/(base)/locator-groups/locator-group-form.tsx +5 -3
  360. package/templates/starter/src/app/(base)/locator-groups/locator-group-table-columns.tsx +77 -77
  361. package/templates/starter/src/app/(base)/locator-groups/locator-group-table.tsx +28 -28
  362. package/templates/starter/src/app/(base)/locator-groups/modify/[id]/page.tsx +46 -46
  363. package/templates/starter/src/app/(base)/locator-groups/page.tsx +9 -19
  364. package/templates/starter/src/app/(base)/locators/create/create-locator-workspace-helpers.test.ts +3 -6
  365. package/templates/starter/src/app/(base)/locators/create/create-locator-workspace-response.ts +22 -5
  366. package/templates/starter/src/app/(base)/locators/create/create-locator-workspace-state.ts +5 -1
  367. package/templates/starter/src/app/(base)/locators/create/use-locator-workspace.ts +7 -2
  368. package/templates/starter/src/app/(base)/locators/locator-file-sync.ts +1 -5
  369. package/templates/starter/src/app/(base)/locators/locator-helpers.ts +2 -12
  370. package/templates/starter/src/app/(base)/locators/locator-table-columns.tsx +59 -60
  371. package/templates/starter/src/app/(base)/modules/module-form.tsx +3 -1
  372. package/templates/starter/src/app/(base)/reports/overview-chart.tsx +49 -49
  373. package/templates/starter/src/app/(base)/reports/test-cases/test-cases-metric-table-columns.tsx +114 -115
  374. package/templates/starter/src/app/(base)/reports/test-cases/test-cases-metric-table.tsx +27 -27
  375. package/templates/starter/src/app/(base)/reports/test-suites/test-suites-metric-table-columns.tsx +80 -79
  376. package/templates/starter/src/app/(base)/reports/test-suites/test-suites-metric-table.tsx +29 -27
  377. package/templates/starter/src/app/(base)/settings/settings-sync-panel-helpers.test.tsx +4 -6
  378. package/templates/starter/src/app/(base)/settings/settings-sync-panel.tsx +22 -23
  379. package/templates/starter/src/app/(base)/tags/tag-form.test.tsx +2 -10
  380. package/templates/starter/src/app/(base)/tags/tag-form.tsx +5 -3
  381. package/templates/starter/src/app/(base)/tags/tag-table-columns.tsx +63 -63
  382. package/templates/starter/src/app/(base)/tags/tag-table.tsx +29 -29
  383. package/templates/starter/src/app/(base)/template-step-groups/create/page.tsx +28 -28
  384. package/templates/starter/src/app/(base)/template-step-groups/template-step-group-form.tsx +3 -1
  385. package/templates/starter/src/app/(base)/template-step-groups/template-step-group-helpers.ts +4 -1
  386. package/templates/starter/src/app/(base)/template-steps/paramChip.tsx +6 -10
  387. package/templates/starter/src/app/(base)/template-steps/template-step-form-helpers.ts +4 -2
  388. package/templates/starter/src/app/(base)/template-steps/template-step-helpers.test.ts +19 -1
  389. package/templates/starter/src/app/(base)/template-steps/template-step-helpers.ts +1 -5
  390. package/templates/starter/src/app/(base)/template-steps/template-step-row-guards.ts +1 -5
  391. package/templates/starter/src/app/(base)/template-steps/template-step-types.ts +1 -5
  392. package/templates/starter/src/app/(base)/template-test-cases/create-template-test-case-page-data.test.ts +4 -1
  393. package/templates/starter/src/app/(base)/template-test-cases/create-template-test-case-page-data.ts +1 -2
  394. package/templates/starter/src/app/(base)/template-test-cases/modify/[id]/page.tsx +1 -0
  395. package/templates/starter/src/app/(base)/template-test-cases/template-test-case-flow.test.tsx +0 -1
  396. package/templates/starter/src/app/(base)/template-test-cases/template-test-case-form.tsx +3 -1
  397. package/templates/starter/src/app/(base)/template-test-cases/template-test-case-table-columns.tsx +76 -76
  398. package/templates/starter/src/app/(base)/template-test-cases/template-test-case-table.tsx +32 -32
  399. package/templates/starter/src/app/(base)/test-cases/create/page.tsx +1 -5
  400. package/templates/starter/src/app/(base)/test-cases/create-from-template/create-from-template-selection-helpers.ts +1 -4
  401. package/templates/starter/src/app/(base)/test-cases/create-from-template/page.test.tsx +2 -2
  402. package/templates/starter/src/app/(base)/test-cases/inline-tag-creation-dialog.tsx +1 -7
  403. package/templates/starter/src/app/(base)/test-cases/inline-test-suite-creation-dialog.tsx +1 -7
  404. package/templates/starter/src/app/(base)/test-cases/modify/[id]/page.tsx +1 -5
  405. package/templates/starter/src/app/(base)/test-cases/test-case-form.tsx +63 -78
  406. package/templates/starter/src/app/(base)/test-cases/test-case-route-helpers.test.ts +2 -7
  407. package/templates/starter/src/app/(base)/test-suites/editable-test-suite-helpers.ts +1 -6
  408. package/templates/starter/src/app/(base)/test-suites/test-suite-form.test.tsx +2 -10
  409. package/templates/starter/src/app/(dashboard-components)/data-card-grid.tsx +10 -10
  410. package/templates/starter/src/app/api/test-runs/[runId]/download/route.ts +1 -4
  411. package/templates/starter/src/app/api/test-runs/[runId]/trace/[testCaseId]/route.test.ts +18 -9
  412. package/templates/starter/src/assets/icons/empty-tube.tsx +23 -23
  413. package/templates/starter/src/assets/icons/tube-plus.tsx +29 -29
  414. package/templates/starter/src/components/data-visualization/info-card.tsx +56 -70
  415. package/templates/starter/src/components/data-visualization/info-grid.tsx +22 -22
  416. package/templates/starter/src/components/diagram/add-node-prompt-node.tsx +1 -1
  417. package/templates/starter/src/components/diagram/dynamic-parameters-helpers.ts +4 -3
  418. package/templates/starter/src/components/diagram/dynamic-parameters.test.tsx +4 -1
  419. package/templates/starter/src/components/diagram/dynamic-parameters.tsx +0 -1
  420. package/templates/starter/src/components/diagram/flow-diagram-block-dialog.test.tsx +26 -0
  421. package/templates/starter/src/components/diagram/flow-diagram-block-dialog.tsx +3 -1
  422. package/templates/starter/src/components/diagram/flow-diagram-connection-guards.ts +24 -6
  423. package/templates/starter/src/components/diagram/flow-diagram-helpers.test.ts +27 -0
  424. package/templates/starter/src/components/diagram/flow-diagram-node-search.tsx +65 -65
  425. package/templates/starter/src/components/diagram/flow-diagram-toolbar.tsx +1 -3
  426. package/templates/starter/src/components/diagram/flow-diagram-view.tsx +1 -7
  427. package/templates/starter/src/components/diagram/flow-node-data-helpers.ts +1 -1
  428. package/templates/starter/src/components/diagram/node-form-fields-content.tsx +9 -2
  429. package/templates/starter/src/components/diagram/node-form-helpers.test.ts +3 -1
  430. package/templates/starter/src/components/diagram/node-form-helpers.ts +1 -4
  431. package/templates/starter/src/components/diagram/node-form-template-step-selection.ts +1 -4
  432. package/templates/starter/src/components/diagram/node-form.test.tsx +25 -0
  433. package/templates/starter/src/components/diagram/node-form.tsx +2 -12
  434. package/templates/starter/src/components/diagram/options-header-node.test.tsx +4 -1
  435. package/templates/starter/src/components/diagram/options-header-node.tsx +140 -130
  436. package/templates/starter/src/components/diagram/use-flow-diagram.ts +1 -2
  437. package/templates/starter/src/components/form/error-message.tsx +7 -7
  438. package/templates/starter/src/components/loading-skeleton/form/button-skeleton.tsx +8 -8
  439. package/templates/starter/src/components/loading-skeleton/form/text-input-skeleton.tsx +8 -8
  440. package/templates/starter/src/components/loading-skeleton/visualization/table-skeleton.tsx +14 -14
  441. package/templates/starter/src/components/navigation/entity-search-command.tsx +3 -9
  442. package/templates/starter/src/components/navigation/nav-link.tsx +60 -60
  443. package/templates/starter/src/components/test-case/test-case-form-helpers.test.ts +1 -5
  444. package/templates/starter/src/components/test-case/test-case-form-helpers.ts +1 -5
  445. package/templates/starter/src/components/test-case/test-case-picker-helpers.ts +8 -7
  446. package/templates/starter/src/components/test-case/test-case-picker.tsx +2 -6
  447. package/templates/starter/src/components/test-run/log-viewer.test.tsx +25 -0
  448. package/templates/starter/src/components/test-run/log-viewer.tsx +2 -2
  449. package/templates/starter/src/components/test-run/test-run-details-guards.ts +10 -1
  450. package/templates/starter/src/components/test-run/test-run-details.test.tsx +9 -19
  451. package/templates/starter/src/components/test-run/use-log-viewer.ts +2 -8
  452. package/templates/starter/src/components/test-run/use-test-run-header.ts +1 -4
  453. package/templates/starter/src/components/test-suite/test-suite-picker.tsx +1 -1
  454. package/templates/starter/src/components/theme/theme-provider.tsx +7 -1
  455. package/templates/starter/src/components/typography/page-header-subtitle.tsx +7 -7
  456. package/templates/starter/src/components/typography/page-header.tsx +7 -7
  457. package/templates/starter/src/components/ui/chart.tsx +2 -8
  458. package/templates/starter/src/components/ui/command.tsx +2 -5
  459. package/templates/starter/src/components/ui/data-table-column-header.tsx +3 -3
  460. package/templates/starter/src/components/ui/data-table.test.tsx +1 -8
  461. package/templates/starter/src/components/ui/dialog.tsx +1 -4
  462. package/templates/starter/src/components/ui/select.tsx +2 -2
  463. package/templates/starter/src/components/ui/separator.tsx +5 -1
  464. package/templates/starter/src/components/ui/skeleton.tsx +7 -7
  465. package/templates/starter/src/components/ui/table.tsx +1 -1
  466. package/templates/starter/src/components/ui/toaster.tsx +26 -26
  467. package/templates/starter/src/components/ui/tooltip.tsx +1 -1
  468. package/templates/starter/src/constants/form-opts/locator-group-form-opts.ts +1 -1
  469. package/templates/starter/src/lib/locator-group-file-utils.ts +5 -1
  470. package/templates/starter/src/lib/locator-picker/session-manager.ts +1 -2
  471. package/templates/starter/src/lib/metrics/metric-calculator.test.ts +105 -6
  472. package/templates/starter/src/lib/metrics/metric-calculator.ts +39 -40
  473. package/templates/starter/src/lib/sync/sync-executor.ts +1 -4
  474. package/templates/starter/src/lib/sync/sync-pending-counts.test.ts +201 -7
  475. package/templates/starter/src/lib/sync/sync-pending-counts.ts +81 -13
  476. package/templates/starter/src/lib/template-automation-paths.ts +1 -1
  477. package/templates/starter/src/lib/template-sync-utils.d.ts +14 -7
  478. package/templates/starter/src/lib/test-case-utils.ts +6 -6
  479. package/templates/starter/src/lib/test-run/log-formatter.ts +82 -83
  480. package/templates/starter/src/lib/test-run/report-parser.ts +352 -352
  481. package/templates/starter/src/lib/transformers/gherkin-converter.ts +42 -42
  482. package/templates/starter/src/lib/transformers/key-to-icon-transformer.tsx +95 -95
  483. package/templates/starter/src/lib/utils/node-param-validation.ts +81 -81
  484. package/templates/starter/src/lib/utils/template-step-file-generator.ts +5 -3
  485. package/templates/starter/src/lib/utils/template-step-file-manager-intelligent.ts +11 -1
  486. package/templates/starter/src/services/dashboard/dashboard-service.test.ts +28 -1
  487. package/templates/starter/src/services/dashboard/dashboard-service.ts +2 -0
  488. package/templates/starter/src/services/locator/locator-service.test.ts +1 -3
  489. package/templates/starter/src/services/locator/locator-service.ts +3 -1
  490. package/templates/starter/src/services/locator/locator-sync-utils.test.ts +1 -4
  491. package/templates/starter/src/services/module/module-service.ts +1 -4
  492. package/templates/starter/src/services/report/report-service.test.ts +70 -6
  493. package/templates/starter/src/services/report/report-service.ts +52 -9
  494. package/templates/starter/src/services/shared/errors.ts +2 -4
  495. package/templates/starter/src/services/template-step/template-step-service.ts +3 -1
  496. package/templates/starter/src/services/template-step-group/template-step-group-service.ts +3 -1
  497. package/templates/starter/src/services/test-case/test-case-service.ts +0 -5
  498. package/templates/starter/src/services/test-run/test-run-service.test.ts +3 -6
  499. package/templates/starter/src/services/test-run/test-run-service.ts +12 -7
  500. package/templates/starter/src/services/test-suite/test-suite-service.test.ts +1 -5
  501. package/templates/starter/src/services/test-suite/test-suite-service.ts +2 -4
  502. package/templates/starter/src/types/form/actionHandler.ts +1 -5
  503. package/templates/starter/tsconfig.json +8 -8
package/README.md CHANGED
@@ -79,12 +79,12 @@ The generated project does not include:
79
79
 
80
80
  The package defaults to the bundled template. Remote fetching is only used when you provide one of the override environment variables below.
81
81
 
82
- | Variable | Description | Default |
83
- | --- | --- | --- |
84
- | `CREATE_APPRAISE_REPO_URL` | Repository URL used for remote template fetching. | `https://github.com/jamil2018/appraisejs-core.git` |
85
- | `CREATE_APPRAISE_BRANCH` | Branch or ref to fetch from the remote repository. | `main` |
86
- | `CREATE_APPRAISE_TEMPLATE_SUBPATH` | Path to the template directory inside that repository. | selected template subpath (`templates/starter` or `templates/blank`) |
87
- | `CREATE_APPRAISE_USE_BUNDLED` | Set to `1`, `true`, or `yes` to force the bundled template even when remote overrides are present. | bundled template |
82
+ | Variable | Description | Default |
83
+ | ---------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
84
+ | `CREATE_APPRAISE_REPO_URL` | Repository URL used for remote template fetching. | `https://github.com/jamil2018/appraisejs-core.git` |
85
+ | `CREATE_APPRAISE_BRANCH` | Branch or ref to fetch from the remote repository. | `main` |
86
+ | `CREATE_APPRAISE_TEMPLATE_SUBPATH` | Path to the template directory inside that repository. | selected template subpath (`templates/starter` or `templates/blank`) |
87
+ | `CREATE_APPRAISE_USE_BUNDLED` | Set to `1`, `true`, or `yes` to force the bundled template even when remote overrides are present. | bundled template |
88
88
 
89
89
  When remote mode is active, the CLI tries the repository tarball first and falls back to `git clone` if needed.
90
90
 
@@ -96,17 +96,17 @@ CREATE_APPRAISE_BRANCH=main npx create-appraisejs@latest --template blank
96
96
 
97
97
  ## Common Scripts In The Generated App
98
98
 
99
- | Script | What it does |
100
- | --- | --- |
101
- | `npm run setup` | Install dependencies, create `.env`, rebuild the local DB, build the app, and protect seeded files |
102
- | `npm run setup:db` | Recreate the local SQLite database from migrations and rerun the sync pipeline |
103
- | `npm run setup:full` | Reinstall dependencies, rebuild the DB, rebuild the app, and protect seeded files |
104
- | `npm run install-playwright -- <browser...>` | Install selected Playwright browsers |
105
- | `npm run sync-all` | Run the full sync pipeline |
106
- | `npm run appraisejs:sync` | Alias for `sync-all` |
107
- | `npm run appraisejs:install-step -- --payload-file <path>` | Internal script used by the public `appraisejs add step` CLI |
108
- | `npm run start` | Start the local production server |
109
- | `npm run dev` | Start the Next.js development server |
99
+ | Script | What it does |
100
+ | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
101
+ | `npm run setup` | Install dependencies, create `.env`, rebuild the local DB, build the app, and protect seeded files |
102
+ | `npm run setup:db` | Recreate the local SQLite database from migrations and rerun the sync pipeline |
103
+ | `npm run setup:full` | Reinstall dependencies, rebuild the DB, rebuild the app, and protect seeded files |
104
+ | `npm run install-playwright -- <browser...>` | Install selected Playwright browsers |
105
+ | `npm run sync-all` | Run the full sync pipeline |
106
+ | `npm run appraisejs:sync` | Alias for `sync-all` |
107
+ | `npm run appraisejs:install-step -- --payload-file <path>` | Internal script used by the public `appraisejs add step` CLI |
108
+ | `npm run start` | Start the local production server |
109
+ | `npm run dev` | Start the Next.js development server |
110
110
 
111
111
  ## Install Additional Template Steps
112
112
 
@@ -1,2 +1,2 @@
1
- export {};
2
- //# sourceMappingURL=cli.e2e.test.d.ts.map
1
+ export {}
2
+ //# sourceMappingURL=cli.e2e.test.d.ts.map
@@ -1,73 +1,75 @@
1
- import { describe, it, expect, beforeEach, afterEach } from 'vitest';
2
- import path from 'path';
3
- import fs from 'fs-extra';
4
- import os from 'os';
5
- import { getTemplatePath } from './copy-template.js';
6
- import { patchPackageJsonScripts } from './install.js';
1
+ import { describe, it, expect, beforeEach, afterEach } from 'vitest'
2
+ import path from 'path'
3
+ import fs from 'fs-extra'
4
+ import os from 'os'
5
+ import { getTemplatePath } from './copy-template.js'
6
+ import { patchPackageJsonScripts } from './install.js'
7
7
  describe('CLI E2E', () => {
8
- let tempDir;
9
- let destDir;
10
- beforeEach(async () => {
11
- tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'create-appraisejs-e2e-'));
12
- destDir = path.join(tempDir, 'my-app');
13
- });
14
- afterEach(async () => {
15
- await fs.remove(tempDir).catch(() => { });
16
- });
17
- it('scaffolds app when run with non-interactive input (manual run required for full E2E)', async () => {
18
- const templatePath = getTemplatePath();
19
- if (!(await fs.pathExists(templatePath))) {
20
- console.warn('Skipping E2E: template not found (run npm run build first)');
21
- return;
22
- }
23
- await fs.ensureDir(destDir);
24
- const pkgJsonPath = path.join(destDir, 'package.json');
25
- const srcPath = path.join(destDir, 'src');
26
- const { copyTemplate } = await import('./copy-template.js');
27
- await copyTemplate(destDir);
28
- expect(await fs.pathExists(pkgJsonPath)).toBe(true);
29
- expect(await fs.pathExists(srcPath)).toBe(true);
30
- const pkg = await fs.readJson(pkgJsonPath);
31
- expect(pkg.name).toBe('appraisejs');
32
- expect(pkg.scripts?.dev).toBeDefined();
33
- });
34
- it('patchPackageJsonScripts rewrites real template scripts for chosen package manager', async () => {
35
- const templatePath = getTemplatePath();
36
- if (!(await fs.pathExists(templatePath))) {
37
- console.warn('Skipping E2E: template not found (run npm run build first)');
38
- return;
39
- }
40
- const { copyTemplate } = await import('./copy-template.js');
41
- await copyTemplate(destDir);
42
- const pkgBefore = await fs.readJson(path.join(destDir, 'package.json'));
43
- expect(pkgBefore.scripts['install-dependencies']).toBe('npm install --legacy-peer-deps');
44
- expect(pkgBefore.scripts.setup).toMatch(/npm run /);
45
- await patchPackageJsonScripts(destDir, 'pnpm');
46
- const pkgAfter = await fs.readJson(path.join(destDir, 'package.json'));
47
- expect(pkgAfter.scripts['install-dependencies']).toBe('pnpm install');
48
- expect(pkgAfter.scripts.setup).toBe('pnpm run install-dependencies && pnpm run setup-env && pnpm run migrate-db && pnpm run install-playwright');
49
- expect(pkgAfter.scripts['appraisejs:setup']).toBe('pnpm run setup');
50
- expect(pkgAfter.scripts['appraisejs:sync']).toBe('pnpm run sync-all');
51
- expect(pkgAfter.scripts['setup-env']).toContain('pnpm exec ');
52
- expect(pkgAfter.scripts['setup-env']).not.toContain('npx ');
53
- expect(pkgAfter.scripts['sync-all']).toContain('pnpm exec ');
54
- expect(pkgAfter.scripts['install-playwright']).toContain('pnpm exec ');
55
- expect(pkgAfter.scripts['install-playwright']).not.toContain('npx ');
56
- });
57
- it('patchPackageJsonScripts rewrites npx-using scripts for bun', async () => {
58
- const templatePath = getTemplatePath();
59
- if (!(await fs.pathExists(templatePath))) {
60
- console.warn('Skipping E2E: template not found (run npm run build first)');
61
- return;
62
- }
63
- const { copyTemplate } = await import('./copy-template.js');
64
- await copyTemplate(destDir);
65
- await patchPackageJsonScripts(destDir, 'bun');
66
- const pkgAfter = await fs.readJson(path.join(destDir, 'package.json'));
67
- expect(pkgAfter.scripts['setup-env']).toContain('bunx ');
68
- expect(pkgAfter.scripts['sync-all']).toContain('bunx ');
69
- expect(pkgAfter.scripts['install-playwright']).toContain('bunx ');
70
- expect(pkgAfter.scripts['setup-env']).not.toContain('npx ');
71
- });
72
- });
73
- //# sourceMappingURL=cli.e2e.test.js.map
8
+ let tempDir
9
+ let destDir
10
+ beforeEach(async () => {
11
+ tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'create-appraisejs-e2e-'))
12
+ destDir = path.join(tempDir, 'my-app')
13
+ })
14
+ afterEach(async () => {
15
+ await fs.remove(tempDir).catch(() => {})
16
+ })
17
+ it('scaffolds app when run with non-interactive input (manual run required for full E2E)', async () => {
18
+ const templatePath = getTemplatePath()
19
+ if (!(await fs.pathExists(templatePath))) {
20
+ console.warn('Skipping E2E: template not found (run npm run build first)')
21
+ return
22
+ }
23
+ await fs.ensureDir(destDir)
24
+ const pkgJsonPath = path.join(destDir, 'package.json')
25
+ const srcPath = path.join(destDir, 'src')
26
+ const { copyTemplate } = await import('./copy-template.js')
27
+ await copyTemplate(destDir)
28
+ expect(await fs.pathExists(pkgJsonPath)).toBe(true)
29
+ expect(await fs.pathExists(srcPath)).toBe(true)
30
+ const pkg = await fs.readJson(pkgJsonPath)
31
+ expect(pkg.name).toBe('appraisejs')
32
+ expect(pkg.scripts?.dev).toBeDefined()
33
+ })
34
+ it('patchPackageJsonScripts rewrites real template scripts for chosen package manager', async () => {
35
+ const templatePath = getTemplatePath()
36
+ if (!(await fs.pathExists(templatePath))) {
37
+ console.warn('Skipping E2E: template not found (run npm run build first)')
38
+ return
39
+ }
40
+ const { copyTemplate } = await import('./copy-template.js')
41
+ await copyTemplate(destDir)
42
+ const pkgBefore = await fs.readJson(path.join(destDir, 'package.json'))
43
+ expect(pkgBefore.scripts['install-dependencies']).toBe('npm install --legacy-peer-deps')
44
+ expect(pkgBefore.scripts.setup).toMatch(/npm run /)
45
+ await patchPackageJsonScripts(destDir, 'pnpm')
46
+ const pkgAfter = await fs.readJson(path.join(destDir, 'package.json'))
47
+ expect(pkgAfter.scripts['install-dependencies']).toBe('pnpm install')
48
+ expect(pkgAfter.scripts.setup).toBe(
49
+ 'pnpm run install-dependencies && pnpm run setup-env && pnpm run migrate-db && pnpm run install-playwright',
50
+ )
51
+ expect(pkgAfter.scripts['appraisejs:setup']).toBe('pnpm run setup')
52
+ expect(pkgAfter.scripts['appraisejs:sync']).toBe('pnpm run sync-all')
53
+ expect(pkgAfter.scripts['setup-env']).toContain('pnpm exec ')
54
+ expect(pkgAfter.scripts['setup-env']).not.toContain('npx ')
55
+ expect(pkgAfter.scripts['sync-all']).toContain('pnpm exec ')
56
+ expect(pkgAfter.scripts['install-playwright']).toContain('pnpm exec ')
57
+ expect(pkgAfter.scripts['install-playwright']).not.toContain('npx ')
58
+ })
59
+ it('patchPackageJsonScripts rewrites npx-using scripts for bun', async () => {
60
+ const templatePath = getTemplatePath()
61
+ if (!(await fs.pathExists(templatePath))) {
62
+ console.warn('Skipping E2E: template not found (run npm run build first)')
63
+ return
64
+ }
65
+ const { copyTemplate } = await import('./copy-template.js')
66
+ await copyTemplate(destDir)
67
+ await patchPackageJsonScripts(destDir, 'bun')
68
+ const pkgAfter = await fs.readJson(path.join(destDir, 'package.json'))
69
+ expect(pkgAfter.scripts['setup-env']).toContain('bunx ')
70
+ expect(pkgAfter.scripts['sync-all']).toContain('bunx ')
71
+ expect(pkgAfter.scripts['install-playwright']).toContain('bunx ')
72
+ expect(pkgAfter.scripts['setup-env']).not.toContain('npx ')
73
+ })
74
+ })
75
+ //# sourceMappingURL=cli.e2e.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAK1G,MAAM,WAAW,MAAM;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,OAAO,CAAA;CACpB;AAWD,wBAAgB,SAAS,CAAC,QAAQ,GAAE,UAAgC,GAAG,MAAM,CA2B5E"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAK1G,MAAM,WAAW,MAAM;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,OAAO,CAAA;CACpB;AAWD,wBAAgB,SAAS,CAAC,QAAQ,GAAE,UAAgC,GAAG,MAAM,CA0B5E"}
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,4BAA4B,EAAmB,MAAM,uBAAuB,CAAA;AAE1G,MAAM,iBAAiB,GAAG,kDAAkD,CAAA;AAC5E,MAAM,cAAc,GAAG,MAAM,CAAA;AAS7B,SAAS,iBAAiB,CAAC,KAAa;IACtC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IACpB,OAAO,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7C,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;aACrC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IAC9C,CAAC;IACD,OAAO,CAAC,CAAA;AACV,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,WAAuB,mBAAmB;IAClE,MAAM,iBAAiB,GACrB,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,IAAI,EAAE,CAAC;QACrD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,IAAI,EAAE,CAAC;QACnD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,IAAI,EAAE,CAAC,CAAA;IAE/D,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,iBAAiB,CAAA;IAC7E,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAA;IAEjF,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,IAAI,EAAE,IAAI,cAAc,CAAA;IAE3E,MAAM,eAAe,GACnB,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,IAAI,EAAE,IAAI,4BAA4B,CAAC,QAAQ,CAAC,CAAA;IAEhG,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAA;IAC7D,MAAM,YAAY,GAChB,aAAa,KAAK,SAAS;QAC3B,aAAa,KAAK,EAAE;QACpB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,WAAW,EAAE,CAAC,CAAA;IACpE,MAAM,UAAU,GAAG,YAAY,IAAI,CAAC,iBAAiB,CAAA;IAErD,OAAO;QACL,QAAQ,EAAE,QAAQ,IAAI,iBAAiB;QACvC,MAAM;QACN,eAAe;QACf,UAAU;KACX,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,4BAA4B,EAAmB,MAAM,uBAAuB,CAAA;AAE1G,MAAM,iBAAiB,GAAG,kDAAkD,CAAA;AAC5E,MAAM,cAAc,GAAG,MAAM,CAAA;AAS7B,SAAS,iBAAiB,CAAC,KAAa;IACtC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IACpB,OAAO,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7C,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;aACrC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IAC9C,CAAC;IACD,OAAO,CAAC,CAAA;AACV,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,WAAuB,mBAAmB;IAClE,MAAM,iBAAiB,GACrB,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,IAAI,EAAE,CAAC;QACrD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,IAAI,EAAE,CAAC;QACnD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,IAAI,EAAE,CAAC,CAAA;IAE/D,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,iBAAiB,CAAA;IAC7E,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAA;IAEjF,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,IAAI,EAAE,IAAI,cAAc,CAAA;IAE3E,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,IAAI,EAAE,IAAI,4BAA4B,CAAC,QAAQ,CAAC,CAAA;IAEtH,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAA;IAC7D,MAAM,YAAY,GAChB,aAAa,KAAK,SAAS;QAC3B,aAAa,KAAK,EAAE;QACpB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,WAAW,EAAE,CAAC,CAAA;IACpE,MAAM,UAAU,GAAG,YAAY,IAAI,CAAC,iBAAiB,CAAA;IAErD,OAAO;QACL,QAAQ,EAAE,QAAQ,IAAI,iBAAiB;QACvC,MAAM;QACN,eAAe;QACf,UAAU;KACX,CAAA;AACH,CAAC"}
@@ -1,2 +1,2 @@
1
- export {};
2
- //# sourceMappingURL=config.test.d.ts.map
1
+ export {}
2
+ //# sourceMappingURL=config.test.d.ts.map
@@ -1,65 +1,65 @@
1
- import { describe, it, expect, beforeEach, afterEach } from 'vitest';
2
- import { getConfig } from './config.js';
1
+ import { describe, it, expect, beforeEach, afterEach } from 'vitest'
2
+ import { getConfig } from './config.js'
3
3
  describe('getConfig', () => {
4
- const originalEnv = process.env;
5
- beforeEach(() => {
6
- process.env = { ...originalEnv };
7
- delete process.env.CREATE_APPRAISE_REPO_URL;
8
- delete process.env.CREATE_APPRAISE_BRANCH;
9
- delete process.env.CREATE_APPRAISE_TEMPLATE_SUBPATH;
10
- delete process.env.CREATE_APPRAISE_USE_BUNDLED;
11
- });
12
- afterEach(() => {
13
- process.env = originalEnv;
14
- });
15
- it('returns default repo base, branch, template subpath, and useBundled false when no env set', () => {
16
- const config = getConfig();
17
- expect(config.repoBase).toContain('github.com');
18
- expect(config.repoBase).toContain('appraisejs');
19
- expect(config.branch).toBe('main');
20
- expect(config.templateSubpath).toBe('templates/default');
21
- expect(config.useBundled).toBe(false);
22
- });
23
- it('uses CREATE_APPRAISE_REPO_URL when set', () => {
24
- process.env.CREATE_APPRAISE_REPO_URL = 'https://example.com/repo';
25
- const config = getConfig();
26
- expect(config.repoBase).toBe('https://example.com/repo');
27
- });
28
- it('normalizes repo base: trims, removes trailing slash and .git', () => {
29
- process.env.CREATE_APPRAISE_REPO_URL = ' https://example.com/repo/.git/ ';
30
- const config = getConfig();
31
- expect(config.repoBase).toBe('https://example.com/repo');
32
- });
33
- it('uses CREATE_APPRAISE_BRANCH when set', () => {
34
- process.env.CREATE_APPRAISE_BRANCH = 'dev';
35
- const config = getConfig();
36
- expect(config.branch).toBe('dev');
37
- });
38
- it('uses CREATE_APPRAISE_TEMPLATE_SUBPATH when set', () => {
39
- process.env.CREATE_APPRAISE_TEMPLATE_SUBPATH = 'templates/custom';
40
- const config = getConfig();
41
- expect(config.templateSubpath).toBe('templates/custom');
42
- });
43
- it('sets useBundled true when CREATE_APPRAISE_USE_BUNDLED is 1', () => {
44
- process.env.CREATE_APPRAISE_USE_BUNDLED = '1';
45
- const config = getConfig();
46
- expect(config.useBundled).toBe(true);
47
- });
48
- it('sets useBundled true when CREATE_APPRAISE_USE_BUNDLED is true', () => {
49
- process.env.CREATE_APPRAISE_USE_BUNDLED = 'true';
50
- const config = getConfig();
51
- expect(config.useBundled).toBe(true);
52
- });
53
- it('sets useBundled true when CREATE_APPRAISE_USE_BUNDLED is yes', () => {
54
- process.env.CREATE_APPRAISE_USE_BUNDLED = 'yes';
55
- const config = getConfig();
56
- expect(config.useBundled).toBe(true);
57
- });
58
- it('sets useBundled false when CREATE_APPRAISE_USE_BUNDLED is empty or 0', () => {
59
- process.env.CREATE_APPRAISE_USE_BUNDLED = '';
60
- expect(getConfig().useBundled).toBe(false);
61
- process.env.CREATE_APPRAISE_USE_BUNDLED = '0';
62
- expect(getConfig().useBundled).toBe(false);
63
- });
64
- });
65
- //# sourceMappingURL=config.test.js.map
4
+ const originalEnv = process.env
5
+ beforeEach(() => {
6
+ process.env = { ...originalEnv }
7
+ delete process.env.CREATE_APPRAISE_REPO_URL
8
+ delete process.env.CREATE_APPRAISE_BRANCH
9
+ delete process.env.CREATE_APPRAISE_TEMPLATE_SUBPATH
10
+ delete process.env.CREATE_APPRAISE_USE_BUNDLED
11
+ })
12
+ afterEach(() => {
13
+ process.env = originalEnv
14
+ })
15
+ it('returns default repo base, branch, template subpath, and useBundled false when no env set', () => {
16
+ const config = getConfig()
17
+ expect(config.repoBase).toContain('github.com')
18
+ expect(config.repoBase).toContain('appraisejs')
19
+ expect(config.branch).toBe('main')
20
+ expect(config.templateSubpath).toBe('templates/default')
21
+ expect(config.useBundled).toBe(false)
22
+ })
23
+ it('uses CREATE_APPRAISE_REPO_URL when set', () => {
24
+ process.env.CREATE_APPRAISE_REPO_URL = 'https://example.com/repo'
25
+ const config = getConfig()
26
+ expect(config.repoBase).toBe('https://example.com/repo')
27
+ })
28
+ it('normalizes repo base: trims, removes trailing slash and .git', () => {
29
+ process.env.CREATE_APPRAISE_REPO_URL = ' https://example.com/repo/.git/ '
30
+ const config = getConfig()
31
+ expect(config.repoBase).toBe('https://example.com/repo')
32
+ })
33
+ it('uses CREATE_APPRAISE_BRANCH when set', () => {
34
+ process.env.CREATE_APPRAISE_BRANCH = 'dev'
35
+ const config = getConfig()
36
+ expect(config.branch).toBe('dev')
37
+ })
38
+ it('uses CREATE_APPRAISE_TEMPLATE_SUBPATH when set', () => {
39
+ process.env.CREATE_APPRAISE_TEMPLATE_SUBPATH = 'templates/custom'
40
+ const config = getConfig()
41
+ expect(config.templateSubpath).toBe('templates/custom')
42
+ })
43
+ it('sets useBundled true when CREATE_APPRAISE_USE_BUNDLED is 1', () => {
44
+ process.env.CREATE_APPRAISE_USE_BUNDLED = '1'
45
+ const config = getConfig()
46
+ expect(config.useBundled).toBe(true)
47
+ })
48
+ it('sets useBundled true when CREATE_APPRAISE_USE_BUNDLED is true', () => {
49
+ process.env.CREATE_APPRAISE_USE_BUNDLED = 'true'
50
+ const config = getConfig()
51
+ expect(config.useBundled).toBe(true)
52
+ })
53
+ it('sets useBundled true when CREATE_APPRAISE_USE_BUNDLED is yes', () => {
54
+ process.env.CREATE_APPRAISE_USE_BUNDLED = 'yes'
55
+ const config = getConfig()
56
+ expect(config.useBundled).toBe(true)
57
+ })
58
+ it('sets useBundled false when CREATE_APPRAISE_USE_BUNDLED is empty or 0', () => {
59
+ process.env.CREATE_APPRAISE_USE_BUNDLED = ''
60
+ expect(getConfig().useBundled).toBe(false)
61
+ process.env.CREATE_APPRAISE_USE_BUNDLED = '0'
62
+ expect(getConfig().useBundled).toBe(false)
63
+ })
64
+ })
65
+ //# sourceMappingURL=config.test.js.map
@@ -1,2 +1,2 @@
1
- export {};
2
- //# sourceMappingURL=copy-template.test.d.ts.map
1
+ export {}
2
+ //# sourceMappingURL=copy-template.test.d.ts.map
@@ -1,71 +1,71 @@
1
- import { describe, it, expect, beforeEach, afterEach } from 'vitest';
2
- import path from 'path';
3
- import fs from 'fs-extra';
4
- import os from 'os';
5
- import { copyTemplate, getTemplatePath } from './copy-template.js';
1
+ import { describe, it, expect, beforeEach, afterEach } from 'vitest'
2
+ import path from 'path'
3
+ import fs from 'fs-extra'
4
+ import os from 'os'
5
+ import { copyTemplate, getTemplatePath } from './copy-template.js'
6
6
  describe('copy-template', () => {
7
- let tempDir;
8
- let destDir;
9
- beforeEach(async () => {
10
- tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'create-appraisejs-test-'));
11
- destDir = path.join(tempDir, 'output');
12
- });
13
- afterEach(async () => {
14
- await fs.remove(tempDir).catch(() => { });
15
- });
16
- describe('getTemplatePath', () => {
17
- it('returns a path ending with templates/default', () => {
18
- const templatePath = getTemplatePath();
19
- expect(templatePath).toMatch(/[\\/]templates[\\/]default$/);
20
- });
21
- });
22
- describe('copyTemplate', () => {
23
- it('copies template files and excludes node_modules, .env, and lockfiles', async () => {
24
- const fixtureDir = path.join(tempDir, 'fixture');
25
- await fs.ensureDir(path.join(fixtureDir, 'src', 'app'));
26
- await fs.ensureDir(path.join(fixtureDir, 'node_modules', 'pkg'));
27
- await fs.writeJson(path.join(fixtureDir, 'package.json'), { name: 'test' });
28
- await fs.writeFile(path.join(fixtureDir, '.env'), 'SECRET=1');
29
- await fs.writeFile(path.join(fixtureDir, 'package-lock.json'), '{}');
30
- await fs.writeFile(path.join(fixtureDir, 'src', 'app', 'page.tsx'), 'export default function Page() {}');
31
- const { getCollectedFilesForTest } = await import('./copy-template.js');
32
- const files = getCollectedFilesForTest(fixtureDir);
33
- expect(files).toContain('package.json');
34
- expect(files.some((f) => f.includes('node_modules'))).toBe(false);
35
- expect(files.some((f) => f.includes('.env'))).toBe(false);
36
- expect(files.some((f) => f.includes('package-lock'))).toBe(false);
37
- const srcFiles = files.filter((f) => f.includes('src'));
38
- expect(srcFiles.length).toBeGreaterThan(0);
39
- await copyTemplate(destDir, undefined, fixtureDir);
40
- expect(await fs.pathExists(path.join(destDir, 'package.json'))).toBe(true);
41
- expect(await fs.pathExists(path.join(destDir, 'src'))).toBe(true);
42
- expect(await fs.pathExists(path.join(destDir, 'src', 'app', 'page.tsx'))).toBe(true);
43
- const hasNodeModules = await fs.pathExists(path.join(destDir, 'node_modules'));
44
- const hasEnv = await fs.pathExists(path.join(destDir, '.env'));
45
- const hasLock = await fs.pathExists(path.join(destDir, 'package-lock.json'));
46
- expect(hasNodeModules).toBe(false);
47
- expect(hasEnv).toBe(false);
48
- expect(hasLock).toBe(false);
49
- });
50
- it('copies package-lock.json when packageManager is npm', async () => {
51
- const fixtureDir = path.join(tempDir, 'fixture');
52
- await fs.ensureDir(path.join(fixtureDir, 'src'));
53
- await fs.writeJson(path.join(fixtureDir, 'package.json'), { name: 'test' });
54
- await fs.writeFile(path.join(fixtureDir, 'package-lock.json'), '{"lockfileVersion": 3}');
55
- await fs.writeFile(path.join(fixtureDir, 'src', 'index.ts'), '// empty');
56
- await copyTemplate(destDir, undefined, fixtureDir, 'npm');
57
- expect(await fs.pathExists(path.join(destDir, 'package-lock.json'))).toBe(true);
58
- expect(await fs.readFile(path.join(destDir, 'package-lock.json'), 'utf-8')).toBe('{"lockfileVersion": 3}');
59
- });
60
- it('does not copy package-lock.json when packageManager is not npm', async () => {
61
- const fixtureDir = path.join(tempDir, 'fixture');
62
- await fs.ensureDir(path.join(fixtureDir, 'src'));
63
- await fs.writeJson(path.join(fixtureDir, 'package.json'), { name: 'test' });
64
- await fs.writeFile(path.join(fixtureDir, 'package-lock.json'), '{}');
65
- await fs.writeFile(path.join(fixtureDir, 'src', 'index.ts'), '// empty');
66
- await copyTemplate(destDir, undefined, fixtureDir, 'yarn');
67
- expect(await fs.pathExists(path.join(destDir, 'package-lock.json'))).toBe(false);
68
- });
69
- });
70
- });
71
- //# sourceMappingURL=copy-template.test.js.map
7
+ let tempDir
8
+ let destDir
9
+ beforeEach(async () => {
10
+ tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'create-appraisejs-test-'))
11
+ destDir = path.join(tempDir, 'output')
12
+ })
13
+ afterEach(async () => {
14
+ await fs.remove(tempDir).catch(() => {})
15
+ })
16
+ describe('getTemplatePath', () => {
17
+ it('returns a path ending with templates/default', () => {
18
+ const templatePath = getTemplatePath()
19
+ expect(templatePath).toMatch(/[\\/]templates[\\/]default$/)
20
+ })
21
+ })
22
+ describe('copyTemplate', () => {
23
+ it('copies template files and excludes node_modules, .env, and lockfiles', async () => {
24
+ const fixtureDir = path.join(tempDir, 'fixture')
25
+ await fs.ensureDir(path.join(fixtureDir, 'src', 'app'))
26
+ await fs.ensureDir(path.join(fixtureDir, 'node_modules', 'pkg'))
27
+ await fs.writeJson(path.join(fixtureDir, 'package.json'), { name: 'test' })
28
+ await fs.writeFile(path.join(fixtureDir, '.env'), 'SECRET=1')
29
+ await fs.writeFile(path.join(fixtureDir, 'package-lock.json'), '{}')
30
+ await fs.writeFile(path.join(fixtureDir, 'src', 'app', 'page.tsx'), 'export default function Page() {}')
31
+ const { getCollectedFilesForTest } = await import('./copy-template.js')
32
+ const files = getCollectedFilesForTest(fixtureDir)
33
+ expect(files).toContain('package.json')
34
+ expect(files.some(f => f.includes('node_modules'))).toBe(false)
35
+ expect(files.some(f => f.includes('.env'))).toBe(false)
36
+ expect(files.some(f => f.includes('package-lock'))).toBe(false)
37
+ const srcFiles = files.filter(f => f.includes('src'))
38
+ expect(srcFiles.length).toBeGreaterThan(0)
39
+ await copyTemplate(destDir, undefined, fixtureDir)
40
+ expect(await fs.pathExists(path.join(destDir, 'package.json'))).toBe(true)
41
+ expect(await fs.pathExists(path.join(destDir, 'src'))).toBe(true)
42
+ expect(await fs.pathExists(path.join(destDir, 'src', 'app', 'page.tsx'))).toBe(true)
43
+ const hasNodeModules = await fs.pathExists(path.join(destDir, 'node_modules'))
44
+ const hasEnv = await fs.pathExists(path.join(destDir, '.env'))
45
+ const hasLock = await fs.pathExists(path.join(destDir, 'package-lock.json'))
46
+ expect(hasNodeModules).toBe(false)
47
+ expect(hasEnv).toBe(false)
48
+ expect(hasLock).toBe(false)
49
+ })
50
+ it('copies package-lock.json when packageManager is npm', async () => {
51
+ const fixtureDir = path.join(tempDir, 'fixture')
52
+ await fs.ensureDir(path.join(fixtureDir, 'src'))
53
+ await fs.writeJson(path.join(fixtureDir, 'package.json'), { name: 'test' })
54
+ await fs.writeFile(path.join(fixtureDir, 'package-lock.json'), '{"lockfileVersion": 3}')
55
+ await fs.writeFile(path.join(fixtureDir, 'src', 'index.ts'), '// empty')
56
+ await copyTemplate(destDir, undefined, fixtureDir, 'npm')
57
+ expect(await fs.pathExists(path.join(destDir, 'package-lock.json'))).toBe(true)
58
+ expect(await fs.readFile(path.join(destDir, 'package-lock.json'), 'utf-8')).toBe('{"lockfileVersion": 3}')
59
+ })
60
+ it('does not copy package-lock.json when packageManager is not npm', async () => {
61
+ const fixtureDir = path.join(tempDir, 'fixture')
62
+ await fs.ensureDir(path.join(fixtureDir, 'src'))
63
+ await fs.writeJson(path.join(fixtureDir, 'package.json'), { name: 'test' })
64
+ await fs.writeFile(path.join(fixtureDir, 'package-lock.json'), '{}')
65
+ await fs.writeFile(path.join(fixtureDir, 'src', 'index.ts'), '// empty')
66
+ await copyTemplate(destDir, undefined, fixtureDir, 'yarn')
67
+ expect(await fs.pathExists(path.join(destDir, 'package-lock.json'))).toBe(false)
68
+ })
69
+ })
70
+ })
71
+ //# sourceMappingURL=copy-template.test.js.map
@@ -1,2 +1,2 @@
1
- export {};
2
- //# sourceMappingURL=download-repo.test.d.ts.map
1
+ export {}
2
+ //# sourceMappingURL=download-repo.test.d.ts.map
@@ -1,14 +1,16 @@
1
- import { describe, it, expect, vi, afterEach } from 'vitest';
2
- import { downloadRepo } from './download-repo.js';
1
+ import { describe, it, expect, vi, afterEach } from 'vitest'
2
+ import { downloadRepo } from './download-repo.js'
3
3
  describe('downloadRepo', () => {
4
- const originalFetch = globalThis.fetch;
5
- afterEach(() => {
6
- vi.restoreAllMocks();
7
- globalThis.fetch = originalFetch;
8
- });
9
- it('throws with message including both attempts and CREATE_APPRAISE_USE_BUNDLED when both tarball and clone fail', async () => {
10
- globalThis.fetch = vi.fn().mockResolvedValue({ ok: false, status: 404, statusText: 'Not Found' });
11
- await expect(downloadRepo('https://github.com/invalid/repo', 'main', 'templates/default')).rejects.toThrow(/CREATE_APPRAISE_USE_BUNDLED/);
12
- }, 15000);
13
- });
14
- //# sourceMappingURL=download-repo.test.js.map
4
+ const originalFetch = globalThis.fetch
5
+ afterEach(() => {
6
+ vi.restoreAllMocks()
7
+ globalThis.fetch = originalFetch
8
+ })
9
+ it('throws with message including both attempts and CREATE_APPRAISE_USE_BUNDLED when both tarball and clone fail', async () => {
10
+ globalThis.fetch = vi.fn().mockResolvedValue({ ok: false, status: 404, statusText: 'Not Found' })
11
+ await expect(downloadRepo('https://github.com/invalid/repo', 'main', 'templates/default')).rejects.toThrow(
12
+ /CREATE_APPRAISE_USE_BUNDLED/,
13
+ )
14
+ }, 15000)
15
+ })
16
+ //# sourceMappingURL=download-repo.test.js.map
@@ -1,2 +1,2 @@
1
- export {};
2
- //# sourceMappingURL=install.test.d.ts.map
1
+ export {}
2
+ //# sourceMappingURL=install.test.d.ts.map