From e694aaf332b3e6e7d86220936773c7818c5bd5aa Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Wed, 22 Mar 2023 20:34:48 +0100 Subject: use npm to manage Javascript libraries I'm not the biggest fan of combining many package managers, but the JavaScript libraries (Bootstrap, Bootstrap-Icons, later the @types modules and Leaflet) are easy to get via npm, so maybe we can use that to our advantage and have npm at least download them. --- .gitignore | 1 + justfile | 10 +++++++++ package-lock.json | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 6 +++++ 4 files changed, 82 insertions(+) create mode 100644 package-lock.json create mode 100644 package.json diff --git a/.gitignore b/.gitignore index 4ff2054..56f6db9 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ poetry.toml /language-packs # The module docs are regenerated using sphinx-apidoc doc/developer/module/ +/node_modules diff --git a/justfile b/justfile index fc29e00..74af962 100644 --- a/justfile +++ b/justfile @@ -58,3 +58,13 @@ compile-language locale: # Extract new messages from the source files extract-messages: pybabel extract -F babel.cfg -o fietsboek/locale/fietslog.pot --input-dirs=fietsboek + +# Copy the assets from the NPM packages +copy-npm-assets: + # Bootstrap + cp node_modules/bootstrap/dist/js/bootstrap.bundle.min.js fietsboek/static/bootstrap.bundle.min.js + cp node_modules/bootstrap/dist/css/bootstrap.css fietsboek/static/bootstrap.css + # Bootstrap icons + cp node_modules/bootstrap-icons/font/bootstrap-icons.css fietsboek/static/bootstrap-icons.css + cp node_modules/bootstrap-icons/font/fonts/bootstrap-icons.woff fietsboek/static/fonts/bootstrap-icons.woff + cp node_modules/bootstrap-icons/font/fonts/bootstrap-icons.woff2 fietsboek/static/fonts/bootstrap-icons.woff2 diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..da91336 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,65 @@ +{ + "name": "fietsboek", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "dependencies": { + "bootstrap": "^5.2.3", + "bootstrap-icons": "^1.10.3" + } + }, + "node_modules/@popperjs/core": { + "version": "2.11.6", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz", + "integrity": "sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, + "node_modules/bootstrap": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.3.tgz", + "integrity": "sha512-cEKPM+fwb3cT8NzQZYEu4HilJ3anCrWqh3CHAok1p9jXqMPsPTBhU25fBckEJHJ/p+tTxTFTsFQGM+gaHpi3QQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/twbs" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/bootstrap" + } + ], + "peerDependencies": { + "@popperjs/core": "^2.11.6" + } + }, + "node_modules/bootstrap-icons": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.10.3.tgz", + "integrity": "sha512-7Qvj0j0idEm/DdX9Q0CpxAnJYqBCFCiUI6qzSPYfERMcokVuV9Mdm/AJiVZI8+Gawe4h/l6zFcOzvV7oXCZArw==" + } + }, + "dependencies": { + "@popperjs/core": { + "version": "2.11.6", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz", + "integrity": "sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==", + "peer": true + }, + "bootstrap": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.3.tgz", + "integrity": "sha512-cEKPM+fwb3cT8NzQZYEu4HilJ3anCrWqh3CHAok1p9jXqMPsPTBhU25fBckEJHJ/p+tTxTFTsFQGM+gaHpi3QQ==", + "requires": {} + }, + "bootstrap-icons": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.10.3.tgz", + "integrity": "sha512-7Qvj0j0idEm/DdX9Q0CpxAnJYqBCFCiUI6qzSPYfERMcokVuV9Mdm/AJiVZI8+Gawe4h/l6zFcOzvV7oXCZArw==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..4f29baf --- /dev/null +++ b/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "bootstrap": "^5.2.3", + "bootstrap-icons": "^1.10.3" + } +} -- cgit v1.2.3