vivth 1.4.10 → 1.5.0
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/README.md +6060 -2037
- package/README.src.md +22 -14
- package/bun.lock +154 -194
- package/dev/auto/.src.ignore +25 -0
- package/dev/auto-doc.mjs +137 -0
- package/generated/types/generated/vivth/exports/all.d.mts +145 -0
- package/generated/types/generated/vivth/exports/neutral.d.mts +105 -0
- package/generated/types/generated/vivth/exports/node.d.mts +40 -0
- package/generated/types/src/bundler/CompileAS.d.mts +30 -0
- package/generated/types/src/bundler/CompileJS.d.mts +109 -0
- package/{types → generated/types}/src/bundler/CreateESPlugin.d.mts +1 -1
- package/{types → generated/types}/src/bundler/EsBundler.d.mts +9 -7
- package/generated/types/src/bundler/FSAnalyzer.d.mts +58 -0
- package/generated/types/src/bundler/FSasar.bundled.d.mts +28 -0
- package/generated/types/src/bundler/FSasar.d.mts +51 -0
- package/generated/types/src/bundler/FileSelfMapper.d.mts +137 -0
- package/generated/types/src/bundler/JSDirMapper.d.mts +128 -0
- package/generated/types/src/bundler/RunWatchThenCompileJSOnSafeExit.d.mts +63 -0
- package/generated/types/src/bundler/adds/BrowserExternals.d.mts +21 -0
- package/generated/types/src/bundler/adds/CreateTransform.d.mts +26 -0
- package/generated/types/src/bundler/adds/LastEditedUnix.d.mts +5 -0
- package/generated/types/src/bundler/adds/NodeModuleList.d.mts +15 -0
- package/generated/types/src/bundler/adds/PathFSBundles.bundled.d.mts +25 -0
- package/generated/types/src/bundler/adds/PathFSBundles.d.mts +48 -0
- package/generated/types/src/bundler/adds/PathFSDir.bundled.d.mts +30 -0
- package/generated/types/src/bundler/adds/PathFSDir.d.mts +48 -0
- package/generated/types/src/bundler/adds/PathFSFile.bundled.d.mts +25 -0
- package/generated/types/src/bundler/adds/PathFSFile.d.mts +40 -0
- package/{types → generated/types}/src/bundler/adds/ToBundledJSPlugin.d.mts +6 -6
- package/generated/types/src/bundler/adds/autoExternalize.d.mts +2 -0
- package/generated/types/src/bundler/adds/emptyBufferValue.d.mts +1 -0
- package/generated/types/src/bundler/adds/isModuleTheBundledVersion.d.mts +1 -0
- package/generated/types/src/bundler/adds/onEndEsBuildErrorLogger.d.mts +1 -0
- package/generated/types/src/bundler/adds/resolveJSDependencyPath.d.mts +1 -0
- package/generated/types/src/class/AwaitSignal.d.mts +48 -0
- package/generated/types/src/class/Console.d.mts +82 -0
- package/generated/types/src/class/DataLog.d.mts +25 -0
- package/generated/types/src/class/Derived.d.mts +74 -0
- package/generated/types/src/class/Effect.d.mts +213 -0
- package/{types → generated/types}/src/class/EnvSignal.d.mts +6 -2
- package/generated/types/src/class/EsWatcher.d.mts +36 -0
- package/{types → generated/types}/src/class/EventSignal.d.mts +39 -39
- package/generated/types/src/class/FSDirArchWatcher.d.mts +110 -0
- package/{types → generated/types}/src/class/FileSafe.d.mts +32 -16
- package/generated/types/src/class/ForEach.d.mts +57 -0
- package/generated/types/src/class/ForSignal.d.mts +63 -0
- package/generated/types/src/class/GetterSetter.d.mts +38 -0
- package/generated/types/src/class/JSONFileHandler.d.mts +50 -0
- package/{types → generated/types}/src/class/ListSignal.d.mts +49 -15
- package/{types → generated/types}/src/class/LitExp.d.mts +18 -18
- package/generated/types/src/class/ObjectSignal.d.mts +267 -0
- package/generated/types/src/class/Paths.d.mts +95 -0
- package/generated/types/src/class/Prettivy.d.mts +26 -0
- package/{types → generated/types}/src/class/QChannel.d.mts +24 -16
- package/generated/types/src/class/SafeExit.d.mts +69 -0
- package/{types → generated/types}/src/class/Setup.d.mts +29 -16
- package/{types → generated/types}/src/class/Signal.d.mts +29 -15
- package/generated/types/src/class/SignalCollection.d.mts +96 -0
- package/{types → generated/types}/src/class/WalkThrough.d.mts +4 -19
- package/generated/types/src/class/WorkerMainThread.bundled.d.mts +83 -0
- package/{types → generated/types}/src/class/WorkerMainThread.d.mts +33 -39
- package/{types → generated/types}/src/class/WorkerThread.d.mts +11 -5
- package/{types → generated/types}/src/common/Base64URL.d.mts +2 -1
- package/generated/types/src/common/Base64URLFromFile.d.mts +20 -0
- package/generated/types/src/common/BundledV.bundled.d.mts +3 -0
- package/generated/types/src/common/BundledV.d.mts +36 -0
- package/{types → generated/types}/src/common/CreateStringID.d.mts +5 -4
- package/generated/types/src/common/EnvMode.d.mts +79 -0
- package/generated/types/src/common/FactoryKey.d.mts +9 -0
- package/generated/types/src/common/Preferrence.d.mts +25 -0
- package/{types → generated/types}/src/common/Trace.d.mts +1 -1
- package/{types → generated/types}/src/common/TracePath.d.mts +1 -1
- package/generated/types/src/common/VivthUnBundledCodeBlock.d.mts +6 -0
- package/generated/types/src/doc/JSautoDOC.d.mts +172 -0
- package/generated/types/src/doc/cleanPreserveTypedef.d.mts +1 -0
- package/{types/src/doc/parsedFile.d.mts → generated/types/src/doc/parsedFileForDOC.d.mts} +56 -27
- package/generated/types/src/function/ClearRequireCache.d.mts +1 -0
- package/{types → generated/types}/src/function/CreateImmutable.d.mts +5 -4
- package/{types → generated/types}/src/function/EventCheck.d.mts +3 -1
- package/{types → generated/types}/src/function/EventObject.d.mts +2 -6
- package/generated/types/src/function/ForInAsync.d.mts +36 -0
- package/generated/types/src/function/ForInSync.d.mts +36 -0
- package/generated/types/src/function/ForOfAsync.d.mts +25 -0
- package/generated/types/src/function/ForOfSync.d.mts +36 -0
- package/generated/types/src/function/GetBufferFromRelativePath.d.mts +15 -0
- package/generated/types/src/function/GetFilesFromDir.d.mts +14 -0
- package/generated/types/src/function/GetMaxFilenameLength.d.mts +9 -0
- package/generated/types/src/function/GetModuleEsbuildPlatform.d.mts +13 -0
- package/{types → generated/types}/src/function/GetNamedImportAlias.d.mts +1 -1
- package/generated/types/src/function/GetRuntime.d.mts +2 -0
- package/generated/types/src/function/InstantiateAssemblyScript.d.mts +15 -0
- package/{types → generated/types}/src/function/IsAsync.d.mts +1 -1
- package/generated/types/src/function/IsInstanceOf.d.mts +25 -0
- package/generated/types/src/function/IsSameFile.d.mts +16 -0
- package/generated/types/src/function/IsStringLooksLikeAPath.d.mts +16 -0
- package/generated/types/src/function/IsTypeOf.d.mts +25 -0
- package/{types → generated/types}/src/function/LazyFactory.d.mts +9 -10
- package/generated/types/src/function/MonkeyPatch.d.mts +33 -0
- package/generated/types/src/function/NewAnimationTimeline.d.mts +24 -0
- package/generated/types/src/function/NewChainable.d.mts +35 -0
- package/generated/types/src/function/NewDynamicsExport.d.mts +49 -0
- package/generated/types/src/function/NewObjectWrapper.d.mts +10 -0
- package/generated/types/src/function/ObjectRegistrar.d.mts +17 -0
- package/generated/types/src/function/ParseSQLFile.d.mts +25 -0
- package/generated/types/src/function/PipeAsync.d.mts +19 -0
- package/generated/types/src/function/PipeSync.d.mts +17 -0
- package/generated/types/src/function/SafeImport.d.mts +21 -0
- package/generated/types/src/function/TemplateLiteral.d.mts +23 -0
- package/{types → generated/types}/src/function/Timeout.d.mts +1 -1
- package/{types → generated/types}/src/function/Tries.d.mts +4 -4
- package/{types → generated/types}/src/function/TryAsync.d.mts +2 -2
- package/{types → generated/types}/src/function/TryNew.d.mts +1 -1
- package/generated/types/src/function/TsToMjs.d.mts +27 -0
- package/generated/types/src/function/UniqueFSTempName.d.mts +9 -0
- package/generated/types/src/function/errorToMessage.d.mts +5 -0
- package/generated/types/src/neinth/VivthyNeinth.d.mts +202 -0
- package/generated/types/src/typehints/ArrayToKeys.d.mts +23 -0
- package/generated/types/src/typehints/AssemblyScriptExportsType.d.mts +4 -0
- package/generated/types/src/typehints/AssemblyScriptLoaderInstantiate.d.mts +4 -0
- package/generated/types/src/typehints/AutoDocASOptions.d.mts +15 -0
- package/generated/types/src/typehints/ChainableType.d.mts +3 -0
- package/generated/types/src/typehints/ComponentDecorator_Constructor.d.mts +3 -0
- package/generated/types/src/typehints/ConsoleAdditionalSettingType.d.mts +3 -0
- package/generated/types/src/typehints/Decorator.d.mts +11 -0
- package/generated/types/src/typehints/DecoratorMonkeyPatch.d.mts +15 -0
- package/{types/src/types → generated/types/src/typehints}/DevTestCB.d.mts +2 -2
- package/generated/types/src/typehints/EnvModeType.d.mts +4 -0
- package/generated/types/src/typehints/ListArg.d.mts +4 -0
- package/generated/types/src/typehints/MonkeyPatchedType.d.mts +1 -0
- package/generated/types/src/typehints/ParametersFollowingN.d.mts +13 -0
- package/generated/types/src/typehints/PrefixedKeysOf.d.mts +1 -0
- package/generated/types/src/typehints/Runtime.d.mts +4 -0
- package/generated/types/src/typehints/SafeImportReturnType.d.mts +1 -0
- package/generated/types/src/typehints/StylePropRefType.d.mts +2 -0
- package/generated/types/src/typehints/TemplateLiteralValueHandler.d.mts +10 -0
- package/generated/types/src/typehints/VLifecycleCallbacks.d.mts +6 -0
- package/generated/types/src/typehints/VivthCleanup.d.mts +12 -0
- package/generated/types/src/web/BrowserDirMapper.d.mts +70 -0
- package/generated/types/src/web/EnsureValidTag.d.mts +7 -0
- package/generated/types/src/web/ViteAddDynamics.d.mts +28 -0
- package/generated/types/src/web/ViteGetAllHTMLFile.d.mts +9 -0
- package/generated/types/src/web/WC_extendsA.d.mts +135 -0
- package/generated/types/src/web/WC_extendsB.d.mts +135 -0
- package/generated/types/src/web/bindings/WC_StyleProp_bind.d.mts +42 -0
- package/generated/types/src/web/bindings/WC_createElement_bind.d.mts +51 -0
- package/generated/types/src/web/bindings/WC_createNamedSlot.d.mts +26 -0
- package/generated/types/src/web/bindings/WC_litRender_bind.d.mts +20 -0
- package/generated/types/src/web/bindings/WC_litStyleMap.d.mts +7 -0
- package/generated/types/src/web/common/CSS.d.mts +23 -0
- package/generated/types/src/web/common/E.d.mts +41 -0
- package/generated/types/src/web/common/NewStyleSheetAsync.d.mts +15 -0
- package/generated/types/src/web/common/NewStyleSheetSync.d.mts +15 -0
- package/generated/types/src/web/common/WC_TagName_type.d.mts +15 -0
- package/generated/types/src/web/signals/IsInViewPortSignal.d.mts +52 -0
- package/generated/types/src/web/signals/ObserverSignal.d.mts +32 -0
- package/generated/types/src/web/signals/WC_litRef.d.mts +26 -0
- package/generated/types/src/web/signals/WC_loopedSiblingsRef.d.mts +44 -0
- package/generated/vivth/exports/all.mjs +233 -0
- package/generated/vivth/exports/neutral.mjs +193 -0
- package/generated/vivth/exports/node.mjs +46 -0
- package/package.json +50 -14
- package/src/bundler/CompileAS.mjs +36 -0
- package/src/bundler/CompileJS.mjs +98 -171
- package/src/bundler/CreateESPlugin.mjs +1 -1
- package/src/bundler/EsBundler.mjs +38 -13
- package/src/bundler/FSAnalyzer.mjs +253 -0
- package/src/bundler/FSasar.bundled.mjs +128 -0
- package/src/bundler/FSasar.mjs +96 -0
- package/src/bundler/FileSelfMapper.mjs +491 -0
- package/src/bundler/JSDirMapper.mjs +528 -0
- package/src/bundler/RunWatchThenCompileJSOnSafeExit.mjs +129 -0
- package/src/bundler/adds/BrowserExternals.mjs +37 -0
- package/src/bundler/adds/CreateTransform.mjs +36 -0
- package/src/bundler/adds/LastEditedUnix.mjs +12 -0
- package/src/bundler/adds/NodeModuleList.mjs +33 -0
- package/src/bundler/adds/PathFSBundles.bundled.mjs +41 -0
- package/src/bundler/adds/PathFSBundles.mjs +91 -0
- package/src/bundler/adds/PathFSDir.bundled.mjs +53 -0
- package/src/bundler/adds/PathFSDir.mjs +100 -0
- package/src/bundler/adds/PathFSFile.bundled.mjs +40 -0
- package/src/bundler/adds/PathFSFile.mjs +85 -0
- package/src/bundler/adds/ToBundledJSPlugin.mjs +116 -55
- package/src/bundler/adds/autoExternalize.mjs +81 -0
- package/src/bundler/adds/emptyBufferValue.mjs +5 -0
- package/src/bundler/adds/isModuleTheBundledVersion.mjs +10 -0
- package/src/bundler/adds/onEndEsBuildErrorLogger.mjs +34 -0
- package/src/bundler/adds/resolveJSDependencyPath.mjs +17 -0
- package/src/class/AwaitSignal.mjs +119 -0
- package/src/class/Console.mjs +36 -14
- package/src/class/DataLog.mjs +29 -0
- package/src/class/Derived.mjs +67 -55
- package/src/class/Effect.mjs +270 -84
- package/src/class/EnvSignal.mjs +11 -8
- package/src/class/EsWatcher.mjs +60 -0
- package/src/class/EventSignal.mjs +46 -58
- package/src/class/FSDirArchWatcher.mjs +246 -0
- package/src/class/FileSafe.mjs +72 -24
- package/src/class/ForEach.mjs +78 -0
- package/src/class/ForSignal.mjs +115 -0
- package/src/class/GetterSetter.mjs +40 -0
- package/src/class/JSONFileHandler.mjs +90 -0
- package/src/class/ListSignal.mjs +68 -26
- package/src/class/LitExp.mjs +59 -36
- package/src/class/ObjectSignal.mjs +225 -0
- package/src/class/Paths.mjs +56 -20
- package/src/class/Prettivy.mjs +51 -0
- package/src/class/QChannel.mjs +48 -26
- package/src/class/SafeExit.mjs +156 -99
- package/src/class/Setup.mjs +28 -16
- package/src/class/Signal.mjs +50 -27
- package/src/class/SignalCollection.mjs +130 -0
- package/src/class/WalkThrough.mjs +6 -23
- package/src/class/{WorkerMainThreadBundled.mjs → WorkerMainThread.bundled.mjs} +56 -77
- package/src/class/WorkerMainThread.mjs +98 -94
- package/src/class/WorkerThread.mjs +24 -17
- package/src/common/Base64URL.mjs +6 -3
- package/src/common/Base64URLFromFile.mjs +17 -4
- package/src/common/BundledV.bundled.mjs +7 -0
- package/src/common/BundledV.mjs +45 -0
- package/src/common/CreateStringID.mjs +8 -7
- package/src/common/EnvMode.mjs +172 -0
- package/src/common/FactoryKey.mjs +11 -0
- package/src/common/Preferrence.mjs +27 -0
- package/src/common/Trace.mjs +1 -1
- package/src/common/TracePath.mjs +53 -3
- package/src/common/VivthUnBundledCodeBlock.mjs +8 -0
- package/src/doc/JSautoDOC.mjs +673 -284
- package/src/doc/cleanPreserveTypedef.mjs +27 -0
- package/src/doc/correctBeforeParse.mjs +57 -48
- package/src/doc/{parsedFile.mjs → parsedFileForDOC.mjs} +133 -120
- package/src/function/ClearRequireCache.mjs +33 -0
- package/src/function/CreateImmutable.mjs +40 -37
- package/src/function/EventCheck.mjs +5 -2
- package/src/function/EventObject.mjs +2 -6
- package/src/function/ForInAsync.mjs +76 -0
- package/src/function/ForInSync.mjs +87 -0
- package/src/function/ForOfAsync.mjs +61 -0
- package/src/function/ForOfSync.mjs +70 -0
- package/src/function/GetBufferFromRelativePath.mjs +25 -0
- package/src/function/GetFilesFromDir.mjs +49 -0
- package/src/function/GetMaxFilenameLength.mjs +32 -0
- package/src/function/GetModuleEsbuildPlatform.mjs +118 -0
- package/src/function/GetNamedImportAlias.mjs +2 -2
- package/src/function/GetRuntime.mjs +10 -14
- package/src/function/InstantiateAssemblyScript.mjs +22 -0
- package/src/function/IsAsync.mjs +1 -1
- package/src/function/IsInstanceOf.mjs +29 -0
- package/src/function/IsSameFile.mjs +41 -0
- package/src/function/IsStringLooksLikeAPath.mjs +20 -0
- package/src/function/IsTypeOf.mjs +27 -0
- package/src/function/IsTypeOf.mts +31 -0
- package/src/function/LazyFactory.mjs +25 -23
- package/src/function/MonkeyPatch.mjs +38 -0
- package/src/function/NewAnimationTimeline.mjs +55 -0
- package/src/function/NewChainable.mjs +69 -0
- package/src/function/NewDynamicsExport.mjs +312 -0
- package/src/function/NewObjectWrapper.mjs +14 -0
- package/src/function/ObjectRegistrar.mjs +23 -0
- package/src/function/ParseSQLFile.mjs +129 -0
- package/src/function/PipeAsync.mjs +30 -0
- package/src/function/PipeSync.mjs +28 -0
- package/src/function/SafeImport.mjs +77 -0
- package/src/function/TemplateLiteral.mjs +42 -23
- package/src/function/Timeout.mjs +4 -4
- package/src/function/Tries.mjs +22 -16
- package/src/function/TryAsync.mjs +3 -2
- package/src/function/TryNew.mjs +1 -1
- package/src/function/TsToMjs.mjs +184 -21
- package/src/function/UniqueFSTempName.mjs +33 -0
- package/src/function/errorToMessage.mjs +21 -0
- package/src/function/resolveErrorArray.mjs +15 -1
- package/src/neinth/VivthyNeinth.mjs +487 -0
- package/src/typehints/ArrayToKeys.mjs +17 -0
- package/src/typehints/ArrayToKeys.mts +31 -0
- package/src/typehints/AssemblyScriptExportsType.mjs +7 -0
- package/src/typehints/AssemblyScriptLoaderInstantiate.mjs +7 -0
- package/src/typehints/AutoDocASOptions.mjs +14 -0
- package/src/typehints/ChainableType.mjs +11 -0
- package/src/typehints/ComponentDecorator_Constructor.mjs +10 -0
- package/src/typehints/ConsoleAdditionalSettingType.mjs +6 -0
- package/src/typehints/Decorator.mjs +9 -0
- package/src/typehints/Decorator.mts +31 -0
- package/src/typehints/DecoratorMonkeyPatch.mjs +10 -0
- package/src/typehints/DecoratorMonkeyPatch.mts +43 -0
- package/src/{types → typehints}/DevTestCB.mjs +2 -2
- package/src/typehints/EnvModeType.mjs +6 -0
- package/src/{types → typehints}/ListArg.mjs +1 -1
- package/src/{types → typehints}/LitExpResultType.mjs +1 -1
- package/src/typehints/MonkeyPatchedType.mjs +13 -0
- package/src/typehints/ParametersFollowingN.mjs +8 -0
- package/src/typehints/ParametersFollowingN.mts +17 -0
- package/src/typehints/PrefixedKeysOf.mjs +9 -0
- package/src/typehints/Runtime.mjs +6 -0
- package/src/typehints/SafeImportReturnType.mjs +6 -0
- package/src/typehints/StylePropRefType.mjs +12 -0
- package/src/typehints/TemplateLiteralValueHandler.mjs +14 -0
- package/src/typehints/VLifecycleCallbacks.mjs +10 -0
- package/src/typehints/VivthCleanup.mjs +14 -0
- package/src/web/BrowserDirMapper.mjs +255 -0
- package/src/web/EnsureValidTag.mjs +5 -0
- package/src/web/EnsureValidTag.mts +10 -0
- package/src/web/ViteAddDynamics.mjs +34 -0
- package/src/web/ViteGetAllHTMLFile.mjs +97 -0
- package/src/web/WC_extendsA.mjs +330 -0
- package/src/web/WC_extendsB.mjs +332 -0
- package/src/web/bindings/WC_StyleProp_bind.mjs +70 -0
- package/src/web/bindings/WC_createElement_bind.mjs +95 -0
- package/src/web/bindings/WC_createNamedSlot.mjs +29 -0
- package/src/web/bindings/WC_litRender_bind.mjs +26 -0
- package/src/web/bindings/WC_litStyleMap.mjs +14 -0
- package/src/web/common/CSS.mjs +35 -0
- package/src/web/common/E.mjs +126 -0
- package/src/web/common/NewStyleSheetAsync.mjs +21 -0
- package/src/web/common/NewStyleSheetSync.mjs +21 -0
- package/src/web/common/WC_TagName_type.mjs +10 -0
- package/src/web/common/WC_TagName_type.mts +36 -0
- package/src/web/signals/IsInViewPortSignal.mjs +140 -0
- package/src/web/signals/ObserverSignal.mjs +93 -0
- package/src/web/signals/WC_litRef.mjs +61 -0
- package/src/web/signals/WC_loopedSiblingsRef.mjs +100 -0
- package/tsconfig.json +44 -41
- package/index.mjs +0 -91
- package/src/bundler/FSInline.mjs +0 -67
- package/src/bundler/FSInlineAnalyzer.mjs +0 -228
- package/src/bundler/FSInlineBundled.mjs +0 -38
- package/src/bundler/adds/externals.mjs +0 -8
- package/src/class/ListDerived.mjs +0 -42
- package/src/common/Dev.mjs +0 -142
- package/src/common/DevBundled.mjs +0 -5
- package/src/common/lazie.mjs +0 -3
- package/src/types/IsListSignal.mjs +0 -6
- package/src/types/Runtime.mjs +0 -6
- package/src/types/VivthDevCodeBlockStringType.mjs +0 -6
- package/types/index.d.mts +0 -58
- package/types/src/bundler/CompileJS.d.mts +0 -119
- package/types/src/bundler/FSInline.d.mts +0 -50
- package/types/src/bundler/FSInlineAnalyzer.d.mts +0 -37
- package/types/src/bundler/FSInlineBundled.d.mts +0 -22
- package/types/src/bundler/adds/externals.d.mts +0 -1
- package/types/src/class/Console.d.mts +0 -71
- package/types/src/class/Derived.d.mts +0 -98
- package/types/src/class/Effect.d.mts +0 -216
- package/types/src/class/ListDerived.d.mts +0 -38
- package/types/src/class/Paths.d.mts +0 -69
- package/types/src/class/SafeExit.d.mts +0 -103
- package/types/src/class/WorkerMainThreadBundled.d.mts +0 -83
- package/types/src/common/Base64URLFromFile.d.mts +0 -16
- package/types/src/common/Dev.d.mts +0 -68
- package/types/src/common/DevBundled.d.mts +0 -3
- package/types/src/common/lazie.d.mts +0 -1
- package/types/src/doc/JSautoDOC.d.mts +0 -83
- package/types/src/function/GetRuntime.d.mts +0 -2
- package/types/src/function/TemplateLiteral.d.mts +0 -22
- package/types/src/function/TsToMjs.d.mts +0 -23
- package/types/src/types/IsListSignal.d.mts +0 -4
- package/types/src/types/ListArg.d.mts +0 -4
- package/types/src/types/Runtime.d.mts +0 -4
- package/types/src/types/VivthDevCodeBlockStringType.d.mts +0 -4
- /package/{types → generated/types}/src/bundler/adds/pluginVivthBundle.d.mts +0 -0
- /package/{types → generated/types}/src/class/WorkerResult.d.mts +0 -0
- /package/{types → generated/types}/src/common/EventNameSpace.d.mts +0 -0
- /package/{types → generated/types}/src/common/eventObjects.d.mts +0 -0
- /package/{types → generated/types}/src/common/keys.d.mts +0 -0
- /package/{types → generated/types}/src/doc/correctBeforeParse.d.mts +0 -0
- /package/{types → generated/types}/src/function/TrySync.d.mts +0 -0
- /package/{types → generated/types}/src/function/resolveErrorArray.d.mts +0 -0
- /package/{types/src/types → generated/types/src/typehints}/AnyButUndefined.d.mts +0 -0
- /package/{types/src/types → generated/types/src/typehints}/ExtnameType.d.mts +0 -0
- /package/{types/src/types → generated/types/src/typehints}/LitExpKeyType.d.mts +0 -0
- /package/{types/src/types → generated/types/src/typehints}/LitExpResultType.d.mts +0 -0
- /package/{types/src/types → generated/types/src/typehints}/MutationType.d.mts +0 -0
- /package/{types/src/types → generated/types/src/typehints}/QCBFIFOReturn.d.mts +0 -0
- /package/{types/src/types → generated/types/src/typehints}/QCBReturn.d.mts +0 -0
- /package/src/{types → typehints}/AnyButUndefined.mjs +0 -0
- /package/src/{types → typehints}/ExtnameType.mjs +0 -0
- /package/src/{types → typehints}/LitExpKeyType.mjs +0 -0
- /package/src/{types → typehints}/MutationType.mjs +0 -0
- /package/src/{types → typehints}/QCBFIFOReturn.mjs +0 -0
- /package/src/{types → typehints}/QCBReturn.mjs +0 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('../bundler/FileSelfMapper.mjs').VivthCleanup} VivthCleanup
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @description
|
|
6
|
+
* - alternative to `neinth`;
|
|
7
|
+
* @template {any} EXPORT
|
|
8
|
+
* @implements {VivthCleanup}
|
|
9
|
+
*/
|
|
10
|
+
export class VivthyNeinth<EXPORT extends unknown> implements VivthCleanup {
|
|
11
|
+
/**
|
|
12
|
+
* @type {QChannel<string>}
|
|
13
|
+
*/
|
|
14
|
+
static #q: QChannel<string>;
|
|
15
|
+
static #hasStarted: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @type {Map<string, VivthyNeinth<any>>}
|
|
18
|
+
*/
|
|
19
|
+
static #mappedInstance: Map<string, VivthyNeinth<any>>;
|
|
20
|
+
/**
|
|
21
|
+
* @type {Parameters<typeof VivthyNeinth["start"]>[0]["assemblyScriptOptions"]}
|
|
22
|
+
*/
|
|
23
|
+
static #assemblyScriptOptions: Parameters<(typeof VivthyNeinth)["start"]>[0]["assemblyScriptOptions"];
|
|
24
|
+
/**
|
|
25
|
+
* @description
|
|
26
|
+
* - DO NOT CALL THIS METHOD INSIDE
|
|
27
|
+
* @param {Object} options
|
|
28
|
+
* @param {string} options.dirPath
|
|
29
|
+
* @param {import('../typehints/AutoDocASOptions.mjs').AutoDocASOptions} [options.assemblyScriptOptions]
|
|
30
|
+
* @returns {ReturnType<typeof TryAsync<void>>}
|
|
31
|
+
*/
|
|
32
|
+
static start: ({ dirPath, assemblyScriptOptions }: {
|
|
33
|
+
dirPath: string;
|
|
34
|
+
assemblyScriptOptions?: import("../typehints/AutoDocASOptions.mjs").AutoDocASOptions | undefined;
|
|
35
|
+
}) => ReturnType<typeof TryAsync<void>>;
|
|
36
|
+
/**
|
|
37
|
+
* @param {import('chokidar/handler.js').EventName} eventName
|
|
38
|
+
* @param {string} path
|
|
39
|
+
* @param {import('node:fs').Stats} [stats]
|
|
40
|
+
*/
|
|
41
|
+
static #watcherListenerQ: (eventName: import("chokidar/handler.js").EventName, path: string, stats?: import("node:fs").Stats) => Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* @param {import('chokidar/handler.js').EventName} eventName
|
|
44
|
+
* @param {string} path
|
|
45
|
+
* @param {import('node:fs').Stats} [stats]
|
|
46
|
+
* @returns {void}
|
|
47
|
+
*/
|
|
48
|
+
static #watcherListener: (eventName: import("chokidar/handler.js").EventName, path: string, stats?: import("node:fs").Stats) => void;
|
|
49
|
+
/**
|
|
50
|
+
* @param {'add'|'change'} _eventName
|
|
51
|
+
* @param {string} path
|
|
52
|
+
* @param {import('node:fs').Stats} [_stats]
|
|
53
|
+
* @returns {Promise<void>}
|
|
54
|
+
*/
|
|
55
|
+
static #addListener: (_eventName: "add" | "change", path: string, _stats?: import("node:fs").Stats) => Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* @param {string} _eventName
|
|
58
|
+
* @param {string} path
|
|
59
|
+
* @param {import('node:fs').Stats} [_stats]
|
|
60
|
+
* @returns {Promise<void>}
|
|
61
|
+
*/
|
|
62
|
+
static #negativeListener: (_eventName: string, path: string, _stats?: import("node:fs").Stats) => Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* @param {string} path
|
|
65
|
+
* @returns {Promise<void>}
|
|
66
|
+
*/
|
|
67
|
+
static #ifPrevInstanceExistThenCleanup_: (path: string) => Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* @param {Object} options
|
|
70
|
+
* @param {(this:VivthyNeinth<EXPORT>, arg0:VivthyNeinth<EXPORT>)=>Promise<EXPORT>} options.export
|
|
71
|
+
* @param {boolean} [options.I__the_developer__have_provided_onFileMutations_cleanupCallbacks_for_every_long_running_object_in_this_file]
|
|
72
|
+
*/
|
|
73
|
+
constructor({ export: exportCallback, I__the_developer__have_provided_onFileMutations_cleanupCallbacks_for_every_long_running_object_in_this_file, }: {
|
|
74
|
+
export: (this: VivthyNeinth<EXPORT>, arg0: VivthyNeinth<EXPORT>) => Promise<EXPORT>;
|
|
75
|
+
I__the_developer__have_provided_onFileMutations_cleanupCallbacks_for_every_long_running_object_in_this_file?: boolean | undefined;
|
|
76
|
+
});
|
|
77
|
+
/**
|
|
78
|
+
* @type { string }
|
|
79
|
+
*/
|
|
80
|
+
path: string;
|
|
81
|
+
/**
|
|
82
|
+
* @description
|
|
83
|
+
* - use this to update export value;
|
|
84
|
+
* - `WARNING`: this instance setter are accesible from outside, including importer;
|
|
85
|
+
* >- usefull for treating `VivthyNeinth` instance as global signal;
|
|
86
|
+
* >- you can accidentally ;
|
|
87
|
+
* @param {EXPORT|undefined} newExportValue
|
|
88
|
+
* @returns {void}
|
|
89
|
+
* @example
|
|
90
|
+
*/
|
|
91
|
+
set exportedValue(newExportValue: EXPORT | undefined);
|
|
92
|
+
/**
|
|
93
|
+
* @description
|
|
94
|
+
* - use this to listen to dependency changes(inside `Effect`);
|
|
95
|
+
* @returns {Promise<Derived<EXPORT|undefined>>}
|
|
96
|
+
* @example
|
|
97
|
+
*/
|
|
98
|
+
get listener(): Promise<Derived<EXPORT | undefined>>;
|
|
99
|
+
/**
|
|
100
|
+
* @description
|
|
101
|
+
* - generate autoCleaned `Signal` instance;
|
|
102
|
+
* @example
|
|
103
|
+
* /// on VivthyNeinth callback scope
|
|
104
|
+
* const { newSignal } = this;
|
|
105
|
+
* const numberSignal = newSignal(1);
|
|
106
|
+
* ///
|
|
107
|
+
*/
|
|
108
|
+
newSignal: <A extends unknown>(obj: A) => Signal<A>;
|
|
109
|
+
/**
|
|
110
|
+
* @description
|
|
111
|
+
* - generate autoCleaned `Effect` instance;
|
|
112
|
+
* @example
|
|
113
|
+
* /// on VivthyNeinth callback scope
|
|
114
|
+
* const { newEffect } = this;
|
|
115
|
+
* const numberSignal = newSignal(1);
|
|
116
|
+
* const effer = newEffect(async({subscribe})=>{
|
|
117
|
+
* const numberSignalValue = subscribe(numberSignal).value;
|
|
118
|
+
* });
|
|
119
|
+
* ///
|
|
120
|
+
*/
|
|
121
|
+
newEffect: (callback: (arg0: Effect["options"]) => Promise<void>) => Effect;
|
|
122
|
+
/**
|
|
123
|
+
* @description
|
|
124
|
+
* - generate autoCleaned `Derived` instance;
|
|
125
|
+
* @example
|
|
126
|
+
* /// on VivthyNeinth callback scope
|
|
127
|
+
* const { newDerived } = this;
|
|
128
|
+
* const effer = newDerived(async({subscribe})=>{
|
|
129
|
+
* const numberSignalValue = subscribe(numberSignal).value;
|
|
130
|
+
* return numberSignalValue * 2;
|
|
131
|
+
* });
|
|
132
|
+
* ///
|
|
133
|
+
*/
|
|
134
|
+
newDerived: <CB extends ConstructorParameters<typeof Derived>[0]>(callback: CB) => Derived<any>;
|
|
135
|
+
/**
|
|
136
|
+
* @description
|
|
137
|
+
* - manually registering object celeanup;
|
|
138
|
+
* @param {()=>Promise<void>} callback
|
|
139
|
+
* @returns {void}
|
|
140
|
+
* @example
|
|
141
|
+
* import { watch } from 'chokidar';
|
|
142
|
+
*
|
|
143
|
+
* /// on VivthyNeinth export callback scope
|
|
144
|
+
* const watcher = watch('D://my/dir/path');
|
|
145
|
+
* // preferably to declare the cleanup right bellow it's object creation;
|
|
146
|
+
* // set 'I__the_developer__have_provided_onFileMutations_cleanupCallbacks_for_every_long_running_object_in_this_file' to false if you might want to save before full cleanup is written;
|
|
147
|
+
* this.onMutate(async () => {
|
|
148
|
+
* watcher.removeAllListeners();
|
|
149
|
+
* watcher.close();
|
|
150
|
+
* });
|
|
151
|
+
*
|
|
152
|
+
* watcher.addListener('all', (eventName, path, stats) => {
|
|
153
|
+
* //
|
|
154
|
+
* })
|
|
155
|
+
* ///
|
|
156
|
+
* // alternative: use vivth `modules` that returns object that implements `VivthCleanup`;
|
|
157
|
+
* // and call uses `registerObjectWithAutoCleanup`;
|
|
158
|
+
*/
|
|
159
|
+
onMutate: (callback: () => Promise<void>) => void;
|
|
160
|
+
/**
|
|
161
|
+
* @description
|
|
162
|
+
* - process SafeExit;
|
|
163
|
+
* @param {()=>Promise<void>} callback
|
|
164
|
+
* @returns {void}
|
|
165
|
+
* @example
|
|
166
|
+
* import { Console } from 'vivth/neutral';
|
|
167
|
+
*
|
|
168
|
+
* /// on VivthyNeinth export callback scope
|
|
169
|
+
* this.onExit(async()=>{
|
|
170
|
+
* Console.log('main process ends');
|
|
171
|
+
* })
|
|
172
|
+
* ///
|
|
173
|
+
*/
|
|
174
|
+
onExit: (callback: () => Promise<void>) => void;
|
|
175
|
+
/**
|
|
176
|
+
* @description
|
|
177
|
+
* - register premade cleanup `vivthCleanup` method to `VivthyNeinth` lifecycle;
|
|
178
|
+
* @template {Object} OBJ
|
|
179
|
+
* @param { OBJ & VivthCleanup } obj
|
|
180
|
+
* @returns {OBJ}
|
|
181
|
+
* @example
|
|
182
|
+
* import { EsWatcher } from "vivth/node";
|
|
183
|
+
*
|
|
184
|
+
* /// on VivthyNeinth export callback scope
|
|
185
|
+
* const esWatcherInstance = this.registerObjectWithAutoCleanup(new EsWatcher({
|
|
186
|
+
* ...buildOptions,
|
|
187
|
+
* }));
|
|
188
|
+
* ///
|
|
189
|
+
*/
|
|
190
|
+
registerObjectWithAutoCleanup<OBJ extends Object>(obj: OBJ & VivthCleanup): OBJ;
|
|
191
|
+
/**
|
|
192
|
+
* @returns {Promise<void>}
|
|
193
|
+
*/
|
|
194
|
+
vivthCleanup: () => Promise<void>;
|
|
195
|
+
#private;
|
|
196
|
+
}
|
|
197
|
+
export type VivthCleanup = import("../bundler/FileSelfMapper.mjs").VivthCleanup;
|
|
198
|
+
import { Derived } from '../class/Derived.mjs';
|
|
199
|
+
import { Signal } from '../class/Signal.mjs';
|
|
200
|
+
import { Effect } from '../class/Effect.mjs';
|
|
201
|
+
import { QChannel } from '../class/QChannel.mjs';
|
|
202
|
+
import { TryAsync } from '../function/TryAsync.mjs';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description
|
|
3
|
+
* - Internal utility to deduplicate a tuple
|
|
4
|
+
*/
|
|
5
|
+
export type Deduplicate<T extends readonly unknown[], ACC extends readonly unknown[] = []> = T extends readonly [infer Head, ...infer Tail] ? Head extends ACC[number] ? Deduplicate<Tail, ACC> : Deduplicate<Tail, readonly [...ACC, Head]> : ACC;
|
|
6
|
+
/**
|
|
7
|
+
* @preserve
|
|
8
|
+
* @description
|
|
9
|
+
* - extract unique string from ArrayString[];
|
|
10
|
+
* - Takes an array/tuple type and returns a unique UNION of its elements.
|
|
11
|
+
* ```ts
|
|
12
|
+
* const a = ['hi', 'there'] as const;
|
|
13
|
+
* const check = (aa:ArrayToKeys<typeof a>) => {};
|
|
14
|
+
* ```
|
|
15
|
+
* ```js
|
|
16
|
+
* const a = /** [at]type {const} *[blank]/ (['hi', 'there']);
|
|
17
|
+
* /** [at]param {ArrayToKeys<typeof a>} aa *[blank]/
|
|
18
|
+
* const check = (aa) => {};
|
|
19
|
+
* ```
|
|
20
|
+
* @template {readonly unknown[]} T
|
|
21
|
+
* @[blank]typedef {import('./ArrayToKeys.mts').ArrayToKeys<T>} ArrayToKeys
|
|
22
|
+
*/
|
|
23
|
+
export type ArrayToKeys<T extends readonly unknown[]> = Deduplicate<T>[number];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type AutoDocASOptions = {
|
|
2
|
+
/**
|
|
3
|
+
* - `true`: will generate `${fileName}.mjs` that uses `FSasar`;
|
|
4
|
+
* >- upon compiling with `vivth` it should be embeded as inline buffer;
|
|
5
|
+
* - `false`: does nothing;
|
|
6
|
+
* - on both cases, the `${fileName}.js` can be used for both browser or nodeJS compatibel runtime;
|
|
7
|
+
*/
|
|
8
|
+
generateFSasarImporter?: boolean | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* - `argv` for assembley script compiler (`asc.main`), excluding `inputPath`, `--outputFile`, `--bindings`;
|
|
11
|
+
* >- `--bindings`: strictly using `esm`;
|
|
12
|
+
*/
|
|
13
|
+
ASArgv?: string[] | undefined;
|
|
14
|
+
ASAPIOptions?: Parameters<typeof import("../bundler/CompileAS.mjs").CompileAS>[1];
|
|
15
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ThisParameterOfOrUnknown } from './DecoratorMonkeyPatch.mts';
|
|
2
|
+
/**
|
|
3
|
+
* @preserve
|
|
4
|
+
* @description
|
|
5
|
+
* - type helper to create decorator;
|
|
6
|
+
* >- matches argument with host method;
|
|
7
|
+
* @template {(...args: any[]) => any} OriginalFn - The original method type;
|
|
8
|
+
* @template {readonly unknown[]} DecoratorArgs - Tuple of custom decorator arguments;
|
|
9
|
+
* @[blank]typedef {import('./Decorator.mts').Decorator<OriginalFn, DecoratorArgs>} Decorator
|
|
10
|
+
*/
|
|
11
|
+
export type Decorator<OriginalFn extends (this: any, ...args: any[]) => any, DecoratorArgs extends readonly unknown[] = []> = DecoratorArgs['length'] extends 0 ? (target: OriginalFn, context: ClassMethodDecoratorContext<ThisParameterOfOrUnknown<OriginalFn>, OriginalFn>) => ((this: ThisParameterOfOrUnknown<OriginalFn>, ...args: Parameters<OriginalFn>) => any) | void : (...args: DecoratorArgs) => (target: OriginalFn, context: ClassMethodDecoratorContext<ThisParameterOfOrUnknown<OriginalFn>, OriginalFn>) => ((this: ThisParameterOfOrUnknown<OriginalFn>, ...args: Parameters<OriginalFn>) => any) | void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility to extract the 'this' context from a function, defaulting to unknown.
|
|
3
|
+
*/
|
|
4
|
+
export type ThisParameterOfOrUnknown<T> = T extends (this: infer U, ...args: any[]) => any ? U : unknown;
|
|
5
|
+
/**
|
|
6
|
+
* @preserve
|
|
7
|
+
* @description
|
|
8
|
+
* - type helper to create decorator for monkeypatching class/instance method;
|
|
9
|
+
* >- matches argument with host method;
|
|
10
|
+
* >- matches return type with host method;
|
|
11
|
+
* @template {(...args: any[]) => any} OriginalFn - The original method type;
|
|
12
|
+
* @template {readonly unknown[]} DecoratorArgs - Tuple of custom decorator arguments;
|
|
13
|
+
* @[blank]typedef {import('./DecoratorMonkeyPatch.mts').DecoratorMonkeyPatch<OriginalFn, DecoratorArgs>} DecoratorMonkeyPatch
|
|
14
|
+
*/
|
|
15
|
+
export type DecoratorMonkeyPatch<OriginalFn extends (this: any, ...args: any[]) => any, DecoratorArgs extends readonly unknown[] = []> = DecoratorArgs['length'] extends 0 ? (target: OriginalFn, context: ClassMethodDecoratorContext<ThisParameterOfOrUnknown<OriginalFn>, OriginalFn>) => ((this: ThisParameterOfOrUnknown<OriginalFn>, ...args: Parameters<OriginalFn>) => ReturnType<OriginalFn>) | void : (...args: DecoratorArgs) => (target: OriginalFn, context: ClassMethodDecoratorContext<ThisParameterOfOrUnknown<OriginalFn>, OriginalFn>) => ((this: ThisParameterOfOrUnknown<OriginalFn>, ...args: Parameters<OriginalFn>) => ReturnType<OriginalFn>) | void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type DevTestCB = (testName: string, testCallback: () => Promise<boolean>) =>
|
|
1
|
+
export type DevTestCB = (testName: string, testCallback: () => Promise<boolean>) => {
|
|
2
2
|
removeId: () => void;
|
|
3
|
-
}
|
|
3
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type MonkeyPatchedType<ORIOBJ extends unknown> = ORIOBJ extends (...args: infer A) => infer R ? (...args: A) => R : ORIOBJ extends abstract new (...args: infer C) => infer I ? abstract new (...args: C) => I : any;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility: build a tuple of length N filled with type T (default = any).
|
|
3
|
+
*/
|
|
4
|
+
export type TupleOfLength<N extends number, T = any, R extends any[] = []> = R['length'] extends N ? R : TupleOfLength<N, T, [...R, T]>;
|
|
5
|
+
/**
|
|
6
|
+
* @preserve
|
|
7
|
+
* @description
|
|
8
|
+
* - Drop the first N parameters from METHOD and return the rest;
|
|
9
|
+
* @template {(...args: any[]) => any} METHOD
|
|
10
|
+
* @template {number} N
|
|
11
|
+
* @[blank]typedef {import('./ParametersFollowingN.mts').ParametersFollowingN<N, METHOD>} ParametersFollowingN
|
|
12
|
+
*/
|
|
13
|
+
export type ParametersFollowingN<METHOD extends (...args: any[]) => any, N extends number> = Parameters<METHOD> extends [...TupleOfLength<N>, ...infer Rest] ? Rest : [];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type PrefixedKeysOf<T extends unknown, Prefix extends string> = Extract<keyof T, `${Prefix}${string}`>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type SafeImportReturnType<IMPORTTARGET extends unknown> = Awaited<ReturnType<typeof import("../function/SafeImport.mjs").SafeImport<IMPORTTARGET>>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* - type helper for typing `vivth.TemplateLiteral`;
|
|
3
|
+
*/
|
|
4
|
+
export type TemplateLiteralValueHandler<INPUTTYPE extends unknown> = (arg0: {
|
|
5
|
+
currentValue: INPUTTYPE;
|
|
6
|
+
index: number;
|
|
7
|
+
templateStringsArray: TemplateStringsArray;
|
|
8
|
+
valuesArrays: INPUTTYPE[];
|
|
9
|
+
inputLength: number;
|
|
10
|
+
}) => (string | Promise<string>);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type VLifecycleCallbacks<TAGNAME extends keyof HTMLElementTagNameMap> = {
|
|
2
|
+
onConnected?: ((this: HTMLElementTagNameMap[TAGNAME], defer: (onDisconnected: () => void) => void) => void) | undefined;
|
|
3
|
+
onDisconnected?: ((this: HTMLElementTagNameMap[TAGNAME]) => void) | undefined;
|
|
4
|
+
onAdopted?: ((this: HTMLElementTagNameMap[TAGNAME], defer: (onDisconnected: () => void) => void) => void) | undefined;
|
|
5
|
+
onAttributeChanged?: ((this: HTMLElementTagNameMap[TAGNAME], name: string, oldValue: string, newValue: string) => void) | undefined;
|
|
6
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* - you can call:
|
|
3
|
+
* ```js
|
|
4
|
+
* something.vivthCleanup();
|
|
5
|
+
* ```
|
|
6
|
+
* >- class that implements this;
|
|
7
|
+
* >- function that have this as part of it's return;
|
|
8
|
+
* - to clean up that object, usually a long lived process;
|
|
9
|
+
*/
|
|
10
|
+
export type VivthCleanup = {
|
|
11
|
+
vivthCleanup: () => Promise<any>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('../typehints/VivthCleanup.mjs').VivthCleanup} VivthCleanup
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @description
|
|
6
|
+
* - class helper to map dynamic mjs files;
|
|
7
|
+
* >- includes `mts` file too;
|
|
8
|
+
* @implements {VivthCleanup}
|
|
9
|
+
*/
|
|
10
|
+
export class BrowserDirMapper implements VivthCleanup {
|
|
11
|
+
/**
|
|
12
|
+
* @description
|
|
13
|
+
* - instantiate the mapper;
|
|
14
|
+
* @param {Object} path
|
|
15
|
+
* @param {string} path.watch
|
|
16
|
+
* @param {string} path.mapTo
|
|
17
|
+
* @param {(normalizedPath:string)=>boolean} [path.eachFilter]
|
|
18
|
+
* @param {ConstructorParameters<typeof JSDirMapper>[1] &
|
|
19
|
+
* {
|
|
20
|
+
* debounce?:number,
|
|
21
|
+
* chokidarOptions?:import('chokidar').ChokidarOptions
|
|
22
|
+
* }
|
|
23
|
+
* } options
|
|
24
|
+
* @example
|
|
25
|
+
* import { BrowserDirMapper } from 'vivth/node'
|
|
26
|
+
* import { Paths, SafeExit, BrowserDirMapper } from 'vivth/neutral';
|
|
27
|
+
*
|
|
28
|
+
* new Paths({
|
|
29
|
+
* root: process.env.INIT_CWD ?? process.cwd(),
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* new SafeExit();
|
|
33
|
+
*
|
|
34
|
+
* new BrowserDirMapper(
|
|
35
|
+
* { mapTo: '/dist/', watch: '/src/' },
|
|
36
|
+
* {
|
|
37
|
+
* esbuild: {
|
|
38
|
+
* buildOptions: {
|
|
39
|
+
* minify: true,
|
|
40
|
+
* },
|
|
41
|
+
* },
|
|
42
|
+
* },
|
|
43
|
+
* );
|
|
44
|
+
*/
|
|
45
|
+
constructor({ watch, mapTo, eachFilter }: {
|
|
46
|
+
watch: string;
|
|
47
|
+
mapTo: string;
|
|
48
|
+
eachFilter?: ((normalizedPath: string) => boolean) | undefined;
|
|
49
|
+
}, options: ConstructorParameters<typeof JSDirMapper>[1] & {
|
|
50
|
+
debounce?: number;
|
|
51
|
+
chokidarOptions?: import("chokidar").ChokidarOptions;
|
|
52
|
+
});
|
|
53
|
+
vivthCleanup: () => Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* @description
|
|
56
|
+
* - `FSDirArchWatcher` instance;
|
|
57
|
+
* @type {FSDirArchWatcher<any>|undefined}
|
|
58
|
+
*/
|
|
59
|
+
dynamicDirWatcher: FSDirArchWatcher<any> | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* @description
|
|
62
|
+
* - `JSDirMapper` instance;
|
|
63
|
+
* @type {JSDirMapper<any>|undefined}
|
|
64
|
+
*/
|
|
65
|
+
dirMapper: JSDirMapper<any> | undefined;
|
|
66
|
+
#private;
|
|
67
|
+
}
|
|
68
|
+
export type VivthCleanup = import("../typehints/VivthCleanup.mjs").VivthCleanup;
|
|
69
|
+
import { FSDirArchWatcher } from '../class/FSDirArchWatcher.mjs';
|
|
70
|
+
import { JSDirMapper } from '../bundler/JSDirMapper.mjs';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { WC_TagName_type } from './common/WC_TagName_type.mts';
|
|
2
|
+
/**
|
|
3
|
+
* @preserve
|
|
4
|
+
* @template {string} T
|
|
5
|
+
* @[blank]typedef {import('./EnsureValidTag.mts').EnsureValidTag<T>} EnsureValidTag
|
|
6
|
+
*/
|
|
7
|
+
export type EnsureValidTag<T extends string> = WC_TagName_type<T> extends T ? T : 'INVALID_TAG_NAME';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description
|
|
3
|
+
* - `vite.rollup/down` plugin abstraction for [NewDynamicsExport](#newdynamicsexport);
|
|
4
|
+
* @param {Parameters<typeof NewDynamicsExport>} args
|
|
5
|
+
* @returns {import('vite').PluginOption}
|
|
6
|
+
*/
|
|
7
|
+
export function ViteAddDynamics(args_0: {
|
|
8
|
+
rootPath: string;
|
|
9
|
+
debounce?: number | undefined;
|
|
10
|
+
useFetchForAssets?: boolean | undefined;
|
|
11
|
+
chokidarOptions?: Partial<{
|
|
12
|
+
persistent: boolean;
|
|
13
|
+
ignoreInitial: boolean;
|
|
14
|
+
followSymlinks: boolean;
|
|
15
|
+
cwd?: string;
|
|
16
|
+
usePolling: boolean;
|
|
17
|
+
interval: number;
|
|
18
|
+
binaryInterval: number;
|
|
19
|
+
alwaysStat?: boolean;
|
|
20
|
+
depth?: number;
|
|
21
|
+
ignorePermissionErrors: boolean;
|
|
22
|
+
atomic: boolean | number;
|
|
23
|
+
} & {
|
|
24
|
+
ignored: import("chokidar").Matcher | import("chokidar").Matcher[];
|
|
25
|
+
awaitWriteFinish: boolean | Partial<import("chokidar").AWF>;
|
|
26
|
+
}> | undefined;
|
|
27
|
+
eachFilter?: ((normalizedPath: string) => boolean) | undefined;
|
|
28
|
+
}): import("vite").PluginOption;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description
|
|
3
|
+
* - Automatically discovers HTML files in a directory and maps them to input keys;
|
|
4
|
+
* - [Paths](#paths) needs to be instantiated;
|
|
5
|
+
* @param {string} dirPath - The absolute or relative path to the directory to scan.
|
|
6
|
+
* @param {string} distPath - The distribution folder name to exclude.
|
|
7
|
+
* @returns {import('vite').PluginOption}
|
|
8
|
+
*/
|
|
9
|
+
export function ViteGetAllHTMLFile(dirPath: string, distPath: string): import("vite").PluginOption;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import {ArrayToKeys} from '../typehints/ArrayToKeys.mjs'
|
|
3
|
+
* @import {WC_TagName_type} from './common/WC_TagName_type.mjs'
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {typeof import('../function/IsTypeOf.mjs').TypeMap} TypeMap
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @description
|
|
10
|
+
* - Generates a base class for Web Component definitions.
|
|
11
|
+
* - Note: This generator does not support `connectedMoveCallback`.
|
|
12
|
+
* For the needs of opting in to [connectedMoveCallback](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements) functionality, use [WC_extendsB](#wc_extendsb) instead.
|
|
13
|
+
* - This class relies heavily on complex type inference which can cause issues, during declaration file generation. To avoid "circular type" errors or build failures, set the following in your `tsconfig.json`:
|
|
14
|
+
* ```json
|
|
15
|
+
* {
|
|
16
|
+
* "compilerOptions": {
|
|
17
|
+
* "declaration": false
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
* - By disabling `declaration`, you prevent the TypeScript compiler from attempting to resolve and export the complex recursive type definitions generated by this factory;
|
|
22
|
+
* @template {new (...args: any[]) => HTMLElement} BASE_CONSTRUCTOR
|
|
23
|
+
* @template {{
|
|
24
|
+
* class?:string;
|
|
25
|
+
* style?:string;
|
|
26
|
+
* observedAttributes?: readonly string[];
|
|
27
|
+
* namedSlots?: readonly string[];
|
|
28
|
+
* props?: Record<string, keyof TypeMap|(new (...args:any[])=>any)>;
|
|
29
|
+
* }} STANDARD
|
|
30
|
+
* @template {(BASE_CONSTRUCTOR) & {
|
|
31
|
+
* tagName: string;
|
|
32
|
+
* extendIs: string;
|
|
33
|
+
* observedAttributes?: STANDARD["observedAttributes"];
|
|
34
|
+
* namedSlots?: STANDARD["namedSlots"];
|
|
35
|
+
* props?: STANDARD["props"];
|
|
36
|
+
* }} CREATEARGS
|
|
37
|
+
* @template { (new (...args: any[]) => InstanceType<BASE_CONSTRUCTOR> & {
|
|
38
|
+
* setObservedAttributes(attributes:Partial<
|
|
39
|
+
* Record<ArrayToKeys<STANDARD["observedAttributes"]extends readonly string[]
|
|
40
|
+
* ? STANDARD["observedAttributes"]
|
|
41
|
+
* :never>,
|
|
42
|
+
* string>
|
|
43
|
+
* >):void;
|
|
44
|
+
* props: NonNullable<NonNullable<Parameters<ReturnType<typeof WC_createElement_bind<CREATEARGS>>>[0]>["props"]>;
|
|
45
|
+
* adoptedCallback():void;
|
|
46
|
+
* connectedCallback():void;
|
|
47
|
+
* disonnectedCallback():void;
|
|
48
|
+
* attributeChangedCallback(name:ArrayToKeys<STANDARD["observedAttributes"]extends readonly string[]?STANDARD["observedAttributes"]:never>, oldValue:string|null, newValue:string|null): void;
|
|
49
|
+
* ON:<OBJ extends Record<any, any> & {
|
|
50
|
+
* onConnected?: NonNullable<Parameters<InstanceType<RET>["ON"]>[1]>["connected"];
|
|
51
|
+
* onDisconnected?: NonNullable<Parameters<InstanceType<RET>["ON"]>[1]>["disconnected"];
|
|
52
|
+
* onAdopted?: NonNullable<Parameters<InstanceType<RET>["ON"]>[1]>["adopted"];
|
|
53
|
+
* onAttributeChanged?: NonNullable<Parameters<InstanceType<RET>["ON"]>[1]>["attributeChanged"];
|
|
54
|
+
* }>
|
|
55
|
+
* (obj:OBJ, callbacks?:
|
|
56
|
+
* {
|
|
57
|
+
* connected?:(obj:OBJ)=>void;
|
|
58
|
+
* disconnected?:(obj:OBJ)=>void;
|
|
59
|
+
* adopted?:(obj:OBJ)=>void;
|
|
60
|
+
* attributeChanged?:(
|
|
61
|
+
* obj:OBJ,
|
|
62
|
+
* name:STANDARD["observedAttributes"]extends readonly string[]
|
|
63
|
+
* ? ArrayToKeys<STANDARD["observedAttributes"]>
|
|
64
|
+
* : never,
|
|
65
|
+
* oldValue:string|null,
|
|
66
|
+
* newValue:string|null
|
|
67
|
+
* )=>void;
|
|
68
|
+
* })=>OBJ;
|
|
69
|
+
* }) & {
|
|
70
|
+
* tagName:string;
|
|
71
|
+
* extendIs:string;
|
|
72
|
+
* namedSlots: STANDARD["namedSlots"];
|
|
73
|
+
* observedAttributes: STANDARD["observedAttributes"];
|
|
74
|
+
* createNamedSlot: typeof WC_createNamedSlot<STANDARD>;
|
|
75
|
+
* props?: STANDARD["props"];
|
|
76
|
+
* define:<TAG extends string, CLASSREF extends CREATEARGS>
|
|
77
|
+
* (
|
|
78
|
+
* tagName:WC_TagName_type<TAG>,
|
|
79
|
+
* classRef:CLASSREF,
|
|
80
|
+
* elementDefinitionOptions?:ElementDefinitionOptions,
|
|
81
|
+
* )=>ReturnType<typeof WC_createElement_bind<CLASSREF>>;
|
|
82
|
+
* }
|
|
83
|
+
* } RET
|
|
84
|
+
* @param {BASE_CONSTRUCTOR} Base
|
|
85
|
+
* @param {STANDARD} [staticMember]
|
|
86
|
+
* @returns {RET}
|
|
87
|
+
* @example
|
|
88
|
+
* export MyWebComponent extends WC_extendsA(HTMLElement, {...options}){
|
|
89
|
+
* static create = this.define('my-webcomponent');
|
|
90
|
+
* }
|
|
91
|
+
*/
|
|
92
|
+
export function WC_extendsA<BASE_CONSTRUCTOR extends new (...args: any[]) => HTMLElement, STANDARD extends {
|
|
93
|
+
class?: string;
|
|
94
|
+
style?: string;
|
|
95
|
+
observedAttributes?: readonly string[];
|
|
96
|
+
namedSlots?: readonly string[];
|
|
97
|
+
props?: Record<string, keyof TypeMap | (new (...args: any[]) => any)>;
|
|
98
|
+
}, CREATEARGS extends (BASE_CONSTRUCTOR) & {
|
|
99
|
+
tagName: string;
|
|
100
|
+
extendIs: string;
|
|
101
|
+
observedAttributes?: STANDARD["observedAttributes"];
|
|
102
|
+
namedSlots?: STANDARD["namedSlots"];
|
|
103
|
+
props?: STANDARD["props"];
|
|
104
|
+
}, RET extends (new (...args: any[]) => InstanceType<BASE_CONSTRUCTOR> & {
|
|
105
|
+
setObservedAttributes(attributes: Partial<Record<ArrayToKeys<STANDARD["observedAttributes"] extends readonly string[] ? STANDARD["observedAttributes"] : never>, string>>): void;
|
|
106
|
+
props: NonNullable<NonNullable<Parameters<ReturnType<typeof WC_createElement_bind<CREATEARGS>>>[0]>["props"]>;
|
|
107
|
+
adoptedCallback(): void;
|
|
108
|
+
connectedCallback(): void;
|
|
109
|
+
disonnectedCallback(): void;
|
|
110
|
+
attributeChangedCallback(name: ArrayToKeys<STANDARD["observedAttributes"] extends readonly string[] ? STANDARD["observedAttributes"] : never>, oldValue: string | null, newValue: string | null): void;
|
|
111
|
+
ON: <OBJ extends Record<any, any> & {
|
|
112
|
+
onConnected?: NonNullable<Parameters<InstanceType<RET>["ON"]>[1]>["connected"];
|
|
113
|
+
onDisconnected?: NonNullable<Parameters<InstanceType<RET>["ON"]>[1]>["disconnected"];
|
|
114
|
+
onAdopted?: NonNullable<Parameters<InstanceType<RET>["ON"]>[1]>["adopted"];
|
|
115
|
+
onAttributeChanged?: NonNullable<Parameters<InstanceType<RET>["ON"]>[1]>["attributeChanged"];
|
|
116
|
+
}>(obj: OBJ, callbacks?: {
|
|
117
|
+
connected?: (obj: OBJ) => void;
|
|
118
|
+
disconnected?: (obj: OBJ) => void;
|
|
119
|
+
adopted?: (obj: OBJ) => void;
|
|
120
|
+
attributeChanged?: (obj: OBJ, name: STANDARD["observedAttributes"] extends readonly string[] ? ArrayToKeys<STANDARD["observedAttributes"]> : never, oldValue: string | null, newValue: string | null) => void;
|
|
121
|
+
}) => OBJ;
|
|
122
|
+
}) & {
|
|
123
|
+
tagName: string;
|
|
124
|
+
extendIs: string;
|
|
125
|
+
namedSlots: STANDARD["namedSlots"];
|
|
126
|
+
observedAttributes: STANDARD["observedAttributes"];
|
|
127
|
+
createNamedSlot: typeof WC_createNamedSlot<STANDARD>;
|
|
128
|
+
props?: STANDARD["props"];
|
|
129
|
+
define: <TAG extends string, CLASSREF extends CREATEARGS>(tagName: WC_TagName_type<TAG>, classRef: CLASSREF, elementDefinitionOptions?: ElementDefinitionOptions) => ReturnType<typeof WC_createElement_bind<CLASSREF>>;
|
|
130
|
+
}>(Base: BASE_CONSTRUCTOR, staticMember?: STANDARD): RET;
|
|
131
|
+
export type TypeMap = typeof import("../function/IsTypeOf.mjs").TypeMap;
|
|
132
|
+
import type { ArrayToKeys } from '../typehints/ArrayToKeys.mjs';
|
|
133
|
+
import { WC_createElement_bind } from './bindings/WC_createElement_bind.mjs';
|
|
134
|
+
import { WC_createNamedSlot } from './bindings/WC_createNamedSlot.mjs';
|
|
135
|
+
import type { WC_TagName_type } from './common/WC_TagName_type.mjs';
|