tungsten 0.7.0 → 0.7.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/AGENTS.md +1246 -0
- package/dist/.build-complete +1 -1
- package/dist/FrameworkConfig.d.ts +2 -0
- package/dist/Instance/Instance.js +6 -33
- package/dist/Instance/InstanceConfig.d.ts +1 -0
- package/dist/Servers/DevServer.js +10 -1
- package/dist/Servers/ProdServer.d.ts +1 -0
- package/dist/Servers/ProdServer.js +18 -1
- package/dist/Servers/routing.js +9 -5
- package/dist/Servers/stubInstance.d.ts +8 -0
- package/dist/Servers/stubInstance.js +40 -0
- package/dist/build/createInstanceConfigFile.js +1 -1
- package/dist/componentHelpers.d.ts +2 -1
- package/dist/componentHelpers.js +3 -0
- package/dist/frameworkConfigSchema.d.ts +2 -0
- package/dist/frameworkConfigSchema.js +4 -1
- package/dist/hydrate/hydrate.js +31 -10
- package/dist/hydrate/stubRouting.d.ts +8 -0
- package/dist/hydrate/stubRouting.js +25 -0
- package/dist/makeFinalConfig.js +2 -0
- package/dist/makeInstanceConfigFromFrameworkConfig.js +1 -0
- package/dist/pipeline/PipelineRequestHandler.js +9 -1
- package/dist/pipeline/hydratePipeline.js +28 -9
- package/dist/pipeline/pipeline.d.ts +35 -33
- package/dist/pipeline/pipeline.js +10 -5
- package/dist/pipeline/pipelineDefinition.d.ts +20 -9
- package/dist/pipeline/runPipeline.d.ts +6 -8
- package/dist/pipeline/runPipeline.js +8 -8
- package/dist/pipeline/runSplitPipeline.d.ts +3 -3
- package/dist/pipeline/runSplitPipeline.js +12 -8
- package/dist/pipeline/splitPipeline.d.ts +8 -8
- package/dist/render/contentTreeToRenderingTree.js +4 -1
- package/dist/routing/MatchedRouteInfo.d.ts +2 -0
- package/dist/routing/MatchedRouteInfo.js +1 -1
- package/dist/routing/RouteContentFunction.d.ts +1 -1
- package/dist/routing/RouteTypes.d.ts +1 -1
- package/dist/routing/Routes.d.ts +9 -4
- package/dist/routing/builder.d.ts +2 -1
- package/dist/routing/builder.js +6 -0
- package/dist/routing/redirectOf.d.ts +11 -0
- package/dist/routing/redirectOf.js +32 -0
- package/dist/routing/routesArray.d.ts +2 -2
- package/dist/routing/routingBuilder.js +0 -1
- package/dist/testing/contentToString.d.ts +13 -0
- package/dist/testing/contentToString.js +105 -0
- package/dist/testing/display.d.ts +2 -0
- package/dist/testing/display.js +37 -0
- package/dist/testing/ensure.d.ts +52 -41
- package/dist/testing/ensure.js +204 -62
- package/dist/testing/host.d.ts +25 -25
- package/dist/testing/host.js +1 -3
- package/dist/testing/hydrateTestApp.js +4 -3
- package/dist/testing/index.d.ts +2 -3
- package/dist/testing/index.js +1 -2
- package/dist/testing/pipeline/createTestPacketApp.d.ts +30 -0
- package/dist/testing/pipeline/createTestPacketApp.js +45 -0
- package/dist/testing/pipeline/createTestPipelineApp.d.ts +70 -0
- package/dist/testing/pipeline/createTestPipelineApp.js +90 -0
- package/dist/testing/pipeline/hostPipeline.d.ts +25 -0
- package/dist/testing/pipeline/hostPipeline.js +18 -0
- package/dist/testing/{hydrateTestPipelineApp.d.ts → pipeline/hydrateTestPipelineApp.d.ts} +6 -6
- package/dist/testing/{hydrateTestPipelineApp.js → pipeline/hydrateTestPipelineApp.js} +22 -19
- package/dist/testing/pipeline/index.d.ts +5 -0
- package/dist/testing/pipeline/index.js +4 -0
- package/dist/testing/pipeline/pipelineTestApp.d.ts +34 -0
- package/dist/testing/pipeline/pipelineTestApp.js +100 -0
- package/dist/testing/pipeline/testPipelineRoute.d.ts +2 -0
- package/dist/testing/pipeline/testPipelineRoute.js +1 -0
- package/dist/testing/resolveContent.d.ts +2 -0
- package/dist/testing/resolveContent.js +9 -1
- package/package.json +10 -5
- package/vendor/css-select.js +3383 -0
- package/vendor/manifest.json +4 -3
- package/dist/AnyComponent.d.ts.map +0 -1
- package/dist/AnyComponentType.d.ts.map +0 -1
- package/dist/AppResponse.d.ts.map +0 -1
- package/dist/AppTypeExtraction.d.ts.map +0 -1
- package/dist/AssignedStyle.d.ts.map +0 -1
- package/dist/Brands.d.ts.map +0 -1
- package/dist/CjsTypes.d.ts.map +0 -1
- package/dist/ComponentInstance.d.ts.map +0 -1
- package/dist/ComponentRenderInfo.type.d.ts.map +0 -1
- package/dist/ComponentStyle.d.ts.map +0 -1
- package/dist/Components.d.ts.map +0 -1
- package/dist/ContentFunction.d.ts.map +0 -1
- package/dist/ContentNode.d.ts.map +0 -1
- package/dist/ContentNodeNew.d.ts.map +0 -1
- package/dist/CssNames.d.ts.map +0 -1
- package/dist/DomNodes.d.ts.map +0 -1
- package/dist/DomPointer.d.ts.map +0 -1
- package/dist/DomRegion.d.ts.map +0 -1
- package/dist/ExtendableHTMLElement.d.ts.map +0 -1
- package/dist/Framework.d.ts.map +0 -1
- package/dist/FrameworkConfig.d.ts.map +0 -1
- package/dist/FunctionComponent.d.ts.map +0 -1
- package/dist/FunctionComponentStandIn.d.ts.map +0 -1
- package/dist/GenericObject.type.d.ts.map +0 -1
- package/dist/HtmlElementAttributes.d.ts.map +0 -1
- package/dist/Instance/ClientRuntimeContext.d.ts.map +0 -1
- package/dist/Instance/Instance.d.ts.map +0 -1
- package/dist/Instance/InstanceConfig.d.ts.map +0 -1
- package/dist/IsDefined.d.ts.map +0 -1
- package/dist/IsIndexableObject.d.ts.map +0 -1
- package/dist/IsNumber.d.ts.map +0 -1
- package/dist/IsObject.d.ts.map +0 -1
- package/dist/Json.type.d.ts.map +0 -1
- package/dist/JsxContent.d.ts.map +0 -1
- package/dist/Key.d.ts.map +0 -1
- package/dist/KeyAttr.d.ts.map +0 -1
- package/dist/MapObject.d.ts.map +0 -1
- package/dist/Mode.d.ts.map +0 -1
- package/dist/Module.d.ts.map +0 -1
- package/dist/NoDeproxy.d.ts.map +0 -1
- package/dist/PopMessage.type.d.ts.map +0 -1
- package/dist/ProcessedStylesObject.d.ts.map +0 -1
- package/dist/RenderFunction.d.ts.map +0 -1
- package/dist/RenderedContentNode.d.ts.map +0 -1
- package/dist/RenderingNode.d.ts.map +0 -1
- package/dist/ReqRes.d.ts.map +0 -1
- package/dist/Sass.d.ts.map +0 -1
- package/dist/Script.d.ts.map +0 -1
- package/dist/ServerRpcFunction.type.d.ts.map +0 -1
- package/dist/Servers/DevServer.d.ts.map +0 -1
- package/dist/Servers/ProdServer.d.ts.map +0 -1
- package/dist/Servers/ServerMiddleware.d.ts.map +0 -1
- package/dist/Servers/StaticSiteServer.d.ts.map +0 -1
- package/dist/Servers/TungstenServer.d.ts.map +0 -1
- package/dist/Servers/cacheVersioned.d.ts.map +0 -1
- package/dist/Servers/devErrorPageAutoRetry.d.ts.map +0 -1
- package/dist/Servers/initStores.d.ts.map +0 -1
- package/dist/Servers/listenVerified.d.ts.map +0 -1
- package/dist/Servers/loadEnvsDev.d.ts.map +0 -1
- package/dist/Servers/portError.d.ts.map +0 -1
- package/dist/Servers/resetRegistrations.d.ts.map +0 -1
- package/dist/Servers/routing.d.ts.map +0 -1
- package/dist/Servers/serveStatic.d.ts.map +0 -1
- package/dist/Servers/tungstenCorePrivateEnvSchema.d.ts.map +0 -1
- package/dist/Servers/tungstenCorePublicEnvSchema.d.ts.map +0 -1
- package/dist/Store/BaseStoreSchema.d.ts.map +0 -1
- package/dist/Store/InternalStoreSchema.d.ts.map +0 -1
- package/dist/Store/ServerDataLoading.d.ts.map +0 -1
- package/dist/Store/Store.d.ts.map +0 -1
- package/dist/Store/StoreProxyInterface.d.ts.map +0 -1
- package/dist/Store/StoreSchemaClass.d.ts.map +0 -1
- package/dist/Store/StoreSubscriptions.types.d.ts.map +0 -1
- package/dist/Store/TypeSafeStore.d.ts.map +0 -1
- package/dist/Store/createStores.d.ts.map +0 -1
- package/dist/Store/exportStore.d.ts.map +0 -1
- package/dist/Store/getInternalStore.d.ts.map +0 -1
- package/dist/Store/getStore.d.ts.map +0 -1
- package/dist/Store/makeStore.d.ts.map +0 -1
- package/dist/Store/registerStore.d.ts.map +0 -1
- package/dist/Store/storeCreators.d.ts.map +0 -1
- package/dist/StoreBindVariable.d.ts.map +0 -1
- package/dist/StyleProcessor.d.ts.map +0 -1
- package/dist/TElement.d.ts.map +0 -1
- package/dist/TungstenApp.d.ts.map +0 -1
- package/dist/TungstenAppOld.d.ts.map +0 -1
- package/dist/TungstenElement.d.ts.map +0 -1
- package/dist/TungstenError.d.ts.map +0 -1
- package/dist/TungstenStyleObject.d.ts.map +0 -1
- package/dist/__deproxy.d.ts.map +0 -1
- package/dist/_client/RootComponent.d.ts.map +0 -1
- package/dist/_client/cjsHelpers.d.ts.map +0 -1
- package/dist/_client/client.d.ts.map +0 -1
- package/dist/_client/hmr.d.ts.map +0 -1
- package/dist/_client/liveReload.d.ts.map +0 -1
- package/dist/_client/liveReloadSource.d.ts.map +0 -1
- package/dist/_client/rootComponentRelFilePath.d.ts.map +0 -1
- package/dist/_client/routes.d.ts.map +0 -1
- package/dist/_testing/regexEquals.d.ts.map +0 -1
- package/dist/_testing/should.d.ts.map +0 -1
- package/dist/_testing/sxy-test-runner.types.d.ts.map +0 -1
- package/dist/alive.d.ts.map +0 -1
- package/dist/api/ApiEndpoint.d.ts.map +0 -1
- package/dist/api/ApiMethod.type.d.ts.map +0 -1
- package/dist/api/ApiRoute.d.ts.map +0 -1
- package/dist/api/ApiRoutes.d.ts.map +0 -1
- package/dist/api/Request.d.ts.map +0 -1
- package/dist/api/Response.d.ts.map +0 -1
- package/dist/api/getApiRoutes.d.ts.map +0 -1
- package/dist/api/getExport.d.ts.map +0 -1
- package/dist/api/getExportDev.d.ts.map +0 -1
- package/dist/appBuilder.d.ts.map +0 -1
- package/dist/appBuilder.types.test.d.ts +0 -110
- package/dist/appBuilder.types.test.d.ts.map +0 -1
- package/dist/appBuilder.types.test.js +0 -240
- package/dist/appOutput.d.ts.map +0 -1
- package/dist/assert.d.ts.map +0 -1
- package/dist/auth/checkPassword.d.ts.map +0 -1
- package/dist/auth/hashPassword.d.ts.map +0 -1
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/babelPlugins/BabelAddDevCacheBust.d.ts.map +0 -1
- package/dist/babelPlugins/BabelExtractComponentStylesheet.d.ts.map +0 -1
- package/dist/babelPlugins/BabelFakeType.d.ts.map +0 -1
- package/dist/babelPlugins/BabelState.type.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformBindDirect.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformBindVar.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformCjsToEsm.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformCjsToFunction.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformCjsToFunction2.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformComponentState.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformComponentStyles.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformCssImports.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformDependencyImportsOld.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformDeproxyState.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformDocInit.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformJsxExtensionsToJs.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformJsxSignals.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformPackageImports.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformReactive.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformReactiveSvelteStyle.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformRemoveBlocks.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformRemoveDevBlocks.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformRemoveServerBlocks.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformRemoveServerCode.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformSxyFrameworkImports.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformSxyJsx.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTransformUniqueComponents.d.ts.map +0 -1
- package/dist/babelPlugins/BabelTypes.d.ts.map +0 -1
- package/dist/babelPlugins/fixImportsInSassErrorMessage.d.ts.map +0 -1
- package/dist/babelPlugins/isBareImport.d.ts.map +0 -1
- package/dist/babelPlugins/test.d.ts.map +0 -1
- package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.d.ts.map +0 -1
- package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.d.ts.map +0 -1
- package/dist/babelPlugins/transformPackageImports/getWebLocationOfPackageFile.d.ts.map +0 -1
- package/dist/babelPlugins/transformPackageImports/resolveBareImport.d.ts.map +0 -1
- package/dist/bin/args.d.ts.map +0 -1
- package/dist/bin/commands/build.d.ts.map +0 -1
- package/dist/bin/commands/buildHelp.d.ts.map +0 -1
- package/dist/bin/commands/clean.d.ts.map +0 -1
- package/dist/bin/commands/compile.d.ts.map +0 -1
- package/dist/bin/commands/compileSimplePackage.d.ts.map +0 -1
- package/dist/bin/commands/dev.d.ts.map +0 -1
- package/dist/bin/commands/devmon.d.ts.map +0 -1
- package/dist/bin/commands/help.d.ts.map +0 -1
- package/dist/bin/commands/speed.d.ts.map +0 -1
- package/dist/bin/commands/start.d.ts.map +0 -1
- package/dist/bin/commands/static.d.ts.map +0 -1
- package/dist/bin/index.d.ts.map +0 -1
- package/dist/bin/moduleLoadAnalysis.d.ts.map +0 -1
- package/dist/bin/vendorHook.d.ts.map +0 -1
- package/dist/booleanAttributeValue.d.ts.map +0 -1
- package/dist/browserStorage.d.ts.map +0 -1
- package/dist/build/BabelConfig.d.ts.map +0 -1
- package/dist/build/CompilationInfo.d.ts.map +0 -1
- package/dist/build/CompilationInfoFailure.d.ts.map +0 -1
- package/dist/build/CompilationInfoSuccess.d.ts.map +0 -1
- package/dist/build/Event.type.d.ts.map +0 -1
- package/dist/build/ImportAliases.d.ts.map +0 -1
- package/dist/build/PackageList.d.ts.map +0 -1
- package/dist/build/PackagesCacheInfo.d.ts.map +0 -1
- package/dist/build/ProcessPackageResult.d.ts.map +0 -1
- package/dist/build/ProcessPackageResults.d.ts.map +0 -1
- package/dist/build/PromiseSettledResultIsPromiseRejectedResult.d.ts.map +0 -1
- package/dist/build/assetVersions.d.ts.map +0 -1
- package/dist/build/babel.user.common.config.d.ts.map +0 -1
- package/dist/build/bundle.d.ts.map +0 -1
- package/dist/build/bundleBabelOptions.d.ts.map +0 -1
- package/dist/build/clientModuleAliases.d.ts.map +0 -1
- package/dist/build/clientRoutesFile.d.ts.map +0 -1
- package/dist/build/combineComponentCss.d.ts.map +0 -1
- package/dist/build/compileJavascript.d.ts.map +0 -1
- package/dist/build/compileStyles.d.ts.map +0 -1
- package/dist/build/compileUserApp.d.ts.map +0 -1
- package/dist/build/componentStylesCache.d.ts.map +0 -1
- package/dist/build/copyAssets.d.ts.map +0 -1
- package/dist/build/copyPackageModulesToPackagesFolder.d.ts.map +0 -1
- package/dist/build/copyPublicFiles.d.ts.map +0 -1
- package/dist/build/createClientFiles.d.ts.map +0 -1
- package/dist/build/createInstanceConfigFile.d.ts.map +0 -1
- package/dist/build/createPackageVirtualFileSystem.d.ts.map +0 -1
- package/dist/build/createPackageVirtualFileSystems.d.ts.map +0 -1
- package/dist/build/customImportAliases.d.ts.map +0 -1
- package/dist/build/customPackageEntryPoints.d.ts.map +0 -1
- package/dist/build/devBundle.d.ts.map +0 -1
- package/dist/build/devBundle.rollup.config.d.ts.map +0 -1
- package/dist/build/findRequiredUserModules.d.ts.map +0 -1
- package/dist/build/frameworkDestLocation.d.ts.map +0 -1
- package/dist/build/frameworkStylesheets.d.ts.map +0 -1
- package/dist/build/getAllSxyClientModules.d.ts.map +0 -1
- package/dist/build/getPackageDirForFile.d.ts.map +0 -1
- package/dist/build/getSxyClientPackageAliases.d.ts.map +0 -1
- package/dist/build/getTempDirForAppCompilation.d.ts.map +0 -1
- package/dist/build/internalAliases.d.ts.map +0 -1
- package/dist/build/makeBabelRawConfig.d.ts.map +0 -1
- package/dist/build/makeBabelUserDevConfig.d.ts.map +0 -1
- package/dist/build/makeBabelUserProdConfig.d.ts.map +0 -1
- package/dist/build/makeEnvJavascriptContent.d.ts.map +0 -1
- package/dist/build/modifySassImports.d.ts.map +0 -1
- package/dist/build/packageIdentifier.d.ts.map +0 -1
- package/dist/build/processDataToLines.d.ts.map +0 -1
- package/dist/build/resolveSassScssImports.d.ts.map +0 -1
- package/dist/build/rollup.user.prod.config.d.ts.map +0 -1
- package/dist/build/rollupExtractComponentStylesheets.d.ts.map +0 -1
- package/dist/build/rollupProdConstants.d.ts.map +0 -1
- package/dist/build/sassImportParser.d.ts.map +0 -1
- package/dist/build/scssImportParserChatgpt.d.ts.map +0 -1
- package/dist/build/tallyBabel.d.ts.map +0 -1
- package/dist/cacheControl.d.ts.map +0 -1
- package/dist/calculateImportedStaticFileLocations.d.ts.map +0 -1
- package/dist/calledFrom.d.ts.map +0 -1
- package/dist/checkedAttributeToBoolean.d.ts.map +0 -1
- package/dist/checkedValueToBoolean.d.ts.map +0 -1
- package/dist/cliOutput.d.ts.map +0 -1
- package/dist/clone.d.ts.map +0 -1
- package/dist/compat/context.d.ts.map +0 -1
- package/dist/compat/forwardRef.d.ts.map +0 -1
- package/dist/compat/index.d.ts.map +0 -1
- package/dist/compat/propTypes.d.ts.map +0 -1
- package/dist/compat/toTungstenClassComponent.d.ts.map +0 -1
- package/dist/compat/toTungstenFunctionComponent.d.ts.map +0 -1
- package/dist/compat/types.d.ts.map +0 -1
- package/dist/componentClassName.d.ts.map +0 -1
- package/dist/componentHelpers.d.ts.map +0 -1
- package/dist/componentProxyHandlers.d.ts.map +0 -1
- package/dist/componentType.d.ts.map +0 -1
- package/dist/components/Await.d.ts.map +0 -1
- package/dist/components/Fragment.d.ts.map +0 -1
- package/dist/components/GoToComponent.d.ts.map +0 -1
- package/dist/components/Lazy.d.ts.map +0 -1
- package/dist/components/Link.d.ts.map +0 -1
- package/dist/components/NativeHtml.d.ts.map +0 -1
- package/dist/components/NoEscape.d.ts.map +0 -1
- package/dist/components/PopMessages.d.ts.map +0 -1
- package/dist/components/Protected.d.ts.map +0 -1
- package/dist/components/RawHtml.d.ts.map +0 -1
- package/dist/components/RouteRedirectComponent.d.ts.map +0 -1
- package/dist/components/Stylesheet.d.ts.map +0 -1
- package/dist/components/WebRedirectComponent.d.ts.map +0 -1
- package/dist/components/_GoToComponent.d.ts.map +0 -1
- package/dist/components/bindable/BindMode.d.ts.map +0 -1
- package/dist/components/bindable/BindVariable.d.ts.map +0 -1
- package/dist/components/bindable/BindableCheckbox.d.ts.map +0 -1
- package/dist/components/bindable/BindableInput.d.ts.map +0 -1
- package/dist/components/bindable/BindableInputNonString.d.ts.map +0 -1
- package/dist/components/bindable/BindableInputString.d.ts.map +0 -1
- package/dist/components/bindable/BindableInputTyped.d.ts.map +0 -1
- package/dist/components/bindable/BindableInputTypedLegacy.d.ts.map +0 -1
- package/dist/components/bindable/BindableRadio.d.ts.map +0 -1
- package/dist/components/bindable/BindableSelect.d.ts.map +0 -1
- package/dist/components/bindable/BindableSelectNaive.d.ts.map +0 -1
- package/dist/components/bindable/BindableTextarea.d.ts.map +0 -1
- package/dist/components/bindable/bindableCandidates.comparison.d.ts.map +0 -1
- package/dist/components/bindable/bindableHtmlElements.d.ts.map +0 -1
- package/dist/components/bindable/bindableProps.types.test.d.ts +0 -50
- package/dist/components/bindable/bindableProps.types.test.d.ts.map +0 -1
- package/dist/components/bindable/bindableProps.types.test.js +0 -252
- package/dist/components/library/RichTextEditor/RichTextEditor.d.ts.map +0 -1
- package/dist/components/library/RichTextEditor/StoredContentNode.d.ts.map +0 -1
- package/dist/components/library/RichTextEditor/activeFormats.d.ts.map +0 -1
- package/dist/components/library/RichTextEditor/contentTree.d.ts.map +0 -1
- package/dist/components/library/RichTextEditor/sanitizeAuthoredHtml.d.ts.map +0 -1
- package/dist/components/library/__StatefulMessage/MessageData.d.ts.map +0 -1
- package/dist/components/library/__StatefulMessage/StatefulMessage.d.ts.map +0 -1
- package/dist/components/library/index.d.ts.map +0 -1
- package/dist/components/makeTypedLink.d.ts.map +0 -1
- package/dist/concat.d.ts.map +0 -1
- package/dist/contentNodeSymbols.d.ts.map +0 -1
- package/dist/context/registerContext.d.ts.map +0 -1
- package/dist/copy.d.ts.map +0 -1
- package/dist/createElement.d.ts.map +0 -1
- package/dist/createRef.d.ts.map +0 -1
- package/dist/createRoutes.d.ts.map +0 -1
- package/dist/defaultConfig.d.ts.map +0 -1
- package/dist/deleteDirs.d.ts.map +0 -1
- package/dist/devBanner.d.ts.map +0 -1
- package/dist/docInit.d.ts.map +0 -1
- package/dist/domNodeChecks.d.ts.map +0 -1
- package/dist/env/Env.d.ts.map +0 -1
- package/dist/env/Interfaces.d.ts.map +0 -1
- package/dist/env/addToEnv.d.ts.map +0 -1
- package/dist/env/droppedCoreEnvKeys.d.ts.map +0 -1
- package/dist/env/funcs.d.ts.map +0 -1
- package/dist/env/getEnvSchemas.d.ts.map +0 -1
- package/dist/env/index.d.ts.map +0 -1
- package/dist/env/privateEnv.d.ts.map +0 -1
- package/dist/env/privateEnvOrThrow.d.ts.map +0 -1
- package/dist/env/publicEnv.d.ts.map +0 -1
- package/dist/env/publicEnvOrThrow.d.ts.map +0 -1
- package/dist/env/registerEnvSchemas.d.ts.map +0 -1
- package/dist/env/setPrivateEnvValidator.d.ts.map +0 -1
- package/dist/env/setPublicEnvValidator.d.ts.map +0 -1
- package/dist/env/test.d.ts.map +0 -1
- package/dist/env/types.d.ts.map +0 -1
- package/dist/env/windowGlobalEnvStatement.d.ts.map +0 -1
- package/dist/experiments.d.ts.map +0 -1
- package/dist/filePathFromUrl.d.ts.map +0 -1
- package/dist/fileVersions.d.ts.map +0 -1
- package/dist/findPackageDotJson.d.ts.map +0 -1
- package/dist/findProjectDir.d.ts.map +0 -1
- package/dist/findUserConfig.d.ts.map +0 -1
- package/dist/fixExtension.d.ts.map +0 -1
- package/dist/foreach.d.ts.map +0 -1
- package/dist/frameworkConfigSchema.d.ts.map +0 -1
- package/dist/getArrowFunctionBody.d.ts.map +0 -1
- package/dist/getComponent.d.ts.map +0 -1
- package/dist/getComponentDev.d.ts.map +0 -1
- package/dist/getConfig.d.ts.map +0 -1
- package/dist/getContentFromFunctionComponent.d.ts.map +0 -1
- package/dist/getFrameworkDir.d.ts.map +0 -1
- package/dist/getRoutes.d.ts.map +0 -1
- package/dist/getRoutesDevs.d.ts.map +0 -1
- package/dist/getStackTrace.d.ts.map +0 -1
- package/dist/getStyledContentFromFunctionComponent.d.ts.map +0 -1
- package/dist/getUserConfig.d.ts.map +0 -1
- package/dist/glob.d.ts.map +0 -1
- package/dist/globals.d.ts.map +0 -1
- package/dist/goto.d.ts.map +0 -1
- package/dist/hasDomain.d.ts.map +0 -1
- package/dist/hasValidKey.d.ts.map +0 -1
- package/dist/headChildren.d.ts.map +0 -1
- package/dist/helpers/combineClassNames.d.ts.map +0 -1
- package/dist/helpers/forwardingFetch.d.ts.map +0 -1
- package/dist/helpers/getFetchCompatibleHeaders.d.ts.map +0 -1
- package/dist/helpers/index.d.ts.map +0 -1
- package/dist/helpers/perRequest.d.ts.map +0 -1
- package/dist/hmr/applyHmrModule.d.ts.map +0 -1
- package/dist/hmr/componentIdentity.d.ts.map +0 -1
- package/dist/hmr/instanceRegistry.d.ts.map +0 -1
- package/dist/hmr/liveReloadHub.d.ts.map +0 -1
- package/dist/hmr/refreshStylesheets.d.ts.map +0 -1
- package/dist/hooks/clearCurrentComponent.d.ts.map +0 -1
- package/dist/hooks/getCurrentComponent.d.ts.map +0 -1
- package/dist/hooks/globalObj.d.ts.map +0 -1
- package/dist/hooks/globalType.d.ts.map +0 -1
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/setCurrentComponent.d.ts.map +0 -1
- package/dist/hooks/shallowCompare.d.ts.map +0 -1
- package/dist/hooks/useCallback.d.ts.map +0 -1
- package/dist/hooks/useContext.d.ts.map +0 -1
- package/dist/hooks/useEffect.d.ts.map +0 -1
- package/dist/hooks/useInstance.d.ts.map +0 -1
- package/dist/hooks/useMemo.d.ts.map +0 -1
- package/dist/hooks/useReducer.d.ts.map +0 -1
- package/dist/hooks/useRef.d.ts.map +0 -1
- package/dist/hooks/useState.d.ts.map +0 -1
- package/dist/htmlEntities.d.ts.map +0 -1
- package/dist/htmlEventHandlerKey.d.ts.map +0 -1
- package/dist/htmlEvents.d.ts.map +0 -1
- package/dist/hydrate/hydrate.d.ts.map +0 -1
- package/dist/hydrate/hydrateGlobalData.d.ts.map +0 -1
- package/dist/hydrate/reconcileHydratedAttributes.d.ts.map +0 -1
- package/dist/hydrate/renderHydrationMismatchBanner.d.ts.map +0 -1
- package/dist/importDevModuleWithRetry.d.ts.map +0 -1
- package/dist/importModule.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/indexInner.d.ts.map +0 -1
- package/dist/info.d.ts.map +0 -1
- package/dist/innerHtmlFromProps.d.ts.map +0 -1
- package/dist/isBrowser.d.ts.map +0 -1
- package/dist/isClient.d.ts.map +0 -1
- package/dist/isDev.d.ts.map +0 -1
- package/dist/isProd.d.ts.map +0 -1
- package/dist/isServer.d.ts.map +0 -1
- package/dist/iterationQueryString.d.ts.map +0 -1
- package/dist/json.d.ts.map +0 -1
- package/dist/jsx-runtime.d.ts.map +0 -1
- package/dist/jsxHelpers.d.ts.map +0 -1
- package/dist/jsxRuntime.d.ts.map +0 -1
- package/dist/jsxRuntimeSignals.d.ts.map +0 -1
- package/dist/loadPackageDotJsonFromDir.d.ts.map +0 -1
- package/dist/logAndReturn.d.ts.map +0 -1
- package/dist/makeFinalConfig.d.ts.map +0 -1
- package/dist/makeInstanceConfigFromFrameworkConfig.d.ts.map +0 -1
- package/dist/makeServerRpc.d.ts.map +0 -1
- package/dist/markOptionSelected.d.ts.map +0 -1
- package/dist/mergeConfigs.d.ts.map +0 -1
- package/dist/moduleReloader.d.ts.map +0 -1
- package/dist/mutatingFunctions.d.ts.map +0 -1
- package/dist/nbsp.d.ts.map +0 -1
- package/dist/objectMap.d.ts.map +0 -1
- package/dist/objectTypesToCopy.d.ts.map +0 -1
- package/dist/objectTypesToProxy.d.ts.map +0 -1
- package/dist/output.d.ts.map +0 -1
- package/dist/packageSettings.d.ts.map +0 -1
- package/dist/pipeLog.d.ts.map +0 -1
- package/dist/pipeline/PipelineRequestHandler.d.ts.map +0 -1
- package/dist/pipeline/contextStore.d.ts.map +0 -1
- package/dist/pipeline/hydratePipeline.d.ts.map +0 -1
- package/dist/pipeline/importRoutesModule.d.ts.map +0 -1
- package/dist/pipeline/networkedTransport.d.ts.map +0 -1
- package/dist/pipeline/pipeline.d.ts.map +0 -1
- package/dist/pipeline/pipeline.types.test.d.ts +0 -650
- package/dist/pipeline/pipeline.types.test.d.ts.map +0 -1
- package/dist/pipeline/pipeline.types.test.js +0 -342
- package/dist/pipeline/pipelineDefinition.d.ts.map +0 -1
- package/dist/pipeline/pipelineSplit.types.test.d.ts +0 -1971
- package/dist/pipeline/pipelineSplit.types.test.d.ts.map +0 -1
- package/dist/pipeline/pipelineSplit.types.test.js +0 -440
- package/dist/pipeline/runPipeline.d.ts.map +0 -1
- package/dist/pipeline/runSplitPipeline.d.ts.map +0 -1
- package/dist/pipeline/splitPipeline.d.ts.map +0 -1
- package/dist/pop.d.ts.map +0 -1
- package/dist/possibleEnvFiles.d.ts.map +0 -1
- package/dist/postcssPlugins/TransformCssNames.d.ts.map +0 -1
- package/dist/postcssPlugins/parseSelectors.d.ts.map +0 -1
- package/dist/postcssPlugins/parseSelectorsRich.d.ts.map +0 -1
- package/dist/postcssPlugins/scopeAnimationValue.d.ts.map +0 -1
- package/dist/postcssPlugins/splitCssValue.d.ts.map +0 -1
- package/dist/postcssPlugins/unwrapIgnoreMarker.d.ts.map +0 -1
- package/dist/promise.d.ts.map +0 -1
- package/dist/propsAreEqual.d.ts.map +0 -1
- package/dist/rawHtml/HtmlAllowList.d.ts.map +0 -1
- package/dist/rawHtml/decodeHtmlEntities.d.ts.map +0 -1
- package/dist/rawHtml/filterContentNode.d.ts.map +0 -1
- package/dist/rawHtml/htmlParsingTags.d.ts.map +0 -1
- package/dist/rawHtml/parseHtml.d.ts.map +0 -1
- package/dist/rawHtml/safeHtmlAllowList.d.ts.map +0 -1
- package/dist/rawHtml/sanitizeHtml.d.ts.map +0 -1
- package/dist/rawHtml/tokenizeHtml.d.ts.map +0 -1
- package/dist/reRouting/addRequireResolveHooks.d.ts.map +0 -1
- package/dist/reRouting/importLoader.d.ts.map +0 -1
- package/dist/ref.d.ts.map +0 -1
- package/dist/regexEscape.d.ts.map +0 -1
- package/dist/removeRecursive.d.ts.map +0 -1
- package/dist/render/HeadData.d.ts.map +0 -1
- package/dist/render/SxyFrameworkModule.d.ts.map +0 -1
- package/dist/render/SxyFrameworkModules.d.ts.map +0 -1
- package/dist/render/addImportMap.d.ts.map +0 -1
- package/dist/render/classComponentNodeToRenderingTree.d.ts.map +0 -1
- package/dist/render/componentNodeToRenderingTree.d.ts.map +0 -1
- package/dist/render/contentNodeToHtml.d.ts.map +0 -1
- package/dist/render/contentToHtml.d.ts.map +0 -1
- package/dist/render/contentToHtmlDev.d.ts.map +0 -1
- package/dist/render/contentTreeToRenderingTree.d.ts.map +0 -1
- package/dist/render/debug.d.ts.map +0 -1
- package/dist/render/functionComponentNodeToRenderingTree.d.ts.map +0 -1
- package/dist/render/getFunctionBodyAsString.d.ts.map +0 -1
- package/dist/render/htmlMonoTags.d.ts.map +0 -1
- package/dist/render/htmlNoSelfCloseTags.d.ts.map +0 -1
- package/dist/render/htmlSelfClosableTags.d.ts.map +0 -1
- package/dist/render/htmlSingleOnlyTags.d.ts.map +0 -1
- package/dist/render/htmlVoidTags.d.ts.map +0 -1
- package/dist/render/instantiateClassComponent.d.ts.map +0 -1
- package/dist/render/instantiateComponent.d.ts.map +0 -1
- package/dist/render/instantiateFunctionComponent.d.ts.map +0 -1
- package/dist/render/printComponentNameInSource.d.ts.map +0 -1
- package/dist/render/processBody.d.ts.map +0 -1
- package/dist/render/processHead.d.ts.map +0 -1
- package/dist/render/processHtmlNode.d.ts.map +0 -1
- package/dist/render/processProps.d.ts.map +0 -1
- package/dist/render/processRenderingNodeHtml.d.ts.map +0 -1
- package/dist/render/readDocInitScript.d.ts.map +0 -1
- package/dist/render/renderingTreeToHtml.d.ts.map +0 -1
- package/dist/render/rootToHtml.d.ts.map +0 -1
- package/dist/render/rootToHtmlDev.d.ts.map +0 -1
- package/dist/requests/axios/get.d.ts.map +0 -1
- package/dist/requests/axios/post.d.ts.map +0 -1
- package/dist/requests/fetch/FetchExtras.d.ts.map +0 -1
- package/dist/requests/fetch/_fetchPromise.d.ts.map +0 -1
- package/dist/requests/fetch/delete.d.ts.map +0 -1
- package/dist/requests/fetch/get.d.ts.map +0 -1
- package/dist/requests/fetch/mergeFetchInit.d.ts.map +0 -1
- package/dist/requests/fetch/paramsObjectToParamsString.d.ts.map +0 -1
- package/dist/requests/fetch/patch.d.ts.map +0 -1
- package/dist/requests/fetch/post.d.ts.map +0 -1
- package/dist/requests/fetch/put.d.ts.map +0 -1
- package/dist/requests/index.d.ts.map +0 -1
- package/dist/routesLocationParts.d.ts.map +0 -1
- package/dist/routing/AppRoutes.d.ts.map +0 -1
- package/dist/routing/Default404.d.ts.map +0 -1
- package/dist/routing/ErrorRouteType.d.ts.map +0 -1
- package/dist/routing/Group.d.ts.map +0 -1
- package/dist/routing/Match.type.d.ts.map +0 -1
- package/dist/routing/MatchedRoute.d.ts.map +0 -1
- package/dist/routing/MatchedRouteInfo.d.ts.map +0 -1
- package/dist/routing/Params.d.ts.map +0 -1
- package/dist/routing/ParamsFromPath.d.ts.map +0 -1
- package/dist/routing/RedirectCode.d.ts.map +0 -1
- package/dist/routing/Route.d.ts.map +0 -1
- package/dist/routing/RouteContent.d.ts.map +0 -1
- package/dist/routing/RouteContentFunction.d.ts.map +0 -1
- package/dist/routing/RouteData.d.ts.map +0 -1
- package/dist/routing/RouteDataFunction.type.d.ts.map +0 -1
- package/dist/routing/RouteDataReturnType.d.ts.map +0 -1
- package/dist/routing/RouteParams.type.d.ts.map +0 -1
- package/dist/routing/RoutePaths.d.ts.map +0 -1
- package/dist/routing/RouteProp.d.ts.map +0 -1
- package/dist/routing/RouteType.d.ts.map +0 -1
- package/dist/routing/RouteTypes.d.ts.map +0 -1
- package/dist/routing/Router.d.ts.map +0 -1
- package/dist/routing/Routes.d.ts.map +0 -1
- package/dist/routing/RoutesFunction.d.ts.map +0 -1
- package/dist/routing/RoutesWithSafeParams.d.ts.map +0 -1
- package/dist/routing/RoutingRedirect.d.ts.map +0 -1
- package/dist/routing/Serializable.d.ts.map +0 -1
- package/dist/routing/TungstenErrorInfo.d.ts.map +0 -1
- package/dist/routing/WebRedirect.d.ts.map +0 -1
- package/dist/routing/builder.d.ts.map +0 -1
- package/dist/routing/builder.trial.d.ts.map +0 -1
- package/dist/routing/compareRequestToRegex.d.ts.map +0 -1
- package/dist/routing/debug.d.ts.map +0 -1
- package/dist/routing/defineRoutes.d.ts.map +0 -1
- package/dist/routing/getPathPriority.d.ts.map +0 -1
- package/dist/routing/matchPath.d.ts.map +0 -1
- package/dist/routing/patternToRegex.d.ts.map +0 -1
- package/dist/routing/pyramidRouting.d.ts.map +0 -1
- package/dist/routing/registerGlobalData.d.ts.map +0 -1
- package/dist/routing/registerParts.types.test.d.ts +0 -2
- package/dist/routing/registerParts.types.test.d.ts.map +0 -1
- package/dist/routing/registerParts.types.test.js +0 -139
- package/dist/routing/registerRoutes.d.ts.map +0 -1
- package/dist/routing/registerRouting.d.ts.map +0 -1
- package/dist/routing/registerRouting.types.test.d.ts +0 -80
- package/dist/routing/registerRouting.types.test.d.ts.map +0 -1
- package/dist/routing/registerRouting.types.test.js +0 -120
- package/dist/routing/registrationTypes.d.ts.map +0 -1
- package/dist/routing/resolveAppRoutes.d.ts.map +0 -1
- package/dist/routing/routeSymbols.d.ts.map +0 -1
- package/dist/routing/routeUrl.d.ts.map +0 -1
- package/dist/routing/routesArray.d.ts.map +0 -1
- package/dist/routing/routesArray.types.test.d.ts +0 -2
- package/dist/routing/routesArray.types.test.d.ts.map +0 -1
- package/dist/routing/routesArray.types.test.js +0 -132
- package/dist/routing/routingBuilder.d.ts.map +0 -1
- package/dist/routing/routingBuilder.types.test.d.ts +0 -2
- package/dist/routing/routingBuilder.types.test.d.ts.map +0 -1
- package/dist/routing/routingBuilder.types.test.js +0 -171
- package/dist/routing/routingRegistry.d.ts.map +0 -1
- package/dist/routing/runContentFunction.d.ts.map +0 -1
- package/dist/routing/splitRequest.d.ts.map +0 -1
- package/dist/run.d.ts.map +0 -1
- package/dist/server.d.ts.map +0 -1
- package/dist/serverModuleLocation.d.ts.map +0 -1
- package/dist/serverRpc.d.ts.map +0 -1
- package/dist/serverRpcs.d.ts.map +0 -1
- package/dist/settings.d.ts.map +0 -1
- package/dist/signals/tracking.d.ts.map +0 -1
- package/dist/slash.d.ts.map +0 -1
- package/dist/spawnShellCommand.d.ts.map +0 -1
- package/dist/standardSchema.d.ts.map +0 -1
- package/dist/standardizeWebPath.d.ts.map +0 -1
- package/dist/startDevServer.d.ts.map +0 -1
- package/dist/stateTracking.d.ts.map +0 -1
- package/dist/staticGen/RouteDefinition.d.ts.map +0 -1
- package/dist/staticGen/getAppRoutes.d.ts.map +0 -1
- package/dist/staticGen/staticGen.d.ts.map +0 -1
- package/dist/staticGen/staticGenFunctions.d.ts.map +0 -1
- package/dist/style/jssToCss.d.ts.map +0 -1
- package/dist/style/styleContent.d.ts.map +0 -1
- package/dist/style/styleContentReact.d.ts.map +0 -1
- package/dist/style/styleContentReactClassOrClassname.d.ts.map +0 -1
- package/dist/style/styleContentSxy.d.ts.map +0 -1
- package/dist/style/styleContentSxyClassOrClassname.d.ts.map +0 -1
- package/dist/style/styleElementContent.d.ts.map +0 -1
- package/dist/style/unusedStyles.d.ts.map +0 -1
- package/dist/styleProcessors.d.ts.map +0 -1
- package/dist/symbols.d.ts.map +0 -1
- package/dist/sync/index.d.ts.map +0 -1
- package/dist/syncServer/index.d.cts.map +0 -1
- package/dist/syncServer/preload.d.ts.map +0 -1
- package/dist/testing/createTestApp.d.ts.map +0 -1
- package/dist/testing/createTestPipelineApp.d.ts +0 -25
- package/dist/testing/createTestPipelineApp.d.ts.map +0 -1
- package/dist/testing/createTestPipelineApp.js +0 -153
- package/dist/testing/ensure.d.ts.map +0 -1
- package/dist/testing/ensure.trial.d.ts.map +0 -1
- package/dist/testing/helpers/contentHtmlElements.d.ts.map +0 -1
- package/dist/testing/host.d.ts.map +0 -1
- package/dist/testing/hostPipeline.d.ts +0 -157
- package/dist/testing/hostPipeline.d.ts.map +0 -1
- package/dist/testing/hostPipeline.js +0 -341
- package/dist/testing/hydrateTestApp.d.ts.map +0 -1
- package/dist/testing/hydrateTestPipelineApp.d.ts.map +0 -1
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/installTestDocInit.d.ts.map +0 -1
- package/dist/testing/installTestStyleProcessors.d.ts.map +0 -1
- package/dist/testing/loadEnv.d.ts.map +0 -1
- package/dist/testing/normalize.d.ts.map +0 -1
- package/dist/testing/resolveContent.d.ts.map +0 -1
- package/dist/testing/testEnvIsRequested.d.ts.map +0 -1
- package/dist/testing/testingComponentPackage.d.ts.map +0 -1
- package/dist/throwError.d.ts.map +0 -1
- package/dist/timeProfiler.d.ts.map +0 -1
- package/dist/todo.d.ts.map +0 -1
- package/dist/update/UpdateResult.d.ts.map +0 -1
- package/dist/update/UpdateScheduler.d.ts.map +0 -1
- package/dist/update/guardedUpdate.d.ts.map +0 -1
- package/dist/update/integrateUpdateVdom.d.ts.map +0 -1
- package/dist/update/integrateUpdateVdomPrebuild.d.ts.map +0 -1
- package/dist/update/pendingMounts.d.ts.map +0 -1
- package/dist/validChildren.d.ts.map +0 -1
- package/dist/warnOnFrameworkChange.d.ts.map +0 -1
- package/dist/watch.d.ts.map +0 -1
- package/dist/when.d.ts.map +0 -1
- package/dist/zones/react.d.ts.map +0 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { ContentNodeIsArray, ContentNodeIsElement, ContentNodeIsFragment, ContentNodeIsLiteral, IsContentNode } from '../ContentNode.js';
|
|
2
|
+
import { $fragment, $key, $props, $type } from '../contentNodeSymbols.js';
|
|
3
|
+
import { componentTypeIdentityKey } from '../hmr/componentIdentity.js';
|
|
4
|
+
import { display } from './display.js';
|
|
5
|
+
import { $passedChildren } from './resolveContent.js';
|
|
6
|
+
const indent = ' ';
|
|
7
|
+
const width = 100;
|
|
8
|
+
/**
|
|
9
|
+
* The tree as JSX. A component host() resolved has its output under it, marked ⤵, and the children
|
|
10
|
+
* it was passed as a prop; one unresolved holds its passed children, as written.
|
|
11
|
+
*/
|
|
12
|
+
export function contentToString(content, options = {}) {
|
|
13
|
+
const lines = contentLines(content, '', options);
|
|
14
|
+
if (lines.length > 0) return lines.join('\n');
|
|
15
|
+
// a tree that renders nothing says what it was: null and false are different returns
|
|
16
|
+
return ContentNodeIsFragment(content) ? '<></>' : `{${display(content)}}`;
|
|
17
|
+
}
|
|
18
|
+
// adjacent text is one line, as the page shows it: JSX splits `Hi, {name}.` into three
|
|
19
|
+
function contentLines(content, at, options) {
|
|
20
|
+
const lines = [];
|
|
21
|
+
let text;
|
|
22
|
+
for (const node of rendered(content, options)) {
|
|
23
|
+
if (ContentNodeIsLiteral(node)) text = (text ?? '') + String(node);else {
|
|
24
|
+
if (text !== undefined) lines.push(at + textLine(text));
|
|
25
|
+
text = undefined;
|
|
26
|
+
lines.push(...elementLines(node, at, options));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (text !== undefined) lines.push(at + textLine(text));
|
|
30
|
+
return lines;
|
|
31
|
+
}
|
|
32
|
+
// quoted where spaces at an edge, or no text at all, would not show
|
|
33
|
+
const textLine = text => text !== '' && text === text.trim() ? text : `{${display(text)}}`;
|
|
34
|
+
// arrays flattened, and fragments unless asked for, as neither renders anything of its own;
|
|
35
|
+
// null, undefined and booleans render nothing
|
|
36
|
+
function rendered(content, options) {
|
|
37
|
+
if (ContentNodeIsArray(content)) return content.flatMap(each => rendered(each, options));
|
|
38
|
+
if (ContentNodeIsFragment(content) && options.fragments !== true) {
|
|
39
|
+
return rendered(content[$props].children, options);
|
|
40
|
+
}
|
|
41
|
+
return ContentNodeIsLiteral(content) || ContentNodeIsElement(content) ? [content] : [];
|
|
42
|
+
}
|
|
43
|
+
function elementLines(node, at, options) {
|
|
44
|
+
const type = node[$type];
|
|
45
|
+
if (type === $fragment) {
|
|
46
|
+
const body = contentLines(node[$props].children, at + indent, options);
|
|
47
|
+
return body.length === 0 ? [`${at}<></>`] : [`${at}<>`, ...body, `${at}</>`];
|
|
48
|
+
}
|
|
49
|
+
const name = typeof type === 'string' ? type : componentTypeIdentityKey(type);
|
|
50
|
+
const {
|
|
51
|
+
children,
|
|
52
|
+
...props
|
|
53
|
+
} = node[$props];
|
|
54
|
+
const key = node[$key];
|
|
55
|
+
const attributes = [...(key === undefined || key === null ? [] : [attribute('key', key)]), ...Object.entries(props).map(([prop, value]) => attribute(prop, value))];
|
|
56
|
+
const resolved = $passedChildren in node;
|
|
57
|
+
const passed = resolved && IsContentNode(node[$passedChildren]) ? node[$passedChildren] : null;
|
|
58
|
+
const passedNodes = rendered(passed, options);
|
|
59
|
+
const passedLines = passedNodes.every(each => ContentNodeIsLiteral(each)) ? [] // none, or text, which is a prop like any other
|
|
60
|
+
: options.children === true ? elementsLines(passed, at + indent, options) : [];
|
|
61
|
+
if (passedNodes.length > 0 && passedLines.length === 0) {
|
|
62
|
+
attributes.push(options.children === true ? attribute('children', passedNodes.join('')) : 'children={...}');
|
|
63
|
+
}
|
|
64
|
+
const body = contentLines(children, at + indent, options);
|
|
65
|
+
const opened = end => passedLines.length === 0 ? tag(`<${name}`, attributes, end, at) : [...tag(`<${name}`, attributes, ' children={', at), ...passedLines, `${at}}${end}`];
|
|
66
|
+
if (body.length === 0) return opened(' />');
|
|
67
|
+
const close = `</${name}>`;
|
|
68
|
+
if (resolved) return [...opened('> ⤵'), ...body, at + close];
|
|
69
|
+
const text = rendered(children, options).every(each => ContentNodeIsLiteral(each));
|
|
70
|
+
const open = opened('>');
|
|
71
|
+
const inline = `${open.at(-1) ?? ''}${body[0]?.trim() ?? ''}${close}`;
|
|
72
|
+
if (text && body.length === 1 && inline.length <= width) return [...open.slice(0, -1), inline];
|
|
73
|
+
return [...open, ...body, at + close];
|
|
74
|
+
}
|
|
75
|
+
// passed children as one JSX expression: an element, or a fragment round several
|
|
76
|
+
function elementsLines(content, at, options) {
|
|
77
|
+
const [only, ...more] = rendered(content, options);
|
|
78
|
+
if (only !== undefined && more.length === 0 && !ContentNodeIsLiteral(only)) {
|
|
79
|
+
return elementLines(only, at, options);
|
|
80
|
+
}
|
|
81
|
+
return [`${at}<>`, ...contentLines(content, at + indent, options), `${at}</>`];
|
|
82
|
+
}
|
|
83
|
+
// an opening tag, its attributes wrapped to the width, each line after the first indented
|
|
84
|
+
function tag(start, attributes, end, at) {
|
|
85
|
+
const lines = [];
|
|
86
|
+
let line = at + start;
|
|
87
|
+
let empty = true; // nothing yet on this line to break after
|
|
88
|
+
attributes.forEach((each, i) => {
|
|
89
|
+
const after = i === attributes.length - 1 ? end : '';
|
|
90
|
+
if (!empty && `${line} ${each}${after}`.length > width) {
|
|
91
|
+
lines.push(line);
|
|
92
|
+
line = at + indent + each;
|
|
93
|
+
} else line += ` ${each}`;
|
|
94
|
+
empty = false;
|
|
95
|
+
});
|
|
96
|
+
return [...lines, line + end];
|
|
97
|
+
}
|
|
98
|
+
function attribute(name, value) {
|
|
99
|
+
if (typeof value === 'string') return `${name}=${display(value)}`;
|
|
100
|
+
// ƒ and the name, not source: an inline arrow takes its prop's name, a bound one 'bound x'
|
|
101
|
+
if (typeof value === 'function') {
|
|
102
|
+
return `${name}={ƒ${value.name === '' ? '' : ` ${value.name}`}}`;
|
|
103
|
+
}
|
|
104
|
+
return `${name}={${display(value)}}`;
|
|
105
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ContentNodeIsElement, IsContentNode } from '../ContentNode.js';
|
|
2
|
+
import { $fragment, $type } from '../contentNodeSymbols.js';
|
|
3
|
+
import { componentTypeIdentityKey } from '../hmr/componentIdentity.js';
|
|
4
|
+
const displayed = 5; // entries shown of an array or object
|
|
5
|
+
const displayDepth = 2;
|
|
6
|
+
// a value as a failure message shows it; arrays and objects shortened by length and depth
|
|
7
|
+
export function display(value, depth = 0) {
|
|
8
|
+
if (typeof value === 'string') return `'${value}'`;
|
|
9
|
+
if (typeof value === 'function') {
|
|
10
|
+
return value.name === '' ? '[function]' : `[function ${value.name}]`;
|
|
11
|
+
}
|
|
12
|
+
if (typeof value !== 'object' || value === null) {
|
|
13
|
+
return String(value); // a number, boolean, bigint, symbol, null or undefined
|
|
14
|
+
}
|
|
15
|
+
if (value instanceof Date) {
|
|
16
|
+
return isNaN(value.getTime()) ? 'Date(invalid)' : `Date(${value.toISOString()})`;
|
|
17
|
+
}
|
|
18
|
+
// an element held as a value, as in a prop: by tag or name, as its symbol keys hide it as data
|
|
19
|
+
if ($type in value && IsContentNode(value) && ContentNodeIsElement(value)) {
|
|
20
|
+
const type = value[$type];
|
|
21
|
+
if (type === $fragment) return '<>';
|
|
22
|
+
return `<${typeof type === 'string' ? type : componentTypeIdentityKey(type)}>`;
|
|
23
|
+
}
|
|
24
|
+
const shown = entries => depth >= displayDepth ? '…' : entries.slice(0, displayed).join(', ') + (entries.length > displayed ? ', …' : '');
|
|
25
|
+
if (Array.isArray(value)) {
|
|
26
|
+
return value.length === 0 ? '[]' : `[${shown(value.map(each => display(each, depth + 1)))}]`;
|
|
27
|
+
}
|
|
28
|
+
if (value instanceof Set) {
|
|
29
|
+
return `Set { ${shown([...value].map(each => display(each, depth + 1)))} }`;
|
|
30
|
+
}
|
|
31
|
+
if (value instanceof Map) {
|
|
32
|
+
const pairs = [...value].map(([key, each]) => `${display(key, depth + 1)} => ${display(each, depth + 1)}`);
|
|
33
|
+
return `Map { ${shown(pairs)} }`;
|
|
34
|
+
}
|
|
35
|
+
const entries = Object.entries(value).map(([key, each]) => `${key}: ${display(each, depth + 1)}`);
|
|
36
|
+
return entries.length === 0 ? '{}' : `{ ${shown(entries)} }`;
|
|
37
|
+
}
|
package/dist/testing/ensure.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ContentNode } from '../ContentNode.js';
|
|
2
|
-
type Kind = 'text' | 'interruptedText' | ElementKind | 'fragment' | 'className' | 'id' | 'children' | `prop:${string}
|
|
3
|
-
type ElementKind = `html:${string}` | `component:${string}
|
|
2
|
+
type Kind = 'text' | 'interruptedText' | ElementKind | 'fragment' | 'className' | 'id' | 'children' | `prop:${string}` | 'elements';
|
|
3
|
+
type ElementKind = `html:${string}` | `component:${string}` | SelectKind;
|
|
4
|
+
type SelectKind = `select:${string}`;
|
|
4
5
|
type Test = (seen: unknown) => boolean;
|
|
5
6
|
type Failure = {
|
|
6
7
|
actual: unknown;
|
|
@@ -39,51 +40,60 @@ type Props = Record<string, unknown> & {
|
|
|
39
40
|
children?: ContentNode;
|
|
40
41
|
};
|
|
41
42
|
type WithFn = (props: Props) => boolean;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
readonly
|
|
45
|
-
readonly one: Ends;
|
|
46
|
-
readonly two: Ends;
|
|
47
|
-
readonly three: Ends;
|
|
48
|
-
readonly count: (num: number) => Ends;
|
|
49
|
-
readonly a: Ends;
|
|
50
|
-
readonly an: Ends;
|
|
51
|
-
readonly some: Ends;
|
|
52
|
-
readonly all: Ends;
|
|
43
|
+
declare const property: unique symbol;
|
|
44
|
+
type PropertyFact = Fact & {
|
|
45
|
+
readonly [property]: true;
|
|
53
46
|
};
|
|
54
|
-
type
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
type Made<Scope extends Fact | undefined, Own extends Fact> = [Scope] extends [Fact] ? Scope : Own;
|
|
48
|
+
type Quantifiers<E> = {
|
|
49
|
+
readonly no: E;
|
|
50
|
+
readonly none: E;
|
|
51
|
+
readonly one: E;
|
|
52
|
+
readonly two: E;
|
|
53
|
+
readonly three: E;
|
|
54
|
+
readonly count: (num: number) => E;
|
|
55
|
+
readonly a: E;
|
|
56
|
+
readonly an: E;
|
|
57
|
+
readonly some: E;
|
|
58
|
+
readonly all: E;
|
|
57
59
|
};
|
|
58
|
-
type
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
type StringEnd<F extends Fact> = ((text: string) => F) & {
|
|
61
|
+
contains: (substring: string) => F;
|
|
62
|
+
matches: (regex: RegExp) => F;
|
|
63
|
+
};
|
|
64
|
+
type ElementEnd<F extends Fact> = F & {
|
|
65
|
+
with: ((facts: PropertyFact[] | WithFn) => F) & Quantifiers<PropertyEnds<F>> & {
|
|
66
|
+
children: ((facts: Fact[]) => F) & Quantifiers<Ends<F>>;
|
|
61
67
|
};
|
|
62
68
|
};
|
|
63
|
-
type
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
prop: (prop: string) => Fact & {
|
|
73
|
-
is: (value: unknown) => Fact;
|
|
74
|
-
contains: (substring: string) => Fact;
|
|
75
|
-
matches: (regex: RegExp) => Fact;
|
|
76
|
-
exact: (value: unknown) => Fact;
|
|
77
|
-
subset: (shape: unknown) => Fact;
|
|
78
|
-
duck: (shape: unknown) => Fact;
|
|
79
|
-
content: () => Fact & {
|
|
80
|
-
with: ((facts: Fact[]) => Fact) & Quantifiers;
|
|
81
|
-
};
|
|
69
|
+
type PropEnd<F extends Fact> = F & {
|
|
70
|
+
is: (value: unknown) => F;
|
|
71
|
+
contains: (substring: string) => F;
|
|
72
|
+
matches: (regex: RegExp) => F;
|
|
73
|
+
exact: (value: unknown) => F;
|
|
74
|
+
subset: (shape: unknown) => F;
|
|
75
|
+
duck: (shape: unknown) => F;
|
|
76
|
+
content: () => F & {
|
|
77
|
+
with: ((facts: Fact[]) => F) & Quantifiers<Ends<F>>;
|
|
82
78
|
};
|
|
83
79
|
};
|
|
84
|
-
|
|
80
|
+
type Ends<Scope extends Fact | undefined = undefined> = {
|
|
81
|
+
text: StringEnd<Made<Scope, Fact>>;
|
|
82
|
+
textCi: StringEnd<Made<Scope, Fact>>;
|
|
83
|
+
interruptedText: StringEnd<Made<Scope, PropertyFact>>;
|
|
84
|
+
html: (tag: string) => ElementEnd<Made<Scope, Fact>>;
|
|
85
|
+
component: (name: string) => ElementEnd<Made<Scope, Fact>>;
|
|
86
|
+
select: (selector: string) => ElementEnd<Made<Scope, Fact>>;
|
|
87
|
+
fragment: () => Made<Scope, Fact>;
|
|
88
|
+
className: (className?: string) => Made<Scope, PropertyFact>;
|
|
89
|
+
id: (id?: string) => Made<Scope, PropertyFact>;
|
|
90
|
+
prop: (prop: string) => PropEnd<Made<Scope, PropertyFact>>;
|
|
91
|
+
};
|
|
92
|
+
declare const propertyEnds: readonly ["interruptedText", "className", "id", "prop"];
|
|
93
|
+
type PropertyEnds<F extends Fact> = Pick<Ends<F>, typeof propertyEnds[number]>;
|
|
94
|
+
declare const _ensure: typeof ensure & Quantifiers<Ends<undefined>>;
|
|
85
95
|
export { _ensure as ensure };
|
|
86
|
-
export declare const no: Ends
|
|
96
|
+
export declare const no: Ends<undefined>, none: Ends<undefined>, one: Ends<undefined>, two: Ends<undefined>, three: Ends<undefined>, a: Ends<undefined>, an: Ends<undefined>, some: Ends<undefined>, all: Ends<undefined>, count: (num: number) => Ends<undefined>;
|
|
87
97
|
export declare class EnsureError extends Error {
|
|
88
98
|
actual: unknown;
|
|
89
99
|
expected: unknown;
|
|
@@ -93,7 +103,7 @@ export declare class EnsureError extends Error {
|
|
|
93
103
|
constructor(message: string, actual: unknown, expected: unknown, operator: string, showDiff: boolean);
|
|
94
104
|
}
|
|
95
105
|
declare function ensure(tree: ContentNode, facts: Fact[], options?: EnsureOptions): void;
|
|
96
|
-
export declare const children: ((facts: Fact[]) =>
|
|
106
|
+
export declare const children: ((facts: Fact[]) => PropertyFact) & Quantifiers<Ends<PropertyFact>>;
|
|
97
107
|
type BuiltFact = {
|
|
98
108
|
kind: Kind;
|
|
99
109
|
test: Test;
|
|
@@ -105,4 +115,5 @@ type BuiltFact = {
|
|
|
105
115
|
operator: string;
|
|
106
116
|
};
|
|
107
117
|
type Sighting = ['text', string] | [Exclude<Kind, 'text'>, unknown];
|
|
118
|
+
export declare const cssSelectBundle: string;
|
|
108
119
|
//# sourceMappingURL=ensure.d.ts.map
|