From 32444fac9067d25da170d4fdfd1f46ff74ba9a7c Mon Sep 17 00:00:00 2001 From: Sli Date: Thu, 10 Oct 2024 15:42:11 +0200 Subject: [PATCH] Apply review comments --- .../static/webpack/user/family-graph-index.js | 6 ++--- core/static/webpack/user/pictures-index.js | 2 +- docs/howto/js-import-paths.md | 26 +++++++++---------- docs/howto/statics.md | 4 +-- openapi-ts.config.ts | 6 ++--- sas/static/webpack/sas/viewer-index.js | 8 +++--- staticfiles/storage.py | 2 +- tsconfig.json | 1 - webpack.config.js | 2 +- 9 files changed, 28 insertions(+), 29 deletions(-) diff --git a/core/static/webpack/user/family-graph-index.js b/core/static/webpack/user/family-graph-index.js index 8ddb8d35..0ff97f98 100644 --- a/core/static/webpack/user/family-graph-index.js +++ b/core/static/webpack/user/family-graph-index.js @@ -170,9 +170,9 @@ function createGraph(container, data, activeUserId) { /** * @typedef FamilyGraphConfig - * @param {number} activeUser Id of the user to fetch the tree from - * @param {number} depthMin Minimum tree depth for godfathers and godchildren - * @param {number} depthMax Maximum tree depth for godfathers and godchildren + * @property {number} activeUser Id of the user to fetch the tree from + * @property {number} depthMin Minimum tree depth for godfathers and godchildren + * @property {number} depthMax Maximum tree depth for godfathers and godchildren **/ /** diff --git a/core/static/webpack/user/pictures-index.js b/core/static/webpack/user/pictures-index.js index c5c4c357..0ec234f7 100644 --- a/core/static/webpack/user/pictures-index.js +++ b/core/static/webpack/user/pictures-index.js @@ -30,7 +30,7 @@ import { picturesFetchPictures } from "#openapi"; /** * @typedef PicturePageConfig - * @param {number} userId Id of the user to get the pictures from + * @property {number} userId Id of the user to get the pictures from **/ /** diff --git a/docs/howto/js-import-paths.md b/docs/howto/js-import-paths.md index e24b5a35..1fd270d1 100644 --- a/docs/howto/js-import-paths.md +++ b/docs/howto/js-import-paths.md @@ -8,12 +8,12 @@ D'abord, il faut ajouter dans node via `package.json`: ```json { - // ... - "imports": { - // ... - "#mon_app:*": "./mon_app/static/webpack/*" - } - // ... + // ... + "imports": { + // ... + "#mon_app:*": "./mon_app/static/webpack/*" + } + // ... } ``` @@ -21,13 +21,13 @@ Ensuite, pour faire fonctionne l'auto-complétion, il faut configurer `tsconfig. ```json { - "compilerOptions": { - // ... - "paths": { - // ... - "#mon_app:*": ["./mon_app/static/webpack/*"] - } - } + "compilerOptions": { + // ... + "paths": { + // ... + "#mon_app:*": ["./mon_app/static/webpack/*"] + } + } } ``` diff --git a/docs/howto/statics.md b/docs/howto/statics.md index 5c9dfdc4..2dbacb09 100644 --- a/docs/howto/statics.md +++ b/docs/howto/statics.md @@ -48,9 +48,9 @@ Pour accéder au fichier, il faut utiliser `static` comme pour le reste mais en ### Les imports au sein des fichiers de webpack -Pour importer au sein de webpack, faut préfixer ses imports de `#app:`. +Pour importer au sein de webpack, il faut préfixer ses imports de `#app:`. -Example: +Exemple: ```js import { paginated } from "#core:utils/api"; diff --git a/openapi-ts.config.ts b/openapi-ts.config.ts index d43e76f0..d583ffee 100644 --- a/openapi-ts.config.ts +++ b/openapi-ts.config.ts @@ -1,10 +1,10 @@ // biome-ignore lint/correctness/noNodejsModules: this only used at compile time -const path = require("node:path"); +import { resolve } from "node:path"; import { defineConfig } from "@hey-api/openapi-ts"; // biome-ignore lint/style/noDefaultExport: needed for openapi-ts export default defineConfig({ client: "@hey-api/client-fetch", - input: path.resolve(__dirname, "./staticfiles/generated/openapi/schema.json"), - output: path.resolve(__dirname, "./staticfiles/generated/openapi"), + input: resolve(__dirname, "./staticfiles/generated/openapi/schema.json"), + output: resolve(__dirname, "./staticfiles/generated/openapi"), }); diff --git a/sas/static/webpack/sas/viewer-index.js b/sas/static/webpack/sas/viewer-index.js index 6d8ae622..222fb519 100644 --- a/sas/static/webpack/sas/viewer-index.js +++ b/sas/static/webpack/sas/viewer-index.js @@ -81,10 +81,10 @@ class PictureWithIdentifications { /** * @typedef ViewerConfig - * @param {number} userId Id of the user to get the pictures from - * @param {number} albumId Id of the album to displlay - * @param {number} firstPictureId id of the first picture to load on the page - * @param {bool} userIsSasAdmin if the user is sas admin + * @property {number} userId Id of the user to get the pictures from + * @property {number} albumId Id of the album to displlay + * @property {number} firstPictureId id of the first picture to load on the page + * @property {bool} userIsSasAdmin if the user is sas admin **/ /** diff --git a/staticfiles/storage.py b/staticfiles/storage.py index 8de9f23f..3aaca470 100644 --- a/staticfiles/storage.py +++ b/staticfiles/storage.py @@ -27,7 +27,7 @@ class ManifestPostProcessingStorage(ManifestStaticFilesStorage): ) name = str(path.with_suffix(".css")) - if path.suffix == ".ts": + elif path.suffix == ".ts": name = str(path.with_suffix(".js")) return super().url(name, force=force) diff --git a/tsconfig.json b/tsconfig.json index 7a3c404d..6c70fc04 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,6 @@ "noImplicitAny": true, "module": "es6", "target": "es5", - "jsx": "react", "allowJs": true, "moduleResolution": "node", "paths": { diff --git a/webpack.config.js b/webpack.config.js index d1deb51a..ca2b7046 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -23,7 +23,7 @@ module.exports = { return obj; }, {}), cache: { - type: "filesystem", // This reduces typescript compilation time like crazy + type: "filesystem", // This reduces typescript compilation time like crazy when you restart the server }, output: { filename: "[name].js",