mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-13 04:05:04 +03:00
treewide: fix package structure
The static files need to be inside the module to be installed correctly as part of the module.
This commit is contained in:
+1
-1
@@ -153,7 +153,7 @@ dmypy.json
|
|||||||
cython_debug/
|
cython_debug/
|
||||||
|
|
||||||
# static files are built
|
# static files are built
|
||||||
backend/static
|
backend/decky_loader/static
|
||||||
|
|
||||||
# ignore settings.json
|
# ignore settings.json
|
||||||
# prevents leaking login details
|
# prevents leaking login details
|
||||||
|
|||||||
@@ -106,12 +106,12 @@ class Loader:
|
|||||||
self.watcher.disabled = False
|
self.watcher.disabled = False
|
||||||
|
|
||||||
async def handle_frontend_assets(self, request: web.Request):
|
async def handle_frontend_assets(self, request: web.Request):
|
||||||
file = Path(__file__).parents[1].joinpath("static").joinpath(request.match_info["path"])
|
file = Path(__file__).parent.joinpath("static").joinpath(request.match_info["path"])
|
||||||
return web.FileResponse(file, headers={"Cache-Control": "no-cache"})
|
return web.FileResponse(file, headers={"Cache-Control": "no-cache"})
|
||||||
|
|
||||||
async def handle_frontend_locales(self, request: web.Request):
|
async def handle_frontend_locales(self, request: web.Request):
|
||||||
req_lang = request.match_info["path"]
|
req_lang = request.match_info["path"]
|
||||||
file = Path(__file__).parents[1].joinpath("locales").joinpath(req_lang)
|
file = Path(__file__).parent.joinpath("locales").joinpath(req_lang)
|
||||||
if exists(file):
|
if exists(file):
|
||||||
return web.FileResponse(file, headers={"Cache-Control": "no-cache", "Content-Type": "application/json"})
|
return web.FileResponse(file, headers={"Cache-Control": "no-cache", "Content-Type": "application/json"})
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ class PluginManager:
|
|||||||
|
|
||||||
for route in list(self.web_app.router.routes()):
|
for route in list(self.web_app.router.routes()):
|
||||||
self.cors.add(route) # pyright: ignore [reportUnknownMemberType]
|
self.cors.add(route) # pyright: ignore [reportUnknownMemberType]
|
||||||
self.web_app.add_routes([static("/static", path.join(path.dirname(__file__), '..', 'static'))])
|
self.web_app.add_routes([static("/static", path.join(path.dirname(__file__), 'static'))])
|
||||||
|
|
||||||
def exception_handler(self, loop: AbstractEventLoop, context: Dict[str, str]):
|
def exception_handler(self, loop: AbstractEventLoop, context: Dict[str, str]):
|
||||||
if context["message"] == "Unclosed connection":
|
if context["message"] == "Unclosed connection":
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ from PyInstaller.utils.hooks import copy_metadata
|
|||||||
a = Analysis(
|
a = Analysis(
|
||||||
['main.py'],
|
['main.py'],
|
||||||
datas=[
|
datas=[
|
||||||
('locales', 'locales'),
|
('decky_loader/locales', 'decky_loader/locales'),
|
||||||
('static', 'static'),
|
('decky_loader/static', 'decky_loader/static'),
|
||||||
] + copy_metadata('decky_loader'),
|
] + copy_metadata('decky_loader'),
|
||||||
hiddenimports=['logging.handlers', 'sqlite3', 'decky_plugin', 'decky'],
|
hiddenimports=['logging.handlers', 'sqlite3', 'decky_plugin', 'decky'],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,7 +8,10 @@ packages = [
|
|||||||
{include = "decky_loader"},
|
{include = "decky_loader"},
|
||||||
{include = "decky_loader/main.py"}
|
{include = "decky_loader/main.py"}
|
||||||
]
|
]
|
||||||
include = ["decky_loader/static/*"]
|
include = [
|
||||||
|
"decky_loader/locales/*",
|
||||||
|
"decky_loader/static/*"
|
||||||
|
]
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = ">=3.10,<3.13"
|
python = ">=3.10,<3.13"
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export default {
|
|||||||
// Namespace separator used in your translation keys
|
// Namespace separator used in your translation keys
|
||||||
// If you want to use plain english keys, separators such as `.` and `:` will conflict. You might want to set `keySeparator: false` and `namespaceSeparator: false`. That way, `t('Status: Loading...')` will not think that there are a namespace and three separator dots for instance.
|
// If you want to use plain english keys, separators such as `.` and `:` will conflict. You might want to set `keySeparator: false` and `namespaceSeparator: false`. That way, `t('Status: Loading...')` will not think that there are a namespace and three separator dots for instance.
|
||||||
|
|
||||||
output: '../backend/locales/$LOCALE.json',
|
output: '../backend/decky_loader/locales/$LOCALE.json',
|
||||||
// Supports $LOCALE and $NAMESPACE injection
|
// Supports $LOCALE and $NAMESPACE injection
|
||||||
// Supports JSON (.json) and YAML (.yml) file formats
|
// Supports JSON (.json) and YAML (.yml) file formats
|
||||||
// Where to write the locale files relative to process.cwd()
|
// Where to write the locale files relative to process.cwd()
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ const hiddenWarnings = ['THIS_IS_UNDEFINED', 'EVAL'];
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
input: 'src/index.ts',
|
input: 'src/index.ts',
|
||||||
plugins: [
|
plugins: [
|
||||||
del({ targets: '../backend/static/*', force: true }),
|
del({ targets: '../backend/decky_loader/static/*', force: true }),
|
||||||
commonjs(),
|
commonjs(),
|
||||||
nodeResolve({
|
nodeResolve({
|
||||||
browser: true,
|
browser: true,
|
||||||
@@ -38,7 +38,7 @@ export default defineConfig({
|
|||||||
],
|
],
|
||||||
preserveEntrySignatures: false,
|
preserveEntrySignatures: false,
|
||||||
output: {
|
output: {
|
||||||
dir: '../backend/static',
|
dir: '../backend/decky_loader/static',
|
||||||
format: 'esm',
|
format: 'esm',
|
||||||
chunkFileNames: (chunkInfo) => {
|
chunkFileNames: (chunkInfo) => {
|
||||||
return 'chunk-[hash].js';
|
return 'chunk-[hash].js';
|
||||||
|
|||||||
Reference in New Issue
Block a user