@plitzi/sdk-shared 0.39.1 → 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.
- package/CHANGELOG.md +7 -0
- package/dist/_virtual/_rolldown/runtime.mjs +1 -2
- package/dist/actions/access.mjs +1 -2
- package/dist/actions/cron.mjs +1 -2
- package/dist/actions/failureHandler.mjs +1 -2
- package/dist/actions/flowDelay.d.ts +6 -0
- package/dist/actions/flowDelay.mjs +3 -0
- package/dist/actions/functions.d.ts +6 -3
- package/dist/actions/functions.mjs +12 -8
- package/dist/actions/index.d.ts +2 -1
- package/dist/actions/index.mjs +10 -9
- package/dist/actions/jobs.mjs +1 -2
- package/dist/actions/smtp.mjs +1 -2
- package/dist/actions/triggerParams.mjs +1 -2
- package/dist/actions/triggers.mjs +1 -2
- package/dist/actions/validateDocument.mjs +133 -123
- package/dist/activity/describe.mjs +1 -2
- package/dist/activity/guard.mjs +1 -2
- package/dist/activity/types.mjs +1 -2
- package/dist/auth/failureChannel.mjs +1 -2
- package/dist/auth/visitorRoles.mjs +1 -2
- package/dist/authoring/builder.mjs +1 -2
- package/dist/authoring/declare.mjs +1 -2
- package/dist/authoring/elementCallbacks.mjs +1 -2
- package/dist/authoring/index.mjs +3 -3
- package/dist/authoring/paramSpec.mjs +1 -2
- package/dist/authoring/spaceCallbacks.mjs +1 -2
- package/dist/builder/contexts/BuilderContext.mjs +1 -2
- package/dist/builder/contexts/index.mjs +1 -2
- package/dist/conditions/dates.d.ts +2 -0
- package/dist/conditions/dates.mjs +12 -0
- package/dist/conditions/evaluateRuleGroup.d.ts +13 -0
- package/dist/conditions/evaluateRuleGroup.mjs +4 -0
- package/dist/conditions/evaluator.d.ts +39 -0
- package/dist/conditions/evaluator.mjs +75 -0
- package/dist/conditions/index.d.ts +10 -0
- package/dist/conditions/index.mjs +5 -0
- package/dist/conditions/rules.d.ts +3 -0
- package/dist/conditions/rules.mjs +3 -0
- package/dist/conditions/types.d.ts +44 -0
- package/dist/connectors/constants.mjs +1 -2
- package/dist/connectors/manifestTokens.mjs +1 -2
- package/dist/connectors/presets.mjs +1 -2
- package/dist/connectors/validateManifest.mjs +56 -57
- package/dist/dataSource/computed.mjs +16 -17
- package/dist/dataSource/getBindingsDetails.d.ts +5 -6
- package/dist/dataSource/getBindingsDetails.mjs +65 -40
- package/dist/dataSource/globalSources.d.ts +1 -1
- package/dist/dataSource/globalSources.mjs +1 -2
- package/dist/dataSource/helpers/getSourceName.mjs +1 -2
- package/dist/dataSource/index.mjs +5 -5
- package/dist/dataSource/utility/arrayMap.mjs +2 -2
- package/dist/dataSource/utility/capitalize.mjs +1 -2
- package/dist/dataSource/utility/checkboxParams.mjs +1 -2
- package/dist/dataSource/utility/dateConverter.mjs +0 -1
- package/dist/dataSource/utility/index.mjs +15 -16
- package/dist/dataSource/utility/not.mjs +1 -2
- package/dist/dataSource/utility/staticValue.mjs +0 -1
- package/dist/dataSource/utility/stringToArray.mjs +0 -1
- package/dist/dataSource/utility/styleSelector.mjs +1 -2
- package/dist/dataSource/utility/styleVariant.mjs +2 -3
- package/dist/dataSource/utility/truthiness.mjs +1 -2
- package/dist/dataSource/utility/twigTemplate.mjs +0 -1
- package/dist/dataSource/variables/resolveVariables.mjs +2 -3
- package/dist/dates/formatDate.mjs +29 -30
- package/dist/dates/isDate.mjs +1 -2
- package/dist/devTools/chrome.mjs +1 -2
- package/dist/devTools/debugCookie.mjs +1 -2
- package/dist/devTools/index.mjs +5 -5
- package/dist/devTools/interactionLog.mjs +1 -2
- package/dist/devTools/react/DevToolsContext.mjs +1 -2
- package/dist/devTools/sight/sight.mjs +1 -2
- package/dist/devTools/utils/PlitziConsole.mjs +1 -2
- package/dist/elements/ComponentContext.mjs +1 -2
- package/dist/flags/flagsCookie.mjs +5 -6
- package/dist/flags/index.d.ts +1 -0
- package/dist/flags/index.mjs +4 -3
- package/dist/flags/overrides.d.ts +36 -0
- package/dist/flags/overrides.mjs +13 -0
- package/dist/flags/react/useFlagResolution.mjs +5 -6
- package/dist/flags/resolveFlags.d.ts +1 -1
- package/dist/flags/resolveFlags.mjs +2 -3
- package/dist/flags/schemaFlag.mjs +1 -2
- package/dist/functions/contract.d.ts +326 -0
- package/dist/functions/contract.mjs +3 -0
- package/dist/functions/index.d.ts +15 -0
- package/dist/functions/index.mjs +9 -0
- package/dist/functions/kv.d.ts +80 -0
- package/dist/functions/kvChange.d.ts +67 -0
- package/dist/functions/kvChange.mjs +24 -0
- package/dist/functions/later.d.ts +18 -0
- package/dist/functions/messages.d.ts +4 -0
- package/dist/functions/messages.mjs +205 -0
- package/dist/functions/protocol.d.ts +416 -0
- package/dist/functions/protocol.mjs +37 -0
- package/dist/functions/rateLimit.d.ts +17 -0
- package/dist/functions/rateLimit.mjs +0 -0
- package/dist/functions/refusal.d.ts +26 -0
- package/dist/functions/refusal.mjs +11 -0
- package/dist/functions/runtime.d.ts +44 -0
- package/dist/functions/runtime.mjs +13 -0
- package/dist/functions/sizes.d.ts +27 -0
- package/dist/functions/sizes.mjs +7 -0
- package/dist/functions/wire.d.ts +11 -0
- package/dist/functions/wire.mjs +39 -0
- package/dist/helpers/canonicalJson.mjs +1 -2
- package/dist/helpers/clipboard.mjs +1 -2
- package/dist/helpers/cookies.mjs +1 -2
- package/dist/helpers/deepEqual/deepEqual.d.ts +5 -0
- package/dist/helpers/deepEqual/deepEqual.mjs +44 -0
- package/dist/helpers/deepEqual/index.d.ts +1 -0
- package/dist/helpers/deepEqual/index.mjs +1 -0
- package/dist/helpers/eventTarget.mjs +1 -2
- package/dist/helpers/fetchManifest.mjs +1 -2
- package/dist/helpers/images.mjs +1 -2
- package/dist/helpers/index.d.ts +4 -6
- package/dist/helpers/index.mjs +24 -20
- package/dist/helpers/interval.mjs +1 -2
- package/dist/helpers/isRecord.mjs +1 -2
- package/dist/helpers/keys.mjs +1 -2
- package/dist/helpers/lodash/camelCase.d.ts +1 -0
- package/dist/helpers/lodash/camelCase.mjs +7 -0
- package/dist/helpers/lodash/capitalize.d.ts +1 -0
- package/dist/helpers/lodash/capitalize.mjs +5 -0
- package/dist/helpers/lodash/cloneDeep.d.ts +8 -0
- package/dist/helpers/lodash/cloneDeep.mjs +53 -0
- package/dist/helpers/lodash/get.d.ts +11 -0
- package/dist/helpers/lodash/get.mjs +14 -0
- package/dist/helpers/lodash/has.d.ts +2 -0
- package/dist/helpers/lodash/has.mjs +12 -0
- package/dist/helpers/lodash/index.d.ts +11 -0
- package/dist/helpers/lodash/index.mjs +7 -0
- package/dist/helpers/lodash/omit.d.ts +4 -0
- package/dist/helpers/lodash/omit.mjs +35 -0
- package/dist/helpers/lodash/set.d.ts +2 -0
- package/dist/helpers/lodash/set.mjs +20 -0
- package/dist/helpers/lodash/shared.d.ts +2 -0
- package/dist/helpers/lodash/shared.mjs +37 -0
- package/dist/helpers/reducerOrigin.mjs +1 -2
- package/dist/helpers/replaceEqualDeep/index.d.ts +1 -0
- package/dist/helpers/replaceEqualDeep/index.mjs +1 -0
- package/dist/helpers/replaceEqualDeep/replaceEqualDeep.d.ts +12 -0
- package/dist/helpers/replaceEqualDeep/replaceEqualDeep.mjs +30 -0
- package/dist/helpers/resources.d.ts +21 -0
- package/dist/helpers/resources.mjs +40 -0
- package/dist/helpers/scroll.mjs +1 -2
- package/dist/helpers/security.d.ts +15 -0
- package/dist/helpers/security.mjs +8 -4
- package/dist/helpers/spaceRoot.mjs +1 -2
- package/dist/helpers/syntaxHighlight.mjs +1 -2
- package/dist/helpers/twigWrapper/Evaluator/Evaluator.mjs +75 -76
- package/dist/helpers/twigWrapper/Evaluator/helpers.mjs +1 -2
- package/dist/helpers/twigWrapper/Lexer/Lexer.mjs +1 -2
- package/dist/helpers/twigWrapper/Lexer/types.mjs +1 -2
- package/dist/helpers/twigWrapper/Parser/Cursor.mjs +1 -2
- package/dist/helpers/twigWrapper/Parser/ExpressionParser.mjs +1 -2
- package/dist/helpers/twigWrapper/Parser/Parser.mjs +1 -2
- package/dist/helpers/twigWrapper/Parser/helpers.mjs +1 -2
- package/dist/helpers/twigWrapper/TemplateCache/TemplateCache.mjs +1 -2
- package/dist/helpers/twigWrapper/charClass.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/arrays.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/catalog/index.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/dateParts.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/dates.mjs +13 -14
- package/dist/helpers/twigWrapper/filters/filters.mjs +21 -22
- package/dist/helpers/twigWrapper/filters/hashing.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/misc.mjs +27 -28
- package/dist/helpers/twigWrapper/filters/numbers.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/objects.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/raw.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/strings.mjs +23 -24
- package/dist/helpers/twigWrapper/filters/types.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/values.mjs +1 -2
- package/dist/helpers/twigWrapper/index.mjs +8 -8
- package/dist/helpers/twigWrapper/inspectTemplate.mjs +12 -13
- package/dist/helpers/twigWrapper/processTwig/helpers.mjs +1 -2
- package/dist/helpers/twigWrapper/processTwig/processTwig.mjs +1 -2
- package/dist/helpers/twigWrapper/processTwig/resolveStepParam.mjs +1 -2
- package/dist/helpers/twigWrapper/templateRoots.d.ts +3 -9
- package/dist/helpers/twigWrapper/templateRoots.mjs +14 -9
- package/dist/helpers/twigWrapper/tokens/hasTemplateSyntax.mjs +1 -2
- package/dist/helpers/twigWrapper/tokens/hasValidToken.mjs +1 -2
- package/dist/helpers/twigWrapper/tokens/tokenPatterns.mjs +1 -2
- package/dist/helpers/utils.mjs +2 -3
- package/dist/history/describe.mjs +1 -2
- package/dist/history/diff.mjs +1 -2
- package/dist/hooks/index.mjs +5 -5
- package/dist/hooks/useFontHead.mjs +1 -2
- package/dist/hooks/useNetwork.mjs +1 -2
- package/dist/hooks/usePlitzi.d.ts +7 -6
- package/dist/hooks/usePlitzi.mjs +1 -2
- package/dist/hooks/useStableValue.mjs +5 -6
- package/dist/navigation/index.mjs +3 -3
- package/dist/navigation/matchPath.mjs +19 -11
- package/dist/navigation/routes.mjs +57 -38
- package/dist/navigation/sitemap.mjs +9 -10
- package/dist/network/entitlements.d.ts +21 -0
- package/dist/network/entitlements.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddElementMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddPluginMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddSnippetMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceCloneElementMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceDeployMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceFixIssuesMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceMoveElementMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpacePublishMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceRemoveElementMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceRemovePluginMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceRenameElementMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceRunE2eTestsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceSetTestsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdatePluginMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSchemaMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSettingsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceAddActionMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRemoveActionMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRunActionMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceUpdateActionMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceAddCdnBucketMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceAddCdnMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceRemoveCdnBucketMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceRemoveCdnMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceSetCdnCredentialMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceUpdateCdnBucketMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceUpdateCdnMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/components/SpaceAddComponentMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/components/SpaceDetachInstanceMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/components/SpaceRemoveComponentMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/components/SpaceUpdateComponentMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceAddConnectorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceRemoveConnectorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceUpdateConnectorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceAddCredentialMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceRemoveCredentialMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceUpdateCredentialMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/data/SpaceSaveDataMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/flags/SpacePublishFlagsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/flags/SpaceRemoveFlagMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/flags/SpaceSetFlagMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/folders/SpaceAddPageFolderMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/folders/SpaceRemovePageFolderMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/folders/SpaceUpdatePageFolderMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceInstallTemplateFunctionsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceRemoveFunctionsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceSaveFunctionsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceTryFunctionMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/jobs/SpaceControlJobMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceAddPageMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceHomePageMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceRemovePageMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceUpdatePageMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/resources/SpaceAddResourceMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/resources/SpaceMoveResourceMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/resources/SpaceRemoveResourceMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeSizeMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStartRuntimeMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStopRuntimeMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/variables/SpaceAddVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/variables/SpaceRemoveVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/variables/SpaceUpdateVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceAddVisitorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceRemoveVisitorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/StyleUpdateMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/StyleUpdateSettingsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleAddFontMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleRemoveFontMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleUpdateFontMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleAddSelectorVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleRemoveSelectorVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleUpdateSelectorVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleAddSelectorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleRemoveSelectorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleRemoveSelectorsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleUpdateSelectorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/variables/StyleAddVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/variables/StyleRemoveVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/variables/StyleUpdateVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/index.mjs +155 -156
- package/dist/network/graphql/builder/Queries/InitQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceActionEventsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceActionsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceCdnsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceChangesQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceCheckActionQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceConnectorsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceCredentialsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceDataQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceDeploymentsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceFunctionsQuery.d.ts +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceFunctionsQuery.mjs +2 -3
- package/dist/network/graphql/builder/Queries/Space/SpaceIssuesQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceJobsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceLatestRevisionQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceQuotaQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceResourcesQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceRuntimeQuery.d.ts +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceRuntimeQuery.mjs +2 -3
- package/dist/network/graphql/builder/Queries/Space/SpaceTestsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceVersionContentsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceVisitorsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/index.mjs +37 -38
- package/dist/network/graphql/builder/Subscriptions/SpaceEventSubscription.mjs +1 -2
- package/dist/network/graphql/builder/Subscriptions/index.mjs +1 -2
- package/dist/network/graphql/builder/fragments/cdnFields.mjs +1 -2
- package/dist/network/graphql/index.d.ts +0 -1
- package/dist/network/graphql/index.mjs +1 -3
- package/dist/network/index.d.ts +1 -5
- package/dist/network/index.mjs +7 -11
- package/dist/network/{NetworkContext.d.ts → react/NetworkContext.d.ts} +12 -11
- package/dist/network/{NetworkContext.mjs → react/NetworkContext.mjs} +1 -2
- package/dist/network/{NetworkInternalContext.d.ts → react/NetworkInternalContext.d.ts} +1 -1
- package/dist/network/react/NetworkInternalContext.mjs +4 -0
- package/dist/network/react/index.d.ts +5 -0
- package/dist/network/react/index.mjs +3 -0
- package/dist/network/spaceEvents.mjs +16 -17
- package/dist/plugins/bundle/bundle.mjs +1 -2
- package/dist/plugins/declaration.mjs +1 -2
- package/dist/plugins/react/ElementRegistryContext.d.ts +26 -0
- package/dist/plugins/react/ElementRegistryContext.mjs +17 -0
- package/dist/plugins/react/PluginAssetsContext.d.ts +11 -0
- package/dist/plugins/react/PluginAssetsContext.mjs +4 -0
- package/dist/plugins/react/PluginsContext.mjs +6 -3
- package/dist/plugins/react/index.d.ts +3 -0
- package/dist/plugins/react/index.mjs +4 -1
- package/dist/project/index.mjs +7 -7
- package/dist/project/layout/check.mjs +26 -27
- package/dist/project/layout/codes.mjs +1 -2
- package/dist/project/layout/contents.mjs +12 -13
- package/dist/project/layout/files.mjs +1 -2
- package/dist/project/layout/folders.mjs +43 -44
- package/dist/project/layout/index.mjs +3 -3
- package/dist/project/layout/plugins.mjs +56 -57
- package/dist/project/layout/vendor.mjs +14 -15
- package/dist/project/network.mjs +1 -2
- package/dist/project/pages/index.mjs +1 -2
- package/dist/project/paths/index.d.ts +8 -2
- package/dist/project/paths/index.mjs +3 -4
- package/dist/project/root.mjs +1 -2
- package/dist/queries/index.mjs +1 -2
- package/dist/queries/queryCache.mjs +1 -2
- package/dist/queries/serverQueries.mjs +1 -2
- package/dist/queries/useQuery.mjs +1 -2
- package/dist/queries/useServerQuery.mjs +1 -2
- package/dist/{helpers → react}/enclosingSpace.mjs +1 -2
- package/dist/react/generateFacade.d.ts +1 -0
- package/dist/{helpers → react}/generateFacade.mjs +4 -5
- package/dist/react/index.d.ts +8 -0
- package/dist/react/index.mjs +4 -0
- package/dist/{helpers → react}/sharedContext.mjs +0 -1
- package/dist/realtime/client.mjs +3 -4
- package/dist/realtime/index.mjs +4 -4
- package/dist/realtime/presence.mjs +1 -2
- package/dist/realtime/topics.mjs +1 -2
- package/dist/runs/index.mjs +1 -2
- package/dist/runs/report.mjs +1 -2
- package/dist/schema/anchor.mjs +1 -2
- package/dist/schema/index.mjs +18 -18
- package/dist/schema/layoutChain.mjs +1 -2
- package/dist/schema/markdownHeadings.mjs +1 -2
- package/dist/schema/motion.mjs +1 -2
- package/dist/schema/motionReveal.mjs +1 -2
- package/dist/schema/pageAccess.d.ts +9 -0
- package/dist/schema/pageAccess.mjs +42 -36
- package/dist/schema/pageElements.d.ts +3 -1
- package/dist/schema/pageElements.mjs +9 -3
- package/dist/schema/pageHead.d.ts +5 -2
- package/dist/schema/pageHead.mjs +3 -4
- package/dist/schema/providerAnswer.mjs +1 -2
- package/dist/schema/providerWhen.d.ts +1 -1
- package/dist/schema/providerWhen.mjs +6 -7
- package/dist/schema/react/SchemaContext.mjs +1 -2
- package/dist/schema/schemaConstants.mjs +1 -2
- package/dist/schema/schemaSettings.mjs +1 -2
- package/dist/schema/serverElements.d.ts +0 -24
- package/dist/schema/serverElements.mjs +60 -39
- package/dist/schema/serverInput.mjs +23 -24
- package/dist/schema/serverQuery.d.ts +15 -5
- package/dist/schema/serverQuery.mjs +47 -35
- package/dist/schema/snippet.mjs +1 -2
- package/dist/schema/wire.mjs +1 -2
- package/dist/security/index.d.ts +49 -0
- package/dist/security/index.mjs +44 -0
- package/dist/server/actions/useActionsSync.mjs +1 -2
- package/dist/server/actions/useImagesSync.mjs +1 -2
- package/dist/server/actions/useRealtimeSync.mjs +1 -2
- package/dist/server/index.mjs +7 -7
- package/dist/server/rsc/refreshRsc.mjs +23 -24
- package/dist/server/rsc/useRscRefresh.mjs +1 -2
- package/dist/server/rsc/useRscSync.mjs +1 -2
- package/dist/server/usePluginRoute.mjs +1 -2
- package/dist/source/export.d.ts +1 -1
- package/dist/source/export.mjs +1 -2
- package/dist/source/import.mjs +1 -2
- package/dist/source/index.mjs +4 -4
- package/dist/source/snapshot.mjs +1 -2
- package/dist/state/index.d.ts +0 -1
- package/dist/state/index.mjs +1 -3
- package/dist/state/paintedState.mjs +10 -11
- package/dist/store/actionRuns/actionRunsRecorder.mjs +1 -2
- package/dist/store/actionRuns/actionRunsStore.mjs +1 -2
- package/dist/store/actionRuns/index.mjs +3 -3
- package/dist/store/actionRuns/useActionRuns.mjs +5 -6
- package/dist/store/index.d.ts +1 -0
- package/dist/store/index.mjs +2 -1
- package/dist/store/renderSettings.d.ts +1 -1
- package/dist/store/renderSettings.mjs +1 -2
- package/dist/{state → store}/runtimeStatePersist.mjs +29 -30
- package/dist/store/storeHooks.d.ts +45 -45
- package/dist/store/storeHooks.mjs +1 -2
- package/dist/store/tracing/index.mjs +5 -5
- package/dist/store/tracing/preview.mjs +1 -2
- package/dist/store/tracing/tracingCollector.d.ts +2 -2
- package/dist/store/tracing/tracingCollector.mjs +79 -78
- package/dist/store/tracing/tracingMiddleware.mjs +1 -2
- package/dist/store/tracing/tracingStore.mjs +1 -2
- package/dist/store/tracing/useTracing.mjs +6 -7
- package/dist/style/breakpoints.mjs +1 -2
- package/dist/style/cssLayers.mjs +1 -2
- package/dist/style/displayModes.mjs +1 -2
- package/dist/style/fontAssets.mjs +1 -2
- package/dist/style/fontValidation.mjs +14 -15
- package/dist/style/fonts.d.ts +5 -3
- package/dist/style/fonts.mjs +23 -24
- package/dist/style/fontsFromCss.mjs +1 -2
- package/dist/style/index.mjs +18 -18
- package/dist/style/keyframes.mjs +1 -2
- package/dist/style/layoutGrid.mjs +1 -2
- package/dist/style/notifications.mjs +1 -2
- package/dist/style/react/useDisplayMode.mjs +1 -2
- package/dist/style/react/useElementSize.mjs +1 -2
- package/dist/style/runtimeStyle.d.ts +19 -21
- package/dist/style/runtimeStyle.mjs +4 -7
- package/dist/style/snippetStyle.mjs +5 -6
- package/dist/style/styleConditions.mjs +1 -2
- package/dist/style/styleConstants.mjs +1 -2
- package/dist/style/stylePseudos.mjs +1 -2
- package/dist/style/styleStates.mjs +1 -2
- package/dist/style/styleTarget.mjs +24 -25
- package/dist/theme/cookie/index.mjs +1 -1
- package/dist/theme/cookie/themeCookie.d.ts +21 -1
- package/dist/theme/cookie/themeCookie.mjs +19 -4
- package/dist/theme/index.d.ts +1 -9
- package/dist/theme/index.mjs +1 -6
- package/dist/theme/{ThemeProvider.d.ts → react/ThemeProvider.d.ts} +8 -2
- package/dist/theme/react/ThemeProvider.mjs +78 -0
- package/dist/theme/{ThemeScope.d.ts → react/ThemeScope.d.ts} +6 -2
- package/dist/theme/react/ThemeScope.mjs +9 -0
- package/dist/theme/react/index.d.ts +9 -0
- package/dist/theme/react/index.mjs +5 -0
- package/dist/theme/{themeStore.d.ts → react/themeStore.d.ts} +5 -5
- package/dist/theme/{themeStore.mjs → react/themeStore.mjs} +4 -4
- package/dist/theme/{useTheme.d.ts → react/useTheme.d.ts} +1 -1
- package/dist/theme/react/useTheme.mjs +19 -0
- package/dist/types/ActionTypes.d.ts +33 -0
- package/dist/types/AuthTypes.d.ts +6 -0
- package/dist/types/CommonTypes.d.ts +14 -3
- package/dist/types/DataSourceTypes.d.ts +1 -1
- package/dist/types/FunctionTypes.d.ts +16 -6
- package/dist/types/InteractionTypes.d.ts +1 -1
- package/dist/types/JobTypes.d.ts +56 -182
- package/dist/types/PluginTypes.d.ts +8 -1
- package/dist/types/SchemaTypes.d.ts +1 -1
- package/dist/types/SchemaTypes.mjs +1 -2
- package/dist/types/ServerAdapterTypes.d.ts +0 -326
- package/dist/types/ServerTypes.d.ts +0 -311
- package/dist/types/SpaceTypes.d.ts +5 -2
- package/dist/types/StoreTypes.d.ts +9 -3
- package/dist/types/StyleTypes.d.ts +6 -0
- package/dist/types/StyleTypes.mjs +1 -2
- package/dist/types/index.d.ts +0 -3
- package/dist/websockets/RTCodec.mjs +1 -2
- package/eslint.config.mjs +25 -0
- package/package.json +29 -18
- package/vite.config.ts +58 -0
- package/dist/helpers/generateFacade.d.ts +0 -2
- package/dist/helpers/ruleEvaluator.d.ts +0 -16
- package/dist/helpers/ruleEvaluator.mjs +0 -5
- package/dist/network/NetworkInternalContext.mjs +0 -5
- package/dist/network/graphql/sdk/Mutations/index.d.ts +0 -3
- package/dist/network/graphql/sdk/Mutations/index.mjs +0 -4
- package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +0 -16
- package/dist/network/graphql/sdk/Queries/InitQuery.mjs +0 -4
- package/dist/network/graphql/sdk/Queries/index.d.ts +0 -6
- package/dist/network/graphql/sdk/Queries/index.mjs +0 -5
- package/dist/network/graphql/sdk/index.d.ts +0 -5
- package/dist/network/graphql/sdk/index.mjs +0 -3
- package/dist/theme/ThemeProvider.mjs +0 -69
- package/dist/theme/ThemeScope.mjs +0 -10
- package/dist/theme/useTheme.mjs +0 -20
- package/dist/types/OAuthTypes.d.ts +0 -246
- package/dist/types/ServerConfigTypes.d.ts +0 -527
- package/dist/types/ServerLogTypes.d.ts +0 -119
- /package/dist/{types/OAuthTypes.mjs → conditions/types.mjs} +0 -0
- /package/dist/{types/ServerConfigTypes.mjs → functions/kv.mjs} +0 -0
- /package/dist/{types/ServerLogTypes.mjs → functions/later.mjs} +0 -0
- /package/dist/{helpers → react}/enclosingSpace.d.ts +0 -0
- /package/dist/{helpers → react}/sharedContext.d.ts +0 -0
- /package/dist/{state → store}/runtimeStatePersist.d.ts +0 -0
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
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 = (
|
|
8
|
-
let
|
|
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:
|
|
10
|
+
from: e,
|
|
11
11
|
to: ".env"
|
|
12
|
-
} : void 0)), m = `${s.resolve(
|
|
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 ? [] : [
|
|
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(
|
|
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 = (
|
|
27
|
-
let
|
|
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
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
8
|
-
var x = (e, t) => t.map((t) => e.find((e) =>
|
|
9
|
-
for (let n of
|
|
10
|
-
let
|
|
11
|
-
if (
|
|
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(
|
|
14
|
+
let n = x(p(y.join(e, t)).files, ["index.ts"]);
|
|
15
15
|
return n ? `${t}/${n}` : void 0;
|
|
16
|
-
}, w = (
|
|
16
|
+
}, w = (i, { mode: a, space: u }) => [
|
|
17
17
|
{
|
|
18
|
-
at:
|
|
19
|
-
reads: `the server builds plugins from ${
|
|
20
|
-
holds: S(
|
|
18
|
+
at: r,
|
|
19
|
+
reads: `the server builds plugins from ${r}/ only`,
|
|
20
|
+
holds: S(i)
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
at:
|
|
24
|
-
reads: `the project's functions are built from ${
|
|
25
|
-
holds: C(
|
|
23
|
+
at: n,
|
|
24
|
+
reads: `the project's functions are built from ${n}/ only`,
|
|
25
|
+
holds: C(i)
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
at:
|
|
29
|
-
reads: `the space's runtime is run from ${
|
|
30
|
-
holds: C(
|
|
28
|
+
at: s,
|
|
29
|
+
reads: `the space's runtime is run from ${s}/ only`,
|
|
30
|
+
holds: C(i)
|
|
31
31
|
},
|
|
32
|
-
...
|
|
33
|
-
at:
|
|
34
|
-
reads: `the server's entry point and ${
|
|
35
|
-
holds: C(
|
|
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
|
-
...
|
|
38
|
-
at:
|
|
39
|
-
reads: `the server reads the project's data from ${
|
|
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:
|
|
43
|
-
reads: `the server serves ${
|
|
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),
|
|
47
|
-
return [...
|
|
48
|
-
}, E = (
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
let
|
|
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: `${
|
|
54
|
-
to: `${
|
|
53
|
+
from: `${i}/`,
|
|
54
|
+
to: `${t}/`
|
|
55
55
|
};
|
|
56
|
-
return
|
|
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 (!
|
|
59
|
-
folder:
|
|
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 ${
|
|
63
|
-
write: `Write ${
|
|
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,
|
|
66
|
-
return
|
|
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 {
|
|
3
|
-
import {
|
|
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,
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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
|
-
|
|
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(
|
|
10
|
-
return
|
|
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 } =
|
|
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) =>
|
|
15
|
-
let { folder: a, accepted:
|
|
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 [
|
|
18
|
-
let g = m.files.find((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
|
|
21
|
-
return [
|
|
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}/${
|
|
24
|
+
to: `${a}/${t}`
|
|
25
25
|
})];
|
|
26
26
|
}
|
|
27
|
-
let _ = m.files.find((e) =>
|
|
27
|
+
let _ = m.files.find((e) => l.some((t) => u(e, t)));
|
|
28
28
|
if (_) {
|
|
29
|
-
let
|
|
30
|
-
return [
|
|
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}/${
|
|
33
|
+
to: `${a}/${n}`
|
|
34
34
|
})];
|
|
35
35
|
}
|
|
36
|
-
let v = m.folders.find((
|
|
37
|
-
return v ? [
|
|
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
|
-
})] : [
|
|
42
|
-
}, E = (
|
|
43
|
-
let
|
|
44
|
-
if (!
|
|
45
|
-
let
|
|
46
|
-
return [
|
|
47
|
-
}, D = (e, t) =>
|
|
48
|
-
let n = x(
|
|
49
|
-
return
|
|
50
|
-
}, k = (e, t) => e.find((e) => e === `${t}.tsx`) ?? e.find((e) => e === `${t}.ts`), A = (
|
|
51
|
-
let 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
|
|
54
|
-
return
|
|
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}/${
|
|
57
|
-
to: `${i}/${
|
|
58
|
-
})] : [
|
|
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 (!
|
|
61
|
-
let n = `${
|
|
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:
|
|
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${
|
|
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}/${
|
|
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}/${
|
|
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 = (
|
|
78
|
+
}, M = (t) => {
|
|
79
79
|
let n = /* @__PURE__ */ new Map();
|
|
80
|
-
for (let
|
|
81
|
-
return [...n].flatMap(([
|
|
82
|
-
}, N = (
|
|
83
|
-
let { files: n, folders:
|
|
84
|
-
let { name: n } = y.parse(
|
|
85
|
-
return
|
|
86
|
-
}), c =
|
|
87
|
-
let n =
|
|
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
|
-
...
|
|
92
|
-
...M(
|
|
93
|
-
...
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
8
|
-
var s = (
|
|
9
|
-
src:
|
|
10
|
-
type:
|
|
11
|
-
isMain:
|
|
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 (!
|
|
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 (
|
|
19
|
-
return { problem:
|
|
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 (!
|
|
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:
|
|
24
|
-
if (!
|
|
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 };
|
package/dist/project/network.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
91
|
-
*
|
|
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
|
-
|
|
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 = "
|
|
3
|
-
|
|
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 };
|
package/dist/project/root.mjs
CHANGED
|
@@ -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
|
-
|
|
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 };
|
package/dist/queries/index.mjs
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 };
|
|
@@ -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 "
|
|
2
|
-
import { omit as t } from "
|
|
3
|
-
|
|
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
|
-
|
|
39
|
-
export { c as default };
|
|
38
|
+
export { c as generateFacade };
|