mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-22 01:26:57 +03:00
Configure Dependabot for npm packages at the template level (#3436)
This commit is contained in:
parent
163975120d
commit
035eede670
8
.github/dependabot.yml
vendored
8
.github/dependabot.yml
vendored
|
@ -10,3 +10,11 @@ updates:
|
|||
interval: "daily"
|
||||
labels:
|
||||
- "update"
|
||||
|
||||
# Update npm packages
|
||||
- package-ecosystem: "npm"
|
||||
directory: "{{cookiecutter.project_slug}}/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
labels:
|
||||
- "update"
|
||||
|
|
|
@ -10,6 +10,7 @@ TODO: restrict Cookiecutter Django project initialization to
|
|||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
import json
|
||||
import os
|
||||
import random
|
||||
import shutil
|
||||
|
@ -95,6 +96,16 @@ def remove_packagejson_file():
|
|||
os.remove(file_name)
|
||||
|
||||
|
||||
def remove_bootstrap_packages():
|
||||
with open("package.json", mode="r") as fd:
|
||||
content = json.load(fd)
|
||||
for package_name in ["bootstrap", "gulp-concat", "@popperjs/core"]:
|
||||
content["devDependencies"].pop(package_name)
|
||||
with open("package.json", mode="w") as fd:
|
||||
json.dump(content, fd, ensure_ascii=False, indent=2)
|
||||
fd.write("\n")
|
||||
|
||||
|
||||
def remove_celery_files():
|
||||
file_names = [
|
||||
os.path.join("config", "celery_app.py"),
|
||||
|
@ -381,6 +392,8 @@ def main():
|
|||
remove_packagejson_file()
|
||||
if "{{ cookiecutter.use_docker }}".lower() == "y":
|
||||
remove_node_dockerfile()
|
||||
elif "{{ cookiecutter.custom_bootstrap_compilation }}" == "n":
|
||||
remove_bootstrap_packages()
|
||||
|
||||
if "{{ cookiecutter.cloud_provider}}".lower() == "none":
|
||||
print(
|
||||
|
|
|
@ -3,12 +3,9 @@
|
|||
"version": "{{ cookiecutter.version }}",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
{% if cookiecutter.js_task_runner == 'Gulp' -%}
|
||||
{% if cookiecutter.custom_bootstrap_compilation == 'y' -%}
|
||||
"bootstrap": "^5.1.3",
|
||||
"gulp-concat": "^2.6.1",
|
||||
"@popperjs/core": "^2.10.2",
|
||||
{% endif -%}
|
||||
"autoprefixer": "^10.4.0",
|
||||
"browser-sync": "^2.27.7",
|
||||
"cssnano": "^5.0.11",
|
||||
|
@ -22,7 +19,6 @@
|
|||
"pixrem": "^5.0.0",
|
||||
"postcss": "^8.3.11",
|
||||
"sass": "^1.43.4"
|
||||
{%- endif %}
|
||||
},
|
||||
"engines": {
|
||||
"node": "16"
|
||||
|
@ -31,9 +27,7 @@
|
|||
"last 2 versions"
|
||||
],
|
||||
"scripts": {
|
||||
{% if cookiecutter.js_task_runner == 'Gulp' -%}
|
||||
"dev": "gulp",
|
||||
"build": "gulp generate-assets"
|
||||
{%- endif %}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user