soma-core 2.2.2 → 2.2.4

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 CHANGED
@@ -8,7 +8,7 @@ SOMA 通用运行时:core 的标准体系 = HTML + 一份 `_ui.yaml` + 组件。
8
8
  Registry 页面以页面名作为公开根路径:注册 `myworkspace` 后直接访问 `/myworkspace`。
9
9
  Host 文件页优先,Registry 页面在 Host 404 时兜底;存量 `/pages/<name>` 链接仅保留兼容读取。
10
10
 
11
- 当前仓内候选版本 `1.7.0` 尚未发布。core 不再有纯计算出口(`theme-pure` / `adaptive-pure` 已随交出退役):纯计算由 `soma-foundation` 与 `soma-ui/{theme-pure,space-pure}` 提供,边界由根 `scripts/verify-foundation.mjs` 检查。
11
+ 当前版本为 `soma-core@2.2.4`(唯一版本)。core 不含纯计算出口(纯计算由 `soma-foundation` 与 `soma-ui/{theme-pure,space-pure}` 提供,边界由根 `scripts/verify-foundation.mjs` 检查)。
12
12
 
13
13
  ## 当前能力(以代码为准)
14
14
 
@@ -52,6 +52,14 @@ export async function loadHostDomainClass(
52
52
  loadFallbackModule?: (base: string) => Promise<SomaDomainModule>;
53
53
  } = {},
54
54
  ): Promise<SomaDomainConstructor> {
55
+ if (
56
+ !context.sourcePackage &&
57
+ !options.loadFallbackModule &&
58
+ options.allowLocaleOnlyFallback !== false &&
59
+ context.base.startsWith('dynamic-')
60
+ ) {
61
+ return SomaLocaleOnlyPageRoot;
62
+ }
55
63
  let registryFailure: unknown;
56
64
  try {
57
65
  let registry: SomaDomainLoaderModule | null = null;
@@ -29,7 +29,12 @@ export function hasModuleNotFoundSignature(error: unknown): boolean {
29
29
  if (typeof unwrapped !== 'object' || unwrapped === null) return false;
30
30
  const { code, message } = unwrapped as { code?: unknown; message?: unknown };
31
31
  if (code === 'MODULE_NOT_FOUND' || code === 'ERR_MODULE_NOT_FOUND') return true;
32
- return typeof message === 'string' && /Cannot find module|Module not found|Can't resolve|Unknown variable dynamic import/i.test(message);
32
+ return (
33
+ typeof message === 'string' &&
34
+ /Cannot find module|Module not found|Can't resolve|Unknown variable dynamic import|Failed to resolve module specifier|does not start with|Failed to fetch dynamically imported module/i.test(
35
+ message,
36
+ )
37
+ );
33
38
  }
34
39
 
35
40
  /**
@@ -42,8 +47,12 @@ export function extractMissingModuleSpecifier(message: string): string | null {
42
47
  if (viteMatch && viteMatch[1]) {
43
48
  return viteMatch[1].trim();
44
49
  }
50
+ const fetchMatch = message.match(/Failed to fetch dynamically imported module:\s*(\S+)/i);
51
+ if (fetchMatch && fetchMatch[1]) {
52
+ return fetchMatch[1].trim().replace(/[?#].*$/, '');
53
+ }
45
54
  const primaryMatch = message.match(
46
- /(?:Cannot find (?:module|package)|Can't resolve|Failed to resolve import)\s+['"]([^'"]+)['"]/i,
55
+ /(?:Cannot find (?:module|package)|Can't resolve|Failed to resolve (?:import|module specifier))\s+['"]([^'"]+)['"]/i,
47
56
  );
48
57
  if (primaryMatch && primaryMatch[1]) {
49
58
  return primaryMatch[1];
@@ -121100,7 +121100,9 @@ function hasModuleNotFoundSignature(error2) {
121100
121100
  if (typeof unwrapped !== "object" || unwrapped === null) return false;
121101
121101
  const { code, message } = unwrapped;
121102
121102
  if (code === "MODULE_NOT_FOUND" || code === "ERR_MODULE_NOT_FOUND") return true;
121103
- return typeof message === "string" && /Cannot find module|Module not found|Can't resolve|Unknown variable dynamic import/i.test(message);
121103
+ return typeof message === "string" && /Cannot find module|Module not found|Can't resolve|Unknown variable dynamic import|Failed to resolve module specifier|does not start with|Failed to fetch dynamically imported module/i.test(
121104
+ message
121105
+ );
121104
121106
  }
121105
121107
  function extractMissingModuleSpecifier(message) {
121106
121108
  if (!message || typeof message !== "string") return null;
@@ -121108,8 +121110,12 @@ function extractMissingModuleSpecifier(message) {
121108
121110
  if (viteMatch && viteMatch[1]) {
121109
121111
  return viteMatch[1].trim();
121110
121112
  }
121113
+ const fetchMatch = message.match(/Failed to fetch dynamically imported module:\s*(\S+)/i);
121114
+ if (fetchMatch && fetchMatch[1]) {
121115
+ return fetchMatch[1].trim().replace(/[?#].*$/, "");
121116
+ }
121111
121117
  const primaryMatch = message.match(
121112
- /(?:Cannot find (?:module|package)|Can't resolve|Failed to resolve import)\s+['"]([^'"]+)['"]/i
121118
+ /(?:Cannot find (?:module|package)|Can't resolve|Failed to resolve (?:import|module specifier))\s+['"]([^'"]+)['"]/i
121113
121119
  );
121114
121120
  if (primaryMatch && primaryMatch[1]) {
121115
121121
  return primaryMatch[1];
@@ -14,6 +14,7 @@ import type {
14
14
  SomaRuntimeServices,
15
15
  } from 'soma-core/runtime';
16
16
  import { assertRuntimeArtifact, maybeStartBootTimings, readBootTimings, SomaBootstrap } from 'soma-core/runtime';
17
+ import { SomaLocaleOnlyPageRoot } from 'soma-core/base';
17
18
  import { loadHostDomainClass, resolveHostBootstrapOptions } from 'soma-core/host-bridge';
18
19
  import { designChunkLoadBackoffMs } from 'soma-foundation/layout';
19
20
  import {
@@ -269,7 +270,10 @@ class NativePageClient {
269
270
 
270
271
  const base = (data.base as string) || urlPathToPageBase(pagePath);
271
272
  const sourcePackage = typeof data.sourcePackage === 'string' ? data.sourcePackage : null;
272
- const DomainClass = await loadHostDomainClass({ base, sourcePackage });
273
+ const DomainClass =
274
+ data.sourceMarkup === 'component-tree' || base.startsWith('dynamic-')
275
+ ? SomaLocaleOnlyPageRoot
276
+ : await loadHostDomainClass({ base, sourcePackage });
273
277
  const routeAssets = {
274
278
  routerPath,
275
279
  ...(data.params !== undefined ? { pageParams: data.params } : {}),
@@ -299,10 +303,13 @@ class NativePageClient {
299
303
  (data.sourceMarkup !== 'component-tree' ||
300
304
  cached.artifact?.artifactDigest === data.artifact?.artifactDigest)
301
305
  ) {
302
- const CachedClass = await loadHostDomainClass({
303
- base: cached.base,
304
- sourcePackage: cached.sourcePackage,
305
- });
306
+ const CachedClass =
307
+ cached.sourceMarkup === 'component-tree' || cached.base.startsWith('dynamic-')
308
+ ? SomaLocaleOnlyPageRoot
309
+ : await loadHostDomainClass({
310
+ base: cached.base,
311
+ sourcePackage: cached.sourcePackage,
312
+ });
306
313
  if (runId === this.currentRunId) {
307
314
  await this.mountInto(
308
315
  CachedClass,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soma-core",
3
- "version": "2.2.2",
3
+ "version": "2.2.4",
4
4
  "description": "SOMA — Semantic Oriented Modular Architecture. A declarative frontend framework runtime with no UI framework dependency; native host shell ships in host-native/.",
5
5
  "keywords": [
6
6
  "soma",