Fix website yarn start
Summary: Inlining the component docs header instead of reading it from the same file we write to. Reviewed By: passy Differential Revision: D15199683 fbshipit-source-id: dc34e25b5f8073aa582f90a14bc875c8e8c431db
This commit is contained in:
committed by
Facebook Github Bot
parent
23b35e8006
commit
c866ba9428
@@ -11,6 +11,13 @@ const fs = require('fs');
|
||||
const babylon = require('@babel/parser');
|
||||
const docblockParser = require('docblock-parser');
|
||||
|
||||
const HEADER = `---
|
||||
id: ui-components
|
||||
title: UI Components
|
||||
---
|
||||
|
||||
Flipper has a lot of built in React components to build UIs. You can import them directly using e.g. \`import {Button} from 'flipper'\`.`;
|
||||
|
||||
const TARGET = __dirname + '/../docs/extending/ui-components.md';
|
||||
|
||||
glob(__dirname + '/../src/ui/components/**/*.js', (err, files) => {
|
||||
@@ -35,7 +42,7 @@ glob(__dirname + '/../src/ui/components/**/*.js', (err, files) => {
|
||||
.filter(Boolean)
|
||||
.map(generateMarkdown)
|
||||
.reduce((acc, cv) => acc + cv, '');
|
||||
fs.writeFileSync(TARGET, fs.readFileSync(TARGET) + content);
|
||||
fs.writeFileSync(TARGET, HEADER + content);
|
||||
});
|
||||
|
||||
// HOC are not supported by react-docgen. This means, styled-components will not
|
||||
|
||||
Reference in New Issue
Block a user