-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ introduce separate package for navigation integration (#152)
* feat: ✨ introduce separate package for navigation integration * fix: 🐛 centralize tsconfig * fix: expo example * fix: 🐛 package.json definitions
- Loading branch information
1 parent
f35cf37
commit c6f9a8f
Showing
41 changed files
with
377 additions
and
425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,43 @@ | ||
const path = require('path'); | ||
const pak = require('../../packages/react-native-bottom-tabs/package.json'); | ||
const fs = require('fs'); | ||
|
||
module.exports = { | ||
presets: ['babel-preset-expo'], | ||
plugins: [ | ||
[ | ||
'module-resolver', | ||
const packages = path.resolve(__dirname, '..', '..', 'packages'); | ||
|
||
/** @type {import('@babel/core').TransformOptions} */ | ||
module.exports = function (api) { | ||
api.cache(true); | ||
|
||
const alias = Object.fromEntries( | ||
fs | ||
.readdirSync(packages) | ||
.filter((name) => !name.startsWith('.')) | ||
.map((name) => { | ||
const pak = require(`../../packages/${name}/package.json`); | ||
|
||
if (pak.source == null) { | ||
return null; | ||
} | ||
|
||
return [pak.name, path.resolve(packages, name, pak.source)]; | ||
}) | ||
.filter(Boolean) | ||
); | ||
|
||
return { | ||
presets: ['babel-preset-expo'], | ||
overrides: [ | ||
{ | ||
extensions: ['.tsx', '.ts', '.js', '.json'], | ||
alias: { | ||
'react-native-bottom-tabs': path.join( | ||
__dirname, | ||
'../../packages/react-native-bottom-tabs', | ||
pak.source | ||
), | ||
}, | ||
exclude: /\/node_modules\//, | ||
plugins: [ | ||
[ | ||
'module-resolver', | ||
{ | ||
extensions: ['.tsx', '.ts', '.js', '.json'], | ||
alias, | ||
}, | ||
], | ||
], | ||
}, | ||
], | ||
], | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,43 @@ | ||
const path = require('path'); | ||
const pak = require('../../packages/react-native-bottom-tabs/package.json'); | ||
const fs = require('fs'); | ||
|
||
module.exports = { | ||
presets: ['module:@react-native/babel-preset'], | ||
plugins: [ | ||
[ | ||
'module-resolver', | ||
const packages = path.resolve(__dirname, '..', '..', 'packages'); | ||
|
||
/** @type {import('@babel/core').TransformOptions} */ | ||
module.exports = function (api) { | ||
api.cache(true); | ||
|
||
const alias = Object.fromEntries( | ||
fs | ||
.readdirSync(packages) | ||
.filter((name) => !name.startsWith('.')) | ||
.map((name) => { | ||
const pak = require(`../../packages/${name}/package.json`); | ||
|
||
if (pak.source == null) { | ||
return null; | ||
} | ||
|
||
return [pak.name, path.resolve(packages, name, pak.source)]; | ||
}) | ||
.filter(Boolean) | ||
); | ||
|
||
return { | ||
presets: ['module:@react-native/babel-preset'], | ||
overrides: [ | ||
{ | ||
extensions: ['.tsx', '.ts', '.js', '.json'], | ||
alias: { | ||
'react-native-bottom-tabs': path.join( | ||
__dirname, | ||
'../../packages/react-native-bottom-tabs', | ||
pak.source | ||
), | ||
}, | ||
exclude: /\/node_modules\//, | ||
plugins: [ | ||
[ | ||
'module-resolver', | ||
{ | ||
extensions: ['.tsx', '.ts', '.js', '.json'], | ||
alias, | ||
}, | ||
], | ||
], | ||
}, | ||
], | ||
], | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,10 @@ | ||
{ | ||
"extends": "../../tsconfig", | ||
"references": [ | ||
{ "path": "../../packages/react-native-bottom-tabs" }, | ||
{ "path": "../../packages/react-navigation" }, | ||
], | ||
"compilerOptions": { | ||
"paths": { | ||
"react-native-bottom-tabs": ["../../packages/react-native-bottom-tabs/src/index"], | ||
"react-native-bottom-tabs/react-navigation": [ | ||
"../../packages/react-native-bottom-tabs/src/react-navigation/index" | ||
] | ||
}, | ||
"allowUnreachableCode": false, | ||
"allowUnusedLabels": false, | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"jsx": "react-jsx", | ||
"lib": ["ESNext"], | ||
"module": "ESNext", | ||
"moduleResolution": "Bundler", | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitReturns": true, | ||
"noImplicitUseStrict": false, | ||
"noStrictGenericChecks": false, | ||
"noUncheckedIndexedAccess": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"strict": true, | ||
"target": "ESNext", | ||
"verbatimModuleSyntax": true | ||
"rootDir": "." | ||
} | ||
} |
Oops, something went wrong.