react-native-builder-bob 0.33.0 → 0.33.1
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/lib/utils/runRNCCli.js +1 -21
- package/lib/utils/runRNCCli.js.map +1 -1
- package/package.json +2 -2
package/lib/utils/runRNCCli.js
CHANGED
|
@@ -5,32 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.runRNCCli = runRNCCli;
|
|
7
7
|
var _spawn = require("./spawn");
|
|
8
|
-
var _nodePath = _interopRequireDefault(require("node:path"));
|
|
9
|
-
var _fsExtra = _interopRequireDefault(require("fs-extra"));
|
|
10
|
-
var _nodeAssert = _interopRequireDefault(require("node:assert"));
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
const NODE_BINARY = 'node';
|
|
13
|
-
|
|
14
8
|
/**
|
|
15
9
|
* Runs the React Native Community CLI with the specified arguments
|
|
16
10
|
*/
|
|
17
11
|
async function runRNCCli(args, options = {
|
|
18
12
|
stdio: 'ignore'
|
|
19
13
|
}) {
|
|
20
|
-
|
|
21
|
-
const RNC_CLI_BINARY_PATH = _nodePath.default.resolve(process.cwd(),
|
|
22
|
-
// We are always expected to run in the library
|
|
23
|
-
'node_modules', '.bin', rncCliBinaryName);
|
|
24
|
-
return await (0, _spawn.spawn)(RNC_CLI_BINARY_PATH, args, options);
|
|
25
|
-
}
|
|
26
|
-
async function getCliBinaryName() {
|
|
27
|
-
const rncCliPackagePath = await (0, _spawn.spawn)(NODE_BINARY, ['-e', `console.log(require.resolve('@react-native-community/cli/package.json'))`]);
|
|
28
|
-
const rncCliPackage = await _fsExtra.default.readJson(rncCliPackagePath);
|
|
29
|
-
const binProperty = rncCliPackage.bin;
|
|
30
|
-
(0, _nodeAssert.default)(typeof binProperty === 'object', "React Native CLI doesn't specify proper binaries");
|
|
31
|
-
const binaries = Object.keys(binProperty);
|
|
32
|
-
const rncCliBinaryName = binaries[0];
|
|
33
|
-
(0, _nodeAssert.default)(typeof rncCliBinaryName === 'string', "React Native Community CLI doesn't have any binaries to run");
|
|
34
|
-
return rncCliBinaryName;
|
|
14
|
+
return await (0, _spawn.spawn)('npx', ['@react-native-community/cli', ...args], options);
|
|
35
15
|
}
|
|
36
16
|
//# sourceMappingURL=runRNCCli.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runRNCCli.js","names":["_spawn","require","
|
|
1
|
+
{"version":3,"file":"runRNCCli.js","names":["_spawn","require","runRNCCli","args","options","stdio","spawn"],"sources":["../../src/utils/runRNCCli.ts"],"sourcesContent":["import { type SpawnOptions } from 'node:child_process';\nimport { spawn } from './spawn';\n\n/**\n * Runs the React Native Community CLI with the specified arguments\n */\nexport async function runRNCCli(\n args: string[],\n options: SpawnOptions = {\n stdio: 'ignore',\n }\n) {\n return await spawn('npx', ['@react-native-community/cli', ...args], options);\n}\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACO,eAAeC,SAASA,CAC7BC,IAAc,EACdC,OAAqB,GAAG;EACtBC,KAAK,EAAE;AACT,CAAC,EACD;EACA,OAAO,MAAM,IAAAC,YAAK,EAAC,KAAK,EAAE,CAAC,6BAA6B,EAAE,GAAGH,IAAI,CAAC,EAAEC,OAAO,CAAC;AAC9E","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-builder-bob",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.1",
|
|
4
4
|
"description": "CLI to build JavaScript files for React Native libraries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"jest": "^29.7.0",
|
|
88
88
|
"mock-fs": "^5.2.0"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "9a025b2a89c7790b74862bf95ccab4b6a388e2cb"
|
|
91
91
|
}
|