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.
@@ -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
- const rncCliBinaryName = await getCliBinaryName();
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","_nodePath","_interopRequireDefault","_fsExtra","_nodeAssert","e","__esModule","default","NODE_BINARY","runRNCCli","args","options","stdio","rncCliBinaryName","getCliBinaryName","RNC_CLI_BINARY_PATH","path","resolve","process","cwd","spawn","rncCliPackagePath","rncCliPackage","fs","readJson","binProperty","bin","assert","binaries","Object","keys"],"sources":["../../src/utils/runRNCCli.ts"],"sourcesContent":["import { type SpawnOptions } from 'node:child_process';\nimport { spawn } from './spawn';\nimport path from 'node:path';\nimport fs from 'fs-extra';\nimport assert from 'node:assert';\n\nconst NODE_BINARY = 'node';\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 const rncCliBinaryName = await getCliBinaryName();\n\n const RNC_CLI_BINARY_PATH = path.resolve(\n process.cwd(), // We are always expected to run in the library\n 'node_modules',\n '.bin',\n rncCliBinaryName\n );\n\n return await spawn(RNC_CLI_BINARY_PATH, args, options);\n}\n\nasync function getCliBinaryName(): Promise<string> {\n const rncCliPackagePath = await spawn(NODE_BINARY, [\n '-e',\n `console.log(require.resolve('@react-native-community/cli/package.json'))`,\n ]);\n\n const rncCliPackage = await fs.readJson(rncCliPackagePath);\n const binProperty = rncCliPackage.bin as Record<string, string>;\n assert(\n typeof binProperty === 'object',\n \"React Native CLI doesn't specify proper binaries\"\n );\n\n const binaries = Object.keys(binProperty);\n const rncCliBinaryName = binaries[0] as string;\n assert(\n typeof rncCliBinaryName === 'string',\n \"React Native Community CLI doesn't have any binaries to run\"\n );\n\n return rncCliBinaryName;\n}\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AAAiC,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEjC,MAAMG,WAAW,GAAG,MAAM;;AAE1B;AACA;AACA;AACO,eAAeC,SAASA,CAC7BC,IAAc,EACdC,OAAqB,GAAG;EACtBC,KAAK,EAAE;AACT,CAAC,EACD;EACA,MAAMC,gBAAgB,GAAG,MAAMC,gBAAgB,CAAC,CAAC;EAEjD,MAAMC,mBAAmB,GAAGC,iBAAI,CAACC,OAAO,CACtCC,OAAO,CAACC,GAAG,CAAC,CAAC;EAAE;EACf,cAAc,EACd,MAAM,EACNN,gBACF,CAAC;EAED,OAAO,MAAM,IAAAO,YAAK,EAACL,mBAAmB,EAAEL,IAAI,EAAEC,OAAO,CAAC;AACxD;AAEA,eAAeG,gBAAgBA,CAAA,EAAoB;EACjD,MAAMO,iBAAiB,GAAG,MAAM,IAAAD,YAAK,EAACZ,WAAW,EAAE,CACjD,IAAI,EACJ,0EAA0E,CAC3E,CAAC;EAEF,MAAMc,aAAa,GAAG,MAAMC,gBAAE,CAACC,QAAQ,CAACH,iBAAiB,CAAC;EAC1D,MAAMI,WAAW,GAAGH,aAAa,CAACI,GAA6B;EAC/D,IAAAC,mBAAM,EACJ,OAAOF,WAAW,KAAK,QAAQ,EAC/B,kDACF,CAAC;EAED,MAAMG,QAAQ,GAAGC,MAAM,CAACC,IAAI,CAACL,WAAW,CAAC;EACzC,MAAMZ,gBAAgB,GAAGe,QAAQ,CAAC,CAAC,CAAW;EAC9C,IAAAD,mBAAM,EACJ,OAAOd,gBAAgB,KAAK,QAAQ,EACpC,6DACF,CAAC;EAED,OAAOA,gBAAgB;AACzB","ignoreList":[]}
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.0",
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": "cac236dcb0dc73f964d1543f5484adb749b30f8f"
90
+ "gitHead": "9a025b2a89c7790b74862bf95ccab4b6a388e2cb"
91
91
  }