expo-harmony-toolkit 1.7.0 → 1.7.2

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.
@@ -6,21 +6,35 @@ exports.isSupportTierAllowed = isSupportTierAllowed;
6
6
  exports.getCapabilityDefinitionsForProject = getCapabilityDefinitionsForProject;
7
7
  exports.collectCapabilityHarmonyPermissions = collectCapabilityHarmonyPermissions;
8
8
  const project_1 = require("../core/project");
9
+ const PREVIEW_BASELINE_EVIDENCE = {
10
+ bundle: true,
11
+ debugBuild: true,
12
+ device: true,
13
+ release: false,
14
+ };
15
+ const EXPLORATORY_EVIDENCE = {
16
+ bundle: false,
17
+ debugBuild: false,
18
+ device: false,
19
+ release: false,
20
+ };
9
21
  exports.CAPABILITY_DEFINITIONS = [
10
22
  {
11
23
  id: 'expo-file-system',
12
24
  packageName: 'expo-file-system',
13
25
  status: 'manual',
14
26
  supportTier: 'preview',
15
- note: 'Preview bridge scaffolding is available through the managed Harmony shim path, but device persistence is not verified yet.',
27
+ runtimeMode: 'adapter',
28
+ evidence: PREVIEW_BASELINE_EVIDENCE,
29
+ note: 'Toolkit-managed Harmony native file-system adapters cover the v1.7.2 preview subset: UTF-8/base64 sandbox I/O, append and partial reads, md5 metadata, and direct downloads into the app sandbox.',
16
30
  docsUrl: 'https://github.com/react-native-oh-library/usage-docs/blob/master/en/react-native-fs.md',
17
31
  nativePackageNames: ['react-native-fs'],
18
32
  harmonyPermissions: [],
19
33
  sampleRoute: '/file-system',
20
34
  acceptanceChecklist: [
21
- 'Write a UTF-8 file into the app sandbox.',
22
- 'Read the file back and verify content.',
23
- 'Delete the file and verify the entry disappears.',
35
+ 'Write UTF-8 and base64 content into the app sandbox.',
36
+ 'Read back full and partial content and verify md5 metadata.',
37
+ 'Download a remote file into the sandbox and clean up generated entries.',
24
38
  ],
25
39
  },
26
40
  {
@@ -28,15 +42,21 @@ exports.CAPABILITY_DEFINITIONS = [
28
42
  packageName: 'expo-image-picker',
29
43
  status: 'manual',
30
44
  supportTier: 'preview',
31
- note: 'Preview bridge scaffolding is available, but image selection and camera capture still require device-side validation before promotion.',
45
+ runtimeMode: 'adapter',
46
+ evidence: PREVIEW_BASELINE_EVIDENCE,
47
+ note: 'Toolkit-managed Harmony adapters cover the v1.7.2 preview subset: media and camera permissions, single/multi-select library flows, system photo/video capture, pending-result restore, and richer video asset metadata.',
32
48
  docsUrl: 'https://github.com/react-native-oh-library/usage-docs/blob/master/en/react-native-image-picker.md',
33
49
  nativePackageNames: ['react-native-image-picker', 'react-native-permissions'],
34
- harmonyPermissions: ['ohos.permission.CAMERA', 'ohos.permission.READ_IMAGEVIDEO'],
50
+ harmonyPermissions: [
51
+ 'ohos.permission.CAMERA',
52
+ 'ohos.permission.MICROPHONE',
53
+ 'ohos.permission.READ_IMAGEVIDEO',
54
+ ],
35
55
  sampleRoute: '/image-picker',
36
56
  acceptanceChecklist: [
37
- 'Request media-library permissions and surface denied/cancel states.',
38
- 'Launch the image library flow and return one selected asset.',
39
- 'Launch the camera flow and surface denied/cancel states.',
57
+ 'Request media-library and camera permissions and surface denied/cancel states.',
58
+ 'Launch single, multi-select, and mixed library flows and return asset metadata.',
59
+ 'Launch photo/video camera capture and restore one pending result when the JS side resumes.',
40
60
  ],
41
61
  },
42
62
  {
@@ -44,15 +64,22 @@ exports.CAPABILITY_DEFINITIONS = [
44
64
  packageName: 'expo-location',
45
65
  status: 'manual',
46
66
  supportTier: 'preview',
47
- note: 'Preview bridge scaffolding is available for foreground permissions, current-position probes, and watch flows, but device-side runtime behavior is still pending verified promotion.',
67
+ runtimeMode: 'adapter',
68
+ evidence: PREVIEW_BASELINE_EVIDENCE,
69
+ note: 'Toolkit-managed Harmony adapters cover the v1.7.2 preview subset: foreground/background permission flows, current and last-known fixes, geocoding, continuous watch subscriptions, and sensor-backed heading updates.',
48
70
  docsUrl: 'https://github.com/react-native-oh-library/usage-docs/blob/master/en/%40react-native-community-geolocation.md',
49
71
  nativePackageNames: ['@react-native-community/geolocation', 'react-native-permissions'],
50
- harmonyPermissions: ['ohos.permission.LOCATION', 'ohos.permission.APPROXIMATELY_LOCATION'],
72
+ harmonyPermissions: [
73
+ 'ohos.permission.LOCATION',
74
+ 'ohos.permission.APPROXIMATELY_LOCATION',
75
+ 'ohos.permission.LOCATION_IN_BACKGROUND',
76
+ 'ohos.permission.ACCELEROMETER',
77
+ ],
51
78
  sampleRoute: '/location',
52
79
  acceptanceChecklist: [
53
- 'Request foreground location permission.',
54
- 'Resolve one current position fix.',
55
- 'Start and stop a watchPosition subscription cleanly.',
80
+ 'Request foreground and background location permissions.',
81
+ 'Resolve current and last-known fixes plus one active watch update.',
82
+ 'Resolve heading snapshot/watch updates and reverse-geocoded results.',
56
83
  ],
57
84
  },
58
85
  {
@@ -60,15 +87,17 @@ exports.CAPABILITY_DEFINITIONS = [
60
87
  packageName: 'expo-camera',
61
88
  status: 'manual',
62
89
  supportTier: 'preview',
63
- note: 'Preview bridge scaffolding is available for permission, preview-surface, and capture-entry flows, but a verified Harmony-native runtime path is not public yet.',
90
+ runtimeMode: 'adapter',
91
+ evidence: PREVIEW_BASELINE_EVIDENCE,
92
+ note: 'Toolkit-managed Harmony adapters cover the v1.7.2 preview subset: embedded camera preview, still capture, preview pause/resume, microphone permission, and in-session video recording controls.',
64
93
  docsUrl: 'https://github.com/react-native-oh-library/usage-docs/blob/master/en/react-native-camera-kit.md',
65
94
  nativePackageNames: ['react-native-camera-kit', 'react-native-permissions'],
66
- harmonyPermissions: ['ohos.permission.CAMERA'],
95
+ harmonyPermissions: ['ohos.permission.CAMERA', 'ohos.permission.MICROPHONE'],
67
96
  sampleRoute: '/camera',
68
97
  acceptanceChecklist: [
69
- 'Request camera permission.',
70
- 'Render a live preview without crashing the Harmony runtime.',
71
- 'Capture one photo and surface the asset metadata back to JS.',
98
+ 'Request camera and microphone permissions.',
99
+ 'Capture one photo and one embedded video result and surface metadata back to JS.',
100
+ 'Exercise preview pause/resume plus denied or canceled outcomes without crashing the Harmony runtime.',
72
101
  ],
73
102
  },
74
103
  {
@@ -76,6 +105,8 @@ exports.CAPABILITY_DEFINITIONS = [
76
105
  packageName: 'expo-notifications',
77
106
  status: 'manual',
78
107
  supportTier: 'experimental',
108
+ runtimeMode: 'shim',
109
+ evidence: EXPLORATORY_EVIDENCE,
79
110
  note: 'Notifications stay below the public promise until a complete Harmony delivery story is validated end to end.',
80
111
  docsUrl: 'https://github.com/react-native-oh-library',
81
112
  nativePackageNames: [],
package/build/types.d.ts CHANGED
@@ -2,6 +2,7 @@ export type CompatibilityStatus = 'supported' | 'manual' | 'unknown';
2
2
  export type EligibilityStatus = 'eligible' | 'ineligible';
3
3
  export type SupportTier = 'verified' | 'preview' | 'experimental' | 'unsupported';
4
4
  export type DoctorTargetTier = Exclude<SupportTier, 'unsupported'>;
5
+ export type CapabilityRuntimeMode = 'shim' | 'adapter' | 'verified';
5
6
  export type DependencySource = 'dependency' | 'devDependency' | 'peerDependency' | 'expo-plugin';
6
7
  export interface ExpoHarmonyPluginProps {
7
8
  bundleName?: string;
@@ -82,11 +83,19 @@ export interface SupportTierSummary {
82
83
  experimental: number;
83
84
  unsupported: number;
84
85
  }
86
+ export interface CapabilityEvidence {
87
+ bundle: boolean;
88
+ debugBuild: boolean;
89
+ device: boolean;
90
+ release: boolean;
91
+ }
85
92
  export interface CapabilityDefinition {
86
93
  id: string;
87
94
  packageName: string;
88
95
  status: CompatibilityStatus;
89
96
  supportTier: DoctorTargetTier;
97
+ runtimeMode: CapabilityRuntimeMode;
98
+ evidence: CapabilityEvidence;
90
99
  note: string;
91
100
  docsUrl?: string;
92
101
  nativePackageNames: string[];
@@ -99,6 +108,8 @@ export interface ProjectCapabilityReport {
99
108
  packageName: string;
100
109
  status: CompatibilityStatus;
101
110
  supportTier: DoctorTargetTier;
111
+ runtimeMode: CapabilityRuntimeMode;
112
+ evidence: CapabilityEvidence;
102
113
  note: string;
103
114
  docsUrl?: string;
104
115
  nativePackageNames: string[];
@@ -106,6 +117,13 @@ export interface ProjectCapabilityReport {
106
117
  sampleRoute: string;
107
118
  acceptanceChecklist: string[];
108
119
  }
120
+ export interface ManagedCapabilityRecord {
121
+ id: string;
122
+ packageName: string;
123
+ supportTier: DoctorTargetTier;
124
+ runtimeMode: CapabilityRuntimeMode;
125
+ evidence: CapabilityEvidence;
126
+ }
109
127
  export interface DoctorReport {
110
128
  generatedAt: string;
111
129
  projectRoot: string;
@@ -200,7 +218,7 @@ export interface ToolkitConfig {
200
218
  rnohCliVersion: string;
201
219
  bundleName: string;
202
220
  entryModuleName: string;
203
- capabilities: string[];
221
+ capabilities: ManagedCapabilityRecord[];
204
222
  requestedHarmonyPermissions: string[];
205
223
  project: {
206
224
  name: string;
package/docs/cli-build.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # CLI 构建指南
2
2
 
3
- `v1.7.0` 延续 `verified + preview + experimental` 支持分层,并把 Batch B 设备能力推进到 preview 接入路径,其中 `expo55-rnoh082-ui-stack` 仍是唯一 verified 矩阵。
3
+ `v1.7.2` 延续 `verified + preview + experimental` 支持分层,并把四项 preview capability 的现有 `🟠` 缺口收口到明确 `🟡` 子集,其中 `expo55-rnoh082-ui-stack` 仍是唯一 verified 矩阵。
4
4
 
5
5
  CLI 命令集合不变:
6
6
 
@@ -1,14 +1,29 @@
1
1
  # npm 发布说明
2
2
 
3
- `v1.5.0` 是 `expo-harmony-toolkit` 首个面向外部用户的 npm 正式公开版本。
3
+ `expo-harmony-toolkit` 继续公开发布到 npm,但从现在开始明确区分两条发布轨:
4
+
5
+ - `latest`
6
+ - 只发布完整验收的 `verified` 能力
7
+ - 面向正式公开承诺
8
+ - `next`
9
+ - 承接 preview fast track
10
+ - 面向更快的集成反馈,不等于 verified 或 release-ready
11
+
12
+ ## 发布轨策略
4
13
 
5
14
  固定策略:
6
15
 
7
16
  - 包名:`expo-harmony-toolkit`
8
- - dist-tag:`latest`
9
- - provenance:GitHub 自动发布开启;本地手动发布不要求
17
+ - 稳定轨 dist-tag:`latest`
18
+ - 快速轨 dist-tag:`next`
19
+ - provenance:GitHub 自动发布开启;本地手动发布不强制
10
20
  - 自动发布:hosted CI only
11
21
 
22
+ 推荐理解:
23
+
24
+ - `latest` 解决“可以公开承诺什么”
25
+ - `next` 解决“怎样更快收敛 preview 能力”
26
+
12
27
  ## 发布前检查
13
28
 
14
29
  统一执行:
@@ -20,47 +35,72 @@ npm pack --dry-run
20
35
  pnpm release:check
21
36
  ```
22
37
 
23
- `release:check` 固定覆盖:
38
+ `release:check` 会根据发布轨选择 smoke sample 与 doctor gate:
39
+
40
+ - `latest`
41
+ - smoke sample:`examples/official-ui-stack-sample`
42
+ - doctor gate:`expo-harmony doctor --strict`
43
+ - `next`
44
+ - smoke sample:`examples/official-native-capabilities-sample`
45
+ - doctor gate:`expo-harmony doctor --target-tier preview`
46
+
47
+ 固定覆盖:
24
48
 
25
49
  - `pnpm build`
26
50
  - `pnpm test`
27
51
  - `npm pack --dry-run`
28
52
  - tarball 文件清单检查,不允许包含 `examples/`、`fixtures/`、`tests/`
29
53
  - tarball 安装 smoke:
30
- - `expo-harmony doctor --strict`
31
- - `expo-harmony init --force`
32
- - `expo-harmony bundle`
54
+ - `doctor`
55
+ - `init --force`
56
+ - `bundle`
57
+ - `next` 轨额外要求 preview sample 作为 smoke 根目录
33
58
 
34
59
  说明:
35
60
 
36
- - hosted CI 默认不阻塞 `build-hap --mode debug`
37
- - `build-hap` 继续作为本地或有 DevEco 工具链环境时的附加验证
61
+ - hosted CI 默认仍可通过 `EXPO_HARMONY_RELEASE_SKIP_HAP=1` 跳过真实 DevEco HAP 构建
62
+ - debug / release HAP gate 继续由 capability acceptance、带工具链环境的 CI 或本地验收补齐
38
63
 
39
64
  ## 手动发布
40
65
 
41
- 本地执行:
66
+ 发布 `latest`:
42
67
 
43
68
  ```bash
44
69
  pnpm release:check
45
70
  npm publish --tag latest --access public
46
71
  ```
47
72
 
73
+ 发布 `next`:
74
+
75
+ ```bash
76
+ EXPO_HARMONY_RELEASE_CHANNEL=next pnpm release:check
77
+ npm publish --tag next --access public
78
+ ```
79
+
48
80
  前提:
49
81
 
50
82
  - 已登录 npm
51
- - 包名 `expo-harmony-toolkit` 仍可用
83
+ - 当前包版本与预期发布轨一致
84
+ - `next` 版本建议使用 prerelease version,例如 `1.8.0-next.1`
52
85
 
53
86
  ## GitHub 自动发布
54
87
 
55
88
  默认触发:
56
89
 
57
- - push version tag,例如 `v1.5.2`
90
+ - push version tag,例如 `v1.8.0`
91
+ - push prerelease tag,例如 `v1.8.0-next.1`
58
92
 
59
93
  工作流行为:
60
94
 
61
95
  - 安装依赖
62
- - 执行 `pnpm release:check`
63
- - 使用 npm Trusted Publisher 发布到 npm
96
+ - 判断发布轨
97
+ - 执行对应轨道的 `release:check`
98
+ - 使用 npm Trusted Publisher 发布到对应 dist-tag
99
+
100
+ 约定:
101
+
102
+ - 普通版本 tag 发布到 `latest`
103
+ - 包含 `-next.`、`-beta.` 或 `-alpha.` 的 tag 发布到 `next`
64
104
 
65
105
  要求:
66
106
 
@@ -69,27 +109,34 @@ npm publish --tag latest --access public
69
109
  - workflow 具备 `id-token: write`
70
110
  - 使用 GitHub-hosted runner
71
111
  - GitHub 自动发布命令包含 `--provenance`
72
- - 本地手动发布只要求 `latest` dist-tag,不强制 provenance
73
-
74
- `workflow_dispatch` 仅用于 rehearsal / dry-run,不会直接 publish。
75
112
 
76
113
  ## tarball smoke 的安装注意事项
77
114
 
78
- 当前官方 UI-stack sample 依赖两项 Git adapter
115
+ 当前公开矩阵内的两套 Git adapter 依赖仍是:
79
116
 
80
117
  - `@react-native-oh-tpl/react-native-reanimated`
81
118
  - `@react-native-oh-tpl/react-native-svg`
82
119
 
83
- 为了避免 Git adapter prepare 阶段拉取私有上游资源,tarball smoke 固定使用:
120
+ 为了避免 adapter prepare 阶段拉取私有上游资源,tarball smoke 固定使用:
84
121
 
85
122
  ```bash
86
123
  pnpm install --ignore-scripts
87
124
  pnpm add --ignore-scripts <tarball>
88
125
  ```
89
126
 
90
- 这不会影响 toolkit 的公开发布验证,因为 tarball smoke 只要求 `doctor`、`init`、`bundle`。
127
+ 这不会影响公开发布验证,因为 smoke 只要求:
128
+
129
+ - `doctor`
130
+ - `init`
131
+ - `bundle`
91
132
 
92
- 补充:
133
+ ## 发布边界
93
134
 
94
- - `react-native-gesture-handler` 目前不在公开 release gate
95
- - 如需继续尝试它,请按矩阵外的手动探索项处理,而不是把它当作 `doctor --strict` 通过条件
135
+ - `latest` 不承接 preview capability 的公开承诺
136
+ - `next` 可以承接 preview fast track,但不得替代 capability promotion gate
137
+ - 任何声称 verified 的能力都必须具备:
138
+ - `bundle`
139
+ - debug `build-hap`
140
+ - device acceptance
141
+ - release acceptance
142
+ - 文档与 acceptance 记录
@@ -2,13 +2,13 @@
2
2
 
3
3
  这份指南适用于仓库内的 `examples/official-app-shell-sample`。
4
4
 
5
- 从 `v1.5.0` 开始,它不再是对外主 sample,而是 App Shell 回归基线,主要用于确认:
5
+ 从 `v1.7.x` 开始,它的定位不再只是“回归基线”,而是最小可理解的 App Shell 开发者 sample。它专门展示:
6
6
 
7
7
  - `expo-router`
8
8
  - `expo-linking`
9
9
  - `expo-constants`
10
- - router sidecar 入口和 bundle 行为
11
- - UI-stack 收口没有破坏原有 App Shell 路径
10
+ - 当前 pathname / observed URL / generated URL
11
+ - router push、`Link` 组件、generated deep link 三条最核心入口
12
12
 
13
13
  ## 使用方式
14
14
 
@@ -19,21 +19,42 @@ pnpm run harmony:doctor:strict
19
19
  pnpm run harmony:init
20
20
  pnpm run harmony:sync-template
21
21
  pnpm run harmony:bundle
22
+ pnpm run harmony:build:debug
22
23
  ```
23
24
 
24
- 如果本机 DevEco 环境已就绪,也可以继续:
25
+ ## 运行时成功标准
26
+
27
+ 打开 App 后,至少确认:
28
+
29
+ - 首页能看到 `Constants.expoConfig?.name`
30
+ - 首页能看到当前 pathname、observed URL、generated details URL
31
+ - 点击 `Push /details with router` 后能进入 `/details`
32
+ - 点击 `Open details with Link component` 后能进入 `/details`
33
+ - 点击 `Open generated deep link` 后,也能把同一个 App 壳子解析到 `/details`
34
+ - 在 `/details` 点击返回后能回首页
35
+
36
+ ## Release 路径
37
+
38
+ 如果要继续验证 release 构建,先准备本地签名覆盖文件:
25
39
 
26
40
  ```bash
27
- pnpm run harmony:build:debug
41
+ mkdir -p .expo-harmony
42
+ $EDITOR .expo-harmony/signing.local.json
43
+ pnpm run harmony:env
44
+ pnpm run harmony:build:release
28
45
  ```
29
46
 
30
- ## 回归关注点
47
+ 说明:
48
+
49
+ - `.expo-harmony/signing.local.json` 是本地 signing 入口
50
+ - signing 缺失时,`harmony:env` 和 `harmony:build:release` 会明确提示,不会静默跳过
51
+
52
+ ## 边界
31
53
 
32
- 这个 sample 不引入 UI adapters。它的价值在于:
54
+ 这个 sample 只负责 App Shell 入门路径,不负责:
33
55
 
34
- - `doctor` 仍然判定在 `expo55-rnoh082-ui-stack` 公开矩阵内
35
- - `index.harmony.js` 与 router sidecar 入口仍然正确
36
- - `autolinking.cmake` 在无 UI adapters 时保持空 stub,不被 UI-stack 逻辑污染
37
- - `bundle.harmony.js` 仍能正确产出 router 页面
56
+ - `react-native-svg`
57
+ - `react-native-reanimated`
58
+ - preview native capability
38
59
 
39
- 如果需要对外展示 UI-stack 能力,请改用 [官方 UI Stack sample 指南](./official-ui-stack-sample.md)。
60
+ 如果你要看 verified UI-stack 主线,请改用 [官方 UI Stack sample 指南](./official-ui-stack-sample.md)。
@@ -2,11 +2,11 @@
2
2
 
3
3
  这份指南适用于仓库内的 `examples/official-minimal-sample`。
4
4
 
5
- 它在 `v1.5.0` 中继续作为最小 smoke baseline,用于回归:
5
+ 它仍然是仓库里最小的官方 sample,但从 `v1.7.x` 开始不再把自己描述成“空白 smoke baseline”。它的定位是:
6
6
 
7
- - 最短 `doctor -> init -> bundle` 链路
8
- - sidecar 模板稳定性
9
- - router、非 UI adapter 的最小输入
7
+ - 让新开发者一眼看懂最短 `doctor -> init -> bundle -> build-hap` 链路
8
+ - 验证受管 Harmony sidecar 的最小稳定产物
9
+ - 明确说明它不覆盖 routerUI-stack、native capability
10
10
 
11
11
  ## 使用方式
12
12
 
@@ -17,16 +17,49 @@ pnpm run harmony:doctor:strict
17
17
  pnpm run harmony:init
18
18
  pnpm run harmony:sync-template
19
19
  pnpm run harmony:bundle
20
+ pnpm run harmony:build:debug
20
21
  ```
21
22
 
22
- ## 预期
23
+ ## 运行时成功标准
23
24
 
24
- - `doctor --strict` 通过
25
- - `harmony:init` 与 `harmony:sync-template` 冪等
26
- - `bundle.harmony.js` 产出成功
27
- - 生成的 `RNOHPackagesFactory.*` 与 `autolinking.cmake` 保持空 baseline,不被 UI-stack 逻辑污染
25
+ 打开 App 后,至少确认:
28
26
 
29
- 如果你要验证 router 或 UI 能力,请改用:
27
+ - 页面能正常启动
28
+ - 页面清楚显示这条 sample 验证的是最短构建链路
29
+ - 页面清楚区分“验证什么”和“故意不包含什么”
30
+ - `bundle.harmony.js` 成功产出
31
+ - 生成的 Harmony sidecar 保持最小且稳定,不被 router 或 UI-stack 逻辑污染
32
+
33
+ ## Release 路径
34
+
35
+ 如果要继续验证 release 构建,先准备本地签名覆盖文件:
36
+
37
+ ```bash
38
+ mkdir -p .expo-harmony
39
+ $EDITOR .expo-harmony/signing.local.json
40
+ pnpm run harmony:env
41
+ pnpm run harmony:build:release
42
+ ```
43
+
44
+ 说明:
45
+
46
+ - `.expo-harmony/signing.local.json` 是本地 signing 入口
47
+ - toolkit 会把本地 signing 合并进 `harmony/build-profile.json5`
48
+ - 如果 signing 没配置,`harmony:env` 会明确报缺失;这属于预期阻断
49
+
50
+ ## 不覆盖的内容
51
+
52
+ 这个 sample 故意不包含:
53
+
54
+ - `expo-router`
55
+ - `expo-linking`
56
+ - `expo-constants`
57
+ - `react-native-svg`
58
+ - `react-native-reanimated`
59
+ - 任意 preview native capability
60
+
61
+ 如果你要验证这些内容,请改用:
30
62
 
31
63
  - [官方 App Shell sample 指南](./official-app-shell-sample.md)
32
64
  - [官方 UI Stack sample 指南](./official-ui-stack-sample.md)
65
+ - [官方 Native Capabilities sample 指南](./official-native-capabilities-sample.md)
@@ -2,12 +2,11 @@
2
2
 
3
3
  路径:`examples/official-native-capabilities-sample`
4
4
 
5
- 这个 sample `v1.7` 开始承担 Batch A+B preview 能力的统一官方入口。它不是新的 `verified` sample,而是专门用来验证:
5
+ 这个 sample `v1.7.2` 的官方 preview native-capability walkthrough。它的目标不是把 preview 能力包装成 `verified`,而是把四项能力当前真实可承诺的 `🟡` 子集集中演示出来,并把 preview 边界收敛到真机 / release 证据,而不是接口缺口。
6
6
 
7
- - `doctor --target-tier preview`
8
- - managed Harmony permission 生成
9
- - preview capability Metro alias / shim
10
- - `bundle` 与 `build-hap --mode debug` 阶段对原生能力 import path 的稳定接管
7
+ 标记说明:
8
+
9
+ - `🟡` 当前可用子集:这部分已经有可信实现,样例和模拟器路径可用;下一步主要缺真机 / release 证据
11
10
 
12
11
  ## 当前覆盖
13
12
 
@@ -23,11 +22,62 @@
23
22
  - `/location`
24
23
  - `/camera`
25
24
 
25
+ ## 每条 route 的真实范围
26
+
27
+ ### `/file-system`
28
+
29
+ `🟡 当前可用子集`:
30
+
31
+ - sandbox 目录创建
32
+ - UTF-8 写入 / 读回
33
+ - base64 roundtrip
34
+ - append / partial read
35
+ - `getInfoAsync({ md5: true })`
36
+ - `downloadAsync`
37
+ - 清理生成产物
38
+
39
+ ### `/image-picker`
40
+
41
+ `🟡 当前可用子集`:
42
+
43
+ - media permission
44
+ - camera permission
45
+ - 单选图库选择
46
+ - 多选图库选择
47
+ - mixed image+video library selection
48
+ - system photo capture
49
+ - system video capture
50
+ - pending result 恢复
51
+ - image / video asset metadata 展示
52
+
53
+ ### `/location`
54
+
55
+ `🟡 当前可用子集`:
56
+
57
+ - foreground permission
58
+ - background permission
59
+ - `getCurrentPositionAsync`
60
+ - `watchPositionAsync`
61
+ - `getHeadingAsync`
62
+ - `watchHeadingAsync`
63
+ - `geocodeAsync`
64
+ - `reverseGeocodeAsync`
65
+
26
66
  说明:
27
67
 
28
- - 这些 route 的目标是承接 preview bridge,而不是宣称运行时已经完全可用
29
- - 当前 sample 强调“可分析、可生成 sidecar、可 bundle、可 debug build、可观察 permission/shim 产物”
30
- - 只有当设备侧 runtime、debug HAP、人工验收都完成后,对应能力才可以从 `preview` 晋升到 `verified`
68
+ - 背景权限按 Harmony 的独立后台权限契约暴露,不伪装成 Expo 的完全同构平台行为
69
+ - heading 使用 Harmony 传感器方向语义,属于最接近 Expo 的等价语义,不复用 GPS `direction`
70
+
71
+ ### `/camera`
72
+
73
+ `🟡 当前可用子集`:
74
+
75
+ - embedded `CameraView` preview
76
+ - `pausePreview` / `resumePreview`
77
+ - still photo capture
78
+ - video recording start / stop / toggle
79
+ - microphone permission snapshot
80
+ - denied / canceled / successful result 展示
31
81
 
32
82
  ## 推荐命令
33
83
 
@@ -48,25 +98,31 @@ pnpm run harmony:doctor:strict
48
98
  预期结果:
49
99
 
50
100
  - `doctor --target-tier preview`:通过
51
- - `doctor --strict`:失败,因为 preview 能力仍然不在 verified allowlist
52
- - `sync-template`:产出 Batch A+B 对应 preview shimsHarmony permissions
101
+ - `doctor --strict`:失败,因为 preview capability 仍然不在 verified allowlist
102
+ - `sync-template`:产出 preview shimsHarmony permissions、toolkit telemetry
53
103
  - `bundle`:成功产出 `bundle.harmony.js`
54
104
  - `build-hap --mode debug`:可进入 debug HAP 构建路径
55
105
 
56
- ## 关键受管产物
106
+ ## Release 路径
107
+
108
+ 如果要继续验证 release 构建,先准备本地签名覆盖文件:
57
109
 
58
- - `harmony/entry/src/main/module.json5`
59
- - `.expo-harmony/shims/expo-file-system/index.js`
60
- - `.expo-harmony/shims/expo-image-picker/index.js`
61
- - `.expo-harmony/shims/expo-location/index.js`
62
- - `.expo-harmony/shims/expo-camera/index.js`
63
- - `metro.harmony.config.js`
110
+ ```bash
111
+ mkdir -p .expo-harmony
112
+ $EDITOR .expo-harmony/signing.local.json
113
+ pnpm run harmony:env
114
+ pnpm run harmony:build:release
115
+ ```
116
+
117
+ 说明:
64
118
 
65
- ## 晋升条件
119
+ - `.expo-harmony/signing.local.json` 是本地 signing 入口
120
+ - toolkit 会把本地 signing 合并进 `harmony/build-profile.json5`
121
+ - 即使 release 构建可走通,在没有真机前,这四项能力也仍保持 `preview`
66
122
 
67
- 当以下条件都具备时,相关能力才可以从这个 sample 迁移到 verified 主叙事:
123
+ ## 当前结论
68
124
 
69
- - 真机或模拟器运行时功能通过
70
- - debug `build-hap` 成功
71
- - 权限拒绝、取消流程、异常路径完成记录
72
- - support matrix、README、roadmap、acceptance 记录同 PR 更新
125
+ - 这个 sample 属于 `preview` 主线,不等于已经进入 `verified`
126
+ - `doctor-report.json` `toolkit-config.json` 中的 `runtimeMode` / `evidence.*` 会如实反映这些能力距离 verified 还缺哪些证据
127
+ - 当前重点是“模拟器下真正可用、核心流清楚、文档一致”
128
+ - 等未来补齐真机 gate 后,才讨论 capability promotion