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.
- package/README.en.md +32 -16
- package/README.md +37 -15
- package/build/core/build.js +1 -1
- package/build/core/constants.d.ts +2 -1
- package/build/core/constants.js +3 -2
- package/build/core/env.js +10 -12
- package/build/core/report.js +29 -1
- package/build/core/signing.d.ts +11 -0
- package/build/core/signing.js +113 -0
- package/build/core/template.js +3182 -182
- package/build/data/capabilities.js +50 -19
- package/build/types.d.ts +19 -1
- package/docs/cli-build.md +1 -1
- package/docs/npm-release.md +70 -23
- package/docs/official-app-shell-sample.md +33 -12
- package/docs/official-minimal-sample.md +43 -10
- package/docs/official-native-capabilities-sample.md +79 -23
- package/docs/official-ui-stack-sample.md +23 -18
- package/docs/roadmap.md +68 -40
- package/docs/support-matrix.md +75 -39
- package/docs/v1.7.0-acceptance.md +70 -101
- package/docs/v1.7.1-acceptance.md +111 -0
- package/docs/v1.7.2-acceptance.md +37 -0
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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
|
|
22
|
-
'Read
|
|
23
|
-
'
|
|
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
|
-
|
|
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: [
|
|
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
|
|
39
|
-
'Launch
|
|
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
|
-
|
|
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: [
|
|
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
|
|
54
|
-
'Resolve one
|
|
55
|
-
'
|
|
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
|
-
|
|
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
|
|
70
|
-
'
|
|
71
|
-
'
|
|
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:
|
|
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.
|
|
3
|
+
`v1.7.2` 延续 `verified + preview + experimental` 支持分层,并把四项 preview capability 的现有 `🟠` 缺口收口到明确 `🟡` 子集,其中 `expo55-rnoh082-ui-stack` 仍是唯一 verified 矩阵。
|
|
4
4
|
|
|
5
5
|
CLI 命令集合不变:
|
|
6
6
|
|
package/docs/npm-release.md
CHANGED
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
# npm 发布说明
|
|
2
2
|
|
|
3
|
-
`
|
|
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
|
-
-
|
|
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
|
-
- `
|
|
31
|
-
- `
|
|
32
|
-
- `
|
|
54
|
+
- `doctor`
|
|
55
|
+
- `init --force`
|
|
56
|
+
- `bundle`
|
|
57
|
+
- `next` 轨额外要求 preview sample 作为 smoke 根目录
|
|
33
58
|
|
|
34
59
|
说明:
|
|
35
60
|
|
|
36
|
-
- hosted CI
|
|
37
|
-
-
|
|
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
|
-
-
|
|
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.
|
|
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
|
-
-
|
|
63
|
-
-
|
|
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
|
-
|
|
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
|
-
为了避免
|
|
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
|
-
|
|
127
|
+
这不会影响公开发布验证,因为 smoke 只要求:
|
|
128
|
+
|
|
129
|
+
- `doctor`
|
|
130
|
+
- `init`
|
|
131
|
+
- `bundle`
|
|
91
132
|
|
|
92
|
-
|
|
133
|
+
## 发布边界
|
|
93
134
|
|
|
94
|
-
- `
|
|
95
|
-
-
|
|
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
|
+
从 `v1.7.x` 开始,它的定位不再只是“回归基线”,而是最小可理解的 App Shell 开发者 sample。它专门展示:
|
|
6
6
|
|
|
7
7
|
- `expo-router`
|
|
8
8
|
- `expo-linking`
|
|
9
9
|
- `expo-constants`
|
|
10
|
-
-
|
|
11
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
54
|
+
这个 sample 只负责 App Shell 入门路径,不负责:
|
|
33
55
|
|
|
34
|
-
- `
|
|
35
|
-
- `
|
|
36
|
-
-
|
|
37
|
-
- `bundle.harmony.js` 仍能正确产出 router 页面
|
|
56
|
+
- `react-native-svg`
|
|
57
|
+
- `react-native-reanimated`
|
|
58
|
+
- preview native capability
|
|
38
59
|
|
|
39
|
-
|
|
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
|
-
|
|
5
|
+
它仍然是仓库里最小的官方 sample,但从 `v1.7.x` 开始不再把自己描述成“空白 smoke baseline”。它的定位是:
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
- sidecar
|
|
9
|
-
-
|
|
7
|
+
- 让新开发者一眼看懂最短 `doctor -> init -> bundle -> build-hap` 链路
|
|
8
|
+
- 验证受管 Harmony sidecar 的最小稳定产物
|
|
9
|
+
- 明确说明它不覆盖 router、UI-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
|
-
|
|
25
|
-
- `harmony:init` 与 `harmony:sync-template` 冪等
|
|
26
|
-
- `bundle.harmony.js` 产出成功
|
|
27
|
-
- 生成的 `RNOHPackagesFactory.*` 与 `autolinking.cmake` 保持空 baseline,不被 UI-stack 逻辑污染
|
|
25
|
+
打开 App 后,至少确认:
|
|
28
26
|
|
|
29
|
-
|
|
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
|
|
5
|
+
这个 sample 是 `v1.7.2` 的官方 preview native-capability walkthrough。它的目标不是把 preview 能力包装成 `verified`,而是把四项能力当前真实可承诺的 `🟡` 子集集中演示出来,并把 preview 边界收敛到真机 / release 证据,而不是接口缺口。
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
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
|
-
-
|
|
29
|
-
-
|
|
30
|
-
|
|
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
|
|
52
|
-
- `sync-template`:产出
|
|
101
|
+
- `doctor --strict`:失败,因为 preview capability 仍然不在 verified allowlist
|
|
102
|
+
- `sync-template`:产出 preview shims、Harmony 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
|
-
|
|
59
|
-
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
123
|
+
## 当前结论
|
|
68
124
|
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
125
|
+
- 这个 sample 属于 `preview` 主线,不等于已经进入 `verified`
|
|
126
|
+
- `doctor-report.json` 与 `toolkit-config.json` 中的 `runtimeMode` / `evidence.*` 会如实反映这些能力距离 verified 还缺哪些证据
|
|
127
|
+
- 当前重点是“模拟器下真正可用、核心流清楚、文档一致”
|
|
128
|
+
- 等未来补齐真机 gate 后,才讨论 capability promotion
|