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,39 @@
|
|
|
1
|
+
import * as jk_fs from "jopi-toolkit/jk_fs";
|
|
2
|
+
import * as jk_events from "jopi-toolkit/jk_events";
|
|
3
|
+
import {getBrowserInstallScript, getServerInstallScript} from "./engine.ts";
|
|
4
|
+
import {JopiEasyWebSite, type WebSite} from "jopijs";
|
|
5
|
+
|
|
6
|
+
export type InstallFunction<T> = (registry: T) => void;
|
|
7
|
+
|
|
8
|
+
export async function loadServerInstall(webSite: JopiEasyWebSite, onWebSiteCreate: (h: (webSite: WebSite) => void|Promise<void>) => void) {
|
|
9
|
+
let installFilePath = getServerInstallScript();
|
|
10
|
+
if (!await jk_fs.isFile(installFilePath)) return;
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
let v = await import(installFilePath);
|
|
14
|
+
if (!v.default) return;
|
|
15
|
+
|
|
16
|
+
await v.default(webSite, onWebSiteCreate);
|
|
17
|
+
|
|
18
|
+
onWebSiteCreate(webSite => {
|
|
19
|
+
jk_events.sendEvent("jopi.server.install.done", webSite);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export async function getBrowserInstallFunction<T>(): Promise<InstallFunction<T>> {
|
|
28
|
+
let installFilePath = getBrowserInstallScript();
|
|
29
|
+
if (!await jk_fs.isFile(installFilePath)) return gVoidFunction;
|
|
30
|
+
|
|
31
|
+
let v = await import(installFilePath);
|
|
32
|
+
if (!v.default) return gVoidFunction;
|
|
33
|
+
|
|
34
|
+
return function(registry: T) {
|
|
35
|
+
v.default(registry);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const gVoidFunction = () => {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CodeGenWriter,
|
|
3
|
+
FilePart,
|
|
4
|
+
InstallFileType,
|
|
5
|
+
ModuleDirProcessor,
|
|
6
|
+
resolveFile
|
|
7
|
+
} from "./engine.ts";
|
|
8
|
+
import * as jk_fs from "jopi-toolkit/jk_fs";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Search the uiInstall.ts and serverInstall.ts files
|
|
12
|
+
*/
|
|
13
|
+
export default class ModInstaller extends ModuleDirProcessor {
|
|
14
|
+
private uiInitFiles: string[] = [];
|
|
15
|
+
private serverInitFiles: string[] = [];
|
|
16
|
+
|
|
17
|
+
override async onBeginModuleProcessing(_writer: CodeGenWriter, moduleDir: string): Promise<void> {
|
|
18
|
+
let uiInitFile = await resolveFile(moduleDir, ["uiInit.tsx", "uiInit.ts"]);
|
|
19
|
+
if (uiInitFile) this.uiInitFiles.push(uiInitFile);
|
|
20
|
+
|
|
21
|
+
let serverInitFile = await resolveFile(moduleDir, ["serverInit.tsx", "serverInit.ts"]);
|
|
22
|
+
if (serverInitFile) this.serverInitFiles.push(serverInitFile);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
override async generateCode(writer: CodeGenWriter): Promise<void> {
|
|
26
|
+
let i = 0;
|
|
27
|
+
|
|
28
|
+
for (let uiInitFile of this.uiInitFiles) {
|
|
29
|
+
i++;
|
|
30
|
+
|
|
31
|
+
let relPath = writer.makePathRelativeToOutput(uiInitFile);
|
|
32
|
+
if (!writer.isTypeScriptOnly) relPath = writer.toJavascriptFileName(relPath);
|
|
33
|
+
|
|
34
|
+
writer.genAddToInstallFile(InstallFileType.browser, FilePart.imports, `\nimport modUiInit${i} from "${relPath}";`);
|
|
35
|
+
writer.genAddToInstallFile(InstallFileType.browser, FilePart.footer, `\n modUiInit${i}(registry);`)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
i = 0;
|
|
39
|
+
|
|
40
|
+
for (let serverInitFile of this.serverInitFiles) {
|
|
41
|
+
i++;
|
|
42
|
+
|
|
43
|
+
let relPath = writer.makePathRelativeToOutput(serverInitFile);
|
|
44
|
+
if (!writer.isTypeScriptOnly) relPath = writer.toJavascriptFileName(relPath);
|
|
45
|
+
|
|
46
|
+
writer.genAddToInstallFile(InstallFileType.server, FilePart.imports, `\nimport modServerInit${i} from "${relPath}";`);
|
|
47
|
+
writer.genAddToInstallFile(InstallFileType.server, FilePart.body, `\n await modServerInit${i}(registry);`)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {type ArobaseList, Type_ArobaseList} from "./arobaseTypes.ts";
|
|
2
|
+
import {CodeGenWriter, FilePart, InstallFileType, type RegistryItem} from "./engine.ts";
|
|
3
|
+
|
|
4
|
+
export default class TypeEvents extends Type_ArobaseList {
|
|
5
|
+
async endGeneratingCode(writer: CodeGenWriter, items: RegistryItem[]): Promise<void> {
|
|
6
|
+
let count = 0;
|
|
7
|
+
|
|
8
|
+
// Here items are individual event listeners.
|
|
9
|
+
// There are not sorted, an item can be bound to an event A and another item to another event.
|
|
10
|
+
//
|
|
11
|
+
for (let item of items) {
|
|
12
|
+
count++;
|
|
13
|
+
|
|
14
|
+
let list = item as ArobaseList;
|
|
15
|
+
|
|
16
|
+
// Note: inside installServer.js : use the global event handler.
|
|
17
|
+
// inside installBrowser.js: use the event handler local to the request.
|
|
18
|
+
//
|
|
19
|
+
let jsSources = ` registry.events.addProvider("${list.listName}", async () => { const R = await import("@/events/${list.listName}"); return R.list; });`;
|
|
20
|
+
writer.genAddToInstallFile(InstallFileType.both, FilePart.body, jsSources);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
protected codeGen_generateImports() {
|
|
25
|
+
return `import {createStaticEvent} from "jopi-toolkit/jk_events";\n`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
protected codeGen_generateExports(array: string, eventName: string) {
|
|
29
|
+
return `export const list = ${array};
|
|
30
|
+
export const event = createStaticEvent(${JSON.stringify(eventName)}, list);
|
|
31
|
+
export default event;`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
protected codeGen_createDeclarationTypes() {
|
|
35
|
+
return `import type { SyncEventListener, StaticEvent } from "jopi-toolkit/jk_events";
|
|
36
|
+
export declare const list: SyncEventListener[];
|
|
37
|
+
export declare const event: StaticEvent;
|
|
38
|
+
export default event;`
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
protected normalizeConditionName(condName: string): string|undefined {
|
|
42
|
+
if (condName.startsWith("if")) {
|
|
43
|
+
condName = condName.substring(2);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
condName = condName.replace("-", "");
|
|
47
|
+
condName = condName.replace("_", "");
|
|
48
|
+
|
|
49
|
+
if (condName==="browser") {
|
|
50
|
+
return "if_browser";
|
|
51
|
+
}
|
|
52
|
+
else if (condName==="server") {
|
|
53
|
+
return "if_server";
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ArobaseType,
|
|
3
|
+
CodeGenWriter,
|
|
4
|
+
FilePart,
|
|
5
|
+
getWriter,
|
|
6
|
+
InstallFileType,
|
|
7
|
+
PriorityLevel,
|
|
8
|
+
resolveFile, writeTextToFileIfMismatch
|
|
9
|
+
} from "./engine.ts";
|
|
10
|
+
import * as jk_fs from "jopi-toolkit/jk_fs";
|
|
11
|
+
import * as jk_app from "jopi-toolkit/jk_app";
|
|
12
|
+
import type {RouteAttributs} from "jopijs/generated";
|
|
13
|
+
|
|
14
|
+
export default class TypeRoutes extends ArobaseType {
|
|
15
|
+
private sourceCode_header = `import {routeBindPage, routeBindVerb} from "jopijs/generated";`;
|
|
16
|
+
private sourceCode_body = "";
|
|
17
|
+
private outputDir: string = "";
|
|
18
|
+
private cwdDir: string = process.cwd();
|
|
19
|
+
private routeCount: number = 1;
|
|
20
|
+
|
|
21
|
+
private registry: Record<string, RegistryItem> = {};
|
|
22
|
+
private routeConfig: Record<string, string> = {};
|
|
23
|
+
|
|
24
|
+
async beginGeneratingCode(writer: CodeGenWriter): Promise<void> {
|
|
25
|
+
for (let item of Object.values(this.registry)) {
|
|
26
|
+
if (item.verb==="PAGE") {
|
|
27
|
+
this.bindPage(item.route, item.filePath, item.attributs);
|
|
28
|
+
} else {
|
|
29
|
+
this.bindVerb(item.verb, item.route, item.filePath, item.attributs);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (Object.keys(this.routeConfig).length>0) {
|
|
34
|
+
this.sourceCode_header += `\nimport {RouteConfig} from "jopijs";`;
|
|
35
|
+
|
|
36
|
+
let count = 1;
|
|
37
|
+
|
|
38
|
+
for (let route of Object.keys(this.routeConfig)) {
|
|
39
|
+
let configFile = this.routeConfig[route];
|
|
40
|
+
let relPath = jk_fs.getRelativePath(writer.dir.output_dir, configFile);
|
|
41
|
+
|
|
42
|
+
this.sourceCode_header += `\nimport routeConfig${count} from "${relPath}";`;
|
|
43
|
+
this.sourceCode_body += `\n await routeConfig${count}(new RouteConfig(webSite, ${JSON.stringify(route)}));`;
|
|
44
|
+
|
|
45
|
+
count++;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
this.sourceCode_body = `\n\nexport default async function(webSite) {${this.sourceCode_body}\n}`;
|
|
50
|
+
|
|
51
|
+
let filePath = jk_fs.join(writer.dir.output_dir, "declareServerRoutes.js");
|
|
52
|
+
await writeTextToFileIfMismatch(filePath, writer.AI_INSTRUCTIONS + this.sourceCode_header + this.sourceCode_body);
|
|
53
|
+
|
|
54
|
+
writer.genAddToInstallFile(InstallFileType.server, FilePart.imports, `\nimport declareRoutes from "./declareServerRoutes.js";`);
|
|
55
|
+
writer.genAddToInstallFile(InstallFileType.server, FilePart.footer, "\n onWebSiteCreated((webSite) => declareRoutes(webSite));");
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async processDir(p: { moduleDir: string; arobaseDir: string; genDir: string; }) {
|
|
59
|
+
this.outputDir = getWriter().dir.output_dir;
|
|
60
|
+
|
|
61
|
+
let dirAttributes = await this.scanAttributes(p.arobaseDir);
|
|
62
|
+
//
|
|
63
|
+
if (dirAttributes.configFile) {
|
|
64
|
+
this.routeConfig["/"] = dirAttributes.configFile;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
await this.scanDir(p.arobaseDir, "/", dirAttributes);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
private bindPage(route: string, filePath: string, attributs: RouteAttributs) {
|
|
71
|
+
let routeId = "r" + (this.routeCount++);
|
|
72
|
+
let srcFilePath = jk_fs.getRelativePath(this.cwdDir, filePath);
|
|
73
|
+
|
|
74
|
+
filePath = jk_app.getCompiledFilePathFor(filePath);
|
|
75
|
+
let distFilePath = jk_fs.getRelativePath(this.outputDir, filePath);
|
|
76
|
+
|
|
77
|
+
let routeBindingParams = {route, attributs, filePath: srcFilePath};
|
|
78
|
+
|
|
79
|
+
this.sourceCode_header += `\nimport c_${routeId} from "${distFilePath}";`;
|
|
80
|
+
this.sourceCode_body += `\n await routeBindPage(webSite, c_${routeId}, ${JSON.stringify(routeBindingParams)});`
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
private bindVerb(verb: string, route: string, filePath: string, attributs: RouteAttributs) {
|
|
84
|
+
let routeId = "r" + (this.routeCount++);
|
|
85
|
+
let relPath = jk_fs.getRelativePath(this.outputDir, filePath);
|
|
86
|
+
|
|
87
|
+
let routeBindingParams = {verb, route, attributs, filePath};
|
|
88
|
+
this.sourceCode_header += `\nimport f_${routeId} from "${relPath}";`;
|
|
89
|
+
this.sourceCode_body += `\n await routeBindVerb(webSite, f_${routeId}, ${JSON.stringify(routeBindingParams)});`
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
protected normalizeFeatureName(feature: string): string|undefined {
|
|
93
|
+
if (feature==="cache") {
|
|
94
|
+
return "cache";
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
feature = feature.replaceAll("-", "");
|
|
98
|
+
feature = feature.replaceAll("_", "");
|
|
99
|
+
|
|
100
|
+
if (feature==="autocache") {
|
|
101
|
+
return "cache";
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
protected normalizeConditionName(condName: string, ctx: any|undefined): string|undefined {
|
|
108
|
+
let needRoleIdx = condName.toLowerCase().indexOf("needrole");
|
|
109
|
+
if (needRoleIdx===-1) return undefined;
|
|
110
|
+
|
|
111
|
+
let target = condName.substring(0, needRoleIdx).toUpperCase();
|
|
112
|
+
let role = condName.substring(needRoleIdx + 8).toLowerCase();
|
|
113
|
+
if ((role[0]==='_')||(role[0]==='-')) role = role.substring(1);
|
|
114
|
+
|
|
115
|
+
if (!ctx[target]) ctx[target] = [role];
|
|
116
|
+
else ctx[target].push(role);
|
|
117
|
+
|
|
118
|
+
target = target.toLowerCase();
|
|
119
|
+
return target + "NeedRole_" + role;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
private async scanAttributes(dirPath: string): Promise<RouteAttributs> {
|
|
123
|
+
const res: RouteAttributs = {needRoles: {}};
|
|
124
|
+
|
|
125
|
+
const infos = await this.dir_extractInfos(dirPath, {
|
|
126
|
+
allowConditions: true,
|
|
127
|
+
requirePriority: true,
|
|
128
|
+
requireRefFile: false,
|
|
129
|
+
conditionCheckingContext: res.needRoles
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
res.configFile = await resolveFile(dirPath, ["config.tsx", "config.ts"]);
|
|
133
|
+
|
|
134
|
+
res.disableCache = (infos.features?.["cache"] === true) ? true : undefined;
|
|
135
|
+
res.priority = infos.priority;
|
|
136
|
+
|
|
137
|
+
if (!Object.values(res.needRoles!).length) {
|
|
138
|
+
res.needRoles = undefined;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return res;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
private addToRegistry(item: RegistryItem) {
|
|
145
|
+
const key = item.route + ' ' + item.verb;
|
|
146
|
+
let current = this.registry[key];
|
|
147
|
+
|
|
148
|
+
if (!current) {
|
|
149
|
+
this.registry[key] = item;
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
let newPriority = item.attributs.priority || PriorityLevel.default;
|
|
154
|
+
let currentPriority = current.attributs.priority || PriorityLevel.default;
|
|
155
|
+
|
|
156
|
+
if (newPriority>currentPriority) {
|
|
157
|
+
this.registry[key] = item;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
private async scanDir(dir: string, route: string, attributes: RouteAttributs) {
|
|
162
|
+
let dirItems = await jk_fs.listDir(dir);
|
|
163
|
+
|
|
164
|
+
for (let dirItem of dirItems) {
|
|
165
|
+
if (dirItem.name[0] === '.') continue;
|
|
166
|
+
|
|
167
|
+
// Ignore if starts with '_'.
|
|
168
|
+
if (dirItem.name[0] === '_') continue;
|
|
169
|
+
|
|
170
|
+
if (dirItem.isDirectory) {
|
|
171
|
+
let segmentInfos = convertRouteSegment(dirItem.name);
|
|
172
|
+
let newRoute = route==="/" ? route + segmentInfos.routePart : route + "/" + segmentInfos.routePart;
|
|
173
|
+
let dirAttributs = await this.scanAttributes(dirItem.fullPath);
|
|
174
|
+
|
|
175
|
+
if (segmentInfos.isCatchAll && segmentInfos.name) {
|
|
176
|
+
dirAttributs.catchAllSlug = segmentInfos.name;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (dirAttributs.configFile) {
|
|
180
|
+
this.routeConfig[newRoute] = dirAttributs.configFile;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
await this.scanDir(dirItem.fullPath, newRoute, dirAttributs);
|
|
184
|
+
} else if (dirItem.isFile) {
|
|
185
|
+
let name = dirItem.name;
|
|
186
|
+
|
|
187
|
+
if (name.endsWith(".tsx") || name.endsWith(".ts")) {
|
|
188
|
+
let idx = name.lastIndexOf(".");
|
|
189
|
+
name = name.substring(0, idx);
|
|
190
|
+
|
|
191
|
+
switch (name) {
|
|
192
|
+
case "page":
|
|
193
|
+
this.addToRegistry({verb: "PAGE", route, filePath: dirItem.fullPath, attributs: attributes});
|
|
194
|
+
break;
|
|
195
|
+
case "onGET":
|
|
196
|
+
this.addToRegistry({verb: "GET", route, filePath: dirItem.fullPath, attributs: attributes});
|
|
197
|
+
break;
|
|
198
|
+
case "onPOST":
|
|
199
|
+
this.addToRegistry({verb: "POST", route, filePath: dirItem.fullPath, attributs: attributes});
|
|
200
|
+
break;
|
|
201
|
+
case "onPUT":
|
|
202
|
+
this.addToRegistry({verb: "PUT", route, filePath: dirItem.fullPath, attributs: attributes});
|
|
203
|
+
break;
|
|
204
|
+
case "onDELETE":
|
|
205
|
+
this.addToRegistry({verb: "DELETE", route, filePath: dirItem.fullPath, attributs: attributes});
|
|
206
|
+
break;
|
|
207
|
+
case "onHEAD":
|
|
208
|
+
this.addToRegistry({verb: "HEAD", route, filePath: dirItem.fullPath, attributs: attributes});
|
|
209
|
+
break;
|
|
210
|
+
case "onPATCH":
|
|
211
|
+
this.addToRegistry({verb: "PATCH", route, filePath: dirItem.fullPath, attributs: attributes});
|
|
212
|
+
break;
|
|
213
|
+
case "onOPTIONS":
|
|
214
|
+
this.addToRegistry({verb: "OPTIONS", route, filePath: dirItem.fullPath, attributs: attributes});
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
interface RegistryItem {
|
|
224
|
+
verb: string;
|
|
225
|
+
route: string;
|
|
226
|
+
filePath: string;
|
|
227
|
+
attributs: RouteAttributs;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function convertRouteSegment(segment: string): {routePart: string, isCatchAll?: boolean, name?: string} {
|
|
231
|
+
if (segment.startsWith("[") && segment.endsWith("]")) {
|
|
232
|
+
segment = segment.substring(1, segment.length - 1);
|
|
233
|
+
|
|
234
|
+
if (segment.startsWith("..")) {
|
|
235
|
+
segment = segment.substring(2);
|
|
236
|
+
while (segment[0]===".") segment=segment.substring(1);
|
|
237
|
+
|
|
238
|
+
return {
|
|
239
|
+
routePart: "**",
|
|
240
|
+
isCatchAll: true,
|
|
241
|
+
name: segment.length ? segment : undefined
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return {
|
|
246
|
+
routePart: ":" + segment,
|
|
247
|
+
isCatchAll: false,
|
|
248
|
+
name: segment
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
return {
|
|
253
|
+
routePart: segment
|
|
254
|
+
};
|
|
255
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {Type_ArobaseList} from "./arobaseTypes.ts";
|
|
2
|
+
|
|
3
|
+
export default class TypeUiComposite extends Type_ArobaseList {
|
|
4
|
+
protected codeGen_generateExports(listAsArray: string) {
|
|
5
|
+
let array = listAsArray.slice(1, -2).split(",");
|
|
6
|
+
listAsArray = array.map(e => ` _jsx(${e}, {})`).join(", \n");
|
|
7
|
+
let fct = `function p() {\n return _jsxs(_Fragment, { children: [\n${listAsArray}\n ]});\n}`;
|
|
8
|
+
|
|
9
|
+
return "export default " + fct + ";";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
protected codeGen_generateImports() {
|
|
13
|
+
return `import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";\n`;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
protected codeGen_createDeclarationTypes() {
|
|
17
|
+
return `export default function p(): import("react/jsx-runtime").JSX.Element;`
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
//import {compile, getDefaultLinkerConfig} from "../@linker/index.ts";
|
|
4
|
+
|
|
5
|
+
const myPlugin = {
|
|
6
|
+
name: "jopi-replace-text",
|
|
7
|
+
|
|
8
|
+
setup(build) {
|
|
9
|
+
build.onLoad({filter: /\.(tsx|ts|js|jsx)$/}, async ({path: p2}) => {
|
|
10
|
+
const oldContent = await fs.readFile(p2, 'utf8');
|
|
11
|
+
let newContent = oldContent.replace("jBundler_ifServer", "jBundler_ifBrowser");
|
|
12
|
+
const loader = path.extname(p2).toLowerCase().substring(1);
|
|
13
|
+
return {contents: newContent, loader: loader};
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// Note: this is not working since it's executed only once at the first start
|
|
17
|
+
// and not after each rebuild.
|
|
18
|
+
|
|
19
|
+
/*build.onStart(async () => {
|
|
20
|
+
//console.log("Jopi - Bun static compiler loader - beforeRebuild");
|
|
21
|
+
//await timer(3000);
|
|
22
|
+
//await compile(import.meta, getDefaultLinkerConfig());
|
|
23
|
+
});*/
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default myPlugin;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as NodeModule from 'node:module';
|
|
2
|
+
|
|
3
|
+
import {isNodeJS, isBunJS} from "jopi-toolkit/jk_what";
|
|
4
|
+
import {installBunJsLoader} from "jopijs/loader-tools";
|
|
5
|
+
|
|
6
|
+
// Guard to avoid recursive self-registration when using Module.register(import.meta.url)
|
|
7
|
+
const __JOPI_LOADER_REGISTERED__ = Symbol.for('jopi-loader:registered');
|
|
8
|
+
const __g: any = globalThis as any;
|
|
9
|
+
|
|
10
|
+
if (!__g[__JOPI_LOADER_REGISTERED__]) {
|
|
11
|
+
__g[__JOPI_LOADER_REGISTERED__] = true;
|
|
12
|
+
|
|
13
|
+
if (isNodeJS) {
|
|
14
|
+
// "register" allow async.
|
|
15
|
+
NodeModule.register(new URL('./nodeJsLoader.js', import.meta.url));
|
|
16
|
+
} else if (isBunJS) {
|
|
17
|
+
installBunJsLoader();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {doNodeJsLoad, doNodeJsResolve} from "jopijs/loader-tools";
|
|
2
|
+
|
|
3
|
+
// Guard to avoid recursive self-registration when using Module.register(import.meta.url)
|
|
4
|
+
/*const __JOPI_LOADER_REGISTERED__ = Symbol.for('jopi-loader:registered');
|
|
5
|
+
const __g: any = globalThis as any;
|
|
6
|
+
|
|
7
|
+
if (!__g[__JOPI_LOADER_REGISTERED__]) {
|
|
8
|
+
__g[__JOPI_LOADER_REGISTERED__] = true;
|
|
9
|
+
|
|
10
|
+
// "register" allow async.
|
|
11
|
+
NodeModule.register(import.meta.url as unknown as string);
|
|
12
|
+
}*/
|
|
13
|
+
|
|
14
|
+
export async function resolve(specifier: string, context: any, nextResolve: any) {
|
|
15
|
+
return doNodeJsResolve(specifier, context, nextResolve);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// noinspection JSUnusedGlobalSymbols
|
|
19
|
+
export async function load(url: string, context: any, nextLoad: any) {
|
|
20
|
+
return doNodeJsLoad(url, context, nextLoad);
|
|
21
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import process from 'node:process';
|
|
2
|
+
import type {WebSite} from "../@core";
|
|
3
|
+
import * as jk_events from "jopi-toolkit/jk_events";
|
|
4
|
+
import {isBunJS} from "jopi-toolkit/jk_what";
|
|
5
|
+
import {DontCallBeforeElapsed} from "jopi-toolkit/jk_tools";
|
|
6
|
+
|
|
7
|
+
export function isBrowserRefreshEnabled(): boolean {
|
|
8
|
+
return hasJopiDevFlag() || hasJopiDevUiFlag();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* JOPI_DEV: on source change, restart the server and refresh the browser.
|
|
13
|
+
* It's slower than JOPI_DEV_UI but allows testing server changes.
|
|
14
|
+
*/
|
|
15
|
+
export function hasJopiDevFlag() {
|
|
16
|
+
return process.env.JOPI_DEV === "1";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* JOPI_DEV_UI: on source change, don't restart the server
|
|
21
|
+
* but rebuild the UI pages and refresh the browser.
|
|
22
|
+
* (with bun: it uses React HMR, which is a special case)
|
|
23
|
+
*
|
|
24
|
+
* -> It's way faster than JOPI_DEV but can have some inconsistency
|
|
25
|
+
* when modifying the @alias directory content.
|
|
26
|
+
*/
|
|
27
|
+
export function hasJopiDevUiFlag() {
|
|
28
|
+
return process.env.JOPI_DEV_UI === "1";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Single page mode is when the internal bundle compiles the pages one by one.
|
|
33
|
+
* It's used for development to have a fast starting time.
|
|
34
|
+
*
|
|
35
|
+
* The opposite (when not single-page mode) is to compile all the pages in one go.
|
|
36
|
+
* This produces an optimized bundle, without duplicates, but can be slow to start.
|
|
37
|
+
*/
|
|
38
|
+
export function isSinglePageMode() {
|
|
39
|
+
if (gSinglePageMode===undefined) {
|
|
40
|
+
if (isReactHMR()) gSinglePageMode = false;
|
|
41
|
+
else gSinglePageMode = hasJopiDevFlag() || hasJopiDevUiFlag();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return gSinglePageMode;
|
|
45
|
+
}
|
|
46
|
+
//
|
|
47
|
+
let gSinglePageMode: boolean|undefined;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* React HMR is when the browser automatically refreshes his content
|
|
51
|
+
* but without a full refresh. It does a clever refresh by removing old
|
|
52
|
+
* JavaScript and injecting the new-one, before re-rendering the React components
|
|
53
|
+
* without losing their previous state.
|
|
54
|
+
*/
|
|
55
|
+
export function isReactHMR() {
|
|
56
|
+
return hasJopiDevUiFlag() && isBunJS;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function sse_onChange() {
|
|
60
|
+
const event = new EventSource('/_jopirw_/bundler');
|
|
61
|
+
let isFirstConnection = true;
|
|
62
|
+
|
|
63
|
+
// This allows refreshing the browser when
|
|
64
|
+
// the connection is lost, and the browser connects again.
|
|
65
|
+
//
|
|
66
|
+
event.addEventListener('open', () => {
|
|
67
|
+
if (isFirstConnection) isFirstConnection = false;
|
|
68
|
+
else window.location.reload();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// This allows refreshing the browser when
|
|
72
|
+
// the server sends a signal to the browser.
|
|
73
|
+
//
|
|
74
|
+
event.addEventListener("change", () => {
|
|
75
|
+
console.log("SSE Event [/_jopirw_/bundler] : Refreshing browser");
|
|
76
|
+
window.location.reload();
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
//
|
|
80
|
+
let g_sse_onChange: string|undefined;
|
|
81
|
+
|
|
82
|
+
export function getBrowserRefreshScript() {
|
|
83
|
+
if (!g_sse_onChange) {
|
|
84
|
+
g_sse_onChange = sse_onChange.toString();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return `(${g_sse_onChange})()`;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function installBrowserRefreshSseEvent(webSite: WebSite) {
|
|
91
|
+
webSite.addSseEVent("/_jopirw_/bundler", {
|
|
92
|
+
getWelcomeMessage() {
|
|
93
|
+
return "Jopi Rewrite - Browser refresh";
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
handler(controller) {
|
|
97
|
+
jk_events.addListener("@jopi.bundler.watch.afterRebuild", () => {
|
|
98
|
+
// Can occur multi times with single-page mode.
|
|
99
|
+
if (!gLimitBrowserRefresh.check()) return;
|
|
100
|
+
|
|
101
|
+
console.log("🔥 JopiN - UI change detected: refreshing browser");
|
|
102
|
+
controller.send("change", "updated");
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const gLimitBrowserRefresh = new DontCallBeforeElapsed(2000);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Contains tools related to pre-processing your source-code.
|
|
2
|
+
Mainly for manager the `import` in order to allows Node.js to mimick Vite.js import capacities:
|
|
3
|
+
|
|
4
|
+
* Importing images / json / ...
|
|
5
|
+
* Supporting alias `import "@/shared/myItems.ts` where `@/shared` point to a special location.
|
|
6
|
+
* Supporting `?raw` and `?inline` modifiers. Ex: `import asDataUrl from "./myImage.png?inline"`.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {supportedExtensionsRegExp} from "./rules.ts";
|
|
2
|
+
import {transformFile} from "./transform.ts";
|
|
3
|
+
import {installEsBuildPlugins} from "./esBuildPlugin.js";
|
|
4
|
+
|
|
5
|
+
// https://bun.com/docs/runtime/plugins
|
|
6
|
+
|
|
7
|
+
export function installBunJsLoader() {
|
|
8
|
+
Bun.plugin({
|
|
9
|
+
name: "jopi-loader",
|
|
10
|
+
setup(build) {
|
|
11
|
+
// For module.css and imports with ?inline and ?raw
|
|
12
|
+
installEsBuildPlugins(build);
|
|
13
|
+
|
|
14
|
+
// For .css/.scss/.png/.txt/...
|
|
15
|
+
build.onLoad({filter: supportedExtensionsRegExp}, async ({path}) => {
|
|
16
|
+
let idx = path.indexOf("?");
|
|
17
|
+
let options = "";
|
|
18
|
+
|
|
19
|
+
if (idx !== -1) {
|
|
20
|
+
options = path.substring(idx + 1);
|
|
21
|
+
path = path.substring(0, idx);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const res = await transformFile(path, options);
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
contents: res.text,
|
|
28
|
+
loader: "js",
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|