Merge pull request #7857 from electron/publish-electron.d.ts
Initial scripts to publish electron.d.ts
This commit is contained in:
commit
7d7a2d9319
4 changed files with 14 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
||||||
"browserify": "^13.1.0",
|
"browserify": "^13.1.0",
|
||||||
"electabul": "~0.0.4",
|
"electabul": "~0.0.4",
|
||||||
"electron-docs-linter": "^2.1.0",
|
"electron-docs-linter": "^2.1.0",
|
||||||
|
"electron-typescript-definitions": "^1.0.1",
|
||||||
"request": "*",
|
"request": "*",
|
||||||
"standard": "^8.4.0",
|
"standard": "^8.4.0",
|
||||||
"standard-markdown": "^2.1.1"
|
"standard-markdown": "^2.1.1"
|
||||||
|
|
|
@ -81,6 +81,7 @@ def main():
|
||||||
sys.stderr.write('\nRunning `npm run lint`\n')
|
sys.stderr.write('\nRunning `npm run lint`\n')
|
||||||
sys.stderr.flush()
|
sys.stderr.flush()
|
||||||
execute([npm, 'run', 'lint'])
|
execute([npm, 'run', 'lint'])
|
||||||
|
|
||||||
if is_release:
|
if is_release:
|
||||||
run_script('build.py', ['-c', 'R'])
|
run_script('build.py', ['-c', 'R'])
|
||||||
run_script('create-dist.py')
|
run_script('create-dist.py')
|
||||||
|
|
|
@ -91,6 +91,7 @@ def main():
|
||||||
|
|
||||||
if PLATFORM != 'win32' and not args.no_api_docs:
|
if PLATFORM != 'win32' and not args.no_api_docs:
|
||||||
create_api_json_schema()
|
create_api_json_schema()
|
||||||
|
create_typescript_definitions()
|
||||||
|
|
||||||
if PLATFORM == 'linux':
|
if PLATFORM == 'linux':
|
||||||
strip_binaries()
|
strip_binaries()
|
||||||
|
@ -143,6 +144,16 @@ def create_api_json_schema():
|
||||||
'--version={}'.format(ELECTRON_VERSION.replace('v', ''))],
|
'--version={}'.format(ELECTRON_VERSION.replace('v', ''))],
|
||||||
env=env)
|
env=env)
|
||||||
|
|
||||||
|
def create_typescript_definitions():
|
||||||
|
node_bin_dir = os.path.join(SOURCE_ROOT, 'node_modules', '.bin')
|
||||||
|
env = os.environ.copy()
|
||||||
|
env['PATH'] = os.path.pathsep.join([node_bin_dir, env['PATH']])
|
||||||
|
infile = os.path.relpath(os.path.join(DIST_DIR, 'electron-api.json'))
|
||||||
|
outfile = os.path.relpath(os.path.join(DIST_DIR, 'electron.d.ts'))
|
||||||
|
execute(['electron-typescript-definitions', '--in={0}'.format(infile),
|
||||||
|
'--out={0}'.format(outfile)], env=env)
|
||||||
|
execute(['tslint', outfile], env=env)
|
||||||
|
|
||||||
def strip_binaries():
|
def strip_binaries():
|
||||||
for binary in TARGET_BINARIES[PLATFORM]:
|
for binary in TARGET_BINARIES[PLATFORM]:
|
||||||
if binary.endswith('.so') or '.' not in binary:
|
if binary.endswith('.so') or '.' not in binary:
|
||||||
|
|
|
@ -81,6 +81,7 @@ def main():
|
||||||
if PLATFORM == 'darwin':
|
if PLATFORM == 'darwin':
|
||||||
upload_electron(github, release, os.path.join(DIST_DIR,
|
upload_electron(github, release, os.path.join(DIST_DIR,
|
||||||
'electron-api.json'))
|
'electron-api.json'))
|
||||||
|
upload_electron(github, release, os.path.join(DIST_DIR, 'electron.d.ts'))
|
||||||
upload_electron(github, release, os.path.join(DIST_DIR, DSYM_NAME))
|
upload_electron(github, release, os.path.join(DIST_DIR, DSYM_NAME))
|
||||||
elif PLATFORM == 'win32':
|
elif PLATFORM == 'win32':
|
||||||
upload_electron(github, release, os.path.join(DIST_DIR, PDB_NAME))
|
upload_electron(github, release, os.path.join(DIST_DIR, PDB_NAME))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue