Skip to content

Commit 4e95021

Browse files
committed
update docs
1 parent e1ecf00 commit 4e95021

File tree

5 files changed

+116
-65
lines changed

5 files changed

+116
-65
lines changed

packages/cli/src/lib/plugins/clean.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ const CLEANUP_TASK_NAMES = [
3939
'bun',
4040
'pnpm',
4141
'rock',
42-
'harmony',
4342
] as const;
4443

4544
/**

packages/platform-harmony/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# @rock-js/platform-harmony
22

3-
Android platform integration for Rock. This package is part of the Rock ecosystem and provides Android-specific build and development tools.
3+
HarmonyOS Next platform integration for Rock. This package is part of the Rock ecosystem and provides HarmonyOS-specific build and development tools.
44

55
## Documentation
66

packages/platform-harmony/src/lib/commands/build/buildHarmony.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
getBinaryPath,
77
logger,
88
outro,
9-
parseArgs,
109
relativeToCwd,
1110
} from '@rock-js/tools';
1211
import { findOutputFile } from '../run/findOutputFile.js';
@@ -16,7 +15,6 @@ export interface BuildFlags {
1615
buildMode: string;
1716
module: string;
1817
product: string;
19-
extraParams?: Array<string>;
2018
local?: boolean;
2119
}
2220

@@ -79,15 +77,6 @@ export async function buildHarmony(
7977
}
8078

8179
export const options = [
82-
{
83-
name: '--variant <string>',
84-
description: `Specify your app's build variant, which is constructed from build type and product flavor, e.g. "debug" or "freeRelease".`,
85-
},
86-
{
87-
name: '--extra-params <string>',
88-
description: 'Custom params passed to gradle build command',
89-
parse: parseArgs,
90-
},
9180
{
9281
name: '--local',
9382
description: 'Force local build with Gradle wrapper.',

website/src/docs/cli/introduction.md

Lines changed: 114 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -134,57 +134,7 @@ Platform plugins are configured through the [`platform`](/docs/configuration/ind
134134
| `build:harmony` | Builds HarmonyOS app for emulator or device |
135135
| `run:harmony` | Runs HarmonyOS app on device |
136136

137-
## Command Options
138-
139-
### `rock start` Options
140-
141-
The `start` command launches a development server (either Re.Pack or Metro, depending on your bundler plugin) that connects to your apps through port 8081 by default. It provides features like Hot Module Reloading (HMR) and error reporting.
142-
143-
| Option | Description |
144-
| :------------------------------------------------ | :------------------------------------------------------------------------------------------ |
145-
| `--port <number>` | Port to run the server on (default: 8081) |
146-
| `--host <string>` | Host to run the server on (default: "") |
147-
| `--project-root <path>`, `--projectRoot <path>` | Path to a custom project root |
148-
| `--watch-folders <list>`, `--watchFolders <list>` | Specify any additional folders to be added to the watch list |
149-
| `--asset-plugins <list>`, `--assetPlugins <list>` | Specify any additional asset plugins to be used by the packager by full filepath |
150-
| `--source-exts <list>`,`--sourceExts <list>` | Specify any additional source extensions to be used by the packager |
151-
| `--max-workers <number>` | Specifies the maximum number of workers the worker-pool will spawn for transforming files |
152-
| `--transformer <string>` | Specify a custom transformer to be used |
153-
| `--reset-cache`, `--resetCache` | Removes cached files |
154-
| `--custom-log-reporter-path <string>` | Path to a JavaScript file that exports a log reporter as a replacement for TerminalReporter |
155-
| `--https` | Enables https connections to the server |
156-
| `--key <path>` | Path to custom SSL key |
157-
| `--cert <path>` | Path to custom SSL cert |
158-
| `--config <string>` | Path to the CLI configuration file |
159-
| `--no-interactive` | Disables interactive mode |
160-
| `--client-logs` | [Deprecated] Enable plain text JavaScript log streaming for all connected apps |
161-
162-
### `rock bundle` Options
163-
164-
The `bundle` command creates an optimized JavaScript bundle for your application, optionally using Hermes bytecode.
165-
166-
| Option | Description |
167-
| :-------------------------------------- | :--------------------------------------------------------------------------------------------------- |
168-
| `--entry-file <path>` | Path to the root JS file, either absolute or relative to JS root |
169-
| `--platform <string>` | Either "ios", "android", or "harmony" (default: "ios") |
170-
| `--transformer <string>` | Specify a custom transformer to be used |
171-
| `--dev [boolean]` | If false, warnings are disabled and the bundle is minified (default: true) |
172-
| `--minify [boolean]` | Allows overriding whether bundle is minified. Defaults to false if dev is true, true if dev is false |
173-
| `--bundle-output <string>` | File name where to store the resulting bundle, ex. /tmp/groups.bundle |
174-
| `--bundle-encoding <string>` | Encoding the bundle should be written in (default: "utf8") |
175-
| `--max-workers <number>` | Specifies the maximum number of workers the worker-pool will spawn for transforming files |
176-
| `--sourcemap-output <string>` | File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map |
177-
| `--sourcemap-sources-root <string>` | Path to make sourcemap's sources entries relative to, ex. /root/dir |
178-
| `--sourcemap-use-absolute-path` | Report SourceMapURL using its full path (default: false) |
179-
| `--assets-dest <string>` | Directory name where to store assets referenced in the bundle |
180-
| `--unstable-transform-profile <string>` | Experimental, transform JS for a specific JS engine (default: "default") |
181-
| `--asset-catalog-dest [string]` | Path where to create an iOS Asset Catalog for images |
182-
| `--reset-cache` | Removes cached files (default: false) |
183-
| `--read-global-cache` | Try to fetch transformed JS code from the global cache, if configured (default: false) |
184-
| `--config <string>` | Path to the CLI configuration file |
185-
| `--resolver-option <string...>` | Custom resolver options of the form key=value. URL-encoded. May be specified multiple times |
186-
| `--config-cmd [string]` | [Internal] A hack for Xcode build script pointing to wrong bundle command |
187-
| `--hermes` | Passes the output JS bundle to Hermes compiler and outputs a bytecode file |
137+
## Platform iOS
188138

189139
### `rock build:ios` Options
190140

@@ -259,6 +209,8 @@ The `sign:ios` command either signs your iOS app with certificates and provision
259209
| `--jsbundle <string>` | Path to JS bundle to apply before signing |
260210
| `--no-hermes` | Don't use Hermes for JS bundle |
261211

212+
## Platform Android
213+
262214
### `rock build:android` Options
263215

264216
The `build:android` command builds your Android app for emulators, devices, or distribution, producing either APK or AAB files. It follows this build strategy:
@@ -307,6 +259,115 @@ The `sign:android <binaryPath>` command signs your Android app with a keystore,
307259
| `--jsbundle <string>` | Path to JS bundle to apply before signing |
308260
| `--no-hermes` | Don't use Hermes for JS bundle |
309261

262+
## Platform HarmonyOS (experimental)
263+
264+
### `rock build:harmony` Options
265+
266+
The `build:harmony` command builds your HarmonyOS app for emulators or devices, producing HAP files. It follows this build strategy:
267+
268+
1. Build locally if `--local` flag is set
269+
1. Otherwise, try to use a cached build from cache (in `.rock` folder)
270+
271+
The build cache is populated by a local build only for now (remote cache is not supported yet).
272+
273+
| Option | Description |
274+
| :---------------------- | :---------------------------- |
275+
| `--build-mode <string>` | Build mode (debug/release) |
276+
| `--module <string>` | Module to build |
277+
| `--product <string>` | Product to build |
278+
| `--local` | Force local build with Hvigor |
279+
280+
### `rock run:harmony` Options
281+
282+
The `run:harmony` command runs your HarmonyOS app on an emulator or device. It extends the functionality of `build:harmony` with additional runtime options.
283+
284+
Same as for `build:harmony` and:
285+
286+
| Option | Description |
287+
| :----------------------- | :------------------------------------- |
288+
| `--port <number>` | Bundler port (default: 8081) |
289+
| `--build-mode <string>` | Build mode (debug/release) |
290+
| `--product <string>` | Product to build |
291+
| `--binary-path <string>` | Path to pre-built HAP binary |
292+
| `--device <string>` | Device/emulator to use (by name or ID) |
293+
| `--local` | Force local build with Hvigor |
294+
| `--ability <string>` | Name of the ability to start |
295+
296+
## Plugin Bundler
297+
298+
### `rock start` Options
299+
300+
The `start` command launches a development server (either Re.Pack or Metro, depending on your bundler plugin) that connects to your apps through port 8081 by default. It provides features like Hot Module Reloading (HMR) and error reporting.
301+
302+
| Option | Description |
303+
| :------------------------------------------------ | :------------------------------------------------------------------------------------------ |
304+
| `--port <number>` | Port to run the server on (default: 8081) |
305+
| `--host <string>` | Host to run the server on (default: "") |
306+
| `--project-root <path>`, `--projectRoot <path>` | Path to a custom project root |
307+
| `--watch-folders <list>`, `--watchFolders <list>` | Specify any additional folders to be added to the watch list |
308+
| `--asset-plugins <list>`, `--assetPlugins <list>` | Specify any additional asset plugins to be used by the packager by full filepath |
309+
| `--source-exts <list>`,`--sourceExts <list>` | Specify any additional source extensions to be used by the packager |
310+
| `--max-workers <number>` | Specifies the maximum number of workers the worker-pool will spawn for transforming files |
311+
| `--transformer <string>` | Specify a custom transformer to be used |
312+
| `--reset-cache`, `--resetCache` | Removes cached files |
313+
| `--custom-log-reporter-path <string>` | Path to a JavaScript file that exports a log reporter as a replacement for TerminalReporter |
314+
| `--https` | Enables https connections to the server |
315+
| `--key <path>` | Path to custom SSL key |
316+
| `--cert <path>` | Path to custom SSL cert |
317+
| `--config <string>` | Path to the CLI configuration file |
318+
| `--no-interactive` | Disables interactive mode |
319+
| `--client-logs` | [Deprecated] Enable plain text JavaScript log streaming for all connected apps |
320+
321+
### `rock bundle` Options
322+
323+
The `bundle` command creates an optimized JavaScript bundle for your application, optionally using Hermes bytecode.
324+
325+
| Option | Description |
326+
| :-------------------------------------- | :--------------------------------------------------------------------------------------------------- |
327+
| `--entry-file <path>` | Path to the root JS file, either absolute or relative to JS root |
328+
| `--platform <string>` | Either "ios", "android", or "harmony" (default: "ios") |
329+
| `--transformer <string>` | Specify a custom transformer to be used |
330+
| `--dev [boolean]` | If false, warnings are disabled and the bundle is minified (default: true) |
331+
| `--minify [boolean]` | Allows overriding whether bundle is minified. Defaults to false if dev is true, true if dev is false |
332+
| `--bundle-output <string>` | File name where to store the resulting bundle, ex. /tmp/groups.bundle |
333+
| `--bundle-encoding <string>` | Encoding the bundle should be written in (default: "utf8") |
334+
| `--max-workers <number>` | Specifies the maximum number of workers the worker-pool will spawn for transforming files |
335+
| `--sourcemap-output <string>` | File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map |
336+
| `--sourcemap-sources-root <string>` | Path to make sourcemap's sources entries relative to, ex. /root/dir |
337+
| `--sourcemap-use-absolute-path` | Report SourceMapURL using its full path (default: false) |
338+
| `--assets-dest <string>` | Directory name where to store assets referenced in the bundle |
339+
| `--unstable-transform-profile <string>` | Experimental, transform JS for a specific JS engine (default: "default") |
340+
| `--asset-catalog-dest [string]` | Path where to create an iOS Asset Catalog for images |
341+
| `--reset-cache` | Removes cached files (default: false) |
342+
| `--read-global-cache` | Try to fetch transformed JS code from the global cache, if configured (default: false) |
343+
| `--config <string>` | Path to the CLI configuration file |
344+
| `--resolver-option <string...>` | Custom resolver options of the form key=value. URL-encoded. May be specified multiple times |
345+
| `--config-cmd [string]` | [Internal] A hack for Xcode build script pointing to wrong bundle command |
346+
| `--hermes` | Passes the output JS bundle to Hermes compiler and outputs a bytecode file |
347+
348+
## Built-in plugins
349+
350+
### `rock fingerprint` Options
351+
352+
The `fingerprint` command calculates a unique hash that represents your project's native state. This hash is used for build caching and remains stable across builds unless you modify native files, change dependencies with native code, or update scripts in package.json.
353+
354+
| Option | Description |
355+
| :------------------------ | :--------------------------------------------- |
356+
| `-p, --platform <string>` | Select platform, e.g. ios, android, or harmony |
357+
| `--raw` | Output the raw fingerprint hash for piping |
358+
359+
**Arguments:**
360+
361+
- `[path]` - Directory to calculate fingerprint for (optional)
362+
363+
### `rock config` Options
364+
365+
The `config` command outputs the autolinking configuration from Community CLI, which is useful for debugging and understanding how dependencies are linked.
366+
367+
| Option | Description |
368+
| :------------------------ | :--------------------------------------------- |
369+
| `-p, --platform <string>` | Select platform, e.g. ios, android, or harmony |
370+
310371
### `rock clean` Options
311372

312373
The `clean` command helps you free up disk space by removing various caches and temporary files from your React Native project. It can clean Android (Gradle), iOS (CocoaPods), Metro, Watchman, Rock's own project caches, and package manager caches.
@@ -317,6 +378,8 @@ The `clean` command helps you free up disk space by removing various caches and
317378
| `--verify-cache` | Whether to verify the cache (currently only applies to npm cache) |
318379
| `--all` | Clean all available caches without interactive prompt |
319380

381+
## Plugin Remote Cache
382+
320383
### `rock remote-cache` Actions and Options
321384

322385
The `remote-cache <action>` command provides utilities to interact with the remote build cache configured via your `remoteCacheProvider`. This is useful for inspecting, downloading, uploading, or deleting build artifacts stored remotely.

website/src/docs/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Choose your path: [Getting Started →](/docs/getting-started)
1111
Rock is built for two kinds of teams:
1212

1313
- **Existing React Native teams using Community CLI** who want to improve build times and developer experience while fitting into your existing workflows and infrastructure.
14-
- **iOS/Android/HarmonyOS native teams** planning to incorporate React Native without disrupting existing workflows: Rock Brownfield lets you add your whole React Native app like any other dependency.
14+
- **iOS/Android teams** planning to incorporate React Native without disrupting existing workflows: Rock Brownfield lets you add your whole React Native app like any other dependency.
1515

1616
:::info New to React Native and building app from scratch?
1717
For **new projects that aren't brownfield**, consider starting with [Expo](https://expo.dev) for the best developer experience and similar remote caching capabilities. We recommend using [this template](https://github.com/nkzw-tech/expo-app-template) for sensible defaults. Rock is designed for teams who have outgrown the Community CLI.

0 commit comments

Comments
 (0)