@plitzi/sdk-shared 0.39.1 → 0.39.3
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 +11 -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,74 +1,9 @@
|
|
|
1
|
-
import { ActionRunSummary } from './ActionTypes';
|
|
2
1
|
import { PluginDeclaration } from './ComponentTypes';
|
|
3
|
-
import { OfflineDataRaw } from './SdkTypes';
|
|
4
|
-
import { SSRMeterDecision, SSRSpaceDeployment } from './ServerAdapterTypes';
|
|
5
|
-
import { FontHead } from './StyleTypes';
|
|
6
|
-
import { SpaceChange } from '../history/types';
|
|
7
|
-
import { PageHeadTags } from '../schema/pageHead';
|
|
8
|
-
import { IncomingHttpHeaders } from 'node:http';
|
|
9
|
-
import { FC } from 'react';
|
|
10
|
-
export type ServerEnvironment = 'development' | 'production' | 'staging' | 'local';
|
|
11
|
-
export type SSRHeaders = IncomingHttpHeaders & {
|
|
12
|
-
':authority'?: string;
|
|
13
|
-
':method'?: string;
|
|
14
|
-
':path'?: string;
|
|
15
|
-
':scheme'?: string;
|
|
16
|
-
};
|
|
17
|
-
export type SSRRequest = {
|
|
18
|
-
method: string;
|
|
19
|
-
path: string;
|
|
20
|
-
search: string;
|
|
21
|
-
url: string;
|
|
22
|
-
hostname: string;
|
|
23
|
-
protocol: 'http' | 'https';
|
|
24
|
-
headers: SSRHeaders;
|
|
25
|
-
query: Record<string, string>;
|
|
26
|
-
/** Raw request body. Populated only for endpoints that consume it (e.g. the login/logout handlers). */
|
|
27
|
-
body?: string;
|
|
28
|
-
/**
|
|
29
|
-
* The client's address, when the host resolved one — through the proxies it sits behind. Forgeable by a direct
|
|
30
|
-
* client like every forwarded header, so it names things (a session in a device list) and never decides anything.
|
|
31
|
-
*/
|
|
32
|
-
ip?: string;
|
|
33
|
-
ctx: SSRContext;
|
|
34
|
-
};
|
|
35
|
-
/** A body's compressed forms, by content encoding — filled as they are first asked for. */
|
|
36
|
-
export type CompressedBodies = Partial<Record<'br' | 'gzip', Buffer>>;
|
|
37
|
-
export type SSRResponseHelpers = {
|
|
38
|
-
status: number;
|
|
39
|
-
/** Multi-valued for the headers that genuinely are, `Set-Cookie` above all — see `setHeader`. */
|
|
40
|
-
headers: Record<string, string | string[]>;
|
|
41
|
-
/** An array sets the header once per entry, which `Set-Cookie` needs: a response that grants a session writes
|
|
42
|
-
* several, and collapsing them into one string would produce a single malformed cookie. */
|
|
43
|
-
setHeader: (name: string, value: string | string[]) => void;
|
|
44
|
-
setStatus: (code: number) => void;
|
|
45
|
-
/**
|
|
46
|
-
* A `Buffer` is sent byte for byte and never compressed: it is how a binary reaches the wire — a font file, an
|
|
47
|
-
* image — and what it holds is usually compressed already. A string keeps the encoding negotiation.
|
|
48
|
-
*
|
|
49
|
-
* `compressed` is where this body's compressed forms are kept, for a body that is sent again unchanged — a cached
|
|
50
|
-
* page, a static file. The first send of each encoding compresses and stores it; every later one sends the stored
|
|
51
|
-
* bytes. Without it a cache hit recompressed the same page on every request, which was nearly all the CPU a cached
|
|
52
|
-
* page cost.
|
|
53
|
-
*
|
|
54
|
-
* A function is a body read only when it is needed: when the stored form for this request's encoding is missing, or
|
|
55
|
-
* the client takes no compression. A static file is then read from disk once per encoding, not on every request.
|
|
56
|
-
*/
|
|
57
|
-
send: (body: string | Buffer | (() => string), options?: {
|
|
58
|
-
compressed?: CompressedBodies;
|
|
59
|
-
}) => void;
|
|
60
|
-
write: (chunk: string | Buffer) => void;
|
|
61
|
-
end: () => void;
|
|
62
|
-
};
|
|
63
2
|
export type SSRRenderResult = {
|
|
64
3
|
status?: number;
|
|
65
4
|
redirect?: string;
|
|
66
5
|
headers?: Record<string, string>;
|
|
67
6
|
};
|
|
68
|
-
export type SSRCredential = {
|
|
69
|
-
provider: string;
|
|
70
|
-
data: unknown;
|
|
71
|
-
};
|
|
72
7
|
/**
|
|
73
8
|
* How a plugin's build reaches the page.
|
|
74
9
|
*
|
|
@@ -122,170 +57,12 @@ export type PluginEntry = {
|
|
|
122
57
|
*/
|
|
123
58
|
deferred?: PluginDeclaration;
|
|
124
59
|
};
|
|
125
|
-
export type SSRTemplateProps = {
|
|
126
|
-
title?: string;
|
|
127
|
-
/** Meta description for the document, and the share-preview text derived from it. */
|
|
128
|
-
description?: string;
|
|
129
|
-
/**
|
|
130
|
-
* The head's tags besides the title and the JSON-LD — description, robots, Open Graph and card, the canonical
|
|
131
|
-
* address, the icon, the browser's colour, the language — as `pageHeadTags` decides them. The server's own.
|
|
132
|
-
*/
|
|
133
|
-
head?: PageHeadTags;
|
|
134
|
-
jsPath?: string;
|
|
135
|
-
cssPath?: string;
|
|
136
|
-
/** Font Awesome's rules, after `cssPath`; its fonts are files beside it, fetched only for a style the page uses. */
|
|
137
|
-
iconsCssPath?: string;
|
|
138
|
-
/**
|
|
139
|
-
* Where the page fetches the space from, when it travels beside the document rather than in its payload: the
|
|
140
|
-
* page preloads it, and the bootstrap reads it before hydrating.
|
|
141
|
-
*/
|
|
142
|
-
spaceDocumentPath?: string;
|
|
143
|
-
builderJsPath?: string;
|
|
144
|
-
builderCssPath?: string;
|
|
145
|
-
plugins?: PluginEntry[];
|
|
146
|
-
react?: string;
|
|
147
|
-
reactJsx?: string;
|
|
148
|
-
reactDom?: string;
|
|
149
|
-
reactDomClient?: string;
|
|
150
|
-
reactCompilerRuntime?: string;
|
|
151
|
-
/** When true the client-side <script> block is omitted — useful for inspecting raw SSR HTML. */
|
|
152
|
-
ssrOnly?: boolean;
|
|
153
|
-
/** The page listens for what the server tells it changed — with `livePages` on (`updatePages`, `reloadPages`). */
|
|
154
|
-
livePages?: boolean;
|
|
155
|
-
/** The draft the page shows (`?__pt=<id>`), named in its listening address so it hears its own changes alone. */
|
|
156
|
-
liveDraft?: string;
|
|
157
|
-
/** The page's plugins can be swapped where they are drawn — a server developing (`devMode`) with `livePages` on. */
|
|
158
|
-
hotPlugins?: boolean;
|
|
159
|
-
debugMode?: boolean;
|
|
160
|
-
/**
|
|
161
|
-
* The theme class this document wears on `<html>` — `dark`, `light`, or nothing at all.
|
|
162
|
-
*
|
|
163
|
-
* The theme is kept in a cookie, so the server that renders the document already knows it: the page arrives
|
|
164
|
-
* painted correctly, with no blocking script in the head and no first paint in the other theme. Empty is not a
|
|
165
|
-
* failure — it is `system`, and the stylesheet's `prefers-color-scheme` queries answer it.
|
|
166
|
-
*/
|
|
167
|
-
themeClass?: string;
|
|
168
|
-
/**
|
|
169
|
-
* The document's web fonts: `fontsToHead(style.fonts, ...)` from this package.
|
|
170
|
-
*
|
|
171
|
-
* In the template rather than left to the SDK because a page paints before its JavaScript exists. A face
|
|
172
|
-
* requested at hydration arrives after the text it is for has already been drawn in a fallback, which is a
|
|
173
|
-
* reflow the visitor watches happen.
|
|
174
|
-
*/
|
|
175
|
-
fonts?: FontHead;
|
|
176
|
-
};
|
|
177
|
-
/**
|
|
178
|
-
* Remote pictures this server fetches, resizes and keeps, at `/_plitzi/img`.
|
|
179
|
-
*
|
|
180
|
-
* A picture from a dozen other sites, some 1500 px wide for a 360 px card, is the heaviest part of most pages; with
|
|
181
|
-
* this on, an `image` whose `src` is another site's offers the browser a `srcset` of sizes this server makes — in
|
|
182
|
-
* AVIF or WebP when the browser takes them, and with `sharp` installed (without it the picture is passed through,
|
|
183
|
-
* still cached).
|
|
184
|
-
*/
|
|
185
|
-
export type SSRImagesConfig = {
|
|
186
|
-
/**
|
|
187
|
-
* The hosts a picture may come from: `images.example.com`, or `*.example.com` for every subdomain. Nothing else is
|
|
188
|
-
* fetched — the endpoint is otherwise a way to make this server download anything — and each address is also held
|
|
189
|
-
* to the rule every outbound request is (no private network, every redirect judged).
|
|
190
|
-
*/
|
|
191
|
-
domains: readonly string[];
|
|
192
|
-
/** Where the resized files are kept. Default: `tmp/images` under the working directory. */
|
|
193
|
-
cacheDir?: string;
|
|
194
|
-
};
|
|
195
|
-
/**
|
|
196
|
-
* How a store-relative font path becomes a URL a browser can fetch.
|
|
197
|
-
*
|
|
198
|
-
* A space's manifest stores paths, never absolute URLs: the same space is rendered by Plitzi's cloud from a CDN,
|
|
199
|
-
* by a self-hosted server from its own disk, and by a static export from wherever it was published to. Baking one
|
|
200
|
-
* of those origins into the document would send every other deployment asking Plitzi for its customer's fonts.
|
|
201
|
-
*/
|
|
202
|
-
export type SSRFontsConfig = {
|
|
203
|
-
/** Prefix joined to each path, e.g. `/fonts` or `https://cdn.example.com/fonts`. Default: `/fonts`. */
|
|
204
|
-
baseUrl?: string;
|
|
205
|
-
/**
|
|
206
|
-
* A directory this server serves the uploaded files from, under `/fonts/*`.
|
|
207
|
-
*
|
|
208
|
-
* The self-hosting answer, and the reason `baseUrl` defaults to a path rather than an origin: with a directory
|
|
209
|
-
* here a deployment needs no object storage, no credentials and no network to serve its customers' fonts. A
|
|
210
|
-
* cloud deployment leaves it out and points `baseUrl` at its CDN instead.
|
|
211
|
-
*/
|
|
212
|
-
dir?: string;
|
|
213
|
-
};
|
|
214
|
-
export type SSRPlugin = {
|
|
215
|
-
component: FC;
|
|
216
|
-
props: Record<string, unknown>;
|
|
217
|
-
};
|
|
218
60
|
/** What a space token is worth. `render` is the public credential every published site embeds — it is readable
|
|
219
61
|
* by anyone who views the page, so it may only read, and only from the origins it declares. `host` is that same
|
|
220
62
|
* read access for a SERVER that renders the space as its own (self-hosting): secret rather than published, since
|
|
221
63
|
* a server has no browser origin for the allowlist to check. `agent` is the delegated grant an MCP connector
|
|
222
64
|
* receives after a member consents, and is the only bearer that may write without a session behind it. */
|
|
223
65
|
export type SpaceScope = 'render' | 'agent' | 'host';
|
|
224
|
-
/** A resolved space token: which space, what the bearer may do, and (for `agent`) the member who consented.
|
|
225
|
-
* `canWrite` is computed by the consumer from its own authorization model — the MCP never derives it. */
|
|
226
|
-
export type SSRGrant = {
|
|
227
|
-
spaceId: number;
|
|
228
|
-
scope: SpaceScope;
|
|
229
|
-
userId?: number;
|
|
230
|
-
/** For an `agent` grant, the application the member connected (`Claude`): what its writes are recorded and shown as. */
|
|
231
|
-
client?: string;
|
|
232
|
-
canWrite: boolean;
|
|
233
|
-
/**
|
|
234
|
-
* Whether it may write and play the space's tests — every role that writes may, and a tester's role (`Can test`) may
|
|
235
|
-
* with nothing else: the MCP saves the tests alone through it, never another change.
|
|
236
|
-
*/
|
|
237
|
-
canTest?: boolean;
|
|
238
|
-
/** Why `canWrite` is false, in the consumer's words, said to the agent in place of the MCP's own: a role that views
|
|
239
|
-
* or edits only the content never had the right to change the design — it did not lose it. */
|
|
240
|
-
readOnlyReason?: string;
|
|
241
|
-
};
|
|
242
|
-
/** A page of a space's change history, newest first; `nextBefore` reads further back, null at the end. */
|
|
243
|
-
export type SSRChangePage = {
|
|
244
|
-
changes: SpaceChange[];
|
|
245
|
-
nextBefore: number | null;
|
|
246
|
-
};
|
|
247
|
-
/** What to read of the history: older than `before`, only the changes that touched `entityId`, `limit` at a time. */
|
|
248
|
-
export type SSRChangeQuery = {
|
|
249
|
-
before?: number;
|
|
250
|
-
entityId?: string;
|
|
251
|
-
limit: number;
|
|
252
|
-
};
|
|
253
|
-
/** Who a write is made for and which request made it, for a consumer that records its changes. Every document one
|
|
254
|
-
* request writes shares its `batch`: one `plitzi_apply`, read back as one change. `client` is the application that
|
|
255
|
-
* wrote it for them (`SSRGrant.client`). */
|
|
256
|
-
export type SSRWriteContext = {
|
|
257
|
-
userId?: number;
|
|
258
|
-
batch: string;
|
|
259
|
-
client?: string;
|
|
260
|
-
};
|
|
261
|
-
/**
|
|
262
|
-
* A session, as the thing that issued it describes it. Deliberately free of transport: whoever mints one says what
|
|
263
|
-
* the credentials are and when they die, and the server decides how they are carried — which is what lets a
|
|
264
|
-
* deployment bring its own identity source without also reimplementing cookies.
|
|
265
|
-
*/
|
|
266
|
-
export type SSRSession = {
|
|
267
|
-
token: string;
|
|
268
|
-
/** Unix seconds. */
|
|
269
|
-
expiresAt: number;
|
|
270
|
-
refreshToken?: string;
|
|
271
|
-
refreshExpiresAt?: number;
|
|
272
|
-
};
|
|
273
|
-
/**
|
|
274
|
-
* How this deployment's session cookies are named and scoped. Every field has a working default derived from the
|
|
275
|
-
* request host, so a server that says nothing still gets a correct cookie; the function forms exist for deployments
|
|
276
|
-
* whose naming varies by environment or host, which is a policy only they know.
|
|
277
|
-
*/
|
|
278
|
-
export type SSRAuthCookie = {
|
|
279
|
-
name?: string | ((hostname: string) => string);
|
|
280
|
-
/** Return undefined for a host-only cookie. Defaults to the registrable domain, so sibling sub-domains share it. */
|
|
281
|
-
domain?: string | ((hostname: string) => string | undefined);
|
|
282
|
-
sameSite?: 'lax' | 'none';
|
|
283
|
-
secure?: boolean;
|
|
284
|
-
/** Path the refresh credential is confined to, so it never rides along on ordinary traffic. Defaults to `/auth`. */
|
|
285
|
-
refreshPath?: string;
|
|
286
|
-
/** Suffix of the readable companion cookie that carries only expiries. Defaults to `_hint`. */
|
|
287
|
-
hintSuffix?: string;
|
|
288
|
-
};
|
|
289
66
|
export type SSRUser = {
|
|
290
67
|
token: string;
|
|
291
68
|
/** Unix seconds the token dies at, so the rendered page can renew ahead of it rather than on a refusal. */
|
|
@@ -302,91 +79,3 @@ export type SSRUser = {
|
|
|
302
79
|
* person, and what a job keeps of whoever started it, for every slice it runs after their session is gone.
|
|
303
80
|
*/
|
|
304
81
|
export type RunUser = Pick<SSRUser, 'id' | 'username' | 'email' | 'verified' | 'permissions' | 'roles'>;
|
|
305
|
-
export type SSRTemplateFn = (params: SSRTemplateProps & {
|
|
306
|
-
html: string;
|
|
307
|
-
offlineData: string;
|
|
308
|
-
}) => string;
|
|
309
|
-
/** Which surfaces a page server mounts. Only what the page pipeline itself owns: the MCP endpoint and
|
|
310
|
-
* draft-preview are stages a companion package hands in, so they are not flags here. */
|
|
311
|
-
export type ServerServices = {
|
|
312
|
-
ssr?: boolean;
|
|
313
|
-
rsc?: boolean;
|
|
314
|
-
};
|
|
315
|
-
export type PluginRegistry = {
|
|
316
|
-
register: (name: string, source: PluginSource) => void;
|
|
317
|
-
/** A plugin no longer there — its folder removed under a dev server: never built or served again. */
|
|
318
|
-
unregister: (name: string) => void;
|
|
319
|
-
invalidate: (name?: string, version?: string) => Promise<void>;
|
|
320
|
-
};
|
|
321
|
-
export type CacheFilter = {
|
|
322
|
-
spaceId?: number;
|
|
323
|
-
environment?: string;
|
|
324
|
-
hostname?: string;
|
|
325
|
-
};
|
|
326
|
-
export type CacheManager = {
|
|
327
|
-
invalidate: (filter?: CacheFilter) => number;
|
|
328
|
-
clear: () => void;
|
|
329
|
-
readonly size: number;
|
|
330
|
-
};
|
|
331
|
-
export type SSRMiddlewareNext = () => Promise<void> | void;
|
|
332
|
-
export type SSRMiddleware = (req: SSRRequest, res: SSRResponseHelpers, next: SSRMiddlewareNext) => Promise<void> | void;
|
|
333
|
-
export type SSRContext = {
|
|
334
|
-
spaceDeployment?: SSRSpaceDeployment;
|
|
335
|
-
user?: SSRUser;
|
|
336
|
-
/** What {@link SSRAdapters.meter} answered for this request, so the render reads the decision instead of
|
|
337
|
-
* asking for it a second time. */
|
|
338
|
-
meter?: SSRMeterDecision;
|
|
339
|
-
/**
|
|
340
|
-
* The runs this request's server elements started, as the action resolver ran them. Read once the render or the
|
|
341
|
-
* refresh is done, and handed on only to a page whose debugging is authorized.
|
|
342
|
-
*/
|
|
343
|
-
actionRuns?: ActionRunSummary[];
|
|
344
|
-
/**
|
|
345
|
-
* This server previews a run of agents and answers its snapshot at `RUN_STATUS_PATH` (`plitzi run preview`): said to a
|
|
346
|
-
* page that may debug, so its dev tools ask for the run — and no other page's ask a server that has none.
|
|
347
|
-
*/
|
|
348
|
-
runStatus?: true;
|
|
349
|
-
/**
|
|
350
|
-
* This request renders a draft session minted for a test runner (`DraftEntry.inspected`): the page carries the
|
|
351
|
-
* space's state bridge, `window.__plitzi`, with no panel or badge.
|
|
352
|
-
*/
|
|
353
|
-
inspectedDraft?: true;
|
|
354
|
-
/**
|
|
355
|
-
* What a refresh of server data asked for beside the page's own address (`/_rsc?location=…&q=…`): a provider's
|
|
356
|
-
* `input`, a page window. What the provider asks for this time, so it wins over the `input` the element was saved
|
|
357
|
-
* with — the query string of the page does not.
|
|
358
|
-
*/
|
|
359
|
-
rscParams?: Record<string, string>;
|
|
360
|
-
};
|
|
361
|
-
export type SSRServer = {
|
|
362
|
-
/**
|
|
363
|
-
* Binds the port. Resolves once it takes connections — in a fleet, once the first worker does — so what says "ready"
|
|
364
|
-
* (a log line, a file a tool reads, a test's first request) says it after, never before. A port it could not take
|
|
365
|
-
* ends the process, or goes to `onListenError`: the promise is then never resolved.
|
|
366
|
-
*/
|
|
367
|
-
listen: (port: number, host?: string) => Promise<void>;
|
|
368
|
-
close: () => Promise<void>;
|
|
369
|
-
readonly cache: CacheManager | null;
|
|
370
|
-
readonly plugins: PluginRegistry;
|
|
371
|
-
/**
|
|
372
|
-
* With `livePages` on, every page open on this server loads again — what a change the pages cannot be handed as
|
|
373
|
-
* documents calls (the server's own code, its plugins' declarations). Nothing otherwise.
|
|
374
|
-
*/
|
|
375
|
-
reloadPages: () => void;
|
|
376
|
-
/**
|
|
377
|
-
* With `livePages` on, every page open on this server showing its own space — or, with `draft`, that draft — swaps it
|
|
378
|
-
* for `documents` where it stands, its state, scroll and focus kept; a page that cannot (one with elements the server
|
|
379
|
-
* draws) loads again. What a project that authors its space in code calls once it serves the new documents
|
|
380
|
-
* (`serveProject`), instead of restarting the server. How many pages were told; none without `livePages`.
|
|
381
|
-
*/
|
|
382
|
-
updatePages: (documents: OfflineDataRaw, options?: {
|
|
383
|
-
draft?: string;
|
|
384
|
-
}) => number;
|
|
385
|
-
/**
|
|
386
|
-
* The server halves of the plugins this server ships (`functions.plugins`), replaced while it runs: what a development
|
|
387
|
-
* server does when a plugin's `functions/` change. `definition` is what `loadFunctions` loads; none takes it away.
|
|
388
|
-
*/
|
|
389
|
-
readonly functions: {
|
|
390
|
-
setPlugin: (plugin: string, definition: unknown) => void;
|
|
391
|
-
};
|
|
392
|
-
};
|
|
@@ -78,7 +78,7 @@ export type SpaceRuntimeEnvironment = {
|
|
|
78
78
|
/** The size it runs at — or will start at — by name (`SpaceRuntimeSizeOption['name']`). */
|
|
79
79
|
size: string;
|
|
80
80
|
};
|
|
81
|
-
/** A size a runtime may run at: what its pod may spend,
|
|
81
|
+
/** A size a runtime may run at: what its pod may spend, how many of it the space bought, and its price a month. */
|
|
82
82
|
export type SpaceRuntimeSizeOption = {
|
|
83
83
|
name: string;
|
|
84
84
|
label: string;
|
|
@@ -86,7 +86,10 @@ export type SpaceRuntimeSizeOption = {
|
|
|
86
86
|
cpu: string;
|
|
87
87
|
/** As Kubernetes reads it: `256Mi`. */
|
|
88
88
|
memory: string;
|
|
89
|
-
|
|
89
|
+
/** How many of it the space bought, each running one environment; `null` where it is not bounded. */
|
|
90
|
+
bought: number | null;
|
|
91
|
+
/** Its price a month, in euro cents, VAT included. */
|
|
92
|
+
displayAmount: number;
|
|
90
93
|
};
|
|
91
94
|
/** A space's runtime: every environment's, and the names of the variables it starts with — never their values. */
|
|
92
95
|
export type SpaceRuntime = {
|
|
@@ -10,6 +10,11 @@ import { DisplayMode, Style, StylePseudo, StyleState } from './StyleTypes';
|
|
|
10
10
|
import { SignedInTestAccount } from './TestTypes';
|
|
11
11
|
import { ColorScheme, Theme } from './ThemeTypes';
|
|
12
12
|
import { FlagOverrides, FlagResolution } from '../flags/resolveFlags';
|
|
13
|
+
/** Where a site's badge leads: who made it, and where to report one that abuses its address — the deployment's own. */
|
|
14
|
+
export type BadgeLinks = {
|
|
15
|
+
madeWith: string;
|
|
16
|
+
report: string;
|
|
17
|
+
};
|
|
13
18
|
export type RuntimeSourceValues = {
|
|
14
19
|
variables?: Record<string, unknown>;
|
|
15
20
|
navigation?: {
|
|
@@ -160,9 +165,10 @@ export type RenderSettings = {
|
|
|
160
165
|
quotaNear?: boolean;
|
|
161
166
|
/**
|
|
162
167
|
* The deployment's "Made with Plitzi" badge, as the SERVER decided when it metered the render: on a plan that does
|
|
163
|
-
* not remove it
|
|
168
|
+
* not remove it — and where it leads, the deployment's own, so a site served on a test tier reports there. Like
|
|
169
|
+
* `overQuota`, a fact about the account behind the site that nothing an author writes can set.
|
|
164
170
|
*/
|
|
165
|
-
badge?:
|
|
171
|
+
badge?: BadgeLinks | false;
|
|
166
172
|
/**
|
|
167
173
|
* Whether every element carries `data-plitzi-el="<its id>"`, which is what an end-to-end test addresses it by.
|
|
168
174
|
*
|
|
@@ -382,7 +388,7 @@ export type ActionRunEntry = {
|
|
|
382
388
|
mode: 'await' | 'detached' | 'stream' | 'render';
|
|
383
389
|
/** The server's own id, once it answers. Absent for a run that never reached one. */
|
|
384
390
|
runId?: string;
|
|
385
|
-
status: 'running' | 'completed' | 'failed' | 'accepted' | 'streaming' | 'skipped' | 'aborted';
|
|
391
|
+
status: 'running' | 'completed' | 'failed' | 'accepted' | 'queued' | 'streaming' | 'skipped' | 'aborted';
|
|
386
392
|
/** The server's vocabulary when it refused: `duplicate`, `over_capacity`, `recursion`, `forbidden`… */
|
|
387
393
|
reason?: string;
|
|
388
394
|
/** What went wrong, when anything says so. Never a credential — the server redacts before answering. */
|
|
@@ -151,7 +151,13 @@ export type Style = {
|
|
|
151
151
|
* because nothing else in the system loads a face. Optional because a document written before the manifest
|
|
152
152
|
* existed has none, and that is a real state every reader has to survive rather than a bug. */
|
|
153
153
|
fonts?: SpaceFont[];
|
|
154
|
+
/** The compiled stylesheet. Empty on a server-rendered page that links it as `cacheHref` instead. */
|
|
154
155
|
cache: string;
|
|
156
|
+
/**
|
|
157
|
+
* Where a server-rendered page's stylesheet is served (`/_plitzi/style/<hash>.css`), when it links the compiled
|
|
158
|
+
* stylesheet rather than carrying it: `cache` is then empty, and the page draws a `<link>` to this.
|
|
159
|
+
*/
|
|
160
|
+
cacheHref?: string;
|
|
155
161
|
};
|
|
156
162
|
export type StyleContextValue = {
|
|
157
163
|
styleUpdate?: unknown;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// src/types/StyleTypes.ts
|
|
2
2
|
var e = /* @__PURE__ */ function(e) {
|
|
3
3
|
return e.COLOR = "color", e.SPACING = "spacing", e.SHADOW = "shadow", e.CUSTOM = "custom", e;
|
|
4
4
|
}({}), t = Object.values(e), n = (e) => typeof e == "string" && t.includes(e);
|
|
5
|
-
//#endregion
|
|
6
5
|
export { e as StyleVariableCategory, n as isStyleVariableCategory };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -27,8 +27,5 @@ export * from './StoreTypes';
|
|
|
27
27
|
export * from './ThemeTypes';
|
|
28
28
|
export * from './ServerTypes';
|
|
29
29
|
export * from './ServerAdapterTypes';
|
|
30
|
-
export * from './ServerConfigTypes';
|
|
31
|
-
export * from './ServerLogTypes';
|
|
32
|
-
export * from './OAuthTypes';
|
|
33
30
|
export * from './PreviewTypes';
|
|
34
31
|
export * from './TestTypes';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/websockets/RTCodec.ts
|
|
2
2
|
var e = /* @__PURE__ */ function(e) {
|
|
3
3
|
return e[e.NORMAL = 1e3] = "NORMAL", e[e.AWAY = 1001] = "AWAY", e[e.ABNORMAL = 1002] = "ABNORMAL", e[e.UNSUPPORTED = 1003] = "UNSUPPORTED", e[e.UNKNOWN = 4e3] = "UNKNOWN", e[e.NOT_AUTHORISED = 4001] = "NOT_AUTHORISED", e[e.INSTANCE_ID_NOT_FOUND = 4002] = "INSTANCE_ID_NOT_FOUND", e[e.USER_TOKEN_NOT_FOUND = 4003] = "USER_TOKEN_NOT_FOUND", e;
|
|
4
4
|
}({}), t = /* @__PURE__ */ function(e) {
|
|
@@ -33,5 +33,4 @@ var e = /* @__PURE__ */ function(e) {
|
|
|
33
33
|
function s(e = !0) {
|
|
34
34
|
return e && !a && (a = new i()), a;
|
|
35
35
|
}
|
|
36
|
-
//#endregion
|
|
37
36
|
export { t as RTEvent, e as RTEventCloseCode, i as default, s as getInstance, n as isRTEvent, r as isRTEventCloseCode, o as setInstance };
|
package/eslint.config.mjs
CHANGED
|
@@ -35,6 +35,29 @@ export default tsEslint.config({
|
|
|
35
35
|
},
|
|
36
36
|
rules: {
|
|
37
37
|
...reactHooks.configs.recommended.rules,
|
|
38
|
+
// One rule evaluator for every reader: sdk-shared's (`@plitzi/sdk-shared/conditions`). plitzi-ui keeps a copy of its
|
|
39
|
+
// own, which Plitzi never reads, so the builder's preview and the server cannot decide a condition two ways.
|
|
40
|
+
'@typescript-eslint/no-restricted-imports': [
|
|
41
|
+
'error',
|
|
42
|
+
{
|
|
43
|
+
paths: [
|
|
44
|
+
{
|
|
45
|
+
name: '@plitzi/plitzi-ui/QueryBuilder/evaluator',
|
|
46
|
+
message: 'Evaluate a condition with `evaluateRuleGroup` from `@plitzi/sdk-shared/conditions`.'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: '@plitzi/plitzi-ui/QueryBuilder',
|
|
50
|
+
importNames: ['QueryBuilderEvaluator'],
|
|
51
|
+
message: 'Evaluate a condition with `evaluateRuleGroup` from `@plitzi/sdk-shared/conditions`.'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: '@plitzi/plitzi-ui/QueryBuilder/helpers',
|
|
55
|
+
importNames: ['QueryBuilderEvaluator'],
|
|
56
|
+
message: 'Evaluate a condition with `evaluateRuleGroup` from `@plitzi/sdk-shared/conditions`.'
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
],
|
|
38
61
|
'no-useless-assignment': 'off',
|
|
39
62
|
'@typescript-eslint/no-deprecated': 'off',
|
|
40
63
|
'@typescript-eslint/no-useless-default-assignment': 'off',
|
|
@@ -64,6 +87,8 @@ export default tsEslint.config({
|
|
|
64
87
|
'react-hooks/immutability': 'off', // @todo: review later
|
|
65
88
|
'react-hooks/set-state-in-effect': 'off', // @todo: review later
|
|
66
89
|
'react-hooks/preserve-manual-memoization': 'off', // @todo: review later
|
|
90
|
+
// sdk-elements' memos that the page server, which draws once, makes as values (`Element/hooks/drawnMemo.ts`).
|
|
91
|
+
'react-hooks/exhaustive-deps': ['warn', { additionalHooks: '(useDrawnMemo|useDrawnCallback)' }],
|
|
67
92
|
'prettier/prettier': ['warn', { trailingComma: 'none' }],
|
|
68
93
|
'@typescript-eslint/restrict-template-expressions': ['error', { allowNumber: true }],
|
|
69
94
|
// Destructuring a key out so the rest carries everything else is how a field is dropped from an object here.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-shared",
|
|
3
|
-
"version": "0.39.
|
|
3
|
+
"version": "0.39.3",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -13,46 +13,47 @@
|
|
|
13
13
|
".": {
|
|
14
14
|
"@plitzi/source": "./src/index.ts",
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
|
-
"import": "./dist/index.mjs"
|
|
16
|
+
"import": "./dist/index.mjs",
|
|
17
|
+
"default": "./dist/index.mjs"
|
|
17
18
|
},
|
|
18
19
|
"./*": {
|
|
19
20
|
"@plitzi/source": "./src/*/index.ts",
|
|
20
21
|
"types": "./dist/*/index.d.ts",
|
|
21
|
-
"import": "./dist/*/index.mjs"
|
|
22
|
+
"import": "./dist/*/index.mjs",
|
|
23
|
+
"default": "./dist/*/index.mjs"
|
|
22
24
|
}
|
|
23
25
|
},
|
|
24
26
|
"type": "module",
|
|
25
27
|
"sideEffects": false,
|
|
26
28
|
"scripts": {
|
|
27
|
-
"lint": "eslint ./src",
|
|
29
|
+
"lint": "eslint --cache --cache-location .eslintcache --cache-strategy content ./src",
|
|
28
30
|
"test": "vitest run",
|
|
29
31
|
"bench": "vitest bench",
|
|
30
|
-
"typecheck": "tsc -p tsconfig.app.json --noEmit",
|
|
32
|
+
"typecheck": "tsc -p tsconfig.app.json --noEmit --incremental --tsBuildInfoFile .tsbuildinfo/app.tsbuildinfo",
|
|
31
33
|
"build:dev": "vite build --mode development --minify false",
|
|
32
34
|
"build:dev-watch": "vite build --mode development --watch --minify false",
|
|
33
35
|
"build:prod": "vite build"
|
|
34
36
|
},
|
|
35
37
|
"dependencies": {
|
|
36
|
-
"@plitzi/nexus": "^1.4.0",
|
|
37
|
-
"@plitzi/plitzi-ui": "^1.6.36",
|
|
38
38
|
"date-fns": "^4.4.0",
|
|
39
|
-
"immer": "^11.1.21",
|
|
40
39
|
"zod": "^4.6.7"
|
|
41
40
|
},
|
|
42
41
|
"peerDependencies": {
|
|
43
42
|
"@apollo/client": "^4.3.1",
|
|
43
|
+
"@plitzi/nexus": "^1.4.0",
|
|
44
44
|
"react": "^19",
|
|
45
45
|
"react-dom": "^19"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@apollo/client": "^4.3.
|
|
48
|
+
"@apollo/client": "^4.3.7",
|
|
49
49
|
"@eslint/js": "^10.0.1",
|
|
50
|
+
"@plitzi/nexus": "^1.4.0",
|
|
50
51
|
"@testing-library/dom": "^10.4.2",
|
|
51
52
|
"@testing-library/react": "^16.3.3",
|
|
52
53
|
"@types/react": "^19.3.0",
|
|
53
54
|
"@types/react-dom": "^19.3.0",
|
|
54
|
-
"@vitejs/plugin-react": "^6.
|
|
55
|
-
"@vitest/coverage-v8": "^5.0
|
|
55
|
+
"@vitejs/plugin-react": "^6.3.0",
|
|
56
|
+
"@vitest/coverage-v8": "^5.1.0",
|
|
56
57
|
"esbuild": "^0.28.2",
|
|
57
58
|
"eslint": "^9.39.5",
|
|
58
59
|
"eslint-config-prettier": "^10.1.8",
|
|
@@ -61,23 +62,33 @@
|
|
|
61
62
|
"eslint-plugin-react": "^7.37.5",
|
|
62
63
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
63
64
|
"eslint-plugin-react-refresh": "^0.5.7",
|
|
64
|
-
"eslint-plugin-storybook": "^10.6.
|
|
65
|
-
"globals": "^17.
|
|
66
|
-
"jsdom": "^
|
|
65
|
+
"eslint-plugin-storybook": "^10.6.6",
|
|
66
|
+
"globals": "^17.14.0",
|
|
67
|
+
"jsdom": "^31.0.0",
|
|
68
|
+
"lodash": "^4.18.1",
|
|
67
69
|
"prettier": "^3.9.10",
|
|
68
70
|
"react": "^19.3.1",
|
|
69
71
|
"react-dom": "^19.3.1",
|
|
70
|
-
"tailwindcss": "^4.3.
|
|
72
|
+
"tailwindcss": "^4.3.5",
|
|
71
73
|
"typescript": "^6.0.3",
|
|
72
|
-
"typescript-eslint": "^8.
|
|
73
|
-
"vite": "^8.3.
|
|
74
|
+
"typescript-eslint": "^8.72.2",
|
|
75
|
+
"vite": "^8.3.7",
|
|
74
76
|
"vite-plugin-dts": "^5.1.2",
|
|
75
|
-
"vitest": "^5.0
|
|
77
|
+
"vitest": "^5.1.0",
|
|
76
78
|
"vitest-fetch-mock": "^0.4.5"
|
|
77
79
|
},
|
|
78
80
|
"peerDependenciesMeta": {
|
|
79
81
|
"@apollo/client": {
|
|
80
82
|
"optional": true
|
|
83
|
+
},
|
|
84
|
+
"@plitzi/nexus": {
|
|
85
|
+
"optional": true
|
|
86
|
+
},
|
|
87
|
+
"react": {
|
|
88
|
+
"optional": true
|
|
89
|
+
},
|
|
90
|
+
"react-dom": {
|
|
91
|
+
"optional": true
|
|
81
92
|
}
|
|
82
93
|
}
|
|
83
94
|
}
|
package/vite.config.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/// <reference types="vitest" />
|
|
3
3
|
|
|
4
4
|
import fs from 'node:fs';
|
|
5
|
+
import { createRequire } from 'node:module';
|
|
5
6
|
import path from 'node:path';
|
|
6
7
|
|
|
7
8
|
import react from '@vitejs/plugin-react';
|
|
@@ -26,8 +27,64 @@ const skipUnchangedDts = (filePath: string, content: string) => {
|
|
|
26
27
|
return undefined;
|
|
27
28
|
};
|
|
28
29
|
|
|
30
|
+
/**
|
|
31
|
+
* The path an external import is written with in the build (`output.paths`). As written — except a deep import of a
|
|
32
|
+
* package with no `exports` map that does not name its file (`react-syntax-highlighter/dist/esm/languages/prism/bash`),
|
|
33
|
+
* written as the file it resolves to (`….js`): a bundler finds the file either way, Node only by its name, and a server
|
|
34
|
+
* that runs this package's build with Node itself — a project of the CLI, a self-hosted server — failed on it.
|
|
35
|
+
*/
|
|
36
|
+
const externalPath = (source: string): string => {
|
|
37
|
+
const deep = deepSpecifier(source);
|
|
38
|
+
if (!deep || path.extname(deep.subpath) !== '') {
|
|
39
|
+
return source;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
let file: string;
|
|
43
|
+
try {
|
|
44
|
+
file = createRequire(path.join(process.cwd(), 'package.json')).resolve(source);
|
|
45
|
+
} catch {
|
|
46
|
+
// Not resolvable from here (a peer the consumer brings): kept as written, as every other import is.
|
|
47
|
+
return source;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const root = packageRootOf(file, deep.name);
|
|
51
|
+
if (!root) {
|
|
52
|
+
return source;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const { exports } = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf-8')) as { exports?: unknown };
|
|
56
|
+
|
|
57
|
+
return exports === undefined ? `${deep.name}/${path.relative(root, file).split(path.sep).join('/')}` : source;
|
|
58
|
+
};
|
|
59
|
+
|
|
29
60
|
const importedPackages = new Set();
|
|
30
61
|
|
|
62
|
+
/** `@scope/name/sub/path` or `name/sub/path` → the package's name and the path inside it; nothing for a bare name. */
|
|
63
|
+
const deepSpecifier = (source: string): { name: string; subpath: string } | undefined => {
|
|
64
|
+
const parts = source.split('/');
|
|
65
|
+
const nameParts = source.startsWith('@') ? 2 : 1;
|
|
66
|
+
if (parts.length <= nameParts) {
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return { name: parts.slice(0, nameParts).join('/'), subpath: parts.slice(nameParts).join('/') };
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/** The `package.json` of the package a resolved file belongs to: the nearest one above it that names the package. */
|
|
74
|
+
const packageRootOf = (file: string, name: string): string | undefined => {
|
|
75
|
+
for (let dir = path.dirname(file); dir !== path.dirname(dir); dir = path.dirname(dir)) {
|
|
76
|
+
const manifest = path.join(dir, 'package.json');
|
|
77
|
+
if (fs.existsSync(manifest)) {
|
|
78
|
+
const { name: found } = JSON.parse(fs.readFileSync(manifest, 'utf-8')) as { name?: string };
|
|
79
|
+
if (found === name) {
|
|
80
|
+
return dir;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return undefined;
|
|
86
|
+
};
|
|
87
|
+
|
|
31
88
|
/**
|
|
32
89
|
* Under test, a workspace package is read from its sources (`@plitzi/source` in its `exports`), not from `dist`: a test
|
|
33
90
|
* then runs against the code of the packages it depends on as it is now, with no build first and no stale one to
|
|
@@ -173,6 +230,7 @@ export default defineConfig(({ mode, command }) => {
|
|
|
173
230
|
format: 'es',
|
|
174
231
|
exports: 'named',
|
|
175
232
|
preserveModules: true, // Keep module structure for tree-shaking
|
|
233
|
+
paths: externalPath,
|
|
176
234
|
preserveModulesRoot: 'src', // Tell Rollup where to "root" the modules (under src)
|
|
177
235
|
entryFileNames: '[name].mjs',
|
|
178
236
|
chunkFileNames: '[name].mjs',
|