@herb-tools/config 0.8.9 → 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.
package/README.md CHANGED
@@ -33,7 +33,7 @@ bun add @herb-tools/config
33
33
  The configuration is stored in a `.herb.yml` file in the project root:
34
34
 
35
35
  ```yaml [.herb.yml]
36
- version: 0.8.9
36
+ version: 0.8.10
37
37
 
38
38
  linter:
39
39
  enabled: true
@@ -1179,7 +1179,7 @@ class Doc {
1179
1179
  const version$1 = {
1180
1180
  major: 4,
1181
1181
  minor: 3,
1182
- patch: 5,
1182
+ patch: 6,
1183
1183
  };
1184
1184
 
1185
1185
  const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
@@ -2200,11 +2200,9 @@ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
2200
2200
  if (keyResult instanceof Promise) {
2201
2201
  throw new Error("Async schemas not supported in object keys currently");
2202
2202
  }
2203
- // Numeric string fallback: if key failed with "expected number", retry with Number(key)
2204
- const checkNumericKey = typeof key === "string" &&
2205
- number$1.test(key) &&
2206
- keyResult.issues.length &&
2207
- keyResult.issues.some((iss) => iss.code === "invalid_type" && iss.expected === "number");
2203
+ // Numeric string fallback: if key is a numeric string and failed, retry with Number(key)
2204
+ // This handles z.number(), z.literal([1, 2, 3]), and unions containing numeric literals
2205
+ const checkNumericKey = typeof key === "string" && number$1.test(key) && keyResult.issues.length;
2208
2206
  if (checkNumericKey) {
2209
2207
  const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
2210
2208
  if (retryResult instanceof Promise) {
@@ -3372,7 +3370,7 @@ function finalize(ctx, schema) {
3372
3370
  }
3373
3371
  }
3374
3372
  // When ref was extracted to $defs, remove properties that match the definition
3375
- if (refSchema.$ref) {
3373
+ if (refSchema.$ref && refSeen.def) {
3376
3374
  for (const key in schema) {
3377
3375
  if (key === "$ref" || key === "allOf")
3378
3376
  continue;
@@ -4846,11 +4844,11 @@ function deepMerge(target, source) {
4846
4844
  return output;
4847
4845
  }
4848
4846
 
4849
- var version = "0.8.9";
4847
+ var version = "0.8.10";
4850
4848
  var packageJson = {
4851
4849
  version: version};
4852
4850
 
4853
- 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.9\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";
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.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";
4854
4852
 
4855
4853
  const DEFAULT_VERSION = packageJson.version;
4856
4854
  class Config {