build: use typescript for internal Electron JS code (#16441)

This commit is contained in:
Samuel Attard 2019-02-06 10:27:20 -08:00 committed by GitHub
parent 858781ba83
commit 26df9992cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 682 additions and 198 deletions

22
script/gen-filenames.js Normal file
View file

@ -0,0 +1,22 @@
const fs = require('fs')
const path = require('path')
const gniPath = path.resolve(__dirname, '../filenames.auto.gni')
const allDocs = fs.readdirSync(path.resolve(__dirname, '../docs/api'))
.map(doc => `docs/api/${doc}`)
.concat(
fs.readdirSync(path.resolve(__dirname, '../docs/api/structures'))
.map(doc => `docs/api/structures/${doc}`)
)
fs.writeFileSync(
gniPath,
`# THIS FILE IS AUTO-GENERATED, PLEASE DO NOT EDIT BY HAND
auto_filenames = {
api_docs = [
${allDocs.map(doc => ` "${doc}",`).join('\n')}
]
}
`
)