@callstack/brownfield-cli 3.3.0 → 3.4.0
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.
- package/CHANGELOG.md +12 -0
- package/dist/brownfield/commands/packageIos.js +1 -1
- package/dist/brownie/commands/codegen.js +1 -1
- package/dist/navigation/runner.d.ts.map +1 -1
- package/dist/navigation/runner.js +5 -2
- package/package.json +13 -13
- package/src/brownfield/commands/packageIos.ts +1 -1
- package/src/brownie/commands/codegen.ts +1 -1
- package/src/navigation/runner.ts +24 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @callstack/brownfield-cli
|
|
2
2
|
|
|
3
|
+
## 3.4.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#246](https://github.com/callstack/react-native-brownfield/pull/246) [`5484065`](https://github.com/callstack/react-native-brownfield/commit/5484065da9dc86a420af2be692fcdefa32fbb2af) Thanks [@artus9033](https://github.com/artus9033)! - chore: upgrade dependencies
|
|
8
|
+
|
|
9
|
+
- [#275](https://github.com/callstack/react-native-brownfield/pull/275) [`dd8b8a0`](https://github.com/callstack/react-native-brownfield/commit/dd8b8a0b532fe779c1f2ce018577ad748b887ee0) Thanks [@artus9033](https://github.com/artus9033)! - chore: bump up Gradle plugin version
|
|
10
|
+
|
|
11
|
+
- [#271](https://github.com/callstack/react-native-brownfield/pull/271) [`54ab7ab`](https://github.com/callstack/react-native-brownfield/commit/54ab7ab01bd6f95439cc8b702d4124552e22ad55) Thanks [@artus9033](https://github.com/artus9033)! - feat: improved logging in brownfield CLI codegens
|
|
12
|
+
|
|
13
|
+
- [#246](https://github.com/callstack/react-native-brownfield/pull/246) [`5484065`](https://github.com/callstack/react-native-brownfield/commit/5484065da9dc86a420af2be692fcdefa32fbb2af) Thanks [@artus9033](https://github.com/artus9033)! - chore: upgrade dependencies
|
|
14
|
+
|
|
3
15
|
## 3.3.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -64,7 +64,7 @@ export const packageIosCommand = curryOptions(new Command('package:ios').descrip
|
|
|
64
64
|
],
|
|
65
65
|
outputPath: brownieOutputPath,
|
|
66
66
|
});
|
|
67
|
-
// Strip the binary from
|
|
67
|
+
// Strip the binary from Brownie.xcframework to make it interface-only.
|
|
68
68
|
// This avoids duplicate symbols when consumer apps embed both BrownfieldLib
|
|
69
69
|
// (which contains Brownie symbols) and Brownie.xcframework.
|
|
70
70
|
stripFrameworkBinary(brownieOutputPath);
|
|
@@ -101,7 +101,7 @@ export async function runCodegen({ platform }) {
|
|
|
101
101
|
throw error;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
outro('
|
|
104
|
+
outro('Brownie codegen done');
|
|
105
105
|
}
|
|
106
106
|
export const codegenCommand = new Command('codegen')
|
|
107
107
|
.description('Generate native store types from TypeScript schema')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/navigation/runner.ts"],"names":[],"mappings":"AA2BA,UAAU,2BAA2B;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/navigation/runner.ts"],"names":[],"mappings":"AA2BA,UAAU,2BAA2B;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAgLD,wBAAsB,oBAAoB,CAAC,EACzC,QAAQ,EACR,MAAc,EACd,WAA2B,GAC5B,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CA8D7C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { logger } from '@rock-js/tools';
|
|
3
|
+
import { intro, logger, outro } from '@rock-js/tools';
|
|
4
4
|
import { DEFAULT_ANDROID_JAVA_PACKAGE, getNavigationPackagePath, } from './config.js';
|
|
5
5
|
import { parseNavigationSpec } from './parser.js';
|
|
6
6
|
import { resolveNavigationSpecPath } from './spec-discovery.js';
|
|
@@ -86,12 +86,13 @@ export async function runNavigationCodegen({ specPath, dryRun = false, projectRo
|
|
|
86
86
|
if (!fs.existsSync(resolvedSpecPath)) {
|
|
87
87
|
throw new Error(`Spec file not found: ${resolvedSpecPath}`);
|
|
88
88
|
}
|
|
89
|
+
intro(`Running Brownfield Navigation codegen`);
|
|
89
90
|
logger.info(`Parsing spec file: ${resolvedSpecPath}`);
|
|
90
91
|
const methods = parseNavigationSpec(resolvedSpecPath);
|
|
91
92
|
if (methods.length === 0) {
|
|
92
93
|
throw new Error('No methods found in spec file');
|
|
93
94
|
}
|
|
94
|
-
logger.info(`Found ${methods.length} method
|
|
95
|
+
logger.info(`Found ${methods.length} method${methods.length === 1 ? '' : 's'}: ${methods.map((method) => method.name).join(', ')}`);
|
|
95
96
|
const packageRoot = getNavigationPackagePath(projectRoot);
|
|
96
97
|
const androidJavaPackageName = DEFAULT_ANDROID_JAVA_PACKAGE;
|
|
97
98
|
const indexTs = generateIndexTs(methods);
|
|
@@ -120,7 +121,9 @@ export async function runNavigationCodegen({ specPath, dryRun = false, projectRo
|
|
|
120
121
|
}
|
|
121
122
|
if (dryRun) {
|
|
122
123
|
printDryRun(androidJavaPackageName, artifacts);
|
|
124
|
+
outro('Brownfield Navigation codegen done');
|
|
123
125
|
return;
|
|
124
126
|
}
|
|
125
127
|
writeArtifacts(getOutputPaths(packageRoot, androidJavaPackageName), artifacts);
|
|
128
|
+
outro('Brownfield Navigation codegen done');
|
|
126
129
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@callstack/brownfield-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Artur Morys-Magiera <artus9033@gmail.com>",
|
|
6
6
|
"bin": {
|
|
@@ -75,12 +75,12 @@
|
|
|
75
75
|
"@expo/config": "^12.0.13",
|
|
76
76
|
"@react-native-community/cli-config": "^20.0.0",
|
|
77
77
|
"@react-native-community/cli-config-android": "^20.0.0",
|
|
78
|
-
"@rock-js/platform-android": "^0.12.
|
|
79
|
-
"@rock-js/platform-apple-helpers": "^0.12.
|
|
80
|
-
"@rock-js/plugin-brownfield-android": "^0.12.
|
|
81
|
-
"@rock-js/plugin-brownfield-ios": "^0.12.
|
|
82
|
-
"@rock-js/tools": "^0.12.
|
|
83
|
-
"commander": "^14.0.
|
|
78
|
+
"@rock-js/platform-android": "^0.12.12",
|
|
79
|
+
"@rock-js/platform-apple-helpers": "^0.12.12",
|
|
80
|
+
"@rock-js/plugin-brownfield-android": "^0.12.12",
|
|
81
|
+
"@rock-js/plugin-brownfield-ios": "^0.12.12",
|
|
82
|
+
"@rock-js/tools": "^0.12.12",
|
|
83
|
+
"commander": "^14.0.3",
|
|
84
84
|
"quicktype-core": "^23.2.6",
|
|
85
85
|
"quicktype-typescript-input": "^23.2.6",
|
|
86
86
|
"ts-morph": "^27.0.2"
|
|
@@ -94,13 +94,13 @@
|
|
|
94
94
|
"@react-native/eslint-config": "0.82.1",
|
|
95
95
|
"@types/babel__core": "^7.20.5",
|
|
96
96
|
"@types/babel__preset-env": "^7.10.0",
|
|
97
|
-
"@types/node": "^25.0
|
|
98
|
-
"@vitest/coverage-v8": "^4.0
|
|
99
|
-
"eslint": "^9.
|
|
100
|
-
"globals": "^
|
|
101
|
-
"nodemon": "^3.1.
|
|
97
|
+
"@types/node": "^25.5.0",
|
|
98
|
+
"@vitest/coverage-v8": "^4.1.0",
|
|
99
|
+
"eslint": "^9.39.3",
|
|
100
|
+
"globals": "^17.3.0",
|
|
101
|
+
"nodemon": "^3.1.14",
|
|
102
102
|
"typescript": "5.9.3",
|
|
103
|
-
"vitest": "^4.0
|
|
103
|
+
"vitest": "^4.1.0"
|
|
104
104
|
},
|
|
105
105
|
"engines": {
|
|
106
106
|
"node": ">=20"
|
|
@@ -118,7 +118,7 @@ export const packageIosCommand = curryOptions(
|
|
|
118
118
|
outputPath: brownieOutputPath,
|
|
119
119
|
});
|
|
120
120
|
|
|
121
|
-
// Strip the binary from
|
|
121
|
+
// Strip the binary from Brownie.xcframework to make it interface-only.
|
|
122
122
|
// This avoids duplicate symbols when consumer apps embed both BrownfieldLib
|
|
123
123
|
// (which contains Brownie symbols) and Brownie.xcframework.
|
|
124
124
|
stripFrameworkBinary(brownieOutputPath);
|
package/src/navigation/runner.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
|
|
4
|
-
import { logger } from '@rock-js/tools';
|
|
4
|
+
import { intro, logger, outro } from '@rock-js/tools';
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_ANDROID_JAVA_PACKAGE,
|
|
7
7
|
getNavigationPackagePath,
|
|
@@ -53,7 +53,11 @@ function getOutputPaths(
|
|
|
53
53
|
const androidPackagePathSegments = androidJavaPackageName.split('.');
|
|
54
54
|
|
|
55
55
|
return {
|
|
56
|
-
turboModuleSpec: path.join(
|
|
56
|
+
turboModuleSpec: path.join(
|
|
57
|
+
packageRoot,
|
|
58
|
+
'src',
|
|
59
|
+
'NativeBrownfieldNavigation.ts'
|
|
60
|
+
),
|
|
57
61
|
navigationTs: path.join(packageRoot, 'src', 'index.ts'),
|
|
58
62
|
commonjsIndexJs: path.join(packageRoot, 'lib', 'commonjs', 'index.js'),
|
|
59
63
|
moduleIndexJs: path.join(packageRoot, 'lib', 'module', 'index.js'),
|
|
@@ -78,7 +82,11 @@ function getOutputPaths(
|
|
|
78
82
|
'ios',
|
|
79
83
|
'BrownfieldNavigationDelegate.swift'
|
|
80
84
|
),
|
|
81
|
-
swiftModels: path.join(
|
|
85
|
+
swiftModels: path.join(
|
|
86
|
+
packageRoot,
|
|
87
|
+
'ios',
|
|
88
|
+
'BrownfieldNavigationModels.swift'
|
|
89
|
+
),
|
|
82
90
|
objcImplementation: path.join(
|
|
83
91
|
packageRoot,
|
|
84
92
|
'ios',
|
|
@@ -207,6 +215,8 @@ export async function runNavigationCodegen({
|
|
|
207
215
|
throw new Error(`Spec file not found: ${resolvedSpecPath}`);
|
|
208
216
|
}
|
|
209
217
|
|
|
218
|
+
intro(`Running Brownfield Navigation codegen`);
|
|
219
|
+
|
|
210
220
|
logger.info(`Parsing spec file: ${resolvedSpecPath}`);
|
|
211
221
|
const methods = parseNavigationSpec(resolvedSpecPath);
|
|
212
222
|
if (methods.length === 0) {
|
|
@@ -214,7 +224,7 @@ export async function runNavigationCodegen({
|
|
|
214
224
|
}
|
|
215
225
|
|
|
216
226
|
logger.info(
|
|
217
|
-
`Found ${methods.length} method
|
|
227
|
+
`Found ${methods.length} method${methods.length === 1 ? '' : 's'}: ${methods.map((method) => method.name).join(', ')}`
|
|
218
228
|
);
|
|
219
229
|
|
|
220
230
|
const packageRoot = getNavigationPackagePath(projectRoot);
|
|
@@ -244,13 +254,21 @@ export async function runNavigationCodegen({
|
|
|
244
254
|
artifacts.swiftModels = models.swiftModels;
|
|
245
255
|
artifacts.kotlinModels = models.kotlinModels;
|
|
246
256
|
} else {
|
|
247
|
-
logger.info(
|
|
257
|
+
logger.info(
|
|
258
|
+
'No complex model types found; skipping quicktype model generation'
|
|
259
|
+
);
|
|
248
260
|
}
|
|
249
261
|
|
|
250
262
|
if (dryRun) {
|
|
251
263
|
printDryRun(androidJavaPackageName, artifacts);
|
|
264
|
+
outro('Brownfield Navigation codegen done');
|
|
252
265
|
return;
|
|
253
266
|
}
|
|
254
267
|
|
|
255
|
-
writeArtifacts(
|
|
268
|
+
writeArtifacts(
|
|
269
|
+
getOutputPaths(packageRoot, androidJavaPackageName),
|
|
270
|
+
artifacts
|
|
271
|
+
);
|
|
272
|
+
|
|
273
|
+
outro('Brownfield Navigation codegen done');
|
|
256
274
|
}
|