mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 11:34:23 +00:00
Add more autogenerated documentation to the whitelist
Summary: I went through and checked what React Native exports that we don't have any autogen docs for, and added the missing stuff into the whitelist. The extra docs seem useful. Still not reference-documented because docgen chokes: AppStateIOS ART Keyboard LinkingIOS Platform RecyclerViewBackedScrollView Touchable UIManager I also fixed up a bit of alphabetical order Closes https://github.com/facebook/react-native/pull/8791 Differential Revision: D3566466 Pulled By: lacker fbshipit-source-id: 0d7c1f242c96bf9afe5f8b54ea7e0b6891effa4b
This commit is contained in:
parent
2b1b8418f0
commit
81bf5decb1
@ -257,6 +257,7 @@ function getTypedef(filepath, fileContent, json) {
|
||||
}
|
||||
|
||||
function renderComponent(filepath) {
|
||||
try {
|
||||
const fileContent = fs.readFileSync(filepath);
|
||||
const json = docgen.parse(
|
||||
fileContent,
|
||||
@ -270,6 +271,10 @@ function renderComponent(filepath) {
|
||||
json.typedef = getTypedef(filepath, fileContent);
|
||||
|
||||
return componentsToMarkdown('component', json, filepath, componentCount++, styleDocs);
|
||||
} catch (e) {
|
||||
console.log('error in renderComponent for', filepath);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
function isJsDocFormat(fileContent) {
|
||||
@ -330,6 +335,9 @@ function parseAPIInferred(filepath, fileContent) {
|
||||
let json;
|
||||
try {
|
||||
json = jsDocs(fileContent);
|
||||
if (!json) {
|
||||
throw new Error('jsDocs returned falsy');
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Cannot parse file', filepath, e);
|
||||
json = {};
|
||||
@ -427,11 +435,12 @@ function getJsDocFormatType(entities) {
|
||||
}
|
||||
|
||||
function renderAPI(filepath, type) {
|
||||
try {
|
||||
const fileContent = fs.readFileSync(filepath).toString();
|
||||
let json = parseAPIInferred(filepath, fileContent);
|
||||
if (isJsDocFormat(fileContent)) {
|
||||
let jsonJsDoc = parseAPIJsDocFormat(filepath, fileContent);
|
||||
// Combine method info with jsdoc fomatted content
|
||||
// Combine method info with jsdoc formatted content
|
||||
const methods = json.methods;
|
||||
if (methods && methods.length) {
|
||||
let modMethods = methods;
|
||||
@ -448,6 +457,10 @@ function renderAPI(filepath, type) {
|
||||
json = jsonJsDoc;
|
||||
}
|
||||
return componentsToMarkdown(type, json, filepath, componentCount++);
|
||||
} catch (e) {
|
||||
console.log('error in renderAPI for', filepath);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
function renderStyle(filepath) {
|
||||
@ -472,6 +485,7 @@ function renderStyle(filepath) {
|
||||
|
||||
const components = [
|
||||
'../Libraries/Components/ActivityIndicator/ActivityIndicator.js',
|
||||
'../Libraries/Components/ActivityIndicator/ActivityIndicatorIOS.ios.js',
|
||||
'../Libraries/Components/DatePicker/DatePickerIOS.ios.js',
|
||||
'../Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js',
|
||||
'../Libraries/Image/Image.ios.js',
|
||||
@ -480,8 +494,8 @@ const components = [
|
||||
'../Libraries/Modal/Modal.js',
|
||||
'../Libraries/CustomComponents/Navigator/Navigator.js',
|
||||
'../Libraries/Components/Navigation/NavigatorIOS.ios.js',
|
||||
'../Libraries/Components/Picker/PickerIOS.ios.js',
|
||||
'../Libraries/Components/Picker/Picker.js',
|
||||
'../Libraries/Components/Picker/PickerIOS.ios.js',
|
||||
'../Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js',
|
||||
'../Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js',
|
||||
'../Libraries/Components/RefreshControl/RefreshControl.js',
|
||||
@ -490,7 +504,10 @@ const components = [
|
||||
'../Libraries/Components/Slider/Slider.js',
|
||||
'../Libraries/Components/SliderIOS/SliderIOS.ios.js',
|
||||
'../Libraries/Components/StatusBar/StatusBar.js',
|
||||
'../Libraries/RCTTest/SnapshotViewIOS.ios.js',
|
||||
'../Libraries/Components/Switch/Switch.js',
|
||||
'../Libraries/Components/SwitchAndroid/SwitchAndroid.android.js',
|
||||
'../Libraries/Components/SwitchIOS/SwitchIOS.ios.js',
|
||||
'../Libraries/Components/TabBarIOS/TabBarIOS.ios.js',
|
||||
'../Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js',
|
||||
'../Libraries/Text/Text.js',
|
||||
@ -507,6 +524,7 @@ const components = [
|
||||
|
||||
const apis = [
|
||||
'../Libraries/ActionSheetIOS/ActionSheetIOS.js',
|
||||
'../Libraries/AdSupport/AdSupportIOS.js',
|
||||
'../Libraries/Utilities/Alert.js',
|
||||
'../Libraries/Utilities/AlertIOS.js',
|
||||
'../Libraries/Animated/src/AnimatedImplementation.js',
|
||||
@ -518,23 +536,30 @@ const apis = [
|
||||
'../Libraries/Components/Clipboard/Clipboard.js',
|
||||
'../Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js',
|
||||
'../Libraries/Utilities/Dimensions.js',
|
||||
'../Libraries/Animated/src/Easing.js',
|
||||
'../Libraries/Geolocation/Geolocation.js',
|
||||
'../Libraries/Image/ImageEditor.js',
|
||||
'../Libraries/CameraRoll/ImagePickerIOS.js',
|
||||
'../Libraries/Image/ImageStore.js',
|
||||
'../Libraries/Components/Intent/IntentAndroid.android.js',
|
||||
'../Libraries/Interaction/InteractionManager.js',
|
||||
'../Libraries/LayoutAnimation/LayoutAnimation.js',
|
||||
'../Libraries/Linking/Linking.js',
|
||||
'../Libraries/CustomComponents/ListView/ListViewDataSource.js',
|
||||
'../node_modules/react/lib/NativeMethodsMixin.js',
|
||||
'../Libraries/BatchedBridge/BatchedBridgedModules/NativeModules.js',
|
||||
'../Libraries/Network/NetInfo.js',
|
||||
'../Libraries/Interaction/PanResponder.js',
|
||||
'../Libraries/Utilities/PixelRatio.js',
|
||||
'../Libraries/PushNotificationIOS/PushNotificationIOS.js',
|
||||
'../Libraries/Settings/Settings.ios.js',
|
||||
'../Libraries/Components/StatusBar/StatusBarIOS.ios.js',
|
||||
'../Libraries/StyleSheet/StyleSheet.js',
|
||||
'../Libraries/Utilities/Systrace.js',
|
||||
'../Libraries/Components/TimePickerAndroid/TimePickerAndroid.android.js',
|
||||
'../Libraries/Components/ToastAndroid/ToastAndroid.android.js',
|
||||
'../Libraries/Vibration/VibrationIOS.ios.js',
|
||||
'../Libraries/Vibration/Vibration.js',
|
||||
'../Libraries/Vibration/VibrationIOS.ios.js',
|
||||
];
|
||||
|
||||
const stylesWithPermalink = [
|
||||
|
Loading…
x
Reference in New Issue
Block a user