Skip to content

Commit

Permalink
'[skip ci] [RN] Add support for src directory in react-native (facebo…
Browse files Browse the repository at this point in the history
…ok#42385)

Summary:
Pull Request resolved: facebook#42385

This adds support for having JS files in a  directory within the  package. The plan is to have 2 subdirectories there:
*  for private modules, with any nested directories (e.g.: ).
*  for public modules, without nested directories. The plan is that the individual modules created in this directory will be public through the index module or directly via something like  (mapped to , or a  directory in the published npm package—details TBD).

The enforcement of private modules being inaccessible from outside the  package will be added soon by huntie.

Changelog: [internal]

Reviewed By: huntie

Differential Revision: D52875999

fbshipit-source-id: 8fe740876285a70c535eecc3c2201142af1c8974
  • Loading branch information
rubennorte authored and facebook-github-bot committed Jan 19, 2024
1 parent 461edd2 commit f075eac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ module.exports = {
},
},
{
files: ['packages/react-native/Libraries/**/*.js'],
files: [
'packages/react-native/Libraries/**/*.js',
'packages/react-native/src/**/*.js',
],
rules: {
'@react-native/platform-colors': 2,
'@react-native/specs/react-native-modules': 2,
Expand Down
5 changes: 4 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ module.exports = {
'denodeify',
],
testEnvironment: 'node',
collectCoverageFrom: ['packages/react-native/Libraries/**/*.js'],
collectCoverageFrom: [
'packages/react-native/Libraries/**/*.js',
'packages/react-native/src/**/*.js',
],
coveragePathIgnorePatterns: [
'/__tests__/',
'/vendor/',
Expand Down
1 change: 1 addition & 0 deletions packages/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"sdks/hermes-engine",
"sdks/hermesc",
"settings.gradle.kts",
"src",
"template.config.js",
"template",
"!template/node_modules",
Expand Down

0 comments on commit f075eac

Please sign in to comment.