Skip to content

Commit

Permalink
Hooks and upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Nov 22, 2024
1 parent b8866bf commit c3f2fd0
Show file tree
Hide file tree
Showing 7 changed files with 161 additions and 102 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ repos:
- id: djade
args: [--target-version, "5.1"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.7.1"
rev: "v0.8.0"
hooks:
- id: ruff
args: [--unsafe-fixes]
Expand All @@ -51,7 +51,7 @@ repos:
hooks:
- id: pyproject-fmt
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.22
rev: v0.23
hooks:
- id: validate-pyproject
- repo: https://github.com/biomejs/pre-commit
Expand Down
2 changes: 1 addition & 1 deletion fabfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fh_fablib as fl


fl.require("1.0.20241002")
fl.require("1.0.20241122.2")
fl.config.update(
domain="traduire.feinheit.dev",
branch="main",
Expand Down
1 change: 1 addition & 0 deletions frontend/styles/reset.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ dd {
/* Set core body defaults */
body {
min-height: 100vh;
/* biome-ignore lint/nursery/noDuplicateProperties: May be unsupported */
min-height: -webkit-fill-available;
scroll-behavior: smooth;
text-rendering: optimizespeed;
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
"semi": false
},
"dependencies": {
"@rspack/cli": "^1.1.1",
"@rspack/core": "^1.1.1",
"@rspack/cli": "^1.1.3",
"@rspack/core": "^1.1.3",
"@swc/helpers": "^0.5.15",
"autoprefixer": "^10.4.20",
"css-loader": "^7.1.2",
"html-webpack-plugin": "^5.6.3",
"postcss": "^8.4.49",
"postcss-loader": "^8.1.1",
Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ blacknoise==1.1.0
certifi==2024.8.30
charset-normalizer==3.4.0
click==8.1.7
coverage==7.6.4
coverage==7.6.7
django==5.1.3
django-authlib==0.17.1
django-authlib==0.17.2
django-canonical-domain==0.11.0
django-debug-toolbar==5.0.0a0
django-ratelimit==4.1.0
Expand All @@ -21,12 +21,12 @@ psycopg-binary==3.2.3
python-dateutil==2.9.0.post0
requests==2.32.3
requests-oauthlib==2.0.0
sentry-sdk==2.18.0
sentry-sdk==2.19.0
six==1.16.0
sniffio==1.3.1
speckenv==6.2
sqlparse==0.5.1
starlette==0.41.2
sqlparse==0.5.2
starlette==0.41.3
time-machine==2.16.0
typing-extensions==4.12.2
urllib3==2.2.3
Expand Down
18 changes: 14 additions & 4 deletions rspack.library.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ TO FH-FABLIB AT https://github.com/feinheit/fh-fablib

const path = require("node:path")
const HtmlWebpackPlugin = require("html-webpack-plugin")
const rspack = require("@rspack/core")

const truthy = (...list) => list.filter((el) => !!el)

Expand Down Expand Up @@ -114,10 +115,19 @@ module.exports = (PRODUCTION) => {

function postcssLoaders(plugins) {
return [
{ loader: rspack.CssExtractRspackPlugin.loader },
{ loader: "css-loader" },
{ loader: "postcss-loader", options: { postcssOptions: { plugins } } },
]
}

function cssExtractPlugin() {
return new rspack.CssExtractRspackPlugin({
filename: PRODUCTION ? "[name].[contenthash].css" : "[name].css",
chunkFilename: PRODUCTION ? "[name].[contenthash].css" : "[name].css",
})
}

return {
truthy,
base: {
Expand All @@ -133,8 +143,7 @@ module.exports = (PRODUCTION) => {
// Same as the default but prefixed with "_/[name]."
assetModuleFilename: "_/[name].[hash][ext][query][fragment]",
},
plugins: truthy(htmlSingleChunkPlugin()),
experiments: { css: true },
plugins: truthy(cssExtractPlugin(), htmlSingleChunkPlugin()),
target: "browserslist:defaults",
},
devServer(proxySettings) {
Expand Down Expand Up @@ -175,7 +184,7 @@ module.exports = (PRODUCTION) => {
postcssRule(cfg) {
return {
test: /\.css$/i,
type: "css",
type: "javascript/auto",
use: postcssLoaders(cfg?.plugins),
}
},
Expand All @@ -195,7 +204,7 @@ module.exports = (PRODUCTION) => {
},
},
],
type: "css",
type: "javascript/auto",
}
},
swcWithPreactRule,
Expand All @@ -215,5 +224,6 @@ module.exports = (PRODUCTION) => {
htmlPlugin,
htmlSingleChunkPlugin,
postcssLoaders,
cssExtractPlugin,
}
}
Loading

0 comments on commit c3f2fd0

Please sign in to comment.