electron/script/create-api-json.js
Samuel Attard e9cb85bea6
build: add import/order eslint rule (#44106)
build: add import/order eslint rule (#44085)

* build: add import/order eslint rule

* chore: run lint:js --fix
2024-10-02 20:52:01 -07:00

18 lines
527 B
JavaScript

const { parseDocs } = require('@electron/docs-parser');
const fs = require('node:fs');
const path = require('node:path');
const { getElectronVersion } = require('./lib/get-version');
parseDocs({
baseDirectory: path.resolve(__dirname, '..'),
packageMode: 'single',
useReadme: false,
moduleVersion: getElectronVersion()
}).then((api) => {
return fs.promises.writeFile(path.resolve(__dirname, '..', 'electron-api.json'), JSON.stringify(api, null, 2));
}).catch((err) => {
console.error(err);
process.exit(1);
});