fix(scripts/stylus-import): add calculated digest to userstyle entries (#1540)
This commit is contained in:
1 parent
699833e1a8
commit
21bec677c8
2 files changed
+12
-3
No files matched your search
@@ -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": {
|
"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": {
|
"workspace": {
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { REPO_ROOT } from "@/constants.ts";
|
|||||||
import * as path from "@std/path";
|
import * as path from "@std/path";
|
||||||
import usercssMeta from "usercss-meta";
|
import usercssMeta from "usercss-meta";
|
||||||
import { ensureDir, walk } from "@std/fs";
|
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"), {
|
const stylesheets = walk(path.join(REPO_ROOT, "styles"), {
|
||||||
includeFiles: true,
|
includeFiles: true,
|
||||||
@@ -27,7 +28,7 @@ for await (const entry of stylesheets) {
|
|||||||
const content = await Deno.readTextFile(entry.path);
|
const content = await Deno.readTextFile(entry.path);
|
||||||
const { metadata } = usercssMeta.parse(content);
|
const { metadata } = usercssMeta.parse(content);
|
||||||
|
|
||||||
data.push({
|
const userstyle = {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
name: metadata.name,
|
name: metadata.name,
|
||||||
description: metadata.description,
|
description: metadata.description,
|
||||||
@@ -36,7 +37,11 @@ for await (const entry of stylesheets) {
|
|||||||
updateUrl: metadata.updateURL,
|
updateUrl: metadata.updateURL,
|
||||||
usercssData: metadata,
|
usercssData: metadata,
|
||||||
sourceCode: content,
|
sourceCode: content,
|
||||||
});
|
} as Record<string, unknown>;
|
||||||
|
|
||||||
|
userstyle.originalDigest = await calcStyleDigest(userstyle);
|
||||||
|
|
||||||
|
data.push(userstyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
await ensureDir("dist");
|
await ensureDir("dist");
|
||||||
|
|||||||
Reference in new issue
Block a user