@wasp.sh/wasp-cli-darwin-arm64-unknown 0.23.0 → 0.24.0-rc.2

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 (233) hide show
  1. package/data/Cli/starters/basic/main.wasp.ts +60 -0
  2. package/data/Cli/starters/basic/package.json +4 -1
  3. package/data/Cli/starters/basic/prettier.config.mjs +9 -0
  4. package/data/Cli/starters/basic/src/tags/tags.wasp.ts +8 -0
  5. package/data/Cli/starters/basic/src/tasks/task.wasp.ts +16 -0
  6. package/data/Cli/starters/minimal/main.wasp.ts +12 -0
  7. package/data/Cli/starters/minimal/package.json +4 -1
  8. package/data/Cli/starters/skeleton/AGENTS.md +23 -0
  9. package/data/Cli/starters/skeleton/CLAUDE.md +23 -0
  10. package/data/Cli/starters/skeleton/tsconfig.json +5 -26
  11. package/data/Cli/starters/{ts-minimal → skeleton}/tsconfig.src.json +2 -1
  12. package/data/Cli/starters/{ts-minimal → skeleton}/tsconfig.wasp.json +5 -2
  13. package/data/Generator/libs/auth/{wasp.sh-lib-auth-0.23.0.tgz → wasp.sh-lib-auth-0.24.0.tgz} +0 -0
  14. package/data/Generator/libs/vite-ssr/{wasp.sh-lib-vite-ssr-0.23.0.tgz → wasp.sh-lib-vite-ssr-0.24.0.tgz} +0 -0
  15. package/data/Generator/templates/sdk/wasp/api/index.ts +51 -47
  16. package/data/Generator/templates/sdk/wasp/auth/email/actions/login.ts +5 -2
  17. package/data/Generator/templates/sdk/wasp/auth/email/actions/passwordReset.ts +9 -4
  18. package/data/Generator/templates/sdk/wasp/auth/email/actions/signup.ts +5 -2
  19. package/data/Generator/templates/sdk/wasp/auth/email/actions/verifyEmail.ts +5 -2
  20. package/data/Generator/templates/sdk/wasp/auth/responseSchemas.ts +10 -0
  21. package/data/Generator/templates/sdk/wasp/auth/useAuth.ts +2 -2
  22. package/data/Generator/templates/sdk/wasp/auth/username/actions/login.ts +5 -3
  23. package/data/Generator/templates/sdk/wasp/auth/username/actions/signup.ts +3 -2
  24. package/data/Generator/templates/sdk/wasp/client/app/layout.tsx +13 -20
  25. package/data/Generator/templates/sdk/wasp/client/app/pages/OAuthCallback.tsx +12 -11
  26. package/data/Generator/templates/sdk/wasp/client/env/schema.ts +8 -8
  27. package/data/Generator/templates/sdk/wasp/client/env.ts +2 -2
  28. package/data/Generator/templates/sdk/wasp/client/operations/internal/index.ts +4 -2
  29. package/data/Generator/templates/sdk/wasp/client/router/NavLink.tsx +21 -0
  30. package/data/Generator/templates/sdk/wasp/client/router/index.ts +2 -0
  31. package/data/Generator/templates/sdk/wasp/client/vite/plugins/typescriptCheck.ts +8 -4
  32. package/data/Generator/templates/sdk/wasp/client/vite/plugins/validateEnv.ts +72 -44
  33. package/data/Generator/templates/sdk/wasp/client/vite/plugins/wasp.ts +1 -1
  34. package/data/Generator/templates/sdk/wasp/tsconfig.json +3 -0
  35. package/data/Generator/templates/types/spec/register.ts +14 -0
  36. package/data/packages/deploy/dist/providers/railway/commands/setup/setup.js +9 -0
  37. package/data/packages/deploy/dist/providers/railway/jsonOutputSchemas.js +47 -0
  38. package/data/packages/deploy/dist/providers/railway/railwayService/deployment.js +45 -0
  39. package/data/packages/deploy/package-lock.json +2 -2
  40. package/data/packages/deploy/package.json +1 -1
  41. package/data/packages/prisma/package-lock.json +2 -2
  42. package/data/packages/prisma/package.json +1 -2
  43. package/data/packages/spec/dist/__tests__/cli.unit.test.js +128 -0
  44. package/data/packages/spec/dist/__tests__/legacy/appAnalyzer.unit.test.d.ts.map +1 -0
  45. package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/appAnalyzer.unit.test.js +3 -3
  46. package/data/packages/spec/dist/__tests__/legacy/mapTsAppSpecToAppSpecDecls.integration.test.d.ts.map +1 -0
  47. package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/mapTsAppSpecToAppSpecDecls.integration.test.js +2 -2
  48. package/data/packages/spec/dist/__tests__/legacy/mapTsAppSpecToAppSpecDecls.unit.test.d.ts.map +1 -0
  49. package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/mapTsAppSpecToAppSpecDecls.unit.test.js +4 -18
  50. package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/testFixtures.d.ts +4 -4
  51. package/data/packages/spec/dist/__tests__/legacy/testFixtures.d.ts.map +1 -0
  52. package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/testFixtures.js +2 -2
  53. package/data/packages/spec/dist/__tests__/legacy/testFixtures.test-d.d.ts.map +1 -0
  54. package/data/packages/spec/dist/__tests__/spec/appAnalyzer.unit.test.d.ts +2 -0
  55. package/data/packages/spec/dist/__tests__/spec/appAnalyzer.unit.test.d.ts.map +1 -0
  56. package/data/packages/spec/dist/__tests__/spec/appAnalyzer.unit.test.js +68 -0
  57. package/data/packages/spec/dist/__tests__/spec/mapApp.unit.test.d.ts +2 -0
  58. package/data/packages/spec/dist/__tests__/spec/mapApp.unit.test.d.ts.map +1 -0
  59. package/data/packages/spec/dist/__tests__/spec/mapApp.unit.test.js +814 -0
  60. package/data/packages/spec/dist/__tests__/spec/refObject.test-d.d.ts +2 -0
  61. package/data/packages/spec/dist/__tests__/spec/refObject.test-d.d.ts.map +1 -0
  62. package/data/packages/spec/dist/__tests__/spec/refObject.test-d.js +148 -0
  63. package/data/packages/spec/dist/__tests__/spec/refObject.unit.test.d.ts +2 -0
  64. package/data/packages/spec/dist/__tests__/spec/refObject.unit.test.d.ts.map +1 -0
  65. package/data/packages/spec/dist/__tests__/spec/refObject.unit.test.js +49 -0
  66. package/data/packages/spec/dist/__tests__/spec/refObjectPath.unit.test.d.ts +2 -0
  67. package/data/packages/spec/dist/__tests__/spec/refObjectPath.unit.test.d.ts.map +1 -0
  68. package/data/packages/spec/dist/__tests__/spec/refObjectPath.unit.test.js +204 -0
  69. package/data/packages/spec/dist/__tests__/spec/testFixtures.d.ts +85 -0
  70. package/data/packages/spec/dist/__tests__/spec/testFixtures.d.ts.map +1 -0
  71. package/data/packages/spec/dist/__tests__/spec/testFixtures.js +473 -0
  72. package/data/packages/spec/dist/__tests__/spec/tsAppSpec.test-d.d.ts +2 -0
  73. package/data/packages/spec/dist/__tests__/spec/tsAppSpec.test-d.d.ts.map +1 -0
  74. package/data/packages/spec/dist/__tests__/spec/tsAppSpec.test-d.js +44 -0
  75. package/data/packages/spec/dist/__tests__/spec-pipeline/pipeline.integration.test.d.ts +2 -0
  76. package/data/packages/spec/dist/__tests__/spec-pipeline/pipeline.integration.test.d.ts.map +1 -0
  77. package/data/packages/spec/dist/__tests__/spec-pipeline/pipeline.integration.test.js +218 -0
  78. package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/imports.unit.test.d.ts +2 -0
  79. package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/imports.unit.test.d.ts.map +1 -0
  80. package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/imports.unit.test.js +174 -0
  81. package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/refHelper.unit.test.d.ts +2 -0
  82. package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/refHelper.unit.test.d.ts.map +1 -0
  83. package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/refHelper.unit.test.js +119 -0
  84. package/data/packages/{wasp-config → spec}/dist/src/appSpec.d.ts +11 -4
  85. package/data/packages/spec/dist/src/appSpec.d.ts.map +1 -0
  86. package/data/packages/{wasp-config → spec}/dist/src/cli.d.ts +3 -1
  87. package/data/packages/spec/dist/src/cli.d.ts.map +1 -0
  88. package/data/packages/spec/dist/src/cli.js +28 -0
  89. package/data/packages/spec/dist/src/index.d.ts +2 -0
  90. package/data/packages/spec/dist/src/index.d.ts.map +1 -0
  91. package/data/packages/spec/dist/src/index.js +1 -0
  92. package/data/packages/spec/dist/src/internal.d.ts +2 -0
  93. package/data/packages/spec/dist/src/internal.d.ts.map +1 -0
  94. package/data/packages/spec/dist/src/internal.js +1 -0
  95. package/data/packages/spec/dist/src/legacy/_private.d.ts.map +1 -0
  96. package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/appAnalyzer.d.ts +1 -1
  97. package/data/packages/spec/dist/src/legacy/appAnalyzer.d.ts.map +1 -0
  98. package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/mapTsAppSpecToAppSpecDecls.d.ts +1 -1
  99. package/data/packages/spec/dist/src/legacy/mapTsAppSpecToAppSpecDecls.d.ts.map +1 -0
  100. package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/mapTsAppSpecToAppSpecDecls.js +3 -6
  101. package/data/packages/spec/dist/src/legacy/publicApi/App.d.ts.map +1 -0
  102. package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/publicApi/tsAppSpec.d.ts +3 -3
  103. package/data/packages/spec/dist/src/legacy/publicApi/tsAppSpec.d.ts.map +1 -0
  104. package/data/packages/spec/dist/src/run.js +28 -0
  105. package/data/packages/spec/dist/src/spec/appAnalyzer.d.ts +8 -0
  106. package/data/packages/spec/dist/src/spec/appAnalyzer.d.ts.map +1 -0
  107. package/data/packages/spec/dist/src/spec/appAnalyzer.js +35 -0
  108. package/data/packages/spec/dist/src/spec/mapApp.d.ts +54 -0
  109. package/data/packages/spec/dist/src/spec/mapApp.d.ts.map +1 -0
  110. package/data/packages/spec/dist/src/spec/mapApp.js +336 -0
  111. package/data/packages/spec/dist/src/spec/publicApi/constructors.d.ts +296 -0
  112. package/data/packages/spec/dist/src/spec/publicApi/constructors.d.ts.map +1 -0
  113. package/data/packages/spec/dist/src/spec/publicApi/constructors.js +277 -0
  114. package/data/packages/spec/dist/src/spec/publicApi/index.d.ts +5 -0
  115. package/data/packages/spec/dist/src/spec/publicApi/index.d.ts.map +1 -0
  116. package/data/packages/spec/dist/src/spec/publicApi/index.js +2 -0
  117. package/data/packages/spec/dist/src/spec/publicApi/register.d.ts +9 -0
  118. package/data/packages/spec/dist/src/spec/publicApi/register.d.ts.map +1 -0
  119. package/data/packages/spec/dist/src/spec/publicApi/register.js +1 -0
  120. package/data/packages/spec/dist/src/spec/publicApi/waspSpec.d.ts +872 -0
  121. package/data/packages/spec/dist/src/spec/publicApi/waspSpec.d.ts.map +1 -0
  122. package/data/packages/spec/dist/src/spec/publicApi/waspSpec.js +1 -0
  123. package/data/packages/spec/dist/src/spec/refObject.d.ts +95 -0
  124. package/data/packages/spec/dist/src/spec/refObject.d.ts.map +1 -0
  125. package/data/packages/spec/dist/src/spec/refObject.js +119 -0
  126. package/data/packages/spec/dist/src/spec/refObjectPath.d.ts +18 -0
  127. package/data/packages/spec/dist/src/spec/refObjectPath.d.ts.map +1 -0
  128. package/data/packages/spec/dist/src/spec/refObjectPath.js +79 -0
  129. package/data/packages/spec/dist/src/spec/specUserError.d.ts +9 -0
  130. package/data/packages/spec/dist/src/spec/specUserError.d.ts.map +1 -0
  131. package/data/packages/spec/dist/src/spec/specUserError.js +8 -0
  132. package/data/packages/spec/dist/src/spec-pipeline/common.d.ts +2 -0
  133. package/data/packages/spec/dist/src/spec-pipeline/common.d.ts.map +1 -0
  134. package/data/packages/spec/dist/src/spec-pipeline/common.js +1 -0
  135. package/data/packages/spec/dist/src/spec-pipeline/loadWaspTsSpec.d.ts +5 -0
  136. package/data/packages/spec/dist/src/spec-pipeline/loadWaspTsSpec.d.ts.map +1 -0
  137. package/data/packages/spec/dist/src/spec-pipeline/loadWaspTsSpec.js +46 -0
  138. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/apply.d.ts +4 -0
  139. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/apply.d.ts.map +1 -0
  140. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/apply.js +34 -0
  141. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/check.d.ts +3 -0
  142. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/check.d.ts.map +1 -0
  143. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/check.js +14 -0
  144. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/index.d.ts +5 -0
  145. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/index.d.ts.map +1 -0
  146. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/index.js +40 -0
  147. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/plan.d.ts +26 -0
  148. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/plan.d.ts.map +1 -0
  149. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/plan.js +57 -0
  150. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/index.d.ts +3 -0
  151. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/index.d.ts.map +1 -0
  152. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/index.js +8 -0
  153. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/apply.d.ts +4 -0
  154. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/apply.d.ts.map +1 -0
  155. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/apply.js +18 -0
  156. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/check.d.ts +3 -0
  157. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/check.d.ts.map +1 -0
  158. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/check.js +13 -0
  159. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/index.d.ts +5 -0
  160. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/index.d.ts.map +1 -0
  161. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/index.js +40 -0
  162. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/plan.d.ts +19 -0
  163. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/plan.d.ts.map +1 -0
  164. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/plan.js +60 -0
  165. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/util.d.ts +10 -0
  166. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/util.d.ts.map +1 -0
  167. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/util.js +53 -0
  168. package/data/packages/spec/dist/src/spec-pipeline/typecheckPlugin/index.d.ts +5 -0
  169. package/data/packages/spec/dist/src/spec-pipeline/typecheckPlugin/index.d.ts.map +1 -0
  170. package/data/packages/spec/dist/src/spec-pipeline/typecheckPlugin/index.js +38 -0
  171. package/data/packages/spec/dist/src/spec-pipeline/typecheckPlugin/project.d.ts +9 -0
  172. package/data/packages/spec/dist/src/spec-pipeline/typecheckPlugin/project.d.ts.map +1 -0
  173. package/data/packages/spec/dist/src/spec-pipeline/typecheckPlugin/project.js +66 -0
  174. package/data/packages/spec/dist/src/typeUtils.d.ts +3 -0
  175. package/data/packages/spec/dist/src/typeUtils.d.ts.map +1 -0
  176. package/data/packages/spec/dist/src/typeUtils.js +1 -0
  177. package/data/packages/{wasp-config → spec}/package-lock.json +921 -1475
  178. package/data/packages/spec/package.json +48 -0
  179. package/data/packages/studio/package-lock.json +2 -2
  180. package/data/packages/studio/package.json +1 -1
  181. package/data/packages/ts-inspect/package-lock.json +2 -2
  182. package/data/packages/ts-inspect/package.json +1 -1
  183. package/package.json +1 -1
  184. package/wasp-bin +0 -0
  185. package/data/Cli/starters/basic/.prettierrc +0 -3
  186. package/data/Cli/starters/basic/main.wasp +0 -100
  187. package/data/Cli/starters/minimal/main.wasp +0 -14
  188. package/data/Cli/starters/ts-minimal/main.wasp.ts +0 -15
  189. package/data/Cli/starters/ts-minimal/package.json +0 -18
  190. package/data/Cli/starters/ts-minimal/schema.prisma +0 -10
  191. package/data/Cli/starters/ts-minimal/src/Main.css +0 -103
  192. package/data/Cli/starters/ts-minimal/src/MainPage.tsx +0 -37
  193. package/data/Cli/starters/ts-minimal/src/assets/logo.svg +0 -1
  194. package/data/Cli/starters/ts-minimal/tsconfig.json +0 -7
  195. package/data/Cli/starters/ts-minimal/vite.config.ts +0 -9
  196. package/data/packages/wasp-config/dist/__tests__/appAnalyzer.unit.test.d.ts.map +0 -1
  197. package/data/packages/wasp-config/dist/__tests__/cli.unit.test.js +0 -65
  198. package/data/packages/wasp-config/dist/__tests__/mapTsAppSpecToAppSpecDecls.integration.test.d.ts.map +0 -1
  199. package/data/packages/wasp-config/dist/__tests__/mapTsAppSpecToAppSpecDecls.unit.test.d.ts.map +0 -1
  200. package/data/packages/wasp-config/dist/__tests__/testFixtures.d.ts.map +0 -1
  201. package/data/packages/wasp-config/dist/__tests__/testFixtures.test-d.d.ts.map +0 -1
  202. package/data/packages/wasp-config/dist/src/_private.d.ts.map +0 -1
  203. package/data/packages/wasp-config/dist/src/appAnalyzer.d.ts.map +0 -1
  204. package/data/packages/wasp-config/dist/src/appSpec.d.ts.map +0 -1
  205. package/data/packages/wasp-config/dist/src/cli.d.ts.map +0 -1
  206. package/data/packages/wasp-config/dist/src/cli.js +0 -24
  207. package/data/packages/wasp-config/dist/src/index.d.ts +0 -8
  208. package/data/packages/wasp-config/dist/src/index.d.ts.map +0 -1
  209. package/data/packages/wasp-config/dist/src/index.js +0 -1
  210. package/data/packages/wasp-config/dist/src/mapTsAppSpecToAppSpecDecls.d.ts.map +0 -1
  211. package/data/packages/wasp-config/dist/src/publicApi/App.d.ts.map +0 -1
  212. package/data/packages/wasp-config/dist/src/publicApi/tsAppSpec.d.ts.map +0 -1
  213. package/data/packages/wasp-config/dist/src/run.js +0 -18
  214. package/data/packages/wasp-config/package.json +0 -40
  215. /package/data/packages/{wasp-config → spec}/dist/__tests__/cli.unit.test.d.ts +0 -0
  216. /package/data/packages/{wasp-config → spec}/dist/__tests__/cli.unit.test.d.ts.map +0 -0
  217. /package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/appAnalyzer.unit.test.d.ts +0 -0
  218. /package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/mapTsAppSpecToAppSpecDecls.integration.test.d.ts +0 -0
  219. /package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/mapTsAppSpecToAppSpecDecls.unit.test.d.ts +0 -0
  220. /package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/testFixtures.test-d.d.ts +0 -0
  221. /package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/testFixtures.test-d.js +0 -0
  222. /package/data/packages/{wasp-config → spec}/dist/src/appSpec.js +0 -0
  223. /package/data/packages/{wasp-config → spec}/dist/src/branded.d.ts +0 -0
  224. /package/data/packages/{wasp-config → spec}/dist/src/branded.d.ts.map +0 -0
  225. /package/data/packages/{wasp-config → spec}/dist/src/branded.js +0 -0
  226. /package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/_private.d.ts +0 -0
  227. /package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/_private.js +0 -0
  228. /package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/appAnalyzer.js +0 -0
  229. /package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/publicApi/App.d.ts +0 -0
  230. /package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/publicApi/App.js +0 -0
  231. /package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/publicApi/tsAppSpec.js +0 -0
  232. /package/data/packages/{wasp-config → spec}/dist/src/run.d.ts +0 -0
  233. /package/data/packages/{wasp-config → spec}/dist/src/run.d.ts.map +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waspSpec.d.ts","sourceRoot":"","sources":["../../../../src/spec/publicApi/waspSpec.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,GAAG;IAClB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,EAAE,IAAI,CAAC;IACX;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,+DAA+D;IAC/D,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,EAAE,CAAC,EAAE,EAAE,CAAC;IACR,gDAAgD;IAChD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,qDAAqD;IACrD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;;OAMG;IACH,IAAI,EAAE,IAAI,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,IAAK,SAAQ,SAAS;IACrC;;;;;;;;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GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;;;;;;;OAaG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,QAAQ,SAAS,KAAK,GACjD,MAAM,GACN,OAAO,CAAC,MAAM,QAAQ,EAAE,MAAM,CAAC,CAAC;AAEpC,KAAK,QAAQ,GAAG,YAAY,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,SAAS,CAAC,QAAQ,IAAI,SAAS,GAAG,QAAQ,CAAC;AAEvD,YAAY;AACV;;GAEG;AACH,0BAA0B;AAC1B;;GAEG;AACH,wBAAwB;AACxB;;;GAGG;AACH,SAAS;AACT;;GAEG;AACH,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AAEzB,UAAU,eAAe,CAAC,IAAI,SAAS,MAAM;IAC3C;;;OAGG;IACH,IAAI,EAAE,IAAI,CAAC;CACZ;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,IAAI,EAAE;QACb,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;KACtB,CAAC;CACH,CAAC"}
@@ -0,0 +1,95 @@
1
+ import type * as AppSpec from "../appSpec.js";
2
+ import type { Branded } from "../branded.js";
3
+ /**
4
+ * A reference to code in your app's `src` directory.
5
+ *
6
+ * @category References
7
+ */
8
+ export type RefObject = Branded<RefObjectDescriptor & {
9
+ kind: "refObject";
10
+ }, "RefObject">;
11
+ /**
12
+ * Input accepted by {@link ref}.
13
+ *
14
+ * @category References
15
+ */
16
+ export type RefObjectDescriptor = NamedRefObjectDescriptor | DefaultRefObjectDescriptor;
17
+ /**
18
+ * Named import reference, equivalent to
19
+ * `import { SomeValue } from "./src/someModule" with { type: "ref" }`.
20
+ *
21
+ * @category References
22
+ */
23
+ export interface NamedRefObjectDescriptor {
24
+ /** Exported name to import. */
25
+ import: string;
26
+ /**
27
+ * Optional local alias.
28
+ *
29
+ * Alias takes precedence over the `import` field when
30
+ * Wasp Spec dervies some {@link WaspSpec.SpecElement} name.
31
+ */
32
+ alias?: string;
33
+ /** Module path, relative to the `*.wasp.ts` file using it. */
34
+ from: string;
35
+ }
36
+ /**
37
+ * Default import reference, equivalent to
38
+ * `import SomeValue from "./src/someModule" with { type: "ref" }`.
39
+ *
40
+ * @category References
41
+ */
42
+ export interface DefaultRefObjectDescriptor {
43
+ /** Local name for the default import. */
44
+ importDefault: string;
45
+ /** Module path, relative to the `*.wasp.ts` file using it. */
46
+ from: string;
47
+ }
48
+ /**
49
+ * Creates a fallback reference object for a value from your app.
50
+ *
51
+ * {@include ./publicApi/referenceImports.md}
52
+ *
53
+ * Reference imports are preferred because editors can follow and rename real
54
+ * imports.
55
+ *
56
+ * The import path must be relative to the `*.wasp.ts` file where it is used
57
+ * and resolve inside the app's `src/` directory. Absolute
58
+ * paths are not supported.
59
+ *
60
+ * @category References
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * import { page, ref } from "@wasp.sh/spec"
65
+ *
66
+ * const MainPage = ref({
67
+ * importDefault: "MainPage",
68
+ * from: "./src/MainPage",
69
+ * })
70
+ *
71
+ * export const mainPage = page(MainPage)
72
+ * ```
73
+ */
74
+ export declare function ref(_descriptor: RefObjectDescriptor): RefObject;
75
+ /**
76
+ * Creates a `ref` helper bound to the user's `.wasp.ts` file.
77
+ *
78
+ * Ref objects need the current spec file location to resolve relative paths,
79
+ * but `ref` itself can't use `import.meta.url` because it would point to this
80
+ * helper module. `_waspMakeRef(sourceFilePath)` lets each `.wasp.ts` file
81
+ * create a local `ref` that carries its own source file path.
82
+ *
83
+ * @internal
84
+ */
85
+ export declare function _waspMakeRef(sourceFilePath: string): (descriptor: RefObjectDescriptor) => SourceAwareRefObject;
86
+ export declare function mapRefObject(refObject: unknown, { projectRootDir }: {
87
+ projectRootDir: string;
88
+ }): AppSpec.ExtImport;
89
+ export declare function getRefObjectDeclarationName(refObject: unknown): string;
90
+ type RefObjectSource = {
91
+ sourceFilePath: string;
92
+ };
93
+ type SourceAwareRefObject = RefObject & RefObjectSource;
94
+ export {};
95
+ //# sourceMappingURL=refObject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refObject.d.ts","sourceRoot":"","sources":["../../../src/spec/refObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAK7C;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,CAC7B,mBAAmB,GAAG;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,EAC3C,WAAW,CACZ,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC3B,wBAAwB,GACxB,0BAA0B,CAAC;AAE/B;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACzC,yCAAyC;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,GAAG,CAAC,WAAW,EAAE,mBAAmB,GAAG,SAAS,CAI/D;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC1B,cAAc,EAAE,MAAM,GACrB,CAAC,UAAU,EAAE,mBAAmB,KAAK,oBAAoB,CAS3D;AAED,wBAAgB,YAAY,CAC1B,SAAS,EAAE,OAAO,EAClB,EAAE,cAAc,EAAE,EAAE;IAAE,cAAc,EAAE,MAAM,CAAA;CAAE,GAC7C,OAAO,CAAC,SAAS,CAqBnB;AAED,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,CAatE;AAmBD,KAAK,eAAe,GAAG;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,KAAK,oBAAoB,GAAG,SAAS,GAAG,eAAe,CAAC"}
@@ -0,0 +1,119 @@
1
+ import { normalizeRefObjectPath } from "./refObjectPath.js";
2
+ import { SpecUserError } from "./specUserError.js";
3
+ /**
4
+ * Creates a fallback reference object for a value from your app.
5
+ *
6
+ * {@include ./publicApi/referenceImports.md}
7
+ *
8
+ * Reference imports are preferred because editors can follow and rename real
9
+ * imports.
10
+ *
11
+ * The import path must be relative to the `*.wasp.ts` file where it is used
12
+ * and resolve inside the app's `src/` directory. Absolute
13
+ * paths are not supported.
14
+ *
15
+ * @category References
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * import { page, ref } from "@wasp.sh/spec"
20
+ *
21
+ * const MainPage = ref({
22
+ * importDefault: "MainPage",
23
+ * from: "./src/MainPage",
24
+ * })
25
+ *
26
+ * export const mainPage = page(MainPage)
27
+ * ```
28
+ */
29
+ export function ref(_descriptor) {
30
+ throw new Error("Missing Wasp transformation. The `.wasp.ts` files are not directly executable, use the Wasp CLI.");
31
+ }
32
+ /**
33
+ * Creates a `ref` helper bound to the user's `.wasp.ts` file.
34
+ *
35
+ * Ref objects need the current spec file location to resolve relative paths,
36
+ * but `ref` itself can't use `import.meta.url` because it would point to this
37
+ * helper module. `_waspMakeRef(sourceFilePath)` lets each `.wasp.ts` file
38
+ * create a local `ref` that carries its own source file path.
39
+ *
40
+ * @internal
41
+ */
42
+ export function _waspMakeRef(sourceFilePath) {
43
+ return (descriptor) => {
44
+ const refObject = {
45
+ ...descriptor,
46
+ kind: "refObject",
47
+ };
48
+ return { ...refObject, sourceFilePath };
49
+ };
50
+ }
51
+ export function mapRefObject(refObject, { projectRootDir }) {
52
+ if (isNamedRefObject(refObject)) {
53
+ return {
54
+ kind: "named",
55
+ name: refObject.import,
56
+ path: mapRefObjectPath(refObject, { projectRootDir }),
57
+ alias: refObject.alias,
58
+ };
59
+ }
60
+ else if (isDefaultRefObject(refObject)) {
61
+ return {
62
+ kind: "default",
63
+ name: refObject.importDefault,
64
+ path: mapRefObjectPath(refObject, { projectRootDir }),
65
+ };
66
+ }
67
+ else {
68
+ throw new SpecUserError("Got an import in the Wasp file that we couldn't process: " +
69
+ JSON.stringify(refObject) +
70
+ '\nYou either used a value imported without `with { type: "ref" }` or didn\'t write the ref object correctly.');
71
+ }
72
+ }
73
+ export function getRefObjectDeclarationName(refObject) {
74
+ if (isNamedRefObject(refObject)) {
75
+ return refObject.alias ?? refObject.import;
76
+ }
77
+ if (isDefaultRefObject(refObject)) {
78
+ return refObject.importDefault;
79
+ }
80
+ throw new SpecUserError("Got an import in the Wasp file that we couldn't process: " +
81
+ JSON.stringify(refObject));
82
+ }
83
+ function mapRefObjectPath(refObject, { projectRootDir }) {
84
+ if (!hasSourceFilePath(refObject)) {
85
+ throw new SpecUserError(`Relative ref path ${JSON.stringify(refObject.from)} is missing source file information. Use \`ref(...)\` in a \`*.wasp.ts\` file.`);
86
+ }
87
+ return normalizeRefObjectPath({
88
+ importPath: refObject.from,
89
+ importingFilePath: refObject.sourceFilePath,
90
+ projectRootDir,
91
+ });
92
+ }
93
+ function hasSourceFilePath(value) {
94
+ return (isObject(value) &&
95
+ "sourceFilePath" in value &&
96
+ typeof value.sourceFilePath === "string");
97
+ }
98
+ function isNamedRefObject(value) {
99
+ return (isObject(value) &&
100
+ typeof value.import === "string" &&
101
+ typeof value.from === "string" &&
102
+ hasValidAlias(value) &&
103
+ hasRefObjectMarker(value));
104
+ }
105
+ function isDefaultRefObject(value) {
106
+ return (isObject(value) &&
107
+ typeof value.importDefault === "string" &&
108
+ typeof value.from === "string" &&
109
+ hasRefObjectMarker(value));
110
+ }
111
+ function hasRefObjectMarker(value) {
112
+ return value.kind === "refObject";
113
+ }
114
+ function hasValidAlias(value) {
115
+ return value.alias === undefined || typeof value.alias === "string";
116
+ }
117
+ function isObject(value) {
118
+ return Object.prototype.toString.call(value) === "[object Object]";
119
+ }
@@ -0,0 +1,18 @@
1
+ import type * as AppSpec from "../appSpec.js";
2
+ /**
3
+ * Converts a relative ref object path from the user's `.wasp.ts` file into
4
+ * AppSpec's absolute `@src/...` path format.
5
+ *
6
+ * This keeps user-authored paths source-relative while giving the Haskell side
7
+ * the same project-rooted paths it already understands.
8
+ *
9
+ * For example, `./src/MainPage` from `/app/main.wasp.ts` becomes
10
+ * `@src/MainPage`, while `./LoginPage` from `/app/src/auth/auth.wasp.ts`
11
+ * becomes `@src/auth/LoginPage`.
12
+ */
13
+ export declare function normalizeRefObjectPath({ importPath, importingFilePath, projectRootDir, }: {
14
+ importPath: string;
15
+ importingFilePath: string;
16
+ projectRootDir: string;
17
+ }): AppSpec.ExtImport["path"];
18
+ //# sourceMappingURL=refObjectPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refObjectPath.d.ts","sourceRoot":"","sources":["../../../src/spec/refObjectPath.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAC;AAG9C;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,UAAU,EACV,iBAAiB,EACjB,cAAc,GACf,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;CACxB,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAQ5B"}
@@ -0,0 +1,79 @@
1
+ import { realpathSync } from "node:fs";
2
+ import * as path from "node:path/posix"; // Module paths are always `/`-delimited
3
+ import { SpecUserError } from "./specUserError.js";
4
+ /**
5
+ * Converts a relative ref object path from the user's `.wasp.ts` file into
6
+ * AppSpec's absolute `@src/...` path format.
7
+ *
8
+ * This keeps user-authored paths source-relative while giving the Haskell side
9
+ * the same project-rooted paths it already understands.
10
+ *
11
+ * For example, `./src/MainPage` from `/app/main.wasp.ts` becomes
12
+ * `@src/MainPage`, while `./LoginPage` from `/app/src/auth/auth.wasp.ts`
13
+ * becomes `@src/auth/LoginPage`.
14
+ */
15
+ export function normalizeRefObjectPath({ importPath, importingFilePath, projectRootDir, }) {
16
+ const srcRelativePath = getValidSrcRelativePath({
17
+ importPath,
18
+ importingFilePath,
19
+ projectRootDir,
20
+ });
21
+ return toAppSpecExtImportPath(srcRelativePath);
22
+ }
23
+ function getValidSrcRelativePath({ importPath, importingFilePath, projectRootDir, }) {
24
+ // The bundler resolves symlinks in module ids, so we compare paths under a
25
+ // canonical project root. Otherwise valid in-src imports can look like they
26
+ // escape src/ because one path has symlinks resolved and the other does not.
27
+ const projectRootPath = path.resolve(projectRootDir);
28
+ const canonicalProjectRootPath = getCanonicalPath(projectRootPath);
29
+ const canonicalImportingFilePath = toCanonicalProjectPath({
30
+ filePath: path.resolve(importingFilePath),
31
+ projectRootPath,
32
+ canonicalProjectRootPath,
33
+ });
34
+ const importingDir = path.dirname(canonicalImportingFilePath);
35
+ const srcRootDir = path.resolve(canonicalProjectRootPath, "src");
36
+ const importedFilePath = path.resolve(importingDir, importPath);
37
+ const srcRelativePath = path.relative(srcRootDir, importedFilePath);
38
+ if (!isValidSrcRelativeFilePath(srcRelativePath)) {
39
+ throw new SpecUserError(`Reference import path ${JSON.stringify(importPath)} in ${JSON.stringify(importingFilePath)} must resolve to a file inside the app src/ directory.`);
40
+ }
41
+ return srcRelativePath;
42
+ }
43
+ function getCanonicalPath(filePath) {
44
+ try {
45
+ return realpathSync(filePath);
46
+ }
47
+ catch (error) {
48
+ if (isNodeError(error) && error.code === "ENOENT") {
49
+ return filePath;
50
+ }
51
+ throw error;
52
+ }
53
+ }
54
+ function toCanonicalProjectPath({ filePath, projectRootPath, canonicalProjectRootPath, }) {
55
+ const projectRelativePath = getPathInsideRoot(filePath, projectRootPath) ??
56
+ getPathInsideRoot(filePath, canonicalProjectRootPath);
57
+ return projectRelativePath !== undefined
58
+ ? path.resolve(canonicalProjectRootPath, projectRelativePath)
59
+ : filePath;
60
+ }
61
+ function getPathInsideRoot(filePath, rootDir) {
62
+ const relativePath = path.relative(rootDir, filePath);
63
+ return isInsideRootRelativePath(relativePath) ? relativePath : undefined;
64
+ }
65
+ function toAppSpecExtImportPath(srcRelativePath) {
66
+ return path.join("@src", srcRelativePath);
67
+ }
68
+ function isValidSrcRelativeFilePath(srcRelativePath) {
69
+ return srcRelativePath !== "" && isInsideRootRelativePath(srcRelativePath);
70
+ }
71
+ function isInsideRootRelativePath(relativePath) {
72
+ return (!startsWithParentSegment(relativePath) && !path.isAbsolute(relativePath));
73
+ }
74
+ function startsWithParentSegment(filePath) {
75
+ return filePath === ".." || filePath.startsWith(`..${path.sep}`);
76
+ }
77
+ function isNodeError(error) {
78
+ return error instanceof Error && "code" in error;
79
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Error caused by invalid user input (unknown entities, bad imports, etc.).
3
+ *
4
+ * These are the errors users hit most often during development, so their
5
+ * messages should be short, clear, and actionable.
6
+ */
7
+ export declare class SpecUserError extends Error {
8
+ }
9
+ //# sourceMappingURL=specUserError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"specUserError.d.ts","sourceRoot":"","sources":["../../../src/spec/specUserError.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,KAAK;CAAG"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Error caused by invalid user input (unknown entities, bad imports, etc.).
3
+ *
4
+ * These are the errors users hit most often during development, so their
5
+ * messages should be short, clear, and actionable.
6
+ */
7
+ export class SpecUserError extends Error {
8
+ }
@@ -0,0 +1,2 @@
1
+ export declare const WASP_SPEC_FILE_REGEX: RegExp;
2
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/spec-pipeline/common.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,QAAgB,CAAC"}
@@ -0,0 +1 @@
1
+ export const WASP_SPEC_FILE_REGEX = /\.wasp\.ts$/;
@@ -0,0 +1,5 @@
1
+ export declare function loadWaspTsSpecDefaultExport({ specPath, tsconfigPath, }: {
2
+ specPath: string;
3
+ tsconfigPath: string;
4
+ }): Promise<unknown>;
5
+ //# sourceMappingURL=loadWaspTsSpec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadWaspTsSpec.d.ts","sourceRoot":"","sources":["../../../src/spec-pipeline/loadWaspTsSpec.ts"],"names":[],"mappings":"AAKA,wBAAsB,2BAA2B,CAAC,EAChD,QAAQ,EACR,YAAY,GACb,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,OAAO,CAAC,CAsBnB"}
@@ -0,0 +1,46 @@
1
+ import { unrun } from "unrun";
2
+ import { SpecUserError } from "../spec/specUserError.js";
3
+ import { transformWaspTsSpecFilesPlugin } from "./transformWaspTsSpecFilesPlugin/index.js";
4
+ import { typecheckPlugin } from "./typecheckPlugin/index.js";
5
+ export async function loadWaspTsSpecDefaultExport({ specPath, tsconfigPath, }) {
6
+ const { module: specModule } = await unrun({
7
+ path: specPath,
8
+ inputOptions: {
9
+ plugins: [
10
+ transformWaspTsSpecFilesPlugin(),
11
+ typecheckPlugin({ tsconfigPath }),
12
+ ],
13
+ },
14
+ // By default, unrun will directly return the `default` export. We want to
15
+ // get it ourselves, so we use this option.
16
+ // https://gugustinette.github.io/unrun/advanced/presets.html
17
+ preset: "bundle-require",
18
+ }).catch((error) => {
19
+ // When a plugin throws, the bundler wraps the original error in an
20
+ // aggregate build error and exposes the originals on `.errors`. We dig out
21
+ // the `SpecUserError` so it reaches the top-level handler in `run.ts` as a
22
+ // clean user error instead of an internal crash.
23
+ throw getSpecUserError(error) ?? error;
24
+ });
25
+ return getDefaultExport(specModule);
26
+ }
27
+ function getSpecUserError(error) {
28
+ if (
29
+ // Checks to convince TypeScript that we can access `error.errors[0]`.
30
+ error instanceof Error &&
31
+ "errors" in error &&
32
+ Array.isArray(error.errors) &&
33
+ error.errors.length === 1 &&
34
+ error.errors[0] instanceof SpecUserError) {
35
+ return error.errors[0];
36
+ }
37
+ else {
38
+ return undefined;
39
+ }
40
+ }
41
+ function getDefaultExport(loadedModule) {
42
+ if (typeof loadedModule !== "object" || loadedModule === null) {
43
+ return undefined;
44
+ }
45
+ return "default" in loadedModule ? loadedModule.default : undefined;
46
+ }
@@ -0,0 +1,4 @@
1
+ import type { RolldownMagicString } from "rolldown";
2
+ import type { Plan } from "./plan.js";
3
+ export declare function applyTransformImportsPlan_mutate(magicString: RolldownMagicString, { refImports, safeRefHelperName }: Plan): void;
4
+ //# sourceMappingURL=apply.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../../../src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/apply.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAOpD,OAAO,KAAK,EAAE,IAAI,EAAsB,MAAM,WAAW,CAAC;AAE1D,wBAAgB,gCAAgC,CAC9C,WAAW,EAAE,mBAAmB,EAChC,EAAE,UAAU,EAAE,iBAAiB,EAAE,EAAE,IAAI,GACtC,IAAI,CA0BN"}
@@ -0,0 +1,34 @@
1
+ import { SpecUserError } from "../../../spec/specUserError.js";
2
+ import { buildImportStatement, PUBLIC_REF_HELPER_IMPORT_NAME, PUBLIC_REF_HELPER_IMPORT_SOURCE, } from "../util.js";
3
+ export function applyTransformImportsPlan_mutate(magicString, { refImports, safeRefHelperName }) {
4
+ for (const { removeImport } of refImports) {
5
+ magicString.remove(removeImport.start, removeImport.end);
6
+ }
7
+ magicString.prepend([
8
+ // Add the `ref` helper import
9
+ buildImportStatement([[PUBLIC_REF_HELPER_IMPORT_NAME, safeRefHelperName]], PUBLIC_REF_HELPER_IMPORT_SOURCE),
10
+ // Convert each original ref import to a `const` declaration that uses the
11
+ // `ref` helper.
12
+ // In ES Modules, imports are always hoisted, so we add these declarations
13
+ // at the top of the file to preserve the original semantics.
14
+ ...refImports.flatMap(({ references }) => references.map((ref) => getLoweredImportSource(ref, {
15
+ refHelperName: safeRefHelperName,
16
+ }))),
17
+ ].join(""));
18
+ }
19
+ function getLoweredImportSource(ref, ctx) {
20
+ switch (ref.kind) {
21
+ case "named":
22
+ return getRefObjectBindingSource(ref.refObject.alias ?? ref.refObject.import, ref.refObject, ctx);
23
+ case "default":
24
+ return getRefObjectBindingSource(ref.refObject.importDefault, ref.refObject, ctx);
25
+ case "namespace":
26
+ throw new SpecUserError([
27
+ "Namespace imports are not supported for reference imports.",
28
+ `Replace \`import * as ${ref.alias} from "${ref.from}" with { type: "ref" }\` with a named or default reference import.`,
29
+ ].join("\n"));
30
+ }
31
+ }
32
+ function getRefObjectBindingSource(identifier, descriptor, { refHelperName }) {
33
+ return `const ${identifier} = ${refHelperName}(${JSON.stringify(descriptor)});\n`;
34
+ }
@@ -0,0 +1,3 @@
1
+ import type { ESTree as t } from "rolldown/utils";
2
+ export declare function assertCanTransformImports(ast: t.Program): void;
3
+ //# sourceMappingURL=check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../../../src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/check.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,gBAAgB,CAAC;AAIlD,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,GAAG,IAAI,CAO9D"}
@@ -0,0 +1,14 @@
1
+ import { SpecUserError } from "../../../spec/specUserError.js";
2
+ import { getStringValue } from "../util.js";
3
+ export function assertCanTransformImports(ast) {
4
+ const hasRefExports = ast.body.some(isRefExportDeclaration);
5
+ if (hasRefExports) {
6
+ throw new SpecUserError("Re-exporting refs is not supported. First import the reference and then re-export it if needed.");
7
+ }
8
+ }
9
+ function isRefExportDeclaration(node) {
10
+ return ((node.type === "ExportNamedDeclaration" ||
11
+ node.type === "ExportAllDeclaration") &&
12
+ node.attributes.some((attr) => getStringValue(attr.key) === "type" &&
13
+ getStringValue(attr.value) === "ref"));
14
+ }
@@ -0,0 +1,5 @@
1
+ import type { Plugin, RolldownMagicString } from "rolldown";
2
+ import type { ESTree as t } from "rolldown/utils";
3
+ export declare function transformRefImportsPlugin(): Plugin;
4
+ export declare function transformRefImports_mutate(ast: t.Program, magicString: RolldownMagicString): void;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,gBAAgB,CAAC;AAMlD,wBAAgB,yBAAyB,IAAI,MAAM,CA+BlD;AAED,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,CAAC,CAAC,OAAO,EACd,WAAW,EAAE,mBAAmB,GAC/B,IAAI,CAUN"}
@@ -0,0 +1,40 @@
1
+ import assert from "node:assert/strict";
2
+ import { WASP_SPEC_FILE_REGEX } from "../../common.js";
3
+ import { applyTransformImportsPlan_mutate } from "./apply.js";
4
+ import { assertCanTransformImports } from "./check.js";
5
+ import { planTransformImports } from "./plan.js";
6
+ export function transformRefImportsPlugin() {
7
+ return {
8
+ name: "wasp/spec/transform-ref-imports",
9
+ options(opts) {
10
+ return {
11
+ ...opts,
12
+ experimental: {
13
+ ...opts.experimental,
14
+ // TODO: Remove this once it goes out of experimental phase.
15
+ // https://rolldown.rs/in-depth/native-magic-string
16
+ nativeMagicString: true,
17
+ },
18
+ };
19
+ },
20
+ transform: {
21
+ filter: { id: WASP_SPEC_FILE_REGEX },
22
+ async handler(code, id, meta) {
23
+ assert(meta.magicString);
24
+ // If the AST is already available, use it; otherwise ask the bundler to
25
+ // parse it.
26
+ const ast = meta.ast || this.parse(code, { lang: "ts" });
27
+ transformRefImports_mutate(ast, meta.magicString);
28
+ return { code: meta.magicString };
29
+ },
30
+ },
31
+ };
32
+ }
33
+ export function transformRefImports_mutate(ast, magicString) {
34
+ assertCanTransformImports(ast);
35
+ const importsPlan = planTransformImports(ast);
36
+ if (!importsPlan) {
37
+ return;
38
+ }
39
+ applyTransformImportsPlan_mutate(magicString, importsPlan);
40
+ }
@@ -0,0 +1,26 @@
1
+ import type { ESTree as t } from "rolldown/utils";
2
+ import type { DefaultRefObjectDescriptor, NamedRefObjectDescriptor } from "@wasp.sh/spec";
3
+ export type Plan = {
4
+ refImports: RefImport[];
5
+ safeRefHelperName: string;
6
+ };
7
+ export type RefImportReference = {
8
+ kind: "named";
9
+ refObject: NamedRefObjectDescriptor;
10
+ } | {
11
+ kind: "default";
12
+ refObject: DefaultRefObjectDescriptor;
13
+ } | {
14
+ kind: "namespace";
15
+ from: string;
16
+ alias: string;
17
+ };
18
+ export interface RefImport {
19
+ references: RefImportReference[];
20
+ removeImport: {
21
+ start: number;
22
+ end: number;
23
+ };
24
+ }
25
+ export declare function planTransformImports(ast: t.Program): Plan | null;
26
+ //# sourceMappingURL=plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../../../src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,gBAAgB,CAAC;AASlD,OAAO,KAAK,EACV,0BAA0B,EAC1B,wBAAwB,EACzB,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,IAAI,GAAG;IACjB,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,wBAAwB,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,0BAA0B,CAAA;CAAE,GAC1D;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvD,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,YAAY,EAAE;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,GAAG,IAAI,GAAG,IAAI,CAWhE"}
@@ -0,0 +1,57 @@
1
+ import { SpecUserError } from "../../../spec/specUserError.js";
2
+ import { getStringValue, getTopLevelBindings, makeSafeName, PUBLIC_REF_HELPER_IMPORT_NAME, } from "../util.js";
3
+ export function planTransformImports(ast) {
4
+ const refImports = findRefImports(ast);
5
+ if (refImports.length === 0) {
6
+ return null;
7
+ }
8
+ const scope = getTopLevelBindings(ast);
9
+ const safeRefHelperName = makeSafeName(PUBLIC_REF_HELPER_IMPORT_NAME, scope);
10
+ return { refImports, safeRefHelperName };
11
+ }
12
+ function findRefImports(ast) {
13
+ return ast.body.filter(isRefImportDeclaration).map((node) => {
14
+ const importSource = getStringValue(node.source);
15
+ if (node.specifiers.length === 0) {
16
+ throw new SpecUserError(`Ref import from ${JSON.stringify(importSource)} must import at least one binding.`);
17
+ }
18
+ return {
19
+ references: node.specifiers.map((specifier) => makeRefObject(importSource, specifier)),
20
+ removeImport: { start: node.start, end: node.end },
21
+ };
22
+ });
23
+ }
24
+ function isRefImportDeclaration(node) {
25
+ return (node.type === "ImportDeclaration" &&
26
+ node.attributes.some((attr) => getStringValue(attr.key) === "type" &&
27
+ getStringValue(attr.value) === "ref"));
28
+ }
29
+ function makeRefObject(importSource, specifier) {
30
+ switch (specifier.type) {
31
+ case "ImportSpecifier":
32
+ return {
33
+ kind: "named",
34
+ refObject: {
35
+ import: getStringValue(specifier.imported),
36
+ alias: getStringValue(specifier.local),
37
+ from: importSource,
38
+ },
39
+ };
40
+ case "ImportDefaultSpecifier":
41
+ return {
42
+ kind: "default",
43
+ refObject: {
44
+ importDefault: getStringValue(specifier.local),
45
+ from: importSource,
46
+ },
47
+ };
48
+ case "ImportNamespaceSpecifier":
49
+ return {
50
+ kind: "namespace",
51
+ alias: getStringValue(specifier.local),
52
+ from: importSource,
53
+ };
54
+ default:
55
+ return specifier;
56
+ }
57
+ }
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from "rolldown";
2
+ export declare function transformWaspTsSpecFilesPlugin(): Plugin[];
3
+ //# sourceMappingURL=index.d.ts.map