@@ -4,14 +4,12 @@ import rimraf from 'rimraf'
4
4
5
5
import markup from './lib/markup'
6
6
import readDocs from './lib/read-docs'
7
- // import fetchYuiDocs from './lib/fetch-yui-docs'
8
7
import createClassesOnDisk from './lib/create-classes'
9
8
import transformYuiObject from './lib/transform-yui-object'
10
9
import normalizeEmberDependencies from './lib/normalize-ember-dependencies'
11
10
import getVersionIndex from './lib/get-version-index'
12
11
import saveDoc from './lib/save-document'
13
12
import revProjVersionFiles from './lib/rev-docs'
14
- // import { downloadExistingDocsToLocal, uploadDocsToS3 } from './lib/s3-sync'
15
13
import fixBorkedYuidocFiles from './lib/fix-borked-yuidoc-files'
16
14
17
15
const docsPath = '../ember-api-docs-data' ;
@@ -21,29 +19,21 @@ export async function apiDocsProcessor(
21
19
specificDocsVersion ,
22
20
ignorePreviouslyIndexedDoc ,
23
21
runClean ,
24
- noSync
25
22
) {
26
23
RSVP . on ( 'error' , reason => {
27
24
console . log ( reason )
28
25
process . exit ( 1 )
29
26
} )
30
27
31
- // if (!noSync) {
32
- // let docsVersionMsg = specificDocsVersion !== '' ? `. For version ${specificDocsVersion}` : ''
33
- // console.log(`Downloading docs for ${projects.join(' & ')}${docsVersionMsg}`)
28
+ let filesToProcess = projects . map ( project => {
29
+ return `${ docsPath } /s3-docs/v${ specificDocsVersion } /${ project } -docs.json`
30
+ } )
31
+
32
+ await RSVP . Promise . all ( filesToProcess . map ( fixBorkedYuidocFiles ) )
34
33
35
- // // await downloadExistingDocsToLocal()
36
- // let filesToProcess = await fetchYuiDocs(projects, specificDocsVersion, runClean)
37
- // await fs.mkdirp(`${docsPath}/s3-original-docs`)
38
- // await RSVP.Promise.all(filesToProcess.map(fixBorkedYuidocFiles))
39
- // } else {
40
- // console.log('Skipping downloading docs')
41
- // }
42
- // array string v3.24.0 ??? bool false
43
34
console . log ( projects , specificDocsVersion , ignorePreviouslyIndexedDoc , runClean )
44
35
await readDocs ( projects , specificDocsVersion , ignorePreviouslyIndexedDoc , runClean )
45
36
. then ( docs => {
46
- console . log ( 'It has this many docs' , docs . ember . length )
47
37
return RSVP . map ( projects , projectName => {
48
38
return RSVP . map ( docs [ projectName ] , doc => {
49
39
let docVersion = doc . version
@@ -113,12 +103,9 @@ export async function apiDocsProcessor(
113
103
projRevFileContent . meta . availableVersions . push ( id . replace ( `${ project } -` , '' ) )
114
104
)
115
105
116
- if ( project === 'ember' ) console . log ( 'Rev has 3.24.0' , projRevFileContent . meta . availableVersions . indexOf ( '3.24.0' ) !== - 1 ) ;
117
-
118
106
fs . writeJsonSync ( projRevFile , projRevFileContent )
119
107
} )
120
108
)
121
- // .then(uploadDocsToS3)
122
109
. then ( ( ) => {
123
110
console . log ( '\n\n\n' )
124
111
console . log ( 'Done!' )
0 commit comments