File tree Expand file tree Collapse file tree 6 files changed +19
-14
lines changed
create-react-native-library
react-native-builder-bob/src Expand file tree Collapse file tree 6 files changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ If you have a reason to not ship Codegen generated scaffold code with your libra
150
150
]
151
151
```
152
152
153
- 3 . Add ` package.json ` to the ` exports ` field in your ` package.json ` :
153
+ 3 . If you have an ` exports ` field in your ` package.json ` , ensure that it contains ` ./ package.json` :
154
154
155
155
``` diff
156
156
"exports": {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import {
20
20
import { getDependencyVersionsFromExampleApp } from './exampleApp/dependencies' ;
21
21
import { printErrorHelp , printNextSteps , printUsedRNVersion } from './inform' ;
22
22
23
- const FALLBACK_BOB_VERSION = '0.36.0 ' ;
23
+ const FALLBACK_BOB_VERSION = '0.38.3 ' ;
24
24
const FALLBACK_NITRO_MODULES_VERSION = '0.22.1' ;
25
25
26
26
yargs
Original file line number Diff line number Diff line change @@ -90,17 +90,17 @@ const TYPE_CHOICES: {
90
90
value : 'turbo-module' ,
91
91
description : 'integration for native APIs to JS' ,
92
92
} ,
93
+ {
94
+ title : 'Fabric view' ,
95
+ value : 'fabric-view' ,
96
+ description : 'integration for native views to JS' ,
97
+ } ,
93
98
{
94
99
title : 'Nitro module' ,
95
100
value : 'nitro-module' ,
96
101
description :
97
102
'type-safe, fast integration for native APIs to JS (experimental)' ,
98
103
} ,
99
- {
100
- title : 'Fabric view' ,
101
- value : 'fabric-view' ,
102
- description : 'integration for native views to JS' ,
103
- } ,
104
104
{
105
105
title : 'Legacy Native module' ,
106
106
value : 'legacy-module' ,
Original file line number Diff line number Diff line change 15
15
"types" : " ./lib/typescript/commonjs/src/index.d.ts" ,
16
16
"default" : " ./lib/commonjs/index.js"
17
17
}
18
- }
18
+ },
19
+ "./package.json" : " ./package.json"
19
20
},
20
21
"files" : [
21
22
" src" ,
234
235
"android" : {
235
236
"javaPackageName" : " com.<%- project.package %>"
236
237
<% if (example === 'vanilla') { -%>
238
+ <% if (project.viewConfig === 'fabric-view') { -%>
239
+ },
240
+ "ios" : {
241
+ "componentProvider" : {
242
+ "<%- project.name -%>View" : " <%- project.name -%>View"
243
+ }
244
+ <% } -%>
237
245
},
238
246
"includesGeneratedCode" : true
239
247
<% } else { -%>
Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ exports[`initializes the configuration 1`] = `
17
17
" types" : " ./lib/typescript/commonjs/src/index.d.ts" ,
18
18
" default" : " ./lib/commonjs/index.js"
19
19
}
20
- }
20
+ },
21
+ " ./package.json" : " ./package.json"
21
22
},
22
23
" source" : " ./src/index.ts" ,
23
24
" main" : " ./lib/commonjs/index.js" ,
Original file line number Diff line number Diff line change @@ -242,6 +242,7 @@ export async function init() {
242
242
243
243
const exportsField = {
244
244
'.' : { } ,
245
+ './package.json' : './package.json' ,
245
246
} ;
246
247
247
248
const importField = {
@@ -265,11 +266,6 @@ export async function init() {
265
266
exportsField [ '.' ] = importField ;
266
267
}
267
268
268
- if ( pkg . codegenConfig && ! pkg . codegenConfig . includesGeneratedCode ) {
269
- // @ts -expect-error The exports is not strictly types therefore it doesn't know about the package.json property
270
- exportsField [ './package.json' ] = './package.json' ;
271
- }
272
-
273
269
if (
274
270
pkg . exports &&
275
271
JSON . stringify ( pkg . exports ) !== JSON . stringify ( exportsField )
You can’t perform that action at this time.
0 commit comments