diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 423022880..bf9301375 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -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 \ No newline at end of file +- vue: 3.3.4 ([MIT](https://opensource.org/licenses/MIT)) +- quasar: 2.12.2 ([MIT](https://opensource.org/licenses/MIT)) +- tailwindcss: 3.3.2 ([MIT](https://opensource.org/licenses/MIT)) +- socket.io: 4.7.1 ([MIT](https://opensource.org/licenses/MIT)) +- es-module-shims: 1.7.3 ([MIT](https://opensource.org/licenses/MIT)) +- aggrid: 30.0.3 ([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.2.4 ([MIT](https://opensource.org/licenses/MIT)) +- nipplejs: 0.10.1 ([MIT](https://opensource.org/licenses/MIT)) +- plotly: 2.24.3 ([MIT](https://opensource.org/licenses/MIT)) +- three: 0.154.0 ([MIT](https://opensource.org/licenses/MIT)) +- tween: 21.0.0 ([MIT](https://opensource.org/licenses/MIT)) +- vanilla-jsoneditor: 0.18.0 ([ISC](https://opensource.org/licenses/ISC)) \ No newline at end of file diff --git a/npm.py b/npm.py index 0318098fe..94a5e55be 100755 --- a/npm.py +++ b/npm.py @@ -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')) @@ -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: