jopijs 0.0.1
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 +134 -0
- package/bin/jopib.js +4 -0
- package/bin/jopin.js +4 -0
- package/dist/@bundler/_logs.d.ts +2 -0
- package/dist/@bundler/_logs.js +4 -0
- package/dist/@bundler/_logs.js.map +1 -0
- package/dist/@bundler/core.d.ts +1 -0
- package/dist/@bundler/core.js +34 -0
- package/dist/@bundler/core.js.map +1 -0
- package/dist/@bundler/esbuild.d.ts +6 -0
- package/dist/@bundler/esbuild.js +111 -0
- package/dist/@bundler/esbuild.js.map +1 -0
- package/dist/@bundler/index.d.ts +2 -0
- package/dist/@bundler/index.js +3 -0
- package/dist/@bundler/index.js.map +1 -0
- package/dist/@bundler/plugins.d.ts +13 -0
- package/dist/@bundler/plugins.js +145 -0
- package/dist/@bundler/plugins.js.map +1 -0
- package/dist/@bundler/tailwind.d.ts +3 -0
- package/dist/@bundler/tailwind.js +119 -0
- package/dist/@bundler/tailwind.js.map +1 -0
- package/dist/@core/PageComponent.d.ts +6 -0
- package/dist/@core/PageComponent.js +10 -0
- package/dist/@core/PageComponent.js.map +1 -0
- package/dist/@core/_logs.d.ts +7 -0
- package/dist/@core/_logs.js +9 -0
- package/dist/@core/_logs.js.map +1 -0
- package/dist/@core/automaticStartStop.d.ts +25 -0
- package/dist/@core/automaticStartStop.js +106 -0
- package/dist/@core/automaticStartStop.js.map +1 -0
- package/dist/@core/browserCacheControl.d.ts +21 -0
- package/dist/@core/browserCacheControl.js +17 -0
- package/dist/@core/browserCacheControl.js.map +1 -0
- package/dist/@core/bundler/bundler.d.ts +22 -0
- package/dist/@core/bundler/bundler.js +90 -0
- package/dist/@core/bundler/bundler.js.map +1 -0
- package/dist/@core/bundler/common.d.ts +2 -0
- package/dist/@core/bundler/common.js +17 -0
- package/dist/@core/bundler/common.js.map +1 -0
- package/dist/@core/bundler/config.d.ts +20 -0
- package/dist/@core/bundler/config.js +11 -0
- package/dist/@core/bundler/config.js.map +1 -0
- package/dist/@core/bundler/extraContent.d.ts +6 -0
- package/dist/@core/bundler/extraContent.js +27 -0
- package/dist/@core/bundler/extraContent.js.map +1 -0
- package/dist/@core/bundler/pagesGenerator.d.ts +1 -0
- package/dist/@core/bundler/pagesGenerator.js +173 -0
- package/dist/@core/bundler/pagesGenerator.js.map +1 -0
- package/dist/@core/bundler/server.d.ts +8 -0
- package/dist/@core/bundler/server.js +35 -0
- package/dist/@core/bundler/server.js.map +1 -0
- package/dist/@core/caches/InMemoryCache.d.ts +35 -0
- package/dist/@core/caches/InMemoryCache.js +353 -0
- package/dist/@core/caches/InMemoryCache.js.map +1 -0
- package/dist/@core/caches/SimpleFileCache.d.ts +18 -0
- package/dist/@core/caches/SimpleFileCache.js +171 -0
- package/dist/@core/caches/SimpleFileCache.js.map +1 -0
- package/dist/@core/caches/cache.d.ts +36 -0
- package/dist/@core/caches/cache.js +33 -0
- package/dist/@core/caches/cache.js.map +1 -0
- package/dist/@core/caches/webSiteMirrorCache.d.ts +16 -0
- package/dist/@core/caches/webSiteMirrorCache.js +81 -0
- package/dist/@core/caches/webSiteMirrorCache.js.map +1 -0
- package/dist/@core/gzip.d.ts +4 -0
- package/dist/@core/gzip.js +31 -0
- package/dist/@core/gzip.js.map +1 -0
- package/dist/@core/index.d.ts +18 -0
- package/dist/@core/index.js +19 -0
- package/dist/@core/index.js.map +1 -0
- package/dist/@core/internalTools.d.ts +14 -0
- package/dist/@core/internalTools.js +79 -0
- package/dist/@core/internalTools.js.map +1 -0
- package/dist/@core/jQuery.d.ts +5 -0
- package/dist/@core/jQuery.js +18 -0
- package/dist/@core/jQuery.js.map +1 -0
- package/dist/@core/jopiEasy.d.ts +287 -0
- package/dist/@core/jopiEasy.js +983 -0
- package/dist/@core/jopiEasy.js.map +1 -0
- package/dist/@core/jopiRequest.d.ts +269 -0
- package/dist/@core/jopiRequest.js +1060 -0
- package/dist/@core/jopiRequest.js.map +1 -0
- package/dist/@core/jopiServer.d.ts +77 -0
- package/dist/@core/jopiServer.js +100 -0
- package/dist/@core/jopiServer.js.map +1 -0
- package/dist/@core/jopiWebSite.d.ts +319 -0
- package/dist/@core/jopiWebSite.js +653 -0
- package/dist/@core/jopiWebSite.js.map +1 -0
- package/dist/@core/letsEncrypt.d.ts +25 -0
- package/dist/@core/letsEncrypt.js +189 -0
- package/dist/@core/letsEncrypt.js.map +1 -0
- package/dist/@core/linker.d.ts +4 -0
- package/dist/@core/linker.js +37 -0
- package/dist/@core/linker.js.map +1 -0
- package/dist/@core/loadBalancing.d.ts +18 -0
- package/dist/@core/loadBalancing.js +126 -0
- package/dist/@core/loadBalancing.js.map +1 -0
- package/dist/@core/middlewares/CorsMiddleware.d.ts +5 -0
- package/dist/@core/middlewares/CorsMiddleware.js +15 -0
- package/dist/@core/middlewares/CorsMiddleware.js.map +1 -0
- package/dist/@core/middlewares/DdosProtection.d.ts +42 -0
- package/dist/@core/middlewares/DdosProtection.js +62 -0
- package/dist/@core/middlewares/DdosProtection.js.map +1 -0
- package/dist/@core/middlewares/index.d.ts +10 -0
- package/dist/@core/middlewares/index.js +14 -0
- package/dist/@core/middlewares/index.js.map +1 -0
- package/dist/@core/publicTools.d.ts +8 -0
- package/dist/@core/publicTools.js +11 -0
- package/dist/@core/publicTools.js.map +1 -0
- package/dist/@core/routeConfig.d.ts +48 -0
- package/dist/@core/routeConfig.js +102 -0
- package/dist/@core/routeConfig.js.map +1 -0
- package/dist/@core/searchParamFilter.d.ts +70 -0
- package/dist/@core/searchParamFilter.js +212 -0
- package/dist/@core/searchParamFilter.js.map +1 -0
- package/dist/@core/serverFetch.d.ts +122 -0
- package/dist/@core/serverFetch.js +312 -0
- package/dist/@core/serverFetch.js.map +1 -0
- package/dist/@core/serverImpl/server_bunjs.d.ts +29 -0
- package/dist/@core/serverImpl/server_bunjs.js +180 -0
- package/dist/@core/serverImpl/server_bunjs.js.map +1 -0
- package/dist/@core/serverImpl/server_nodejs.d.ts +22 -0
- package/dist/@core/serverImpl/server_nodejs.js +235 -0
- package/dist/@core/serverImpl/server_nodejs.js.map +1 -0
- package/dist/@core/serverInstanceBuilder.d.ts +17 -0
- package/dist/@core/serverInstanceBuilder.js +14 -0
- package/dist/@core/serverInstanceBuilder.js.map +1 -0
- package/dist/@core/userStores.d.ts +13 -0
- package/dist/@core/userStores.js +20 -0
- package/dist/@core/userStores.js.map +1 -0
- package/dist/@crawler/common.d.ts +203 -0
- package/dist/@crawler/common.js +68 -0
- package/dist/@crawler/common.js.map +1 -0
- package/dist/@crawler/core.d.ts +87 -0
- package/dist/@crawler/core.js +586 -0
- package/dist/@crawler/core.js.map +1 -0
- package/dist/@crawler/directFileCache.d.ts +10 -0
- package/dist/@crawler/directFileCache.js +60 -0
- package/dist/@crawler/directFileCache.js.map +1 -0
- package/dist/@crawler/index.d.ts +4 -0
- package/dist/@crawler/index.js +5 -0
- package/dist/@crawler/index.js.map +1 -0
- package/dist/@crawler/urlMapping.d.ts +21 -0
- package/dist/@crawler/urlMapping.js +52 -0
- package/dist/@crawler/urlMapping.js.map +1 -0
- package/dist/@crawler/utils.d.ts +6 -0
- package/dist/@crawler/utils.js +13 -0
- package/dist/@crawler/utils.js.map +1 -0
- package/dist/@generated/index.d.ts +29 -0
- package/dist/@generated/index.js +93 -0
- package/dist/@generated/index.js.map +1 -0
- package/dist/@linker/arobaseTypes.d.ts +50 -0
- package/dist/@linker/arobaseTypes.js +235 -0
- package/dist/@linker/arobaseTypes.js.map +1 -0
- package/dist/@linker/changeProof.d.ts +5 -0
- package/dist/@linker/changeProof.js +50 -0
- package/dist/@linker/changeProof.js.map +1 -0
- package/dist/@linker/config.d.ts +2 -0
- package/dist/@linker/config.js +40 -0
- package/dist/@linker/config.js.map +1 -0
- package/dist/@linker/engine.d.ts +156 -0
- package/dist/@linker/engine.js +665 -0
- package/dist/@linker/engine.js.map +1 -0
- package/dist/@linker/index.d.ts +3 -0
- package/dist/@linker/index.js +4 -0
- package/dist/@linker/index.js.map +1 -0
- package/dist/@linker/install.d.ts +4 -0
- package/dist/@linker/install.js +42 -0
- package/dist/@linker/install.js.map +1 -0
- package/dist/@linker/modInstaller.d.ts +10 -0
- package/dist/@linker/modInstaller.js +38 -0
- package/dist/@linker/modInstaller.js.map +1 -0
- package/dist/@linker/typeEvents.d.ts +9 -0
- package/dist/@linker/typeEvents.js +48 -0
- package/dist/@linker/typeEvents.js.map +1 -0
- package/dist/@linker/typeRoutes.d.ts +23 -0
- package/dist/@linker/typeRoutes.js +197 -0
- package/dist/@linker/typeRoutes.js.map +1 -0
- package/dist/@linker/typeUiComposite.d.ts +6 -0
- package/dist/@linker/typeUiComposite.js +16 -0
- package/dist/@linker/typeUiComposite.js.map +1 -0
- package/dist/@loader/index.d.ts +1 -0
- package/dist/@loader/index.js +17 -0
- package/dist/@loader/index.js.map +1 -0
- package/dist/@loader/nodeJsLoader.d.ts +2 -0
- package/dist/@loader/nodeJsLoader.js +19 -0
- package/dist/@loader/nodeJsLoader.js.map +1 -0
- package/dist/@loader-client/index.d.ts +33 -0
- package/dist/@loader-client/index.js +98 -0
- package/dist/@loader-client/index.js.map +1 -0
- package/dist/@loader-tools/bunJsLoader.d.ts +1 -0
- package/dist/@loader-tools/bunJsLoader.js +28 -0
- package/dist/@loader-tools/bunJsLoader.js.map +1 -0
- package/dist/@loader-tools/config.d.ts +49 -0
- package/dist/@loader-tools/config.js +79 -0
- package/dist/@loader-tools/config.js.map +1 -0
- package/dist/@loader-tools/cssModuleCompiler.d.ts +5 -0
- package/dist/@loader-tools/cssModuleCompiler.js +65 -0
- package/dist/@loader-tools/cssModuleCompiler.js.map +1 -0
- package/dist/@loader-tools/esBuildPlugin.d.ts +5 -0
- package/dist/@loader-tools/esBuildPlugin.js +113 -0
- package/dist/@loader-tools/esBuildPlugin.js.map +1 -0
- package/dist/@loader-tools/index.d.ts +9 -0
- package/dist/@loader-tools/index.js +10 -0
- package/dist/@loader-tools/index.js.map +1 -0
- package/dist/@loader-tools/jopin.d.ts +10 -0
- package/dist/@loader-tools/jopin.js +331 -0
- package/dist/@loader-tools/jopin.js.map +1 -0
- package/dist/@loader-tools/nodeJsLoader.d.ts +13 -0
- package/dist/@loader-tools/nodeJsLoader.js +101 -0
- package/dist/@loader-tools/nodeJsLoader.js.map +1 -0
- package/dist/@loader-tools/nodeJsResolver.d.ts +2 -0
- package/dist/@loader-tools/nodeJsResolver.js +117 -0
- package/dist/@loader-tools/nodeJsResolver.js.map +1 -0
- package/dist/@loader-tools/rules.d.ts +3 -0
- package/dist/@loader-tools/rules.js +33 -0
- package/dist/@loader-tools/rules.js.map +1 -0
- package/dist/@loader-tools/sourceChangesWatcher.d.ts +39 -0
- package/dist/@loader-tools/sourceChangesWatcher.js +182 -0
- package/dist/@loader-tools/sourceChangesWatcher.js.map +1 -0
- package/dist/@loader-tools/tools.d.ts +21 -0
- package/dist/@loader-tools/tools.js +113 -0
- package/dist/@loader-tools/tools.js.map +1 -0
- package/dist/@loader-tools/transform.d.ts +5 -0
- package/dist/@loader-tools/transform.js +114 -0
- package/dist/@loader-tools/transform.js.map +1 -0
- package/dist/@loader-tools/virtualUrl.d.ts +9 -0
- package/dist/@loader-tools/virtualUrl.js +40 -0
- package/dist/@loader-tools/virtualUrl.js.map +1 -0
- package/dist/@tool-jopinb/index.d.ts +1 -0
- package/dist/@tool-jopinb/index.js +9 -0
- package/dist/@tool-jopinb/index.js.map +1 -0
- package/dist/@ui/components.d.ts +27 -0
- package/dist/@ui/components.js +42 -0
- package/dist/@ui/components.js.map +1 -0
- package/dist/@ui/cssModules.d.ts +11 -0
- package/dist/@ui/cssModules.js +17 -0
- package/dist/@ui/cssModules.js.map +1 -0
- package/dist/@ui/hooks.d.ts +31 -0
- package/dist/@ui/hooks.js +71 -0
- package/dist/@ui/hooks.js.map +1 -0
- package/dist/@ui/index.d.ts +9 -0
- package/dist/@ui/index.js +11 -0
- package/dist/@ui/index.js.map +1 -0
- package/dist/@ui/internal.d.ts +4 -0
- package/dist/@ui/internal.js +10 -0
- package/dist/@ui/internal.js.map +1 -0
- package/dist/@ui/modules.d.ts +41 -0
- package/dist/@ui/modules.js +74 -0
- package/dist/@ui/modules.js.map +1 -0
- package/dist/@ui/objectRegistry.d.ts +12 -0
- package/dist/@ui/objectRegistry.js +35 -0
- package/dist/@ui/objectRegistry.js.map +1 -0
- package/dist/@ui/pageController.d.ts +61 -0
- package/dist/@ui/pageController.js +166 -0
- package/dist/@ui/pageController.js.map +1 -0
- package/dist/@ui/tools.d.ts +24 -0
- package/dist/@ui/tools.js +78 -0
- package/dist/@ui/tools.js.map +1 -0
- package/dist/@uikit/core/UiKitModule.d.ts +6 -0
- package/dist/@uikit/core/UiKitModule.js +18 -0
- package/dist/@uikit/core/UiKitModule.js.map +1 -0
- package/dist/@uikit/core/index.d.ts +1 -0
- package/dist/@uikit/core/index.js +4 -0
- package/dist/@uikit/core/index.js.map +1 -0
- package/dist/@uikit/core/jBundler_ifBrowser.d.ts +1 -0
- package/dist/@uikit/core/jBundler_ifBrowser.js +5 -0
- package/dist/@uikit/core/jBundler_ifBrowser.js.map +1 -0
- package/dist/@uikit/core/jBundler_ifServer.d.ts +6 -0
- package/dist/@uikit/core/jBundler_ifServer.js +17 -0
- package/dist/@uikit/core/jBundler_ifServer.js.map +1 -0
- package/dist/@uikit/forms/components.d.ts +18 -0
- package/dist/@uikit/forms/components.js +69 -0
- package/dist/@uikit/forms/components.js.map +1 -0
- package/dist/@uikit/forms/hooks.d.ts +4 -0
- package/dist/@uikit/forms/hooks.js +31 -0
- package/dist/@uikit/forms/hooks.js.map +1 -0
- package/dist/@uikit/forms/index.d.ts +3 -0
- package/dist/@uikit/forms/index.js +4 -0
- package/dist/@uikit/forms/index.js.map +1 -0
- package/dist/@uikit/forms/interfaces.d.ts +101 -0
- package/dist/@uikit/forms/interfaces.js +4 -0
- package/dist/@uikit/forms/interfaces.js.map +1 -0
- package/dist/@uikit/forms/private.d.ts +40 -0
- package/dist/@uikit/forms/private.js +307 -0
- package/dist/@uikit/forms/private.js.map +1 -0
- package/dist/@uikit/helpers/hooks.d.ts +33 -0
- package/dist/@uikit/helpers/hooks.js +107 -0
- package/dist/@uikit/helpers/hooks.js.map +1 -0
- package/dist/@uikit/helpers/index.d.ts +2 -0
- package/dist/@uikit/helpers/index.js +3 -0
- package/dist/@uikit/helpers/index.js.map +1 -0
- package/dist/@uikit/helpers/tools.d.ts +8 -0
- package/dist/@uikit/helpers/tools.js +35 -0
- package/dist/@uikit/helpers/tools.js.map +1 -0
- package/dist/@uikit/index.d.ts +10 -0
- package/dist/@uikit/index.js +13 -0
- package/dist/@uikit/index.js.map +1 -0
- package/dist/@uikit/menu/core.d.ts +21 -0
- package/dist/@uikit/menu/core.js +191 -0
- package/dist/@uikit/menu/core.js.map +1 -0
- package/dist/@uikit/menu/hooks.d.ts +5 -0
- package/dist/@uikit/menu/hooks.js +24 -0
- package/dist/@uikit/menu/hooks.js.map +1 -0
- package/dist/@uikit/menu/index.d.ts +3 -0
- package/dist/@uikit/menu/index.js +4 -0
- package/dist/@uikit/menu/index.js.map +1 -0
- package/dist/@uikit/menu/interfaces.d.ts +20 -0
- package/dist/@uikit/menu/interfaces.js +8 -0
- package/dist/@uikit/menu/interfaces.js.map +1 -0
- package/dist/@uikit/menu/internal.d.ts +40 -0
- package/dist/@uikit/menu/internal.js +191 -0
- package/dist/@uikit/menu/internal.js.map +1 -0
- package/dist/@uikit/reactRouter/hooks/jBundler_ifBrowser.d.ts +18 -0
- package/dist/@uikit/reactRouter/hooks/jBundler_ifBrowser.js +40 -0
- package/dist/@uikit/reactRouter/hooks/jBundler_ifBrowser.js.map +1 -0
- package/dist/@uikit/reactRouter/hooks/jBundler_ifServer.d.ts +28 -0
- package/dist/@uikit/reactRouter/hooks/jBundler_ifServer.js +35 -0
- package/dist/@uikit/reactRouter/hooks/jBundler_ifServer.js.map +1 -0
- package/dist/@uikit/reactRouter/index.d.ts +1 -0
- package/dist/@uikit/reactRouter/index.js +2 -0
- package/dist/@uikit/reactRouter/index.js.map +1 -0
- package/dist/@uikit/users/hooks.d.ts +10 -0
- package/dist/@uikit/users/hooks.js +39 -0
- package/dist/@uikit/users/hooks.js.map +1 -0
- package/dist/@uikit/users/index.d.ts +1 -0
- package/dist/@uikit/users/index.js +2 -0
- package/dist/@uikit/users/index.js.map +1 -0
- package/dist/@uikit/variants/index.d.ts +7 -0
- package/dist/@uikit/variants/index.js +16 -0
- package/dist/@uikit/variants/index.js.map +1 -0
- package/package.json +115 -0
- package/src/@bundler/README.md +1 -0
- package/src/@bundler/_logs.ts +4 -0
- package/src/@bundler/core.ts +41 -0
- package/src/@bundler/esbuild.ts +141 -0
- package/src/@bundler/index.ts +3 -0
- package/src/@bundler/plugins.ts +163 -0
- package/src/@bundler/tailwind.ts +139 -0
- package/src/@core/PageComponent.tsx +25 -0
- package/src/@core/README.md +1 -0
- package/src/@core/_logs.ts +11 -0
- package/src/@core/automaticStartStop.ts +132 -0
- package/src/@core/browserCacheControl.ts +40 -0
- package/src/@core/bundler/bundler.ts +128 -0
- package/src/@core/bundler/common.ts +18 -0
- package/src/@core/bundler/config.ts +37 -0
- package/src/@core/bundler/extraContent.ts +30 -0
- package/src/@core/bundler/pagesGenerator.ts +194 -0
- package/src/@core/bundler/server.ts +41 -0
- package/src/@core/caches/InMemoryCache.ts +483 -0
- package/src/@core/caches/SimpleFileCache.ts +205 -0
- package/src/@core/caches/cache.ts +77 -0
- package/src/@core/caches/webSiteMirrorCache.ts +90 -0
- package/src/@core/cheerio.d.ts +332 -0
- package/src/@core/gzip.ts +33 -0
- package/src/@core/index.ts +23 -0
- package/src/@core/internalTools.ts +95 -0
- package/src/@core/jQuery.ts +22 -0
- package/src/@core/jopiEasy.ts +1285 -0
- package/src/@core/jopiRequest.tsx +1279 -0
- package/src/@core/jopiServer.ts +188 -0
- package/src/@core/jopiWebSite.tsx +1027 -0
- package/src/@core/letsEncrypt.ts +243 -0
- package/src/@core/linker.ts +42 -0
- package/src/@core/loadBalancing.ts +152 -0
- package/src/@core/middlewares/CorsMiddleware.ts +23 -0
- package/src/@core/middlewares/DdosProtection.ts +120 -0
- package/src/@core/middlewares/index.ts +16 -0
- package/src/@core/publicTools.ts +14 -0
- package/src/@core/routeConfig.ts +104 -0
- package/src/@core/searchParamFilter.ts +315 -0
- package/src/@core/serverFetch.ts +454 -0
- package/src/@core/serverImpl/server_bunjs.tsx +230 -0
- package/src/@core/serverImpl/server_nodejs.ts +312 -0
- package/src/@core/serverInstanceBuilder.ts +36 -0
- package/src/@core/userStores.ts +34 -0
- package/src/@crawler/README.md +1 -0
- package/src/@crawler/common.ts +275 -0
- package/src/@crawler/core.ts +678 -0
- package/src/@crawler/directFileCache.ts +69 -0
- package/src/@crawler/index.ts +4 -0
- package/src/@crawler/urlMapping.ts +67 -0
- package/src/@crawler/utils.ts +13 -0
- package/src/@generated/index.ts +134 -0
- package/src/@linker/arobaseTypes.ts +325 -0
- package/src/@linker/changeProof.ts +53 -0
- package/src/@linker/config.ts +46 -0
- package/src/@linker/engine.ts +865 -0
- package/src/@linker/index.ts +3 -0
- package/src/@linker/install.ts +39 -0
- package/src/@linker/modInstaller.ts +50 -0
- package/src/@linker/typeEvents.ts +58 -0
- package/src/@linker/typeRoutes.ts +255 -0
- package/src/@linker/typeUiComposite.ts +19 -0
- package/src/@loader/README.md +4 -0
- package/src/@loader/bunHtmlCompiler.mjs +27 -0
- package/src/@loader/index.ts +19 -0
- package/src/@loader/loader.mjs +7 -0
- package/src/@loader/nodeJsLoader.ts +21 -0
- package/src/@loader-client/README.md +2 -0
- package/src/@loader-client/index.ts +108 -0
- package/src/@loader-tools/README.md +6 -0
- package/src/@loader-tools/bunJsLoader.ts +33 -0
- package/src/@loader-tools/config.ts +142 -0
- package/src/@loader-tools/cssModuleCompiler.ts +76 -0
- package/src/@loader-tools/esBuildPlugin.ts +142 -0
- package/src/@loader-tools/index.ts +11 -0
- package/src/@loader-tools/jopin.ts +403 -0
- package/src/@loader-tools/nodeJsLoader.ts +119 -0
- package/src/@loader-tools/nodeJsResolver.ts +140 -0
- package/src/@loader-tools/rules.ts +45 -0
- package/src/@loader-tools/sourceChangesWatcher.ts +225 -0
- package/src/@loader-tools/tools.ts +139 -0
- package/src/@loader-tools/transform.ts +138 -0
- package/src/@loader-tools/virtualUrl.ts +57 -0
- package/src/@loader-types/README.md +15 -0
- package/src/@loader-types/extensions.d.ts +65 -0
- package/src/@tool-jopinb/README.md +1 -0
- package/src/@tool-jopinb/index.ts +11 -0
- package/src/@ui/README.md +3 -0
- package/src/@ui/components.tsx +49 -0
- package/src/@ui/cssModules.tsx +27 -0
- package/src/@ui/hooks.tsx +95 -0
- package/src/@ui/index.ts +13 -0
- package/src/@ui/internal.ts +12 -0
- package/src/@ui/modules.ts +100 -0
- package/src/@ui/objectRegistry.ts +50 -0
- package/src/@ui/pageController.ts +203 -0
- package/src/@ui/tools.ts +116 -0
- package/src/@uikit/README.md +1 -0
- package/src/@uikit/core/UiKitModule.ts +20 -0
- package/src/@uikit/core/index.ts +4 -0
- package/src/@uikit/core/jBundler_ifBrowser.ts +4 -0
- package/src/@uikit/core/jBundler_ifServer.ts +18 -0
- package/src/@uikit/forms/components.tsx +97 -0
- package/src/@uikit/forms/hooks.ts +38 -0
- package/src/@uikit/forms/index.ts +3 -0
- package/src/@uikit/forms/interfaces.ts +159 -0
- package/src/@uikit/forms/private.ts +365 -0
- package/src/@uikit/helpers/hooks.ts +133 -0
- package/src/@uikit/helpers/index.ts +2 -0
- package/src/@uikit/helpers/tools.ts +39 -0
- package/src/@uikit/index.ts +15 -0
- package/src/@uikit/menu/core.ts +227 -0
- package/src/@uikit/menu/hooks.ts +28 -0
- package/src/@uikit/menu/index.ts +3 -0
- package/src/@uikit/menu/interfaces.ts +26 -0
- package/src/@uikit/menu/internal.ts +218 -0
- package/src/@uikit/package.json +15 -0
- package/src/@uikit/reactRouter/hooks/jBundler_ifBrowser.tsx +59 -0
- package/src/@uikit/reactRouter/hooks/jBundler_ifServer.tsx +51 -0
- package/src/@uikit/reactRouter/index.ts +1 -0
- package/src/@uikit/users/hooks.ts +50 -0
- package/src/@uikit/users/index.ts +1 -0
- package/src/@uikit/variants/index.tsx +20 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import {makeIterable} from "../internalTools.js";
|
|
2
|
+
import type {JopiRequest} from "../jopiRequest.tsx";
|
|
3
|
+
|
|
4
|
+
export interface CacheRole {
|
|
5
|
+
isUserCache?: boolean;
|
|
6
|
+
isMobileCache?: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface PageCache {
|
|
10
|
+
cacheRole?: CacheRole;
|
|
11
|
+
|
|
12
|
+
getFromCache(req: JopiRequest, url: URL): Promise<Response | undefined>;
|
|
13
|
+
|
|
14
|
+
addToCache(req: JopiRequest, url: URL, response: Response, headersToInclude: string[] | undefined): Promise<Response>;
|
|
15
|
+
|
|
16
|
+
hasInCache(url: URL): Promise<boolean>;
|
|
17
|
+
|
|
18
|
+
removeFromCache(url: URL): Promise<void>;
|
|
19
|
+
|
|
20
|
+
createSubCache(name: string): PageCache;
|
|
21
|
+
|
|
22
|
+
getSubCacheIterator(): Iterable<string>;
|
|
23
|
+
|
|
24
|
+
getCacheEntryIterator(subCacheName?: string): Iterable<CacheEntry>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export class VoidPageCache implements PageCache {
|
|
28
|
+
getFromCache(): Promise<Response | undefined> {
|
|
29
|
+
return Promise.resolve(undefined);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
addToCache(_req: JopiRequest, _url: URL, response: Response): Promise<Response> {
|
|
33
|
+
return Promise.resolve(response);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
hasInCache(): Promise<boolean> {
|
|
37
|
+
return Promise.resolve(false);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
removeFromCache(_url: URL): Promise<void> {
|
|
41
|
+
return Promise.resolve();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
createSubCache(): PageCache {
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
getCacheEntryIterator() {
|
|
49
|
+
return makeIterable({
|
|
50
|
+
next(): IteratorResult<CacheEntry> {
|
|
51
|
+
return { value: undefined, done: true };
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
getSubCacheIterator() {
|
|
57
|
+
return makeIterable({
|
|
58
|
+
next(): IteratorResult<string> {
|
|
59
|
+
return { value: undefined, done: true };
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface CacheEntry {
|
|
66
|
+
url: string;
|
|
67
|
+
binary?: Uint8Array<ArrayBuffer>;
|
|
68
|
+
binarySize?: number;
|
|
69
|
+
isGzipped?: boolean;
|
|
70
|
+
|
|
71
|
+
headers?: {[key:string]: string};
|
|
72
|
+
|
|
73
|
+
status?: number;
|
|
74
|
+
|
|
75
|
+
_refCount?: number;
|
|
76
|
+
_refCountSinceGC?: number;
|
|
77
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import * as jk_fs from "jopi-toolkit/jk_fs";
|
|
3
|
+
import type {JopiRequest} from "../jopiRequest";
|
|
4
|
+
import fs from "node:fs/promises";
|
|
5
|
+
import {makeIterable} from "../internalTools.ts";
|
|
6
|
+
import type {CacheEntry, PageCache} from "./cache.ts";
|
|
7
|
+
|
|
8
|
+
export class WebSiteMirrorCache implements PageCache {
|
|
9
|
+
public readonly rootDir: string;
|
|
10
|
+
public readonly rootDirAtFileUrl: string;
|
|
11
|
+
|
|
12
|
+
constructor(rootDir: string) {
|
|
13
|
+
if (!rootDir) rootDir = ".";
|
|
14
|
+
if (!path.isAbsolute(rootDir)) rootDir = path.resolve(process.cwd(), rootDir);
|
|
15
|
+
this.rootDir = rootDir;
|
|
16
|
+
this.rootDirAtFileUrl = jk_fs.pathToFileURL(this.rootDir).href;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
private calKey(url: URL): string {
|
|
20
|
+
let sURL = this.rootDirAtFileUrl + url.pathname;
|
|
21
|
+
return jk_fs.fileURLToPath(sURL);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
private calcFilePath(url: URL): string {
|
|
25
|
+
let fp = this.calKey(url);
|
|
26
|
+
|
|
27
|
+
if (fp.endsWith("/")) {
|
|
28
|
+
fp += "index.html";
|
|
29
|
+
} else {
|
|
30
|
+
const ext = path.extname(fp);
|
|
31
|
+
if (!ext) fp += "/index.html";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return fp;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async addToCache(req: JopiRequest, url: URL, response: Response): Promise<Response> {
|
|
38
|
+
// We don't store 404 and others.
|
|
39
|
+
if (response.status !== 200) return response;
|
|
40
|
+
|
|
41
|
+
const filePath = this.calcFilePath(url);
|
|
42
|
+
await fs.mkdir(path.dirname(filePath), {recursive: true});
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
if (!response.body) return response;
|
|
46
|
+
await jk_fs.writeResponseToFile(new Response(response.body), filePath);
|
|
47
|
+
return await req.file_returnFile(filePath);
|
|
48
|
+
} catch (e) {
|
|
49
|
+
console.error(e);
|
|
50
|
+
return new Response("", {status: 500});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async removeFromCache(url: URL): Promise<void> {
|
|
55
|
+
const filePath = this.calcFilePath(url);
|
|
56
|
+
await fs.unlink(filePath);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async hasInCache(url: URL): Promise<boolean> {
|
|
60
|
+
const filePath = this.calcFilePath(url);
|
|
61
|
+
const stats = await jk_fs.getFileStat(filePath);
|
|
62
|
+
return !!stats && stats.isFile();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
getFromCache(req: JopiRequest, url: URL): Promise<Response | undefined> {
|
|
66
|
+
const filePath = this.calcFilePath(url);
|
|
67
|
+
return req.file_tryReturnFile(filePath);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
createSubCache(name: string): PageCache {
|
|
71
|
+
const newDir = path.join(this.rootDir, "_ subCaches", name);
|
|
72
|
+
return new WebSiteMirrorCache(newDir);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
getCacheEntryIterator() {
|
|
76
|
+
return makeIterable({
|
|
77
|
+
next(): IteratorResult<CacheEntry> {
|
|
78
|
+
return {value: undefined, done: true};
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
getSubCacheIterator() {
|
|
84
|
+
return makeIterable({
|
|
85
|
+
next(): IteratorResult<string> {
|
|
86
|
+
return {value: undefined, done: true};
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
|
|
3
|
+
// -- JOPI (Johan P) --
|
|
4
|
+
//
|
|
5
|
+
// It's comme from the original type definition of cheerio where I have added
|
|
6
|
+
// - reactReplaceWith
|
|
7
|
+
// - reactReplaceContentWith
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
interface Document {}
|
|
11
|
+
|
|
12
|
+
declare namespace cheerio {
|
|
13
|
+
type Element = TextElement | TagElement | CommentElement;
|
|
14
|
+
|
|
15
|
+
interface TextElement {
|
|
16
|
+
type: "text";
|
|
17
|
+
next: Element | null;
|
|
18
|
+
prev: Element | null;
|
|
19
|
+
parent: Element;
|
|
20
|
+
data?: string | undefined;
|
|
21
|
+
startIndex?: number | undefined;
|
|
22
|
+
endIndex?: number | undefined;
|
|
23
|
+
attribs: { [attr: string]: string };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface TagElement {
|
|
27
|
+
tagName: string;
|
|
28
|
+
type: "tag" | "script" | "style";
|
|
29
|
+
name: string;
|
|
30
|
+
attribs: { [attr: string]: string };
|
|
31
|
+
"x-attribsNamespace": { [attr: string]: string };
|
|
32
|
+
"x-prefixNamespace": { [attr: string]: string };
|
|
33
|
+
children: Element[];
|
|
34
|
+
childNodes: Element[] | null;
|
|
35
|
+
lastChild: Element | null;
|
|
36
|
+
firstChild: Element | null;
|
|
37
|
+
next: Element | null;
|
|
38
|
+
nextSibling: Element;
|
|
39
|
+
prev: Element | null;
|
|
40
|
+
previousSibling: Element;
|
|
41
|
+
parent: Element;
|
|
42
|
+
parentNode: Element;
|
|
43
|
+
nodeValue: string;
|
|
44
|
+
data?: string | undefined;
|
|
45
|
+
startIndex?: number | undefined;
|
|
46
|
+
endIndex?: number | undefined;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface CommentElement {
|
|
50
|
+
type: "comment";
|
|
51
|
+
next: Element | null;
|
|
52
|
+
prev: Element | null;
|
|
53
|
+
parent: Element;
|
|
54
|
+
data?: string | undefined;
|
|
55
|
+
startIndex?: number | undefined;
|
|
56
|
+
endIndex?: number | undefined;
|
|
57
|
+
attribs: { [attr: string]: string };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
type AttrFunction = (el: Element, i: number, currentValue: string) => any;
|
|
61
|
+
|
|
62
|
+
interface Cheerio {
|
|
63
|
+
// >>> JOPI HACK
|
|
64
|
+
reactReplaceWith(node: React.ReactNode): Cheerio;
|
|
65
|
+
reactReplaceContentWith(node: React.ReactNode): Cheerio;
|
|
66
|
+
// <<< JOPI HACK
|
|
67
|
+
|
|
68
|
+
// Document References
|
|
69
|
+
// Cheerio https://github.com/cheeriojs/cheerio
|
|
70
|
+
// JQuery http://api.jquery.com
|
|
71
|
+
|
|
72
|
+
[Symbol.iterator](): IterableIterator<Element>;
|
|
73
|
+
[index: number]: Element;
|
|
74
|
+
cheerio: string;
|
|
75
|
+
length: number;
|
|
76
|
+
|
|
77
|
+
// Attributes
|
|
78
|
+
|
|
79
|
+
attr(): { [attr: string]: string };
|
|
80
|
+
attr(name: string): string | undefined;
|
|
81
|
+
attr(name: string, value: AttrFunction): Cheerio;
|
|
82
|
+
// `value` *can* be `any` here but:
|
|
83
|
+
// 1. That makes type-checking the function-type useless
|
|
84
|
+
// 2. It's converted to a string anyway
|
|
85
|
+
attr(name: string, value: string): Cheerio;
|
|
86
|
+
// The map's values *can* be `any` but they'll all be cast to strings
|
|
87
|
+
// regardless.
|
|
88
|
+
attr(map: { [key: string]: any }): Cheerio;
|
|
89
|
+
|
|
90
|
+
data(): any;
|
|
91
|
+
data(name: string): any;
|
|
92
|
+
data(name: string, value: any): any;
|
|
93
|
+
|
|
94
|
+
val(): string;
|
|
95
|
+
val(value: string): Cheerio;
|
|
96
|
+
|
|
97
|
+
removeAttr(name: string): Cheerio;
|
|
98
|
+
|
|
99
|
+
has(selector: string): Cheerio;
|
|
100
|
+
has(element: Element): Cheerio;
|
|
101
|
+
|
|
102
|
+
hasClass(className: string): boolean;
|
|
103
|
+
addClass(classNames: string): Cheerio;
|
|
104
|
+
|
|
105
|
+
removeClass(): Cheerio;
|
|
106
|
+
removeClass(className: string): Cheerio;
|
|
107
|
+
removeClass(func: (index: number, className: string) => string): Cheerio;
|
|
108
|
+
|
|
109
|
+
toggleClass(className: string): Cheerio;
|
|
110
|
+
toggleClass(className: string, toggleSwitch: boolean): Cheerio;
|
|
111
|
+
toggleClass(toggleSwitch?: boolean): Cheerio;
|
|
112
|
+
toggleClass(
|
|
113
|
+
func: (index: number, className: string, toggleSwitch: boolean) => string,
|
|
114
|
+
toggleSwitch?: boolean,
|
|
115
|
+
): Cheerio;
|
|
116
|
+
|
|
117
|
+
is(selector: string): boolean;
|
|
118
|
+
is(element: Element): boolean;
|
|
119
|
+
is(element: Element[]): boolean;
|
|
120
|
+
is(selection: Cheerio): boolean;
|
|
121
|
+
is(func: (index: number, element: Element) => boolean): boolean;
|
|
122
|
+
|
|
123
|
+
// Form
|
|
124
|
+
serialize(): string;
|
|
125
|
+
serializeArray(): Array<{ name: string; value: string }>;
|
|
126
|
+
|
|
127
|
+
// Traversing
|
|
128
|
+
|
|
129
|
+
find(selector: string): Cheerio;
|
|
130
|
+
find(element: Cheerio): Cheerio;
|
|
131
|
+
|
|
132
|
+
parent(selector?: string): Cheerio;
|
|
133
|
+
parents(selector?: string): Cheerio;
|
|
134
|
+
parentsUntil(selector?: string, filter?: string): Cheerio;
|
|
135
|
+
parentsUntil(element: Element, filter?: string): Cheerio;
|
|
136
|
+
parentsUntil(element: Cheerio, filter?: string): Cheerio;
|
|
137
|
+
|
|
138
|
+
prop(name: string): any;
|
|
139
|
+
prop(name: string, value: any): Cheerio;
|
|
140
|
+
|
|
141
|
+
closest(): Cheerio;
|
|
142
|
+
closest(selector: string): Cheerio;
|
|
143
|
+
|
|
144
|
+
next(selector?: string): Cheerio;
|
|
145
|
+
nextAll(): Cheerio;
|
|
146
|
+
nextAll(selector: string): Cheerio;
|
|
147
|
+
|
|
148
|
+
nextUntil(selector?: string, filter?: string): Cheerio;
|
|
149
|
+
nextUntil(element: Element, filter?: string): Cheerio;
|
|
150
|
+
nextUntil(element: Cheerio, filter?: string): Cheerio;
|
|
151
|
+
|
|
152
|
+
prev(selector?: string): Cheerio;
|
|
153
|
+
prevAll(): Cheerio;
|
|
154
|
+
prevAll(selector: string): Cheerio;
|
|
155
|
+
|
|
156
|
+
prevUntil(selector?: string, filter?: string): Cheerio;
|
|
157
|
+
prevUntil(element: Element, filter?: string): Cheerio;
|
|
158
|
+
prevUntil(element: Cheerio, filter?: string): Cheerio;
|
|
159
|
+
|
|
160
|
+
slice(start: number, end?: number): Cheerio;
|
|
161
|
+
|
|
162
|
+
siblings(selector?: string): Cheerio;
|
|
163
|
+
|
|
164
|
+
children(selector?: string): Cheerio;
|
|
165
|
+
|
|
166
|
+
contents(): Cheerio;
|
|
167
|
+
|
|
168
|
+
each(func: (index: number, element: Element) => any): Cheerio;
|
|
169
|
+
map(func: (index: number, element: Element) => any): Cheerio;
|
|
170
|
+
|
|
171
|
+
filter(selector: string): Cheerio;
|
|
172
|
+
filter(selection: Cheerio): Cheerio;
|
|
173
|
+
filter(element: Element): Cheerio;
|
|
174
|
+
filter(elements: Element[]): Cheerio;
|
|
175
|
+
filter(func: (index: number, element: Element) => boolean): Cheerio;
|
|
176
|
+
|
|
177
|
+
not(selector: string): Cheerio;
|
|
178
|
+
not(selection: Cheerio): Cheerio;
|
|
179
|
+
not(element: Element): Cheerio;
|
|
180
|
+
not(func: (index: number, element: Element) => boolean): Cheerio;
|
|
181
|
+
|
|
182
|
+
first(): Cheerio;
|
|
183
|
+
last(): Cheerio;
|
|
184
|
+
|
|
185
|
+
eq(index: number): Cheerio;
|
|
186
|
+
|
|
187
|
+
get(): any[];
|
|
188
|
+
get(index: number): any;
|
|
189
|
+
|
|
190
|
+
index(): number;
|
|
191
|
+
index(selector: string): number;
|
|
192
|
+
index(selection: Cheerio): number;
|
|
193
|
+
|
|
194
|
+
end(): Cheerio;
|
|
195
|
+
|
|
196
|
+
add(selectorOrHtml: string): Cheerio;
|
|
197
|
+
add(selector: string, context: Document): Cheerio;
|
|
198
|
+
add(element: Element): Cheerio;
|
|
199
|
+
add(elements: Element[]): Cheerio;
|
|
200
|
+
add(selection: Cheerio): Cheerio;
|
|
201
|
+
|
|
202
|
+
addBack(): Cheerio;
|
|
203
|
+
addBack(filter: string): Cheerio;
|
|
204
|
+
|
|
205
|
+
// Manipulation
|
|
206
|
+
appendTo(target: Cheerio): Cheerio;
|
|
207
|
+
prependTo(target: Cheerio): Cheerio;
|
|
208
|
+
|
|
209
|
+
append(content: string, ...contents: any[]): Cheerio;
|
|
210
|
+
append(content: Document, ...contents: any[]): Cheerio;
|
|
211
|
+
append(content: Document[], ...contents: any[]): Cheerio;
|
|
212
|
+
append(content: Cheerio, ...contents: any[]): Cheerio;
|
|
213
|
+
|
|
214
|
+
prepend(content: string, ...contents: any[]): Cheerio;
|
|
215
|
+
prepend(content: Document, ...contents: any[]): Cheerio;
|
|
216
|
+
prepend(content: Document[], ...contents: any[]): Cheerio;
|
|
217
|
+
prepend(content: Cheerio, ...contents: any[]): Cheerio;
|
|
218
|
+
|
|
219
|
+
after(content: string, ...contents: any[]): Cheerio;
|
|
220
|
+
after(content: Document, ...contents: any[]): Cheerio;
|
|
221
|
+
after(content: Document[], ...contents: any[]): Cheerio;
|
|
222
|
+
after(content: Cheerio, ...contents: any[]): Cheerio;
|
|
223
|
+
|
|
224
|
+
insertAfter(content: string): Cheerio;
|
|
225
|
+
insertAfter(content: Document): Cheerio;
|
|
226
|
+
insertAfter(content: Cheerio): Cheerio;
|
|
227
|
+
|
|
228
|
+
before(content: string, ...contents: any[]): Cheerio;
|
|
229
|
+
before(content: Document, ...contents: any[]): Cheerio;
|
|
230
|
+
before(content: Document[], ...contents: any[]): Cheerio;
|
|
231
|
+
before(content: Cheerio, ...contents: any[]): Cheerio;
|
|
232
|
+
|
|
233
|
+
insertBefore(content: string): Cheerio;
|
|
234
|
+
insertBefore(content: Document): Cheerio;
|
|
235
|
+
insertBefore(content: Cheerio): Cheerio;
|
|
236
|
+
|
|
237
|
+
remove(selector?: string): Cheerio;
|
|
238
|
+
|
|
239
|
+
replaceWith(content: string): Cheerio;
|
|
240
|
+
replaceWith(content: Element): Cheerio;
|
|
241
|
+
replaceWith(content: Element[]): Cheerio;
|
|
242
|
+
replaceWith(content: Cheerio): Cheerio;
|
|
243
|
+
replaceWith(content: () => Cheerio): Cheerio;
|
|
244
|
+
|
|
245
|
+
empty(): Cheerio;
|
|
246
|
+
|
|
247
|
+
html(): string | null;
|
|
248
|
+
html(html: string): Cheerio;
|
|
249
|
+
|
|
250
|
+
text(): string;
|
|
251
|
+
text(text: string): Cheerio;
|
|
252
|
+
|
|
253
|
+
wrap(content: string): Cheerio;
|
|
254
|
+
wrap(content: Document): Cheerio;
|
|
255
|
+
wrap(content: Cheerio): Cheerio;
|
|
256
|
+
|
|
257
|
+
css(propertyName?: string): string;
|
|
258
|
+
css(propertyNames: string[]): string[];
|
|
259
|
+
css(propertyName: string, value: string): Cheerio;
|
|
260
|
+
css(propertyName: string, value: number): Cheerio;
|
|
261
|
+
css(propertyName: string, func: (index: number, value: string) => string): Cheerio;
|
|
262
|
+
css(propertyName: string, func: (index: number, value: string) => number): Cheerio;
|
|
263
|
+
css(properties: Object): Cheerio;
|
|
264
|
+
|
|
265
|
+
// Rendering
|
|
266
|
+
|
|
267
|
+
// Miscellaneous
|
|
268
|
+
|
|
269
|
+
clone(): Cheerio;
|
|
270
|
+
|
|
271
|
+
// Not Documented
|
|
272
|
+
|
|
273
|
+
toArray(): Element[];
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
interface CheerioParserOptions {
|
|
277
|
+
// Document References
|
|
278
|
+
// Cheerio https://github.com/cheeriojs/cheerio
|
|
279
|
+
// HTMLParser2 https://github.com/fb55/htmlparser2/wiki/Parser-options
|
|
280
|
+
// DomHandler https://github.com/fb55/DomHandler
|
|
281
|
+
|
|
282
|
+
xmlMode?: boolean | undefined;
|
|
283
|
+
decodeEntities?: boolean | undefined;
|
|
284
|
+
lowerCaseTags?: boolean | undefined;
|
|
285
|
+
lowerCaseAttributeNames?: boolean | undefined;
|
|
286
|
+
recognizeCDATA?: boolean | undefined;
|
|
287
|
+
recognizeSelfClosing?: boolean | undefined;
|
|
288
|
+
normalizeWhitespace?: boolean | undefined;
|
|
289
|
+
withStartIndices?: boolean | undefined;
|
|
290
|
+
withEndIndices?: boolean | undefined;
|
|
291
|
+
ignoreWhitespace?: boolean | undefined;
|
|
292
|
+
_useHtmlParser2?: boolean | undefined;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
interface Selector {
|
|
296
|
+
(selector: string): Cheerio;
|
|
297
|
+
(selector: string, context: string): Cheerio;
|
|
298
|
+
(selector: string, context: Element): Cheerio;
|
|
299
|
+
(selector: string, context: Element[]): Cheerio;
|
|
300
|
+
(selector: string, context: Cheerio): Cheerio;
|
|
301
|
+
(selector: string, context: string, root: string): Cheerio;
|
|
302
|
+
(selector: string, context: Element, root: string): Cheerio;
|
|
303
|
+
(selector: string, context: Element[], root: string): Cheerio;
|
|
304
|
+
(selector: string, context: Cheerio, root: string): Cheerio;
|
|
305
|
+
(selector: any): Cheerio;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
interface Root extends Selector {
|
|
309
|
+
// Document References
|
|
310
|
+
// Cheerio https://github.com/cheeriojs/cheerio
|
|
311
|
+
// JQuery http://api.jquery.com
|
|
312
|
+
root(): Cheerio;
|
|
313
|
+
contains(container: Element, contained: Element): boolean;
|
|
314
|
+
parseHTML(data: string, context?: Document | null, keepScripts?: boolean): Document[];
|
|
315
|
+
|
|
316
|
+
html(options?: CheerioParserOptions): string;
|
|
317
|
+
html(dom: string | Cheerio | Element, options?: CheerioParserOptions): string;
|
|
318
|
+
|
|
319
|
+
xml(dom?: string | Cheerio | Element): string;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
interface CheerioAPI extends Root {
|
|
323
|
+
version: string;
|
|
324
|
+
load(html: string | Buffer, options?: CheerioParserOptions): Root;
|
|
325
|
+
load(element: Element | Element[], options?: CheerioParserOptions): Root;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
declare module "cheerio" {
|
|
330
|
+
const cheerioModule: cheerio.CheerioAPI;
|
|
331
|
+
export = cheerioModule;
|
|
332
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// noinspection JSUnusedGlobalSymbols
|
|
2
|
+
|
|
3
|
+
import {pipeline} from "node:stream/promises";
|
|
4
|
+
import {createReadStream, createWriteStream} from "node:fs";
|
|
5
|
+
import {createGunzip, createGzip} from "node:zlib";
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import fs from 'node:fs/promises';
|
|
8
|
+
import * as jk_fs from "jopi-toolkit/jk_fs";
|
|
9
|
+
|
|
10
|
+
export async function gzipFile(inputPath: string, outputPath: string) {
|
|
11
|
+
try {
|
|
12
|
+
await pipeline(createReadStream(inputPath), createGzip(), createWriteStream(outputPath));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
console.error("Can't gzip file", inputPath, e);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export async function gunzipFile(inputPath: string, outputPath: string) {
|
|
19
|
+
try {
|
|
20
|
+
await pipeline(createReadStream(inputPath), createGunzip(), createWriteStream(outputPath));
|
|
21
|
+
} catch (e) {
|
|
22
|
+
console.error("Can't gunzip file", inputPath, e);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function mkDirForFile(filePath: string): Promise<void> {
|
|
27
|
+
const directoryPath = path.dirname(filePath);
|
|
28
|
+
await fs.mkdir(directoryPath, {recursive: true});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export async function saveReadableStreamToFile(filePath: string, stream: ReadableStream<Uint8Array>) {
|
|
32
|
+
await jk_fs.writeResponseToFile(new Response(stream), filePath);
|
|
33
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export * from "./publicTools.ts";
|
|
2
|
+
export * from "./searchParamFilter.ts";
|
|
3
|
+
export * from "./serverFetch.ts";
|
|
4
|
+
export * from "./caches/InMemoryCache.ts";
|
|
5
|
+
export * from "./caches/SimpleFileCache.ts";
|
|
6
|
+
export * from "./loadBalancing.ts";
|
|
7
|
+
export * from "./automaticStartStop.ts";
|
|
8
|
+
export * from "./middlewares/index.ts";
|
|
9
|
+
|
|
10
|
+
export * from "./letsEncrypt.ts";
|
|
11
|
+
export * from "./jopiEasy.ts";
|
|
12
|
+
export * from "./routeConfig.ts";
|
|
13
|
+
|
|
14
|
+
export * from "./jopiRequest.tsx";
|
|
15
|
+
export * from "./jopiWebSite.tsx";
|
|
16
|
+
export * from "./jopiServer.ts";
|
|
17
|
+
export * from "./browserCacheControl.ts";
|
|
18
|
+
|
|
19
|
+
export * from "./bundler/config.ts";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export {type CreateBundleParams} from "./bundler/bundler.ts";
|
|
23
|
+
export {type BundlerConfig} from "./bundler/config.ts";
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type {CacheEntry} from "./caches/cache.ts";
|
|
2
|
+
import * as jk_timer from "jopi-toolkit/jk_timer";
|
|
3
|
+
|
|
4
|
+
export const serverInitChronos = jk_timer.chrono(false);
|
|
5
|
+
|
|
6
|
+
export function parseCookies(headers: Headers): { [name: string]: string } {
|
|
7
|
+
const cookies: { [name: string]: string } = {};
|
|
8
|
+
const cookieHeader = headers.get('Cookie');
|
|
9
|
+
|
|
10
|
+
if (!cookieHeader) {
|
|
11
|
+
return cookies;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
cookieHeader.split(';').forEach(cookie => {
|
|
15
|
+
const parts = cookie.split('=');
|
|
16
|
+
if (parts.length >= 2) {
|
|
17
|
+
const name = parts[0].trim();
|
|
18
|
+
cookies[name] = parts.slice(1).join('=').trim();
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
return cookies;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function readContentLength(headers: Headers): number {
|
|
26
|
+
const cl = headers.get("content-length");
|
|
27
|
+
if (!cl) return -1;
|
|
28
|
+
return parseInt(cl);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const gDefaultHeadersToCache: string[] = [ "content-type", "etag", "last-modified"];
|
|
32
|
+
|
|
33
|
+
export function cacheAddBrowserCacheValues(cacheEntry: CacheEntry, etag: string) {
|
|
34
|
+
if (!cacheEntry.headers) cacheEntry.headers = {};
|
|
35
|
+
cacheEntry.headers["etag"] = etag;
|
|
36
|
+
cacheEntry.headers["last-modified-since"] = new Date().toUTCString();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function cacheEntryToResponse(entry: CacheEntry) {
|
|
40
|
+
if (entry.binary) {
|
|
41
|
+
let headers = entry.headers;
|
|
42
|
+
if (!headers) headers = {};
|
|
43
|
+
|
|
44
|
+
if (entry.isGzipped) {
|
|
45
|
+
headers["content-encoding"] = "gzip";
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
delete(headers["content-encoding"]);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return new Response(entry.binary.buffer, {
|
|
52
|
+
status: entry.status ?? 200,
|
|
53
|
+
headers: headers
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return new Response("", {status: entry.status, headers: entry.headers});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function responseToCacheEntry(url: string, response: Response, headersToInclude: string[]|undefined): CacheEntry {
|
|
61
|
+
const status = response.status;
|
|
62
|
+
const entry: CacheEntry = {status, url};
|
|
63
|
+
|
|
64
|
+
if (status===200) {
|
|
65
|
+
const headers = {};
|
|
66
|
+
entry.headers = headers;
|
|
67
|
+
|
|
68
|
+
// "content-type", "etag", "last-modified"
|
|
69
|
+
if (!headersToInclude) {
|
|
70
|
+
headersToInclude = gDefaultHeadersToCache;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
headersToInclude.forEach(header => addHeaderIfExist(headers, header, response.headers));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if ((status>=300)&&(status<400)) {
|
|
77
|
+
entry.headers = {};
|
|
78
|
+
addHeaderIfExist(entry.headers!, "Location", response.headers);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return entry;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function addHeaderIfExist(headers: {[key: string]: string}, headerName: string, source: Headers) {
|
|
85
|
+
const v = source.get(headerName);
|
|
86
|
+
if (v!==null) headers[headerName] = v;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function makeIterable<T>(iterator: Iterator<T>): Iterable<T> {
|
|
90
|
+
return {
|
|
91
|
+
[Symbol.iterator]() {
|
|
92
|
+
return iterator;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference path="cheerio.d.ts" />
|
|
2
|
+
|
|
3
|
+
import * as ReactServer from 'react-dom/server';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Add our own function to cheerio.
|
|
7
|
+
* Note: the definition type has directly been added to cheerio.d.ts.
|
|
8
|
+
*/
|
|
9
|
+
export function initCheerio($: cheerio.Root) {
|
|
10
|
+
$.prototype.reactReplaceWith = function (this: cheerio.Cheerio, node: React.ReactElement): cheerio.Cheerio {
|
|
11
|
+
// Note: "this: cheerio.Cheerio" allows casting the value of this.
|
|
12
|
+
|
|
13
|
+
this.replaceWith(ReactServer.renderToStaticMarkup(node));
|
|
14
|
+
return this;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
$.prototype.reactReplaceContentWith = function (this: cheerio.Cheerio, node: React.ReactElement): cheerio.Cheerio {
|
|
18
|
+
// Note: "this: cheerio.Cheerio" allows casting the value of this.
|
|
19
|
+
|
|
20
|
+
return this.html(ReactServer.renderToStaticMarkup(node));
|
|
21
|
+
};
|
|
22
|
+
}
|