Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"light-date": "^1.2.0"
},
"devDependencies": {
"react-native-ui-lib": "7.46.3-snapshot.7352",
"react-native-ui-lib": "7.46.3-snapshot.7426",
"shell-utils": "^1.0.10"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions docuilib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
"@types/react": "18.3.24",
"@types/react-helmet": "^6.1.2",
"@types/react-router-dom": "^5.1.8",
"metro-react-native-babel-preset": "0.77.3",
"metro-react-native-babel-preset": "^0.77.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-native-linear-gradient": "2.6.2",
"react-native-shimmer-placeholder": "^2.0.9",
"react-native-ui-lib": "7.46.3-snapshot.7352",
"react-native-ui-lib": "7.46.3-snapshot.7426",
"shell-utils": "^1.0.10",
"typescript": "~5.2.2"
},
Expand Down
36 changes: 20 additions & 16 deletions docuilib/plugins/uilib.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@ const path = require('path');
const webpack = require('webpack');

module.exports = ({siteDir}, _options) => {
// RN modules that must be transpiled (regardless of hoisted location)
const rnModules = [
'react-native-web',
'react-native-ui-lib',
'react-native-reanimated',
'react-native-shimmer-placeholder',
'react-native-linear-gradient'
];
const makeNodeModulesRegex = (name) => new RegExp(`node_modules[\\\\/]${name}[\\\\/]`);

// Absolute paths (when packages are installed inside docuilib)
const inSiteNodeModules = rnModules.map(m => path.resolve(siteDir, 'node_modules', m));
// Regex match to also catch hoisted locations (e.g. root/node_modules)
const hoistedNodeModulesRegexes = rnModules.map(makeNodeModulesRegex);

const baseProjectSource = [
// Project sources
path.resolve(siteDir, 'src'),
path.resolve(siteDir, 'node_modules/react-native-web'),
path.resolve(siteDir, 'node_modules/react-native-ui-lib'),
path.resolve(siteDir, 'node_modules/react-native-shimmer-placeholder'),
path.resolve(siteDir, 'node_modules/react-native-reanimated'),
path.resolve(siteDir, 'node_modules/react-native-linear-gradient')
// just for not getting warnings
// path.resolve(siteDir, 'node_modules/react-native-haptic-feedback'),
// path.resolve(siteDir, 'node_modules/react-native-animatable'),
// path.resolve(siteDir, 'node_modules/react-native-svg'),
// path.resolve(siteDir, 'node_modules/react-native-svg-transformer'),
// path.resolve(siteDir, 'node_modules/@react-native-community/netinfo'),
// path.resolve(siteDir, 'node_modules/@react-native-community/datetimepicker'),
// path.resolve(siteDir, 'node_modules/react-native-color'),

// path.resolve(siteDir, 'node_modules/postcss'),
// path.resolve(siteDir, 'node_modules/postcss-js')
// Specific absolute locations
...inSiteNodeModules,
// And any hoisted locations matching these node_modules
...hoistedNodeModulesRegexes
];

const useBabelForRN = {
Expand Down
Loading