Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d4b2047

Browse files
authored
Merge pull request electron#7120 from electron/lint-docs
Publish the public API as a JSON object
2 parents d1274bb + 9e8b095 commit d4b2047

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"devDependencies": {
55
"asar": "^0.11.0",
66
"electabul": "~0.0.4",
7+
"electron-docs-linter": "^1.6.2",
78
"request": "*",
89
"standard": "^7.1.2",
910
"standard-markdown": "^1.2.1"
@@ -28,11 +29,12 @@
2829
"clean": "python ./script/clean.py",
2930
"coverage": "npm run instrument-code-coverage && npm test -- --use-instrumented-asar",
3031
"instrument-code-coverage": "electabul instrument --input-path ./lib --output-path ./out/coverage/electron.asar",
31-
"lint": "npm run lint-js && npm run lint-cpp && npm run lint-py && npm run lint-docs",
32+
"lint": "npm run lint-js && npm run lint-cpp && npm run lint-py && npm run lint-api-docs-js && npm run lint-api-docs",
3233
"lint-js": "standard && cd spec && standard",
3334
"lint-cpp": "python ./script/cpplint.py",
3435
"lint-py": "python ./script/pylint.py",
35-
"lint-docs": "standard-markdown docs",
36+
"lint-api-docs-js": "standard-markdown docs",
37+
"lint-api-docs": "electron-docs-linter docs/api --version=$npm_package_version --outfile=out/electron-api.json",
3638
"preinstall": "node -e 'process.exit(0)'",
3739
"repl": "python ./script/start.py --interactive",
3840
"start": "python ./script/start.py",

script/create-dist.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def main():
8585
copy_chrome_binary('chromedriver')
8686
copy_chrome_binary('mksnapshot')
8787
copy_license()
88+
copy_api_json_schema()
8889

8990
if PLATFORM == 'linux':
9091
strip_binaries()
@@ -128,6 +129,8 @@ def copy_license():
128129
DIST_DIR)
129130
shutil.copy2(os.path.join(SOURCE_ROOT, 'LICENSE'), DIST_DIR)
130131

132+
def copy_api_json_schema():
133+
shutil.copy2(os.path.join(OUT_DIR, 'electron-api.json'), DIST_DIR)
131134

132135
def strip_binaries():
133136
for binary in TARGET_BINARIES[PLATFORM]:

script/upload.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ def main():
7979
upload_electron(github, release, os.path.join(DIST_DIR, DIST_NAME))
8080
upload_electron(github, release, os.path.join(DIST_DIR, SYMBOLS_NAME))
8181
if PLATFORM == 'darwin':
82+
upload_electron(github, release, os.path.join(DIST_DIR,
83+
'electron-api.json'))
8284
upload_electron(github, release, os.path.join(DIST_DIR, DSYM_NAME))
8385
elif PLATFORM == 'win32':
8486
upload_electron(github, release, os.path.join(DIST_DIR, PDB_NAME))

0 commit comments

Comments
 (0)