Skip to content

Commit

Permalink
build: update to lume v1.19.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jrson83 committed Jul 12, 2024
1 parent aca3d20 commit c3f8df5
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 35 deletions.
5 changes: 3 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"clean": "rm -rf ./_site",
"build": "BUILD_MODE=\"prod\" deno task lume",
"serve": "BUILD_MODE=\"dev\" deno task lume -s",
"lume": "echo \"import 'lume/cli.ts'\" | deno run --unstable -A -"
"lume": "echo \"import 'lume/cli.ts'\" | deno run -A -"
},
"lint": {
"exclude": [
Expand All @@ -28,5 +28,6 @@
"exclude": [
"./_site"
]
}
},
"velociraptor": "./scripts.ts"
}
2 changes: 1 addition & 1 deletion import_map.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"imports": {
"lume/": "https://deno.land/x/lume@v1.19.0/",
"lume/": "https://deno.land/x/lume@v1.19.1/",
"#plugins/": "./plugins/",
"#types": "./src/_includes/types.ts",
"#utils": "./src/_includes/utils/index.ts"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** The plugin is deprecated in favour of: https://lume.land/plugins/sitemap/ */
// deno-lint-ignore-file -- The plugin is deprecated in favour of: https://lume.land/plugins/sitemap/

import { merge } from "lume/core/utils.ts";
import { Page } from "lume/core/filesystem.ts";
Expand Down
2 changes: 1 addition & 1 deletion plugins/md5-cache-buster/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function (userOptions?: Partial<Options>) {

function replaceUrls() {
site.use(modifyUrls({
fn(url, page) {
fn(url, _page) {
if (url.endsWith(".css") || url.endsWith(".js")) {
const result = hashedAssets.find((asset) => {
return asset.filename.toLowerCase() === url.toLowerCase();
Expand Down
28 changes: 0 additions & 28 deletions scripts.json

This file was deleted.

26 changes: 26 additions & 0 deletions scripts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { ScriptsConfiguration } from "https://deno.land/x/velociraptor@1.5.0/mod.ts";

export default <ScriptsConfiguration> {
scripts: {
clean: {
desc: "Clean dist",
cmd: '"rm -rf ./_site',
},
check: {
desc: "Type-checks the code",
cmd: "deno cache --unstable -c deno.json ./src/index.tsx",
},
fmt: {
desc: "Formats code",
cmd: "deno fmt -c deno.json",
},
lint: {
desc: "Lints code",
cmd: "deno lint -c deno.json",
},
"pre-commit": {
cmd: ["vr fmt", "vr lint", "vr check"],
gitHook: "pre-commit",
},
},
};
2 changes: 1 addition & 1 deletion src/scripts/blog.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const debounce = (fn) => {

const storeScroll = () => {
const contentBox = main.getBoundingClientRect();
const screenHeight = window.innerHeight;
const screenHeight = globalThis.innerHeight;

const headerHeight = header.offsetHeight;
const mainHeight = contentBox.height;
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const root = document.documentElement;
const mediaQuery = "(prefers-color-scheme: dark)";
const mediaMatch = window.matchMedia;
const mediaMatch = globalThis.matchMedia;
const currentMode = mediaMatch(mediaQuery).matches;

const storeTheme = (targetTheme) => {
Expand Down

0 comments on commit c3f8df5

Please sign in to comment.