File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,21 @@ import { mapWorkspaceToPackages } from '../release/utils/workspace';
20
20
import { projectRoot } from '../utils' ;
21
21
import fs from 'fs' ;
22
22
import glob from 'glob' ;
23
+ import { join } from 'path' ;
23
24
import * as yargs from 'yargs' ;
24
25
26
+ /**
27
+ * Add to devsite files to alert anyone trying to make a documentation fix
28
+ * to the generated files.
29
+ */
30
+ const GOOGLE3_HEADER = `{% comment %}
31
+ DO NOT EDIT THIS FILE!
32
+ This is generated by the JS SDK team, and any local changes will be
33
+ overwritten. Changes should be made in the source code at
34
+ https://github.com/firebase/firebase-js-sdk
35
+ {% endcomment %}
36
+ ` ;
37
+
25
38
const tmpDir = `${ projectRoot } /temp` ;
26
39
27
40
yargs
@@ -101,6 +114,15 @@ async function generateDocs(forDevsite: boolean = false) {
101
114
{ stdio : 'inherit' }
102
115
) ;
103
116
117
+ if ( forDevsite ) {
118
+ const mdFiles = fs . readdirSync ( join ( projectRoot , outputFolder ) ) ;
119
+ for ( const mdFile of mdFiles ) {
120
+ const fullPath = join ( projectRoot , outputFolder , mdFile ) ;
121
+ const content = fs . readFileSync ( fullPath , 'utf-8' ) ;
122
+ fs . writeFileSync ( fullPath , GOOGLE3_HEADER + content ) ;
123
+ }
124
+ }
125
+
104
126
moveRulesUnitTestingDocs ( outputFolder , command ) ;
105
127
}
106
128
You can’t perform that action at this time.
0 commit comments