@loworbitstudio/visor 1.45.0 → 1.45.1

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "0.4.0",
3
- "generated_at": "2026-11-12T23:01:11.719Z",
3
+ "generated_at": "2026-11-13T16:58:30.093Z",
4
4
  "components": {
5
5
  "accessibility-specimen": {
6
6
  "changeType": "current",
package/dist/index.js CHANGED
@@ -4511,6 +4511,7 @@ function buildAnnotatedYAML(result) {
4511
4511
  // src/commands/theme-register.ts
4512
4512
  import { readFileSync as readFileSync19, writeFileSync as writeFileSync10, mkdirSync as mkdirSync7, existsSync as existsSync16 } from "fs";
4513
4513
  import { resolve as resolve14, join as join19 } from "path";
4514
+ import { parse as parseYaml3 } from "yaml";
4514
4515
  import { generateThemeData as generateThemeData4 } from "@loworbitstudio/visor-theme-engine";
4515
4516
  import { docsAdapter as docsAdapter2 } from "@loworbitstudio/visor-theme-engine/adapters";
4516
4517
 
@@ -4812,6 +4813,25 @@ function themeRegisterCommand(file, cwd, options) {
4812
4813
  process.exit(1);
4813
4814
  return;
4814
4815
  }
4816
+ const escapedGroup = options.group.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4817
+ const customDir = join19(repoRoot, "custom-themes");
4818
+ if (filePath.startsWith(customDir + "/") || !new RegExp(`label:\\s*"${escapedGroup}"`).test(themeConfigContent)) {
4819
+ const yamlGroup = parseYaml3(yamlContent)?.group;
4820
+ const problem = yamlGroup !== options.group ? `${filePath} has group "${typeof yamlGroup === "string" ? yamlGroup : "(none)"}"; set \`group: "${options.group}"\` in it.` : !filePath.startsWith(customDir + "/") ? `${filePath} is not in ${customDir}, where \`visor theme sync\` reads it. Put it there, or in visor-themes-private.` : null;
4821
+ if (problem) {
4822
+ if (options.json) console.log(JSON.stringify({ success: false, error: problem }));
4823
+ else logger.error(problem);
4824
+ process.exit(1);
4825
+ return;
4826
+ }
4827
+ if (options.json) {
4828
+ console.log(JSON.stringify({ success: true, slug: slug2, label, group: options.group, via: "theme sync", next: "visor theme sync" }));
4829
+ } else {
4830
+ logger.success(`Theme registered: ${label} (${slug2}) in ${options.group}`);
4831
+ logger.info("`visor theme sync` (the docs predev runs it) adds it to the switcher.");
4832
+ }
4833
+ return;
4834
+ }
4815
4835
  const cssExists = existsSync16(cssFilePath);
4816
4836
  const cssChanged = !cssExists || readFileSync19(cssFilePath, "utf-8") !== css;
4817
4837
  const { updated: newGlobals, changed: globalsChanged } = insertGlobalsImport(globalsContent, slug2);
@@ -5009,7 +5029,7 @@ import {
5009
5029
  copyFileSync
5010
5030
  } from "fs";
5011
5031
  import { join as join21, basename as basename4, resolve as resolve15, sep, relative as relative2 } from "path";
5012
- import { parse as parseYaml3 } from "yaml";
5032
+ import { parse as parseYaml4 } from "yaml";
5013
5033
  import { generateThemeData as generateThemeData5, validateFontCoverage, formatFontCoverageError } from "@loworbitstudio/visor-theme-engine";
5014
5034
  import { docsAdapter as docsAdapter3 } from "@loworbitstudio/visor-theme-engine/adapters";
5015
5035
  var PRIVATE_THEMES_REPO_URL = "git@github.com:low-orbit-studio/visor-themes-private.git";
@@ -5172,17 +5192,17 @@ function enforceWorkspaceGuard(cwd) {
5172
5192
  ].join("\n");
5173
5193
  }
5174
5194
  function extractGroup(yamlContent) {
5175
- const parsed = parseYaml3(yamlContent);
5195
+ const parsed = parseYaml4(yamlContent);
5176
5196
  if (typeof parsed?.group === "string") return parsed.group;
5177
5197
  return void 0;
5178
5198
  }
5179
5199
  function extractLabel(yamlContent) {
5180
- const parsed = parseYaml3(yamlContent);
5200
+ const parsed = parseYaml4(yamlContent);
5181
5201
  if (typeof parsed?.label === "string") return parsed.label;
5182
5202
  return void 0;
5183
5203
  }
5184
5204
  function extractDefaultMode(yamlContent) {
5185
- const parsed = parseYaml3(yamlContent);
5205
+ const parsed = parseYaml4(yamlContent);
5186
5206
  const v = parsed?.["default-mode"];
5187
5207
  if (v === "dark" || v === "light") return v;
5188
5208
  return void 0;
@@ -6708,7 +6728,7 @@ Visor Tokens (${categoryLabel}) \u2014 ${tokens2.length} tokens
6708
6728
  // src/commands/migrate-token-substitution.ts
6709
6729
  import { readFileSync as readFileSync26, writeFileSync as writeFileSync14, readdirSync as readdirSync11, statSync as statSync9, existsSync as existsSync23 } from "fs";
6710
6730
  import { resolve as resolve17, join as join25, relative as relative4 } from "path";
6711
- import { parse as parseYaml4 } from "yaml";
6731
+ import { parse as parseYaml5 } from "yaml";
6712
6732
  import pc4 from "picocolors";
6713
6733
  var V7_ENTR_SUBSTITUTION_MAP = {
6714
6734
  "--panel": "--surface-card",
@@ -6738,7 +6758,7 @@ function readMapFromThemeFile(themeId, cwd) {
6738
6758
  if (existsSync23(candidate)) {
6739
6759
  try {
6740
6760
  const raw = readFileSync26(candidate, "utf-8");
6741
- const parsed = parseYaml4(raw);
6761
+ const parsed = parseYaml5(raw);
6742
6762
  if (parsed?.migrate?.["token-substitution"]) {
6743
6763
  return parsed.migrate["token-substitution"];
6744
6764
  }
@@ -8426,7 +8446,7 @@ import {
8426
8446
  } from "fs";
8427
8447
  import { basename as basename8, dirname as dirname14, isAbsolute as isAbsolute6, join as join32, resolve as resolve20 } from "path";
8428
8448
  import * as childProcess6 from "child_process";
8429
- import { parse as parseYaml5 } from "yaml";
8449
+ import { parse as parseYaml6 } from "yaml";
8430
8450
  import { generateThemeData as generateThemeData7 } from "@loworbitstudio/visor-theme-engine";
8431
8451
  import { nextjsAdapter as nextjsAdapter3 } from "@loworbitstudio/visor-theme-engine/adapters";
8432
8452
  import { validate as validate3 } from "@loworbitstudio/visor-theme-engine";
@@ -8645,7 +8665,7 @@ ${list}`
8645
8665
  try {
8646
8666
  applyThemeToFork(themeFile, outputDir, build.manifest);
8647
8667
  if (options.validate) {
8648
- const parsed = parseYaml5(readFileSync32(themeFile, "utf-8"));
8668
+ const parsed = parseYaml6(readFileSync32(themeFile, "utf-8"));
8649
8669
  const result = validate3(parsed);
8650
8670
  if (!result.valid) {
8651
8671
  const messages = result.errors.map((e) => e.message).join("; ");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "0.4.0",
3
- "generated_at": "2026-11-12T23:01:11.711Z",
3
+ "generated_at": "2026-11-13T16:58:30.087Z",
4
4
  "components": {
5
5
  "accessibility-specimen": {
6
6
  "category": "specimen",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loworbitstudio/visor",
3
- "version": "1.45.0",
3
+ "version": "1.45.1",
4
4
  "description": "CLI for the Visor design system — add components, hooks, and utilities to your project.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -46,7 +46,7 @@
46
46
  "dependencies": {
47
47
  "@aws-sdk/client-s3": "^3.1021.0",
48
48
  "@babel/parser": "^7.26.0",
49
- "@loworbitstudio/visor-theme-engine": "^0.34.0",
49
+ "@loworbitstudio/visor-theme-engine": "^0.34.1",
50
50
  "commander": "^13.1.0",
51
51
  "diff": "^8.0.4",
52
52
  "picocolors": "^1.1.1",