@herb-tools/config 0.8.8 → 0.8.10

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.
@@ -1177,7 +1177,7 @@ class Doc {
1177
1177
  const version$1 = {
1178
1178
  major: 4,
1179
1179
  minor: 3,
1180
- patch: 5,
1180
+ patch: 6,
1181
1181
  };
1182
1182
 
1183
1183
  const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
@@ -2198,11 +2198,9 @@ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
2198
2198
  if (keyResult instanceof Promise) {
2199
2199
  throw new Error("Async schemas not supported in object keys currently");
2200
2200
  }
2201
- // Numeric string fallback: if key failed with "expected number", retry with Number(key)
2202
- const checkNumericKey = typeof key === "string" &&
2203
- number$1.test(key) &&
2204
- keyResult.issues.length &&
2205
- keyResult.issues.some((iss) => iss.code === "invalid_type" && iss.expected === "number");
2201
+ // Numeric string fallback: if key is a numeric string and failed, retry with Number(key)
2202
+ // This handles z.number(), z.literal([1, 2, 3]), and unions containing numeric literals
2203
+ const checkNumericKey = typeof key === "string" && number$1.test(key) && keyResult.issues.length;
2206
2204
  if (checkNumericKey) {
2207
2205
  const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
2208
2206
  if (retryResult instanceof Promise) {
@@ -3370,7 +3368,7 @@ function finalize(ctx, schema) {
3370
3368
  }
3371
3369
  }
3372
3370
  // When ref was extracted to $defs, remove properties that match the definition
3373
- if (refSchema.$ref) {
3371
+ if (refSchema.$ref && refSeen.def) {
3374
3372
  for (const key in schema) {
3375
3373
  if (key === "$ref" || key === "allOf")
3376
3374
  continue;
@@ -4844,11 +4842,11 @@ function deepMerge(target, source) {
4844
4842
  return output;
4845
4843
  }
4846
4844
 
4847
- var version = "0.8.8";
4845
+ var version = "0.8.10";
4848
4846
  var packageJson = {
4849
4847
  version: version};
4850
4848
 
4851
- var configTemplate = "# This file configures Herb for your project and team.\n# Settings here take precedence over individual editor preferences.\n#\n# Herb is a suite of tools for HTML+ERB templates including:\n# - Linter: Validates templates and enforces best practices\n# - Formatter: Auto-formats templates with intelligent indentation\n# - Language Server: Provides IDE support (VS Code, Zed, Neovim, etc.)\n#\n# Website: https://herb-tools.dev\n# Configuration: https://herb-tools.dev/configuration\n# GitHub Repo: https://github.com/marcoroth/herb\n#\n\nversion: 0.8.8\n\n# files:\n# # Additional patterns beyond the defaults (**.html, **.rhtml, **.html.erb, etc.)\n# include:\n# - '**/*.xml.erb'\n# - 'custom/**/*.html'\n#\n# # Patterns to exclude (can exclude defaults too)\n# exclude:\n# - 'public/**/*'\n# - 'tmp/**/*'\n\nlinter:\n enabled: true\n\n # # Exit with error code when diagnostics of this severity or higher are present\n # # Valid values: error (default), warning, info, hint\n # failLevel: warning\n\n # # Additional patterns beyond the defaults for linting\n # include:\n # - '**/*.xml.erb'\n #\n # # Patterns to exclude from linting\n # exclude:\n # - 'app/views/admin/**/*'\n\n # rules:\n # erb-no-extra-newline:\n # enabled: false\n #\n # # Rules can have 'include', 'only', and 'exclude' patterns\n # some-rule:\n # # Additional patterns to check (additive, ignored when 'only' is present)\n # include:\n # - 'app/components/**/*'\n # # Don't apply this rule to files matching these patterns\n # exclude:\n # - 'app/views/admin/**/*'\n #\n # another-rule:\n # # Only apply this rule to files matching these patterns (overrides all 'include')\n # only:\n # - 'app/views/**/*'\n # # Exclude still applies even with 'only'\n # exclude:\n # - 'app/views/admin/**/*'\n\nformatter:\n enabled: false\n indentWidth: 2\n maxLineLength: 80\n\n # # Additional patterns beyond the defaults for formatting\n # include:\n # - '**/*.xml.erb'\n #\n # # Patterns to exclude from formatting\n # exclude:\n # - 'app/views/admin/**/*'\n\n # # Rewriters modify templates during formatting\n # rewriter:\n # # Pre-format rewriters (modify AST before formatting)\n # pre:\n # - tailwind-class-sorter\n # # Post-format rewriters (modify formatted output string)\n # post: []\n";
4849
+ var configTemplate = "# This file configures Herb for your project and team.\n# Settings here take precedence over individual editor preferences.\n#\n# Herb is a suite of tools for HTML+ERB templates including:\n# - Linter: Validates templates and enforces best practices\n# - Formatter: Auto-formats templates with intelligent indentation\n# - Language Server: Provides IDE support (VS Code, Zed, Neovim, etc.)\n#\n# Website: https://herb-tools.dev\n# Configuration: https://herb-tools.dev/configuration\n# GitHub Repo: https://github.com/marcoroth/herb\n#\n\nversion: 0.8.10\n\n# files:\n# # Additional patterns beyond the defaults (**.html, **.rhtml, **.html.erb, etc.)\n# include:\n# - '**/*.xml.erb'\n# - 'custom/**/*.html'\n#\n# # Patterns to exclude (can exclude defaults too)\n# exclude:\n# - 'public/**/*'\n# - 'tmp/**/*'\n\nlinter:\n enabled: true\n\n # # Exit with error code when diagnostics of this severity or higher are present\n # # Valid values: error (default), warning, info, hint\n # failLevel: warning\n\n # # Additional patterns beyond the defaults for linting\n # include:\n # - '**/*.xml.erb'\n #\n # # Patterns to exclude from linting\n # exclude:\n # - 'app/views/admin/**/*'\n\n # rules:\n # erb-no-extra-newline:\n # enabled: false\n #\n # # Rules can have 'include', 'only', and 'exclude' patterns\n # some-rule:\n # # Additional patterns to check (additive, ignored when 'only' is present)\n # include:\n # - 'app/components/**/*'\n # # Don't apply this rule to files matching these patterns\n # exclude:\n # - 'app/views/admin/**/*'\n #\n # another-rule:\n # # Only apply this rule to files matching these patterns (overrides all 'include')\n # only:\n # - 'app/views/**/*'\n # # Exclude still applies even with 'only'\n # exclude:\n # - 'app/views/admin/**/*'\n\nformatter:\n enabled: false\n indentWidth: 2\n maxLineLength: 80\n\n # # Additional patterns beyond the defaults for formatting\n # include:\n # - '**/*.xml.erb'\n #\n # # Patterns to exclude from formatting\n # exclude:\n # - 'app/views/admin/**/*'\n\n # # Rewriters modify templates during formatting\n # rewriter:\n # # Pre-format rewriters (modify AST before formatting)\n # pre:\n # - tailwind-class-sorter\n # # Post-format rewriters (modify formatted output string)\n # post: []\n";
4852
4850
 
4853
4851
  const DEFAULT_VERSION = packageJson.version;
4854
4852
  class Config {