@lynxship/cli 0.1.19 → 0.1.21

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.
Files changed (193) hide show
  1. package/README.md +66 -5
  2. package/dist/android/signing.d.ts +16 -0
  3. package/dist/android/signing.d.ts.map +1 -0
  4. package/dist/android/signing.js +131 -0
  5. package/dist/android/types.d.ts +12 -0
  6. package/dist/android/types.d.ts.map +1 -0
  7. package/dist/android/types.js +1 -0
  8. package/dist/android-build.d.ts +4 -13
  9. package/dist/android-build.d.ts.map +1 -1
  10. package/dist/android-build.js +14 -133
  11. package/dist/android-toolchain/inspection.d.ts +3 -0
  12. package/dist/android-toolchain/inspection.d.ts.map +1 -0
  13. package/dist/android-toolchain/inspection.js +122 -0
  14. package/dist/android-toolchain/probes.d.ts +23 -0
  15. package/dist/android-toolchain/probes.d.ts.map +1 -0
  16. package/dist/android-toolchain/probes.js +183 -0
  17. package/dist/android-toolchain/types.d.ts +20 -0
  18. package/dist/android-toolchain/types.d.ts.map +1 -0
  19. package/dist/android-toolchain/types.js +1 -0
  20. package/dist/android-toolchain.d.ts +4 -20
  21. package/dist/android-toolchain.d.ts.map +1 -1
  22. package/dist/android-toolchain.js +4 -300
  23. package/dist/app-config.d.ts +25 -0
  24. package/dist/app-config.d.ts.map +1 -0
  25. package/dist/app-config.js +106 -0
  26. package/dist/bundle-build.d.ts.map +1 -1
  27. package/dist/bundle-build.js +11 -0
  28. package/dist/cli.d.ts +3 -0
  29. package/dist/cli.d.ts.map +1 -0
  30. package/dist/cli.js +66 -0
  31. package/dist/commands/build-execution.d.ts +41 -0
  32. package/dist/commands/build-execution.d.ts.map +1 -0
  33. package/dist/commands/build-execution.js +182 -0
  34. package/dist/commands/configuration.d.ts +19 -0
  35. package/dist/commands/configuration.d.ts.map +1 -0
  36. package/dist/commands/configuration.js +174 -0
  37. package/dist/commands/development.d.ts +22 -0
  38. package/dist/commands/development.d.ts.map +1 -0
  39. package/dist/commands/development.js +132 -0
  40. package/dist/commands/device.d.ts +3 -0
  41. package/dist/commands/device.d.ts.map +1 -0
  42. package/dist/commands/device.js +86 -0
  43. package/dist/commands/doctor.d.ts +18 -0
  44. package/dist/commands/doctor.d.ts.map +1 -0
  45. package/dist/commands/doctor.js +320 -0
  46. package/dist/commands/help.d.ts +2 -0
  47. package/dist/commands/help.d.ts.map +1 -0
  48. package/dist/commands/help.js +118 -0
  49. package/dist/commands/i18n.d.ts +14 -0
  50. package/dist/commands/i18n.d.ts.map +1 -0
  51. package/dist/commands/i18n.js +88 -0
  52. package/dist/commands/logs.d.ts +3 -0
  53. package/dist/commands/logs.d.ts.map +1 -0
  54. package/dist/commands/logs.js +51 -0
  55. package/dist/commands/metadata.d.ts +3 -0
  56. package/dist/commands/metadata.d.ts.map +1 -0
  57. package/dist/commands/metadata.js +45 -0
  58. package/dist/commands/ota.d.ts +28 -0
  59. package/dist/commands/ota.d.ts.map +1 -0
  60. package/dist/commands/ota.js +203 -0
  61. package/dist/commands/project.d.ts +14 -0
  62. package/dist/commands/project.d.ts.map +1 -0
  63. package/dist/commands/project.js +122 -0
  64. package/dist/commands/remote-build.d.ts +35 -0
  65. package/dist/commands/remote-build.d.ts.map +1 -0
  66. package/dist/commands/remote-build.js +73 -0
  67. package/dist/commands/submit.d.ts +27 -0
  68. package/dist/commands/submit.d.ts.map +1 -0
  69. package/dist/commands/submit.js +92 -0
  70. package/dist/ecosystem.d.ts +9 -0
  71. package/dist/ecosystem.d.ts.map +1 -0
  72. package/dist/ecosystem.js +95 -0
  73. package/dist/frameworks.d.ts.map +1 -1
  74. package/dist/frameworks.js +5 -1
  75. package/dist/guidance/catalog.d.ts +3 -0
  76. package/dist/guidance/catalog.d.ts.map +1 -0
  77. package/dist/guidance/catalog.js +504 -0
  78. package/dist/guidance/types.d.ts +10 -0
  79. package/dist/guidance/types.d.ts.map +1 -0
  80. package/dist/guidance/types.js +1 -0
  81. package/dist/guidance.d.ts +2 -9
  82. package/dist/guidance.d.ts.map +1 -1
  83. package/dist/guidance.js +1 -502
  84. package/dist/i18n/discovery.d.ts +14 -0
  85. package/dist/i18n/discovery.d.ts.map +1 -0
  86. package/dist/i18n/discovery.js +106 -0
  87. package/dist/i18n/plan.d.ts +12 -0
  88. package/dist/i18n/plan.d.ts.map +1 -0
  89. package/dist/i18n/plan.js +95 -0
  90. package/dist/i18n/setup.d.ts +11 -0
  91. package/dist/i18n/setup.d.ts.map +1 -0
  92. package/dist/i18n/setup.js +47 -0
  93. package/dist/i18n/types.d.ts +17 -0
  94. package/dist/i18n/types.d.ts.map +1 -0
  95. package/dist/i18n/types.js +1 -0
  96. package/dist/index.d.ts +1 -1
  97. package/dist/index.d.ts.map +1 -1
  98. package/dist/index.js +4 -2069
  99. package/dist/ios/assets.d.ts +19 -0
  100. package/dist/ios/assets.d.ts.map +1 -0
  101. package/dist/ios/assets.js +128 -0
  102. package/dist/ios/production-build.d.ts +6 -0
  103. package/dist/ios/production-build.d.ts.map +1 -0
  104. package/dist/ios/production-build.js +200 -0
  105. package/dist/ios/project.d.ts +4 -0
  106. package/dist/ios/project.d.ts.map +1 -0
  107. package/dist/ios/project.js +43 -0
  108. package/dist/ios/simulator-build.d.ts +8 -0
  109. package/dist/ios/simulator-build.d.ts.map +1 -0
  110. package/dist/ios/simulator-build.js +188 -0
  111. package/dist/ios/simulator.d.ts +5 -0
  112. package/dist/ios/simulator.d.ts.map +1 -0
  113. package/dist/ios/simulator.js +60 -0
  114. package/dist/ios/types.d.ts +14 -0
  115. package/dist/ios/types.d.ts.map +1 -0
  116. package/dist/ios/types.js +1 -0
  117. package/dist/ios-build.d.ts +4 -37
  118. package/dist/ios-build.d.ts.map +1 -1
  119. package/dist/ios-build.js +3 -575
  120. package/dist/ios-host.d.ts.map +1 -1
  121. package/dist/ios-toolchain/inspection.d.ts +4 -0
  122. package/dist/ios-toolchain/inspection.d.ts.map +1 -0
  123. package/dist/ios-toolchain/inspection.js +211 -0
  124. package/dist/ios-toolchain/probes.d.ts +24 -0
  125. package/dist/ios-toolchain/probes.d.ts.map +1 -0
  126. package/dist/ios-toolchain/probes.js +127 -0
  127. package/dist/ios-toolchain/types.d.ts +17 -0
  128. package/dist/ios-toolchain/types.d.ts.map +1 -0
  129. package/dist/ios-toolchain/types.js +1 -0
  130. package/dist/ios-toolchain.d.ts +3 -18
  131. package/dist/ios-toolchain.d.ts.map +1 -1
  132. package/dist/ios-toolchain.js +1 -333
  133. package/dist/plugins/contracts.d.ts +28 -0
  134. package/dist/plugins/contracts.d.ts.map +1 -0
  135. package/dist/plugins/contracts.js +1 -0
  136. package/dist/plugins/discovery.d.ts +19 -0
  137. package/dist/plugins/discovery.d.ts.map +1 -0
  138. package/dist/plugins/discovery.js +250 -0
  139. package/dist/plugins/native-operations.d.ts +28 -0
  140. package/dist/plugins/native-operations.d.ts.map +1 -0
  141. package/dist/plugins/native-operations.js +217 -0
  142. package/dist/plugins/operations.d.ts +9 -0
  143. package/dist/plugins/operations.d.ts.map +1 -0
  144. package/dist/plugins/operations.js +76 -0
  145. package/dist/plugins/validation.d.ts +9 -0
  146. package/dist/plugins/validation.d.ts.map +1 -0
  147. package/dist/plugins/validation.js +52 -0
  148. package/dist/plugins.d.ts +3 -34
  149. package/dist/plugins.d.ts.map +1 -1
  150. package/dist/plugins.js +2 -595
  151. package/dist/process-runner.d.ts +4 -0
  152. package/dist/process-runner.d.ts.map +1 -1
  153. package/dist/process-runner.js +14 -0
  154. package/dist/remote.d.ts +22 -1
  155. package/dist/remote.d.ts.map +1 -1
  156. package/dist/remote.js +141 -2
  157. package/dist/rspeedy-app-config.d.ts +4 -0
  158. package/dist/rspeedy-app-config.d.ts.map +1 -0
  159. package/dist/rspeedy-app-config.js +32 -0
  160. package/dist/runtime/args.d.ts +3 -0
  161. package/dist/runtime/args.d.ts.map +1 -0
  162. package/dist/runtime/args.js +11 -0
  163. package/dist/runtime/build-commands.d.ts +3 -0
  164. package/dist/runtime/build-commands.d.ts.map +1 -0
  165. package/dist/runtime/build-commands.js +282 -0
  166. package/dist/runtime/context.d.ts +63 -0
  167. package/dist/runtime/context.d.ts.map +1 -0
  168. package/dist/runtime/context.js +179 -0
  169. package/dist/runtime/early-commands.d.ts +4 -0
  170. package/dist/runtime/early-commands.d.ts.map +1 -0
  171. package/dist/runtime/early-commands.js +284 -0
  172. package/dist/runtime/project.d.ts +8 -0
  173. package/dist/runtime/project.d.ts.map +1 -0
  174. package/dist/runtime/project.js +38 -0
  175. package/dist/runtime/state.d.ts +47 -0
  176. package/dist/runtime/state.d.ts.map +1 -0
  177. package/dist/runtime/state.js +33 -0
  178. package/dist/secure-store/backends.d.ts +20 -0
  179. package/dist/secure-store/backends.d.ts.map +1 -0
  180. package/dist/secure-store/backends.js +248 -0
  181. package/dist/secure-store/types.d.ts +27 -0
  182. package/dist/secure-store/types.d.ts.map +1 -0
  183. package/dist/secure-store/types.js +1 -0
  184. package/dist/secure-store.d.ts +2 -26
  185. package/dist/secure-store.d.ts.map +1 -1
  186. package/dist/secure-store.js +3 -245
  187. package/dist/ui/components.d.ts.map +1 -1
  188. package/dist/ui/components.js +2 -1
  189. package/package.json +7 -4
  190. package/templates/android-host/app/build.gradle +1 -0
  191. package/templates/android-host/app/src/main/java/template/MainActivity.java +98 -3
  192. package/templates/ios-host/__IOS_TARGET_NAME__/DemoLynxProvider.swift +26 -16
  193. package/templates/ios-host/__IOS_TARGET_NAME__/ViewController.swift +107 -19
package/dist/guidance.js CHANGED
@@ -1,505 +1,4 @@
1
- const guidance = {
2
- CLI_PROJECT_REQUIRED: {
3
- commands: ["lynxship init", "lynxship doctor"],
4
- note: "Run them from the project directory or add --project-dir <path>.",
5
- },
6
- CLI_PROJECT_ID_REQUIRED: {
7
- commands: ["lynxship init", "lynxship doctor"],
8
- },
9
- CLI_R2_REQUIRED: {
10
- commands: ["lynxship storage configure", "lynxship doctor"],
11
- },
12
- CLI_R2_ACCOUNT_ID: {
13
- commands: ["lynxship storage configure"],
14
- note: "Use the 32-character Cloudflare account ID.",
15
- },
16
- CLI_R2_BUCKET: {
17
- commands: ["lynxship storage configure"],
18
- note: "Use a lowercase R2 bucket name with no spaces or underscores.",
19
- },
20
- CLI_R2_ENDPOINT: {
21
- commands: ["lynxship storage configure"],
22
- note: "Use the HTTPS S3 endpoint for the same Cloudflare account.",
23
- },
24
- CLI_R2_EXPIRY: {
25
- commands: ["lynxship storage configure"],
26
- note: "Choose a download lifetime between 1 second and 7 days.",
27
- },
28
- CLI_R2_CREDENTIALS: {
29
- commands: ["lynxship storage configure", "lynxship doctor"],
30
- },
31
- BUILD_SIGNING_REQUIRED: {
32
- commands: [
33
- "lynxship android configure",
34
- "lynxship doctor --platform android",
35
- ],
36
- note: "An existing .jks/.keystore is supported; production builds need a real release key.",
37
- },
38
- LYNXSHIP_KEYSTORE_PATH: {
39
- commands: ["lynxship android configure"],
40
- },
41
- LYNXSHIP_KEY_ALIAS: {
42
- commands: ["lynxship android configure"],
43
- },
44
- LYNXSHIP_KEYSTORE_PASSWORD: {
45
- commands: ["lynxship android configure"],
46
- },
47
- LYNXSHIP_KEY_PASSWORD: {
48
- commands: ["lynxship android configure"],
49
- },
50
- ANDROID_HOST_REQUIRED: {
51
- commands: [
52
- "lynxship dev",
53
- "lynxship android host init --application-id com.example.myapp",
54
- "lynxship build --platform android --application-id com.example.myapp --profile production",
55
- "lynxship doctor --platform android",
56
- ],
57
- note: "Interactive build creates a missing android/ host after asking for the application ID. CI must pass --application-id. Existing android/ directories are never overwritten.",
58
- },
59
- ANDROID_HOST_EXISTS: {
60
- commands: ["lynxship doctor --platform android"],
61
- note: "Review the existing android/ host instead of overwriting it.",
62
- },
63
- ANDROID_APPLICATION_ID_INVALID: {
64
- commands: ["lynxship android host init --application-id com.example.myapp"],
65
- note: "Use a reverse-domain Android application ID, for example com.company.app.",
66
- },
67
- ANDROID_PLATFORM_UNSUPPORTED: {
68
- commands: ["lynxship doctor --platform android"],
69
- note: "Android builds run on Windows, macOS or Linux. Use macOS for iOS builds.",
70
- },
71
- BUILD_ALL_MACOS_REQUIRED: {
72
- commands: [
73
- "lynxship build --platform android --profile production",
74
- "lynxship build --platform all --profile production --no-upload",
75
- ],
76
- note: "Run the all-platform command on a macOS machine or macOS CI worker; the second command is for CI verification.",
77
- },
78
- ANDROID_APKSIGNER_REQUIRED: {
79
- commands: [
80
- "lynxship doctor --platform android",
81
- 'sdkmanager "build-tools;latest"',
82
- ],
83
- note: "Ensure Android SDK Build Tools are installed and available through ANDROID_HOME or ANDROID_SDK_ROOT.",
84
- },
85
- ANDROID_JARSIGNER_REQUIRED: {
86
- commands: ["lynxship doctor --platform android", "java -version"],
87
- note: "Install JDK 17 or newer and make sure jarsigner is on PATH.",
88
- },
89
- ANDROID_ADB_REQUIRED: {
90
- commands: ["lynxship doctor --platform android", "adb devices"],
91
- note: "Install Android SDK Platform-Tools and connect or start a device.",
92
- },
93
- ANDROID_TOOLCHAIN_REQUIRED: {
94
- commands: [
95
- "lynxship doctor --platform android",
96
- "lynxship doctor --platform android --fix",
97
- "lynxship build --platform android --profile production",
98
- ],
99
- note: "The doctor detects the project AGP/Gradle contract and the required JDK, Android SDK packages and Build Tools. --fix installs only missing SDK packages after confirmation.",
100
- },
101
- WEB_CONFIGURATION_REQUIRED: {
102
- commands: [
103
- "lynxship doctor --platform web",
104
- "lynxship build --platform web --profile production",
105
- ],
106
- note: "Configure environments.web in lynx.config.* or provide the project's build:web script.",
107
- },
108
- BUILD_MISO_NIX_REQUIRED: {
109
- commands: [
110
- "lynxship doctor --platform android",
111
- "nix --version",
112
- "lynxship build --platform android --profile production",
113
- ],
114
- note: "Install Nix and use the project's flake to build the Miso Lynx bundle.",
115
- },
116
- BUILD_MISO_ATTRIBUTE_REQUIRED: {
117
- commands: [
118
- "lynxship init",
119
- "lynxship build --platform android --profile production",
120
- ],
121
- note: "Expose a default/mkLynxBundle output or set build.production.miso.attribute to the Nix flake output that creates main.lynx.bundle.",
122
- },
123
- BUILD_MISO_BUNDLE_MISSING: {
124
- commands: [
125
- "nix build",
126
- "lynxship build --platform android --profile production",
127
- ],
128
- note: "Check build.production.miso.artifact and the output produced by the Miso flake.",
129
- },
130
- BUILD_MISO_MICROHS_ADAPTER_REQUIRED: {
131
- commands: [
132
- "lynxship doctor --platform android",
133
- "lynxship inspect",
134
- "lynxship build --platform android --profile production",
135
- ],
136
- note: "MicroHs is opt-in and is not a drop-in GHCJS replacement. Configure build.<profile>.miso.microhs with a pinned binary or manifest and a real adapter command, or set build.<profile>.miso.compiler to ghcjs.",
137
- },
138
- BUILD_MISO_MICROHS_ADAPTER_FAILED: {
139
- commands: [
140
- "lynxship doctor --platform android --profile production",
141
- "lynxship inspect",
142
- "lynxship build --platform android --profile production",
143
- ],
144
- note: "The real adapter or MicroHs compiler rejected the Miso source or failed to write the Lynx bundle. This does not prove Miso/MicroHs compatibility; use the official GHC/Nix workflow until the adapter supports the project's language extensions, packages, FFI and bundle output.",
145
- },
146
- BUILD_MISO_ARTIFACT_OUTSIDE_PROJECT: {
147
- commands: ["lynxship inspect", "lynxship doctor --platform android"],
148
- note: "Set build.<profile>.miso.artifact to a file inside the project, such as result/main.lynx.bundle.",
149
- },
150
- BUILD_MISO_BUNDLE_INVALID: {
151
- commands: [
152
- "lynxship inspect",
153
- "lynxship build --platform android --profile production",
154
- ],
155
- note: "The configured Miso artifact must be a non-empty file produced by the adapter.",
156
- },
157
- MICROHS_MANIFEST_REQUIRED: {
158
- commands: [
159
- "lynxship doctor --platform android",
160
- "lynxship inspect",
161
- "lynxship build --platform android --profile production",
162
- ],
163
- note: "Provide build.<profile>.miso.microhs.binary for an existing verified mhs binary, or provide a pinned manifest/manifestUrl. LynxShip never downloads an unpinned compiler.",
164
- },
165
- MICROHS_HOST_UNSUPPORTED: {
166
- commands: ["lynxship doctor --platform android", "lynxship inspect"],
167
- note: "Use a verified MicroHs host binary for darwin-arm64, darwin-x64, linux-arm64, linux-x64 or win32-x64, or select the official ghcjs workflow.",
168
- },
169
- MICROHS_ARTIFACT_UNAVAILABLE: {
170
- commands: ["lynxship doctor --platform android", "lynxship inspect"],
171
- note: "Publish or select a manifest artifact for the current host architecture. The compiler host architecture is independent from the Android/iOS packaging target.",
172
- },
173
- MICROHS_BINARY_MISSING: {
174
- commands: ["lynxship doctor --platform android", "lynxship inspect"],
175
- note: "The configured MicroHs binary does not exist. Fix build.<profile>.miso.microhs.binary or use a pinned manifest.",
176
- },
177
- MICROHS_VERSION_MISMATCH: {
178
- commands: ["lynxship inspect", "lynxship doctor --platform android"],
179
- note: "The requested MicroHs version does not match the pinned manifest. Keep compiler and adapter versions aligned.",
180
- },
181
- MICROHS_MANIFEST_INVALID: {
182
- commands: ["lynxship inspect", "lynxship doctor --platform android"],
183
- note: "The MicroHs manifest is invalid. It must declare schemaVersion 1, a source commit and SHA-256-pinned artifacts.",
184
- },
185
- MICROHS_MANIFEST_READ_FAILED: {
186
- commands: ["lynxship inspect", "lynxship doctor --platform android"],
187
- note: "Check the configured local MicroHs manifest path and permissions.",
188
- },
189
- MICROHS_MANIFEST_FETCH_FAILED: {
190
- commands: ["lynxship inspect", "lynxship doctor --platform android"],
191
- note: "Check the pinned MicroHs manifest URL and network access. LynxShip does not silently fall back to an unverified download.",
192
- },
193
- MICROHS_HASH_MISMATCH: {
194
- commands: ["lynxship inspect", "lynxship doctor --platform android"],
195
- note: "The downloaded compiler did not match its pinned SHA-256. Do not reuse the cache; verify the release manifest and artifact source.",
196
- },
197
- MICROHS_SIGNATURE_INVALID: {
198
- commands: ["lynxship inspect", "lynxship doctor --platform android"],
199
- note: "The MicroHs artifact signature did not verify. Check the pinned release public key and manifest; the binary was rejected.",
200
- },
201
- MICROHS_SIGNATURE_KEY_REQUIRED: {
202
- commands: ["lynxship inspect", "lynxship doctor --platform android"],
203
- note: "The manifest declares a signed MicroHs artifact. Configure the pinned public key before using it.",
204
- },
205
- WEB_BUNDLE_MISSING: {
206
- commands: [
207
- "lynxship doctor --platform web",
208
- "lynxship build --platform web --profile production",
209
- ],
210
- note: "The official Web output is dist/*.web.bundle; check the Rspeedy Web environment and artifact path.",
211
- },
212
- HARMONY_HOST_REQUIRED: {
213
- commands: [
214
- "lynxship doctor --platform harmony",
215
- "lynxship build --platform harmony --profile production",
216
- ],
217
- note: "Use the official Lynx Harmony host; LynxShip does not invent a fake HAP host.",
218
- },
219
- HARMONY_TOOLCHAIN_REQUIRED: {
220
- commands: [
221
- "lynxship doctor --platform harmony",
222
- "lynxship build --platform harmony --profile production",
223
- ],
224
- note: "Install the DevEco/OpenHarmony SDK, expose ohpm and use the host's pinned hvigorw wrapper.",
225
- },
226
- HARMONY_SIGN_TOOL_REQUIRED: {
227
- commands: [
228
- "lynxship doctor --platform harmony",
229
- "lynxship build --platform harmony --profile production",
230
- ],
231
- note: "Set LYNXSHIP_HAP_SIGN_TOOL to the official hap-sign-tool.jar or configure build.<profile>.harmony.signTool.",
232
- },
233
- HARMONY_HDC_REQUIRED: {
234
- commands: [
235
- "lynxship doctor --platform harmony",
236
- "lynxship run --platform harmony --device <device-id>",
237
- "lynxship logs --platform harmony --device <device-id>",
238
- ],
239
- note: "Install the OpenHarmony SDK platform tools and make hdc available on PATH.",
240
- },
241
- DESKTOP_HOST_REQUIRED: {
242
- commands: [
243
- "lynxship doctor --platform desktop",
244
- "lynxship build --platform desktop --profile production",
245
- ],
246
- note: "Use the official Lynxtron host and its electron-builder configuration or pack script.",
247
- },
248
- DESKTOP_ARTIFACT_MISSING: {
249
- commands: [
250
- "lynxship doctor --platform desktop",
251
- "lynxship build --platform desktop --profile production",
252
- ],
253
- note: "Configure the Lynxtron pack script and set build.<profile>.desktop.artifact when output is not unique.",
254
- },
255
- DESKTOP_SIGNING_REQUIRED: {
256
- commands: [
257
- "lynxship doctor --platform desktop",
258
- "lynxship build --platform desktop --profile production",
259
- "lynxship build --platform desktop --profile production --no-upload --allow-unsigned",
260
- ],
261
- note: "Production and uploaded Desktop artifacts must pass Windows Authenticode or Apple code-signature verification. Use --allow-unsigned only for local packaging tests together with --no-upload; it can never publish an unsigned artifact.",
262
- },
263
- TARGET_RUN_UNSUPPORTED: {
264
- commands: [
265
- "lynxship preview",
266
- "lynxship run --platform android --artifact <apk>",
267
- "lynxship run --platform harmony --artifact <hap>",
268
- ],
269
- note: "Web and desktop artifacts use their target runtime or operating-system installer; only device targets are installed by this command.",
270
- },
271
- TARGET_LOGS_UNSUPPORTED: {
272
- commands: [
273
- "lynxship dev",
274
- "lynxship logs --platform android",
275
- "lynxship logs --platform harmony",
276
- ],
277
- note: "Web and desktop logs come from their runtime tooling; LynxShip streams native device logs only.",
278
- },
279
- CLI_DOCTOR_FIX_PLATFORM: {
280
- commands: ["lynxship doctor --platform android --fix"],
281
- note: "The guided repair currently installs Android SDK packages only; JDK and Android Studio remain explicit developer installations.",
282
- },
283
- LYNX_BUNDLE_MISSING: {
284
- commands: ["lynxship dev", "lynxship build --platform android"],
285
- note: "Build the Lynx bundle with the project's configured package manager.",
286
- },
287
- IOS_HOST_REQUIRED: {
288
- commands: [
289
- "lynxship dev",
290
- "lynxship ios host init --bundle-identifier com.example.myapp",
291
- "lynxship build --platform ios --bundle-identifier com.example.myapp --profile production",
292
- "lynxship doctor --platform ios",
293
- ],
294
- note: "Interactive build creates a missing ios/ host after asking for the bundle identifier. CI must pass --bundle-identifier. Existing ios/ directories are never overwritten.",
295
- },
296
- IOS_HOST_EXISTS: {
297
- commands: ["lynxship doctor --platform ios"],
298
- note: "Review the existing ios/ host instead of overwriting it.",
299
- },
300
- IOS_BUNDLE_IDENTIFIER_INVALID: {
301
- commands: ["lynxship ios host init --bundle-identifier com.example.myapp"],
302
- note: "Use a reverse-domain bundle identifier, for example com.company.app.",
303
- },
304
- IOS_MACOS_REQUIRED: {
305
- commands: ["lynxship doctor --platform ios"],
306
- note: "Run real iOS commands on macOS. Windows and Linux cannot produce an IPA.",
307
- },
308
- IOS_XCODE_REQUIRED: {
309
- commands: ["xcode-select --install", "lynxship doctor --platform ios"],
310
- note: "Install Xcode from the Mac App Store and select its command-line tools.",
311
- },
312
- IOS_XCRUN_REQUIRED: {
313
- commands: ["xcode-select --install", "lynxship doctor --platform ios"],
314
- },
315
- IOS_TOOLCHAIN_REQUIRED: {
316
- commands: [
317
- "lynxship doctor --platform ios",
318
- "lynxship ios host init --bundle-identifier com.example.myapp",
319
- "lynxship build --platform ios --profile production",
320
- ],
321
- note: "The iOS doctor checks macOS, Xcode, xcrun, CocoaPods, Xcode settings, Apple signing identities, provisioning and export options without printing certificate contents.",
322
- },
323
- IOS_SIMULATOR_PLATFORM: {
324
- commands: [
325
- "lynxship doctor --platform ios --profile simulator",
326
- "lynxship build --platform ios --simulator --profile simulator --no-upload",
327
- ],
328
- note: "The iOS Simulator target is selected with --platform ios; Android, Web and Desktop targets cannot use this flag.",
329
- },
330
- IOS_SIMULATOR_RUNTIME_REQUIRED: {
331
- commands: [
332
- "xcode-select --install",
333
- "lynxship doctor --platform ios --profile simulator",
334
- "lynxship build --platform ios --simulator --profile simulator --no-upload",
335
- ],
336
- note: "Install an iOS Simulator runtime in Xcode > Settings > Components, then rerun the doctor.",
337
- },
338
- IOS_SIMULATOR_ARTIFACT_MISSING: {
339
- commands: [
340
- "lynxship doctor --platform ios --profile simulator",
341
- "lynxship build --platform ios --simulator --profile simulator --no-upload",
342
- ],
343
- note: "The simulator build must produce an .app under DerivedData before it can be installed.",
344
- },
345
- IOS_SIMULATOR_UPLOAD_BLOCKED: {
346
- commands: [
347
- "lynxship build --platform ios --simulator --profile simulator --no-upload",
348
- "lynxship build --platform ios --profile production",
349
- ],
350
- note: "Simulator .app artifacts stay local; use a signed production device build for R2 upload and distribution.",
351
- },
352
- IOS_COCOAPODS_REQUIRED: {
353
- commands: [
354
- "brew install cocoapods",
355
- "cd ios && pod install --repo-update",
356
- "lynxship doctor --platform ios --profile simulator",
357
- "lynxship build --platform ios --simulator --profile simulator --no-upload",
358
- ],
359
- note: "CocoaPods is required when the iOS host contains a Podfile. The first install refreshes the CocoaPods specs repository.",
360
- },
361
- IOS_PROJECT_REQUIRED: {
362
- commands: [
363
- "lynxship ios host init --bundle-identifier com.example.myapp",
364
- "lynxship doctor --platform ios",
365
- ],
366
- },
367
- IOS_SCHEME_REQUIRED: {
368
- commands: [
369
- "lynxship inspect",
370
- "lynxship doctor --platform ios --profile simulator",
371
- "lynxship doctor --platform ios --profile production",
372
- ],
373
- note: "Set build.<profile>.ios.scheme in lynxship.json.",
374
- },
375
- IOS_EXPORT_OPTIONS_REQUIRED: {
376
- commands: [
377
- "lynxship ios host init --bundle-identifier com.example.myapp",
378
- "lynxship doctor --platform ios",
379
- "lynxship build --platform ios --simulator --profile simulator --no-upload",
380
- ],
381
- note: "Set build.<profile>.ios.exportOptionsPlist for a device IPA; simulator .app builds do not require export options.",
382
- },
383
- IOS_DEVICE_REQUIRED: {
384
- commands: [
385
- "xcrun devicectl list devices",
386
- "lynxship run --platform ios --device <device-id>",
387
- ],
388
- },
389
- IOS_DEVICE_LOGS_UNSUPPORTED: {
390
- commands: [
391
- "xcrun simctl list devices",
392
- "lynxship logs --platform ios --device <simulator-id>",
393
- ],
394
- },
395
- DEVICE_ARTIFACT_REQUIRED: {
396
- commands: [
397
- "lynxship build --platform android --profile production",
398
- "lynxship run --platform android --artifact <path-to-apk>",
399
- ],
400
- },
401
- LYNX_CODEGEN_SCRIPT_REQUIRED: {
402
- commands: [
403
- "lynxship autolink check --platform android",
404
- "lynxship autolink codegen --library-dir <native-library>",
405
- ],
406
- note: "The native library must expose its official codegen script.",
407
- },
408
- LYNX_AUTOLINK_ANDROID_REQUIRED: {
409
- commands: [
410
- "lynxship autolink check --platform android",
411
- "lynxship autolink codegen --library-dir <native-library>",
412
- ],
413
- },
414
- LYNX_AUTOLINK_IOS_REQUIRED: {
415
- commands: [
416
- "lynxship autolink check --platform ios",
417
- "lynxship autolink codegen --library-dir <native-library>",
418
- ],
419
- },
420
- OTA_HOST_INTEGRATION_REQUIRED: {
421
- commands: [
422
- "lynxship ota doctor --platform android",
423
- "lynxship ota doctor --platform ios",
424
- ],
425
- note: "Integrate the LynxShip OTA client in the native host before publishing updates.",
426
- },
427
- OTA_NATIVE_CHANGE_REQUIRED: {
428
- commands: [
429
- "lynxship ota doctor --platform android",
430
- "lynxship build --platform android --profile production",
431
- "lynxship update --platform android --bundle dist/main.lynx.bundle",
432
- ],
433
- note: "Native changes require a new compatible binary before an OTA release.",
434
- },
435
- OTA_BUNDLE_REQUIRED: {
436
- commands: [
437
- "lynxship build --platform android --profile production",
438
- "lynxship update --platform android --bundle dist/main.lynx.bundle",
439
- ],
440
- },
441
- BUILD_REQUIRED: {
442
- commands: ["lynxship build --platform android --profile production"],
443
- },
444
- STORE_ARTIFACT_REQUIRED: {
445
- commands: [
446
- "lynxship build --platform android --profile production",
447
- "lynxship submit --platform android --latest",
448
- ],
449
- },
450
- STORE_SUBMISSION_REQUIRED: {
451
- commands: [
452
- "lynxship store configure --platform android",
453
- "lynxship submit --platform android --latest",
454
- ],
455
- },
456
- RELEASE_NOT_FOUND: {
457
- commands: [
458
- "lynxship update --platform android",
459
- "lynxship update rollback --help",
460
- ],
461
- },
462
- ROLLBACK_RELEASE_REQUIRED: {
463
- commands: [
464
- 'lynxship update rollback --platform android --release-id <release-id> --reason "reason"',
465
- ],
466
- },
467
- ROLLBACK_REASON_REQUIRED: {
468
- commands: [
469
- 'lynxship update rollback --platform android --release-id <release-id> --reason "reason"',
470
- ],
471
- },
472
- CLI_INTERACTIVE_REQUIRED: {
473
- commands: ["lynxship <command>"],
474
- note: "Run without --non-interactive, or provide the documented CI environment variables.",
475
- },
476
- PROFILE_NOT_FOUND: {
477
- commands: ["lynxship inspect", "lynxship build --profile production"],
478
- note: "Use a profile declared under build in lynxship.json.",
479
- },
480
- PLATFORM_INVALID: {
481
- commands: [
482
- "lynxship build --platform android",
483
- "lynxship build --platform ios",
484
- "lynxship build --platform all",
485
- ],
486
- },
487
- IOS_SIGNATURE_INVALID: {
488
- commands: [
489
- "lynxship doctor --platform ios",
490
- "lynxship build --platform ios --profile production",
491
- ],
492
- note: "Check the Apple certificate, provisioning profile, team and export options.",
493
- },
494
- CLI_DEVTOOL_COMMAND: {
495
- commands: [
496
- "lynxship devtool doctor --platform android",
497
- "lynxship trace doctor --platform android",
498
- "lynxship recorder doctor --platform android",
499
- ],
500
- note: "Lynx Trace and Recorder are operated from Lynx DevTool Desktop after the native -dev runtime is integrated.",
501
- },
502
- };
1
+ import { guidance } from "./guidance/catalog.js";
503
2
  function guidanceForErrorBase(error) {
504
3
  const code = error.code;
505
4
  if (typeof code === "string" && guidance[code])
@@ -0,0 +1,14 @@
1
+ import type { IntlCapability } from "@lynxship/i18n";
2
+ interface ProjectPackageJson {
3
+ readonly main?: unknown;
4
+ readonly source?: unknown;
5
+ readonly dependencies?: Record<string, string>;
6
+ readonly devDependencies?: Record<string, string>;
7
+ }
8
+ export declare function readProjectPackage(root: string): Promise<ProjectPackageJson>;
9
+ export declare function resolveEntryFile(root: string, requested?: string): Promise<string>;
10
+ export declare function discoverLocales(root: string): Promise<string[]>;
11
+ export declare function discoverIntlCapabilities(root: string): Promise<IntlCapability[]>;
12
+ export declare function projectRelative(root: string, file: string): string;
13
+ export {};
14
+ //# sourceMappingURL=discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/i18n/discovery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrD,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnD;AAyBD,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,kBAAkB,CAAC,CAU7B;AAED,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAsCjB;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAYrE;AAED,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,cAAc,EAAE,CAAC,CAU3B;AAiBD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAElE"}
@@ -0,0 +1,106 @@
1
+ import { readdir, readFile } from "node:fs/promises";
2
+ import { basename, extname, join, relative, resolve } from "node:path";
3
+ import { exists } from "../runtime/project.js";
4
+ const ENTRY_CANDIDATES = [
5
+ "src/index.tsx",
6
+ "src/index.ts",
7
+ "src/main.tsx",
8
+ "src/main.ts",
9
+ "index.tsx",
10
+ "index.ts",
11
+ ];
12
+ const SOURCE_EXTENSIONS = new Set([".ts", ".tsx", ".js", ".jsx", ".mjs"]);
13
+ const CAPABILITY_PATTERNS = [
14
+ ["NumberFormat", /\bIntl\s*\.\s*NumberFormat\b/],
15
+ ["DateTimeFormat", /\bIntl\s*\.\s*DateTimeFormat\b/],
16
+ ["RelativeTimeFormat", /\bIntl\s*\.\s*RelativeTimeFormat\b/],
17
+ ["ListFormat", /\bIntl\s*\.\s*ListFormat\b/],
18
+ ["DisplayNames", /\bIntl\s*\.\s*DisplayNames\b/],
19
+ ["Locale", /\bIntl\s*\.\s*Locale\b/],
20
+ ["getCanonicalLocales", /\bIntl\s*\.\s*getCanonicalLocales\b/],
21
+ ["Segmenter", /\bIntl\s*\.\s*Segmenter\b/],
22
+ ["DurationFormat", /\bIntl\s*\.\s*DurationFormat\b/],
23
+ ];
24
+ export async function readProjectPackage(root) {
25
+ try {
26
+ return JSON.parse(await readFile(join(root, "package.json"), "utf8"));
27
+ }
28
+ catch (error) {
29
+ if (error.code === "ENOENT")
30
+ throw new Error(`No package.json found in ${root}`);
31
+ throw new Error(`Invalid package.json in ${root}`);
32
+ }
33
+ }
34
+ export async function resolveEntryFile(root, requested) {
35
+ if (requested) {
36
+ const file = resolve(root, requested);
37
+ if (await exists(file))
38
+ return file;
39
+ throw new Error(`The requested i18n entry file does not exist: ${requested}`);
40
+ }
41
+ const packageJson = await readProjectPackage(root);
42
+ if (typeof packageJson.source === "string") {
43
+ const source = resolve(root, packageJson.source);
44
+ if (await exists(source))
45
+ return source;
46
+ }
47
+ const conventional = await Promise.all(ENTRY_CANDIDATES.map(async (candidate) => (await exists(resolve(root, candidate))) ? candidate : undefined));
48
+ const existing = conventional.filter((candidate) => candidate !== undefined);
49
+ const first = existing[0];
50
+ if (existing.length === 1 && first)
51
+ return resolve(root, first);
52
+ if (existing.length > 1)
53
+ throw new Error(`Multiple conventional Lynx entry files were found (${existing.join(", ")}). Pass --entry to choose one.`);
54
+ if (typeof packageJson.main === "string" &&
55
+ SOURCE_EXTENSIONS.has(extname(packageJson.main))) {
56
+ const main = resolve(root, packageJson.main);
57
+ if (await exists(main))
58
+ return main;
59
+ }
60
+ throw new Error("Could not find the Lynx entry file. Pass `--entry src/index.tsx` to lynxship i18n setup.");
61
+ }
62
+ export async function discoverLocales(root) {
63
+ const directories = [join(root, "src", "locales"), join(root, "locales")];
64
+ for (const directory of directories) {
65
+ if (!(await exists(directory)))
66
+ continue;
67
+ const files = await readdir(directory, { withFileTypes: true });
68
+ const locales = files
69
+ .filter((file) => file.isFile() && extname(file.name) === ".json")
70
+ .map((file) => basename(file.name, ".json"))
71
+ .filter((locale) => /^[A-Za-z0-9]+(?:[-_][A-Za-z0-9]+)*$/.test(locale));
72
+ if (locales.length > 0)
73
+ return [...new Set(locales)].sort();
74
+ }
75
+ return ["en"];
76
+ }
77
+ export async function discoverIntlCapabilities(root) {
78
+ const files = await sourceFiles(root);
79
+ const contents = await Promise.all(files.map((file) => readFile(file, "utf8").catch(() => "")));
80
+ const capabilities = new Set(["PluralRules"]);
81
+ for (const [capability, pattern] of CAPABILITY_PATTERNS)
82
+ if (contents.some((content) => pattern.test(content)))
83
+ capabilities.add(capability);
84
+ return [...capabilities];
85
+ }
86
+ async function sourceFiles(root) {
87
+ const result = [];
88
+ const visit = async (directory) => {
89
+ if (!(await exists(directory)))
90
+ return;
91
+ for (const entry of await readdir(directory, { withFileTypes: true })) {
92
+ if (entry.name === "node_modules" || entry.name === "dist")
93
+ continue;
94
+ const file = join(directory, entry.name);
95
+ if (entry.isDirectory())
96
+ await visit(file);
97
+ else if (SOURCE_EXTENSIONS.has(extname(entry.name)))
98
+ result.push(file);
99
+ }
100
+ };
101
+ await visit(join(root, "src"));
102
+ return result;
103
+ }
104
+ export function projectRelative(root, file) {
105
+ return relative(root, file).replaceAll("\\", "/");
106
+ }
@@ -0,0 +1,12 @@
1
+ import { type IntlCapability } from "@lynxship/i18n";
2
+ import type { I18nSetupPlan } from "./types.js";
3
+ export declare function createI18nSetupPlan(options: {
4
+ root: string;
5
+ entry?: string;
6
+ capabilities?: readonly IntlCapability[];
7
+ locales?: readonly string[];
8
+ persistence: boolean;
9
+ }): Promise<I18nSetupPlan>;
10
+ export declare function renderPolyfillSource(plan: I18nSetupPlan): string;
11
+ export declare function entryImportPath(plan: I18nSetupPlan): string;
12
+ //# sourceMappingURL=plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/i18n/plan.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA0BhD,wBAAsB,mBAAmB,CAAC,OAAO,EAAE;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IACzC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,WAAW,EAAE,OAAO,CAAC;CACtB,GAAG,OAAO,CAAC,aAAa,CAAC,CA2CzB;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAgBhE;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAM3D"}