Skip to content

Commit cb9f696

Browse files
committed
chore: provide brownfield bin
1 parent c5a51fd commit cb9f696

5 files changed

Lines changed: 14 additions & 12 deletions

File tree

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Install dependencies
3030
run: yarn install
3131

32-
- name: Build package
32+
- name: Build packages
3333
run: yarn build
3434

3535
- name: Build Android RN app
@@ -40,12 +40,12 @@ jobs:
4040
- name: Package AAR with the Brownfield CLI
4141
run: |
4242
cd apps/RNApp
43-
npx tsx ../../src/cli/index.ts package:android --module-name :BrownfieldLib --variant release
43+
yarn workspace @callstack/react-native-brownfield brownfield package:android --module-name :BrownfieldLib --variant release
4444
4545
- name: Publish AAR artifact to Maven Local
4646
run: |
4747
cd apps/RNApp/android/BrownfieldLib
48-
npx tsx ../../src/cli/index.ts publish:android --module-name :BrownfieldLib
48+
yarn workspace @callstack/react-native-brownfield brownfield publish:android --module-name :BrownfieldLib
4949
5050
- name: Verify debug AAR exists in Maven Local
5151
run: stat ~/.m2/repository/com/rnapp/brownfieldlib/0.0.1-local/brownfieldlib-0.0.1-local-debug.aar
@@ -101,7 +101,7 @@ jobs:
101101
- name: Package iOS Framework with the Brownfield CLI
102102
run: |
103103
cd apps/RNApp
104-
npx tsx ../../src/cli/index.ts package:ios --workspace RNApp --scheme BrownfieldLib
104+
yarn workspace @callstack/react-native-brownfield brownfield package:ios --workspace RNApp --scheme BrownfieldLib
105105
106106
- name: Build Brownfield iOS native app
107107
run: |

docs/docs/docs/getting-started/quick-start.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ You can use the built-in CLI that comes with this library to package your React
3838

3939
##### Publish for iOS
4040

41-
Simply run `npx react-native-brownfield package:ios` to create an XCFramework that you can later integrate into your native iOS app according to other instruction sections below.
41+
Simply run `npx brownfield package:ios` to create an XCFramework that you can later integrate into your native iOS app according to other instruction sections below.
4242

4343
Available arguments:
4444

@@ -54,7 +54,7 @@ Available arguments:
5454

5555
##### Build for Android
5656

57-
To build the artifact for Android without publishing, run `npx react-native-brownfield package:aar --module-name app`.
57+
To build the artifact for Android without publishing, run `npx brownfield package:aar --module-name app`.
5858

5959
Available arguments:
6060

@@ -68,7 +68,7 @@ Available arguments:
6868

6969
To publish the `.aar`(s) built beforehand with `react-native-brownfield package:aar` to Maven local, which will allow Gradle to be able to load it from Maven local repository, run:
7070

71-
`npx react-native-brownfield publish:android --module-name app`
71+
`npx brownfield publish:android --module-name app`
7272

7373
| Argument | Description | Default |
7474
| ------------- | ------------------------------------------------------------------------------------------------------------------------- | ---------------------- | ----- |

packages/react-native-brownfield/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"version": "2.0.1",
44
"license": "MIT",
55
"author": "Michal Chudziak <mike.chudziak@callstack.com>",
6-
"bin": "lib/commonjs/cli/index.js",
6+
"bin": {
7+
"brownfield": "./lib/commonjs/cli/index.js"
8+
},
79
"contributors": [
810
"Piotr Drapich <piotr.drapich@callstack.com>"
911
],
@@ -29,7 +31,8 @@
2931
"scripts": {
3032
"lint": "eslint \"**/*.{js,ts,tsx}\"",
3133
"typecheck": "tsc --noEmit",
32-
"build": "bob build"
34+
"build": "bob build",
35+
"brownfield": "brownfield"
3336
},
3437
"keywords": [
3538
"react-native-brownfield",

packages/react-native-brownfield/src/cli/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,13 @@ import {
2424
getAarConfig,
2525
makeRelativeAndroidProjectConfigPaths,
2626
} from './utils';
27-
import { version } from '../../package.json';
2827

2928
const program = new Command();
3029

3130
program
3231
.name('react-native-brownfield')
3332
.description('React Native Brownfield library CLI')
34-
.version(version)
33+
.version(process.env.npm_package_version ?? '0.0.0')
3534
.option('--verbose', 'Enable verbose output')
3635
.hook('preAction', (_cmd) => {
3736
const opts = program.opts();

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1602,7 +1602,7 @@ __metadata:
16021602
react: "*"
16031603
react-native: "*"
16041604
bin:
1605-
react-native-brownfield: lib/commonjs/cli/index.js
1605+
brownfield: ./lib/commonjs/cli/index.js
16061606
languageName: unknown
16071607
linkType: soft
16081608

0 commit comments

Comments
 (0)