soma-core 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/SomaPageClient.tsx +5 -5
- package/app/api/[...path]/route.ts +3 -3
- package/app/components/SomaHostPage.tsx +1 -1
- package/app/layout.tsx +13 -13
- package/app/soma/manifest/route.ts +1 -1
- package/app/soma/page/route.ts +1 -1
- package/app/soma/page-object/route.ts +9 -8
- package/bin/soma-db.cjs +13 -0
- package/bin/soma-lsp.cjs +5 -5
- package/bin/soma-mock.mjs +1 -1
- package/bin/soma-sync.cjs +1 -1
- package/core/{compiler → build/compiler}/full-manifest-builder.ts +10 -10
- package/core/{compiler → build/compiler}/host-config-sync.cjs +1 -1
- package/core/{compiler → build/compiler}/precompiled-manifest-loader.ts +1 -1
- package/core/{compiler → build/compiler}/rollup-plugin-soma.ts +1 -1
- package/core/{compiler → build/compiler}/route-builder.ts +31 -31
- package/core/{compiler → build/compiler}/soma-manifest-webpack-plugin.js +1 -1
- package/core/{compiler → build/compiler}/soma-precompile.js +8 -8
- package/core/{compiler → build/compiler}/soma-precompile.ts +94 -94
- package/core/{compiler → build/compiler}/soma-webpack-loader.js +41 -41
- package/core/{compiler → build/compiler}/vite-plugin-soma.ts +83 -83
- package/core/build/db/cli.ts +10 -0
- package/core/build/db/emit-entities.ts +45 -0
- package/core/build/db/emit-mappers.ts +175 -0
- package/core/build/db/emit-prisma-schema.ts +92 -0
- package/core/build/db/generate.ts +166 -0
- package/core/build/db/ir.ts +75 -0
- package/core/build/db/load-db-yaml.ts +241 -0
- package/core/{base → client/base}/SomaApi.ts +14 -14
- package/core/{base → client/base}/SomaDict.ts +168 -168
- package/core/{base → client/base}/SomaHttpClient.ts +123 -123
- package/core/{base → client/base}/SomaPageRootBase.ts +71 -71
- package/core/{base → client/base}/SomaValidator.ts +147 -147
- package/core/{compiler → client/compiler}/manifest-compiler.ts +238 -238
- package/core/{engine → client/engine}/asset-resolver.ts +102 -102
- package/core/{engine → client/engine}/dom-renderer.ts +341 -341
- package/core/{engine → client/engine}/event-engine.ts +356 -356
- package/core/{engine → client/engine}/lis.ts +60 -60
- package/core/{engine → client/engine}/on-change-engine.ts +3 -3
- package/core/{engine → client/engine}/property-watcher.ts +2 -2
- package/core/{engine → client/engine}/reactive-proxy.ts +231 -231
- package/core/{engine → client/engine}/render-engine.ts +350 -350
- package/core/{engine → client/engine}/runtime-builder.ts +177 -177
- package/core/{engine → client/engine}/scope-resolver.ts +308 -308
- package/core/{engine → client/engine}/soma-bootstrap.ts +8 -8
- package/core/{engine → client/engine}/style-binder.ts +423 -423
- package/core/{engine → client/engine}/theme-variables.ts +1 -1
- package/core/{engine → client/engine}/timer-engine.ts +3 -3
- package/core/{engine → client/engine}/trigger-engine.ts +2 -2
- package/core/client/host-bridge/index.ts +27 -0
- package/core/{host → client/host-bridge}/load-host-domain-class.ts +1 -1
- package/core/{infra → client/infra}/http/SomaHttpService.ts +185 -185
- package/core/{parser → client/parser}/annotation-extractor.ts +2 -2
- package/core/{parser → client/parser}/pipeline-parser.ts +3 -3
- package/core/{parser → client/parser}/style-config-parser.ts +340 -340
- package/core/{parser → client/parser}/timer-parser.ts +3 -3
- package/core/{parser → client/parser}/trigger-parser.ts +3 -3
- package/core/{parser → client/parser}/ui-config-parser.ts +408 -408
- package/core/{parser → client/parser}/yaml-loader.ts +36 -36
- package/core/{scheduler → client/scheduler}/SomaScheduler.ts +190 -190
- package/core/{validation → client/validation}/contract-validator.ts +2 -2
- package/core/index.ts +40 -39
- package/core/{api → server/api}/IService.ts +29 -29
- package/core/{engine → server/headless}/soma-headless-page.ts +26 -9
- package/core/{host → server/host}/server-page-assets.ts +1 -1
- package/core/server/index.ts +56 -0
- package/core/{infra → server/infra}/cache/ServerFileCache.ts +123 -123
- package/core/server/infra/db/errors.ts +11 -0
- package/core/server/infra/db/mapper/PrismaSomaMapper.ts +313 -0
- package/core/server/infra/db/mapper/SomaBaseMapper.ts +23 -0
- package/core/server/infra/db/mapper/SomaMapperHooks.ts +13 -0
- package/core/server/infra/db/query/SomaQuery.ts +149 -0
- package/core/server/infra/db/service/SomaDbService.ts +64 -0
- package/core/server/infra/db/soma-db.ts +120 -0
- package/core/server/infra/db/types.ts +21 -0
- package/core/server/server-only.d.ts +1 -0
- package/core/{types → shared/types}/domain.types.ts +91 -91
- package/dist/cli/soma.js +5 -1
- package/dist/core/index.cjs +73 -73
- package/dist/diagnostics/telemetry.cjs +1 -1
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/{compiler → build/compiler}/full-manifest-builder.d.ts +5 -5
- package/dist/types/{compiler → build/compiler}/precompiled-manifest-loader.d.ts +1 -1
- package/dist/types/{compiler → build/compiler}/soma-precompile.d.ts +5 -5
- package/dist/types/{compiler → build/compiler}/vite-plugin-soma.d.ts +1 -1
- package/dist/types/build/db/cli.d.ts +2 -0
- package/dist/types/build/db/emit-entities.d.ts +5 -0
- package/dist/types/build/db/emit-mappers.d.ts +15 -0
- package/dist/types/build/db/emit-prisma-schema.d.ts +2 -0
- package/dist/types/build/db/generate.d.ts +7 -0
- package/dist/types/build/db/ir.d.ts +58 -0
- package/dist/types/build/db/load-db-yaml.d.ts +14 -0
- package/dist/types/{base → client/base}/SomaPageRootBase.d.ts +1 -1
- package/dist/types/{base → client/base}/SomaValidator.d.ts +1 -1
- package/dist/types/{compiler → client/compiler}/manifest-compiler.d.ts +3 -3
- package/dist/types/{engine → client/engine}/dom-renderer.d.ts +2 -2
- package/dist/types/{engine → client/engine}/event-engine.d.ts +1 -1
- package/dist/types/{engine → client/engine}/on-change-engine.d.ts +1 -1
- package/dist/types/{engine → client/engine}/property-watcher.d.ts +1 -1
- package/dist/types/{engine → client/engine}/render-engine.d.ts +3 -3
- package/dist/types/{engine → client/engine}/runtime-builder.d.ts +5 -5
- package/dist/types/{engine → client/engine}/scope-resolver.d.ts +1 -1
- package/dist/types/{engine → client/engine}/soma-bootstrap.d.ts +7 -7
- package/dist/types/{engine → client/engine}/style-binder.d.ts +1 -1
- package/dist/types/{engine → client/engine}/theme-variables.d.ts +1 -1
- package/dist/types/{engine → client/engine}/timer-engine.d.ts +1 -1
- package/dist/types/{engine → client/engine}/trigger-engine.d.ts +1 -1
- package/dist/types/client/host-bridge/index.d.ts +9 -0
- package/dist/types/{host → client/host-bridge}/load-host-domain-class.d.ts +1 -1
- package/dist/types/{infra → client/infra}/http/SomaHttpService.d.ts +1 -1
- package/dist/types/{parser → client/parser}/annotation-extractor.d.ts +2 -2
- package/dist/types/{parser → client/parser}/pipeline-parser.d.ts +1 -1
- package/dist/types/{parser → client/parser}/style-config-parser.d.ts +1 -1
- package/dist/types/{parser → client/parser}/timer-parser.d.ts +2 -2
- package/dist/types/{parser → client/parser}/trigger-parser.d.ts +2 -2
- package/dist/types/{parser → client/parser}/ui-config-parser.d.ts +1 -1
- package/dist/types/{scheduler → client/scheduler}/SomaScheduler.d.ts +1 -1
- package/dist/types/{validation → client/validation}/contract-validator.d.ts +2 -2
- package/dist/types/index.d.ts +35 -35
- package/dist/types/{api → server/api}/IService.d.ts +1 -1
- package/dist/types/{engine → server/headless}/soma-headless-page.d.ts +4 -2
- package/dist/types/server/index.d.ts +26 -0
- package/dist/types/server/infra/db/errors.d.ts +5 -0
- package/dist/types/server/infra/db/mapper/PrismaSomaMapper.d.ts +77 -0
- package/dist/types/server/infra/db/mapper/SomaBaseMapper.d.ts +20 -0
- package/dist/types/server/infra/db/mapper/SomaMapperHooks.d.ts +12 -0
- package/dist/types/server/infra/db/query/SomaQuery.d.ts +42 -0
- package/dist/types/server/infra/db/service/SomaDbService.d.ts +24 -0
- package/dist/types/server/infra/db/soma-db.d.ts +45 -0
- package/dist/types/server/infra/db/types.d.ts +18 -0
- package/dist/types/{types → shared/types}/domain.types.d.ts +1 -1
- package/global.d.ts +8 -8
- package/middleware.ts +1 -1
- package/next.config.js +11 -11
- package/package.json +34 -26
- package/tailwind.config.ts +24 -24
- package/docs//351/241/265/351/235/242JSON/346/250/241/345/274/217/346/216/245/345/205/245/346/214/207/345/215/227.md +0 -141
- /package/core/{compiler → build/compiler}/page-base-resolver.ts +0 -0
- /package/core/{compiler → build/compiler}/rspack-plugin-soma.js +0 -0
- /package/core/{compiler → build/compiler}/soma-rspack-yaml-loader.js +0 -0
- /package/core/{lsp → build/lsp}/cross-file-diagnostics.cjs +0 -0
- /package/core/{lsp → build/lsp}/event-yaml-completion.cjs +0 -0
- /package/core/{lsp → build/lsp}/extra-completion.cjs +0 -0
- /package/core/{lsp → build/lsp}/lsp-navigation.cjs +0 -0
- /package/core/{lsp → build/lsp}/ui-yaml-completion.cjs +0 -0
- /package/core/{base → client/base}/SomaEntity.ts +0 -0
- /package/core/{base → client/base}/SomaLocaleOnlyPageRoot.ts +0 -0
- /package/core/{base → client/base}/decorators/Event.ts +0 -0
- /package/core/{base → client/base}/decorators/Locale.ts +0 -0
- /package/core/{base → client/base}/decorators/Page.ts +0 -0
- /package/core/{base → client/base}/decorators/Show.ts +0 -0
- /package/core/{base → client/base}/decorators/ShowList.ts +0 -0
- /package/core/{base → client/base}/decorators/index.ts +0 -0
- /package/core/{base → client/base}/index.ts +0 -0
- /package/core/{base → client/base}/runAsync.ts +0 -0
- /package/core/{container → client/container}/IContainerAdapter.ts +0 -0
- /package/core/{container → client/container}/MiniProgramContainerAdapter.ts +0 -0
- /package/core/{container → client/container}/ReactNativeContainerAdapter.ts +0 -0
- /package/core/{container → client/container}/SomaContainerAdapter.ts +0 -0
- /package/core/{diagnostics → client/diagnostics}/SomaDiagnostics.ts +0 -0
- /package/core/{diagnostics → client/diagnostics}/SomaTelemetry.ts +0 -0
- /package/core/{diagnostics → client/diagnostics}/telemetry-context.ts +0 -0
- /package/core/{host → client/host-bridge}/resolve-host-bootstrap.ts +0 -0
- /package/core/{host → client/host-bridge}/soma-bootstrap-host.stub.ts +0 -0
- /package/core/{host → client/host-bridge}/soma-domain-loaders.stub.ts +0 -0
- /package/core/{host → client/host-bridge}/soma-domain-loaders.ts +0 -0
- /package/core/{infra → client/infra}/auth/IAuthService.ts +0 -0
- /package/core/{infra → client/infra}/auth/TokenAuthService.ts +0 -0
- /package/core/{infra → client/infra}/cache/ICache.ts +0 -0
- /package/core/{infra → client/infra}/cache/MemoryCache.ts +0 -0
- /package/core/{infra → client/infra}/config/IConfig.ts +0 -0
- /package/core/{infra → client/infra}/config/SomaConfig.ts +0 -0
- /package/core/{infra → client/infra}/event-bus/IEventBus.ts +0 -0
- /package/core/{infra → client/infra}/event-bus/SomaEventBus.ts +0 -0
- /package/core/{infra → client/infra}/http/IHttpClient.ts +0 -0
- /package/core/{infra → client/infra}/i18n/DefaultI18n.ts +0 -0
- /package/core/{infra → client/infra}/i18n/II18n.ts +0 -0
- /package/core/{infra → client/infra}/logger/ConsoleLogger.ts +0 -0
- /package/core/{infra → client/infra}/logger/ILogger.ts +0 -0
- /package/core/{infra → client/infra}/notify/DefaultNotifyService.ts +0 -0
- /package/core/{infra → client/infra}/notify/DomNotifyService.ts +0 -0
- /package/core/{infra → client/infra}/notify/INotifyService.ts +0 -0
- /package/core/{infra → client/infra}/notify/INotifyTheme.ts +0 -0
- /package/core/{infra → client/infra}/permission/IPermission.ts +0 -0
- /package/core/{infra → client/infra}/permission/SomaPermission.ts +0 -0
- /package/core/{infra → client/infra}/realtime/IRealtimeService.ts +0 -0
- /package/core/{infra → client/infra}/realtime/IRealtimeTransport.ts +0 -0
- /package/core/{infra → client/infra}/realtime/SomaRealtimeService.ts +0 -0
- /package/core/{infra → client/infra}/realtime/SseRealtimeTransport.ts +0 -0
- /package/core/{infra → client/infra}/realtime/WebSocketRealtimeTransport.ts +0 -0
- /package/core/{infra → client/infra}/router/IRouter.ts +0 -0
- /package/core/{infra → client/infra}/router/SomaRouter.ts +0 -0
- /package/core/{infra → client/infra}/router/router-path.ts +0 -0
- /package/core/{infra → client/infra}/storage/IStorageService.ts +0 -0
- /package/core/{infra → client/infra}/storage/MemoryStorageService.ts +0 -0
- /package/core/{infra → client/infra}/storage/SessionStorageService.ts +0 -0
- /package/core/{infra → client/infra}/timer/ITimer.ts +0 -0
- /package/core/{infra → client/infra}/timer/SomaTimer.ts +0 -0
- /package/core/{middleware → client/middleware}/SomaMiddlewareChain.ts +0 -0
- /package/core/{middleware → client/middleware}/createPermissionMiddleware.ts +0 -0
- /package/core/{quality → client/quality}/SomaQualityRegistry.ts +0 -0
- /package/core/{runtime → client/runtime}/SomaRuntimeServices.ts +0 -0
- /package/core/{runtime → client/runtime}/SomaSnapshotStore.ts +0 -0
- /package/core/{runtime → client/runtime}/serialize-page-state.ts +0 -0
- /package/core/{api → server/api}/load-host-service.ts +0 -0
- /package/core/{api → server/api}/service-path.ts +0 -0
- /package/core/{host → server/host}/app-config-composer.ts +0 -0
- /package/core/{host → server/host}/app-config.stub.ts +0 -0
- /package/core/{host → server/host}/host-config-paths.cjs +0 -0
- /package/core/{host → server/host}/host-config-paths.ts +0 -0
- /package/core/{host → server/host}/invoke-host-request-hook.ts +0 -0
- /package/core/{host → server/host}/locale.stub.ts +0 -0
- /package/core/{host → server/host}/page-response-mode.cjs +0 -0
- /package/core/{host → server/host}/page-response-request.ts +0 -0
- /package/core/{host → server/host}/request-origin.ts +0 -0
- /package/core/{host → server/host}/resolve-host-request-hook.ts +0 -0
- /package/core/{host → server/host}/soma-request-hook-host.stub.ts +0 -0
- /package/core/{host → server/host}/source-packages.ts +0 -0
- /package/core/{infra → server/infra}/http/soma-server-request-context.ts +0 -0
- /package/core/{mock → server/mock}/node/catch-all.mjs +0 -0
- /package/core/{mock → server/mock}/node/cli.d.mts +0 -0
- /package/core/{mock → server/mock}/node/cli.mjs +0 -0
- /package/core/{mock → server/mock}/node/context.mjs +0 -0
- /package/core/{mock → server/mock}/node/environment-policy.mjs +0 -0
- /package/core/{mock → server/mock}/node/plugin-loader.mjs +0 -0
- /package/core/{mock → server/mock}/node/preload.mjs +0 -0
- /package/core/{mock → server/mock}/node/process-lifecycle.mjs +0 -0
- /package/core/{mock → server/mock}/node/public.d.mts +0 -0
- /package/core/{mock → server/mock}/node/public.mjs +0 -0
- /package/core/{mock → server/mock}/node/registry.mjs +0 -0
- /package/core/{mock → server/mock}/node/schema-generator.mjs +0 -0
- /package/core/{mock → server/mock}/testing/host-harness.d.mts +0 -0
- /package/core/{mock → server/mock}/testing/host-harness.mjs +0 -0
- /package/core/{mock → server/mock}/testing/host-runtime.mjs +0 -0
- /package/core/{manifest → shared/manifest}/manifest-contract.ts +0 -0
- /package/core/{types → shared/types}/engine.types.ts +0 -0
- /package/core/{types → shared/types}/event.types.ts +0 -0
- /package/core/{types → shared/types}/keyboard.types.ts +0 -0
- /package/core/{types → shared/types}/manifest.types.ts +0 -0
- /package/core/{types → shared/types}/scheduler.types.ts +0 -0
- /package/core/{types → shared/types}/style-config.types.ts +0 -0
- /package/core/{types → shared/types}/timer.types.ts +0 -0
- /package/core/{types → shared/types}/trigger.types.ts +0 -0
- /package/core/{types → shared/types}/ui-config.types.ts +0 -0
- /package/core/{types → shared/types}/watcher.types.ts +0 -0
- /package/dist/types/{compiler → build/compiler}/page-base-resolver.d.ts +0 -0
- /package/dist/types/{compiler → build/compiler}/rollup-plugin-soma.d.ts +0 -0
- /package/dist/types/{compiler → build/compiler}/route-builder.d.ts +0 -0
- /package/dist/types/{base → client/base}/SomaApi.d.ts +0 -0
- /package/dist/types/{base → client/base}/SomaDict.d.ts +0 -0
- /package/dist/types/{base → client/base}/SomaEntity.d.ts +0 -0
- /package/dist/types/{base → client/base}/SomaHttpClient.d.ts +0 -0
- /package/dist/types/{base → client/base}/SomaLocaleOnlyPageRoot.d.ts +0 -0
- /package/dist/types/{base → client/base}/decorators/Event.d.ts +0 -0
- /package/dist/types/{base → client/base}/decorators/Locale.d.ts +0 -0
- /package/dist/types/{base → client/base}/decorators/Page.d.ts +0 -0
- /package/dist/types/{base → client/base}/decorators/Show.d.ts +0 -0
- /package/dist/types/{base → client/base}/decorators/ShowList.d.ts +0 -0
- /package/dist/types/{base → client/base}/decorators/index.d.ts +0 -0
- /package/dist/types/{base → client/base}/index.d.ts +0 -0
- /package/dist/types/{base → client/base}/runAsync.d.ts +0 -0
- /package/dist/types/{container → client/container}/IContainerAdapter.d.ts +0 -0
- /package/dist/types/{container → client/container}/MiniProgramContainerAdapter.d.ts +0 -0
- /package/dist/types/{container → client/container}/ReactNativeContainerAdapter.d.ts +0 -0
- /package/dist/types/{container → client/container}/SomaContainerAdapter.d.ts +0 -0
- /package/dist/types/{diagnostics → client/diagnostics}/SomaDiagnostics.d.ts +0 -0
- /package/dist/types/{diagnostics → client/diagnostics}/SomaTelemetry.d.ts +0 -0
- /package/dist/types/{diagnostics → client/diagnostics}/telemetry-context.d.ts +0 -0
- /package/dist/types/{engine → client/engine}/asset-resolver.d.ts +0 -0
- /package/dist/types/{engine → client/engine}/lis.d.ts +0 -0
- /package/dist/types/{engine → client/engine}/reactive-proxy.d.ts +0 -0
- /package/dist/types/{host → client/host-bridge}/resolve-host-bootstrap.d.ts +0 -0
- /package/dist/types/{host → client/host-bridge}/soma-bootstrap-host.stub.d.ts +0 -0
- /package/dist/types/{host → client/host-bridge}/soma-domain-loaders.d.ts +0 -0
- /package/dist/types/{host → client/host-bridge}/soma-domain-loaders.stub.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/auth/IAuthService.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/auth/TokenAuthService.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/cache/ICache.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/cache/MemoryCache.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/config/IConfig.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/config/SomaConfig.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/event-bus/IEventBus.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/event-bus/SomaEventBus.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/http/IHttpClient.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/i18n/DefaultI18n.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/i18n/II18n.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/logger/ConsoleLogger.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/logger/ILogger.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/notify/DefaultNotifyService.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/notify/DomNotifyService.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/notify/INotifyService.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/notify/INotifyTheme.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/permission/IPermission.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/permission/SomaPermission.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/realtime/IRealtimeService.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/realtime/IRealtimeTransport.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/realtime/SomaRealtimeService.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/realtime/SseRealtimeTransport.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/realtime/WebSocketRealtimeTransport.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/router/IRouter.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/router/SomaRouter.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/router/router-path.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/storage/IStorageService.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/storage/MemoryStorageService.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/storage/SessionStorageService.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/timer/ITimer.d.ts +0 -0
- /package/dist/types/{infra → client/infra}/timer/SomaTimer.d.ts +0 -0
- /package/dist/types/{middleware → client/middleware}/SomaMiddlewareChain.d.ts +0 -0
- /package/dist/types/{middleware → client/middleware}/createPermissionMiddleware.d.ts +0 -0
- /package/dist/types/{parser → client/parser}/yaml-loader.d.ts +0 -0
- /package/dist/types/{quality → client/quality}/SomaQualityRegistry.d.ts +0 -0
- /package/dist/types/{runtime → client/runtime}/SomaRuntimeServices.d.ts +0 -0
- /package/dist/types/{runtime → client/runtime}/SomaSnapshotStore.d.ts +0 -0
- /package/dist/types/{runtime → client/runtime}/serialize-page-state.d.ts +0 -0
- /package/dist/types/{api → server/api}/load-host-service.d.ts +0 -0
- /package/dist/types/{api → server/api}/service-path.d.ts +0 -0
- /package/dist/types/{host → server/host}/app-config-composer.d.ts +0 -0
- /package/dist/types/{host → server/host}/app-config.stub.d.ts +0 -0
- /package/dist/types/{host → server/host}/host-config-paths.d.ts +0 -0
- /package/dist/types/{host → server/host}/invoke-host-request-hook.d.ts +0 -0
- /package/dist/types/{host → server/host}/locale.stub.d.ts +0 -0
- /package/dist/types/{host → server/host}/page-response-request.d.ts +0 -0
- /package/dist/types/{host → server/host}/request-origin.d.ts +0 -0
- /package/dist/types/{host → server/host}/resolve-host-request-hook.d.ts +0 -0
- /package/dist/types/{host → server/host}/server-page-assets.d.ts +0 -0
- /package/dist/types/{host → server/host}/soma-request-hook-host.stub.d.ts +0 -0
- /package/dist/types/{host → server/host}/source-packages.d.ts +0 -0
- /package/dist/types/{infra → server/infra}/cache/ServerFileCache.d.ts +0 -0
- /package/dist/types/{infra → server/infra}/http/soma-server-request-context.d.ts +0 -0
- /package/dist/types/{manifest → shared/manifest}/manifest-contract.d.ts +0 -0
- /package/dist/types/{types → shared/types}/engine.types.d.ts +0 -0
- /package/dist/types/{types → shared/types}/event.types.d.ts +0 -0
- /package/dist/types/{types → shared/types}/keyboard.types.d.ts +0 -0
- /package/dist/types/{types → shared/types}/manifest.types.d.ts +0 -0
- /package/dist/types/{types → shared/types}/scheduler.types.d.ts +0 -0
- /package/dist/types/{types → shared/types}/style-config.types.d.ts +0 -0
- /package/dist/types/{types → shared/types}/timer.types.d.ts +0 -0
- /package/dist/types/{types → shared/types}/trigger.types.d.ts +0 -0
- /package/dist/types/{types → shared/types}/ui-config.types.d.ts +0 -0
- /package/dist/types/{types → shared/types}/watcher.types.d.ts +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prisma-backed SomaBaseMapper (MySQL).
|
|
3
|
+
* Supports logic delete, auto-fill timestamps, and lifecycle hooks.
|
|
4
|
+
*/
|
|
5
|
+
import 'server-only';
|
|
6
|
+
import { SomaQuery } from '../query/SomaQuery';
|
|
7
|
+
import type { SomaBaseMapper } from './SomaBaseMapper';
|
|
8
|
+
import type { SomaMapperHooks } from './SomaMapperHooks';
|
|
9
|
+
import type { PageRequest, PageResult } from '../types';
|
|
10
|
+
export interface PrismaDelegate {
|
|
11
|
+
findUnique(args: Record<string, unknown>): Promise<unknown>;
|
|
12
|
+
findFirst(args: Record<string, unknown>): Promise<unknown>;
|
|
13
|
+
findMany(args: Record<string, unknown>): Promise<unknown[]>;
|
|
14
|
+
count(args: Record<string, unknown>): Promise<number>;
|
|
15
|
+
create(args: Record<string, unknown>): Promise<unknown>;
|
|
16
|
+
createMany?(args: Record<string, unknown>): Promise<{
|
|
17
|
+
count: number;
|
|
18
|
+
}>;
|
|
19
|
+
update(args: Record<string, unknown>): Promise<unknown>;
|
|
20
|
+
updateMany(args: Record<string, unknown>): Promise<{
|
|
21
|
+
count: number;
|
|
22
|
+
}>;
|
|
23
|
+
delete(args: Record<string, unknown>): Promise<unknown>;
|
|
24
|
+
deleteMany(args: Record<string, unknown>): Promise<{
|
|
25
|
+
count: number;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
export interface PrismaSomaMapperOptions {
|
|
29
|
+
/** Prisma client model key, e.g. "order" for model Order */
|
|
30
|
+
model: string;
|
|
31
|
+
/** Primary key field name, default "id" */
|
|
32
|
+
idField?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Soft-delete field. If set:
|
|
35
|
+
* - selects filter `field IS NULL` unless query.includeDeleted()
|
|
36
|
+
* - delete* sets field to Date (or logicDeleteValue) instead of hard delete
|
|
37
|
+
*/
|
|
38
|
+
logicDeleteField?: string;
|
|
39
|
+
/** Value written on soft delete; default `new Date()` */
|
|
40
|
+
logicDeleteValue?: unknown | (() => unknown);
|
|
41
|
+
/** Auto-set on insert when missing */
|
|
42
|
+
createdAtField?: string;
|
|
43
|
+
/** Auto-set on insert/update */
|
|
44
|
+
updatedAtField?: string;
|
|
45
|
+
hooks?: SomaMapperHooks;
|
|
46
|
+
}
|
|
47
|
+
export declare class PrismaSomaMapper<T extends object = Record<string, unknown>, ID = string> implements SomaBaseMapper<T, ID> {
|
|
48
|
+
protected readonly model: string;
|
|
49
|
+
protected readonly idField: string;
|
|
50
|
+
protected readonly logicDeleteField?: string;
|
|
51
|
+
protected readonly logicDeleteValue?: unknown | (() => unknown);
|
|
52
|
+
protected readonly createdAtField?: string;
|
|
53
|
+
protected readonly updatedAtField?: string;
|
|
54
|
+
protected readonly hooks: SomaMapperHooks<T>;
|
|
55
|
+
constructor(options: PrismaSomaMapperOptions);
|
|
56
|
+
protected delegate(): PrismaDelegate;
|
|
57
|
+
protected softDeleteMarker(): unknown;
|
|
58
|
+
protected notDeletedWhere(): Record<string, unknown> | undefined;
|
|
59
|
+
protected applyLogicDeleteFilter(query: SomaQuery<T> | undefined, where: Record<string, unknown> | undefined): Record<string, unknown> | undefined;
|
|
60
|
+
protected buildArgs(query?: SomaQuery<T>): Record<string, unknown>;
|
|
61
|
+
protected applyInsertFill(entity: Partial<T>): Partial<T>;
|
|
62
|
+
protected applyUpdateFill(patch: Partial<T>): Partial<T>;
|
|
63
|
+
selectById(id: ID): Promise<T | null>;
|
|
64
|
+
selectBatchIds(ids: ID[]): Promise<T[]>;
|
|
65
|
+
selectOne(query?: SomaQuery<T>): Promise<T | null>;
|
|
66
|
+
selectList(query?: SomaQuery<T>): Promise<T[]>;
|
|
67
|
+
selectCount(query?: SomaQuery<T>): Promise<number>;
|
|
68
|
+
selectPage(page: PageRequest, query?: SomaQuery<T>): Promise<PageResult<T>>;
|
|
69
|
+
insert(entity: Partial<T>): Promise<T>;
|
|
70
|
+
insertBatch(entities: Partial<T>[]): Promise<T[]>;
|
|
71
|
+
updateById(id: ID, patch: Partial<T>): Promise<T>;
|
|
72
|
+
update(query: SomaQuery<T>, patch: Partial<T>): Promise<number>;
|
|
73
|
+
deleteById(id: ID): Promise<boolean>;
|
|
74
|
+
delete(query: SomaQuery<T>): Promise<number>;
|
|
75
|
+
/** Force physical delete even when logicDeleteField is set */
|
|
76
|
+
forceDeleteById(id: ID): Promise<boolean>;
|
|
77
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MyBatis-Plus BaseMapper-style contract for Host repository mappers.
|
|
3
|
+
*/
|
|
4
|
+
import 'server-only';
|
|
5
|
+
import type { SomaQuery } from '../query/SomaQuery';
|
|
6
|
+
import type { PageRequest, PageResult } from '../types';
|
|
7
|
+
export interface SomaBaseMapper<T, ID = string> {
|
|
8
|
+
selectById(id: ID): Promise<T | null>;
|
|
9
|
+
selectBatchIds(ids: ID[]): Promise<T[]>;
|
|
10
|
+
selectOne(query?: SomaQuery<T>): Promise<T | null>;
|
|
11
|
+
selectList(query?: SomaQuery<T>): Promise<T[]>;
|
|
12
|
+
selectCount(query?: SomaQuery<T>): Promise<number>;
|
|
13
|
+
selectPage(page: PageRequest, query?: SomaQuery<T>): Promise<PageResult<T>>;
|
|
14
|
+
insert(entity: Partial<T>): Promise<T>;
|
|
15
|
+
insertBatch(entities: Partial<T>[]): Promise<T[]>;
|
|
16
|
+
updateById(id: ID, patch: Partial<T>): Promise<T>;
|
|
17
|
+
update(query: SomaQuery<T>, patch: Partial<T>): Promise<number>;
|
|
18
|
+
deleteById(id: ID): Promise<boolean>;
|
|
19
|
+
delete(query: SomaQuery<T>): Promise<number>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mapper lifecycle hooks (MyBatis-Plus interceptor style, simplified).
|
|
3
|
+
*/
|
|
4
|
+
import 'server-only';
|
|
5
|
+
export interface SomaMapperHooks<T extends object = Record<string, unknown>> {
|
|
6
|
+
beforeInsert?(entity: Partial<T>): Partial<T> | void | Promise<Partial<T> | void>;
|
|
7
|
+
afterInsert?(entity: T): void | Promise<void>;
|
|
8
|
+
beforeUpdate?(patch: Partial<T>): Partial<T> | void | Promise<Partial<T> | void>;
|
|
9
|
+
afterUpdate?(entity: T): void | Promise<void>;
|
|
10
|
+
beforeDelete?(idOrQuery: unknown): void | Promise<void>;
|
|
11
|
+
afterDelete?(result: unknown): void | Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chainable query builder (MyBatis-Plus QueryWrapper style).
|
|
3
|
+
* Compiles to a Prisma-compatible where / orderBy / select shape.
|
|
4
|
+
*/
|
|
5
|
+
import 'server-only';
|
|
6
|
+
import type { SomaFieldPath } from '../types';
|
|
7
|
+
export declare class SomaQuery<T = Record<string, unknown>> {
|
|
8
|
+
private readonly conditions;
|
|
9
|
+
private readonly orGroups;
|
|
10
|
+
private readonly order;
|
|
11
|
+
private selectFields;
|
|
12
|
+
private includeDeletedFlag;
|
|
13
|
+
eq(field: SomaFieldPath<T>, value: unknown): this;
|
|
14
|
+
ne(field: SomaFieldPath<T>, value: unknown): this;
|
|
15
|
+
in(field: SomaFieldPath<T>, values: unknown[]): this;
|
|
16
|
+
notIn(field: SomaFieldPath<T>, values: unknown[]): this;
|
|
17
|
+
like(field: SomaFieldPath<T>, value: string): this;
|
|
18
|
+
gt(field: SomaFieldPath<T>, value: unknown): this;
|
|
19
|
+
ge(field: SomaFieldPath<T>, value: unknown): this;
|
|
20
|
+
lt(field: SomaFieldPath<T>, value: unknown): this;
|
|
21
|
+
le(field: SomaFieldPath<T>, value: unknown): this;
|
|
22
|
+
between(field: SomaFieldPath<T>, start: unknown, end: unknown): this;
|
|
23
|
+
isNull(field: SomaFieldPath<T>): this;
|
|
24
|
+
isNotNull(field: SomaFieldPath<T>): this;
|
|
25
|
+
/** Nested AND group: q.and(sub => sub.eq(...).eq(...)) */
|
|
26
|
+
and(builder: (q: SomaQuery<T>) => void): this;
|
|
27
|
+
/** Nested OR group: q.or(sub => sub.eq(...).eq(...)) — OR among conditions in the subgroup */
|
|
28
|
+
or(builder: (q: SomaQuery<T>) => void): this;
|
|
29
|
+
orderByAsc(field: SomaFieldPath<T>): this;
|
|
30
|
+
orderByDesc(field: SomaFieldPath<T>): this;
|
|
31
|
+
select(...fields: Array<SomaFieldPath<T>>): this;
|
|
32
|
+
/** Include soft-deleted rows when mapper has logicDelete configured */
|
|
33
|
+
includeDeleted(flag?: boolean): this;
|
|
34
|
+
/** @internal */
|
|
35
|
+
shouldIncludeDeleted(): boolean;
|
|
36
|
+
/** @internal Prisma where */
|
|
37
|
+
toPrismaWhere(): Record<string, unknown> | undefined;
|
|
38
|
+
/** @internal Prisma orderBy */
|
|
39
|
+
toPrismaOrderBy(): Array<Record<string, 'asc' | 'desc'>> | undefined;
|
|
40
|
+
/** @internal Prisma select object */
|
|
41
|
+
toPrismaSelect(): Record<string, true> | undefined;
|
|
42
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service layer over SomaBaseMapper (MyBatis-Plus IService style).
|
|
3
|
+
*/
|
|
4
|
+
import 'server-only';
|
|
5
|
+
import type { SomaBaseMapper } from '../mapper/SomaBaseMapper';
|
|
6
|
+
import type { SomaQuery } from '../query/SomaQuery';
|
|
7
|
+
import type { PageRequest, PageResult } from '../types';
|
|
8
|
+
export declare class SomaDbService<T extends object, ID = string> {
|
|
9
|
+
protected readonly baseMapper: SomaBaseMapper<T, ID>;
|
|
10
|
+
constructor(baseMapper: SomaBaseMapper<T, ID>);
|
|
11
|
+
getMapper(): SomaBaseMapper<T, ID>;
|
|
12
|
+
selectById(id: ID): Promise<T | null>;
|
|
13
|
+
selectBatchIds(ids: ID[]): Promise<T[]>;
|
|
14
|
+
selectOne(query?: SomaQuery<T>): Promise<T | null>;
|
|
15
|
+
selectList(query?: SomaQuery<T>): Promise<T[]>;
|
|
16
|
+
selectCount(query?: SomaQuery<T>): Promise<number>;
|
|
17
|
+
selectPage(page: PageRequest, query?: SomaQuery<T>): Promise<PageResult<T>>;
|
|
18
|
+
save(entity: Partial<T>): Promise<T>;
|
|
19
|
+
saveBatch(entities: Partial<T>[]): Promise<T[]>;
|
|
20
|
+
updateById(id: ID, patch: Partial<T>): Promise<T>;
|
|
21
|
+
update(query: SomaQuery<T>, patch: Partial<T>): Promise<number>;
|
|
22
|
+
removeById(id: ID): Promise<boolean>;
|
|
23
|
+
remove(query: SomaQuery<T>): Promise<number>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-only DB capability for Host `api/service`.
|
|
3
|
+
*
|
|
4
|
+
* Framework provides registration / singleton / provider lifecycle.
|
|
5
|
+
* Host owns Prisma (or other) client, schema, and queries.
|
|
6
|
+
* Never import from Domain / `'use client'` code.
|
|
7
|
+
*/
|
|
8
|
+
import 'server-only';
|
|
9
|
+
export interface ISomaDbProvider<TClient = unknown> {
|
|
10
|
+
getClient(): TClient;
|
|
11
|
+
disconnect?(): Promise<void> | void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Register the Host DB client (typically PrismaClient).
|
|
15
|
+
* Call once from a server-only Host module such as `lib/db.ts`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function setSomaDb<T>(client: T): T;
|
|
18
|
+
/**
|
|
19
|
+
* Register a provider (client + optional disconnect).
|
|
20
|
+
*/
|
|
21
|
+
export declare function registerSomaDbProvider<T>(provider: ISomaDbProvider<T>): T;
|
|
22
|
+
/**
|
|
23
|
+
* Read the registered DB client.
|
|
24
|
+
* Throws if `setSomaDb` / `createSomaDbSingleton` has not run yet.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getSomaDb<T = unknown>(): T;
|
|
27
|
+
/** Disconnect provider if registered, then clear state. */
|
|
28
|
+
export declare function disconnectSomaDb(): Promise<void>;
|
|
29
|
+
/** Test / hot-reload helper. */
|
|
30
|
+
export declare function resetSomaDb(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Next.js-friendly singleton. Survives dev hot reload via globalThis.
|
|
33
|
+
* Also registers the client through `setSomaDb`.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* // Host lib/db.ts
|
|
37
|
+
* import { PrismaClient } from '@prisma/client';
|
|
38
|
+
* import { createSomaDbSingleton } from 'soma-core/server';
|
|
39
|
+
* export const db = createSomaDbSingleton(() => new PrismaClient());
|
|
40
|
+
*/
|
|
41
|
+
export declare function createSomaDbSingleton<T>(factory: () => T): T;
|
|
42
|
+
/**
|
|
43
|
+
* Scoped client for tests: set for duration of fn, then restore previous.
|
|
44
|
+
*/
|
|
45
|
+
export declare function withSomaDb<T, R>(client: T, fn: () => Promise<R> | R): Promise<R>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared DB paging types (MyBatis-Plus style).
|
|
3
|
+
* Server-only; never import from Domain / client code.
|
|
4
|
+
*/
|
|
5
|
+
import 'server-only';
|
|
6
|
+
export interface PageRequest {
|
|
7
|
+
/** 1-based page index */
|
|
8
|
+
page: number;
|
|
9
|
+
/** page size */
|
|
10
|
+
size: number;
|
|
11
|
+
}
|
|
12
|
+
export interface PageResult<T> {
|
|
13
|
+
records: T[];
|
|
14
|
+
total: number;
|
|
15
|
+
page: number;
|
|
16
|
+
size: number;
|
|
17
|
+
}
|
|
18
|
+
export type SomaFieldPath<T> = Extract<keyof T, string> | (string & {});
|
|
@@ -8,7 +8,7 @@ export interface SomaPageRoot {
|
|
|
8
8
|
/** 应用配置(引擎在 mount 时注入) */
|
|
9
9
|
_config?: unknown;
|
|
10
10
|
/** 运行时基础设施(引擎在 mount 时注入) */
|
|
11
|
-
_services?: import('
|
|
11
|
+
_services?: import('../../client/runtime/SomaRuntimeServices').SomaRuntimeServices;
|
|
12
12
|
/** 页面初始化(引擎在渲染完成后调用) */
|
|
13
13
|
onMount?(): void | Promise<void>;
|
|
14
14
|
/** 页面销毁前(引擎在卸载时调用) */
|
package/global.d.ts
CHANGED
|
@@ -15,29 +15,29 @@ declare module '*.yml' {
|
|
|
15
15
|
|
|
16
16
|
declare module '@soma-host/bootstrap/soma-bootstrap' {
|
|
17
17
|
export const configureSomaBootstrap:
|
|
18
|
-
| import('./core/host/resolve-host-bootstrap').SomaBootstrapConfigurator
|
|
18
|
+
| import('./core/client/host-bridge/resolve-host-bootstrap').SomaBootstrapConfigurator
|
|
19
19
|
| undefined;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
declare module '@soma-host/bootstrap/soma-request-hook' {
|
|
23
23
|
export const somaRequestHook:
|
|
24
|
-
| import('./core/host/resolve-host-request-hook').SomaRequestHook
|
|
24
|
+
| import('./core/server/host/resolve-host-request-hook').SomaRequestHook
|
|
25
25
|
| undefined;
|
|
26
26
|
export const handleSomaRequest:
|
|
27
|
-
| import('./core/host/resolve-host-request-hook').SomaRequestHook
|
|
27
|
+
| import('./core/server/host/resolve-host-request-hook').SomaRequestHook
|
|
28
28
|
| undefined;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
declare module '@soma-host/bootstrap/soma-domain-loaders' {
|
|
32
32
|
export const somaDomainLoaders:
|
|
33
|
-
| import('./core/host/soma-domain-loaders').SomaDomainLoaderMap
|
|
33
|
+
| import('./core/client/host-bridge/soma-domain-loaders').SomaDomainLoaderMap
|
|
34
34
|
| undefined;
|
|
35
35
|
export const loadSomaDomainModule:
|
|
36
|
-
| import('./core/host/soma-domain-loaders').SomaDomainModuleResolver
|
|
36
|
+
| import('./core/client/host-bridge/soma-domain-loaders').SomaDomainModuleResolver
|
|
37
37
|
| undefined;
|
|
38
38
|
const defaultExport:
|
|
39
|
-
| import('./core/host/soma-domain-loaders').SomaDomainLoaderMap
|
|
40
|
-
| import('./core/host/soma-domain-loaders').SomaDomainModuleResolver
|
|
39
|
+
| import('./core/client/host-bridge/soma-domain-loaders').SomaDomainLoaderMap
|
|
40
|
+
| import('./core/client/host-bridge/soma-domain-loaders').SomaDomainModuleResolver
|
|
41
41
|
| undefined;
|
|
42
42
|
export default defaultExport;
|
|
43
43
|
}
|
|
@@ -60,7 +60,7 @@ declare module '@soma-host/*' {
|
|
|
60
60
|
|
|
61
61
|
/** Dev console API (window.__SOMA__ in npm run dev) */
|
|
62
62
|
interface SomaDevConsole {
|
|
63
|
-
getDiagnosticsSnapshot: () => import('./core/diagnostics/SomaDiagnostics').SomaDiagnosticsSnapshot | null;
|
|
63
|
+
getDiagnosticsSnapshot: () => import('./core/client/diagnostics/SomaDiagnostics').SomaDiagnosticsSnapshot | null;
|
|
64
64
|
getTelemetrySnapshot: () => Record<string, { count: number; avg: number; max: number; min: number }> | null;
|
|
65
65
|
getAvailableThemes?: () => string[];
|
|
66
66
|
getDomainInstance: () => unknown;
|
package/middleware.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { NextRequest, NextResponse } from 'next/server';
|
|
|
2
2
|
import {
|
|
3
3
|
SOMA_PAGE_REQUEST_URL_HEADER,
|
|
4
4
|
shouldUseJsonPageResponse,
|
|
5
|
-
} from './core/host/page-response-request';
|
|
5
|
+
} from './core/server/host/page-response-request';
|
|
6
6
|
|
|
7
7
|
export function middleware(request: NextRequest) {
|
|
8
8
|
if (!shouldUseJsonPageResponse({
|
package/next.config.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/** @type {import('next').NextConfig} */
|
|
2
2
|
const fs = require('fs');
|
|
3
3
|
const path = require('path');
|
|
4
|
-
const { SomaManifestWebpackPlugin } = require('./core/compiler/soma-manifest-webpack-plugin');
|
|
4
|
+
const { SomaManifestWebpackPlugin } = require('./core/build/compiler/soma-manifest-webpack-plugin');
|
|
5
5
|
const {
|
|
6
6
|
resolveHostConfigRoot,
|
|
7
7
|
resolveHostAppConfigPath,
|
|
8
|
-
} = require('./core/host/host-config-paths.cjs');
|
|
8
|
+
} = require('./core/server/host/host-config-paths.cjs');
|
|
9
9
|
const {
|
|
10
10
|
readSomaPageResponseMode,
|
|
11
|
-
} = require('./core/host/page-response-mode.cjs');
|
|
11
|
+
} = require('./core/server/host/page-response-mode.cjs');
|
|
12
12
|
|
|
13
13
|
function readSomaWebpackCacheMode(env = process.env) {
|
|
14
14
|
const mode = env.SOMA_WEBPACK_CACHE_MODE;
|
|
@@ -148,7 +148,7 @@ const nextConfig = {
|
|
|
148
148
|
}
|
|
149
149
|
config.resolve.alias['@'] = __dirname;
|
|
150
150
|
config.resolve.alias['soma-core$'] = path.resolve(__dirname, 'core/index.ts');
|
|
151
|
-
config.resolve.alias['soma-core/base$'] = path.resolve(__dirname, 'core/base/index.ts');
|
|
151
|
+
config.resolve.alias['soma-core/base$'] = path.resolve(__dirname, 'core/client/base/index.ts');
|
|
152
152
|
config.resolve.alias['@core'] = path.resolve(__dirname, 'core');
|
|
153
153
|
for (const entry of hostFileDependencyEntries) {
|
|
154
154
|
const packageJson = readJson(path.join(entry.root, 'package.json'));
|
|
@@ -165,22 +165,22 @@ const nextConfig = {
|
|
|
165
165
|
}
|
|
166
166
|
config.resolve.alias['@soma-host/bootstrap/soma-bootstrap'] = resolveOptionalHostSourceFile(
|
|
167
167
|
'bootstrap/soma-bootstrap.ts',
|
|
168
|
-
'core/host/soma-bootstrap-host.stub.ts',
|
|
168
|
+
'core/client/host-bridge/soma-bootstrap-host.stub.ts',
|
|
169
169
|
);
|
|
170
170
|
config.resolve.alias['@soma-host/bootstrap/soma-request-hook'] = resolveOptionalHostSourceFile(
|
|
171
171
|
'bootstrap/soma-request-hook.ts',
|
|
172
|
-
'core/host/soma-request-hook-host.stub.ts',
|
|
172
|
+
'core/server/host/soma-request-hook-host.stub.ts',
|
|
173
173
|
);
|
|
174
174
|
config.resolve.alias['@soma-host/bootstrap/soma-domain-loaders'] = resolveOptionalHostSourceFile(
|
|
175
175
|
'bootstrap/soma-domain-loaders.ts',
|
|
176
|
-
'core/host/soma-domain-loaders.stub.ts',
|
|
176
|
+
'core/client/host-bridge/soma-domain-loaders.stub.ts',
|
|
177
177
|
);
|
|
178
178
|
config.resolve.alias['@soma-host/config/locale.yaml'] = resolveOptionalHostConfigFile(
|
|
179
179
|
'locale.yaml',
|
|
180
|
-
'core/host/locale.stub.ts',
|
|
180
|
+
'core/server/host/locale.stub.ts',
|
|
181
181
|
);
|
|
182
182
|
config.resolve.alias['@soma-host/config/app.config.yaml'] = resolveHostAppConfigAlias(
|
|
183
|
-
'core/host/app-config.stub.ts',
|
|
183
|
+
'core/server/host/app-config.stub.ts',
|
|
184
184
|
);
|
|
185
185
|
config.resolve.alias['@soma-host'] = hostSourceRoot;
|
|
186
186
|
|
|
@@ -191,14 +191,14 @@ const nextConfig = {
|
|
|
191
191
|
test: /_(ui|event|style)\.ya?ml$/,
|
|
192
192
|
type: 'javascript/auto',
|
|
193
193
|
use: [
|
|
194
|
-
{ loader: path.resolve(__dirname, 'core/compiler/soma-webpack-loader.js') },
|
|
194
|
+
{ loader: path.resolve(__dirname, 'core/build/compiler/soma-webpack-loader.js') },
|
|
195
195
|
],
|
|
196
196
|
},
|
|
197
197
|
{
|
|
198
198
|
test: /\.(config|locale(\.[a-zA-Z-]+)?)\.ya?ml$/,
|
|
199
199
|
type: 'javascript/auto',
|
|
200
200
|
use: [
|
|
201
|
-
{ loader: path.resolve(__dirname, 'core/compiler/soma-webpack-loader.js') },
|
|
201
|
+
{ loader: path.resolve(__dirname, 'core/build/compiler/soma-webpack-loader.js') },
|
|
202
202
|
],
|
|
203
203
|
},
|
|
204
204
|
{ test: /\.html$/, type: 'asset/source' },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soma-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "SOMA — Semantic Oriented Modular Architecture. A declarative frontend framework runtime built on Next.js 14+ App Router.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"soma",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"typesVersions": {
|
|
22
22
|
"*": {
|
|
23
23
|
"diagnostics": [
|
|
24
|
-
"./core/diagnostics/SomaTelemetry.ts"
|
|
24
|
+
"./core/client/diagnostics/SomaTelemetry.ts"
|
|
25
25
|
]
|
|
26
26
|
}
|
|
27
27
|
},
|
|
@@ -38,46 +38,51 @@
|
|
|
38
38
|
"default": "./core/index.ts"
|
|
39
39
|
},
|
|
40
40
|
"./base": {
|
|
41
|
-
"types": "./dist/types/base/index.d.ts",
|
|
42
|
-
"import": "./core/base/index.ts",
|
|
43
|
-
"default": "./core/base/index.ts"
|
|
41
|
+
"types": "./dist/types/client/base/index.d.ts",
|
|
42
|
+
"import": "./core/client/base/index.ts",
|
|
43
|
+
"default": "./core/client/base/index.ts"
|
|
44
44
|
},
|
|
45
|
-
"./compiler/vite": "./core/compiler/vite-plugin-soma.ts",
|
|
46
|
-
"./compiler/webpack-loader": "./core/compiler/soma-webpack-loader.js",
|
|
45
|
+
"./compiler/vite": "./core/build/compiler/vite-plugin-soma.ts",
|
|
46
|
+
"./compiler/webpack-loader": "./core/build/compiler/soma-webpack-loader.js",
|
|
47
47
|
"./diagnostics": {
|
|
48
|
-
"types": "./dist/types/diagnostics/SomaTelemetry.d.ts",
|
|
49
|
-
"import": "./core/diagnostics/SomaTelemetry.ts",
|
|
48
|
+
"types": "./dist/types/client/diagnostics/SomaTelemetry.d.ts",
|
|
49
|
+
"import": "./core/client/diagnostics/SomaTelemetry.ts",
|
|
50
50
|
"require": "./dist/diagnostics/telemetry.cjs",
|
|
51
|
-
"default": "./core/diagnostics/SomaTelemetry.ts"
|
|
51
|
+
"default": "./core/client/diagnostics/SomaTelemetry.ts"
|
|
52
52
|
},
|
|
53
53
|
"./host/request-hook": {
|
|
54
|
-
"types": "./dist/types/host/resolve-host-request-hook.d.ts",
|
|
55
|
-
"import": "./core/host/resolve-host-request-hook.ts",
|
|
56
|
-
"default": "./core/host/resolve-host-request-hook.ts"
|
|
54
|
+
"types": "./dist/types/server/host/resolve-host-request-hook.d.ts",
|
|
55
|
+
"import": "./core/server/host/resolve-host-request-hook.ts",
|
|
56
|
+
"default": "./core/server/host/resolve-host-request-hook.ts"
|
|
57
|
+
},
|
|
58
|
+
"./server": {
|
|
59
|
+
"types": "./dist/types/server/index.d.ts",
|
|
60
|
+
"import": "./core/server/index.ts",
|
|
61
|
+
"default": "./core/server/index.ts"
|
|
57
62
|
},
|
|
58
63
|
"./mock/node": {
|
|
59
|
-
"types": "./core/mock/node/public.d.mts",
|
|
60
|
-
"import": "./core/mock/node/public.mjs",
|
|
61
|
-
"default": "./core/mock/node/public.mjs"
|
|
64
|
+
"types": "./core/server/mock/node/public.d.mts",
|
|
65
|
+
"import": "./core/server/mock/node/public.mjs",
|
|
66
|
+
"default": "./core/server/mock/node/public.mjs"
|
|
62
67
|
},
|
|
63
68
|
"./mock/node/cli": {
|
|
64
|
-
"types": "./core/mock/node/cli.d.mts",
|
|
65
|
-
"import": "./core/mock/node/cli.mjs",
|
|
66
|
-
"default": "./core/mock/node/cli.mjs"
|
|
69
|
+
"types": "./core/server/mock/node/cli.d.mts",
|
|
70
|
+
"import": "./core/server/mock/node/cli.mjs",
|
|
71
|
+
"default": "./core/server/mock/node/cli.mjs"
|
|
67
72
|
},
|
|
68
73
|
"./testing/mock-host": {
|
|
69
|
-
"types": "./core/mock/testing/host-harness.d.mts",
|
|
70
|
-
"import": "./core/mock/testing/host-harness.mjs",
|
|
71
|
-
"default": "./core/mock/testing/host-harness.mjs"
|
|
74
|
+
"types": "./core/server/mock/testing/host-harness.d.mts",
|
|
75
|
+
"import": "./core/server/mock/testing/host-harness.mjs",
|
|
76
|
+
"default": "./core/server/mock/testing/host-harness.mjs"
|
|
72
77
|
}
|
|
73
78
|
},
|
|
74
79
|
"files": [
|
|
75
80
|
"bin/soma.cjs",
|
|
81
|
+
"bin/soma-db.cjs",
|
|
76
82
|
"bin/soma-lsp.cjs",
|
|
77
83
|
"bin/soma-sync.cjs",
|
|
78
84
|
"bin/soma-mock.mjs",
|
|
79
85
|
"core/",
|
|
80
|
-
"docs/",
|
|
81
86
|
"editor/",
|
|
82
87
|
"app/",
|
|
83
88
|
"dist/",
|
|
@@ -94,9 +99,9 @@
|
|
|
94
99
|
},
|
|
95
100
|
"scripts": {
|
|
96
101
|
"build:cli": "tsc -p tsconfig.cli.json",
|
|
97
|
-
"build:precompile": "esbuild core/compiler/soma-precompile.ts --bundle --platform=node --format=cjs --outfile=core/compiler/soma-precompile.js",
|
|
102
|
+
"build:precompile": "esbuild core/build/compiler/soma-precompile.ts --bundle --platform=node --format=cjs --outfile=core/build/compiler/soma-precompile.js",
|
|
98
103
|
"build:core-dist": "node scripts/build-core-dist.mjs",
|
|
99
|
-
"build:types": "tsc -p tsconfig.types.json",
|
|
104
|
+
"build:types": "rm -rf dist/types && tsc -p tsconfig.types.json",
|
|
100
105
|
"build:all": "npm run build:cli && npm run build:core-dist && npm run build:types",
|
|
101
106
|
"package:vscode": "node scripts/package-vscode.mjs",
|
|
102
107
|
"prepublishOnly": "npm run build:all",
|
|
@@ -107,6 +112,8 @@
|
|
|
107
112
|
"test": "vitest run && npm run test:mock",
|
|
108
113
|
"test:mock": "node --test tests/mock/*.test.mjs",
|
|
109
114
|
"verify:mock-pack": "node scripts/verify-mock-pack.mjs",
|
|
115
|
+
"verify:client-boundary": "node scripts/verify-client-boundary.mjs",
|
|
116
|
+
"verify:client-dep-graph": "node scripts/verify-client-dep-graph.mjs",
|
|
110
117
|
"test:watch": "vitest",
|
|
111
118
|
"typecheck": "tsc --noEmit"
|
|
112
119
|
},
|
|
@@ -116,7 +123,8 @@
|
|
|
116
123
|
"jiti": "^1.21.7",
|
|
117
124
|
"js-yaml": "^4.3.0",
|
|
118
125
|
"msw": "2.15.0",
|
|
119
|
-
"reflect-metadata": "^0.2.1"
|
|
126
|
+
"reflect-metadata": "^0.2.1",
|
|
127
|
+
"server-only": "^0.0.1"
|
|
120
128
|
},
|
|
121
129
|
"peerDependencies": {
|
|
122
130
|
"next": ">=14.0.0",
|
package/tailwind.config.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import type { Config } from 'tailwindcss';
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import path from 'node:path';
|
|
1
|
+
import type { Config } from 'tailwindcss';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
4
|
import { createRequire } from 'node:module';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
|
-
import { getSomaAssetSources } from './core/host/source-packages';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Framework Tailwind config (loaded with soma-core / Next).
|
|
6
|
+
import { getSomaAssetSources } from './core/server/host/source-packages';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Framework Tailwind config (loaded with soma-core / Next).
|
|
10
10
|
* Host theme/plugins come from SOMA_HOST_DIR/tailwind.config.cjs/js via presets.
|
|
11
|
-
*/
|
|
12
|
-
if (!process.env.SOMA_HOST_DIR) {
|
|
13
|
-
throw new Error('[soma-core] tailwind: SOMA_HOST_DIR is not set');
|
|
14
|
-
}
|
|
15
|
-
const hostDir = path.resolve(process.env.SOMA_HOST_DIR);
|
|
16
|
-
const require = createRequire(fileURLToPath(import.meta.url));
|
|
17
|
-
|
|
11
|
+
*/
|
|
12
|
+
if (!process.env.SOMA_HOST_DIR) {
|
|
13
|
+
throw new Error('[soma-core] tailwind: SOMA_HOST_DIR is not set');
|
|
14
|
+
}
|
|
15
|
+
const hostDir = path.resolve(process.env.SOMA_HOST_DIR);
|
|
16
|
+
const require = createRequire(fileURLToPath(import.meta.url));
|
|
17
|
+
|
|
18
18
|
function loadHostPreset(): Config | null {
|
|
19
19
|
for (const name of ['tailwind.config.cjs', 'tailwind.config.js']) {
|
|
20
|
-
const cfgPath = path.join(hostDir, name);
|
|
21
|
-
if (!fs.existsSync(cfgPath)) continue;
|
|
22
|
-
const mod = require(cfgPath) as Config | { default: Config };
|
|
23
|
-
return ('default' in mod && mod.default) ? mod.default : (mod as Config);
|
|
24
|
-
}
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
|
|
20
|
+
const cfgPath = path.join(hostDir, name);
|
|
21
|
+
if (!fs.existsSync(cfgPath)) continue;
|
|
22
|
+
const mod = require(cfgPath) as Config | { default: Config };
|
|
23
|
+
return ('default' in mod && mod.default) ? mod.default : (mod as Config);
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
28
|
const hostPreset = loadHostPreset();
|
|
29
29
|
const sourceContent = getSomaAssetSources(hostDir).flatMap((source) => [
|
|
30
30
|
path.join(source.assetRoot, 'html/**/*.html'),
|
|
@@ -40,5 +40,5 @@ const config: Config = {
|
|
|
40
40
|
...sourceContent,
|
|
41
41
|
],
|
|
42
42
|
};
|
|
43
|
-
|
|
44
|
-
export default config;
|
|
43
|
+
|
|
44
|
+
export default config;
|