mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
progress
This commit is contained in:
@@ -157,14 +157,8 @@ function execute(options) {
|
||||
metadatas.config[key] = process.env[key];
|
||||
});
|
||||
|
||||
// fs.writeFileSync(
|
||||
// 'core/metadata.js',
|
||||
// '/**\n' +
|
||||
// ' * @generated\n' +
|
||||
// ' * @providesModule Metadata\n' +
|
||||
// ' */\n' +
|
||||
// 'module.exports = ' + JSON.stringify(metadatas, null, 2) + ';'
|
||||
// );
|
||||
console.log(`conversion finished.`)
|
||||
return JSON.stringify(metadatas, null, 2);
|
||||
}
|
||||
|
||||
if (argv.convert) {
|
||||
|
||||
+86
-86
@@ -10,101 +10,101 @@
|
||||
'use strict';
|
||||
|
||||
const components = [
|
||||
'build/Libraries/Components/ActivityIndicator/ActivityIndicator.js',
|
||||
'build/Libraries/Components/Button.js',
|
||||
'build/Libraries/Components/DatePicker/DatePickerIOS.ios.js',
|
||||
'build/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js',
|
||||
'build/Libraries/Lists/FlatList.js',
|
||||
'build/Libraries/Image/Image.ios.js',
|
||||
'build/Libraries/Components/Keyboard/KeyboardAvoidingView.js',
|
||||
'build/Libraries/Lists/ListView/ListView.js',
|
||||
'build/Libraries/Components/MaskedView/MaskedViewIOS.ios.js',
|
||||
'build/Libraries/Modal/Modal.js',
|
||||
'build/Libraries/Components/Navigation/NavigatorIOS.ios.js',
|
||||
'build/Libraries/Components/Picker/Picker.js',
|
||||
'build/Libraries/Components/Picker/PickerIOS.ios.js',
|
||||
'build/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js',
|
||||
'build/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js',
|
||||
'build/Libraries/Components/RefreshControl/RefreshControl.js',
|
||||
'build/Libraries/Components/ScrollView/ScrollView.js',
|
||||
'build/Libraries/Lists/SectionList.js',
|
||||
'build/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js',
|
||||
'build/Libraries/Components/Slider/Slider.js',
|
||||
'build/Libraries/RCTTest/SnapshotViewIOS.ios.js',
|
||||
'build/Libraries/Components/StatusBar/StatusBar.js',
|
||||
'build/Libraries/Components/Switch/Switch.js',
|
||||
'build/Libraries/Components/TabBarIOS/TabBarIOS.ios.js',
|
||||
'build/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js',
|
||||
'build/Libraries/Text/Text.js',
|
||||
'build/Libraries/Components/TextInput/TextInput.js',
|
||||
'build/Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js',
|
||||
'build/Libraries/Components/Touchable/TouchableHighlight.js',
|
||||
'build/Libraries/Components/Touchable/TouchableNativeFeedback.android.js',
|
||||
'build/Libraries/Components/Touchable/TouchableOpacity.js',
|
||||
'build/Libraries/Components/Touchable/TouchableWithoutFeedback.js',
|
||||
'build/Libraries/Components/View/View.js',
|
||||
'build/Libraries/Components/ViewPager/ViewPagerAndroid.android.js',
|
||||
'build/Libraries/Lists/VirtualizedList.js',
|
||||
'build/Libraries/Components/WebView/WebView.ios.js',
|
||||
'../Libraries/Components/ActivityIndicator/ActivityIndicator.js',
|
||||
'../Libraries/Components/Button.js',
|
||||
'../Libraries/Components/CheckBox/CheckBox.android.js',
|
||||
'../Libraries/Components/DatePicker/DatePickerIOS.ios.js',
|
||||
'../Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js',
|
||||
'../Libraries/Lists/FlatList.js',
|
||||
'../Libraries/Image/Image.ios.js',
|
||||
'../Libraries/Components/Keyboard/KeyboardAvoidingView.js',
|
||||
'../Libraries/Lists/ListView/ListView.js',
|
||||
'../Libraries/Components/MaskedView/MaskedViewIOS.ios.js',
|
||||
'../Libraries/Modal/Modal.js',
|
||||
'../Libraries/Components/Navigation/NavigatorIOS.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',
|
||||
'../Libraries/Components/ScrollView/ScrollView.js',
|
||||
'../Libraries/Lists/SectionList.js',
|
||||
'../Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js',
|
||||
'../Libraries/Components/Slider/Slider.js',
|
||||
'../Libraries/RCTTest/SnapshotViewIOS.ios.js',
|
||||
'../Libraries/Components/StatusBar/StatusBar.js',
|
||||
'../Libraries/Components/Switch/Switch.js',
|
||||
'../Libraries/Components/TabBarIOS/TabBarIOS.ios.js',
|
||||
'../Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js',
|
||||
'../Libraries/Text/Text.js',
|
||||
'../Libraries/Components/TextInput/TextInput.js',
|
||||
'../Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js',
|
||||
'../Libraries/Components/Touchable/TouchableHighlight.js',
|
||||
'../Libraries/Components/Touchable/TouchableNativeFeedback.android.js',
|
||||
'../Libraries/Components/Touchable/TouchableOpacity.js',
|
||||
'../Libraries/Components/Touchable/TouchableWithoutFeedback.js',
|
||||
'../Libraries/Components/View/View.js',
|
||||
'../Libraries/Components/ViewPager/ViewPagerAndroid.android.js',
|
||||
'../Libraries/Lists/VirtualizedList.js',
|
||||
'../Libraries/Components/WebView/WebView.ios.js',
|
||||
];
|
||||
|
||||
const apis = [
|
||||
'build/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js',
|
||||
'build/Libraries/ActionSheetIOS/ActionSheetIOS.js',
|
||||
'build/Libraries/Alert/Alert.js',
|
||||
'build/Libraries/Alert/AlertIOS.js',
|
||||
'build/Libraries/Animated/src/AnimatedImplementation.js',
|
||||
'build/Libraries/ReactNative/AppRegistry.js',
|
||||
'build/Libraries/AppState/AppState.js',
|
||||
'build/Libraries/Storage/AsyncStorage.js',
|
||||
'build/Libraries/Utilities/BackAndroid.js',
|
||||
'build/Libraries/Utilities/BackHandler.ios.js',
|
||||
'build/Libraries/Utilities/BackHandler.android.js',
|
||||
'build/Libraries/CameraRoll/CameraRoll.js',
|
||||
'build/Libraries/Components/Clipboard/Clipboard.js',
|
||||
'build/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js',
|
||||
'build/Libraries/Utilities/Dimensions.js',
|
||||
'build/Libraries/Animated/src/Easing.js',
|
||||
'build/Libraries/Geolocation/Geolocation.js',
|
||||
'build/Libraries/Image/ImageEditor.js',
|
||||
'build/Libraries/CameraRoll/ImagePickerIOS.js',
|
||||
'build/Libraries/Image/ImageStore.js',
|
||||
'build/Libraries/Interaction/InteractionManager.js',
|
||||
'build/Libraries/Components/Keyboard/Keyboard.js',
|
||||
'build/Libraries/LayoutAnimation/LayoutAnimation.js',
|
||||
'build/Libraries/Linking/Linking.js',
|
||||
'build/Libraries/Lists/ListView/ListViewDataSource.js',
|
||||
'build/Libraries/Network/NetInfo.js',
|
||||
'build/Libraries/Interaction/PanResponder.js',
|
||||
'build/Libraries/PermissionsAndroid/PermissionsAndroid.js',
|
||||
'build/Libraries/Utilities/PixelRatio.js',
|
||||
'build/Libraries/PushNotificationIOS/PushNotificationIOS.js',
|
||||
'build/Libraries/Settings/Settings.ios.js',
|
||||
'build/Libraries/Share/Share.js',
|
||||
'build/Libraries/Components/StatusBar/StatusBarIOS.ios.js',
|
||||
'build/Libraries/StyleSheet/StyleSheet.js',
|
||||
'build/Libraries/Performance/Systrace.js',
|
||||
'build/Libraries/Components/TimePickerAndroid/TimePickerAndroid.android.js',
|
||||
'build/Libraries/Components/ToastAndroid/ToastAndroid.android.js',
|
||||
'build/Libraries/Vibration/Vibration.js',
|
||||
'build/Libraries/Vibration/VibrationIOS.ios.js',
|
||||
'../Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js',
|
||||
'../Libraries/ActionSheetIOS/ActionSheetIOS.js',
|
||||
'../Libraries/Alert/Alert.js',
|
||||
'../Libraries/Alert/AlertIOS.js',
|
||||
'../Libraries/Animated/src/AnimatedImplementation.js',
|
||||
'../Libraries/ReactNative/AppRegistry.js',
|
||||
'../Libraries/AppState/AppState.js',
|
||||
'../Libraries/Storage/AsyncStorage.js',
|
||||
'../Libraries/Utilities/BackAndroid.js',
|
||||
'../Libraries/Utilities/BackHandler.ios.js',
|
||||
'../Libraries/Utilities/BackHandler.android.js',
|
||||
'../Libraries/CameraRoll/CameraRoll.js',
|
||||
'../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/Interaction/InteractionManager.js',
|
||||
'../Libraries/Components/Keyboard/Keyboard.js',
|
||||
'../Libraries/LayoutAnimation/LayoutAnimation.js',
|
||||
'../Libraries/Linking/Linking.js',
|
||||
'../Libraries/Lists/ListView/ListViewDataSource.js',
|
||||
'../Libraries/Network/NetInfo.js',
|
||||
'../Libraries/Interaction/PanResponder.js',
|
||||
'../Libraries/PermissionsAndroid/PermissionsAndroid.js',
|
||||
'../Libraries/Utilities/PixelRatio.js',
|
||||
'../Libraries/PushNotificationIOS/PushNotificationIOS.js',
|
||||
'../Libraries/Settings/Settings.ios.js',
|
||||
'../Libraries/Share/Share.js',
|
||||
'../Libraries/Components/StatusBar/StatusBarIOS.ios.js',
|
||||
'../Libraries/StyleSheet/StyleSheet.js',
|
||||
'../Libraries/Performance/Systrace.js',
|
||||
'../Libraries/Components/TimePickerAndroid/TimePickerAndroid.android.js',
|
||||
'../Libraries/Components/ToastAndroid/ToastAndroid.android.js',
|
||||
'../Libraries/Vibration/Vibration.js',
|
||||
'../Libraries/Vibration/VibrationIOS.ios.js',
|
||||
];
|
||||
|
||||
const stylesForEmbed = [
|
||||
'build/Libraries/Components/View/ViewStylePropTypes.js',
|
||||
'build/Libraries/Text/TextStylePropTypes.js',
|
||||
'build/Libraries/Image/ImageStylePropTypes.js',
|
||||
'../Libraries/Components/View/ViewStylePropTypes.js',
|
||||
'../Libraries/Text/TextStylePropTypes.js',
|
||||
'../Libraries/Image/ImageStylePropTypes.js',
|
||||
];
|
||||
|
||||
const stylesWithPermalink = [
|
||||
'build/Libraries/StyleSheet/LayoutPropTypes.js',
|
||||
'build/Libraries/StyleSheet/TransformPropTypes.js',
|
||||
'build/Libraries/Components/View/ShadowPropTypesIOS.js',
|
||||
'build/Libraries/Components/View/ViewPropTypes.js',
|
||||
...stylesForEmbed,
|
||||
];
|
||||
'../Libraries/StyleSheet/LayoutPropTypes.js',
|
||||
'../Libraries/StyleSheet/TransformPropTypes.js',
|
||||
'../Libraries/Components/View/ShadowPropTypesIOS.js',
|
||||
'../Libraries/Components/View/ViewPropTypes.js',
|
||||
].concat(stylesForEmbed);
|
||||
|
||||
const viewPropTypes = 'build/Libraries/Components/View/ViewPropTypes.js';
|
||||
const viewPropTypes = '../Libraries/Components/View/ViewPropTypes.js';
|
||||
|
||||
module.exports = {
|
||||
components,
|
||||
@@ -112,4 +112,4 @@ module.exports = {
|
||||
stylesWithPermalink,
|
||||
stylesForEmbed,
|
||||
viewPropTypes,
|
||||
};
|
||||
};
|
||||
@@ -258,7 +258,7 @@ function getViewPropTypes() {
|
||||
}
|
||||
|
||||
return docgen.parse(
|
||||
fs.readFileSync(docsList.viewPropTypes),
|
||||
fs.readFileSync(docsList.viewPropTypes.replace('../','')),
|
||||
viewPropTypesResolver,
|
||||
[
|
||||
viewPropTypesConversionHandler,
|
||||
@@ -268,8 +268,9 @@ function getViewPropTypes() {
|
||||
}
|
||||
|
||||
function renderComponent(filepath) {
|
||||
filepath = filepath.replace('../','');
|
||||
if (!fs.existsSync(filepath)) {
|
||||
// We're processing old versions of the docs that may be missing newer libraries.
|
||||
console.log(`${filepath} does not exist at ${process.cwd()}`);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@@ -520,7 +521,6 @@ function renderStyle(filepath) {
|
||||
const all = docsList.components
|
||||
.concat(docsList.apis)
|
||||
.concat(docsList.stylesWithPermalink);
|
||||
|
||||
const styleDocs = docsList.stylesForEmbed.reduce(function(docs, filepath) {
|
||||
docs[path.basename(filepath).replace(path.extname(filepath), '')] =
|
||||
docgen.parse(
|
||||
@@ -543,6 +543,7 @@ function extractDocs() {
|
||||
return renderAPI(filepath, 'api');
|
||||
});
|
||||
var styles = docsList.stylesWithPermalink.map(renderStyle);
|
||||
|
||||
return [].concat(
|
||||
components,
|
||||
apis,
|
||||
|
||||
+116
-92
@@ -18,7 +18,7 @@ const mkdirp = require('mkdirp');
|
||||
const Promise = require('bluebird');
|
||||
const shell = require('shelljs');
|
||||
|
||||
// const convert = require('./convert.js');
|
||||
const convert = require('./convert.js');
|
||||
const slugify = require('../core/slugify');
|
||||
|
||||
const CWD = process.cwd();
|
||||
@@ -39,8 +39,8 @@ const SIDEBAR_DIR = 'versioned_sidebars';
|
||||
const { JSDOM } = jsdom;
|
||||
|
||||
// Start up a server. Don't forget to close the connection when done.
|
||||
// const server = require('./server.js');
|
||||
// server.noconvert = true;
|
||||
const server = require('./server.js');
|
||||
server.noconvert = true;
|
||||
|
||||
const argv = require('minimist')(process.argv.slice(2), {
|
||||
alias: {
|
||||
@@ -119,31 +119,35 @@ function generateAutodocForFile(file, options) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates Markdown documentation. Uses the convert script to extract docs from source files.
|
||||
*
|
||||
* Generates Markdown documentation.
|
||||
* Uses the convert script to extract docs from source files.
|
||||
*/
|
||||
function generateAutodocs(options = { version: 'next' }) {
|
||||
console.log(`Generating Markdown files from JavaScript sources for version ${options.version}.`);
|
||||
convert({extractDocs: true});
|
||||
let queue = Promise.resolve();
|
||||
function generateAutodocs(options = { }) {
|
||||
console.log(`Generating Markdown files from JavaScript sources.`);
|
||||
|
||||
return Promise.resolve().then(function() {
|
||||
return glob('src/**/*.js');
|
||||
}).then(function(files) {
|
||||
let p = Promise.resolve();
|
||||
files.forEach(function(file) {
|
||||
p = p.then(function() {
|
||||
return generateAutodocForFile(file, options);
|
||||
const metadata = convert({extractDocs: true});
|
||||
return Promise.resolve()
|
||||
.then(function() {
|
||||
return glob('src/**/*.js');
|
||||
})
|
||||
.then(function(files) {
|
||||
let queue = Promise.resolve();
|
||||
files.forEach(function(file) {
|
||||
queue = queue.then(function() {
|
||||
return generateAutodocForFile(file, options);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
return p;
|
||||
}).then(function() {
|
||||
console.log(`Generated Markdown files from JavaScript sources for version ${options.version}.`);
|
||||
}).catch(function(e) {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
});
|
||||
return queue;
|
||||
})
|
||||
.then(function() {
|
||||
console.log(`Generated Markdown files from JavaScript sources.`);
|
||||
return metadata;
|
||||
})
|
||||
.catch(function(e) {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
// Check out gh-pages branch
|
||||
@@ -272,76 +276,90 @@ function checkOutDocs() {
|
||||
function checkoutMasterDocs() {
|
||||
const pathToGitCheckout = filepath.create(BUILD_DIR, CHECKOUT_DIR);
|
||||
|
||||
let sidebarMetadata = {};
|
||||
const p = Promise.resolve();
|
||||
return p
|
||||
.then(() => {
|
||||
return fs.ensureDir(pathToGitCheckout.toString());
|
||||
})
|
||||
.then(() => {
|
||||
shell.cd(CWD);
|
||||
shell.cd(BUILD_DIR);
|
||||
shell.cd(CHECKOUT_DIR);
|
||||
return fs.exists(pathToGitCheckout.append(`.git`).toString())
|
||||
}).then(gitCheckoutExists => {
|
||||
if (!gitCheckoutExists) {
|
||||
shell.exec(`git init`).code !== 0;
|
||||
|
||||
if (shell.exec(`git remote add origin ${remoteBranch}`).code !== 0) {
|
||||
throw new Error('Error: git remote failed');
|
||||
let sidebarMetadata = {};
|
||||
const p = Promise.resolve();
|
||||
return p
|
||||
.then(() => {
|
||||
return fs.ensureDir(pathToGitCheckout.toString());
|
||||
})
|
||||
.then(() => {
|
||||
shell.cd(CWD);
|
||||
shell.cd(BUILD_DIR);
|
||||
shell.cd(CHECKOUT_DIR);
|
||||
return fs.exists(pathToGitCheckout.append(`.git`).toString())
|
||||
})
|
||||
.then(gitCheckoutExists => {
|
||||
if (!gitCheckoutExists) {
|
||||
shell.exec(`git init`).code !== 0;
|
||||
|
||||
if (shell.exec(`git remote add origin ${remoteBranch}`).code !== 0) {
|
||||
throw new Error('Error: git remote failed');
|
||||
}
|
||||
}
|
||||
return;
|
||||
})
|
||||
.then(() => {
|
||||
if (shell.exec(`git fetch`).code !== 0) {
|
||||
throw new Error('Error: git fetch failed');
|
||||
}
|
||||
shell.exec(`git config core.sparsecheckout true`).code !== 0;
|
||||
shell.exec(`echo "docs/*" >> .git/info/sparse-checkout`).code !== 0;
|
||||
shell.exec(`echo "Libraries/*" >> .git/info/sparse-checkout`).code !== 0;
|
||||
|
||||
if (shell.exec(`git checkout master`).code !== 0) {
|
||||
throw new Error('Error: git checkout failed');
|
||||
}
|
||||
|
||||
return glob('docs/**/*.md');
|
||||
})
|
||||
.then((files) => {
|
||||
let seq = Promise.resolve();
|
||||
files.forEach((file) => {
|
||||
seq = seq.then(() => {
|
||||
return fs.readFile(file, 'utf8');
|
||||
}).then((originalMarkdown) => {
|
||||
const frontmatter = fm(originalMarkdown);
|
||||
|
||||
const category = frontmatter.attributes.category;
|
||||
const transformedMarkdown = [
|
||||
'---',
|
||||
'id: ' + frontmatter.attributes.id,
|
||||
'title: ' + frontmatter.attributes.title,
|
||||
'---',
|
||||
frontmatter.body
|
||||
].filter(function(line) {
|
||||
return line;
|
||||
}).join('\n');
|
||||
|
||||
if (!sidebarMetadata.hasOwnProperty(category)) {
|
||||
sidebarMetadata[category] = [];
|
||||
}
|
||||
}
|
||||
return;
|
||||
})
|
||||
.then(() => {
|
||||
if (shell.exec(`git fetch`).code !== 0) {
|
||||
throw new Error('Error: git fetch failed');
|
||||
}
|
||||
|
||||
shell.exec(`git config core.sparsecheckout true`).code !== 0;
|
||||
shell.exec(`echo "docs/*" >> .git/info/sparse-checkout`).code !== 0;
|
||||
shell.exec(`echo "Libraries/*" >> .git/info/sparse-checkout`).code !== 0;
|
||||
|
||||
if (shell.exec(`git checkout master`).code !== 0) {
|
||||
throw new Error('Error: git checkout failed');
|
||||
}
|
||||
|
||||
return glob('docs/**/*.md');
|
||||
}).then((files) => {
|
||||
let seq = Promise.resolve();
|
||||
files.forEach((file) => {
|
||||
seq = seq.then(() => {
|
||||
console.log(`reading ${file}`)
|
||||
return fs.readFile(file);
|
||||
}).then((originalMarkdown) => {
|
||||
console.log(`got:\n${originalMarkdown}`)
|
||||
const frontmatter = fm(originalMarkdown);
|
||||
|
||||
const transformedMarkdown = [
|
||||
'---',
|
||||
'id: ' + frontmatter.attributes.id,
|
||||
'title: ' + frontmatter.attributes.title,
|
||||
'---',
|
||||
frontmatter.body
|
||||
]
|
||||
.filter(function(line) {
|
||||
return line;
|
||||
})
|
||||
.join('\n');
|
||||
|
||||
const pathToOutputFile = filepath.create(CWD, '../..', 'docs', `${frontmatter.attributes.id}.${MARKDOWN_EXTENSION}`);
|
||||
return fs.outputFile(pathToOutputFile.toString(), transformedMarkdown);
|
||||
});
|
||||
|
||||
sidebarMetadata[category].push(frontmatter.attributes.id);
|
||||
|
||||
const pathToOutputFile = filepath.create(CWD, '..', 'docs', `${frontmatter.attributes.id}.${MARKDOWN_EXTENSION}`);
|
||||
return fs.outputFile(pathToOutputFile.toString(), transformedMarkdown);
|
||||
});
|
||||
// now we convert
|
||||
// now we handle sidebarring
|
||||
// and make versioned sidebar?
|
||||
return seq; //copy
|
||||
}).then(() => {
|
||||
// then finally we run docgen over Libraries/...
|
||||
console.log(`should codegen`)
|
||||
});
|
||||
|
||||
// now we convert
|
||||
// now we handle sidebarring
|
||||
// and make versioned sidebar?
|
||||
return seq; //copy
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
})
|
||||
.then(() => {
|
||||
return generateAutodocs();
|
||||
})
|
||||
.then(() => {
|
||||
console.log(`My sidebar: ${JSON.stringify(sidebarMetadata)}`);
|
||||
|
||||
// then finally we run docgen over Libraries/...
|
||||
console.log(`should codegen`)
|
||||
const pathToOutputFile = filepath.create(CWD, '..', 'website', `gen-sidebars.json`);
|
||||
return fs.outputFile(pathToOutputFile.toString(), { "docs": sidebarMetadata });
|
||||
});
|
||||
}
|
||||
|
||||
function extractDocVersionFromFilename(file) {
|
||||
@@ -477,7 +495,13 @@ if (argv.clean) {
|
||||
if (argv.autodocs) {
|
||||
runChecks();
|
||||
// checkOutDocs();
|
||||
checkoutMasterDocs();
|
||||
checkoutMasterDocs()
|
||||
.finally(function() {
|
||||
server.close();
|
||||
}).catch(function(e) {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
'use strict';
|
||||
const connect = require('connect');
|
||||
const convert = require('./convert.js');
|
||||
// const convert = require('./convert.js');
|
||||
const http = require('http');
|
||||
const optimist = require('optimist');
|
||||
const path = require('path');
|
||||
@@ -47,7 +47,7 @@ const app = connect()
|
||||
// but fast enough that we don't really need to care right now.
|
||||
if (!server.noconvert && req.url.match(/\.html|\/$/)) {
|
||||
var extractDocs = req.url.match(/\/docs/); // Lazily extract docs.
|
||||
convert({extractDocs});
|
||||
// convert({extractDocs});
|
||||
}
|
||||
next();
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user