@plitzi/sdk-shared 0.39.0 → 0.39.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 (508) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/_virtual/_rolldown/runtime.mjs +1 -2
  3. package/dist/actions/access.mjs +1 -2
  4. package/dist/actions/cron.mjs +1 -2
  5. package/dist/actions/failureHandler.mjs +1 -2
  6. package/dist/actions/flowDelay.d.ts +6 -0
  7. package/dist/actions/flowDelay.mjs +3 -0
  8. package/dist/actions/functions.d.ts +6 -3
  9. package/dist/actions/functions.mjs +12 -8
  10. package/dist/actions/index.d.ts +2 -1
  11. package/dist/actions/index.mjs +10 -9
  12. package/dist/actions/jobs.mjs +1 -2
  13. package/dist/actions/smtp.mjs +1 -2
  14. package/dist/actions/triggerParams.mjs +1 -2
  15. package/dist/actions/triggers.mjs +1 -2
  16. package/dist/actions/validateDocument.mjs +133 -123
  17. package/dist/activity/describe.mjs +1 -2
  18. package/dist/activity/guard.mjs +1 -2
  19. package/dist/activity/types.mjs +1 -2
  20. package/dist/auth/failureChannel.mjs +1 -2
  21. package/dist/auth/visitorRoles.mjs +1 -2
  22. package/dist/authoring/builder.mjs +1 -2
  23. package/dist/authoring/declare.mjs +1 -2
  24. package/dist/authoring/elementCallbacks.mjs +1 -2
  25. package/dist/authoring/index.mjs +3 -3
  26. package/dist/authoring/paramSpec.mjs +1 -2
  27. package/dist/authoring/spaceCallbacks.mjs +1 -2
  28. package/dist/builder/contexts/BuilderContext.mjs +1 -2
  29. package/dist/builder/contexts/index.mjs +1 -2
  30. package/dist/conditions/dates.d.ts +2 -0
  31. package/dist/conditions/dates.mjs +12 -0
  32. package/dist/conditions/evaluateRuleGroup.d.ts +13 -0
  33. package/dist/conditions/evaluateRuleGroup.mjs +4 -0
  34. package/dist/conditions/evaluator.d.ts +39 -0
  35. package/dist/conditions/evaluator.mjs +75 -0
  36. package/dist/conditions/index.d.ts +10 -0
  37. package/dist/conditions/index.mjs +5 -0
  38. package/dist/conditions/rules.d.ts +3 -0
  39. package/dist/conditions/rules.mjs +3 -0
  40. package/dist/conditions/types.d.ts +44 -0
  41. package/dist/connectors/constants.mjs +1 -2
  42. package/dist/connectors/manifestTokens.mjs +1 -2
  43. package/dist/connectors/presets.mjs +1 -2
  44. package/dist/connectors/validateManifest.mjs +56 -57
  45. package/dist/dataSource/computed.mjs +16 -17
  46. package/dist/dataSource/getBindingsDetails.d.ts +5 -6
  47. package/dist/dataSource/getBindingsDetails.mjs +65 -40
  48. package/dist/dataSource/globalSources.d.ts +1 -1
  49. package/dist/dataSource/globalSources.mjs +1 -2
  50. package/dist/dataSource/helpers/getSourceName.mjs +1 -2
  51. package/dist/dataSource/index.mjs +5 -5
  52. package/dist/dataSource/utility/arrayMap.mjs +2 -2
  53. package/dist/dataSource/utility/capitalize.mjs +1 -2
  54. package/dist/dataSource/utility/checkboxParams.mjs +1 -2
  55. package/dist/dataSource/utility/dateConverter.mjs +0 -1
  56. package/dist/dataSource/utility/index.mjs +15 -16
  57. package/dist/dataSource/utility/not.mjs +1 -2
  58. package/dist/dataSource/utility/staticValue.mjs +0 -1
  59. package/dist/dataSource/utility/stringToArray.mjs +0 -1
  60. package/dist/dataSource/utility/styleSelector.mjs +1 -2
  61. package/dist/dataSource/utility/styleVariant.mjs +2 -3
  62. package/dist/dataSource/utility/truthiness.mjs +1 -2
  63. package/dist/dataSource/utility/twigTemplate.mjs +0 -1
  64. package/dist/dataSource/variables/resolveVariables.mjs +2 -3
  65. package/dist/dates/formatDate.mjs +29 -30
  66. package/dist/dates/isDate.mjs +1 -2
  67. package/dist/devTools/chrome.mjs +1 -2
  68. package/dist/devTools/debugCookie.mjs +1 -2
  69. package/dist/devTools/index.mjs +5 -5
  70. package/dist/devTools/interactionLog.mjs +1 -2
  71. package/dist/devTools/react/DevToolsContext.mjs +1 -2
  72. package/dist/devTools/sight/sight.mjs +1 -2
  73. package/dist/devTools/utils/PlitziConsole.mjs +1 -2
  74. package/dist/elements/ComponentContext.mjs +1 -2
  75. package/dist/flags/flagsCookie.mjs +5 -6
  76. package/dist/flags/index.d.ts +1 -0
  77. package/dist/flags/index.mjs +4 -3
  78. package/dist/flags/overrides.d.ts +36 -0
  79. package/dist/flags/overrides.mjs +13 -0
  80. package/dist/flags/react/useFlagResolution.mjs +5 -6
  81. package/dist/flags/resolveFlags.d.ts +1 -1
  82. package/dist/flags/resolveFlags.mjs +2 -3
  83. package/dist/flags/schemaFlag.mjs +1 -2
  84. package/dist/functions/contract.d.ts +326 -0
  85. package/dist/functions/contract.mjs +3 -0
  86. package/dist/functions/index.d.ts +15 -0
  87. package/dist/functions/index.mjs +9 -0
  88. package/dist/functions/kv.d.ts +80 -0
  89. package/dist/functions/kvChange.d.ts +67 -0
  90. package/dist/functions/kvChange.mjs +24 -0
  91. package/dist/functions/later.d.ts +18 -0
  92. package/dist/functions/messages.d.ts +4 -0
  93. package/dist/functions/messages.mjs +205 -0
  94. package/dist/functions/protocol.d.ts +416 -0
  95. package/dist/functions/protocol.mjs +37 -0
  96. package/dist/functions/rateLimit.d.ts +17 -0
  97. package/dist/functions/rateLimit.mjs +0 -0
  98. package/dist/functions/refusal.d.ts +26 -0
  99. package/dist/functions/refusal.mjs +11 -0
  100. package/dist/functions/runtime.d.ts +44 -0
  101. package/dist/functions/runtime.mjs +13 -0
  102. package/dist/functions/sizes.d.ts +27 -0
  103. package/dist/functions/sizes.mjs +7 -0
  104. package/dist/functions/wire.d.ts +11 -0
  105. package/dist/functions/wire.mjs +39 -0
  106. package/dist/helpers/canonicalJson.mjs +1 -2
  107. package/dist/helpers/clipboard.mjs +1 -2
  108. package/dist/helpers/cookies.mjs +1 -2
  109. package/dist/helpers/deepEqual/deepEqual.d.ts +5 -0
  110. package/dist/helpers/deepEqual/deepEqual.mjs +44 -0
  111. package/dist/helpers/deepEqual/index.d.ts +1 -0
  112. package/dist/helpers/deepEqual/index.mjs +1 -0
  113. package/dist/helpers/eventTarget.mjs +1 -2
  114. package/dist/helpers/fetchManifest.mjs +1 -2
  115. package/dist/helpers/images.mjs +1 -2
  116. package/dist/helpers/index.d.ts +4 -6
  117. package/dist/helpers/index.mjs +24 -20
  118. package/dist/helpers/interval.mjs +1 -2
  119. package/dist/helpers/isRecord.mjs +1 -2
  120. package/dist/helpers/keys.mjs +1 -2
  121. package/dist/helpers/lodash/camelCase.d.ts +1 -0
  122. package/dist/helpers/lodash/camelCase.mjs +7 -0
  123. package/dist/helpers/lodash/capitalize.d.ts +1 -0
  124. package/dist/helpers/lodash/capitalize.mjs +5 -0
  125. package/dist/helpers/lodash/cloneDeep.d.ts +8 -0
  126. package/dist/helpers/lodash/cloneDeep.mjs +53 -0
  127. package/dist/helpers/lodash/get.d.ts +11 -0
  128. package/dist/helpers/lodash/get.mjs +14 -0
  129. package/dist/helpers/lodash/has.d.ts +2 -0
  130. package/dist/helpers/lodash/has.mjs +12 -0
  131. package/dist/helpers/lodash/index.d.ts +11 -0
  132. package/dist/helpers/lodash/index.mjs +7 -0
  133. package/dist/helpers/lodash/omit.d.ts +4 -0
  134. package/dist/helpers/lodash/omit.mjs +35 -0
  135. package/dist/helpers/lodash/set.d.ts +2 -0
  136. package/dist/helpers/lodash/set.mjs +20 -0
  137. package/dist/helpers/lodash/shared.d.ts +2 -0
  138. package/dist/helpers/lodash/shared.mjs +37 -0
  139. package/dist/helpers/reducerOrigin.mjs +1 -2
  140. package/dist/helpers/replaceEqualDeep/index.d.ts +1 -0
  141. package/dist/helpers/replaceEqualDeep/index.mjs +1 -0
  142. package/dist/helpers/replaceEqualDeep/replaceEqualDeep.d.ts +12 -0
  143. package/dist/helpers/replaceEqualDeep/replaceEqualDeep.mjs +30 -0
  144. package/dist/helpers/resources.d.ts +21 -0
  145. package/dist/helpers/resources.mjs +40 -0
  146. package/dist/helpers/scroll.mjs +1 -2
  147. package/dist/helpers/security.d.ts +15 -0
  148. package/dist/helpers/security.mjs +8 -4
  149. package/dist/helpers/spaceRoot.mjs +1 -2
  150. package/dist/helpers/syntaxHighlight.mjs +1 -2
  151. package/dist/helpers/twigWrapper/Evaluator/Evaluator.mjs +75 -76
  152. package/dist/helpers/twigWrapper/Evaluator/helpers.mjs +1 -2
  153. package/dist/helpers/twigWrapper/Lexer/Lexer.mjs +1 -2
  154. package/dist/helpers/twigWrapper/Lexer/types.mjs +1 -2
  155. package/dist/helpers/twigWrapper/Parser/Cursor.mjs +1 -2
  156. package/dist/helpers/twigWrapper/Parser/ExpressionParser.mjs +1 -2
  157. package/dist/helpers/twigWrapper/Parser/Parser.mjs +1 -2
  158. package/dist/helpers/twigWrapper/Parser/helpers.mjs +1 -2
  159. package/dist/helpers/twigWrapper/TemplateCache/TemplateCache.mjs +1 -2
  160. package/dist/helpers/twigWrapper/charClass.mjs +1 -2
  161. package/dist/helpers/twigWrapper/filters/arrays.mjs +1 -2
  162. package/dist/helpers/twigWrapper/filters/catalog/index.mjs +1 -2
  163. package/dist/helpers/twigWrapper/filters/dateParts.mjs +1 -2
  164. package/dist/helpers/twigWrapper/filters/dates.mjs +13 -14
  165. package/dist/helpers/twigWrapper/filters/filters.mjs +21 -22
  166. package/dist/helpers/twigWrapper/filters/hashing.mjs +1 -2
  167. package/dist/helpers/twigWrapper/filters/misc.mjs +27 -28
  168. package/dist/helpers/twigWrapper/filters/numbers.mjs +1 -2
  169. package/dist/helpers/twigWrapper/filters/objects.mjs +1 -2
  170. package/dist/helpers/twigWrapper/filters/raw.mjs +1 -2
  171. package/dist/helpers/twigWrapper/filters/strings.mjs +23 -24
  172. package/dist/helpers/twigWrapper/filters/types.mjs +1 -2
  173. package/dist/helpers/twigWrapper/filters/values.mjs +1 -2
  174. package/dist/helpers/twigWrapper/index.mjs +8 -8
  175. package/dist/helpers/twigWrapper/inspectTemplate.mjs +12 -13
  176. package/dist/helpers/twigWrapper/processTwig/helpers.mjs +1 -2
  177. package/dist/helpers/twigWrapper/processTwig/processTwig.mjs +1 -2
  178. package/dist/helpers/twigWrapper/processTwig/resolveStepParam.mjs +1 -2
  179. package/dist/helpers/twigWrapper/templateRoots.d.ts +3 -9
  180. package/dist/helpers/twigWrapper/templateRoots.mjs +14 -9
  181. package/dist/helpers/twigWrapper/tokens/hasTemplateSyntax.mjs +1 -2
  182. package/dist/helpers/twigWrapper/tokens/hasValidToken.mjs +1 -2
  183. package/dist/helpers/twigWrapper/tokens/tokenPatterns.mjs +1 -2
  184. package/dist/helpers/utils.mjs +2 -3
  185. package/dist/history/describe.mjs +1 -2
  186. package/dist/history/diff.mjs +1 -2
  187. package/dist/hooks/index.mjs +5 -5
  188. package/dist/hooks/useFontHead.mjs +1 -2
  189. package/dist/hooks/useNetwork.mjs +1 -2
  190. package/dist/hooks/usePlitzi.d.ts +7 -6
  191. package/dist/hooks/usePlitzi.mjs +1 -2
  192. package/dist/hooks/useStableValue.mjs +5 -6
  193. package/dist/navigation/index.mjs +3 -3
  194. package/dist/navigation/matchPath.mjs +19 -11
  195. package/dist/navigation/routes.mjs +57 -38
  196. package/dist/navigation/sitemap.mjs +9 -10
  197. package/dist/network/entitlements.d.ts +21 -0
  198. package/dist/network/entitlements.mjs +1 -2
  199. package/dist/network/graphql/builder/Mutations/Space/SpaceAddElementMutation.mjs +1 -2
  200. package/dist/network/graphql/builder/Mutations/Space/SpaceAddPluginMutation.mjs +1 -2
  201. package/dist/network/graphql/builder/Mutations/Space/SpaceAddSnippetMutation.mjs +1 -2
  202. package/dist/network/graphql/builder/Mutations/Space/SpaceCloneElementMutation.mjs +1 -2
  203. package/dist/network/graphql/builder/Mutations/Space/SpaceDeployMutation.mjs +1 -2
  204. package/dist/network/graphql/builder/Mutations/Space/SpaceFixIssuesMutation.mjs +1 -2
  205. package/dist/network/graphql/builder/Mutations/Space/SpaceMoveElementMutation.mjs +1 -2
  206. package/dist/network/graphql/builder/Mutations/Space/SpacePublishMutation.mjs +1 -2
  207. package/dist/network/graphql/builder/Mutations/Space/SpaceRemoveElementMutation.mjs +1 -2
  208. package/dist/network/graphql/builder/Mutations/Space/SpaceRemovePluginMutation.mjs +1 -2
  209. package/dist/network/graphql/builder/Mutations/Space/SpaceRenameElementMutation.mjs +1 -2
  210. package/dist/network/graphql/builder/Mutations/Space/SpaceRunE2eTestsMutation.mjs +1 -2
  211. package/dist/network/graphql/builder/Mutations/Space/SpaceSetTestsMutation.mjs +1 -2
  212. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementMutation.mjs +1 -2
  213. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementsMutation.mjs +1 -2
  214. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateMutation.mjs +1 -2
  215. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdatePluginMutation.mjs +1 -2
  216. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSchemaMutation.mjs +1 -2
  217. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSettingsMutation.mjs +1 -2
  218. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceAddActionMutation.mjs +1 -2
  219. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRemoveActionMutation.mjs +1 -2
  220. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRunActionMutation.mjs +1 -2
  221. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceUpdateActionMutation.mjs +1 -2
  222. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceAddCdnBucketMutation.mjs +1 -2
  223. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceAddCdnMutation.mjs +1 -2
  224. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceRemoveCdnBucketMutation.mjs +1 -2
  225. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceRemoveCdnMutation.mjs +1 -2
  226. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceSetCdnCredentialMutation.mjs +1 -2
  227. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceUpdateCdnBucketMutation.mjs +1 -2
  228. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceUpdateCdnMutation.mjs +1 -2
  229. package/dist/network/graphql/builder/Mutations/Space/components/SpaceAddComponentMutation.mjs +1 -2
  230. package/dist/network/graphql/builder/Mutations/Space/components/SpaceDetachInstanceMutation.mjs +1 -2
  231. package/dist/network/graphql/builder/Mutations/Space/components/SpaceRemoveComponentMutation.mjs +1 -2
  232. package/dist/network/graphql/builder/Mutations/Space/components/SpaceUpdateComponentMutation.mjs +1 -2
  233. package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceAddConnectorMutation.mjs +1 -2
  234. package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceRemoveConnectorMutation.mjs +1 -2
  235. package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceUpdateConnectorMutation.mjs +1 -2
  236. package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceAddCredentialMutation.mjs +1 -2
  237. package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceRemoveCredentialMutation.mjs +1 -2
  238. package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceUpdateCredentialMutation.mjs +1 -2
  239. package/dist/network/graphql/builder/Mutations/Space/data/SpaceSaveDataMutation.mjs +1 -2
  240. package/dist/network/graphql/builder/Mutations/Space/flags/SpacePublishFlagsMutation.mjs +1 -2
  241. package/dist/network/graphql/builder/Mutations/Space/flags/SpaceRemoveFlagMutation.mjs +1 -2
  242. package/dist/network/graphql/builder/Mutations/Space/flags/SpaceSetFlagMutation.mjs +1 -2
  243. package/dist/network/graphql/builder/Mutations/Space/folders/SpaceAddPageFolderMutation.mjs +1 -2
  244. package/dist/network/graphql/builder/Mutations/Space/folders/SpaceRemovePageFolderMutation.mjs +1 -2
  245. package/dist/network/graphql/builder/Mutations/Space/folders/SpaceUpdatePageFolderMutation.mjs +1 -2
  246. package/dist/network/graphql/builder/Mutations/Space/functions/SpaceInstallTemplateFunctionsMutation.mjs +1 -2
  247. package/dist/network/graphql/builder/Mutations/Space/functions/SpaceRemoveFunctionsMutation.mjs +1 -2
  248. package/dist/network/graphql/builder/Mutations/Space/functions/SpaceSaveFunctionsMutation.mjs +1 -2
  249. package/dist/network/graphql/builder/Mutations/Space/functions/SpaceTryFunctionMutation.mjs +1 -2
  250. package/dist/network/graphql/builder/Mutations/Space/jobs/SpaceControlJobMutation.mjs +1 -2
  251. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceAddPageMutation.mjs +1 -2
  252. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceHomePageMutation.mjs +1 -2
  253. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceRemovePageMutation.mjs +1 -2
  254. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceUpdatePageMutation.mjs +1 -2
  255. package/dist/network/graphql/builder/Mutations/Space/resources/SpaceAddResourceMutation.mjs +1 -2
  256. package/dist/network/graphql/builder/Mutations/Space/resources/SpaceMoveResourceMutation.mjs +1 -2
  257. package/dist/network/graphql/builder/Mutations/Space/resources/SpaceRemoveResourceMutation.mjs +1 -2
  258. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeMutation.mjs +1 -2
  259. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeVariableMutation.mjs +1 -2
  260. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeSizeMutation.mjs +1 -2
  261. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeVariableMutation.mjs +1 -2
  262. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStartRuntimeMutation.mjs +1 -2
  263. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStopRuntimeMutation.mjs +1 -2
  264. package/dist/network/graphql/builder/Mutations/Space/variables/SpaceAddVariableMutation.mjs +1 -2
  265. package/dist/network/graphql/builder/Mutations/Space/variables/SpaceRemoveVariableMutation.mjs +1 -2
  266. package/dist/network/graphql/builder/Mutations/Space/variables/SpaceUpdateVariableMutation.mjs +1 -2
  267. package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceAddVisitorMutation.mjs +1 -2
  268. package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceRemoveVisitorMutation.mjs +1 -2
  269. package/dist/network/graphql/builder/Mutations/Style/StyleUpdateMutation.mjs +1 -2
  270. package/dist/network/graphql/builder/Mutations/Style/StyleUpdateSettingsMutation.mjs +1 -2
  271. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleAddFontMutation.mjs +1 -2
  272. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleRemoveFontMutation.mjs +1 -2
  273. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleUpdateFontMutation.mjs +1 -2
  274. package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleAddSelectorVariableMutation.mjs +1 -2
  275. package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleRemoveSelectorVariableMutation.mjs +1 -2
  276. package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleUpdateSelectorVariableMutation.mjs +1 -2
  277. package/dist/network/graphql/builder/Mutations/Style/selectors/StyleAddSelectorMutation.mjs +1 -2
  278. package/dist/network/graphql/builder/Mutations/Style/selectors/StyleRemoveSelectorMutation.mjs +1 -2
  279. package/dist/network/graphql/builder/Mutations/Style/selectors/StyleRemoveSelectorsMutation.mjs +1 -2
  280. package/dist/network/graphql/builder/Mutations/Style/selectors/StyleUpdateSelectorMutation.mjs +1 -2
  281. package/dist/network/graphql/builder/Mutations/Style/variables/StyleAddVariableMutation.mjs +1 -2
  282. package/dist/network/graphql/builder/Mutations/Style/variables/StyleRemoveVariableMutation.mjs +1 -2
  283. package/dist/network/graphql/builder/Mutations/Style/variables/StyleUpdateVariableMutation.mjs +1 -2
  284. package/dist/network/graphql/builder/Mutations/index.mjs +155 -156
  285. package/dist/network/graphql/builder/Queries/InitQuery.mjs +1 -2
  286. package/dist/network/graphql/builder/Queries/Space/SpaceActionEventsQuery.mjs +1 -2
  287. package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.mjs +1 -2
  288. package/dist/network/graphql/builder/Queries/Space/SpaceActionsQuery.mjs +1 -2
  289. package/dist/network/graphql/builder/Queries/Space/SpaceCdnsQuery.mjs +1 -2
  290. package/dist/network/graphql/builder/Queries/Space/SpaceChangesQuery.mjs +1 -2
  291. package/dist/network/graphql/builder/Queries/Space/SpaceCheckActionQuery.mjs +1 -2
  292. package/dist/network/graphql/builder/Queries/Space/SpaceConnectorsQuery.mjs +1 -2
  293. package/dist/network/graphql/builder/Queries/Space/SpaceCredentialsQuery.mjs +1 -2
  294. package/dist/network/graphql/builder/Queries/Space/SpaceDataQuery.mjs +1 -2
  295. package/dist/network/graphql/builder/Queries/Space/SpaceDeploymentsQuery.mjs +1 -2
  296. package/dist/network/graphql/builder/Queries/Space/SpaceFunctionsQuery.d.ts +1 -1
  297. package/dist/network/graphql/builder/Queries/Space/SpaceFunctionsQuery.mjs +2 -3
  298. package/dist/network/graphql/builder/Queries/Space/SpaceIssuesQuery.mjs +1 -2
  299. package/dist/network/graphql/builder/Queries/Space/SpaceJobsQuery.mjs +1 -2
  300. package/dist/network/graphql/builder/Queries/Space/SpaceLatestRevisionQuery.mjs +1 -2
  301. package/dist/network/graphql/builder/Queries/Space/SpaceQuotaQuery.mjs +1 -2
  302. package/dist/network/graphql/builder/Queries/Space/SpaceResourcesQuery.mjs +1 -2
  303. package/dist/network/graphql/builder/Queries/Space/SpaceRuntimeQuery.d.ts +1 -1
  304. package/dist/network/graphql/builder/Queries/Space/SpaceRuntimeQuery.mjs +2 -3
  305. package/dist/network/graphql/builder/Queries/Space/SpaceTestsQuery.mjs +1 -2
  306. package/dist/network/graphql/builder/Queries/Space/SpaceVersionContentsQuery.mjs +1 -2
  307. package/dist/network/graphql/builder/Queries/Space/SpaceVisitorsQuery.mjs +1 -2
  308. package/dist/network/graphql/builder/Queries/index.mjs +37 -38
  309. package/dist/network/graphql/builder/Subscriptions/SpaceEventSubscription.mjs +1 -2
  310. package/dist/network/graphql/builder/Subscriptions/index.mjs +1 -2
  311. package/dist/network/graphql/builder/fragments/cdnFields.mjs +1 -2
  312. package/dist/network/graphql/index.d.ts +0 -1
  313. package/dist/network/graphql/index.mjs +1 -3
  314. package/dist/network/index.d.ts +1 -5
  315. package/dist/network/index.mjs +7 -11
  316. package/dist/network/{NetworkContext.d.ts → react/NetworkContext.d.ts} +12 -11
  317. package/dist/network/{NetworkContext.mjs → react/NetworkContext.mjs} +1 -2
  318. package/dist/network/{NetworkInternalContext.d.ts → react/NetworkInternalContext.d.ts} +1 -1
  319. package/dist/network/react/NetworkInternalContext.mjs +4 -0
  320. package/dist/network/react/index.d.ts +5 -0
  321. package/dist/network/react/index.mjs +3 -0
  322. package/dist/network/spaceEvents.mjs +16 -17
  323. package/dist/plugins/bundle/bundle.mjs +1 -2
  324. package/dist/plugins/declaration.mjs +1 -2
  325. package/dist/plugins/react/ElementRegistryContext.d.ts +26 -0
  326. package/dist/plugins/react/ElementRegistryContext.mjs +17 -0
  327. package/dist/plugins/react/PluginAssetsContext.d.ts +11 -0
  328. package/dist/plugins/react/PluginAssetsContext.mjs +4 -0
  329. package/dist/plugins/react/PluginsContext.mjs +6 -3
  330. package/dist/plugins/react/index.d.ts +3 -0
  331. package/dist/plugins/react/index.mjs +4 -1
  332. package/dist/project/index.mjs +7 -7
  333. package/dist/project/layout/check.mjs +26 -27
  334. package/dist/project/layout/codes.mjs +1 -2
  335. package/dist/project/layout/contents.mjs +12 -13
  336. package/dist/project/layout/files.mjs +1 -2
  337. package/dist/project/layout/folders.mjs +43 -44
  338. package/dist/project/layout/index.mjs +3 -3
  339. package/dist/project/layout/plugins.mjs +56 -57
  340. package/dist/project/layout/vendor.mjs +14 -15
  341. package/dist/project/network.mjs +1 -2
  342. package/dist/project/pages/index.mjs +1 -2
  343. package/dist/project/paths/index.d.ts +8 -2
  344. package/dist/project/paths/index.mjs +3 -4
  345. package/dist/project/root.mjs +1 -2
  346. package/dist/queries/index.mjs +1 -2
  347. package/dist/queries/queryCache.mjs +1 -2
  348. package/dist/queries/serverQueries.mjs +1 -2
  349. package/dist/queries/useQuery.mjs +1 -2
  350. package/dist/queries/useServerQuery.mjs +1 -2
  351. package/dist/{helpers → react}/enclosingSpace.mjs +1 -2
  352. package/dist/react/generateFacade.d.ts +1 -0
  353. package/dist/{helpers → react}/generateFacade.mjs +4 -5
  354. package/dist/react/index.d.ts +8 -0
  355. package/dist/react/index.mjs +4 -0
  356. package/dist/{helpers → react}/sharedContext.mjs +0 -1
  357. package/dist/realtime/client.mjs +3 -4
  358. package/dist/realtime/index.mjs +4 -4
  359. package/dist/realtime/presence.mjs +1 -2
  360. package/dist/realtime/topics.mjs +1 -2
  361. package/dist/runs/index.mjs +1 -2
  362. package/dist/runs/report.mjs +1 -2
  363. package/dist/schema/anchor.mjs +1 -2
  364. package/dist/schema/index.mjs +18 -18
  365. package/dist/schema/layoutChain.mjs +1 -2
  366. package/dist/schema/markdownHeadings.mjs +1 -2
  367. package/dist/schema/motion.mjs +1 -2
  368. package/dist/schema/motionReveal.mjs +1 -2
  369. package/dist/schema/pageAccess.d.ts +9 -0
  370. package/dist/schema/pageAccess.mjs +42 -36
  371. package/dist/schema/pageElements.d.ts +3 -1
  372. package/dist/schema/pageElements.mjs +9 -3
  373. package/dist/schema/pageHead.d.ts +5 -2
  374. package/dist/schema/pageHead.mjs +3 -4
  375. package/dist/schema/providerAnswer.mjs +1 -2
  376. package/dist/schema/providerWhen.d.ts +1 -1
  377. package/dist/schema/providerWhen.mjs +6 -7
  378. package/dist/schema/react/SchemaContext.mjs +1 -2
  379. package/dist/schema/schemaConstants.mjs +1 -2
  380. package/dist/schema/schemaSettings.d.ts +1 -1
  381. package/dist/schema/schemaSettings.mjs +2 -3
  382. package/dist/schema/serverElements.d.ts +0 -24
  383. package/dist/schema/serverElements.mjs +60 -39
  384. package/dist/schema/serverInput.mjs +23 -24
  385. package/dist/schema/serverQuery.d.ts +15 -5
  386. package/dist/schema/serverQuery.mjs +47 -35
  387. package/dist/schema/snippet.mjs +1 -2
  388. package/dist/schema/wire.mjs +1 -2
  389. package/dist/security/index.d.ts +49 -0
  390. package/dist/security/index.mjs +44 -0
  391. package/dist/server/actions/useActionsSync.mjs +1 -2
  392. package/dist/server/actions/useImagesSync.mjs +1 -2
  393. package/dist/server/actions/useRealtimeSync.mjs +1 -2
  394. package/dist/server/index.mjs +7 -7
  395. package/dist/server/rsc/refreshRsc.mjs +23 -24
  396. package/dist/server/rsc/useRscRefresh.mjs +1 -2
  397. package/dist/server/rsc/useRscSync.mjs +1 -2
  398. package/dist/server/usePluginRoute.mjs +1 -2
  399. package/dist/source/export.d.ts +1 -1
  400. package/dist/source/export.mjs +1 -2
  401. package/dist/source/import.mjs +1 -2
  402. package/dist/source/index.mjs +4 -4
  403. package/dist/source/snapshot.mjs +1 -2
  404. package/dist/state/index.d.ts +0 -1
  405. package/dist/state/index.mjs +1 -3
  406. package/dist/state/paintedState.d.ts +20 -4
  407. package/dist/state/paintedState.mjs +21 -21
  408. package/dist/store/actionRuns/actionRunsRecorder.mjs +1 -2
  409. package/dist/store/actionRuns/actionRunsStore.mjs +1 -2
  410. package/dist/store/actionRuns/index.mjs +3 -3
  411. package/dist/store/actionRuns/useActionRuns.mjs +5 -6
  412. package/dist/store/index.d.ts +1 -0
  413. package/dist/store/index.mjs +2 -1
  414. package/dist/store/renderSettings.d.ts +1 -1
  415. package/dist/store/renderSettings.mjs +1 -2
  416. package/dist/store/runtimeStatePersist.mjs +171 -0
  417. package/dist/store/storeHooks.d.ts +45 -45
  418. package/dist/store/storeHooks.mjs +1 -2
  419. package/dist/store/tracing/index.mjs +5 -5
  420. package/dist/store/tracing/preview.mjs +1 -2
  421. package/dist/store/tracing/tracingCollector.d.ts +2 -2
  422. package/dist/store/tracing/tracingCollector.mjs +79 -78
  423. package/dist/store/tracing/tracingMiddleware.mjs +1 -2
  424. package/dist/store/tracing/tracingStore.mjs +1 -2
  425. package/dist/store/tracing/useTracing.mjs +6 -7
  426. package/dist/style/breakpoints.mjs +1 -2
  427. package/dist/style/cssLayers.mjs +1 -2
  428. package/dist/style/displayModes.mjs +1 -2
  429. package/dist/style/fontAssets.mjs +1 -2
  430. package/dist/style/fontValidation.mjs +14 -15
  431. package/dist/style/fonts.d.ts +5 -3
  432. package/dist/style/fonts.mjs +23 -24
  433. package/dist/style/fontsFromCss.mjs +1 -2
  434. package/dist/style/index.mjs +18 -18
  435. package/dist/style/keyframes.mjs +1 -2
  436. package/dist/style/layoutGrid.mjs +1 -2
  437. package/dist/style/notifications.mjs +1 -2
  438. package/dist/style/react/useDisplayMode.mjs +1 -2
  439. package/dist/style/react/useElementSize.mjs +1 -2
  440. package/dist/style/runtimeStyle.d.ts +19 -21
  441. package/dist/style/runtimeStyle.mjs +4 -7
  442. package/dist/style/snippetStyle.mjs +5 -6
  443. package/dist/style/styleConditions.mjs +1 -2
  444. package/dist/style/styleConstants.mjs +1 -2
  445. package/dist/style/stylePseudos.mjs +1 -2
  446. package/dist/style/styleStates.mjs +1 -2
  447. package/dist/style/styleTarget.mjs +24 -25
  448. package/dist/theme/cookie/index.mjs +1 -1
  449. package/dist/theme/cookie/themeCookie.d.ts +21 -1
  450. package/dist/theme/cookie/themeCookie.mjs +19 -4
  451. package/dist/theme/index.d.ts +1 -9
  452. package/dist/theme/index.mjs +1 -6
  453. package/dist/theme/{ThemeProvider.d.ts → react/ThemeProvider.d.ts} +8 -2
  454. package/dist/theme/react/ThemeProvider.mjs +78 -0
  455. package/dist/theme/{ThemeScope.d.ts → react/ThemeScope.d.ts} +6 -2
  456. package/dist/theme/react/ThemeScope.mjs +9 -0
  457. package/dist/theme/react/index.d.ts +9 -0
  458. package/dist/theme/react/index.mjs +5 -0
  459. package/dist/theme/{themeStore.d.ts → react/themeStore.d.ts} +5 -5
  460. package/dist/theme/{themeStore.mjs → react/themeStore.mjs} +4 -4
  461. package/dist/theme/{useTheme.d.ts → react/useTheme.d.ts} +1 -1
  462. package/dist/theme/react/useTheme.mjs +19 -0
  463. package/dist/types/ActionTypes.d.ts +33 -0
  464. package/dist/types/AuthTypes.d.ts +6 -0
  465. package/dist/types/CommonTypes.d.ts +14 -3
  466. package/dist/types/DataSourceTypes.d.ts +1 -1
  467. package/dist/types/FunctionTypes.d.ts +16 -6
  468. package/dist/types/InteractionTypes.d.ts +1 -1
  469. package/dist/types/JobTypes.d.ts +56 -182
  470. package/dist/types/PluginTypes.d.ts +8 -1
  471. package/dist/types/SchemaTypes.d.ts +8 -1
  472. package/dist/types/SchemaTypes.mjs +1 -2
  473. package/dist/types/ServerAdapterTypes.d.ts +0 -326
  474. package/dist/types/ServerTypes.d.ts +0 -311
  475. package/dist/types/SpaceTypes.d.ts +5 -2
  476. package/dist/types/StoreTypes.d.ts +9 -3
  477. package/dist/types/StyleTypes.d.ts +6 -0
  478. package/dist/types/StyleTypes.mjs +1 -2
  479. package/dist/types/index.d.ts +0 -3
  480. package/dist/websockets/RTCodec.mjs +1 -2
  481. package/eslint.config.mjs +25 -0
  482. package/package.json +29 -18
  483. package/vite.config.ts +58 -0
  484. package/dist/helpers/generateFacade.d.ts +0 -2
  485. package/dist/helpers/ruleEvaluator.d.ts +0 -16
  486. package/dist/helpers/ruleEvaluator.mjs +0 -5
  487. package/dist/network/NetworkInternalContext.mjs +0 -5
  488. package/dist/network/graphql/sdk/Mutations/index.d.ts +0 -3
  489. package/dist/network/graphql/sdk/Mutations/index.mjs +0 -4
  490. package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +0 -16
  491. package/dist/network/graphql/sdk/Queries/InitQuery.mjs +0 -4
  492. package/dist/network/graphql/sdk/Queries/index.d.ts +0 -6
  493. package/dist/network/graphql/sdk/Queries/index.mjs +0 -5
  494. package/dist/network/graphql/sdk/index.d.ts +0 -5
  495. package/dist/network/graphql/sdk/index.mjs +0 -3
  496. package/dist/state/runtimeStatePersist.mjs +0 -119
  497. package/dist/theme/ThemeProvider.mjs +0 -69
  498. package/dist/theme/ThemeScope.mjs +0 -10
  499. package/dist/theme/useTheme.mjs +0 -20
  500. package/dist/types/OAuthTypes.d.ts +0 -246
  501. package/dist/types/ServerConfigTypes.d.ts +0 -527
  502. package/dist/types/ServerLogTypes.d.ts +0 -119
  503. /package/dist/{types/OAuthTypes.mjs → conditions/types.mjs} +0 -0
  504. /package/dist/{types/ServerConfigTypes.mjs → functions/kv.mjs} +0 -0
  505. /package/dist/{types/ServerLogTypes.mjs → functions/later.mjs} +0 -0
  506. /package/dist/{helpers → react}/enclosingSpace.d.ts +0 -0
  507. /package/dist/{helpers → react}/sharedContext.d.ts +0 -0
  508. /package/dist/{state → store}/runtimeStatePersist.d.ts +0 -0
@@ -1,31 +1,30 @@
1
- import { finding as e } from "./codes.mjs";
2
- import { NOT_SOURCE as t, entriesOf as n, filesUnder as r } from "./files.mjs";
3
- import { DATA_DIR as i, PUBLIC_DIR as a, RUNS_DIR as o } from "../paths/index.mjs";
1
+ import { DATA_DIR as e, PUBLIC_DIR as t, RUNS_DIR as n } from "../paths/index.mjs";
2
+ import { finding as r } from "./codes.mjs";
3
+ import { NOT_SOURCE as i, entriesOf as a, filesUnder as o } from "./files.mjs";
4
4
  import s from "node:path";
5
5
  import { readFileSync as c } from "node:fs";
6
- //#region src/project/layout/contents.ts
7
- var l = (e) => e.split("\n").map((e) => e.replace(/^(\s*(?:export\s+)?[A-Za-z_][A-Za-z0-9_]*\s*=).*$/, "$1")).join("\n"), u = (t) => {
8
- let i = n(t).files, a = i.includes(".env"), u = i.includes(".env.example"), d = r(t, "src", /* @__PURE__ */ new Set(["node_modules"])).filter((e) => s.posix.basename(e) === ".env"), f = !a && d.length === 1, p = d.map((t) => e("env-in-src", t, `${t} is never read: Node reads the project's settings from the .env at its root, as its scripts start it (--env-file-if-exists=.env).`, f ? `Move it to the root: mv ${t} .env` : `Copy what it sets into the root's .env, then delete ${t}.`, f ? {
6
+ // src/project/layout/contents.ts
7
+ var l = (e) => e.split("\n").map((e) => e.replace(/^(\s*(?:export\s+)?[A-Za-z_][A-Za-z0-9_]*\s*=).*$/, "$1")).join("\n"), u = (e) => {
8
+ let t = a(e).files, i = t.includes(".env"), u = t.includes(".env.example"), d = o(e, "src", /* @__PURE__ */ new Set(["node_modules"])).filter((e) => s.posix.basename(e) === ".env"), f = !i && d.length === 1, p = d.map((e) => r("env-in-src", e, `${e} is never read: Node reads the project's settings from the .env at its root, as its scripts start it (--env-file-if-exists=.env).`, f ? `Move it to the root: mv ${e} .env` : `Copy what it sets into the root's .env, then delete ${e}.`, f ? {
9
9
  action: "move",
10
- from: t,
10
+ from: e,
11
11
  to: ".env"
12
- } : void 0)), m = `${s.resolve(t).split(s.sep).join("/")}/`.includes(`/${o}/`), h = a || m || p.length > 0 ? [] : [e("env-missing", ".env", ".env is missing at the project’s root: none of its settings is set — the keys and secrets its code reads from process.env.", u ? "Copy .env.example and fill it in: cp .env.example .env" : "Write .env with the settings the project reads (process.env.*), and .env.example naming them.", u ? {
12
+ } : void 0)), m = `${s.resolve(e).split(s.sep).join("/")}/`.includes(`/${n}/`), h = i || m || p.length > 0 ? [] : [r("env-missing", ".env", ".env is missing at the project’s root: none of its settings is set — the keys and secrets its code reads from process.env.", u ? "Copy .env.example and fill it in: cp .env.example .env" : "Write .env with the settings the project reads (process.env.*), and .env.example naming them.", u ? {
13
13
  action: "copy",
14
14
  from: ".env.example",
15
15
  to: ".env"
16
- } : void 0)], g = u ? [] : [e("env-example-missing", ".env.example", ".env.example is missing: committed where .env never is, it names the settings .env holds, with no secret in them — so a clone knows what to fill in.", a ? "Write it from .env with every value left empty, and commit it." : "Write it — each setting the project reads, as KEY= with no value — and commit it.", a ? {
16
+ } : void 0)], g = u ? [] : [r("env-example-missing", ".env.example", ".env.example is missing: committed where .env never is, it names the settings .env holds, with no secret in them — so a clone knows what to fill in.", i ? "Write it from .env with every value left empty, and commit it." : "Write it — each setting the project reads, as KEY= with no value — and commit it.", i ? {
17
17
  action: "write",
18
18
  file: ".env.example",
19
- contents: l(c(s.join(t, ".env"), "utf-8"))
19
+ contents: l(c(s.join(e, ".env"), "utf-8"))
20
20
  } : void 0)];
21
21
  return [
22
22
  ...p,
23
23
  ...h,
24
24
  ...g
25
25
  ];
26
- }, d = (n) => r(n, i).filter((e) => !t.has(s.posix.basename(e)) && !e.endsWith(".json")).map((t) => e("data-not-json", t, `${t} is not JSON: a provider's /data/<file> and ctx.data read JSON files only, and plitzi space push leaves it behind.`, `Keep it as JSON (${t.replace(/\.[^./]*$/, "")}.json), or move it out of ${i}/.`)), f = /^\.env(?:\..*)?$|\.(?:pem|key|p12|pfx|jks|keystore|sqlite3?|db|sql|dump)$|secret|credential|password|passwd|private[-_.]?key|id_rsa|id_ed25519|service[-_]?account/i, p = (t, n) => {
27
- let o = r(t, a, /* @__PURE__ */ new Set(["node_modules"])), c = o.filter((e) => f.test(s.posix.basename(e))).map((t) => e("public-secret-file", t, `${t} is served to anyone who asks, as it is — everything in ${a}/ is on the internet once the project is deployed — and its name says it holds a secret, a key or a database.`, `Take it out of ${a}/: settings go in the root's .env${n === "server" ? `, data only the server reads in ${i}/` : ""}.`)), l = `${a}/data`, u = n === "server" ? o.filter((e) => e.startsWith(`${l}/`) && e.endsWith(".json")) : [], d = u.slice(0, 3).map((e) => s.posix.basename(e)), p = u.length > 0 ? [e("public-data", `${l}/`, `${l}/ holds ${String(u.length)} JSON file${u.length === 1 ? "" : "s"} (${d.join(", ")}${u.length > d.length ? ", …" : ""}), served to anyone who asks: every visitor can read all of ${u.length === 1 ? "it" : "them"}, not only what a page shows.`, `Data only the server should read goes in ${i}/ — a provider reads it on the server (runtime: 'server', query: '/data/<file>'), a function with ctx.data('<file>'), and neither serves the file. What every visitor may read can stay.`)] : [];
26
+ }, d = (t) => o(t, e).filter((e) => !i.has(s.posix.basename(e)) && !e.endsWith(".json")).map((t) => r("data-not-json", t, `${t} is not JSON: a provider's /data/<file> and ctx.data read JSON files only, and plitzi space push leaves it behind.`, `Keep it as JSON (${t.replace(/\.[^./]*$/, "")}.json), or move it out of ${e}/.`)), f = /^\.env(?:\..*)?$|\.(?:pem|key|p12|pfx|jks|keystore|sqlite3?|db|sql|dump)$|secret|credential|password|passwd|private[-_.]?key|id_rsa|id_ed25519|service[-_]?account/i, p = (n, i) => {
27
+ let a = o(n, t, /* @__PURE__ */ new Set(["node_modules"])), c = a.filter((e) => f.test(s.posix.basename(e))).map((n) => r("public-secret-file", n, `${n} is served to anyone who asks, as it is — everything in ${t}/ is on the internet once the project is deployed — and its name says it holds a secret, a key or a database.`, `Take it out of ${t}/: settings go in the root's .env${i === "server" ? `, data only the server reads in ${e}/` : ""}.`)), l = `${t}/data`, u = i === "server" ? a.filter((e) => e.startsWith(`${l}/`) && e.endsWith(".json")) : [], d = u.slice(0, 3).map((e) => s.posix.basename(e)), p = u.length > 0 ? [r("public-data", `${l}/`, `${l}/ holds ${String(u.length)} JSON file${u.length === 1 ? "" : "s"} (${d.join(", ")}${u.length > d.length ? ", …" : ""}), served to anyone who asks: every visitor can read all of ${u.length === 1 ? "it" : "them"}, not only what a page shows.`, `Data only the server should read goes in ${e}/ — a provider reads it on the server (runtime: 'server', query: '/data/<file>'), a function with ctx.data('<file>'), and neither serves the file. What every visitor may read can stay.`)] : [];
28
28
  return [...c, ...p];
29
29
  };
30
- //#endregion
31
30
  export { d as dataFindings, u as envFindings, p as publicFindings };
@@ -1,6 +1,6 @@
1
1
  import e from "node:path";
2
2
  import { readdirSync as t, statSync as n } from "node:fs";
3
- //#region src/project/layout/files.ts
3
+ // src/project/layout/files.ts
4
4
  var r = /* @__PURE__ */ new Set([
5
5
  ".gitkeep",
6
6
  "README.md",
@@ -45,5 +45,4 @@ var r = /* @__PURE__ */ new Set([
45
45
  let n = e.toLowerCase(), r = t.toLowerCase();
46
46
  return n === r || n === `${r}s` || `${n}s` === r || r.length >= 5 && f(n, r) <= 1;
47
47
  }, m = "macOS and Windows disks ignore case, so it is found there — and not on Linux, where the project is deployed.", h = (e, t) => u(e, t) ? `git mv ${e} ${e}-tmp && git mv ${e}-tmp ${t}` : `git mv ${e} ${t}`;
48
- //#endregion
49
48
  export { m as CASE_NOTE, i as JAVASCRIPT_ENTRY, r as NOT_SOURCE, a as TYPE_NAME, d as capitalized, o as entriesOf, s as exists, c as filesUnder, h as gitMove, l as holdsSource, p as nearName, u as sameIgnoringCase };
@@ -1,69 +1,68 @@
1
- import { finding as e } from "./codes.mjs";
2
- import { CASE_NOTE as t, capitalized as n, entriesOf as r, exists as i, gitMove as a, nearName as o, sameIgnoringCase as s } from "./files.mjs";
3
- import { AUTHOR_FILE as c, DATA_DIR as l, FUNCTIONS_DIR as u, PLUGINS_DIR as d, PLUGIN_DECLARATION_FILE as f, PLUGIN_ENTRIES as p, PUBLIC_DIR as m, RUNTIME_DIR as h, SPACE_DIR as g, SPACE_ENTRY as _ } from "../paths/index.mjs";
1
+ import { AUTHOR_FILE as e, DATA_DIR as t, FUNCTIONS_DIR as n, PLUGINS_DIR as r, PLUGIN_DECLARATION_FILE as i, PLUGIN_ENTRIES as a, PUBLIC_DIR as o, RUNTIME_DIR as s, SPACE_DIR as c, SPACE_ENTRY as l } from "../paths/index.mjs";
2
+ import { finding as u } from "./codes.mjs";
3
+ import { CASE_NOTE as d, capitalized as f, entriesOf as p, exists as m, gitMove as h, nearName as g, sameIgnoringCase as _ } from "./files.mjs";
4
4
  import { entryFindings as v } from "./plugins.mjs";
5
5
  import y from "node:path";
6
6
  import { readFileSync as b } from "node:fs";
7
- //#region src/project/layout/folders.ts
8
- var x = (e, t) => t.map((t) => e.find((e) => s(e, t))).find((e) => e !== void 0), S = (e) => (t) => {
9
- for (let n of r(y.join(e, t)).folders) {
10
- let i = x(r(y.join(e, t, n)).files, [...p, f]);
11
- if (i) return `${t}/${n}/${i}`;
7
+ // src/project/layout/folders.ts
8
+ var x = (e, t) => t.map((t) => e.find((e) => _(e, t))).find((e) => e !== void 0), S = (e) => (t) => {
9
+ for (let n of p(y.join(e, t)).folders) {
10
+ let r = x(p(y.join(e, t, n)).files, [...a, i]);
11
+ if (r) return `${t}/${n}/${r}`;
12
12
  }
13
13
  }, C = (e) => (t) => {
14
- let n = x(r(y.join(e, t)).files, ["index.ts"]);
14
+ let n = x(p(y.join(e, t)).files, ["index.ts"]);
15
15
  return n ? `${t}/${n}` : void 0;
16
- }, w = (e, { mode: t, space: n }) => [
16
+ }, w = (i, { mode: a, space: u }) => [
17
17
  {
18
- at: d,
19
- reads: `the server builds plugins from ${d}/ only`,
20
- holds: S(e)
18
+ at: r,
19
+ reads: `the server builds plugins from ${r}/ only`,
20
+ holds: S(i)
21
21
  },
22
22
  {
23
- at: u,
24
- reads: `the project's functions are built from ${u}/ only`,
25
- holds: C(e)
23
+ at: n,
24
+ reads: `the project's functions are built from ${n}/ only`,
25
+ holds: C(i)
26
26
  },
27
27
  {
28
- at: h,
29
- reads: `the space's runtime is run from ${h}/ only`,
30
- holds: C(e)
28
+ at: s,
29
+ reads: `the space's runtime is run from ${s}/ only`,
30
+ holds: C(i)
31
31
  },
32
- ...n === "local" ? [{
33
- at: g,
34
- reads: `the server's entry point and ${c} import the space from ${_}`,
35
- holds: C(e)
32
+ ...u === "local" ? [{
33
+ at: c,
34
+ reads: `the server's entry point and ${e} import the space from ${l}`,
35
+ holds: C(i)
36
36
  }] : [],
37
- ...t === "server" ? [{
38
- at: l,
39
- reads: `the server reads the project's data from ${l}/ only (/data/<file>, ctx.data)`
37
+ ...a === "server" ? [{
38
+ at: t,
39
+ reads: `the server reads the project's data from ${t}/ only (/data/<file>, ctx.data)`
40
40
  }] : [],
41
41
  {
42
- at: m,
43
- reads: `the server serves ${m}/ only, at the site's root`
42
+ at: o,
43
+ reads: `the server serves ${o}/ only, at the site's root`
44
44
  }
45
45
  ], T = (e, t) => {
46
- let n = y.posix.dirname(t), i = y.posix.basename(t), a = n === "." ? "src" : ".", s = r(y.join(e, n)).folders.filter((e) => o(e, i)).map((e) => y.posix.join(n, e)), c = r(y.join(e, a)).folders.filter((e) => e === i || o(e, i)).map((e) => y.posix.join(a, e));
47
- return [...s, ...c];
48
- }, E = (r, o) => w(r, o).flatMap(({ at: o, reads: c, holds: l }) => T(r, o).map((u) => {
49
- let d = l?.(u), f = s(u, o), p = `did you mean ${o}/? ${n(c)}.${f ? ` ${t}` : ""}`, m = `Move it: ${a(u, o)}`;
50
- f ? m = `Rename it: ${a(u, o)}` : i(r, o, "folder") && (m = `Move what it holds into ${o}/, and delete it.`);
51
- let h = {
46
+ let n = y.posix.dirname(t), r = y.posix.basename(t), i = n === "." ? "src" : ".", a = p(y.join(e, n)).folders.filter((e) => g(e, r)).map((e) => y.posix.join(n, e)), o = p(y.join(e, i)).folders.filter((e) => e === r || g(e, r)).map((e) => y.posix.join(i, e));
47
+ return [...a, ...o];
48
+ }, E = (e, t) => w(e, t).flatMap(({ at: t, reads: n, holds: r }) => T(e, t).map((i) => {
49
+ let a = r?.(i), o = _(i, t), s = `did you mean ${t}/? ${f(n)}.${o ? ` ${d}` : ""}`, c = `Move it: ${h(i, t)}`;
50
+ o ? c = `Rename it: ${h(i, t)}` : m(e, t, "folder") && (c = `Move what it holds into ${t}/, and delete it.`);
51
+ let l = {
52
52
  action: "move",
53
- from: `${u}/`,
54
- to: `${o}/`
53
+ from: `${i}/`,
54
+ to: `${t}/`
55
55
  };
56
- return d ? e("folder-misplaced", `${u}/`, `${u}/ holds ${d}, and nothing reads it there — ${p}`, m, h) : e("folder-near-miss", `${u}/`, `${u}/ is read by nothing — ${p}`, m, h);
56
+ return a ? u("folder-misplaced", `${i}/`, `${i}/ holds ${a}, and nothing reads it there — ${s}`, c, l) : u("folder-near-miss", `${i}/`, `${i}/ is read by nothing — ${s}`, c, l);
57
57
  })), D = (t, n) => {
58
- if (!i(t, "src/space/index.ts", "file")) return n.some((e) => e.code === "folder-misplaced" && e.autofix?.action === "move" && e.autofix.to === "src/space/") ? [] : v(t, {
59
- folder: g,
58
+ if (!m(t, "src/space/index.ts", "file")) return n.some((e) => e.code === "folder-misplaced" && e.autofix?.action === "move" && e.autofix.to === "src/space/") ? [] : v(t, {
59
+ folder: c,
60
60
  accepted: ["index.ts"],
61
61
  code: "space-entry-missing",
62
- lost: `the server's entry point and ${c}, which import the space from ${_}, do not start`,
63
- write: `Write ${_} exporting the space — export const space = { name, permanentUrl, pages } — or bring back the one git has: git checkout -- ${_}`
62
+ lost: `the server's entry point and ${e}, which import the space from ${l}, do not start`,
63
+ write: `Write ${l} exporting the space — export const space = { name, permanentUrl, pages } — or bring back the one git has: git checkout -- ${l}`
64
64
  });
65
- let r = b(y.join(t, _), "utf-8"), a = /^\s*export\s+default\b/m.test(r), o = /\bexport\s+(?:const|let|var|function)\s+space\b/.test(r) || /\bexport\s*\{[^}]*\bspace\b[^}]*\}/.test(r);
66
- return a && !o ? [e("space-default-export", _, `${_} exports the space by default, and it is imported by name — import { space } from './space/index.ts' — so the server's entry point and ${c} find no space.`, "Export it as `export const space = …` instead of `export default …`.")] : [];
65
+ let r = b(y.join(t, l), "utf-8"), i = /^\s*export\s+default\b/m.test(r), a = /\bexport\s+(?:const|let|var|function)\s+space\b/.test(r) || /\bexport\s*\{[^}]*\bspace\b[^}]*\}/.test(r);
66
+ return i && !a ? [u("space-default-export", l, `${l} exports the space by default, and it is imported by name — import { space } from './space/index.ts' — so the server's entry point and ${e} find no space.`, "Export it as `export const space = …` instead of `export default …`.")] : [];
67
67
  };
68
- //#endregion
69
68
  export { E as nearMissFindings, D as spaceFindings };
@@ -1,5 +1,5 @@
1
1
  import { PROJECT_LAYOUT_CODES as e } from "./codes.mjs";
2
- import { readVendorPlugin as t } from "./vendor.mjs";
3
- import { checkPluginFolder as n, elementEntry as r, pluginEntry as i, pluginTypeOf as a } from "./plugins.mjs";
2
+ import { checkPluginFolder as t, elementEntry as n, pluginEntry as r, pluginTypeOf as i } from "./plugins.mjs";
3
+ import { readVendorPlugin as a } from "./vendor.mjs";
4
4
  import { ProjectLayoutError as o, assertProjectLayout as s, checkProjectLayout as c, layoutFindingText as l } from "./check.mjs";
5
- export { e as PROJECT_LAYOUT_CODES, o as ProjectLayoutError, s as assertProjectLayout, n as checkPluginFolder, c as checkProjectLayout, r as elementEntry, l as layoutFindingText, i as pluginEntry, a as pluginTypeOf, t as readVendorPlugin };
5
+ export { e as PROJECT_LAYOUT_CODES, o as ProjectLayoutError, s as assertProjectLayout, t as checkPluginFolder, c as checkProjectLayout, n as elementEntry, l as layoutFindingText, r as pluginEntry, i as pluginTypeOf, a as readVendorPlugin };
@@ -1,99 +1,98 @@
1
- import { isFunctionsDefinitionFile as e } from "../../actions/functions.mjs";
2
- import { finding as t } from "./codes.mjs";
3
- import { CASE_NOTE as n, JAVASCRIPT_ENTRY as r, NOT_SOURCE as i, TYPE_NAME as a, capitalized as o, entriesOf as s, exists as c, gitMove as l, holdsSource as u, nearName as d, sameIgnoringCase as f } from "./files.mjs";
4
- import { PLUGINS_DIR as p, PLUGIN_DECLARATION_FILE as m, PLUGIN_ENTRIES as h, PLUGIN_FUNCTIONS_DIR as g, VENDOR_PLUGINS_DIR as _ } from "../paths/index.mjs";
5
- import { readVendorPlugin as v } from "./vendor.mjs";
1
+ import { finding as e } from "./codes.mjs";
2
+ import { CASE_NOTE as t, JAVASCRIPT_ENTRY as n, NOT_SOURCE as r, TYPE_NAME as i, capitalized as a, entriesOf as o, exists as s, gitMove as c, holdsSource as l, nearName as u, sameIgnoringCase as d } from "./files.mjs";
3
+ import { readVendorPlugin as f } from "./vendor.mjs";
4
+ import { isFunctionsDefinitionFile as p } from "../../actions/functions.mjs";
5
+ import { PLUGINS_DIR as m, PLUGIN_DECLARATION_FILE as h, PLUGIN_ENTRIES as g, PLUGIN_FUNCTIONS_DIR as _, VENDOR_PLUGINS_DIR as v } from "../paths/index.mjs";
6
6
  import y from "node:path";
7
- //#region src/project/layout/plugins.ts
7
+ // src/project/layout/plugins.ts
8
8
  var b = (e) => `${e.charAt(0).toLowerCase()}${e.slice(1)}`, x = (e) => {
9
- let t = e.split(/[^A-Za-z0-9]+/).filter(Boolean).map(o).join(""), n = /^\d+/.exec(t)?.[0] ?? "", r = `${o(t.slice(n.length))}${n}`;
10
- return a.test(r) ? r : void 0;
9
+ let t = e.split(/[^A-Za-z0-9]+/).filter(Boolean).map(a).join(""), n = /^\d+/.exec(t)?.[0] ?? "", r = `${a(t.slice(n.length))}${n}`;
10
+ return i.test(r) ? r : void 0;
11
11
  }, S = (e) => {
12
- let { files: t } = s(e), n = h.filter((e) => t.includes(e));
12
+ let { files: t } = o(e), n = g.filter((e) => t.includes(e));
13
13
  return n.length === 1 ? y.join(e, n[0]) : void 0;
14
- }, C = (e, t) => a.test(t) ? S(y.join(e, p, t)) : void 0, w = (e) => e.length > 1 ? `${e[0]} (or ${e.slice(1).join(", ")})` : e[0], T = (e, i) => {
15
- let { folder: a, accepted: o, code: u, lost: p } = i, m = s(y.join(e, a)), h = o.filter((e) => m.files.includes(e));
14
+ }, C = (e, t) => i.test(t) ? S(y.join(e, m, t)) : void 0, w = (e) => e.length > 1 ? `${e[0]} (or ${e.slice(1).join(", ")})` : e[0], T = (r, i) => {
15
+ let { folder: a, accepted: l, code: f, lost: p } = i, m = o(y.join(r, a)), h = l.filter((e) => m.files.includes(e));
16
16
  if (h.length === 1) return [];
17
- if (h.length > 1) return [t("plugin-entry-ambiguous", `${a}/`, `${a}/ has both ${h.join(" and ")}, and a plugin is built from one of them.`, `Keep one — ${h[h.length - 1]} when it writes JSX — and delete the other.`)];
18
- let g = m.files.find((e) => r.test(e));
17
+ if (h.length > 1) return [e("plugin-entry-ambiguous", `${a}/`, `${a}/ has both ${h.join(" and ")}, and a plugin is built from one of them.`, `Keep one — ${h[h.length - 1]} when it writes JSX — and delete the other.`)];
18
+ let g = m.files.find((e) => n.test(e));
19
19
  if (g) {
20
- let e = g.endsWith(".jsx") && o.includes("index.tsx") ? "index.tsx" : "index.ts";
21
- return [t("entry-not-typescript", `${a}/${g}`, `${a}/${g} is JavaScript, and ${a}/ is built from ${w(o)}: the project's code is TypeScript, so ${p}.`, `Rename it ${e} — JavaScript is TypeScript already, types left out: ${l(`${a}/${g}`, `${a}/${e}`)}`, {
20
+ let t = g.endsWith(".jsx") && l.includes("index.tsx") ? "index.tsx" : "index.ts";
21
+ return [e("entry-not-typescript", `${a}/${g}`, `${a}/${g} is JavaScript, and ${a}/ is built from ${w(l)}: the project's code is TypeScript, so ${p}.`, `Rename it ${t} — JavaScript is TypeScript already, types left out: ${c(`${a}/${g}`, `${a}/${t}`)}`, {
22
22
  action: "move",
23
23
  from: `${a}/${g}`,
24
- to: `${a}/${e}`
24
+ to: `${a}/${t}`
25
25
  })];
26
26
  }
27
- let _ = m.files.find((e) => o.some((t) => d(e, t)));
27
+ let _ = m.files.find((e) => l.some((t) => u(e, t)));
28
28
  if (_) {
29
- let e = o.find((e) => d(_, e)) ?? o[0];
30
- return [t(u, `${a}/${_}`, `${a}/ has no ${e} — did you mean ${_}? Named otherwise, ${p}.${f(_, e) ? ` ${n}` : ""}`, `Rename it ${e}: ${l(`${a}/${_}`, `${a}/${e}`)}`, {
29
+ let n = l.find((e) => u(_, e)) ?? l[0];
30
+ return [e(f, `${a}/${_}`, `${a}/ has no ${n} — did you mean ${_}? Named otherwise, ${p}.${d(_, n) ? ` ${t}` : ""}`, `Rename it ${n}: ${c(`${a}/${_}`, `${a}/${n}`)}`, {
31
31
  action: "move",
32
32
  from: `${a}/${_}`,
33
- to: `${a}/${e}`
33
+ to: `${a}/${n}`
34
34
  })];
35
35
  }
36
- let v = m.folders.find((t) => o.some((n) => c(e, `${a}/${t}/${n}`, "file")));
37
- return v ? [t(u, `${a}/${v}/`, `${a}/ has no ${w(o)}, and ${a}/${v}/ has: one folder too deep, so ${p}.`, `Move what ${a}/${v}/ holds up into ${a}/.`, {
36
+ let v = m.folders.find((e) => l.some((t) => s(r, `${a}/${e}/${t}`, "file")));
37
+ return v ? [e(f, `${a}/${v}/`, `${a}/ has no ${w(l)}, and ${a}/${v}/ has: one folder too deep, so ${p}.`, `Move what ${a}/${v}/ holds up into ${a}/.`, {
38
38
  action: "move",
39
39
  from: `${a}/${v}/`,
40
40
  to: `${a}/`
41
- })] : [t(u, `${a}/`, `${a}/ has no ${w(o)}, so ${p}.`, i.write)];
42
- }, E = (n, r) => {
43
- let i = s(y.join(n, r.folder));
44
- if (!u(i) || i.files.some(e)) return [];
45
- let a = i.folders.find((t) => s(y.join(n, r.folder, t)).files.some(e));
46
- return [t(r.code, `${r.folder}/${a === void 0 ? "" : `${a}/`}`, `${r.folder}/ has no file at its top${a === void 0 ? "" : `, and ${r.folder}/${a}/ has: a folder there is helpers`}, so ${r.lost}.`, r.write)];
47
- }, D = (e, t) => u(s(y.join(e, t.folder))) ? T(e, t) : [], O = (e) => {
48
- let n = x(e), r = `${p}/${e}`;
49
- return t("plugin-name-invalid", `${r}/`, `${r}/ cannot be a plugin: a folder of ${p}/ is registered as the element type its name makes, and a type is a letter followed by letters and digits.${n ? ` Did you mean ${n}?` : ""}`, n ? `Rename it ${n} — the type ${b(n)}: ${l(r, `${p}/${n}`)}; then type: '${b(n)}' in its ${m}, and renderType: '${b(n)}' where the space renders it.` : "Rename it with letters and digits, starting with a letter: StatCard is the type statCard.");
50
- }, k = (e, t) => e.find((e) => e === `${t}.tsx`) ?? e.find((e) => e === `${t}.ts`), A = (e, r) => {
51
- let i = `${p}/${r}`, { files: a } = s(y.join(e, i));
41
+ })] : [e(f, `${a}/`, `${a}/ has no ${w(l)}, so ${p}.`, i.write)];
42
+ }, E = (t, n) => {
43
+ let r = o(y.join(t, n.folder));
44
+ if (!l(r) || r.files.some(p)) return [];
45
+ let i = r.folders.find((e) => o(y.join(t, n.folder, e)).files.some(p));
46
+ return [e(n.code, `${n.folder}/${i === void 0 ? "" : `${i}/`}`, `${n.folder}/ has no file at its top${i === void 0 ? "" : `, and ${n.folder}/${i}/ has: a folder there is helpers`}, so ${n.lost}.`, n.write)];
47
+ }, D = (e, t) => l(o(y.join(e, t.folder))) ? T(e, t) : [], O = (t) => {
48
+ let n = x(t), r = `${m}/${t}`;
49
+ return e("plugin-name-invalid", `${r}/`, `${r}/ cannot be a plugin: a folder of ${m}/ is registered as the element type its name makes, and a type is a letter followed by letters and digits.${n ? ` Did you mean ${n}?` : ""}`, n ? `Rename it ${n} — the type ${b(n)}: ${c(r, `${m}/${n}`)}; then type: '${b(n)}' in its ${h}, and renderType: '${b(n)}' where the space renders it.` : "Rename it with letters and digits, starting with a letter: StatCard is the type statCard.");
50
+ }, k = (e, t) => e.find((e) => e === `${t}.tsx`) ?? e.find((e) => e === `${t}.ts`), A = (n, r) => {
51
+ let i = `${m}/${r}`, { files: a } = o(y.join(n, i));
52
52
  if (a.includes("declaration.ts")) return [];
53
- let o = b(r), c = `authoring holds none of the space's ${o} elements to its attributes, and the builder does not offer it`, u = a.find((e) => d(e, m));
54
- return u ? [t("plugin-declaration-missing", `${i}/${u}`, `${i}/ has no ${m} — did you mean ${u}? Named otherwise, ${c}.${f(u, "declaration.ts") ? ` ${n}` : ""}`, `Rename it ${m}: ${l(`${i}/${u}`, `${i}/${m}`)}`, {
53
+ let s = b(r), l = `authoring holds none of the space's ${s} elements to its attributes, and the builder does not offer it`, f = a.find((e) => u(e, h));
54
+ return f ? [e("plugin-declaration-missing", `${i}/${f}`, `${i}/ has no ${h} — did you mean ${f}? Named otherwise, ${l}.${d(f, "declaration.ts") ? ` ${t}` : ""}`, `Rename it ${h}: ${c(`${i}/${f}`, `${i}/${h}`)}`, {
55
55
  action: "move",
56
- from: `${i}/${u}`,
57
- to: `${i}/${m}`
58
- })] : [t("plugin-declaration-missing", `${i}/`, `${i}/ has no ${m}: ${c}.`, `Write ${i}/${m} — export default { type: '${o}', … } — as npx plitzi plugin add writes one beside the component it makes.`)];
56
+ from: `${i}/${f}`,
57
+ to: `${i}/${h}`
58
+ })] : [e("plugin-declaration-missing", `${i}/`, `${i}/ has no ${h}: ${l}.`, `Write ${i}/${h} — export default { type: '${s}', … } — as npx plitzi plugin add writes one beside the component it makes.`)];
59
59
  }, j = (e, t) => {
60
- if (!a.test(t)) return [O(t)];
61
- let n = `${p}/${t}`, r = b(t), i = k(s(y.join(e, n)).files, t);
60
+ if (!i.test(t)) return [O(t)];
61
+ let n = `${m}/${t}`, r = b(t), a = k(o(y.join(e, n)).files, t);
62
62
  return [
63
63
  ...T(e, {
64
64
  folder: n,
65
- accepted: h,
65
+ accepted: g,
66
66
  code: "plugin-entry-missing",
67
67
  lost: `the server cannot build the plugin ${r}`,
68
- write: `Write ${n}/index.ts exporting the component by default${i ? ` — export { default } from './${i}';` : ""} — as npx plitzi plugin add writes it. Every folder of ${p}/ is a plugin: code several plugins share goes outside it (src/shared/).`
68
+ write: `Write ${n}/index.ts exporting the component by default${a ? ` — export { default } from './${a}';` : ""} — as npx plitzi plugin add writes it. Every folder of ${m}/ is a plugin: code several plugins share goes outside it (src/shared/).`
69
69
  }),
70
70
  ...E(e, {
71
- folder: `${n}/${g}`,
71
+ folder: `${n}/${_}`,
72
72
  code: "plugin-functions-entry-missing",
73
73
  lost: `none of the plugin's server half runs (its routes under /fn/plugins/${r}/)`,
74
- write: `Write ${n}/${g}/index.ts exporting defineFunctions({ … }) by default — as npx plitzi plugin add --server writes it.`
74
+ write: `Write ${n}/${_}/index.ts exporting defineFunctions({ … }) by default — as npx plitzi plugin add --server writes it.`
75
75
  }),
76
76
  ...A(e, t)
77
77
  ];
78
- }, M = (e) => {
78
+ }, M = (t) => {
79
79
  let n = /* @__PURE__ */ new Map();
80
- for (let t of e.filter((e) => a.test(e))) n.set(b(t), [...n.get(b(t)) ?? [], t]);
81
- return [...n].flatMap(([e, n]) => n.slice(1).map((r) => t("plugin-type-taken", `${p}/${r}/`, `${p}/${n[0]}/ and ${p}/${r}/ are both the plugin ${e}: the server registers a folder by its name with a small first letter, and keeps one.`, `Put them in one folder, or rename one: git mv ${p}/${r} ${p}/<AnotherName>`)));
82
- }, N = (e) => {
83
- let { files: n, folders: r } = s(y.join(e, p)), o = n.filter((e) => !i.has(e) && e !== "declarations.ts").map((e) => {
84
- let { name: n } = y.parse(e), r = n !== "index" && x(n) || "<Name>";
85
- return t("plugin-file-loose", `${p}/${e}`, `${p}/${e} is a file, and every plugin is a folder of ${p}/: the server reads nothing of it.`, `Give it a folder with an index.ts that exports it by default — ${p}/${r}/${e} and ${p}/${r}/index.ts, as npx plitzi plugin add writes them — or move it out of ${p}/.`);
86
- }), c = s(y.join(e, _)).folders, l = new Set(r.filter((e) => a.test(e)).map(b)), u = c.filter((e) => l.has(e)).map((e) => t("plugin-shadowed", `${_}/${e}/`, `${e} is both ${_}/${e}/, as it was built, and a folder of ${p}/: the server runs the built one, and a change to the source shows nowhere.`, `Delete ${_}/${e}/: the source is the plugin now.`)), d = c.flatMap((t) => {
87
- let n = v(e, t);
80
+ for (let e of t.filter((e) => i.test(e))) n.set(b(e), [...n.get(b(e)) ?? [], e]);
81
+ return [...n].flatMap(([t, n]) => n.slice(1).map((r) => e("plugin-type-taken", `${m}/${r}/`, `${m}/${n[0]}/ and ${m}/${r}/ are both the plugin ${t}: the server registers a folder by its name with a small first letter, and keeps one.`, `Put them in one folder, or rename one: git mv ${m}/${r} ${m}/<AnotherName>`)));
82
+ }, N = (t) => {
83
+ let { files: n, folders: a } = o(y.join(t, m)), s = n.filter((e) => !r.has(e) && e !== "declarations.ts").map((t) => {
84
+ let { name: n } = y.parse(t), r = n !== "index" && x(n) || "<Name>";
85
+ return e("plugin-file-loose", `${m}/${t}`, `${m}/${t} is a file, and every plugin is a folder of ${m}/: the server reads nothing of it.`, `Give it a folder with an index.ts that exports it by default — ${m}/${r}/${t} and ${m}/${r}/index.ts, as npx plitzi plugin add writes them — or move it out of ${m}/.`);
86
+ }), c = o(y.join(t, v)).folders, l = new Set(a.filter((e) => i.test(e)).map(b)), u = c.filter((e) => l.has(e)).map((t) => e("plugin-shadowed", `${v}/${t}/`, `${t} is both ${v}/${t}/, as it was built, and a folder of ${m}/: the server runs the built one, and a change to the source shows nowhere.`, `Delete ${v}/${t}/: the source is the plugin now.`)), d = c.flatMap((e) => {
87
+ let n = f(t, e);
88
88
  return "problem" in n ? [n.problem] : [];
89
89
  });
90
90
  return [
91
- ...r.flatMap((t) => j(e, t)),
92
- ...M(r),
93
- ...o,
91
+ ...a.flatMap((e) => j(t, e)),
92
+ ...M(a),
93
+ ...s,
94
94
  ...u,
95
95
  ...d
96
96
  ];
97
97
  };
98
- //#endregion
99
98
  export { j as checkPluginFolder, S as elementEntry, T as entryFindings, E as functionsFindings, C as pluginEntry, N as pluginFindings, b as pluginTypeOf, D as sourceEntryFindings };
@@ -1,27 +1,27 @@
1
- import { isRecord as e } from "../../helpers/isRecord.mjs";
2
- import { finding as t } from "./codes.mjs";
3
- import { exists as n } from "./files.mjs";
1
+ import { finding as e } from "./codes.mjs";
2
+ import { exists as t } from "./files.mjs";
3
+ import { isRecord as n } from "../../helpers/isRecord.mjs";
4
4
  import { PLUGIN_MANIFEST_FILE as r, VENDOR_PLUGINS_DIR as i } from "../paths/index.mjs";
5
5
  import a from "node:path";
6
6
  import { readFileSync as o } from "node:fs";
7
- //#region src/project/layout/vendor.ts
8
- var s = (t) => e(t.assets) ? Object.values(t.assets).flatMap((t) => e(t) && typeof t.src == "string" && typeof t.type == "string" ? [{
9
- src: t.src,
10
- type: t.type,
11
- isMain: t.isMain === !0
7
+ // src/project/layout/vendor.ts
8
+ var s = (e) => n(e.assets) ? Object.values(e.assets).flatMap((e) => n(e) && typeof e.src == "string" && typeof e.type == "string" ? [{
9
+ src: e.src,
10
+ type: e.type,
11
+ isMain: e.isMain === !0
12
12
  }] : []) : [], c = (c, l) => {
13
13
  let u = `${i}/${l}`, d = `${u}/${r}`, f = `npx plitzi space pull brings it again — or delete ${u}/, and the space renders no ${l}.`;
14
- if (!n(c, d, "file")) return { problem: t("vendor-manifest-missing", `${u}/`, `${u}/ has no ${r}: the server runs a built plugin by what its manifest names, so ${l} does not run.`, f) };
14
+ if (!t(c, d, "file")) return { problem: e("vendor-manifest-missing", `${u}/`, `${u}/ has no ${r}: the server runs a built plugin by what its manifest names, so ${l} does not run.`, f) };
15
15
  let p;
16
16
  try {
17
17
  p = JSON.parse(o(a.join(c, d), "utf-8"));
18
- } catch (e) {
19
- return { problem: t("vendor-manifest-invalid", d, `${d} is not JSON (${e instanceof Error ? e.message : String(e)}), so ${l} does not run.`, f) };
18
+ } catch (t) {
19
+ return { problem: e("vendor-manifest-invalid", d, `${d} is not JSON (${t instanceof Error ? t.message : String(t)}), so ${l} does not run.`, f) };
20
20
  }
21
- if (!e(p)) return { problem: t("vendor-manifest-invalid", d, `${d} is not a manifest, so ${l} does not run.`, f) };
21
+ if (!n(p)) return { problem: e("vendor-manifest-invalid", d, `${d} is not a manifest, so ${l} does not run.`, f) };
22
22
  let m = s(p), h = m.find((e) => e.type === "script" && e.isMain) ?? m.find((e) => e.type === "script");
23
- if (!h) return { problem: t("vendor-script-missing", d, `${d} names no script to run, so ${l} does not run.`, f) };
24
- if (!n(c, a.posix.join(u, h.src), "file")) return { problem: t("vendor-script-missing", d, `${d} names ${h.src} as the script to run, and ${u}/${h.src} is not there, so ${l} does not run.`, f) };
23
+ if (!h) return { problem: e("vendor-script-missing", d, `${d} names no script to run, so ${l} does not run.`, f) };
24
+ if (!t(c, a.posix.join(u, h.src), "file")) return { problem: e("vendor-script-missing", d, `${d} names ${h.src} as the script to run, and ${u}/${h.src} is not there, so ${l} does not run.`, f) };
25
25
  let g = m.find((e) => e.type === "style");
26
26
  return {
27
27
  script: a.join(c, u, h.src),
@@ -30,5 +30,4 @@ var s = (t) => e(t.assets) ? Object.values(t.assets).flatMap((t) => e(t) && type
30
30
  ...typeof p.functions == "string" ? { functions: a.join(c, u, p.functions) } : {}
31
31
  };
32
32
  };
33
- //#endregion
34
33
  export { c as readVendorPlugin };
@@ -1,4 +1,3 @@
1
- //#region src/project/network.ts
1
+ // src/project/network.ts
2
2
  var e = (e) => Object.values(e).flat().flatMap((e) => e && e.family === "IPv4" && !e.internal ? [e.address] : []), t = (e) => `${(e.split(".").at(0) ?? "").toLowerCase()}.local`;
3
- //#endregion
4
3
  export { t as localNetworkName, e as networkAddresses };
@@ -1,6 +1,6 @@
1
1
  import e from "node:path";
2
2
  import { existsSync as t, readdirSync as n } from "node:fs";
3
- //#region src/project/pages/index.ts
3
+ // src/project/pages/index.ts
4
4
  var r = /\.(?:[cm]?[jt]sx?)$/, i = /\.(?:test|spec)\.[cm]?[jt]sx?$|\.d\.[cm]?ts$/, a = [
5
5
  "index.ts",
6
6
  "index.tsx",
@@ -10,5 +10,4 @@ var r = /\.(?:[cm]?[jt]sx?)$/, i = /\.(?:test|spec)\.[cm]?[jt]sx?$|\.d\.[cm]?ts$
10
10
  let s = n.isDirectory() ? a.find((r) => t(e.join(o, n.name, r))) : void 0;
11
11
  return s ? [e.join(o, n.name, s)] : [];
12
12
  }).sort() : [];
13
- //#endregion
14
13
  export { o as pageModulesIn };
@@ -87,8 +87,14 @@ export declare const FUNCTIONS_DIR = "src/functions";
87
87
  export declare const RUNTIME_DIR = "src/runtime";
88
88
  export declare const RUNTIME_ENTRY = "src/runtime/index.ts";
89
89
  /**
90
- * What `npm run build` compiles `src/` into — the server's own code, as JavaScript, for `start:prod` to run with no
91
- * TypeScript in the process. The same tree: `src/runtime/index.ts` is `dist/runtime/index.js`.
90
+ * The project's entry point — the page server, or the Vite app — in `src/`, where an entry point is looked for. The
91
+ * CLI's all the same: `plitzi upgrade` keeps it current, and what a project changes goes in `src/config/serverOptions.ts`.
92
+ */
93
+ export declare const MAIN_FILE = "src/main.ts";
94
+ /**
95
+ * What `npm run build` bundles the server into (`@plitzi/sdk-server/bundle`), for `start:prod` to run with no TypeScript
96
+ * in the process: its entry point and the modules the server imports by their path, named as their sources are —
97
+ * `src/main.ts` is `dist/main.js`, `src/runtime/index.ts` is `dist/runtime/index.js` — and what they share in `chunks/`.
92
98
  */
93
99
  export declare const BUILD_DIR = "dist";
94
100
  /**
@@ -1,4 +1,3 @@
1
- //#region src/project/paths/index.ts
2
- var e = "tmp", t = "tmp/plitzi-runs", n = `${t}/active.json`, r = "src", i = ".plitzi", a = "plitzi", o = `${i}/author.ts`, s = "src/space", c = `${s}/index.ts`, l = "src/plugins", u = ["index.ts", "index.tsx"], d = "declaration.ts", f = "functions", p = "vendor/plugins", m = "plugin-manifest.json", h = "vendor/runtime.bundle", g = "public", _ = "src/data", v = "/data/", y = "src/functions", b = "src/runtime", x = `${b}/index.ts`, S = "dist", C = "state", w = `${C}/kv.json`, T = `${C}/jobs.json`, E = "tmp/later-ask.json", D = "tmp/later-answer.json", O = "tmp/dev-server.json", k = "PLITZI_SERVER_RECORD", A = "PLITZI_STATE_DIR", j = "PLITZI_PREVIEW_FILE", M = "plitzi-preview", N = (e) => `${M}-${String(e + 1)}`;
3
- //#endregion
4
- export { n as ACTIVE_RUN_FILE, o as AUTHOR_FILE, S as BUILD_DIR, i as CLI_DIR, _ as DATA_DIR, O as DEV_SERVER_FILE, y as FUNCTIONS_DIR, T as JOBS_FILE, w as KV_FILE, D as LATER_ANSWER_FILE, E as LATER_ASK_FILE, a as LEGACY_CLI_DIR, l as PLUGINS_DIR, d as PLUGIN_DECLARATION_FILE, u as PLUGIN_ENTRIES, f as PLUGIN_FUNCTIONS_DIR, m as PLUGIN_MANIFEST_FILE, j as PREVIEW_FILE_ENV, M as PREVIEW_SLUG, v as PROJECT_DATA_PREFIX, C as PROJECT_STATE, e as PROJECT_TMP, g as PUBLIC_DIR, t as RUNS_DIR, h as RUNTIME_BUNDLE, b as RUNTIME_DIR, x as RUNTIME_ENTRY, k as SERVER_RECORD_ENV, r as SOURCE_DIR, s as SPACE_DIR, c as SPACE_ENTRY, A as STATE_DIR_ENV, p as VENDOR_PLUGINS_DIR, N as previewCopyId };
1
+ // src/project/paths/index.ts
2
+ var e = "tmp", t = "tmp/plitzi-runs", n = `${t}/active.json`, r = "src", i = ".plitzi", a = "plitzi", o = `${i}/author.ts`, s = "src/space", c = `${s}/index.ts`, l = "src/plugins", u = ["index.ts", "index.tsx"], d = "declaration.ts", f = "functions", p = "vendor/plugins", m = "plugin-manifest.json", h = "vendor/runtime.bundle", g = "public", _ = "src/data", v = "/data/", y = "src/functions", b = "src/runtime", x = `${b}/index.ts`, S = "src/main.ts", C = "dist", w = "state", T = `${w}/kv.json`, E = `${w}/jobs.json`, D = "tmp/later-ask.json", O = "tmp/later-answer.json", k = "tmp/dev-server.json", A = "PLITZI_SERVER_RECORD", j = "PLITZI_STATE_DIR", M = "PLITZI_PREVIEW_FILE", N = "plitzi-preview", P = (e) => `${N}-${String(e + 1)}`;
3
+ export { n as ACTIVE_RUN_FILE, o as AUTHOR_FILE, C as BUILD_DIR, i as CLI_DIR, _ as DATA_DIR, k as DEV_SERVER_FILE, y as FUNCTIONS_DIR, E as JOBS_FILE, T as KV_FILE, O as LATER_ANSWER_FILE, D as LATER_ASK_FILE, a as LEGACY_CLI_DIR, S as MAIN_FILE, l as PLUGINS_DIR, d as PLUGIN_DECLARATION_FILE, u as PLUGIN_ENTRIES, f as PLUGIN_FUNCTIONS_DIR, m as PLUGIN_MANIFEST_FILE, M as PREVIEW_FILE_ENV, N as PREVIEW_SLUG, v as PROJECT_DATA_PREFIX, w as PROJECT_STATE, e as PROJECT_TMP, g as PUBLIC_DIR, t as RUNS_DIR, h as RUNTIME_BUNDLE, b as RUNTIME_DIR, x as RUNTIME_ENTRY, A as SERVER_RECORD_ENV, r as SOURCE_DIR, s as SPACE_DIR, c as SPACE_ENTRY, j as STATE_DIR_ENV, p as VENDOR_PLUGINS_DIR, P as previewCopyId };
@@ -2,7 +2,7 @@ import { BUILD_DIR as e } from "./paths/index.mjs";
2
2
  import t from "node:path";
3
3
  import { existsSync as n, realpathSync as r } from "node:fs";
4
4
  import { createHash as i } from "node:crypto";
5
- //#region src/project/root.ts
5
+ // src/project/root.ts
6
6
  var a = ["package.json", "src/"], o = class extends Error {
7
7
  constructor(e, t) {
8
8
  super(`${e} is not the root of a Plitzi project: it has no ${t.join(" and no ")}. Run it from the project's root, the folder its package.json is in — where its scripts run it (npm start, npm run author).`), this.name = "ProjectRootError";
@@ -23,5 +23,4 @@ var s = (e) => {
23
23
  let a = l(t.join(n, e)), o = i !== void 0 && l(i).startsWith(`${a}${t.sep}`);
24
24
  return t.join(n, o ? t.join(e, t.relative("src", r)).replace(/\.tsx?$/, ".js") : r);
25
25
  }, d = (e) => i("sha256").update(l(e)).digest("hex").slice(0, 12);
26
- //#endregion
27
26
  export { o as ProjectRootError, s as checkProjectRoot, d as projectMark, u as projectModule, c as projectRoot };
@@ -2,7 +2,7 @@ import e, { GC_TIME as t, QueryCache as n, queryId as r, queryPath as i } from "
2
2
  import { refreshServerQueries as a, registerServerQuery as o } from "./serverQueries.mjs";
3
3
  import s from "./useQuery.mjs";
4
4
  import c from "./useServerQuery.mjs";
5
- //#region src/queries/index.ts
5
+ // src/queries/index.ts
6
6
  var l = () => typeof location > "u" ? void 0 : location.href, u = (e) => {
7
7
  try {
8
8
  return new URL(e, l()).origin;
@@ -43,5 +43,4 @@ var l = () => typeof location > "u" ? void 0 : location.href, u = (e) => {
43
43
  }
44
44
  return i === "origin" && r ? f(r) : g();
45
45
  };
46
- //#endregion
47
46
  export { t as GC_TIME, n as QueryCache, v as invalidateAfterWrite, g as invalidateQueries, f as invalidateQueriesForWrite, h as matchesQuery, p as parseIds, e as queryCache, r as queryId, i as queryPath, o as registerServerQuery, _ as requestKey, s as useQuery, c as useServerQuery };
@@ -1,5 +1,5 @@
1
1
  import { createStore as e } from "@plitzi/nexus";
2
- //#region src/queries/queryCache.ts
2
+ // src/queries/queryCache.ts
3
3
  var t = 3e5, n = (e) => {
4
4
  let t = 3735928559, n = 1103547991;
5
5
  for (let r = 0; r < e.length; r++) {
@@ -186,5 +186,4 @@ var t = 3e5, n = (e) => {
186
186
  this.runtimes.get(t) === e && e.holds === 0 && e.observers.size === 0 && (this.runtimes.delete(t), e.controller?.abort(), this.store.setState(r(e.key), void 0, { unmount: !0 }));
187
187
  }
188
188
  }, a = new i();
189
- //#endregion
190
189
  export { t as GC_TIME, i as QueryCache, a as default, n as queryId, r as queryPath };
@@ -1,9 +1,8 @@
1
- //#region src/queries/serverQueries.ts
1
+ // src/queries/serverQueries.ts
2
2
  var e = /* @__PURE__ */ new Set(), t = (t) => {
3
3
  let n = { ...t };
4
4
  return e.add(n), () => {
5
5
  e.delete(n);
6
6
  };
7
7
  }, n = (t) => Promise.allSettled([...e].filter((e) => !t || t(e)).map((e) => e.refresh())).then(() => void 0);
8
- //#endregion
9
8
  export { n as refreshServerQueries, t as registerServerQuery };
@@ -1,7 +1,7 @@
1
1
  import e, { GC_TIME as t, queryPath as n } from "./queryCache.mjs";
2
2
  import { useCallback as r, useEffect as i, useRef as a } from "react";
3
3
  import { createStoreHook as o } from "@plitzi/nexus/react";
4
- //#region src/queries/useQuery.ts
4
+ // src/queries/useQuery.ts
5
5
  var { useStore: s } = o(), c = ({ key: o, meta: c, fetcher: l, enabled: u = !0, staleTime: d, gcTime: f = t, isCacheable: p }) => {
6
6
  let m = o !== void 0, [h] = s(n(o ?? ""), {
7
7
  store: e.store,
@@ -46,5 +46,4 @@ var { useStore: s } = o(), c = ({ key: o, meta: c, fetcher: l, enabled: u = !0,
46
46
  cancel: D
47
47
  };
48
48
  };
49
- //#endregion
50
49
  export { c as default };
@@ -1,6 +1,6 @@
1
1
  import { registerServerQuery as e } from "./serverQueries.mjs";
2
2
  import { useEffect as t, useRef as n } from "react";
3
- //#region src/queries/useServerQuery.ts
3
+ // src/queries/useServerQuery.ts
4
4
  var r = ({ id: r, url: i, enabled: a, active: o, refresh: s }) => {
5
5
  let c = n(!1);
6
6
  t(() => {
@@ -17,5 +17,4 @@ var r = ({ id: r, url: i, enabled: a, active: o, refresh: s }) => {
17
17
  s
18
18
  ]);
19
19
  };
20
- //#endregion
21
20
  export { r as default };
@@ -1,5 +1,4 @@
1
1
  import { sharedContext as e } from "./sharedContext.mjs";
2
- //#region src/helpers/enclosingSpace.ts
2
+ // src/react/enclosingSpace.ts
3
3
  var t = e("EnclosingSpaceContext", !1);
4
- //#endregion
5
4
  export { t as EnclosingSpaceContext };
@@ -0,0 +1 @@
1
+ export declare const generateFacade: (modules: Record<string, unknown>, windowKey?: string) => void;
@@ -1,6 +1,6 @@
1
- import { isRecord as e } from "./isRecord.mjs";
2
- import { omit as t } from "@plitzi/plitzi-ui/helpers/lodash";
3
- //#region src/helpers/generateFacade.tsx
1
+ import { isRecord as e } from "../helpers/isRecord.mjs";
2
+ import { omit as t } from "../helpers/lodash/omit.mjs";
3
+ // src/react/generateFacade.tsx
4
4
  var n = (e) => e.replace(/^@/, "").replace(/[-/]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()).replace(/\s+/g, ""), r = (t, n) => {
5
5
  let r = Reflect.get(window, t), i = e(r) ? r[n] : void 0;
6
6
  return e(i) ? i : {};
@@ -35,5 +35,4 @@ var n = (e) => e.replace(/^@/, "").replace(/[-/]/g, " ").replace(/\b\w/g, (e) =>
35
35
  let l = document.createElement("script");
36
36
  l.type = "importmap", l.textContent = c, document.head.appendChild(l);
37
37
  };
38
- //#endregion
39
- export { c as default };
38
+ export { c as generateFacade };