Skip to content

Commit 5fe782a

Browse files
huntiefacebook-github-bot
authored andcommitted
Move cxx-api scripts under scripts/, add README (#52467)
Summary: Pull Request resolved: #52467 Moves the WIP `cxx-public-api` project under `scripts/cxx-api/`, add minimal README docs. Changelog: [Internal] Reviewed By: christophpurrer Differential Revision: D77865490 fbshipit-source-id: ce49845386c468ee7422b864c49f2a8c9eed5a70
1 parent abfb9cb commit 5fe782a

7 files changed

Lines changed: 33 additions & 28 deletions

File tree

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"build-types": "node ./scripts/build-types",
1212
"clang-format": "clang-format -i --glob=*/**/*.{h,cpp,m,mm}",
1313
"clean": "node ./scripts/build/clean.js",
14+
"cxx-api-build": "node ./scripts/cxx-api/public-api.js",
1415
"flow-check": "flow check",
1516
"flow": "flow",
1617
"format-check": "prettier --list-different \"./**/*.{js,md,yml,ts,tsx}\"",
@@ -82,6 +83,7 @@
8283
"glob": "^7.1.1",
8384
"hermes-eslint": "0.29.1",
8485
"hermes-transform": "0.29.1",
86+
"ini": "^5.0.0",
8587
"inquirer": "^7.1.0",
8688
"jest": "^29.7.0",
8789
"jest-config": "^29.7.0",

private/cxx-public-api/package.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

scripts/cxx-api/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# scripts/cxx-api
2+
3+
[Experimental] Build scripts for React Native's C++ / Objective-C / Objective-C++ API.
4+
5+
## Usage
6+
7+
#### Build API snapshot
8+
9+
Builds a `ReactNativeCPP.api` file to the `output` location configured in `public-api.conf`.
10+
11+
```sh
12+
yarn cxx-api-build
13+
```
14+
15+
#### Check API snapshot
16+
17+
Prints a warning message with the API snapshot diff since the previous commit.
18+
19+
```sh
20+
./scripts/cxx-api/check-api.sh
21+
```
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ pushd "$FBSOURCE_ROOT/xplat/js/react-native-github" || exit $ERR_CODE_CANT_FIND_
7373
trap cleanup EXIT
7474

7575
# TODO: This operates in the sandbox and can't modify files in the repository, which we need for change detection
76-
# buck2 run //xplat/js/react-native-github/private/cxx-public-api:public-api
77-
REPO_RELATIVE_DIR="private/cxx-public-api"
76+
# buck2 run //xplat/js/react-native-github/scripts/cxx-api:public-api
77+
REPO_RELATIVE_DIR="scripts/cxx-api"
7878
(cd "$REPO_RELATIVE_DIR" && $YARN_BINARY install)
7979
$NODE_BINARY "$REPO_RELATIVE_DIR/public-api.js"
8080
echo
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ packages/react-native/Libraries/WebSocket/*
2222
packages/react-native/Libraries/Wrapper/Example/*
2323

2424
[settings]
25-
output=private/cxx-public-api/ReactNativeCPP.api
25+
output=scripts/cxx-api/ReactNativeCPP.api
2626
; clang=$HOME/some/path/to/clang
2727
; clang-format=$HOME/some/path/to/clang-format
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ const isTTY = process.stdout.isTTY;
3434

3535
/*::
3636
type Config = {
37-
include: string[],
38-
exclude: string[],
39-
settings: {
40-
output: string,
41-
clang?: string,
42-
'clang-format'?: string,
43-
}
37+
include: string[],
38+
exclude: string[],
39+
settings: {
40+
output: string,
41+
clang?: string,
42+
'clang-format'?: string,
43+
},
4444
};
4545
4646
type ParsedConfig = {

0 commit comments

Comments
 (0)