litestar-vite 0.1.3__tar.gz → 0.1.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/.gitignore +2 -0
  2. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/.pre-commit-config.yaml +6 -6
  3. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/PKG-INFO +4 -2
  4. litestar_vite-0.1.5/examples/htmx/app.py +20 -0
  5. litestar_vite-0.1.5/examples/htmx/package.json +20 -0
  6. litestar_vite-0.1.5/examples/htmx/tsconfig.json +31 -0
  7. litestar_vite-0.1.5/examples/htmx/vite.config.ts +25 -0
  8. litestar_vite-0.1.5/examples/react/app.py +20 -0
  9. litestar_vite-0.1.5/examples/vue/app.py +22 -0
  10. litestar_vite-0.1.5/examples/vue/package-lock.json +1275 -0
  11. litestar_vite-0.1.5/examples/vue/package.json +10 -0
  12. litestar_vite-0.1.5/examples/vue/tsconfig.json +30 -0
  13. litestar_vite-0.1.5/examples/vue/vite.config.ts +21 -0
  14. litestar_vite-0.1.5/examples/vue/web/__init__.py +0 -0
  15. litestar_vite-0.1.5/examples/vue/web/controllers.py +21 -0
  16. litestar_vite-0.1.5/examples/vue/web/public/.gitkeep +0 -0
  17. litestar_vite-0.1.5/examples/vue/web/resources/App.vue +25 -0
  18. litestar_vite-0.1.5/examples/vue/web/resources/assets/vue.svg +1 -0
  19. litestar_vite-0.1.5/examples/vue/web/resources/main.ts +6 -0
  20. litestar_vite-0.1.5/examples/vue/web/resources/styles.css +0 -0
  21. litestar_vite-0.1.5/examples/vue/web/templates/index.html.j2 +18 -0
  22. litestar_vite-0.1.5/litestar_vite/cli.py +202 -0
  23. litestar_vite-0.1.5/litestar_vite/commands.py +118 -0
  24. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/litestar_vite/config.py +44 -9
  25. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/litestar_vite/loader.py +31 -20
  26. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/litestar_vite/plugin.py +31 -7
  27. litestar_vite-0.1.5/litestar_vite/py.typed +0 -0
  28. litestar_vite-0.1.5/litestar_vite/template_engine.py +85 -0
  29. litestar_vite-0.1.5/litestar_vite/templates/__init__.py +0 -0
  30. litestar_vite-0.1.5/litestar_vite/templates/init/htmx/main.css.j2 +0 -0
  31. litestar_vite-0.1.5/litestar_vite/templates/init/htmx/main.js.j2 +1 -0
  32. litestar_vite-0.1.5/litestar_vite/templates/init/index.html.j2 +18 -0
  33. litestar_vite-0.1.5/litestar_vite/templates/init/package.json.j2 +10 -0
  34. litestar_vite-0.1.5/litestar_vite/templates/init/react/App.tsx.j2 +9 -0
  35. litestar_vite-0.1.5/litestar_vite/templates/init/react/main.tsx.j2 +9 -0
  36. litestar_vite-0.1.5/litestar_vite/templates/init/tailwindcss/main.css.j2 +3 -0
  37. litestar_vite-0.1.5/litestar_vite/templates/init/tailwindcss/postcss.config.ts.j2 +6 -0
  38. litestar_vite-0.1.5/litestar_vite/templates/init/tailwindcss/tailwind.config.js.j2 +9 -0
  39. litestar_vite-0.1.5/litestar_vite/templates/init/tsconfig.json.j2 +30 -0
  40. litestar_vite-0.1.5/litestar_vite/templates/init/vanilla/main.css.j2 +0 -0
  41. litestar_vite-0.1.5/litestar_vite/templates/init/vite.config.ts.j2 +27 -0
  42. litestar_vite-0.1.5/litestar_vite/templates/init/vue/App.vue.j2 +5 -0
  43. litestar_vite-0.1.5/litestar_vite/templates/init/vue/main.ts.j2 +0 -0
  44. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/pdm.lock +522 -594
  45. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/pyproject.toml +8 -2
  46. litestar_vite-0.1.5/tests/__init__.py +0 -0
  47. litestar_vite-0.1.3/litestar_vite/cli.py +0 -24
  48. litestar_vite-0.1.3/litestar_vite/template_engine.py +0 -104
  49. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/.github/CODEOWNERS +0 -0
  50. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/.github/workflows/cd.yaml +0 -0
  51. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/.github/workflows/ci.yaml +0 -0
  52. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/.github/workflows/docs-preview.yaml +0 -0
  53. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/.github/workflows/docs.yaml +0 -0
  54. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/.github/workflows/pr-title.yaml +0 -0
  55. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/.github/workflows/publish.yaml +0 -0
  56. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/CONTRIBUTING.rst +0 -0
  57. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/LICENSE +0 -0
  58. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/Makefile +0 -0
  59. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/README.md +0 -0
  60. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/docs/Makefile +0 -0
  61. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/docs/conf.py +0 -0
  62. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/docs/contribution-guide.rst +0 -0
  63. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/docs/fix_missing_references.py +0 -0
  64. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/docs/index.rst +0 -0
  65. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/docs/reference/config.rst +0 -0
  66. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/docs/reference/plugin.rst +0 -0
  67. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/docs/usage/index.rst +0 -0
  68. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/docs/usage/placeholder.rst +0 -0
  69. {litestar_vite-0.1.3/tests → litestar_vite-0.1.5/examples}/__init__.py +0 -0
  70. /litestar_vite-0.1.3/litestar_vite/py.typed → /litestar_vite-0.1.5/examples/vue/__init__.py +0 -0
  71. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/litestar_vite/__init__.py +0 -0
  72. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/litestar_vite/__metadata__.py +0 -0
  73. {litestar_vite-0.1.3 → litestar_vite-0.1.5}/tests/docker-compose.yml +0 -0
@@ -163,3 +163,5 @@ cython_debug/
163
163
 
164
164
  # vscode
165
165
  .vscode
166
+
167
+ node_modules
@@ -2,12 +2,12 @@ default_language_version:
2
2
  python: "3.11"
3
3
  repos:
4
4
  - repo: https://github.com/compilerla/conventional-pre-commit
5
- rev: v2.4.0
5
+ rev: v3.0.0
6
6
  hooks:
7
7
  - id: conventional-pre-commit
8
8
  stages: [commit-msg]
9
9
  - repo: https://github.com/pre-commit/pre-commit-hooks
10
- rev: v4.4.0
10
+ rev: v4.5.0
11
11
  hooks:
12
12
  - id: check-ast
13
13
  - id: check-case-conflict
@@ -17,7 +17,7 @@ repos:
17
17
  - id: mixed-line-ending
18
18
  - id: trailing-whitespace
19
19
  - repo: https://github.com/charliermarsh/ruff-pre-commit
20
- rev: "v0.0.292"
20
+ rev: "v0.1.7"
21
21
  hooks:
22
22
  - id: ruff
23
23
  args: ["--fix"]
@@ -27,12 +27,12 @@ repos:
27
27
  hooks:
28
28
  - id: codespell
29
29
  - repo: https://github.com/psf/black
30
- rev: 23.9.1
30
+ rev: 23.11.0
31
31
  hooks:
32
32
  - id: black
33
33
  args: [--config=./pyproject.toml]
34
34
  - repo: https://github.com/pre-commit/mirrors-mypy
35
- rev: "v1.5.1"
35
+ rev: "v1.7.1"
36
36
  hooks:
37
37
  - id: mypy
38
38
  exclude: "docs"
@@ -52,6 +52,6 @@ repos:
52
52
  "litestar[cli]",
53
53
  ]
54
54
  - repo: https://github.com/sphinx-contrib/sphinx-lint
55
- rev: "v0.6.8"
55
+ rev: "v0.9.0"
56
56
  hooks:
57
57
  - id: sphinx-lint
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: litestar-vite
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: Vite plugin for Litestar
5
5
  Project-URL: Changelog, https://cofin.github.io/litestar-vite/latest/changelog
6
6
  Project-URL: Discord, https://discord.gg/X3FJqy8d2j
@@ -30,7 +30,9 @@ Classifier: Topic :: Database :: Database Engines/Servers
30
30
  Classifier: Topic :: Software Development
31
31
  Classifier: Typing :: Typed
32
32
  Requires-Python: >=3.8
33
- Requires-Dist: litestar[cli,jinja]>=2.0.1
33
+ Requires-Dist: litestar[cli,jinja]>=2.4.0
34
+ Provides-Extra: nodeenv
35
+ Requires-Dist: nodeenv; extra == 'nodeenv'
34
36
  Description-Content-Type: text/markdown
35
37
 
36
38
  # Litestar Vite
@@ -0,0 +1,20 @@
1
+ from __future__ import annotations
2
+
3
+ from pathlib import Path
4
+
5
+ from litestar import Litestar
6
+
7
+ from litestar_vite import ViteConfig, VitePlugin
8
+
9
+ here = Path(__file__).parent
10
+
11
+ vite = VitePlugin(
12
+ config=ViteConfig(
13
+ bundle_dir=Path(here / "web" / "public"),
14
+ resource_dir=Path(here / "web" / "resources"),
15
+ assets_dir=Path(here / "web" / "resources" / "assets"),
16
+ templates_dir=Path(here / "web" / "templates"),
17
+ hot_reload=True,
18
+ ),
19
+ )
20
+ app = Litestar(plugins=[vite])
@@ -0,0 +1,20 @@
1
+ {
2
+ "private": true,
3
+ "type": "module",
4
+ "scripts": {
5
+ "dev": "vite",
6
+ "build": "vite build"
7
+ },
8
+ "dependencies": {
9
+ "htmx.org": "^1.9.6"
10
+ },
11
+ "devDependencies": {
12
+ "axios": "^1.1.2",
13
+ "litestar-vite-plugin": "^0.1.0",
14
+ "typescript": "^4.9.5",
15
+ "autoprefixer": "^10.4.16",
16
+ "postcss": "^8.4.31",
17
+ "tailwindcss": "^3.3.5",
18
+ "vite": "^4.0.0"
19
+ }
20
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ESNext",
4
+ "useDefineForClassFields": true,
5
+ "module": "ESNext",
6
+ "moduleResolution": "node",
7
+ "strict": true,
8
+ "jsx": "preserve",
9
+ "resolveJsonModule": true,
10
+ "isolatedModules": true,
11
+ "esModuleInterop": true,
12
+ "lib": ["ESNext", "DOM"],
13
+ "skipLibCheck": true,
14
+ "noEmit": true,
15
+ "composite": true,
16
+ "allowSyntheticDefaultImports": true,
17
+ "baseUrl": "resources",
18
+ "paths": {
19
+ "@/*": ["./*"]
20
+ },
21
+ "types": ["vite/client", "node"]
22
+ },
23
+ "include": [
24
+ "**/*.d.ts",
25
+ "resources/**/*.js" ,
26
+ "resources/**/*.ts" ,
27
+
28
+
29
+ "vite.config.ts"
30
+ ]
31
+ }
@@ -0,0 +1,25 @@
1
+ import { defineConfig } from "vite";
2
+
3
+
4
+ import litestar from "litestar-vite-plugin";
5
+
6
+ export default defineConfig({
7
+ plugins: [
8
+
9
+
10
+ litestar({
11
+ input: [
12
+ "resources/styles.css"
13
+ ],
14
+ assetUrl: "/static/",
15
+ assetDirectory: "resources/assets",
16
+ bundleDirectory: "public",
17
+ resourceDirectory: "resources"
18
+ }),
19
+ ],
20
+ resolve: {
21
+ alias: {
22
+ "@": "resources",
23
+ },
24
+ },
25
+ });
@@ -0,0 +1,20 @@
1
+ from __future__ import annotations
2
+
3
+ from pathlib import Path
4
+
5
+ from litestar import Litestar
6
+
7
+ from litestar_vite import ViteConfig, VitePlugin
8
+
9
+ here = Path(__file__).parent
10
+
11
+ vite = VitePlugin(
12
+ config=ViteConfig(
13
+ bundle_dir=Path(here / "web" / "public"),
14
+ resource_dir=Path(here / "web" / "resources"),
15
+ assets_dir=Path(here / "web" / "resources" / "assets"),
16
+ templates_dir=Path(here / "web" / "templates"),
17
+ hot_reload=True,
18
+ ),
19
+ )
20
+ app = Litestar(plugins=[vite])
@@ -0,0 +1,22 @@
1
+ from __future__ import annotations
2
+
3
+ from pathlib import Path
4
+
5
+ from litestar import Litestar
6
+ from web.controllers import WebController
7
+
8
+ from litestar_vite import ViteConfig, VitePlugin
9
+
10
+ here = Path(__file__).parent
11
+
12
+ vite = VitePlugin(
13
+ config=ViteConfig(
14
+ bundle_dir=Path(here / "web" / "public"),
15
+ resource_dir=Path(here / "web" / "resources"),
16
+ assets_dir=Path(here / "web" / "resources" / "assets"),
17
+ templates_dir=Path(here / "web" / "templates"),
18
+ hot_reload=True,
19
+ port=3006,
20
+ ),
21
+ )
22
+ app = Litestar(plugins=[vite], route_handlers=[WebController])