New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial scripts to publish electron.d.ts #7857

Merged
merged 4 commits into from May 5, 2017
Jump to file or symbol
Failed to load files and symbols.
+14 −0
Diff settings

Always

Just for now

View
@@ -6,6 +6,7 @@
"browserify": "^13.1.0",
"electabul": "~0.0.4",
"electron-docs-linter": "^2.1.0",
"electron-typescript-definitions": "^1.0.1",
"request": "*",
"standard": "^8.4.0",
"standard-markdown": "^2.1.1"
View
@@ -81,6 +81,7 @@ def main():
sys.stderr.write('\nRunning `npm run lint`\n')
sys.stderr.flush()
execute([npm, 'run', 'lint'])
if is_release:
run_script('build.py', ['-c', 'R'])
run_script('create-dist.py')
View
@@ -92,6 +92,7 @@ def main():
if PLATFORM != 'win32' and not args.no_api_docs:
create_api_json_schema()
create_typescript_definitions()
if PLATFORM == 'linux':
strip_binaries()
@@ -144,6 +145,16 @@ def create_api_json_schema():
'--version={}'.format(ELECTRON_VERSION.replace('v', ''))],
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():
for binary in TARGET_BINARIES[PLATFORM]:
if binary.endswith('.so') or '.' not in binary:
View
@@ -81,6 +81,7 @@ def main():
if PLATFORM == 'darwin':
upload_electron(github, release, os.path.join(DIST_DIR,
'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))
elif PLATFORM == 'win32':
upload_electron(github, release, os.path.join(DIST_DIR, PDB_NAME))
ProTip! Use n and p to navigate between commits in a pull request.