Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"build-types": "node ./scripts/build-types",
"clang-format": "clang-format -i --glob=*/**/*.{h,cpp,m,mm}",
"clean": "node ./scripts/build/clean.js",
"cxx-api-build": "node ./scripts/cxx-api/public-api.js",
"flow-check": "flow check",
"flow": "flow",
"format-check": "prettier --list-different \"./**/*.{js,md,yml,ts,tsx}\"",
Expand Down Expand Up @@ -82,6 +83,7 @@
"glob": "^7.1.1",
"hermes-eslint": "0.29.1",
"hermes-transform": "0.29.1",
"ini": "^5.0.0",
"inquirer": "^7.1.0",
"jest": "^29.7.0",
"jest-config": "^29.7.0",
Expand Down
18 changes: 0 additions & 18 deletions private/cxx-public-api/package.json

This file was deleted.

21 changes: 21 additions & 0 deletions scripts/cxx-api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# scripts/cxx-api

[Experimental] Build scripts for React Native's C++ / Objective-C / Objective-C++ API.

## Usage

#### Build API snapshot

Builds a `ReactNativeCPP.api` file to the `output` location configured in `public-api.conf`.

```sh
yarn cxx-api-build
```

#### Check API snapshot

Prints a warning message with the API snapshot diff since the previous commit.

```sh
./scripts/cxx-api/check-api.sh
```
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ pushd "$FBSOURCE_ROOT/xplat/js/react-native-github" || exit $ERR_CODE_CANT_FIND_
trap cleanup EXIT

# TODO: This operates in the sandbox and can't modify files in the repository, which we need for change detection
# buck2 run //xplat/js/react-native-github/private/cxx-public-api:public-api
REPO_RELATIVE_DIR="private/cxx-public-api"
# buck2 run //xplat/js/react-native-github/scripts/cxx-api:public-api
REPO_RELATIVE_DIR="scripts/cxx-api"
(cd "$REPO_RELATIVE_DIR" && $YARN_BINARY install)
$NODE_BINARY "$REPO_RELATIVE_DIR/public-api.js"
echo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ packages/react-native/Libraries/WebSocket/*
packages/react-native/Libraries/Wrapper/Example/*

[settings]
output=private/cxx-public-api/ReactNativeCPP.api
output=scripts/cxx-api/ReactNativeCPP.api
; clang=$HOME/some/path/to/clang
; clang-format=$HOME/some/path/to/clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ const isTTY = process.stdout.isTTY;

/*::
type Config = {
include: string[],
exclude: string[],
settings: {
output: string,
clang?: string,
'clang-format'?: string,
}
include: string[],
exclude: string[],
settings: {
output: string,
clang?: string,
'clang-format'?: string,
},
};

type ParsedConfig = {
Expand Down
Loading