@callstack/brownfield-cli 2.0.0-rc.1 → 2.0.0-rc.2

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.
@@ -0,0 +1,4 @@
1
+ export * from './paths.js';
2
+ export * from './rn-cli.js';
3
+ export * from './stripFrameworkBinary.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/brownfield/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './paths.js';
2
+ export * from './rn-cli.js';
3
+ export * from './stripFrameworkBinary.js';
@@ -0,0 +1,17 @@
1
+ import type { PackageAarFlags } from '@rock-js/platform-android';
2
+ import type { AndroidProjectConfig, Config as UserConfig, ProjectConfig } from '@react-native-community/cli-types';
3
+ /**
4
+ * Gets the project info for the given platform from the current working directory
5
+ * @param platform the platform for which to get project info
6
+ * @returns project root and android project config
7
+ */
8
+ export declare function getProjectInfo<Platform extends 'ios' | 'android'>(platform: Platform): {
9
+ projectRoot: string;
10
+ userConfig: UserConfig;
11
+ platformConfig: ProjectConfig[Platform];
12
+ };
13
+ export declare const getAarConfig: (args: PackageAarFlags, androidConfig: AndroidProjectConfig) => {
14
+ sourceDir: string;
15
+ moduleName: string;
16
+ };
17
+ //# sourceMappingURL=rn-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rn-cli.d.ts","sourceRoot":"","sources":["../../../src/brownfield/utils/rn-cli.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EACV,oBAAoB,EACpB,MAAM,IAAI,UAAU,EACpB,aAAa,EACd,MAAM,mCAAmC,CAAC;AAW3C;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,SAAS,KAAK,GAAG,SAAS,EAC/D,QAAQ,EAAE,QAAQ,GACjB;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,UAAU,CAAC;IACvB,cAAc,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;CACzC,CAmBA;AAED,eAAO,MAAM,YAAY,GACvB,MAAM,eAAe,EACrB,eAAe,oBAAoB;;;CAOpC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import cliConfigImport from '@react-native-community/cli-config';
2
+ const cliConfig = typeof cliConfigImport === 'function'
3
+ ? cliConfigImport
4
+ : // @ts-expect-error: interop default
5
+ cliConfigImport.default;
6
+ import { findProjectRoot, makeRelativeProjectConfigPaths } from './paths.js';
7
+ /**
8
+ * Gets the project info for the given platform from the current working directory
9
+ * @param platform the platform for which to get project info
10
+ * @returns project root and android project config
11
+ */
12
+ export function getProjectInfo(platform) {
13
+ const projectRoot = findProjectRoot();
14
+ const userConfig = cliConfig({
15
+ projectRoot,
16
+ selectedPlatform: platform,
17
+ });
18
+ // below: relative sourceDir path is required by RN CLI's API
19
+ const platformConfig = makeRelativeProjectConfigPaths(projectRoot, userConfig.project[platform]);
20
+ if (!platformConfig) {
21
+ throw new Error(`${platform} project not found.`);
22
+ }
23
+ return { projectRoot, userConfig, platformConfig };
24
+ }
25
+ export const getAarConfig = (args, androidConfig) => {
26
+ const config = {
27
+ sourceDir: androidConfig.sourceDir,
28
+ moduleName: args.moduleName ?? '',
29
+ };
30
+ return config;
31
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@callstack/brownfield-cli",
3
- "version": "2.0.0-rc.1",
3
+ "version": "2.0.0-rc.2",
4
4
  "license": "MIT",
5
5
  "author": "Artur Morys-Magiera <artus9033@gmail.com>",
6
6
  "bin": {
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "homepage": "https://github.com/callstack/react-native-brownfield",
15
15
  "repository": {
16
- "url": "https://github.com/callstack/react-native-brownfield"
16
+ "url": "git+https://github.com/callstack/react-native-brownfield.git"
17
17
  },
18
18
  "description": "Brownfield CLI for React Native, gathering all packages of the RN brownfield ecosystem",
19
19
  "exports": {
@@ -76,6 +76,8 @@
76
76
  "@rock-js/plugin-brownfield-ios": "^0.12.8",
77
77
  "@rock-js/tools": "^0.12.8",
78
78
  "commander": "^14.0.2",
79
+ "quicktype-core": "^23.2.6",
80
+ "quicktype-typescript-input": "^23.2.6",
79
81
  "ts-morph": "^27.0.2"
80
82
  },
81
83
  "devDependencies": {
@@ -98,4 +100,4 @@
98
100
  "engines": {
99
101
  "node": ">=20"
100
102
  }
101
- }
103
+ }
package/CHANGELOG.md DELETED
@@ -1,25 +0,0 @@
1
- # @callstack/brownfield-cli
2
-
3
- ## 1.0.4
4
-
5
- ### Patch Changes
6
-
7
- - [#216](https://github.com/callstack/react-native-brownfield/pull/216) [`8ce3ea1`](https://github.com/callstack/react-native-brownfield/commit/8ce3ea10e0719adac7396dea8f171753e901b31d) Thanks [@thymikee](https://github.com/thymikee)! - chore: remove release-it
8
-
9
- ## 1.0.3
10
-
11
- ### Patch Changes
12
-
13
- - [#213](https://github.com/callstack/react-native-brownfield/pull/213) [`2347775`](https://github.com/callstack/react-native-brownfield/commit/23477753b16ee189b82c1aee3eac98a56c79f52a) Thanks [@thymikee](https://github.com/thymikee)! - feat: create brownfield package as CLI proxy
14
-
15
- ## 1.0.2
16
-
17
- ### Patch Changes
18
-
19
- - [`2a8563f`](https://github.com/callstack/react-native-brownfield/commit/2a8563f65ed152054ad1290caf963791a368ee9a) Thanks [@okwasniewski](https://github.com/okwasniewski)! - feat: strip framework binaries to avoid duplicate symbol errors
20
-
21
- ## 1.0.1
22
-
23
- ### Patch Changes
24
-
25
- - [#198](https://github.com/callstack/react-native-brownfield/pull/198) [`c8c903d`](https://github.com/callstack/react-native-brownfield/commit/c8c903d0d2b78a8c06a41213dfbe781a2daf3d25) Thanks [@artus9033](https://github.com/artus9033)! - docs: added README files to all packages