@doubao-apps/template 0.0.35-rc.0 → 0.0.35

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.
@@ -1,3 +1,4 @@
1
+ import { getPackageInfoSync } from "@byted-doubao-apps/framework/api";
1
2
  function resolveIconSrc(icons) {
2
3
  if ('string' == typeof icons) return icons.length > 0 ? icons : void 0;
3
4
  return icons?.['3x'] || icons?.['2x'] || icons?.['1x'];
@@ -5,9 +6,10 @@ function resolveIconSrc(icons) {
5
6
  function getAppInfo() {
6
7
  try {
7
8
  const manifest = globalThis.__AI_MANIFEST__;
9
+ const packageInfo = getPackageInfoSync?.();
8
10
  return {
9
- appName: manifest.name || manifest.appId || manifest.package || '',
10
- appIconSrc: resolveIconSrc(manifest.icons)
11
+ appName: manifest ? manifest.name || manifest.appId || manifest.package : packageInfo?.name,
12
+ appIconSrc: manifest ? resolveIconSrc(manifest.icons) : packageInfo?.iconSrc
11
13
  };
12
14
  } catch {
13
15
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doubao-apps/template",
3
- "version": "0.0.35-rc.0",
3
+ "version": "0.0.35",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {