Skip to content

Commit

Permalink
Lots of functional auth changes and precommit changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gone committed Mar 11, 2022
1 parent 35c2cb7 commit b6cbbf9
Show file tree
Hide file tree
Showing 54 changed files with 793 additions and 470 deletions.
11 changes: 10 additions & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@
"use_local_docker_db": "n",
"use_wagtail": "n",
"_copy_without_render": [
"*.html",
"*/templates/header.html",
"*/templates/403.html",
"*/templates/404.html",
"*/templates/500.html",
"*/templates/index.html",
"*/templates/current_time.html",
"*/templates/base.html",
"*/templates/components/*.html",
"*/templates/account/*.html",
"*/templates/util/*.html",
"templates/**/*.txt",
"*.jinja",
".yarn/*"
Expand Down
1 change: 1 addition & 0 deletions {{cookiecutter.repo_name}}/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = {
},
"rules": {
"@typescript-eslint/no-unused-vars": "error",
"no-unused-vars": 0,
"import/no-absolute-path": 0,
"quotes": ["error", "double", { "avoidEscape": true }]
},
Expand Down
3 changes: 3 additions & 0 deletions {{cookiecutter.repo_name}}/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
*/static_source/assets/*
*/static_source/manifest.json

static/
bundles/*
bundles/
Expand Down
36 changes: 33 additions & 3 deletions {{cookiecutter.repo_name}}/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,25 @@ repos:
types: [python]
- repo: local
hooks:
- id: flakehell
name: flakehell
entry: poetry run flakehell lint
- id: flakeheaven
name: flakeheaven
entry: poetry run flakeheaven lint --config=pyproject.toml
types: [python]
language: system
- repo: local
hooks:
- id: pylint
name: pylint
entry: poetry run pylint
language: system
types: [python]
args:
[
"-rn", # Only display messages
"--output-format=colorized",
"-sn", # Don't display the score
"--load-plugins=pylint.extensions.docparams", # Load an extension
]
- repo: local
hooks:
- id: djlint
Expand Down Expand Up @@ -56,6 +70,22 @@ repos:
# TODO: https://github.com/adamchainz/pre-commit-oxipng

## frontend
- repo: local
hooks:
- id: tsc
name: tsc
entry: npx tsc --noEmit --skipLibCheck
files: ^frontend/
language: system
types_or: [ts, javascript]
exclude: |
(?x)^(
postcss.config.js|
tailwind.config.js|
vite.config.js|
frontend/fontawesome/.*|
node_modules/.*
)
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.5.1
hooks:
Expand Down
21 changes: 19 additions & 2 deletions {{cookiecutter.repo_name}}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ These instructions will help you get you a copy of the project up and running on
## Prerequisites
* [node](https://nodejs.org/en/download/)
* [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
* [yarn](https://classic.yarnpkg.com/en/docs/install/)
* [python3 (preferrably python 3.10)](https://www.python.org/downloads/), although [pyenv](https://github.com/pyenv/pyenv) is recommended to manage versions
* [git](https://git-scm.com/downloads)
* bash ([WSL2](https://docs.microsoft.com/en-us/windows/wsl/install-win10) or [Cygwin](https://cygwin.com/install.html) recommended for windows users)
Expand Down Expand Up @@ -235,9 +234,27 @@ We have added h1 and h5 to the wagtail cms richtext editor as they do not come o

---
TO ADD



### DIRENV
### pdbpp and sticky by default config
### PLAYWRIGHT
webcomponents w/ alpine
Alpine dev tools
# setting up

### UPGRADING PYTHON PACKAGES
https://github.com/python-poetry/poetry/issues/1387
###UPGRADING NODE PACKAGES
https://shouts.dev/upgrade-all-npm-packages-to-the-latest-versions




- build + serve vs dev
- debug watcher
- browser based debugging for node
- separate threads when in debugging
- more high level stuff
"django rest framework is used for the backend and djoser for the auth"
"django rest framework is used for the backend and djoser for the auth"
9 changes: 9 additions & 0 deletions {{cookiecutter.repo_name}}/frontend/css/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@ body {
top: 50%;
z-index: 40;
}


button {
@apply inline-flex items-center px-4 py-2 border border-transparent text-base font-medium
rounded-md shadow-sm text-white bg-indigo-600 hover:bg-indigo-700
focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500;

justify-content: center;
}
5 changes: 3 additions & 2 deletions {{cookiecutter.repo_name}}/frontend/js/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

// @ts-expect-error // this whole system is broken w/ vite
if (import.meta.env.MODE !== "development") {
// @ts-expect-error // this whole system is broken w/ vite
import("vite/modulepreload-polyfill"); // eslint-disable-line import/no-unresolved
// // @ts-expect-error // this whole system is broken w/ vite
// import("vite/modulepreload-polyfill"); // eslint-disable-line import/no-unresolved
// https://github.com/vitejs/vite/issues/4786
}

// Import our CSS
Expand Down
9 changes: 6 additions & 3 deletions {{cookiecutter.repo_name}}/frontend/js/system.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import "htmx.org";
// @ts-expect-error // todo: make a types file for x-widget
import xWidget from "x-widget";
import Alpine from "alpinejs";

declare global {
Expand All @@ -9,6 +7,11 @@ declare global {
}
}

// @ts-expect-error // needs to declare that htmx lives on window, auto added by import
const { htmx } = window; // eslint-disable-line @typescript-eslint/no-unused-vars
window.Alpine = Alpine;
Alpine.plugin(xWidget);
Alpine.start();

// if (import.meta.hot) {
// import.meta.hot.on("special-update", (data) => {});
// }
2 changes: 1 addition & 1 deletion {{cookiecutter.repo_name}}/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
try:
import django # noqa
import django # pylint: disable=unused-import # noqa
except ImportError:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
Expand Down
6 changes: 2 additions & 4 deletions {{cookiecutter.repo_name}}/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"@types/alpinejs": "^3.7.0",
"@typescript-eslint/eslint-plugin": "^5.9.0",
"@typescript-eslint/parser": "^5.9.0",
"@vitejs/plugin-vue": "^2.0.1",
"autoprefixer": "^10.4.1",
"eslint": "^8.6.0",
"eslint-config-airbnb-base": "^15.0.0",
Expand All @@ -21,13 +20,12 @@
"postcss": "^8.4.5",
"stylelint": "^14.2.0",
"stylelint-config-standard-scss": "^3.0.0",
"tailwindcss": "^3.0.10",
"tailwindcss": "^3.0.21",
"typescript": "^4.5.4",
"vite": "^2.8.0"
},
"dependencies": {
"alpinejs": "^3.8.1",
"x-widget": "^0.2.7",
"htmx.org": "^1.6.1"
"htmx.org": "^1.7.0"
}
}
Loading

0 comments on commit b6cbbf9

Please sign in to comment.