create-react-native-library 0.52.0 → 0.53.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/lib/constants.js CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.SUPPORTED_REACT_NATIVE_VERSION = exports.FALLBACK_NITRO_MODULES_VERSION = exports.FALLBACK_BOB_VERSION = void 0;
7
- const FALLBACK_BOB_VERSION = exports.FALLBACK_BOB_VERSION = '0.40.8';
8
- const FALLBACK_NITRO_MODULES_VERSION = exports.FALLBACK_NITRO_MODULES_VERSION = '0.26.2';
9
- const SUPPORTED_REACT_NATIVE_VERSION = exports.SUPPORTED_REACT_NATIVE_VERSION = '0.79.2';
7
+ const FALLBACK_BOB_VERSION = exports.FALLBACK_BOB_VERSION = '0.40.13';
8
+ const FALLBACK_NITRO_MODULES_VERSION = exports.FALLBACK_NITRO_MODULES_VERSION = '0.28.1';
9
+ const SUPPORTED_REACT_NATIVE_VERSION = exports.SUPPORTED_REACT_NATIVE_VERSION = '0.81.0';
10
10
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":["FALLBACK_BOB_VERSION","exports","FALLBACK_NITRO_MODULES_VERSION","SUPPORTED_REACT_NATIVE_VERSION"],"sources":["../src/constants.ts"],"sourcesContent":["export const FALLBACK_BOB_VERSION = '0.40.8';\nexport const FALLBACK_NITRO_MODULES_VERSION = '0.26.2';\nexport const SUPPORTED_REACT_NATIVE_VERSION = '0.79.2';\n"],"mappings":";;;;;;AAAO,MAAMA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,QAAQ;AACrC,MAAME,8BAA8B,GAAAD,OAAA,CAAAC,8BAAA,GAAG,QAAQ;AAC/C,MAAMC,8BAA8B,GAAAF,OAAA,CAAAE,8BAAA,GAAG,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"constants.js","names":["FALLBACK_BOB_VERSION","exports","FALLBACK_NITRO_MODULES_VERSION","SUPPORTED_REACT_NATIVE_VERSION"],"sources":["../src/constants.ts"],"sourcesContent":["export const FALLBACK_BOB_VERSION = '0.40.13';\nexport const FALLBACK_NITRO_MODULES_VERSION = '0.28.1';\nexport const SUPPORTED_REACT_NATIVE_VERSION = '0.81.0';\n"],"mappings":";;;;;;AAAO,MAAMA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,SAAS;AACtC,MAAME,8BAA8B,GAAAD,OAAA,CAAAC,8BAAA,GAAG,QAAQ;AAC/C,MAAMC,8BAA8B,GAAAF,OAAA,CAAAE,8BAAA,GAAG,QAAQ","ignoreList":[]}
@@ -6,10 +6,15 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.createInitialGitCommit = createInitialGitCommit;
7
7
  var _spawn = require("./spawn");
8
8
  async function createInitialGitCommit(folder, signal) {
9
- const isInGitRepo = (await (0, _spawn.spawn)('git', ['rev-parse', '--is-inside-work-tree'], {
10
- cwd: folder,
11
- signal
12
- })) === 'true';
9
+ let isInGitRepo = false;
10
+ try {
11
+ isInGitRepo = (await (0, _spawn.spawn)('git', ['rev-parse', '--is-inside-work-tree'], {
12
+ cwd: folder,
13
+ signal
14
+ })) === 'true';
15
+ } catch (error) {
16
+ // Ignore errors
17
+ }
13
18
  if (!isInGitRepo) {
14
19
  await (0, _spawn.spawn)('git', ['init'], {
15
20
  cwd: folder,
@@ -1 +1 @@
1
- {"version":3,"file":"initialCommit.js","names":["_spawn","require","createInitialGitCommit","folder","signal","isInGitRepo","spawn","cwd"],"sources":["../../src/utils/initialCommit.ts"],"sourcesContent":["import { spawn } from './spawn';\n\nexport async function createInitialGitCommit(\n folder: string,\n signal?: AbortSignal\n) {\n const isInGitRepo =\n (await spawn('git', ['rev-parse', '--is-inside-work-tree'], {\n cwd: folder,\n signal,\n })) === 'true';\n\n if (!isInGitRepo) {\n await spawn('git', ['init'], { cwd: folder, signal });\n await spawn('git', ['branch', '-M', 'main'], { cwd: folder, signal });\n await spawn('git', ['add', '.'], { cwd: folder, signal });\n await spawn('git', ['commit', '-m', 'chore: initial commit'], {\n cwd: folder,\n signal,\n });\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEO,eAAeC,sBAAsBA,CAC1CC,MAAc,EACdC,MAAoB,EACpB;EACA,MAAMC,WAAW,GACf,CAAC,MAAM,IAAAC,YAAK,EAAC,KAAK,EAAE,CAAC,WAAW,EAAE,uBAAuB,CAAC,EAAE;IAC1DC,GAAG,EAAEJ,MAAM;IACXC;EACF,CAAC,CAAC,MAAM,MAAM;EAEhB,IAAI,CAACC,WAAW,EAAE;IAChB,MAAM,IAAAC,YAAK,EAAC,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE;MAAEC,GAAG,EAAEJ,MAAM;MAAEC;IAAO,CAAC,CAAC;IACrD,MAAM,IAAAE,YAAK,EAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE;MAAEC,GAAG,EAAEJ,MAAM;MAAEC;IAAO,CAAC,CAAC;IACrE,MAAM,IAAAE,YAAK,EAAC,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE;MAAEC,GAAG,EAAEJ,MAAM;MAAEC;IAAO,CAAC,CAAC;IACzD,MAAM,IAAAE,YAAK,EAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,uBAAuB,CAAC,EAAE;MAC5DC,GAAG,EAAEJ,MAAM;MACXC;IACF,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
1
+ {"version":3,"file":"initialCommit.js","names":["_spawn","require","createInitialGitCommit","folder","signal","isInGitRepo","spawn","cwd","error"],"sources":["../../src/utils/initialCommit.ts"],"sourcesContent":["import { spawn } from './spawn';\n\nexport async function createInitialGitCommit(\n folder: string,\n signal?: AbortSignal\n) {\n let isInGitRepo = false;\n\n try {\n isInGitRepo =\n (await spawn('git', ['rev-parse', '--is-inside-work-tree'], {\n cwd: folder,\n signal,\n })) === 'true';\n } catch (error) {\n // Ignore errors\n }\n\n if (!isInGitRepo) {\n await spawn('git', ['init'], { cwd: folder, signal });\n await spawn('git', ['branch', '-M', 'main'], { cwd: folder, signal });\n await spawn('git', ['add', '.'], { cwd: folder, signal });\n await spawn('git', ['commit', '-m', 'chore: initial commit'], {\n cwd: folder,\n signal,\n });\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEO,eAAeC,sBAAsBA,CAC1CC,MAAc,EACdC,MAAoB,EACpB;EACA,IAAIC,WAAW,GAAG,KAAK;EAEvB,IAAI;IACFA,WAAW,GACT,CAAC,MAAM,IAAAC,YAAK,EAAC,KAAK,EAAE,CAAC,WAAW,EAAE,uBAAuB,CAAC,EAAE;MAC1DC,GAAG,EAAEJ,MAAM;MACXC;IACF,CAAC,CAAC,MAAM,MAAM;EAClB,CAAC,CAAC,OAAOI,KAAK,EAAE;IACd;EAAA;EAGF,IAAI,CAACH,WAAW,EAAE;IAChB,MAAM,IAAAC,YAAK,EAAC,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE;MAAEC,GAAG,EAAEJ,MAAM;MAAEC;IAAO,CAAC,CAAC;IACrD,MAAM,IAAAE,YAAK,EAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE;MAAEC,GAAG,EAAEJ,MAAM;MAAEC;IAAO,CAAC,CAAC;IACrE,MAAM,IAAAE,YAAK,EAAC,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE;MAAEC,GAAG,EAAEJ,MAAM;MAAEC;IAAO,CAAC,CAAC;IACzD,MAAM,IAAAE,YAAK,EAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,uBAAuB,CAAC,EAAE;MAC5DC,GAAG,EAAEJ,MAAM;MACXC;IACF,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-react-native-library",
3
- "version": "0.52.0",
3
+ "version": "0.53.0",
4
4
  "description": "CLI to scaffold React Native libraries",
5
5
  "keywords": [
6
6
  "react-native",
@@ -66,5 +66,5 @@
66
66
  "@types/validate-npm-package-name": "^3.0.3",
67
67
  "@types/yargs": "^17.0.10"
68
68
  },
69
- "gitHead": "250cb0a6013eb73266c5c0392ff3366ad0cdfe6a"
69
+ "gitHead": "d6a5438130a96c4fa286a009b8240837a26d1209"
70
70
  }
@@ -11,13 +11,15 @@ This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/f
11
11
  - The library package in the root directory.
12
12
  - An example app in the `example/` directory.
13
13
 
14
- To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
14
+ To get started with the project, make sure you have the correct version of [Node.js](https://nodejs.org/) installed. See the [`.nvmrc`](./.nvmrc) file for the version used in this project.
15
+
16
+ Run `yarn` in the root directory to install the required dependencies for each package:
15
17
 
16
18
  ```sh
17
19
  yarn
18
20
  ```
19
21
 
20
- > Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development.
22
+ > Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development without manually migrating.
21
23
 
22
24
  <% if (project.moduleConfig === 'nitro-modules' || project.viewConfig === 'nitro-view') { -%>
23
25
  This project uses Nitro Modules. If you're not familiar with how Nitro works, make sure to check the [Nitro Modules Docs](https://nitro.margelo.com/).
@@ -56,7 +56,9 @@ const result = await multiply(3, 7);
56
56
 
57
57
  ## Contributing
58
58
 
59
- See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
59
+ - [Development workflow](CONTRIBUTING.md#development-workflow)
60
+ - [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
61
+ - [Code of conduct](CODE_OF_CONDUCT.md)
60
62
 
61
63
  ## License
62
64
 
@@ -6,6 +6,7 @@
6
6
  },
7
7
  "allowUnreachableCode": false,
8
8
  "allowUnusedLabels": false,
9
+ "customConditions": ["react-native-strict-api"],
9
10
  "esModuleInterop": true,
10
11
  "forceConsistentCasingInFileNames": true,
11
12
  "jsx": "react-jsx",
@@ -144,11 +144,3 @@ dependencies {
144
144
  implementation project(":react-native-nitro-modules")
145
145
  <% } -%>
146
146
  }
147
-
148
- <% if (project.moduleConfig === "turbo-modules" || project.viewConfig === "fabric-view") { -%>
149
- react {
150
- jsRootDir = file("../src/")
151
- libraryName = "<%- project.viewConfig !== null ? project.name + 'View' : project.name -%>"
152
- codegenJavaPackageName = "com.<%- project.package -%>"
153
- }
154
- <% } -%>
@@ -1,5 +1,4 @@
1
- import type { TurboModule } from 'react-native';
2
- import { TurboModuleRegistry } from 'react-native';
1
+ import { TurboModuleRegistry, type TurboModule } from 'react-native';
3
2
 
4
3
  export interface Spec extends TurboModule {
5
4
  multiply(a: number, b: number): number;
@@ -1,5 +1,4 @@
1
- import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
2
- import type { ViewProps } from 'react-native';
1
+ import { codegenNativeComponent, type ViewProps } from 'react-native';
3
2
 
4
3
  interface NativeProps extends ViewProps {
5
4
  color?: string;