@mark1russell7/site-pages 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js CHANGED
@@ -1 +1,3 @@
1
- export { S as BASE_CSS, U as DEFAULT_CHANGELOGS, nt as GITHUB_API, rt as GITHUB_GRAPHQL, t as HELP, et as NPM_REGISTRY, j as OPEN_CLASSES, h as RELEASES_SCRIPT, W as ReleaseDataError, M as RoadmapParseError, N as STATUS_CLASSES, c as STATUS_SCRIPT, o as TYPESCRIPT_PROBE, n as UsageError, r as build, P as buildStatusBoard, it as checkStateOf, l as classCounts, dt as compareVersions, w as dayRange, O as escapeHtml, st as firstSentence, Y as gitTagDates, at as githubOpenWork, ot as githubReleases, J as globFiles, X as headCommit, ct as headingAnchor, Z as headingDate, k as inlineMarkdown, Q as isShallow, ft as kindOf, v as laneCenter, F as linksOf, T as longDate, I as markdownTables, G as mergeReleases, tt as npmPublishTimes, y as oldestFirst, u as openGroups, $ as originRepository, C as pageShell, i as parseBuildArgs, lt as parseChangelog, L as parseRoadmap, pt as parseVersion, R as plainText, s as probeScript, K as readChangelogs, q as readReleases, z as readStatusBoard, ut as releaseBodyEntries, b as releaseSummary, g as releasesLead, _ as renderReleasesPage, d as renderStatusPage, B as roadmapItems, a as runCli, A as safeUrl, f as sectionsOf, E as shortDate, p as slugOf, V as splitRow, H as statusClassOf, m as statusLead, x as timelineLayout, D as utcDay, mt as versionOfTag } from "./build-xJqNIzdO.js";
1
+ import { $ as checkStateOf, A as safeUrl, B as roadmapItems, C as pageShell, D as utcDay, E as shortDate, F as linksOf, G as mergeReleases, H as statusClassOf, I as markdownTables, J as globFiles, K as readChangelogs, L as parseRoadmap, M as RoadmapParseError, N as STATUS_CLASSES, O as escapeHtml, P as buildStatusBoard, Q as GITHUB_GRAPHQL, R as plainText, S as BASE_CSS, T as longDate, U as DEFAULT_CHANGELOGS, V as splitRow, W as ReleaseDataError, X as npmPublishTimes, Y as NPM_REGISTRY, Z as GITHUB_API, _ as renderReleasesPage, a as runCli, at as releaseBodyEntries, b as releaseSummary, c as STATUS_SCRIPT, ct as parseVersion, d as renderStatusPage, et as githubOpenWork, f as sectionsOf, g as releasesLead, h as RELEASES_SCRIPT, i as parseBuildArgs, it as parseChangelog, j as OPEN_CLASSES, k as inlineMarkdown, l as classCounts, lt as versionOfTag, m as statusLead, n as UsageError, nt as firstSentence, o as TYPESCRIPT_PROBE, ot as compareVersions, p as slugOf, q as readReleases, r as build, rt as headingAnchor, s as probeScript, st as kindOf, t as HELP, tt as githubReleases, u as openGroups, v as laneCenter, w as dayRange, x as timelineLayout, y as oldestFirst, z as readStatusBoard } from "./chunks/build.js";
2
+ import { a as kpiProblems, c as writeKpi, d as headingDate, f as isShallow, i as kpiFile, l as gitTagDates, n as KPI_FORMAT, o as kpiText, p as originRepository, r as KpiError, s as readKpi, t as KPI_FILE, u as headCommit } from "./chunks/kpi.js";
3
+ export { BASE_CSS, DEFAULT_CHANGELOGS, GITHUB_API, GITHUB_GRAPHQL, HELP, KPI_FILE, KPI_FORMAT, KpiError, NPM_REGISTRY, OPEN_CLASSES, RELEASES_SCRIPT, ReleaseDataError, RoadmapParseError, STATUS_CLASSES, STATUS_SCRIPT, TYPESCRIPT_PROBE, UsageError, build, buildStatusBoard, checkStateOf, classCounts, compareVersions, dayRange, escapeHtml, firstSentence, gitTagDates, githubOpenWork, githubReleases, globFiles, headCommit, headingAnchor, headingDate, inlineMarkdown, isShallow, kindOf, kpiFile, kpiProblems, kpiText, laneCenter, linksOf, longDate, markdownTables, mergeReleases, npmPublishTimes, oldestFirst, openGroups, originRepository, pageShell, parseBuildArgs, parseChangelog, parseRoadmap, parseVersion, plainText, probeScript, readChangelogs, readKpi, readReleases, readStatusBoard, releaseBodyEntries, releaseSummary, releasesLead, renderReleasesPage, renderStatusPage, roadmapItems, runCli, safeUrl, sectionsOf, shortDate, slugOf, splitRow, statusClassOf, statusLead, timelineLayout, utcDay, versionOfTag, writeKpi };
package/build/vite.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { BuildInfo } from "./chrome.js";
2
+ import { i as KpiInput } from "./chunks/kpi.js";
2
3
  /** The environment variables that this module reads. */
3
4
  export type SiteEnv = Readonly<Record<string, string | undefined>>;
4
5
  /** The options of `siteShell`. */
@@ -41,6 +42,31 @@ export interface SiteShellPlugin {
41
42
  config(config: SiteShellConfigInput): SiteShellConfig;
42
43
  transformIndexHtml(): SiteShellTag[];
43
44
  }
45
+ /** The input of `siteKpi`. Without a commit, the plugin takes `GITHUB_SHA`, else the head of the repository. */
46
+ export type SiteKpiInput = Omit<KpiInput, "commit"> & {
47
+ readonly commit?: string | undefined;
48
+ };
49
+ /** The part of the context of a Rollup hook that `siteKpi` uses. */
50
+ export interface SiteKpiContext {
51
+ emitFile(file: {
52
+ type: "asset";
53
+ fileName: string;
54
+ source: string;
55
+ }): string;
56
+ }
57
+ /** The Vite plugin that `siteKpi` gives. */
58
+ export interface SiteKpiPlugin {
59
+ readonly name: string;
60
+ readonly apply: "build";
61
+ generateBundle(this: SiteKpiContext): void;
62
+ }
63
+ /**
64
+ * This function gives the Vite plugin that adds `kpi.json` to the root of a built site. A fault in the data stops the build.
65
+ *
66
+ * @param input - The data, or a function that reads it at the time of the build.
67
+ * @param env - The environment variables. A test gives its own.
68
+ */
69
+ export declare function siteKpi(input: SiteKpiInput | (() => SiteKpiInput), env?: SiteEnv): SiteKpiPlugin;
44
70
  /**
45
71
  * This function gives the script that sets the saved theme before the first paint, so a dark page
46
72
  * does not show white for a moment. The script reads `storageKey`, as `applyTheme` writes it.
@@ -1 +1 @@
1
- {"version":3,"file":"vite.d.ts","names":[],"sources":["../src/vite.ts"],"mappings":";;YAeY,UAAU,SAAS;;iBAGd;;WAEN;;;;;WAKA;;;YAIC;;iBAGK;WACN;WACA;WACA;aAAmB,SAAS;;;;iBAItB;WACN;WACA;aAAkB,QAAQ;;WAC1B,QAAQ,SAAS;;;iBAIX;WACN;WACA;WACA;;;iBAIM;WACN;EACT,OAAO,QAAQ,uBAAuB;EACtC,sBAAsB;;;;;;;;;wBAUR,YAAY;;;;;wBASZ,SAAS,MAAK;;wBAMd,UAAU,kBAAkB,MAAK,SAAuB,MAAK,OAAoB;;;;;;;;;;;;wBAoBjF,UAAU,SAAS,mBAAmB"}
1
+ {"version":3,"file":"vite.d.ts","names":[],"sources":["../src/vite.ts"],"mappings":";;;YAiBY,UAAU,SAAS;;iBAGd;;WAEN;;;;;WAKA;;;YAIC;;iBAGK;WACN;WACA;WACA;aAAmB,SAAS;;;;iBAItB;WACN;WACA;aAAkB,QAAQ;;WAC1B,QAAQ,SAAS;;;iBAIX;WACN;WACA;WACA;;;iBAIM;WACN;EACT,OAAO,QAAQ,uBAAuB;EACtC,sBAAsB;;;YAIZ,eAAe,KAAK;WAAiC;;;iBAGhD;EACf,SAAS;IAAQ;IAAe;IAAkB;;;;iBAInC;WACN;WACA;EACT,eAAA,MAAqB;;;;;;;;wBASP,QAAQ,OAAO,sBAAsB,eAAe,MAAK,UAAwB;;;;;;;;wBAmBjF,YAAY;;;;;wBASZ,SAAS,MAAK;;wBAMd,UAAU,kBAAkB,MAAK,SAAuB,MAAK,OAAoB;;;;;;;;;;;;wBAoBjF,UAAU,SAAS,mBAAmB"}
package/build/vite.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { i as kpiFile, o as kpiText, t as KPI_FILE, u as headCommit } from "./chunks/kpi.js";
1
2
  import { readFileSync } from "node:fs";
2
3
  import { resolve } from "node:path";
3
4
  // src/vite.ts
@@ -9,6 +10,30 @@ import { resolve } from "node:path";
9
10
  * package keeps no dependency. A test examines that Vite accepts the plugin.
10
11
  */
11
12
  /**
13
+ * This function gives the Vite plugin that adds `kpi.json` to the root of a built site. A fault in the data stops the build.
14
+ *
15
+ * @param input - The data, or a function that reads it at the time of the build.
16
+ * @param env - The environment variables. A test gives its own.
17
+ */
18
+ function siteKpi(input, env = process.env) {
19
+ return {
20
+ name: "site-pages-kpi",
21
+ apply: "build",
22
+ generateBundle() {
23
+ const data = typeof input === "function" ? input() : input;
24
+ const commit = data.commit ?? env["GITHUB_SHA"] ?? headCommit(process.cwd()) ?? "";
25
+ this.emitFile({
26
+ type: "asset",
27
+ fileName: KPI_FILE,
28
+ source: kpiText(kpiFile({
29
+ ...data,
30
+ commit
31
+ }))
32
+ });
33
+ }
34
+ };
35
+ }
36
+ /**
12
37
  * This function gives the script that sets the saved theme before the first paint, so a dark page
13
38
  * does not show white for a moment. The script reads `storageKey`, as `applyTheme` writes it.
14
39
  *
@@ -70,6 +95,6 @@ function siteShell(options) {
70
95
  }
71
96
  };
72
97
  }
73
- export { buildInfo, siteBase, siteShell, themeScript };
98
+ export { buildInfo, siteBase, siteKpi, siteShell, themeScript };
74
99
 
75
100
  //# sourceMappingURL=vite.js.map
package/build/vite.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"vite.js","names":[],"sources":["../src/vite.ts"],"sourcesContent":["/**\n * The build side of the shell of a site: a Vite plugin and its parts. Import this module from\n * `@mark1russell7/site-pages/vite`. It is for `vite.config.ts`, not for a browser.\n *\n * This module does not import Vite. The types of the plugin are the small part that it uses, so the\n * package keeps no dependency. A test examines that Vite accepts the plugin.\n */\n\nimport { readFileSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\nimport type { BuildInfo } from \"./chrome.ts\";\n\nexport type { BuildInfo } from \"./chrome.ts\";\n\n/** The environment variables that this module reads. */\nexport type SiteEnv = Readonly<Record<string, string | undefined>>;\n\n/** The options of `siteShell`. */\nexport interface SiteShellOptions {\n /** The `localStorage` key of the theme. Give the same key to `setupTheme` in the page. */\n readonly themeKey: string;\n /**\n * The file with the version for `__BUILD__`, relative to the folder of the site. The default is\n * `../package.json`. The value `false` gives a build with no version.\n */\n readonly packageFile?: string | false | undefined;\n}\n\n/** The value of `build.target` in a Vite config. */\nexport type SiteTarget = string | string[] | false;\n\n/** The part of the Vite config that `siteShell` reads. */\nexport interface SiteShellConfigInput {\n readonly root?: string | undefined;\n readonly base?: string | undefined;\n readonly build?: { readonly target?: SiteTarget | undefined } | null | undefined;\n}\n\n/** The part of the Vite config that `siteShell` sets. Vite merges it into the config of the site. */\nexport interface SiteShellConfig {\n readonly base: string;\n readonly build: { readonly target: SiteTarget };\n readonly define: Readonly<Record<string, string>>;\n}\n\n/** A tag for the `head` of each HTML page. */\nexport interface SiteShellTag {\n readonly tag: \"script\";\n readonly children: string;\n readonly injectTo: \"head\";\n}\n\n/** The Vite plugin that `siteShell` gives. */\nexport interface SiteShellPlugin {\n readonly name: string;\n config(config: SiteShellConfigInput): SiteShellConfig;\n transformIndexHtml(): SiteShellTag[];\n}\n\n/**\n * This function gives the script that sets the saved theme before the first paint, so a dark page\n * does not show white for a moment. The script reads `storageKey`, as `applyTheme` writes it.\n *\n * @remarks The text goes in an inline `script` element. Thus the function escapes each `<` of the\n * key, so a key cannot close the element.\n */\nexport function themeScript(storageKey: string): string {\n const key = JSON.stringify(storageKey).replaceAll(\"<\", \"\\\\u003c\");\n return `try{const t=localStorage.getItem(${key});if(t===\"light\"||t===\"dark\")document.documentElement.dataset.theme=t}catch{}`;\n}\n\n/**\n * This function gives the `base` of Vite from `SITE_BASE`, with one `/` at the end. The Pages\n * workflow sets that variable to `/<name>`. A local build has no such variable, and gets `/`.\n */\nexport function siteBase(env: SiteEnv = process.env): string {\n const base = env[\"SITE_BASE\"];\n return base ? `${base.replace(/\\/$/, \"\")}/` : \"/\";\n}\n\n/** This function gives the data of a build. Outside CI, `GITHUB_SHA` is not set, and `sha` is `local`. */\nexport function buildInfo(version?: string, env: SiteEnv = process.env, now: Date = new Date()): BuildInfo {\n return { sha: (env[\"GITHUB_SHA\"] ?? \"local\").slice(0, 7), date: now.toISOString().slice(0, 10), version };\n}\n\n/** This function reads the field `version` of a `package.json` file. */\nfunction versionIn(file: string): string | undefined {\n return (JSON.parse(readFileSync(file, \"utf8\")) as { version?: string }).version;\n}\n\n/**\n * This function makes the Vite plugin of a site. The plugin does these four operations:\n *\n * - It sets `base` from `SITE_BASE`.\n * - It sets `build.target` to `es2022`.\n * - It defines `__BUILD__`, the value that `showBuild` shows.\n * - It adds `themeScript` to the `head` of each HTML page.\n *\n * A `base` or a `build.target` in the config of the site has priority. The other values of `build`\n * and `define` in that config stay, because Vite merges them.\n */\nexport function siteShell(options: SiteShellOptions): SiteShellPlugin {\n return {\n name: \"site-pages-shell\",\n config(config) {\n const packageFile = options.packageFile ?? \"../package.json\";\n const version = packageFile === false ? undefined : versionIn(resolve(config.root ?? \".\", packageFile));\n return {\n base: config.base ?? siteBase(),\n build: { target: config.build?.target ?? \"es2022\" },\n define: { __BUILD__: JSON.stringify(buildInfo(version)) },\n };\n },\n transformIndexHtml() {\n return [{ tag: \"script\", children: themeScript(options.themeKey), injectTo: \"head\" }];\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkEA,SAAgB,YAAY,YAA4B;CAEtD,OAAO,oCADK,KAAK,UAAU,UAAU,CAAC,CAAC,WAAW,KAAK,SACV,EAAE;AACjD;;;;;AAMA,SAAgB,SAAS,MAAe,QAAQ,KAAa;CAC3D,MAAM,OAAO,IAAI;CACjB,OAAO,OAAO,GAAG,KAAK,QAAQ,OAAO,EAAE,EAAE,KAAK;AAChD;;AAGA,SAAgB,UAAU,SAAkB,MAAe,QAAQ,KAAK,sBAAY,IAAI,KAAK,GAAc;CACzG,OAAO;EAAE,MAAM,IAAI,iBAAiB,QAAA,CAAS,MAAM,GAAG,CAAC;EAAG,MAAM,IAAI,YAAY,CAAC,CAAC,MAAM,GAAG,EAAE;EAAG;CAAQ;AAC1G;;AAGA,SAAS,UAAU,MAAkC;CACnD,OAAQ,KAAK,MAAM,aAAa,MAAM,MAAM,CAAC,CAAC,CAA0B;AAC1E;;;;;;;;;;;;AAaA,SAAgB,UAAU,SAA4C;CACpE,OAAO;EACL,MAAM;EACN,OAAO,QAAQ;GACb,MAAM,cAAc,QAAQ,eAAe;GAC3C,MAAM,UAAU,gBAAgB,QAAQ,KAAA,IAAY,UAAU,QAAQ,OAAO,QAAQ,KAAK,WAAW,CAAC;GACtG,OAAO;IACL,MAAM,OAAO,QAAQ,SAAS;IAC9B,OAAO,EAAE,QAAQ,OAAO,OAAO,UAAU,SAAS;IAClD,QAAQ,EAAE,WAAW,KAAK,UAAU,UAAU,OAAO,CAAC,EAAE;GAC1D;EACF;EACA,qBAAqB;GACnB,OAAO,CAAC;IAAE,KAAK;IAAU,UAAU,YAAY,QAAQ,QAAQ;IAAG,UAAU;GAAO,CAAC;EACtF;CACF;AACF"}
1
+ {"version":3,"file":"vite.js","names":[],"sources":["../src/vite.ts"],"sourcesContent":["/**\n * The build side of the shell of a site: a Vite plugin and its parts. Import this module from\n * `@mark1russell7/site-pages/vite`. It is for `vite.config.ts`, not for a browser.\n *\n * This module does not import Vite. The types of the plugin are the small part that it uses, so the\n * package keeps no dependency. A test examines that Vite accepts the plugin.\n */\n\nimport { readFileSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\nimport type { BuildInfo } from \"./chrome.ts\";\nimport { headCommit } from \"./data/git.ts\";\nimport { KPI_FILE, kpiFile, kpiText, type KpiInput } from \"./data/kpi.ts\";\n\nexport type { BuildInfo } from \"./chrome.ts\";\n\n/** The environment variables that this module reads. */\nexport type SiteEnv = Readonly<Record<string, string | undefined>>;\n\n/** The options of `siteShell`. */\nexport interface SiteShellOptions {\n /** The `localStorage` key of the theme. Give the same key to `setupTheme` in the page. */\n readonly themeKey: string;\n /**\n * The file with the version for `__BUILD__`, relative to the folder of the site. The default is\n * `../package.json`. The value `false` gives a build with no version.\n */\n readonly packageFile?: string | false | undefined;\n}\n\n/** The value of `build.target` in a Vite config. */\nexport type SiteTarget = string | string[] | false;\n\n/** The part of the Vite config that `siteShell` reads. */\nexport interface SiteShellConfigInput {\n readonly root?: string | undefined;\n readonly base?: string | undefined;\n readonly build?: { readonly target?: SiteTarget | undefined } | null | undefined;\n}\n\n/** The part of the Vite config that `siteShell` sets. Vite merges it into the config of the site. */\nexport interface SiteShellConfig {\n readonly base: string;\n readonly build: { readonly target: SiteTarget };\n readonly define: Readonly<Record<string, string>>;\n}\n\n/** A tag for the `head` of each HTML page. */\nexport interface SiteShellTag {\n readonly tag: \"script\";\n readonly children: string;\n readonly injectTo: \"head\";\n}\n\n/** The Vite plugin that `siteShell` gives. */\nexport interface SiteShellPlugin {\n readonly name: string;\n config(config: SiteShellConfigInput): SiteShellConfig;\n transformIndexHtml(): SiteShellTag[];\n}\n\n/** The input of `siteKpi`. Without a commit, the plugin takes `GITHUB_SHA`, else the head of the repository. */\nexport type SiteKpiInput = Omit<KpiInput, \"commit\"> & { readonly commit?: string | undefined };\n\n/** The part of the context of a Rollup hook that `siteKpi` uses. */\nexport interface SiteKpiContext {\n emitFile(file: { type: \"asset\"; fileName: string; source: string }): string;\n}\n\n/** The Vite plugin that `siteKpi` gives. */\nexport interface SiteKpiPlugin {\n readonly name: string;\n readonly apply: \"build\";\n generateBundle(this: SiteKpiContext): void;\n}\n\n/**\n * This function gives the Vite plugin that adds `kpi.json` to the root of a built site. A fault in the data stops the build.\n *\n * @param input - The data, or a function that reads it at the time of the build.\n * @param env - The environment variables. A test gives its own.\n */\nexport function siteKpi(input: SiteKpiInput | (() => SiteKpiInput), env: SiteEnv = process.env): SiteKpiPlugin {\n return {\n name: \"site-pages-kpi\",\n apply: \"build\",\n generateBundle() {\n const data = typeof input === \"function\" ? input() : input;\n const commit = data.commit ?? env[\"GITHUB_SHA\"] ?? headCommit(process.cwd()) ?? \"\";\n this.emitFile({ type: \"asset\", fileName: KPI_FILE, source: kpiText(kpiFile({ ...data, commit })) });\n },\n };\n}\n\n/**\n * This function gives the script that sets the saved theme before the first paint, so a dark page\n * does not show white for a moment. The script reads `storageKey`, as `applyTheme` writes it.\n *\n * @remarks The text goes in an inline `script` element. Thus the function escapes each `<` of the\n * key, so a key cannot close the element.\n */\nexport function themeScript(storageKey: string): string {\n const key = JSON.stringify(storageKey).replaceAll(\"<\", \"\\\\u003c\");\n return `try{const t=localStorage.getItem(${key});if(t===\"light\"||t===\"dark\")document.documentElement.dataset.theme=t}catch{}`;\n}\n\n/**\n * This function gives the `base` of Vite from `SITE_BASE`, with one `/` at the end. The Pages\n * workflow sets that variable to `/<name>`. A local build has no such variable, and gets `/`.\n */\nexport function siteBase(env: SiteEnv = process.env): string {\n const base = env[\"SITE_BASE\"];\n return base ? `${base.replace(/\\/$/, \"\")}/` : \"/\";\n}\n\n/** This function gives the data of a build. Outside CI, `GITHUB_SHA` is not set, and `sha` is `local`. */\nexport function buildInfo(version?: string, env: SiteEnv = process.env, now: Date = new Date()): BuildInfo {\n return { sha: (env[\"GITHUB_SHA\"] ?? \"local\").slice(0, 7), date: now.toISOString().slice(0, 10), version };\n}\n\n/** This function reads the field `version` of a `package.json` file. */\nfunction versionIn(file: string): string | undefined {\n return (JSON.parse(readFileSync(file, \"utf8\")) as { version?: string }).version;\n}\n\n/**\n * This function makes the Vite plugin of a site. The plugin does these four operations:\n *\n * - It sets `base` from `SITE_BASE`.\n * - It sets `build.target` to `es2022`.\n * - It defines `__BUILD__`, the value that `showBuild` shows.\n * - It adds `themeScript` to the `head` of each HTML page.\n *\n * A `base` or a `build.target` in the config of the site has priority. The other values of `build`\n * and `define` in that config stay, because Vite merges them.\n */\nexport function siteShell(options: SiteShellOptions): SiteShellPlugin {\n return {\n name: \"site-pages-shell\",\n config(config) {\n const packageFile = options.packageFile ?? \"../package.json\";\n const version = packageFile === false ? undefined : versionIn(resolve(config.root ?? \".\", packageFile));\n return {\n base: config.base ?? siteBase(),\n build: { target: config.build?.target ?? \"es2022\" },\n define: { __BUILD__: JSON.stringify(buildInfo(version)) },\n };\n },\n transformIndexHtml() {\n return [{ tag: \"script\", children: themeScript(options.themeKey), injectTo: \"head\" }];\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkFA,SAAgB,QAAQ,OAA4C,MAAe,QAAQ,KAAoB;CAC7G,OAAO;EACL,MAAM;EACN,OAAO;EACP,iBAAiB;GACf,MAAM,OAAO,OAAO,UAAU,aAAa,MAAM,IAAI;GACrD,MAAM,SAAS,KAAK,UAAU,IAAI,iBAAiB,WAAW,QAAQ,IAAI,CAAC,KAAK;GAChF,KAAK,SAAS;IAAE,MAAM;IAAS,UAAU;IAAU,QAAQ,QAAQ,QAAQ;KAAE,GAAG;KAAM;IAAO,CAAC,CAAC;GAAE,CAAC;EACpG;CACF;AACF;;;;;;;;AASA,SAAgB,YAAY,YAA4B;CAEtD,OAAO,oCADK,KAAK,UAAU,UAAU,CAAC,CAAC,WAAW,KAAK,SACV,EAAE;AACjD;;;;;AAMA,SAAgB,SAAS,MAAe,QAAQ,KAAa;CAC3D,MAAM,OAAO,IAAI;CACjB,OAAO,OAAO,GAAG,KAAK,QAAQ,OAAO,EAAE,EAAE,KAAK;AAChD;;AAGA,SAAgB,UAAU,SAAkB,MAAe,QAAQ,KAAK,sBAAY,IAAI,KAAK,GAAc;CACzG,OAAO;EAAE,MAAM,IAAI,iBAAiB,QAAA,CAAS,MAAM,GAAG,CAAC;EAAG,MAAM,IAAI,YAAY,CAAC,CAAC,MAAM,GAAG,EAAE;EAAG;CAAQ;AAC1G;;AAGA,SAAS,UAAU,MAAkC;CACnD,OAAQ,KAAK,MAAM,aAAa,MAAM,MAAM,CAAC,CAAC,CAA0B;AAC1E;;;;;;;;;;;;AAaA,SAAgB,UAAU,SAA4C;CACpE,OAAO;EACL,MAAM;EACN,OAAO,QAAQ;GACb,MAAM,cAAc,QAAQ,eAAe;GAC3C,MAAM,UAAU,gBAAgB,QAAQ,KAAA,IAAY,UAAU,QAAQ,OAAO,QAAQ,KAAK,WAAW,CAAC;GACtG,OAAO;IACL,MAAM,OAAO,QAAQ,SAAS;IAC9B,OAAO,EAAE,QAAQ,OAAO,OAAO,UAAU,SAAS;IAClD,QAAQ,EAAE,WAAW,KAAK,UAAU,UAAU,OAAO,CAAC,EAAE;GAC1D;EACF;EACA,qBAAqB;GACnB,OAAO,CAAC;IAAE,KAAK;IAAU,UAAU,YAAY,QAAQ,QAAQ;IAAG,UAAU;GAAO,CAAC;EACtF;CACF;AACF"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@mark1russell7/site-pages",
4
- "version": "0.2.2",
4
+ "version": "0.2.4",
5
5
  "description": "A release timeline page and a live status page for the site of a GitHub repository: JSON data and standalone HTML, made at deploy time.",
6
6
  "keywords": [
7
7
  "github-pages",
@@ -5,17 +5,25 @@
5
5
  * import "@mark1russell7/site-pages/explorer.css";
6
6
  *
7
7
  * The explorer reads the tokens of a site when they exist: --card or --surface, --fg or --ink, --muted,
8
- * --line or --rule, --sunk or --sunken, --accent or --focus and --mono. Without them, it uses its own colors.
8
+ * --line or --rule, --sunk, --sunken or --well, --accent or --focus and --mono. Without them, it uses its own
9
+ * colors, the --rx-base tokens. These tokens have a dark value, so a site can have some of its tokens and not others.
9
10
  * The two dark rules below keep the same values, as the rules of shell.css do.
10
11
  */
11
12
  .response-explorer {
12
- --rx-surface: var(--card, var(--surface, #ffffff));
13
- --rx-sunken: var(--sunk, var(--sunken, #f1eee8));
14
- --rx-ink: var(--fg, var(--ink, #1b1a17));
15
- --rx-muted: var(--muted, #5d5952);
16
- --rx-rule: var(--line, var(--rule, #e0dbd1));
17
- --rx-accent: var(--accent, var(--focus, #2f5bd3));
18
- --rx-error: var(--err, #b42318);
13
+ --rx-base-surface: #ffffff;
14
+ --rx-base-sunken: #f1eee8;
15
+ --rx-base-ink: #1b1a17;
16
+ --rx-base-muted: #5d5952;
17
+ --rx-base-rule: #e0dbd1;
18
+ --rx-base-accent: #2f5bd3;
19
+ --rx-base-error: #b42318;
20
+ --rx-surface: var(--card, var(--surface, var(--rx-base-surface)));
21
+ --rx-sunken: var(--sunk, var(--sunken, var(--well, var(--rx-base-sunken))));
22
+ --rx-ink: var(--fg, var(--ink, var(--rx-base-ink)));
23
+ --rx-muted: var(--muted, var(--rx-base-muted));
24
+ --rx-rule: var(--line, var(--rule, var(--rx-base-rule)));
25
+ --rx-accent: var(--accent, var(--focus, var(--rx-base-accent)));
26
+ --rx-error: var(--err, var(--rx-base-error));
19
27
  --rx-mono: var(--mono, ui-monospace, Menlo, Consolas, monospace);
20
28
  --rx-veil: #8f8d86;
21
29
  --rx-seq-0: #cde2fb;
@@ -39,6 +47,13 @@
39
47
 
40
48
  @media (prefers-color-scheme: dark) {
41
49
  :root:not([data-theme="light"]) .response-explorer {
50
+ --rx-base-surface: #171a23;
51
+ --rx-base-sunken: #1f2330;
52
+ --rx-base-ink: #e8e9ef;
53
+ --rx-base-muted: #a0a4b6;
54
+ --rx-base-rule: #2e3345;
55
+ --rx-base-accent: #93abff;
56
+ --rx-base-error: #fda29b;
42
57
  --rx-veil: #55534e;
43
58
  --rx-seq-0: #0d366b;
44
59
  --rx-seq-1: #104281;
@@ -55,6 +70,13 @@
55
70
  }
56
71
 
57
72
  :root[data-theme="dark"] .response-explorer {
73
+ --rx-base-surface: #171a23;
74
+ --rx-base-sunken: #1f2330;
75
+ --rx-base-ink: #e8e9ef;
76
+ --rx-base-muted: #a0a4b6;
77
+ --rx-base-rule: #2e3345;
78
+ --rx-base-accent: #93abff;
79
+ --rx-base-error: #fda29b;
58
80
  --rx-veil: #55534e;
59
81
  --rx-seq-0: #0d366b;
60
82
  --rx-seq-1: #104281;