litestar-vite 0.12.1__tar.gz → 0.13.1__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.

Potentially problematic release.


This version of litestar-vite might be problematic. Click here for more details.

Files changed (81) hide show
  1. {litestar_vite-0.12.1 → litestar_vite-0.13.1}/.gitignore +1 -0
  2. {litestar_vite-0.12.1 → litestar_vite-0.13.1}/PKG-INFO +3 -3
  3. {litestar_vite-0.12.1 → litestar_vite-0.13.1}/pyproject.toml +29 -91
  4. litestar_vite-0.13.1/src/js/LICENSE +45 -0
  5. litestar_vite-0.13.1/src/js/Makefile +66 -0
  6. litestar_vite-0.13.1/src/js/NOTICE +25 -0
  7. litestar_vite-0.13.1/src/js/README.md +15 -0
  8. litestar_vite-0.13.1/src/js/src/dev-server-index.html +185 -0
  9. litestar_vite-0.13.1/src/js/src/index.ts +677 -0
  10. litestar_vite-0.13.1/src/js/src/inertia-helpers/index.ts +170 -0
  11. litestar_vite-0.13.1/src/js/tests/__data__/dummy.ts +1 -0
  12. litestar_vite-0.13.1/src/js/tests/index.test.ts +841 -0
  13. litestar_vite-0.13.1/src/js/tsconfig.inertia-helpers.json +7 -0
  14. litestar_vite-0.13.1/src/js/tsconfig.json +13 -0
  15. litestar_vite-0.13.1/src/js/vitest.config.ts +8 -0
  16. litestar_vite-0.13.1/src/js/vitest.workspace.ts +4 -0
  17. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/__init__.py +0 -2
  18. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/__metadata__.py +0 -2
  19. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/cli.py +33 -38
  20. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/commands.py +45 -35
  21. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/config.py +6 -7
  22. litestar_vite-0.13.1/src/py/litestar_vite/inertia/_utils.py +99 -0
  23. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/inertia/config.py +5 -7
  24. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/inertia/exception_handler.py +22 -8
  25. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/inertia/helpers.py +57 -61
  26. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/inertia/middleware.py +4 -6
  27. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/inertia/plugin.py +22 -9
  28. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/inertia/request.py +58 -20
  29. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/inertia/response.py +42 -40
  30. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/inertia/routes.py +7 -9
  31. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/inertia/types.py +6 -8
  32. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/loader.py +93 -29
  33. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/plugin.py +71 -34
  34. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/conftest.py +1 -1
  35. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_asset_loader.py +2 -1
  36. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_cli/conftest.py +2 -1
  37. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_inertia/test_response.py +11 -11
  38. litestar_vite-0.13.1/tools/__init__.py +0 -0
  39. litestar_vite-0.13.1/tools/build_docs.py +96 -0
  40. litestar_vite-0.13.1/tools/clean.js +80 -0
  41. litestar_vite-0.13.1/tools/pypi_readme.py +19 -0
  42. litestar_vite-0.13.1/tools/sphinx_ext/__init__.py +18 -0
  43. litestar_vite-0.13.1/tools/sphinx_ext/changelog.py +161 -0
  44. litestar_vite-0.13.1/tools/sphinx_ext/missing_references.py +135 -0
  45. litestar_vite-0.12.1/litestar_vite/inertia/_utils.py +0 -63
  46. {litestar_vite-0.12.1 → litestar_vite-0.13.1}/LICENSE +0 -0
  47. {litestar_vite-0.12.1 → litestar_vite-0.13.1}/README.md +0 -0
  48. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/inertia/__init__.py +0 -0
  49. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/py.typed +0 -0
  50. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/templates/__init__.py +0 -0
  51. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/templates/index.html.j2 +0 -0
  52. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/templates/main.ts.j2 +0 -0
  53. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/templates/package.json.j2 +0 -0
  54. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/templates/styles.css.j2 +0 -0
  55. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/templates/tsconfig.json.j2 +0 -0
  56. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/litestar_vite/templates/vite.config.ts.j2 +0 -0
  57. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/__init__.py +0 -0
  58. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/py.typed +0 -0
  59. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/templates/__init__.py +0 -0
  60. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/templates/index.html.j2 +0 -0
  61. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_app/__init__.py +0 -0
  62. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_app/app.py +0 -0
  63. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_app/web/__init__.py +0 -0
  64. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_app/web/public/.gitkeep +0 -0
  65. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_app/web/public/assets/main-l0sNRNKZ.js +0 -0
  66. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_app/web/public/assets/styles-l0sNRNKZ.js +0 -0
  67. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_app/web/public/manifest.json +0 -0
  68. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_app/web/resources/.gitkeep +0 -0
  69. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_app/web/resources/main.ts +0 -0
  70. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_app/web/resources/styles.css +0 -0
  71. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_app/web/templates/.gitkeep +0 -0
  72. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_app/web/templates/index.html +0 -0
  73. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_cli/__init__.py +0 -0
  74. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_cli/test_init.py +0 -0
  75. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_commands.py +0 -0
  76. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_config.py +0 -0
  77. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_inertia/__init__.py +0 -0
  78. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_inertia/conftest.py +0 -0
  79. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_inertia/templates/index.html.j2 +0 -0
  80. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_inertia/test_request.py +0 -0
  81. {litestar_vite-0.12.1 → litestar_vite-0.13.1/src/py}/tests/test_inertia/test_routes.py +0 -0
@@ -166,3 +166,4 @@ cython_debug/
166
166
  .vscode
167
167
 
168
168
  node_modules
169
+ .aider*
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: litestar-vite
3
- Version: 0.12.1
3
+ Version: 0.13.1
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
@@ -19,16 +19,16 @@ Classifier: License :: OSI Approved :: MIT License
19
19
  Classifier: Natural Language :: English
20
20
  Classifier: Operating System :: OS Independent
21
21
  Classifier: Programming Language :: Python
22
- Classifier: Programming Language :: Python :: 3.8
23
22
  Classifier: Programming Language :: Python :: 3.9
24
23
  Classifier: Programming Language :: Python :: 3.10
25
24
  Classifier: Programming Language :: Python :: 3.11
26
25
  Classifier: Programming Language :: Python :: 3.12
26
+ Classifier: Programming Language :: Python :: 3.13
27
27
  Classifier: Topic :: Database
28
28
  Classifier: Topic :: Database :: Database Engines/Servers
29
29
  Classifier: Topic :: Software Development
30
30
  Classifier: Typing :: Typed
31
- Requires-Python: >=3.8
31
+ Requires-Python: >=3.9
32
32
  Requires-Dist: litestar[jinja]>=2.7.0
33
33
  Provides-Extra: nodeenv
34
34
  Requires-Dist: nodeenv; extra == 'nodeenv'
@@ -5,11 +5,11 @@ classifiers = [
5
5
  "License :: OSI Approved :: MIT License",
6
6
  "Natural Language :: English",
7
7
  "Operating System :: OS Independent",
8
- "Programming Language :: Python :: 3.8",
9
8
  "Programming Language :: Python :: 3.9",
10
9
  "Programming Language :: Python :: 3.10",
11
10
  "Programming Language :: Python :: 3.11",
12
11
  "Programming Language :: Python :: 3.12",
12
+ "Programming Language :: Python :: 3.13",
13
13
  "Programming Language :: Python",
14
14
  "Topic :: Software Development",
15
15
  "Typing :: Typed",
@@ -24,8 +24,8 @@ keywords = ["litestar", "vite"]
24
24
  license = { text = "MIT" }
25
25
  name = "litestar-vite"
26
26
  readme = "README.md"
27
- requires-python = ">=3.8"
28
- version = "0.12.1"
27
+ requires-python = ">=3.9"
28
+ version = "0.13.1"
29
29
 
30
30
  [project.urls]
31
31
  Changelog = "https://cofin.github.io/litestar-vite/latest/changelog"
@@ -42,19 +42,12 @@ nodeenv = ["nodeenv"]
42
42
  build-backend = "hatchling.build"
43
43
  requires = ["hatchling"]
44
44
 
45
- [tool.hatch.build]
46
- dev-mode-dirs = ["src/py", "."]
47
-
48
-
49
45
  [tool.hatch.build.targets.sdist]
50
- exclude = [".github", "docs"]
51
- packages = ["src/py/litestar_vite", "src/py/tests"]
52
- include = ["src/py/*","src/js/*"]
53
- skip-excluded-dirs = false
46
+ exclude = ["/.github", "/docs"]
47
+ include = ["src/py/*","src/js/*","tools/*"]
54
48
 
55
49
  [tool.hatch.build.targets.wheel]
56
50
  packages = ["src/py/litestar_vite"]
57
- sources = ["src/py"]
58
51
 
59
52
  [dependency-groups]
60
53
  dev = [ {include-group = "build"}, { include-group = "linting" }, { include-group = "test" }, { include-group = "docs" } ]
@@ -90,7 +83,7 @@ test = [
90
83
  allow_dirty = true
91
84
  commit = true
92
85
  commit_args = "--no-verify"
93
- current_version = "0.12.1"
86
+ current_version = "0.13.1"
94
87
  ignore_missing_files = false
95
88
  ignore_missing_version = false
96
89
  message = "chore(release): bump to v{new_version}"
@@ -269,17 +262,29 @@ lint.ignore = [
269
262
  "PLR0913", # too many arguments
270
263
  "PT",
271
264
  "TD",
265
+ "ARG002", # ignore for now; investigate
266
+ "ARG003", # ignore for now; investigate
272
267
  "PERF203", # ignore for now; investigate
268
+ "PD011", # pandas
269
+ "PLR0912",
273
270
  "ISC001",
274
271
  "COM812",
272
+ "CPY001",
273
+ "PGH003",
274
+ "FA100",
275
+ "PLC0415", # import should be at the top of the file
276
+ "PLR0904", # too many public methods
277
+ "PLR0914",
278
+ "PLR0917",
279
+ "PLC2701", # private import
280
+ "S704",
281
+ "S404",
275
282
  ]
276
283
  lint.select = ["ALL"]
277
- # Allow unused variables when underscore-prefixed.
278
- lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
279
284
  src = ["src/py/litestar_vite", "src/py/tests"]
280
- target-version = "py38"
285
+ target-version = "py39"
281
286
  unsafe-fixes = true
282
-
287
+ lint.extend-safe-fixes = ["TC"]
283
288
 
284
289
  [tool.ruff.lint.pydocstyle]
285
290
  convention = "google"
@@ -318,6 +323,7 @@ max-complexity = 12
318
323
  "UP006",
319
324
  "SLF001",
320
325
  "ERA001",
326
+
321
327
  ]
322
328
  "tools/*.py" = [ "PLR0911"]
323
329
 
@@ -325,8 +331,10 @@ max-complexity = 12
325
331
  known-first-party = ["litestar_vite", "tests"]
326
332
 
327
333
  [tool.pyright]
328
- venvPath = "."
329
334
  disableBytesTypePromotions = true
335
+ reportPrivateImportUsage = "none"
336
+ reportUnknownVariableType = "none"
337
+ reportUnnecessaryContains = "none"
330
338
  exclude = [
331
339
  "docs",
332
340
  "src/py/tests/unit/test_extensions",
@@ -335,13 +343,12 @@ exclude = [
335
343
  "src/py/tests/docker_service_fixtures.py",
336
344
  ]
337
345
  include = ["src/py/litestar_vite"]
338
- pythonVersion = "3.8"
346
+ pythonVersion = "3.9"
339
347
  strict = ["src/py/litestar_vite/**/*"]
340
- venv = ".venv"
341
348
 
342
349
  [tool.mypy]
343
350
  disallow_untyped_defs = false
344
- files = ["src/py/litestar_vite", "src/py/tests"]
351
+ files = ["src/py/litestar_vite", "src/py/tests", "tools"]
345
352
  follow_imports = "normal" # "silent" for not following
346
353
  ignore_missing_imports = true
347
354
  pretty = true
@@ -349,12 +356,6 @@ show_column_numbers = true
349
356
  warn_no_return = false
350
357
  warn_unused_ignores = true
351
358
 
352
- [[tool.mypy.overrides]]
353
- ignore_missing_imports = true
354
- module = [
355
- "awaitlet",
356
- ]
357
-
358
359
  [[tool.mypy.overrides]]
359
360
  disable_error_code = "attr-defined"
360
361
  disallow_untyped_decorators = false
@@ -362,67 +363,4 @@ module = "tests.*"
362
363
 
363
364
  [tool.codespell]
364
365
  ignore-words-list = "selectin"
365
- skip = 'pdm.lock,examples/inertia/package-lock.json,examples/inertia/public/assets/*.js'
366
-
367
- [tool.git-cliff.changelog]
368
- body = """
369
- {% if version %}\
370
- `Release [v{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} <https://github.com/cofin/litestar-vite/releases/tag/v{{ version | trim_start_matches(pat="v") }}>`_
371
- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
372
- * `See All commits in v{{ version | trim_start_matches(pat="v") }} <https://github.com/cofin/litestar-vite/commits/v{{ version | trim_start_matches(pat="v") }}>`_
373
- {% else %}\
374
- [unreleased]
375
- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
376
- {% endif %}\
377
- {% if previous %}\
378
- {% if previous.commit_id %}
379
- `{{ previous.commit_id | truncate(length=7, end="") }} <https://github.com/cofin/litestar-vite/commit/{{ previous.commit_id }}>`_ ... \
380
- `{{ commit_id | truncate(length=7, end="") }} <https://github.com/cofin/litestar-vite/commit/{{ commit_id }}>`_ \
381
- | `See diff for {{ version | trim_start_matches(pat="v") }} <https://github.com/cofin/litestar-vite/compare/{{ previous.commit_id }}...{{ commit_id }}>`_
382
- {% endif %}\
383
- {% endif %}\
384
- {% for group, commits in commits | group_by(attribute="group") %}
385
- {{ group | upper_first }}
386
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
387
- {% for commit in commits %}
388
- * (`{{ commit.id | truncate(length=7, end="") }} <https://github.com/cofin/litestar-vite/commit/{{ commit.id }}>`_) {% if commit.breaking %}[**breaking**] {% endif %} - {{ commit.message | upper_first }} ({{ commit.author.name }})\
389
- {% for footer in commit.footers -%}
390
- , {{ footer.token }}{{ footer.separator }}{{ footer.value }}\
391
- {% endfor %}\
392
- {% endfor %}
393
- {% endfor %}\n
394
- """
395
- footer = """
396
- Litestar vite Changelog
397
- """
398
- header = """
399
- =========
400
- Changelog
401
- =========\n
402
- All commits to this project will be documented in this file.\n
403
- """
404
- trim = true
405
-
406
- [tool.git-cliff.git]
407
- commit_parsers = [
408
- { message = "^feat", group = "Features" },
409
- { message = "^fix", group = "Bug Fixes" },
410
- { message = "^doc", group = "Documentation" },
411
- { message = "^perf", group = "Performance" },
412
- { message = "^refactor", group = "Refactor" },
413
- { message = "^style", group = "Styling" },
414
- { message = "^test", group = "Testing" },
415
- { message = "^chore\\(release\\): prepare for", skip = true },
416
- { message = "^chore", group = "Miscellaneous Tasks" },
417
- { body = ".*security", group = "Security" },
418
- ]
419
- conventional_commits = true
420
- filter_commits = false
421
- filter_unconventional = true
422
- ignore_tags = ""
423
- protect_breaking_commits = false
424
- skip_tags = "v0.1.0-beta.1"
425
- sort_commits = "oldest"
426
- split_commits = false
427
- tag_pattern = "v[0-9]*"
428
- topo_order = false
366
+ skip = 'uv.lock,examples/inertia/package-lock.json,examples/inertia/public/assets/*.js'
@@ -0,0 +1,45 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021, 2022, 2023 Litestar Org.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ Code adapted from:
24
+
25
+ The MIT License (MIT)
26
+
27
+ Copyright (c) Taylor Otwell
28
+
29
+ Permission is hereby granted, free of charge, to any person obtaining a copy
30
+ of this software and associated documentation files (the "Software"), to deal
31
+ in the Software without restriction, including without limitation the rights
32
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
33
+ copies of the Software, and to permit persons to whom the Software is
34
+ furnished to do so, subject to the following conditions:
35
+
36
+ The above copyright notice and this permission notice shall be included in
37
+ all copies or substantial portions of the Software.
38
+
39
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
40
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
41
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
42
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
43
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
44
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
45
+ THE SOFTWARE.
@@ -0,0 +1,66 @@
1
+ SHELL := /bin/bash
2
+ # =============================================================================
3
+ # Variables
4
+ # =============================================================================
5
+
6
+ .DEFAULT_GOAL:=help
7
+ .ONESHELL:
8
+ NODE_MODULES_EXISTS = $(shell python3 -c "if __import__('pathlib').Path('node_modules').exists(): print('yes')")
9
+
10
+ .EXPORT_ALL_VARIABLES:
11
+
12
+ ifndef VERBOSE
13
+ .SILENT:
14
+ endif
15
+
16
+
17
+ .PHONY: help
18
+ help: ## Display this help text for Makefile
19
+ @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
20
+
21
+ .PHONY: upgrade
22
+ upgrade: ## Upgrade all dependencies to the latest stable versions
23
+ @echo "=> Updating all dependencies"
24
+ @npm upgrade --latest
25
+ @echo "=> Dependencies Updated"
26
+ # @pre-commit autoupdate
27
+ # @echo "=> Updated Pre-commit"
28
+
29
+ # =============================================================================
30
+ # Developer Utils
31
+ # =============================================================================
32
+ install: ## Install the project and
33
+ @if [ "$(NODE_MODULES_EXISTS)" ]; then echo "=> Removing existing node modules"; fi
34
+ @if [ "$(NODE_MODULES_EXISTS)" ]; then $(MAKE) destroy-node_modules; fi
35
+ @echo "=> Installing all dependencies"
36
+ @npm ci install --silent
37
+ @echo "=> Install complete! Note: If you want to re-install re-run 'make install'"
38
+
39
+ destroy-node_modules: ## Destroy the node environment
40
+ @rm -rf node_modules
41
+ # =============================================================================
42
+ # Tests, Linting, Coverage, Build
43
+ # =============================================================================
44
+ .PHONY: lint
45
+ lint: ## Runs pre-commit hooks; includes ruff linting, codespell, black
46
+ @echo "=> Running pre-commit process"
47
+ @pre-commit run --all-files
48
+ @echo "=> Pre-commit complete"
49
+
50
+ .PHONY: test
51
+ test: ## Run the tests
52
+ @echo "=> Running test cases"
53
+ @npm run test
54
+ @echo "=> Tests complete"
55
+
56
+ .PHONY: build
57
+ build:
58
+ @echo "=> Building package..."
59
+ @npm run build
60
+ @echo "=> Package build complete..."
61
+
62
+ .PHONY: publish
63
+ publish: test build
64
+ @echo "=> Publishing package..."
65
+ @npm publish
66
+ @echo "=> Package publish complete..."
@@ -0,0 +1,25 @@
1
+ # NOTICE
2
+
3
+ Code adapted from:
4
+
5
+ The MIT License (MIT)
6
+
7
+ Copyright (c) Taylor Otwell
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in
17
+ all copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ THE SOFTWARE.
@@ -0,0 +1,15 @@
1
+ # Litestar Vite Plugin
2
+
3
+ **Notice** This is experimental software
4
+
5
+ ## What is this?
6
+
7
+ This is a library for Litestar and Vite that makes integration between the the two easier.
8
+
9
+ For details on usage, use the `litestar-vite` [plugin](https://github.com/cofin/litestar-vite)
10
+
11
+ ## Credit
12
+
13
+ The team at Laravel have done an incredible job at making it easier to use common JS/TS frameworks with the framework.
14
+
15
+ This plugin is more than a little inspired by the worker here [Laravel's Vite Integration](https://github.com/laravel/vite-plugin)
@@ -0,0 +1,185 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+
7
+ <title>Litestar Vite</title>
8
+
9
+ <!-- Fonts -->
10
+ <link
11
+ href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap"
12
+ rel="stylesheet"
13
+ />
14
+
15
+ <script src="https://cdn.tailwindcss.com"></script>
16
+ </head>
17
+ <body class="antialiased">
18
+ <div
19
+ class="relative flex min-h-screen flex-col justify-center overflow-hidden bg-gray-100 text-gray-600 dark:text-gray-400 dark:bg-gray-900 py-6 sm:py-12"
20
+ >
21
+ <div
22
+ class="relative bg-white dark:bg-gray-800 px-6 pt-10 pb-8 shadow-xl ring-1 ring-gray-900/5 sm:mx-auto sm:max-w-xl sm:rounded-lg sm:px-10"
23
+ >
24
+ <div class="mx-auto">
25
+ <div class="flex items-center justify-center space-x-6">
26
+ <a href="https://litestar.dev">
27
+ <svg
28
+ viewBox="0 52 410 250"
29
+ xmlns="http://www.w3.org/2000/svg"
30
+ class="h-16 w-auto"
31
+ >
32
+ <defs>
33
+ <clipPath id="9eb7762d41">
34
+ <path
35
+ d="M 15.933594 105 L 328 105 L 328 259 L 15.933594 259 Z M 15.933594 105 "
36
+ clip-rule="nonzero"
37
+ />
38
+ </clipPath>
39
+ <clipPath id="183d3cc178">
40
+ <path
41
+ d="M 142 78.769531 L 359.433594 78.769531 L 359.433594 296.269531 L 142 296.269531 Z M 142 78.769531 "
42
+ clip-rule="nonzero"
43
+ />
44
+ </clipPath>
45
+ </defs>
46
+ <g clip-path="url(#9eb7762d41)">
47
+ <path
48
+ fill="#edb641"
49
+ d="M 147.625 240.3125 C 161.5 233.984375 173.554688 227.011719 183.425781 220.550781 C 202.304688 208.203125 226.4375 185.242188 227.761719 183.410156 L 218.917969 177.503906 L 211.257812 172.386719 L 235.503906 171.441406 L 243.296875 171.136719 L 245.414062 163.640625 L 252.007812 140.304688 L 260.402344 163.054688 L 263.097656 170.363281 L 270.890625 170.058594 L 295.136719 169.113281 L 276.078125 184.117188 L 269.953125 188.9375 L 272.652344 196.25 L 281.046875 218.996094 L 260.871094 205.523438 L 254.390625 201.195312 L 248.265625 206.015625 L 229.207031 221.023438 L 232.480469 209.425781 L 235.796875 197.691406 L 236.207031 196.234375 C 213.003906 213.585938 180.546875 230.304688 161.140625 236.488281 C 156.6875 237.90625 152.183594 239.179688 147.625 240.3125 Z M 101.992188 258.078125 C 136.382812 256.734375 177.355469 248 217.675781 222.363281 L 209.90625 249.867188 L 254.910156 214.4375 L 302.539062 246.246094 L 282.71875 192.539062 L 327.71875 157.109375 L 270.46875 159.34375 L 250.648438 105.636719 L 235.085938 160.726562 L 177.835938 162.964844 L 210.980469 185.097656 C 189.164062 204.921875 134.445312 247.195312 61.957031 250.03125 C 47.300781 250.601562 31.914062 249.558594 15.933594 246.394531 C 15.933594 246.394531 52.011719 260.035156 101.992188 258.078125 "
50
+ fill-opacity="1"
51
+ fill-rule="nonzero"
52
+ />
53
+ </g>
54
+ <g clip-path="url(#183d3cc178)">
55
+ <path
56
+ fill="#edb641"
57
+ d="M 250.789062 78.96875 C 190.78125 78.96875 142.140625 127.570312 142.140625 187.519531 C 142.140625 198.875 143.886719 209.816406 147.121094 220.101562 C 151.847656 217.75 156.363281 215.316406 160.660156 212.84375 C 158.394531 204.789062 157.183594 196.296875 157.183594 187.519531 C 157.183594 135.871094 199.089844 93.996094 250.789062 93.996094 C 302.484375 93.996094 344.390625 135.871094 344.390625 187.519531 C 344.390625 239.171875 302.484375 281.042969 250.789062 281.042969 C 222.75 281.042969 197.597656 268.722656 180.441406 249.210938 C 175.453125 251.152344 170.402344 252.917969 165.289062 254.511719 C 185.183594 279.816406 216.082031 296.070312 250.789062 296.070312 C 310.792969 296.070312 359.433594 247.472656 359.433594 187.519531 C 359.433594 127.570312 310.792969 78.96875 250.789062 78.96875 "
58
+ fill-opacity="1"
59
+ fill-rule="nonzero"
60
+ />
61
+ </g>
62
+ <path
63
+ fill="#edb641"
64
+ d="M 92.292969 173.023438 L 98.289062 191.460938 L 117.691406 191.460938 L 101.992188 202.855469 L 107.988281 221.292969 L 92.292969 209.898438 L 76.59375 221.292969 L 82.589844 202.855469 L 66.894531 191.460938 L 86.296875 191.460938 L 92.292969 173.023438 "
65
+ fill-opacity="1"
66
+ fill-rule="nonzero"
67
+ />
68
+ <path
69
+ fill="#edb641"
70
+ d="M 120.214844 112.25 L 125.390625 128.167969 L 142.140625 128.167969 L 128.589844 138 L 133.765625 153.917969 L 120.214844 144.082031 L 106.664062 153.917969 L 111.839844 138 L 98.289062 128.167969 L 115.039062 128.167969 L 120.214844 112.25 "
71
+ fill-opacity="1"
72
+ fill-rule="nonzero"
73
+ />
74
+ <path
75
+ fill="#edb641"
76
+ d="M 34.695312 209.136719 L 37.71875 218.421875 L 47.492188 218.421875 L 39.585938 224.160156 L 42.605469 233.449219 L 34.695312 227.707031 L 26.792969 233.449219 L 29.8125 224.160156 L 21.90625 218.421875 L 31.679688 218.421875 L 34.695312 209.136719 "
77
+ fill-opacity="1"
78
+ fill-rule="nonzero"
79
+ />
80
+ </svg>
81
+ </a>
82
+ <svg
83
+ xmlns="http://www.w3.org/2000/svg"
84
+ class="h-6 w-6 text-gray-500"
85
+ fill="none"
86
+ viewBox="0 0 24 24"
87
+ stroke="currentColor"
88
+ stroke-width="2"
89
+ >
90
+ <path
91
+ stroke-linecap="round"
92
+ stroke-linejoin="round"
93
+ d="M12 4v16m8-8H4"
94
+ />
95
+ </svg>
96
+ <a href="https://vitejs.dev">
97
+ <svg
98
+ viewBox="0 0 410 404"
99
+ fill="none"
100
+ xmlns="http://www.w3.org/2000/svg"
101
+ class="h-16 w-auto"
102
+ >
103
+ <path
104
+ d="M399.641 59.5246L215.643 388.545C211.844 395.338 202.084 395.378 198.228 388.618L10.5817 59.5563C6.38087 52.1896 12.6802 43.2665 21.0281 44.7586L205.223 77.6824C206.398 77.8924 207.601 77.8904 208.776 77.6763L389.119 44.8058C397.439 43.2894 403.768 52.1434 399.641 59.5246Z"
105
+ fill="url(#paint0_linear)"
106
+ />
107
+ <path
108
+ d="M292.965 1.5744L156.801 28.2552C154.563 28.6937 152.906 30.5903 152.771 32.8664L144.395 174.33C144.198 177.662 147.258 180.248 150.51 179.498L188.42 170.749C191.967 169.931 195.172 173.055 194.443 176.622L183.18 231.775C182.422 235.487 185.907 238.661 189.532 237.56L212.947 230.446C216.577 229.344 220.065 232.527 219.297 236.242L201.398 322.875C200.278 328.294 207.486 331.249 210.492 326.603L212.5 323.5L323.454 102.072C325.312 98.3645 322.108 94.137 318.036 94.9228L279.014 102.454C275.347 103.161 272.227 99.746 273.262 96.1583L298.731 7.86689C299.767 4.27314 296.636 0.855181 292.965 1.5744Z"
109
+ fill="url(#paint1_linear)"
110
+ />
111
+ <defs>
112
+ <linearGradient
113
+ id="paint0_linear"
114
+ x1="6.00017"
115
+ y1="32.9999"
116
+ x2="235"
117
+ y2="344"
118
+ gradientUnits="userSpaceOnUse"
119
+ >
120
+ <stop stop-color="#41D1FF" />
121
+ <stop offset="1" stop-color="#BD34FE" />
122
+ </linearGradient>
123
+ <linearGradient
124
+ id="paint1_linear"
125
+ x1="194.651"
126
+ y1="8.81818"
127
+ x2="236.076"
128
+ y2="292.989"
129
+ gradientUnits="userSpaceOnUse"
130
+ >
131
+ <stop stop-color="#FFEA83" />
132
+ <stop
133
+ offset="0.0833333"
134
+ stop-color="#FFDD35"
135
+ />
136
+ <stop offset="1" stop-color="#FFA800" />
137
+ </linearGradient>
138
+ </defs>
139
+ </svg>
140
+ </a>
141
+ </div>
142
+ <div class="divide-y divide-gray-300 dark:divide-gray-700">
143
+ <div class="py-8 text-base leading-7">
144
+ <p>
145
+ This is the Vite development server that
146
+ provides Hot Module Replacement for your
147
+ Litestar application.
148
+ </p>
149
+ <p class="mt-6">
150
+ To access your Litestar application, you will
151
+ need to run a local development server.
152
+ </p>
153
+ </div>
154
+ <div class="pt-8 text-base leading-7">
155
+ <p>
156
+ Your Litestar application's configured
157
+ <code
158
+ class="text-sm font-bold text-gray-900 dark:text-gray-100"
159
+ >APP_URL</code
160
+ >
161
+ is:<br />
162
+ <a
163
+ href="{{ APP_URL }}"
164
+ class="font-semibold text-red-500 hover:text-red-600"
165
+ >{{ APP_URL }}</a
166
+ >
167
+ </p>
168
+ <p class="mt-6">
169
+ Want more information on Litestar's Vite
170
+ integration?
171
+ </p>
172
+ <p>
173
+ <a
174
+ href="https://litestar.dev/docs/vite"
175
+ class="font-semibold text-red-500 hover:text-red-600"
176
+ >Read the docs &rarr;</a
177
+ >
178
+ </p>
179
+ </div>
180
+ </div>
181
+ </div>
182
+ </div>
183
+ </div>
184
+ </body>
185
+ </html>