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
package/dist/testing/ensure.js
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
2
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
3
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
4
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
5
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
1
6
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
7
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
8
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
+
import { existsSync } from 'node:fs';
|
|
10
|
+
import { createRequire } from 'node:module';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
4
12
|
import { styleText } from 'node:util';
|
|
5
13
|
import deepEqual from 'deep-eql';
|
|
14
|
+
import { warn } from '../output.js';
|
|
6
15
|
import { ContentNodeElementIsComponent, ContentNodeElementIsHtml, ContentNodeIsArray, ContentNodeIsElement, ContentNodeIsLiteral, IsContentNode } from '../ContentNode.js';
|
|
7
|
-
import { $
|
|
16
|
+
import { $props, $type } from '../contentNodeSymbols.js';
|
|
8
17
|
import { componentTypeIdentityKey } from '../hmr/componentIdentity.js';
|
|
18
|
+
import { display } from './display.js';
|
|
19
|
+
// with: the match's properties; its tag, and text and elements it holds, are for children
|
|
20
|
+
const propertyEnds = ['interruptedText', 'className', 'id', 'prop'];
|
|
9
21
|
// exported after
|
|
10
22
|
const _ensure = withMembers(ensure, quantifiers(fact => fact));
|
|
11
23
|
export { _ensure as ensure }; // naming
|
|
@@ -22,32 +34,39 @@ export const {
|
|
|
22
34
|
all,
|
|
23
35
|
count
|
|
24
36
|
} = _ensure;
|
|
25
|
-
|
|
37
|
+
// E: the ends as the caller offers them, which the built ends are typed loosely for.
|
|
38
|
+
// properties: only the ends a with list takes
|
|
39
|
+
function quantifiers(finish, properties = false) {
|
|
40
|
+
const made = (quantifier, requirement, spoken) => {
|
|
41
|
+
const all = ends(quantifier, requirement, finish, spoken);
|
|
42
|
+
const offered = properties ? Object.fromEntries(propertyEnds.map(name => [name, all[name]])) : all;
|
|
43
|
+
return offered; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
44
|
+
};
|
|
26
45
|
return {
|
|
27
46
|
get no() {
|
|
28
|
-
return
|
|
47
|
+
return made('no', counting(count => count === 0, 0));
|
|
29
48
|
},
|
|
30
49
|
get none() {
|
|
31
|
-
return
|
|
50
|
+
return made('none', counting(count => count === 0, 0), 'no');
|
|
32
51
|
},
|
|
33
52
|
get one() {
|
|
34
|
-
return
|
|
53
|
+
return made('one', counting(count => count === 1, 1));
|
|
35
54
|
},
|
|
36
55
|
get two() {
|
|
37
|
-
return
|
|
56
|
+
return made('two', counting(count => count === 2, 2));
|
|
38
57
|
},
|
|
39
58
|
get three() {
|
|
40
|
-
return
|
|
59
|
+
return made('three', counting(count => count === 3, 3));
|
|
41
60
|
},
|
|
42
61
|
get a() {
|
|
43
|
-
return
|
|
62
|
+
return made('a', counting(count => count === 1, 1));
|
|
44
63
|
},
|
|
45
64
|
get an() {
|
|
46
|
-
return
|
|
65
|
+
return made('an', counting(count => count === 1, 1));
|
|
47
66
|
},
|
|
48
|
-
count: num =>
|
|
67
|
+
count: num => made(`count(${num})`, counting(count => count === num, num), String(num)),
|
|
49
68
|
get some() {
|
|
50
|
-
return
|
|
69
|
+
return made('some', () => {
|
|
51
70
|
let count = 0;
|
|
52
71
|
return [match => {
|
|
53
72
|
if (match) ++count;
|
|
@@ -58,11 +77,11 @@ function quantifiers(finish) {
|
|
|
58
77
|
saw: 'saw 0',
|
|
59
78
|
showDiff: false
|
|
60
79
|
}];
|
|
61
|
-
}
|
|
80
|
+
});
|
|
62
81
|
},
|
|
63
82
|
// every sighting of its kind must match, and there must be one: all of none proves nothing
|
|
64
83
|
get all() {
|
|
65
|
-
return
|
|
84
|
+
return made('all', () => {
|
|
66
85
|
let count = 0;
|
|
67
86
|
return [match => {
|
|
68
87
|
if (match) ++count;
|
|
@@ -72,7 +91,7 @@ function quantifiers(finish) {
|
|
|
72
91
|
saw: `saw ${count} of ${ofKind}`,
|
|
73
92
|
showDiff: ofKind > 0
|
|
74
93
|
}];
|
|
75
|
-
},
|
|
94
|
+
}, 'every');
|
|
76
95
|
}
|
|
77
96
|
};
|
|
78
97
|
}
|
|
@@ -82,7 +101,8 @@ const spokenList = facts => `(${facts.map(fact => fact[5]).join(' and ')})`;
|
|
|
82
101
|
const jsxValue = value => typeof value === 'string' ? `"${value}"` : `{${display(value)}}`;
|
|
83
102
|
// each end says only what a sighting must be, and how it reads in a failure;
|
|
84
103
|
// ensure() starts the requirement
|
|
85
|
-
// spoken: the quantifier as prose, where it differs - none as no, count(3) as 3
|
|
104
|
+
// spoken: the quantifier as prose, where it differs - none as no, count(3) as 3.
|
|
105
|
+
// Typed loosely, every end making a plain Fact; quantifiers() gives them their offered types
|
|
86
106
|
function ends(quantifier, requirement, finish, spoken = quantifier) {
|
|
87
107
|
const fact = (kind, test, end, prose, explain) => finish([kind, test, requirement, quantifier, end, `${spoken} ${prose}`, explain]);
|
|
88
108
|
const many = !['one', 'a', 'an', 'every', '1'].includes(spoken);
|
|
@@ -95,12 +115,12 @@ function ends(quantifier, requirement, finish, spoken = quantifier) {
|
|
|
95
115
|
};
|
|
96
116
|
// alone: present. with: facts on the element itself, its children among them
|
|
97
117
|
const element = (kind, end, prose, own) => {
|
|
98
|
-
const within = scoped(kind, end, prose,
|
|
118
|
+
const within = scoped(kind, end, prose, own);
|
|
99
119
|
const below = scoped(kind, end, prose, childrenScope);
|
|
100
120
|
const children = withMembers(facts => below(facts, `with.children(${listed(facts)})`, `with ${spokenList(facts)} in its children`), quantifiers(inner => below([inner], `with.children.${chained(inner)}`, `with ${inner[5]} in its children`)));
|
|
101
121
|
return Object.assign(fact(kind, () => true, end, prose), {
|
|
102
122
|
// facts, or a fn given the props for what facts cannot say
|
|
103
|
-
with: withMembers(withMembers(facts => Array.isArray(facts) ? within(facts, `with(${listed(facts)})`, `with ${spokenList(facts)}`) : fact(kind, seen => facts(seen), `${end}.with(${fnName(facts)})`, `${prose} passing ${fnName(facts)}`), quantifiers(inner => within([inner], `with.${chained(inner)}`, `with ${inner[5]}`))), {
|
|
123
|
+
with: withMembers(withMembers(facts => Array.isArray(facts) ? within(facts, `with(${listed(facts)})`, `with ${spokenList(facts)}`) : fact(kind, seen => facts(propsOf(seen)), `${end}.with(${fnName(facts)})`, `${prose} passing ${fnName(facts)}`), quantifiers(inner => within([inner], `with.${chained(inner)}`, `with ${inner[5]}`), true)), {
|
|
104
124
|
children
|
|
105
125
|
})
|
|
106
126
|
});
|
|
@@ -119,8 +139,12 @@ function ends(quantifier, requirement, finish, spoken = quantifier) {
|
|
|
119
139
|
text: stringEnd('text', 'text', 'text node'),
|
|
120
140
|
textCi: stringEnd('text', 'textCi', 'text node', true),
|
|
121
141
|
interruptedText: stringEnd('interruptedText', 'interruptedText', 'element text'),
|
|
122
|
-
html: tag => element(`html:${tag}`, `html('${tag}')`, `<${tag}>`,
|
|
123
|
-
component: name => element(`component:${name}`, `component('${name}')`, `<${name}>`,
|
|
142
|
+
html: tag => element(`html:${tag}`, `html('${tag}')`, `<${tag}>`, seen => htmlOwnSightings(tag, propsOf(seen))),
|
|
143
|
+
component: name => element(`component:${name}`, `component('${name}')`, `<${name}>`, seen => componentOwnSightings(name, propsOf(seen))),
|
|
144
|
+
select: query => {
|
|
145
|
+
selector(query); // an invalid selector throws here, as the fact is made
|
|
146
|
+
return element(`select:${query}`, `select('${query}')`, `'${query}' ${noun('element')}`, selectOwnSightings);
|
|
147
|
+
},
|
|
124
148
|
fragment: () => fact('fragment', () => true, 'fragment()', noun('fragment')),
|
|
125
149
|
className: className => fact('className', seen => className === undefined || seen === className, className === undefined ? 'className()' : `className('${className}')`, className === undefined ? noun('class') : `class="${className}"`),
|
|
126
150
|
id: id => fact('id', seen => id === undefined || seen === id, id === undefined ? 'id()' : `id('${id}')`, id === undefined ? noun('id') : `id="${id}"`),
|
|
@@ -196,9 +220,17 @@ function tracked(sightings, facts) {
|
|
|
196
220
|
for (const [kind, value] of sightings) {
|
|
197
221
|
for (const fact of byKind.get(kind) ?? []) fact.track(fact.test(value));
|
|
198
222
|
}
|
|
223
|
+
for (const [kind, kindFacts] of byKind) {
|
|
224
|
+
if (!isSelectKind(kind)) continue;
|
|
225
|
+
for (const [, value] of selectSightings(sightings, kind)) {
|
|
226
|
+
for (const fact of kindFacts) fact.track(fact.test(value));
|
|
227
|
+
}
|
|
228
|
+
}
|
|
199
229
|
return started;
|
|
200
230
|
}
|
|
201
|
-
const
|
|
231
|
+
const isSelectKind = kind => kind.startsWith('select:');
|
|
232
|
+
const sightingsOf = (sightings, kind) => isSelectKind(kind) ? selectSightings(sightings, kind) : sightings.filter(([seenKind]) => seenKind === kind);
|
|
233
|
+
const ofKind = (sightings, kind) => sightingsOf(sightings, kind).length;
|
|
202
234
|
// the first fact to fail, with what it saw.
|
|
203
235
|
// Every fact decides, including those of a kind the tree never showed
|
|
204
236
|
function check(sightings, facts) {
|
|
@@ -258,7 +290,7 @@ function explained(outcome, style) {
|
|
|
258
290
|
}) => {
|
|
259
291
|
if (fact.explain === undefined) return paint('red', `${label(fact)}: ${failure.saw}`);
|
|
260
292
|
// a children fact's one sighting is its element, so listing it would repeat the element
|
|
261
|
-
const element = fact.operator === '' ? sightings
|
|
293
|
+
const element = fact.operator === '' ? sightingsOf(sightings, fact.kind)[0] : undefined;
|
|
262
294
|
const inner = element === undefined ? undefined : fact.explain(element[1]);
|
|
263
295
|
if (inner !== undefined) {
|
|
264
296
|
return `${readable ? 'in its children,' : 'children:'} ${explained(inner, style)}`;
|
|
@@ -275,14 +307,18 @@ const fnName = fn => fn.name === '' ? 'fn' : fn.name;
|
|
|
275
307
|
const chained = ([,,, quantifier, end]) => quantifier === '' ? end : `${quantifier}.${end}`;
|
|
276
308
|
const listed = facts => `[${facts.map(chained).join(', ')}]`;
|
|
277
309
|
const childrenKind = 'children';
|
|
310
|
+
const childrenScope = seen => contentSightings(propsOf(seen).children);
|
|
311
|
+
// an element sighting's value is its props, or for a selector's, the element it matched
|
|
312
|
+
const propsOf = seen =>
|
|
278
313
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
279
|
-
|
|
314
|
+
seen instanceof SelectElement ? seen.props : seen;
|
|
280
315
|
// a children fact takes the kind of the element whose with list holds it
|
|
281
316
|
const forKind = (fact, kind) => fact[0] === childrenKind ? [kind, fact[1], fact[2], fact[3], fact[4], fact[5], fact[6]] : fact;
|
|
282
317
|
// a with list holds one sighting of its element's kind - the element itself - so a children fact
|
|
283
318
|
// passes where the element's content meets its inner facts
|
|
284
319
|
function childrenFact(inner, end, spoken) {
|
|
285
|
-
|
|
320
|
+
const fact = [childrenKind, scopeTest(childrenScope, inner), counting(count => count === 1, 1), '', end, `${spoken} in its children`, scopeExplain(childrenScope, inner)];
|
|
321
|
+
return fact; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
286
322
|
}
|
|
287
323
|
// the element's children as a tree, for a with list, beside the element's own facts:
|
|
288
324
|
// with([one.className('x'), children.one.html('li')]), or with([children([…])]) for a list of them
|
|
@@ -339,9 +375,9 @@ function seenLine({
|
|
|
339
375
|
readable,
|
|
340
376
|
paint
|
|
341
377
|
} = style;
|
|
342
|
-
const separator = top && /^(html|component):/.test(kind) ? '\n ' : ', ';
|
|
378
|
+
const separator = top && /^(html|component|select):/.test(kind) ? '\n ' : ', ';
|
|
343
379
|
const named = readable ? spokenKind(kind) : kind;
|
|
344
|
-
const seen = sightings
|
|
380
|
+
const seen = sightingsOf(sightings, kind).map(sighting => ({
|
|
345
381
|
sighting,
|
|
346
382
|
outcome: explain?.(sighting[1])
|
|
347
383
|
}));
|
|
@@ -367,6 +403,7 @@ const plural = named => named.endsWith('s') ? `${named}es` : `${named}s`;
|
|
|
367
403
|
function spokenKind(kind) {
|
|
368
404
|
const [family, name] = kind.split(/:(.*)/);
|
|
369
405
|
if (family === 'html' || family === 'component') return `<${name}>`;
|
|
406
|
+
if (family === 'select') return `'${name}' element`;
|
|
370
407
|
if (family === 'prop') return `${name} prop`;
|
|
371
408
|
const plain = {
|
|
372
409
|
text: 'text node',
|
|
@@ -378,44 +415,13 @@ function spokenKind(kind) {
|
|
|
378
415
|
// an element as its tag or name and props, as written: <a href='/x'>
|
|
379
416
|
function displaySighting([kind, value]) {
|
|
380
417
|
if (kind === 'fragment') return '<>';
|
|
418
|
+
if (value instanceof SelectElement) return displayElement(value.name, value.props);
|
|
381
419
|
const element = /^(?:html|component):(.*)$/.exec(kind)?.[1];
|
|
382
|
-
|
|
383
|
-
const props = Object.entries(value).filter(([name]) => name !== 'children').map(([name, prop]) => ` ${name}=${display(prop)}`);
|
|
384
|
-
return `<${element}${props.join('')}>`;
|
|
420
|
+
return element === undefined ? display(value) : displayElement(element, value);
|
|
385
421
|
}
|
|
386
|
-
|
|
387
|
-
const
|
|
388
|
-
|
|
389
|
-
function display(value, depth = 0) {
|
|
390
|
-
if (typeof value === 'string') return `'${value}'`;
|
|
391
|
-
if (typeof value === 'function') {
|
|
392
|
-
return value.name === '' ? '[function]' : `[function ${value.name}]`;
|
|
393
|
-
}
|
|
394
|
-
if (typeof value !== 'object' || value === null) {
|
|
395
|
-
return String(value); // a number, boolean, bigint, symbol, null or undefined
|
|
396
|
-
}
|
|
397
|
-
if (value instanceof Date) {
|
|
398
|
-
return isNaN(value.getTime()) ? 'Date(invalid)' : `Date(${value.toISOString()})`;
|
|
399
|
-
}
|
|
400
|
-
// an element held as a value, as in a prop: by tag or name, as its symbol keys hide it as data
|
|
401
|
-
if ($type in value && IsContentNode(value) && ContentNodeIsElement(value)) {
|
|
402
|
-
const type = value[$type];
|
|
403
|
-
if (type === $fragment) return '<>';
|
|
404
|
-
return `<${typeof type === 'string' ? type : componentTypeIdentityKey(type)}>`;
|
|
405
|
-
}
|
|
406
|
-
const shown = entries => depth >= displayDepth ? '…' : entries.slice(0, displayed).join(', ') + (entries.length > displayed ? ', …' : '');
|
|
407
|
-
if (Array.isArray(value)) {
|
|
408
|
-
return value.length === 0 ? '[]' : `[${shown(value.map(each => display(each, depth + 1)))}]`;
|
|
409
|
-
}
|
|
410
|
-
if (value instanceof Set) {
|
|
411
|
-
return `Set { ${shown([...value].map(each => display(each, depth + 1)))} }`;
|
|
412
|
-
}
|
|
413
|
-
if (value instanceof Map) {
|
|
414
|
-
const pairs = [...value].map(([key, each]) => `${display(key, depth + 1)} => ${display(each, depth + 1)}`);
|
|
415
|
-
return `Map { ${shown(pairs)} }`;
|
|
416
|
-
}
|
|
417
|
-
const entries = Object.entries(value).map(([key, each]) => `${key}: ${display(each, depth + 1)}`);
|
|
418
|
-
return entries.length === 0 ? '{}' : `{ ${shown(entries)} }`;
|
|
422
|
+
function displayElement(element, props) {
|
|
423
|
+
const shown = Object.entries(props).filter(([name]) => name !== 'children').map(([name, prop]) => ` ${name}=${display(prop)}`);
|
|
424
|
+
return `<${element}${shown.join('')}>`;
|
|
419
425
|
}
|
|
420
426
|
// an element's edge: text either side of one is not one run of text
|
|
421
427
|
const edge = Symbol('edge');
|
|
@@ -437,6 +443,10 @@ function contentSightings(content) {
|
|
|
437
443
|
sightings.push([...token]);
|
|
438
444
|
}
|
|
439
445
|
}
|
|
446
|
+
sightings.push(['elements', {
|
|
447
|
+
roots: selectNodes(content, null),
|
|
448
|
+
descend: true
|
|
449
|
+
}]);
|
|
440
450
|
return sightings;
|
|
441
451
|
}
|
|
442
452
|
// fragments, arrays and non-rendered values add no edge: their text runs on into their neighbours'
|
|
@@ -519,4 +529,136 @@ function contains(shape, value, arrays) {
|
|
|
519
529
|
// every prop but children, whose content is walked instead
|
|
520
530
|
function propSightings(props) {
|
|
521
531
|
return Object.entries(props).filter(([name]) => name !== 'children').map(([name, value]) => [`prop:${name}`, value]);
|
|
522
|
-
}
|
|
532
|
+
}
|
|
533
|
+
// an element as a selector reads it; a component, by name, is the parent of what it holds.
|
|
534
|
+
// Each scope is a tree of its own, so a selector sees no ancestor outside it
|
|
535
|
+
var _children = /*#__PURE__*/new WeakMap();
|
|
536
|
+
class SelectElement {
|
|
537
|
+
constructor(family, name, props, parent, siblings) {
|
|
538
|
+
_defineProperty(this, "family", void 0);
|
|
539
|
+
_defineProperty(this, "name", void 0);
|
|
540
|
+
_defineProperty(this, "props", void 0);
|
|
541
|
+
_defineProperty(this, "parent", void 0);
|
|
542
|
+
_defineProperty(this, "siblings", void 0);
|
|
543
|
+
_classPrivateFieldInitSpec(this, _children, void 0);
|
|
544
|
+
this.family = family;
|
|
545
|
+
this.name = name;
|
|
546
|
+
this.props = props;
|
|
547
|
+
this.parent = parent;
|
|
548
|
+
this.siblings = siblings;
|
|
549
|
+
}
|
|
550
|
+
get children() {
|
|
551
|
+
return _classPrivateFieldGet(_children, this) ?? _classPrivateFieldSet(_children, this, selectNodes(this.props.children, this));
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
// fragments and arrays unwrapped, as the page has no node for them
|
|
555
|
+
function selectNodes(content, parent) {
|
|
556
|
+
const nodes = [];
|
|
557
|
+
const add = each => {
|
|
558
|
+
if (ContentNodeIsArray(each)) each.forEach(add);else if (ContentNodeIsLiteral(each)) nodes.push(String(each));else if (!ContentNodeIsElement(each)) return; // null, undefined, boolean
|
|
559
|
+
else if (ContentNodeElementIsHtml(each)) {
|
|
560
|
+
nodes.push(new SelectElement('html', each[$type], each[$props], parent, nodes));
|
|
561
|
+
} else if (ContentNodeElementIsComponent(each)) {
|
|
562
|
+
const name = componentTypeIdentityKey(each[$type]);
|
|
563
|
+
nodes.push(new SelectElement('component', name, each[$props], parent, nodes));
|
|
564
|
+
} else add(each[$props].children);
|
|
565
|
+
};
|
|
566
|
+
add(content);
|
|
567
|
+
return nodes;
|
|
568
|
+
}
|
|
569
|
+
// its own sightings, and itself to match: a children fact in its with list is of its kind.
|
|
570
|
+
// It keeps its place in the tree, so an ancestor in the selector still holds
|
|
571
|
+
const selectOwnSightings = seen => {
|
|
572
|
+
const element = seen; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
573
|
+
const {
|
|
574
|
+
family,
|
|
575
|
+
name,
|
|
576
|
+
props
|
|
577
|
+
} = element;
|
|
578
|
+
const own = family === 'html' ? htmlOwnSightings(name, props) : componentOwnSightings(name, props);
|
|
579
|
+
return [...own, ['elements', {
|
|
580
|
+
roots: [element],
|
|
581
|
+
descend: false
|
|
582
|
+
}]];
|
|
583
|
+
};
|
|
584
|
+
function selectSightings(sightings, kind) {
|
|
585
|
+
const matches = selector(kind.slice('select:'.length));
|
|
586
|
+
const found = [];
|
|
587
|
+
const visit = (nodes, descend) => {
|
|
588
|
+
for (const node of nodes) {
|
|
589
|
+
if (typeof node === 'string') continue;
|
|
590
|
+
if (matches(node)) found.push([kind, node]);
|
|
591
|
+
if (descend) visit(node.children, true);
|
|
592
|
+
}
|
|
593
|
+
};
|
|
594
|
+
for (const [seenKind, value] of sightings) {
|
|
595
|
+
if (seenKind !== 'elements') continue;
|
|
596
|
+
const {
|
|
597
|
+
roots,
|
|
598
|
+
descend
|
|
599
|
+
} = value; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
600
|
+
visit(roots, descend);
|
|
601
|
+
}
|
|
602
|
+
return found;
|
|
603
|
+
}
|
|
604
|
+
const selectors = new Map();
|
|
605
|
+
// on the first select(): ~100ms and 44 modules at import, which no other fact needs
|
|
606
|
+
let cssSelect;
|
|
607
|
+
// shipped in the package's vendor/, as dist is
|
|
608
|
+
export const cssSelectBundle = fileURLToPath(new URL('../../vendor/css-select.js', import.meta.url));
|
|
609
|
+
// the vendor bundle (one file, ~9ms), else the package (44 modules, ~100ms)
|
|
610
|
+
function loadCssSelect() {
|
|
611
|
+
const bundled = existsSync(cssSelectBundle);
|
|
612
|
+
if (!bundled) {
|
|
613
|
+
warn(`tungsten ensure: no css-select bundle at ${cssSelectBundle}; ` + 'loading the package instead, which is slower');
|
|
614
|
+
}
|
|
615
|
+
const load = createRequire(import.meta.url);
|
|
616
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
617
|
+
return load(bundled ? cssSelectBundle : 'css-select');
|
|
618
|
+
}
|
|
619
|
+
function selector(query) {
|
|
620
|
+
let compiled = selectors.get(query);
|
|
621
|
+
if (compiled === undefined) {
|
|
622
|
+
cssSelect ??= loadCssSelect();
|
|
623
|
+
// xmlMode: names as written, so Link is a component and link no tag
|
|
624
|
+
compiled = cssSelect.compile(query, {
|
|
625
|
+
adapter,
|
|
626
|
+
xmlMode: true,
|
|
627
|
+
cacheResults: false
|
|
628
|
+
});
|
|
629
|
+
selectors.set(query, compiled);
|
|
630
|
+
}
|
|
631
|
+
return compiled;
|
|
632
|
+
}
|
|
633
|
+
// as the page renders it: true present and empty; false, null and undefined absent.
|
|
634
|
+
// class and id only on html, as a component's className is still a prop
|
|
635
|
+
function attribute({
|
|
636
|
+
family,
|
|
637
|
+
props
|
|
638
|
+
}, name) {
|
|
639
|
+
const html = family === 'html';
|
|
640
|
+
if (name === 'children' || !html && (name === 'class' || name === 'id')) return undefined;
|
|
641
|
+
const value = !html ? props[name] : name === 'class' ? props.className ?? props.class : name === 'for' ? props.htmlFor ?? props.for : props[name];
|
|
642
|
+
if (value === undefined || value === null || value === false) return undefined;
|
|
643
|
+
if (value === true) return '';
|
|
644
|
+
if (typeof value === 'string') return value;
|
|
645
|
+
if (typeof value === 'number' || typeof value === 'bigint') return String(value);
|
|
646
|
+
return ''; // a handler or data: present, with no text to compare
|
|
647
|
+
}
|
|
648
|
+
function hasAncestorIn(node, nodes) {
|
|
649
|
+
for (let up = typeof node === 'string' ? null : node.parent; up !== null; up = up.parent) {
|
|
650
|
+
if (nodes.includes(up)) return true;
|
|
651
|
+
}
|
|
652
|
+
return false;
|
|
653
|
+
}
|
|
654
|
+
const adapter = {
|
|
655
|
+
isTag: node => typeof node !== 'string',
|
|
656
|
+
getName: element => element.name,
|
|
657
|
+
getParent: element => element.parent,
|
|
658
|
+
getChildren: node => typeof node === 'string' ? [] : node.children,
|
|
659
|
+
getSiblings: node => typeof node === 'string' ? [node] : node.siblings,
|
|
660
|
+
getText: node => typeof node === 'string' ? node : contentText(node.props.children),
|
|
661
|
+
getAttributeValue: attribute,
|
|
662
|
+
hasAttrib: (element, name) => attribute(element, name) !== undefined,
|
|
663
|
+
removeSubsets: nodes => nodes.filter((node, i) => nodes.indexOf(node) === i && !hasAncestorIn(node, nodes))
|
|
664
|
+
};
|
package/dist/testing/host.d.ts
CHANGED
|
@@ -19,22 +19,18 @@ export type Navigation = {
|
|
|
19
19
|
to: string;
|
|
20
20
|
};
|
|
21
21
|
export type StateSetter<Component extends TungstenBaseComponent<any, any>> = (state: StateOf<Component>) => StateOf<Component> | void;
|
|
22
|
-
type HostedCore<Component extends TungstenBaseComponent<any, any>> = {
|
|
22
|
+
type HostedCore<Component extends TungstenBaseComponent<any, any>, Content = ContentOf<Component>> = {
|
|
23
23
|
readonly component: Component;
|
|
24
24
|
readonly props: Component['props'];
|
|
25
25
|
readonly state: StateOf<Component>;
|
|
26
26
|
readonly title: string | undefined;
|
|
27
27
|
readonly navigations: readonly Navigation[];
|
|
28
|
-
content: () =>
|
|
29
|
-
updateProps: (props: Component['props']) => Promise<Awaited<
|
|
30
|
-
updateState: (setter: StateSetter<Component>) => Promise<Awaited<
|
|
28
|
+
content: () => Content;
|
|
29
|
+
updateProps: (props: Component['props']) => Promise<Awaited<Content>>;
|
|
30
|
+
updateState: (setter: StateSetter<Component>) => Promise<Awaited<Content>>;
|
|
31
31
|
};
|
|
32
32
|
export type Hosted<Component extends TungstenBaseComponent<any, any>> = HostedCore<Component> & ComponentApi<Component>;
|
|
33
|
-
export type HostedResolved<Component extends TungstenBaseComponent<any, any>> =
|
|
34
|
-
content: () => Promise<ContentNode>;
|
|
35
|
-
updateProps: (props: Component['props']) => Promise<ContentNode>;
|
|
36
|
-
updateState: (setter: StateSetter<Component>) => Promise<ContentNode>;
|
|
37
|
-
} & ComponentApi<Component>;
|
|
33
|
+
export type HostedResolved<Component extends TungstenBaseComponent<any, any>> = HostedCore<Component, Promise<ContentNode>> & ComponentApi<Component>;
|
|
38
34
|
type StoreSchemaOf<Component> = Component extends {
|
|
39
35
|
store: ComponentStore<infer Schema extends object>;
|
|
40
36
|
} ? Schema : never;
|
|
@@ -44,7 +40,7 @@ export type HostedRoute = {
|
|
|
44
40
|
params?: Record<string, string>;
|
|
45
41
|
data?: unknown;
|
|
46
42
|
};
|
|
47
|
-
type RouteOptions = {
|
|
43
|
+
export type RouteOptions = {
|
|
48
44
|
routing: true;
|
|
49
45
|
location: Path;
|
|
50
46
|
routes: Routes<any> | RoutesFunction<any>;
|
|
@@ -90,16 +86,16 @@ type StoreOptionsFor<Schema extends object> = {
|
|
|
90
86
|
* Resolve the content through every component in the tree (the default). false: the hosted
|
|
91
87
|
* component's own content alone, its child components unexpanded.
|
|
92
88
|
*/
|
|
93
|
-
type ResolveOption = {
|
|
89
|
+
export type ResolveOption = {
|
|
94
90
|
resolve?: boolean;
|
|
95
91
|
};
|
|
96
|
-
type
|
|
92
|
+
export type Resolve = {
|
|
97
93
|
resolve?: true;
|
|
98
94
|
};
|
|
99
|
-
type
|
|
95
|
+
export type DontResolve = {
|
|
100
96
|
resolve: false;
|
|
101
97
|
};
|
|
102
|
-
type AppDataOptions = {
|
|
98
|
+
export type AppDataOptions = {
|
|
103
99
|
/** What this.tungsten.context reads. An empty object when not given. */
|
|
104
100
|
context?: object;
|
|
105
101
|
/** What this.tungsten.networkedData reads. An empty object when not given. */
|
|
@@ -107,13 +103,17 @@ type AppDataOptions = {
|
|
|
107
103
|
/** What this.tungsten.globalData reads. An empty object when not given. */
|
|
108
104
|
globalData?: object;
|
|
109
105
|
};
|
|
110
|
-
export type HostStoreOptions<Schema extends object> = (RouteOptions &
|
|
106
|
+
export type HostStoreOptions<Schema extends object, R extends ResolveOption = ResolveOption> = (RouteOptions & R & AppDataOptions & StoreOptionsFor<Schema>) extends infer Options ? Options extends unknown ? {
|
|
111
107
|
[K in keyof Options]: Options[K];
|
|
112
108
|
} : never : never;
|
|
113
|
-
export type HostOptions<Component> = [StoreOf<Component>] extends [never] ? (RouteOptions &
|
|
109
|
+
export type HostOptions<Component, R extends ResolveOption = ResolveOption> = [StoreOf<Component>] extends [never] ? (RouteOptions & R & AppDataOptions & (NoStore | StoreOptionsFor<any>)) extends infer Options ? Options extends unknown ? {
|
|
114
110
|
[K in keyof Options]: Options[K];
|
|
115
|
-
} : never : never : HostStoreOptions<StoreOf<Component
|
|
116
|
-
type
|
|
111
|
+
} : never : never : HostStoreOptions<StoreOf<Component>, R>;
|
|
112
|
+
export type HostStoreResolveOptions<Schema extends object> = HostStoreOptions<Schema, Resolve>;
|
|
113
|
+
export type HostStoreDontResolveOptions<Schema extends object> = HostStoreOptions<Schema, DontResolve>;
|
|
114
|
+
export type HostResolveOptions<Component> = HostOptions<Component, Resolve>;
|
|
115
|
+
export type HostDontResolveOptions<Component> = HostOptions<Component, DontResolve>;
|
|
116
|
+
type HostArgs<Props, Component> = [StoreOf<Component>] extends [never] ? object extends Props ? [props?: Props, options?: HostOptions<Component> & Resolve] : [props: Props, options?: HostOptions<Component> & Resolve] : object extends Props ? [props: Props | undefined, options: HostOptions<Component> & Resolve] : [props: Props, options: HostOptions<Component> & Resolve];
|
|
117
117
|
/**
|
|
118
118
|
* Constructs a component outside of any app and drives it the way the framework
|
|
119
119
|
* does - init, then the mount lifecycles - calling its content function with
|
|
@@ -139,21 +139,21 @@ export declare function host<Props extends TungstenComponentPropsBase, Schema ex
|
|
|
139
139
|
store: ComponentStore<Schema>;
|
|
140
140
|
}), props: Props, options: NoInfer<[
|
|
141
141
|
Schema
|
|
142
|
-
] extends [InternalStoreSchema] ? never : HostStoreOptions<Schema> &
|
|
143
|
-
export declare function host<Props extends TungstenComponentPropsBase, Component extends TungstenBaseComponent<any, any>>(ComponentType: TungstenComponentClass<Props, Component>, props: Props | undefined, options: HostOptions<Component> &
|
|
142
|
+
] extends [InternalStoreSchema] ? never : HostStoreOptions<Schema> & DontResolve>): Promise<Hosted<Component>>;
|
|
143
|
+
export declare function host<Props extends TungstenComponentPropsBase, Component extends TungstenBaseComponent<any, any>>(ComponentType: TungstenComponentClass<Props, Component>, props: Props | undefined, options: HostOptions<Component> & DontResolve): Promise<Hosted<Component>>;
|
|
144
144
|
export declare function host<Props extends TungstenComponentPropsBase, Schema extends object, Component extends TungstenBaseComponent<any, any> & {
|
|
145
145
|
store: ComponentStore<Schema>;
|
|
146
146
|
}>(ComponentType: TungstenComponentClass<Props, Component> & (new (...args: any) => {
|
|
147
147
|
store: ComponentStore<Schema>;
|
|
148
148
|
}), props: Props, options: NoInfer<[
|
|
149
149
|
Schema
|
|
150
|
-
] extends [InternalStoreSchema] ? never : HostStoreOptions<Schema> &
|
|
150
|
+
] extends [InternalStoreSchema] ? never : HostStoreOptions<Schema> & Resolve>): Promise<HostedResolved<Component>>;
|
|
151
151
|
export declare function host<Props extends TungstenComponentPropsBase, Component extends TungstenBaseComponent<any, any>>(ComponentType: TungstenComponentClass<Props, Component>, ...[props, options]: HostArgs<Props, Component>): Promise<HostedResolved<Component>>;
|
|
152
152
|
export declare namespace host {
|
|
153
153
|
var generic: typeof hostGeneric;
|
|
154
154
|
var jsx: typeof hostJsx;
|
|
155
155
|
}
|
|
156
|
-
type HostGenericArgs<Component> = [StoreOf<Component>] extends [never] ? [options?: HostOptions<Component> &
|
|
156
|
+
type HostGenericArgs<Component> = [StoreOf<Component>] extends [never] ? [options?: HostOptions<Component> & Resolve] : [options: HostOptions<Component> & Resolve];
|
|
157
157
|
/**
|
|
158
158
|
* host() for a generic component class, whose type arguments it cannot infer: passed as an
|
|
159
159
|
* argument, the class's own parameters are erased to their constraints before the props are
|
|
@@ -168,7 +168,7 @@ type HostGenericArgs<Component> = [StoreOf<Component>] extends [never] ? [option
|
|
|
168
168
|
* one: give it type parameters of its own, or a second call signature, and the inference
|
|
169
169
|
* that makes this work is lost.
|
|
170
170
|
*/
|
|
171
|
-
export declare function hostGeneric<Props extends TungstenComponentPropsBase, Component extends TungstenBaseComponent<any, any>>(ComponentType: TungstenComponentClass<Props, Component>, options: HostOptions<Component> &
|
|
171
|
+
export declare function hostGeneric<Props extends TungstenComponentPropsBase, Component extends TungstenBaseComponent<any, any>>(ComponentType: TungstenComponentClass<Props, Component>, options: HostOptions<Component> & DontResolve): (props: Props) => Promise<Hosted<Component>>;
|
|
172
172
|
export declare function hostGeneric<Props extends TungstenComponentPropsBase, Component extends TungstenBaseComponent<any, any>>(ComponentType: TungstenComponentClass<Props, Component>, ...args: HostGenericArgs<Component>): (props: Props) => Promise<HostedResolved<Component>>;
|
|
173
173
|
type AnyClassComponent = TungstenBaseComponent<any, any>;
|
|
174
174
|
/**
|
|
@@ -182,7 +182,7 @@ type AnyClassComponent = TungstenBaseComponent<any, any>;
|
|
|
182
182
|
* `props`, `state` and the component's own methods. host() itself infers all of that from the
|
|
183
183
|
* class, so a test that leans on the wrapper's api is better off with host().
|
|
184
184
|
*/
|
|
185
|
-
export declare function hostJsx<Component extends AnyClassComponent = AnyClassComponent>(element: ContentNodeElement, options: HostOptions<Component> &
|
|
186
|
-
export declare function hostJsx<Component extends AnyClassComponent = AnyClassComponent>(element: ContentNodeElement, options?: HostOptions<Component> &
|
|
185
|
+
export declare function hostJsx<Component extends AnyClassComponent = AnyClassComponent>(element: ContentNodeElement, options: HostOptions<Component> & DontResolve): Promise<Hosted<Component>>;
|
|
186
|
+
export declare function hostJsx<Component extends AnyClassComponent = AnyClassComponent>(element: ContentNodeElement, options?: HostOptions<Component> & Resolve): Promise<HostedResolved<Component>>;
|
|
187
187
|
export {};
|
|
188
188
|
//# sourceMappingURL=host.d.ts.map
|
package/dist/testing/host.js
CHANGED
|
@@ -45,9 +45,7 @@ async function hostedRouting(options, context, networkedData) {
|
|
|
45
45
|
return {
|
|
46
46
|
routes: options.routes,
|
|
47
47
|
internalStore: {
|
|
48
|
-
|
|
49
|
-
location
|
|
50
|
-
} : {}),
|
|
48
|
+
location: location ?? '/',
|
|
51
49
|
...(matchedRouteInfo !== undefined ? {
|
|
52
50
|
matchedRouteInfo
|
|
53
51
|
} : {}),
|
|
@@ -147,7 +147,8 @@ export async function hydrateTestApp(RootComponent, ...args) {
|
|
|
147
147
|
const clientProps = options?.props ?? {}; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
148
148
|
const serverProps = options?.serverProps ?? clientProps;
|
|
149
149
|
const location = options?.location ?? '/';
|
|
150
|
-
const globalData = options?.globalData ? options.globalData
|
|
150
|
+
const globalData = options?.globalData ? options.globalData // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
151
|
+
: {}; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
151
152
|
const matchedRouteInfo = {
|
|
152
153
|
key: null,
|
|
153
154
|
params: options?.routeParams ?? {},
|
|
@@ -167,9 +168,9 @@ export async function hydrateTestApp(RootComponent, ...args) {
|
|
|
167
168
|
// routing() falls back to the built-in 404 when neither '404' nor 'default' is given
|
|
168
169
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
169
170
|
const appRoutes = options?.routes ?? {};
|
|
170
|
-
const context = options?.context ?? {};
|
|
171
|
+
const context = options?.context ?? {}; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
171
172
|
// one object for both passes: the server's is serialized into the page and carried to the client
|
|
172
|
-
const networkedData = options?.networkedData ?? {};
|
|
173
|
+
const networkedData = options?.networkedData ?? {}; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
173
174
|
// dev, so a path given twice fails the test
|
|
174
175
|
const routes = toRoutes(typeof appRoutes === 'function' ? appRoutes(null, context, networkedData) : appRoutes, true);
|
|
175
176
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- rootToHtml.ts builds a root content node the same way
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
export { loadEnv } from './loadEnv.js';
|
|
2
2
|
export { testEnvVariableName } from './testEnvIsRequested.js';
|
|
3
3
|
export { type HydrateTestApp, type HydrateTestAppOptions, hydrateTestApp, } from './hydrateTestApp.js';
|
|
4
|
-
export { type HydrateTestPipelineApp, type HydrateTestPipelineAppOptions, hydrateTestPipelineApp, } from './hydrateTestPipelineApp.js';
|
|
5
4
|
export { type ComponentProps, type CreateTestAppArgs, type TestApp, type TestAppOptions, type TestStore, type TestStoreOverride, type TestStoreRegistration, type TestRoutes, createTestApp, testStore, } from './createTestApp.js';
|
|
6
|
-
export { type
|
|
7
|
-
export { type HostOptions, type HostStoreOptions, type Hosted, type HostedResolved, host, hostGeneric, hostJsx, } from './host.js';
|
|
5
|
+
export { type HostDontResolveOptions, type HostOptions, type HostResolveOptions, type HostStoreDontResolveOptions, type HostStoreOptions, type HostStoreResolveOptions, type Hosted, type HostedResolved, host, hostGeneric, hostJsx, } from './host.js';
|
|
8
6
|
export { testingComponentPackage } from './testingComponentPackage.js';
|
|
9
7
|
export { contentHtmlElements } from './helpers/contentHtmlElements.js';
|
|
10
8
|
export { ensure } from './ensure.js';
|
|
9
|
+
export { contentToString, type ContentToStringOptions } from './contentToString.js';
|
|
11
10
|
export { makeStore, type TrueStore } from '../Store/makeStore.js';
|
|
12
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/testing/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
export { loadEnv } from './loadEnv.js';
|
|
2
2
|
export { testEnvVariableName } from './testEnvIsRequested.js';
|
|
3
3
|
export { hydrateTestApp } from './hydrateTestApp.js';
|
|
4
|
-
export { hydrateTestPipelineApp } from './hydrateTestPipelineApp.js';
|
|
5
4
|
export { createTestApp, testStore } from './createTestApp.js';
|
|
6
|
-
export { createTestPipelineApp } from './createTestPipelineApp.js';
|
|
7
5
|
export { host, hostGeneric, hostJsx } from './host.js';
|
|
8
6
|
export { testingComponentPackage } from './testingComponentPackage.js';
|
|
9
7
|
export { contentHtmlElements } from './helpers/contentHtmlElements.js';
|
|
10
8
|
export { ensure } from './ensure.js';
|
|
9
|
+
export { contentToString } from './contentToString.js';
|
|
11
10
|
export { makeStore } from '../Store/makeStore.js';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ConstructPackage, TungstenBaseComponent, TungstenComponentPropsBase } from '../../Components.jsx';
|
|
2
|
+
import type { Nothing } from '../../pipeline/pipeline.js';
|
|
3
|
+
import type { TestApp } from '../createTestApp.js';
|
|
4
|
+
import type { PipelineTestAppOptions } from './pipelineTestApp.js';
|
|
5
|
+
type Field<K extends string, T, Default> = Default extends T ? {
|
|
6
|
+
[_ in K]?: T;
|
|
7
|
+
} : {
|
|
8
|
+
[_ in K]: T;
|
|
9
|
+
};
|
|
10
|
+
export type PacketForComponent<C> = C extends {
|
|
11
|
+
readonly tungsten: {
|
|
12
|
+
readonly context: infer Ctx;
|
|
13
|
+
readonly networked: infer N;
|
|
14
|
+
readonly allRoutesData: infer G;
|
|
15
|
+
};
|
|
16
|
+
} ? Field<'context', Ctx, Nothing> & Field<'networked', N, Nothing> & Field<'allRoutesData', G, undefined> & {
|
|
17
|
+
routes?: never;
|
|
18
|
+
} : 'invalid component';
|
|
19
|
+
export type TestPacketAppOptions<Props extends object> = PipelineTestAppOptions<Props>;
|
|
20
|
+
export type CreateTestPacketAppArgs<Props extends object> = object extends Props ? [options?: TestPacketAppOptions<Props>] : [options: TestPacketAppOptions<Props> & {
|
|
21
|
+
props: Props;
|
|
22
|
+
}];
|
|
23
|
+
/**
|
|
24
|
+
* createTestPipelineApp() with the pipeline's result in place of the pipeline: the component is
|
|
25
|
+
* handed the packet's context, networked data and all-routes data as they are, with no stages run.
|
|
26
|
+
* There are no routes; the location still reaches the instance.
|
|
27
|
+
*/
|
|
28
|
+
export declare function createTestPacketApp<Props extends TungstenComponentPropsBase, Component extends TungstenBaseComponent<any, any>, RouteData = undefined>(packet: PacketForComponent<Component>, RootComponent: new (pkg: ConstructPackage<Props, RouteData>) => Component, ...args: CreateTestPacketAppArgs<Props>): Promise<TestApp<Component>>;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=createTestPacketApp.d.ts.map
|