Skip to content

Commit

Permalink
add licenses of third-party libraries to Dependencies.md
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Oct 5, 2023
1 parent 97f75b9 commit 8f07717
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
28 changes: 14 additions & 14 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Included Web Dependencies

- vue: 3.3.4
- quasar: 2.12.2
- tailwindcss: 3.3.2
- socket.io: 4.7.1
- es-module-shims: 1.7.3
- aggrid: 30.0.3
- echarts: 5.4.3
- highcharts: 11.1.0
- mermaid: 10.2.4
- nipplejs: 0.10.1
- plotly: 2.24.3
- three: 0.154.0
- tween: 21.0.0
- vanilla-jsoneditor: 0.18.0
- vue: 3.3.4 ([MIT](https://opensource.org/licenses/MIT))
- quasar: 2.12.7 ([MIT](https://opensource.org/licenses/MIT))
- tailwindcss: 3.3.3 ([MIT](https://opensource.org/licenses/MIT))
- socket.io: 4.7.2 ([MIT](https://opensource.org/licenses/MIT))
- es-module-shims: 1.8.0 ([MIT](https://opensource.org/licenses/MIT))
- aggrid: 30.2.0 ([MIT](https://opensource.org/licenses/MIT))
- echarts: 5.4.3 ([Apache-2.0](https://opensource.org/licenses/Apache-2.0))
- highcharts: 11.1.0 ([https://www.highcharts.com/license](https://www.highcharts.com/license))
- mermaid: 10.5.0 ([MIT](https://opensource.org/licenses/MIT))
- nipplejs: 0.10.1 ([MIT](https://opensource.org/licenses/MIT))
- plotly: 2.26.2 ([MIT](https://opensource.org/licenses/MIT))
- three: 0.157.0 ([MIT](https://opensource.org/licenses/MIT))
- tween: 21.0.0 ([MIT](https://opensource.org/licenses/MIT))
- vanilla-jsoneditor: 0.18.8 ([ISC](https://opensource.org/licenses/ISC))
12 changes: 9 additions & 3 deletions npm.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,18 @@ def download_buffered(url: str) -> Path:
path.mkdir(exist_ok=True)
filepath = path / url_to_filename(url)
if not filepath.exists():
response = requests.get(url, headers={'User-Agent': 'Mozilla/5.0'})
response = requests.get(url, headers={'User-Agent': 'Mozilla/5.0'}, timeout=3)
filepath.write_bytes(response.content)
return filepath


DEPENDENCIES = (Path(__file__).parent / 'DEPENDENCIES.md').open('w')
DEPENDENCIES.write('# Included Web Dependencies\n\n')
KNOWN_LICENSES = {
'MIT': 'https://opensource.org/licenses/MIT',
'ISC': 'https://opensource.org/licenses/ISC',
'Apache-2.0': 'https://opensource.org/licenses/Apache-2.0',
}

# Create a hidden folder to work in.
tmp = cleanup(Path('.npm'))
Expand All @@ -60,8 +65,9 @@ def download_buffered(url: str) -> Path:
npm_data = json.loads(download_buffered(f'https://registry.npmjs.org/{package_name}').read_text())
npm_version = dependency.get('version', npm_data['dist-tags']['latest'])
npm_tarball = npm_data['versions'][npm_version]['dist']['tarball']
print(f'{key}: {npm_version} - {npm_tarball}')
DEPENDENCIES.write(f'- {key}: {npm_version}\n')
license_ = npm_data['versions'][npm_version]['license']
print(f'{key}: {npm_version} - {npm_tarball} ({license_})')
DEPENDENCIES.write(f'- {key}: {npm_version} ([{license_}]({KNOWN_LICENSES.get(license_, license_)}))\n')

# Handle the special case of tailwind. Hopefully remove this soon.
if 'download' in dependency:
Expand Down

0 comments on commit 8f07717

Please sign in to comment.