diff --git a/deno.lock b/deno.lock index be8a0a6a84..ad53834cb9 100644 --- a/deno.lock +++ b/deno.lock @@ -1219,8 +1219,12 @@ ] } }, + "redirects": { + "https://github.com/openstyles/stylus/raw/8fe35a4b90d85fb911bd7aa1deab4e4733c31150/src/js/sections-util.js": "https://raw.githubusercontent.com/openstyles/stylus/8fe35a4b90d85fb911bd7aa1deab4e4733c31150/src/js/sections-util.js" + }, "remote": { - "https://raw.githubusercontent.com/catppuccin/catppuccin/d4f2666c2b04337f0a8632713de0889d9a7d332d/resources/ports.schema.json": "39ce3bcd2dabd033010684df7caa82cc69c25584174eba0922e6435dce53f06a" + "https://raw.githubusercontent.com/catppuccin/catppuccin/d4f2666c2b04337f0a8632713de0889d9a7d332d/resources/ports.schema.json": "39ce3bcd2dabd033010684df7caa82cc69c25584174eba0922e6435dce53f06a", + "https://raw.githubusercontent.com/openstyles/stylus/8fe35a4b90d85fb911bd7aa1deab4e4733c31150/src/js/sections-util.js": "387e164ad40bc76048dccaafce6a032ac745616e7fc29f1873d7da33f5739502" }, "workspace": { "dependencies": [ diff --git a/scripts/stylus-import/main.ts b/scripts/stylus-import/main.ts index 2de693ead4..e6fa3abf3b 100644 --- a/scripts/stylus-import/main.ts +++ b/scripts/stylus-import/main.ts @@ -3,6 +3,7 @@ import { REPO_ROOT } from "@/constants.ts"; import * as path from "@std/path"; import usercssMeta from "usercss-meta"; import { ensureDir, walk } from "@std/fs"; +import { calcStyleDigest } from "https://github.com/openstyles/stylus/raw/8fe35a4b90d85fb911bd7aa1deab4e4733c31150/src/js/sections-util.js"; const stylesheets = walk(path.join(REPO_ROOT, "styles"), { includeFiles: true, @@ -27,7 +28,7 @@ for await (const entry of stylesheets) { const content = await Deno.readTextFile(entry.path); const { metadata } = usercssMeta.parse(content); - data.push({ + const userstyle = { enabled: true, name: metadata.name, description: metadata.description, @@ -36,7 +37,11 @@ for await (const entry of stylesheets) { updateUrl: metadata.updateURL, usercssData: metadata, sourceCode: content, - }); + } as Record; + + userstyle.originalDigest = await calcStyleDigest(userstyle); + + data.push(userstyle); } await ensureDir("dist");