-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add project templating and javascript plugin
feat: add project templating and javascript plugin
- Loading branch information
Showing
45 changed files
with
2,623 additions
and
687 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,3 +163,5 @@ cython_debug/ | |
|
||
# vscode | ||
.vscode | ||
|
||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from __future__ import annotations | ||
|
||
from pathlib import Path | ||
|
||
from litestar import Litestar | ||
|
||
from litestar_vite import ViteConfig, VitePlugin | ||
|
||
here = Path(__file__).parent | ||
|
||
vite = VitePlugin( | ||
config=ViteConfig( | ||
bundle_dir=Path(here / "web" / "public"), | ||
resource_dir=Path(here / "web" / "resources"), | ||
assets_dir=Path(here / "web" / "resources" / "assets"), | ||
templates_dir=Path(here / "web" / "templates"), | ||
hot_reload=True, | ||
), | ||
) | ||
app = Litestar(plugins=[vite]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"private": true, | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build" | ||
}, | ||
"dependencies": { | ||
"htmx.org": "^1.9.6" | ||
}, | ||
"devDependencies": { | ||
"axios": "^1.1.2", | ||
"litestar-vite-plugin": "^0.1.0", | ||
"typescript": "^4.9.5", | ||
"autoprefixer": "^10.4.16", | ||
"postcss": "^8.4.31", | ||
"tailwindcss": "^3.3.5", | ||
"vite": "^4.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ESNext", | ||
"useDefineForClassFields": true, | ||
"module": "ESNext", | ||
"moduleResolution": "node", | ||
"strict": true, | ||
"jsx": "preserve", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"esModuleInterop": true, | ||
"lib": ["ESNext", "DOM"], | ||
"skipLibCheck": true, | ||
"noEmit": true, | ||
"composite": true, | ||
"allowSyntheticDefaultImports": true, | ||
"baseUrl": "resources", | ||
"paths": { | ||
"@/*": ["./*"] | ||
}, | ||
"types": ["vite/client", "node"] | ||
}, | ||
"include": [ | ||
"**/*.d.ts", | ||
"resources/**/*.js" , | ||
"resources/**/*.ts" , | ||
|
||
|
||
"vite.config.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { defineConfig } from "vite"; | ||
|
||
|
||
import litestar from "litestar-vite-plugin"; | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
|
||
|
||
litestar({ | ||
input: [ | ||
"resources/styles.css" | ||
], | ||
assetUrl: "/static/", | ||
assetDirectory: "resources/assets", | ||
bundleDirectory: "public", | ||
resourceDirectory: "resources" | ||
}), | ||
], | ||
resolve: { | ||
alias: { | ||
"@": "resources", | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from __future__ import annotations | ||
|
||
from pathlib import Path | ||
|
||
from litestar import Litestar | ||
|
||
from litestar_vite import ViteConfig, VitePlugin | ||
|
||
here = Path(__file__).parent | ||
|
||
vite = VitePlugin( | ||
config=ViteConfig( | ||
bundle_dir=Path(here / "web" / "public"), | ||
resource_dir=Path(here / "web" / "resources"), | ||
assets_dir=Path(here / "web" / "resources" / "assets"), | ||
templates_dir=Path(here / "web" / "templates"), | ||
hot_reload=True, | ||
), | ||
) | ||
app = Litestar(plugins=[vite]) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from __future__ import annotations | ||
|
||
from pathlib import Path | ||
|
||
from litestar import Litestar | ||
from web.controllers import WebController | ||
|
||
from litestar_vite import ViteConfig, VitePlugin | ||
|
||
here = Path(__file__).parent | ||
|
||
vite = VitePlugin( | ||
config=ViteConfig( | ||
bundle_dir=Path(here / "web" / "public"), | ||
resource_dir=Path(here / "web" / "resources"), | ||
assets_dir=Path(here / "web" / "resources" / "assets"), | ||
templates_dir=Path(here / "web" / "templates"), | ||
hot_reload=True, | ||
port=3006, | ||
), | ||
) | ||
app = Litestar(plugins=[vite], route_handlers=[WebController]) |
Oops, something went wrong.