Repository: gohugoio/hugo
Pull request #12894 (2024-09-30 08:52:00)

build(deps): bump github.com/evanw/esbuild from 0.23.1 to 0.24.0
Bumps [github.com/evanw/esbuild](https://github.com/evanw/esbuild) from 0.23.1 to 0.24.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/evanw/esbuild/releases">github.com/evanw/esbuild's releases</a>.</em></p>
<blockquote>
<h2>v0.24.0</h2>
<p><strong><em>This release deliberately contains backwards-incompatible changes.</em></strong> To avoid automatically picking up releases like this, you should either be pinning the exact version of <code>esbuild</code> in your <code>package.json</code> file (recommended) or be using a version range syntax that only accepts patch upgrades such as <code>^0.23.0</code> or <code>~0.23.0</code>. See npm's documentation about <a href="https://docs.npmjs.com/cli/v6/using-npm/semver/">semver</a> for more information.</p>
<ul>
<li>
<p>Drop support for older platforms (<a href="https://redirect.github.com/evanw/esbuild/pull/3902">#3902</a>)</p>
<p>This release drops support for the following operating system:</p>
<ul>
<li>macOS 10.15 Catalina</li>
</ul>
<p>This is because the Go programming language dropped support for this operating system version in Go 1.23, and this release updates esbuild from Go 1.22 to Go 1.23. Go 1.23 now requires macOS 11 Big Sur or later.</p>
<p>Note that this only affects the binary esbuild executables that are published to the esbuild npm package. It's still possible to compile esbuild's source code for these older operating systems. If you need to, you can compile esbuild for yourself using an older version of the Go compiler (before Go version 1.23). That might look something like this:</p>
<pre><code>git clone https://github.com/evanw/esbuild.git
cd esbuild
go build ./cmd/esbuild
./esbuild --version
</code></pre>
</li>
<li>
<p>Fix class field decorators in TypeScript if <code>useDefineForClassFields</code> is <code>false</code> (<a href="https://redirect.github.com/evanw/esbuild/issues/3913">#3913</a>)</p>
<p>Setting the <code>useDefineForClassFields</code> flag to <code>false</code> in <code>tsconfig.json</code> means class fields use the legacy TypeScript behavior instead of the standard JavaScript behavior. Specifically they use assign semantics instead of define semantics (e.g. setters are triggered) and fields without an initializer are not initialized at all. However, when this legacy behavior is combined with standard JavaScript decorators, TypeScript switches to always initializing all fields, even those without initializers. Previously esbuild incorrectly continued to omit field initializers for this edge case. These field initializers in this case should now be emitted starting with this release.</p>
</li>
<li>
<p>Avoid incorrect cycle warning with <code>tsconfig.json</code> multiple inheritance (<a href="https://redirect.github.com/evanw/esbuild/issues/3898">#3898</a>)</p>
<p>TypeScript 5.0 introduced multiple inheritance for <code>tsconfig.json</code> files where <code>extends</code> can be an array of file paths. Previously esbuild would incorrectly treat files encountered more than once when processing separate subtrees of the multiple inheritance hierarchy as an inheritance cycle. With this release, <code>tsconfig.json</code> files containing this edge case should work correctly without generating a warning.</p>
</li>
<li>
<p>Handle Yarn Plug'n'Play stack overflow with <code>tsconfig.json</code> (<a href="https://redirect.github.com/evanw/esbuild/issues/3915">#3915</a>)</p>
<p>Previously a <code>tsconfig.json</code> file that <code>extends</code> another file in a package with an <code>exports</code> map could cause a stack overflow when Yarn's Plug'n'Play resolution was active. This edge case should work now starting with this release.</p>
</li>
<li>
<p>Work around more issues with Deno 1.31+ (<a href="https://redirect.github.com/evanw/esbuild/pull/3917">#3917</a>)</p>
<p>This version of Deno broke the <code>stdin</code> and <code>stdout</code> properties on command objects for inherited streams, which matters when you run esbuild's Deno module as the entry point (i.e. when <code>import.meta.main</code> is <code>true</code>). Previously esbuild would crash in Deno 1.31+ if you ran esbuild like that. This should be fixed starting with this release.</p>
<p>This fix was contributed by <a href="https://github.com/Joshix-1"><code>@​Joshix-1</code></a>.</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/evanw/esbuild/blob/main/CHANGELOG.md">github.com/evanw/esbuild's changelog</a>.</em></p>
<blockquote>
<h2>0.24.0</h2>
<p><strong><em>This release deliberately contains backwards-incompatible changes.</em></strong> To avoid automatically picking up releases like this, you should either be pinning the exact version of <code>esbuild</code> in your <code>package.json</code> file (recommended) or be using a version range syntax that only accepts patch upgrades such as <code>^0.23.0</code> or <code>~0.23.0</code>. See npm's documentation about <a href="https://docs.npmjs.com/cli/v6/using-npm/semver/">semver</a> for more information.</p>
<ul>
<li>
<p>Drop support for older platforms (<a href="https://redirect.github.com/evanw/esbuild/pull/3902">#3902</a>)</p>
<p>This release drops support for the following operating system:</p>
<ul>
<li>macOS 10.15 Catalina</li>
</ul>
<p>This is because the Go programming language dropped support for this operating system version in Go 1.23, and this release updates esbuild from Go 1.22 to Go 1.23. Go 1.23 now requires macOS 11 Big Sur or later.</p>
<p>Note that this only affects the binary esbuild executables that are published to the esbuild npm package. It's still possible to compile esbuild's source code for these older operating systems. If you need to, you can compile esbuild for yourself using an older version of the Go compiler (before Go version 1.23). That might look something like this:</p>
<pre><code>git clone https://github.com/evanw/esbuild.git
cd esbuild
go build ./cmd/esbuild
./esbuild --version
</code></pre>
</li>
<li>
<p>Fix class field decorators in TypeScript if <code>useDefineForClassFields</code> is <code>false</code> (<a href="https://redirect.github.com/evanw/esbuild/issues/3913">#3913</a>)</p>
<p>Setting the <code>useDefineForClassFields</code> flag to <code>false</code> in <code>tsconfig.json</code> means class fields use the legacy TypeScript behavior instead of the standard JavaScript behavior. Specifically they use assign semantics instead of define semantics (e.g. setters are triggered) and fields without an initializer are not initialized at all. However, when this legacy behavior is combined with standard JavaScript decorators, TypeScript switches to always initializing all fields, even those without initializers. Previously esbuild incorrectly continued to omit field initializers for this edge case. These field initializers in this case should now be emitted starting with this release.</p>
</li>
<li>
<p>Avoid incorrect cycle warning with <code>tsconfig.json</code> multiple inheritance (<a href="https://redirect.github.com/evanw/esbuild/issues/3898">#3898</a>)</p>
<p>TypeScript 5.0 introduced multiple inheritance for <code>tsconfig.json</code> files where <code>extends</code> can be an array of file paths. Previously esbuild would incorrectly treat files encountered more than once when processing separate subtrees of the multiple inheritance hierarchy as an inheritance cycle. With this release, <code>tsconfig.json</code> files containing this edge case should work correctly without generating a warning.</p>
</li>
<li>
<p>Handle Yarn Plug'n'Play stack overflow with <code>tsconfig.json</code> (<a href="https://redirect.github.com/evanw/esbuild/issues/3915">#3915</a>)</p>
<p>Previously a <code>tsconfig.json</code> file that <code>extends</code> another file in a package with an <code>exports</code> map could cause a stack overflow when Yarn's Plug'n'Play resolution was active. This edge case should work now starting with this release.</p>
</li>
<li>
<p>Work around more issues with Deno 1.31+ (<a href="https://redirect.github.com/evanw/esbuild/pull/3917">#3917</a>)</p>
<p>This version of Deno broke the <code>stdin</code> and <code>stdout</code> properties on command objects for inherited streams, which matters when you run esbuild's Deno module as the entry point (i.e. when <code>import.meta.main</code> is <code>true</code>). Previously esbuild would crash in Deno 1.31+ if you ran esbuild like that. This should be fixed starting with this release.</p>
<p>This fix was contributed by <a href="https://github.com/Joshix-1"><code>@​Joshix-1</code></a>.</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/evanw/esbuild/commit/d34e79e2a998c21bb71d57b92b0017ca11756912"><code>d34e79e</code></a> publish 0.24.0 to npm</li>
<li><a href="https://github.com/evanw/esbuild/commit/045a87f164b31838aad7e2bcba112cf7717898d0"><code>045a87f</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3887">#3887</a>: omit dead export warning for <code>default</code></li>
<li><a href="https://github.com/evanw/esbuild/commit/6e049b81d2e080ccdf24db84a71934ea736879ce"><code>6e049b8</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3913">#3913</a>: useDefineForClassFields and decorators</li>
<li><a href="https://github.com/evanw/esbuild/commit/9c26f987dd9bbd33861a86b2a9d0b347f9ec297e"><code>9c26f98</code></a> lower decorators for useDefineForClassFields <a href="https://redirect.github.com/evanw/esbuild/issues/3913">#3913</a></li>
<li><a href="https://github.com/evanw/esbuild/commit/46fdb686e2880f5b8447f998dedfc730e66ae32a"><code>46fdb68</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3898">#3898</a>: incorrect cyclic tsconfig.json warning</li>
<li><a href="https://github.com/evanw/esbuild/commit/b50044303b3430ce007ac0fe4baf21160093794e"><code>b500443</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3917">#3917</a>: running esbuild cli with deno</li>
<li><a href="https://github.com/evanw/esbuild/commit/b125e62c7033e3ace20df9ec05c846d222f61ce5"><code>b125e62</code></a> run <code>make update-compat-table</code></li>
<li><a href="https://github.com/evanw/esbuild/commit/112b9aa32ea80eeef01cb91a8b415cfff08ef850"><code>112b9aa</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3915">#3915</a>: stack overflow with yarn + tsconfig</li>
<li><a href="https://github.com/evanw/esbuild/commit/ed5a555488a18e3b48954506e98d1f6a51f53368"><code>ed5a555</code></a> wasm: catch and rethrow stack overflows (<a href="https://redirect.github.com/evanw/esbuild/issues/3915">#3915</a>)</li>
<li><a href="https://github.com/evanw/esbuild/commit/11d3196156b12b11a3dc68f9d00a4a9982b907c0"><code>11d3196</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3902">#3902</a>: update go 1.22.5 =&gt; 1.23.1</li>
<li>Additional commits viewable in <a href="https://github.com/evanw/esbuild/compare/v0.23.1...v0.24.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/evanw/esbuild&package-manager=go_modules&previous-version=0.23.1&new-version=0.24.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/go.mod b/go.mod
index b049672bf..75b6300a9 100644
--- a/go.mod
+++ b/go.mod
@@ -27,7 +27,7 @@ require (
 	github.com/cli/safeexec v1.0.1
 	github.com/disintegration/gift v1.2.1
 	github.com/dustin/go-humanize v1.0.1
-	github.com/evanw/esbuild v0.23.1
+	github.com/evanw/esbuild v0.24.0
 	github.com/fatih/color v1.17.0
 	github.com/fortytw2/leaktest v1.3.0
 	github.com/frankban/quicktest v1.14.6
@@ -46,7 +46,7 @@ require (
 	github.com/gohugoio/testmodBuilder/mods v0.0.0-20190520184928-c56af20f2e95
 	github.com/google/go-cmp v0.6.0
 	github.com/gorilla/websocket v1.5.3
-	github.com/hairyhenderson/go-codeowners v0.5.0
+	github.com/hairyhenderson/go-codeowners v0.6.0
 	github.com/jdkato/prose v1.2.1
 	github.com/kylelemons/godebug v1.1.0
 	github.com/kyokomi/emoji/v2 v2.2.13
diff --git a/go.sum b/go.sum
index 17a2e2708..7646f3cd4 100644
--- a/go.sum
+++ b/go.sum
@@ -189,8 +189,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
 github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
 github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
 github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/evanw/esbuild v0.23.1 h1:ociewhY6arjTarKLdrXfDTgy25oxhTZmzP8pfuBTfTA=
-github.com/evanw/esbuild v0.23.1/go.mod h1:D2vIQZqV/vIf/VRHtViaUtViZmG7o+kKmlBfVQuRi48=
+github.com/evanw/esbuild v0.24.0 h1:GZ78naTLp7FKr+K7eNuM/SLs5maeiHYRPsTg6kmdsSE=
+github.com/evanw/esbuild v0.24.0/go.mod h1:D2vIQZqV/vIf/VRHtViaUtViZmG7o+kKmlBfVQuRi48=
 github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
 github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
 github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
@@ -329,8 +329,8 @@ github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS
 github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
 github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
 github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
-github.com/hairyhenderson/go-codeowners v0.5.0 h1:dpQB+hVHiRc2VVvc2BHxkuM+tmu9Qej/as3apqUbsWc=
-github.com/hairyhenderson/go-codeowners v0.5.0/go.mod h1:R3uW1OQXEj2Gu6/OvZ7bt6hr0qdkLvUWPiqNaWnexpo=
+github.com/hairyhenderson/go-codeowners v0.6.0 h1:cRCtmNf9Ni1GIeiAAlHX5IEEB2gr61813Kx5JmXxAAk=
+github.com/hairyhenderson/go-codeowners v0.6.0/go.mod h1:RFWbGcjlXhRKNezt7AQHmJucY0alk4osN0+RKOsIAa8=
 github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
 github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
 github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
diff --git a/resources/page/pagemeta/page_frontmatter.go b/resources/page/pagemeta/page_frontmatter.go
index 9491bf1bc..d5d612609 100644
--- a/resources/page/pagemeta/page_frontmatter.go
+++ b/resources/page/pagemeta/page_frontmatter.go
@@ -728,7 +728,7 @@ func (f *frontmatterFieldHandlers) newDateFieldHandler(key string, setter func(d
 	return func(d *FrontMatterDescriptor) (bool, error) {
 		v, found := d.PageConfig.Params[key]
 
-		if !found {
+		if !found || v == "" || v == nil {
 			return false, nil
 		}
 
@@ -739,7 +739,7 @@ func (f *frontmatterFieldHandlers) newDateFieldHandler(key string, setter func(d
 			var err error
 			date, err = htime.ToTimeInDefaultLocationE(v, d.Location)
 			if err != nil {
-				return false, fmt.Errorf("invalid front matter: %s: %s: see %s", key, v, d.PathOrTitle)
+				return false, fmt.Errorf("the %q front matter field is not a parsable date: see %s", key, d.PathOrTitle)
 			}
 			d.PageConfig.Params[key] = date
 		}


Test patch:
diff --git a/resources/page/pagemeta/pagemeta_integration_test.go b/resources/page/pagemeta/pagemeta_integration_test.go
index 4d195b7f0..d0c550b2e 100644
--- a/resources/page/pagemeta/pagemeta_integration_test.go
+++ b/resources/page/pagemeta/pagemeta_integration_test.go
@@ -14,6 +14,7 @@
 package pagemeta_test
 
 import (
+	"strings"
 	"testing"
 
 	"github.com/gohugoio/hugo/hugolib"
@@ -43,3 +44,99 @@ Lastmod: 2024-03-13 06:00:00 &#43;0000 GMT
 Eq: true
 `)
 }
+
+func TestDateValidation(t *testing.T) {
+	t.Parallel()
+
+	files := `
+-- hugo.toml --
+disableKinds = ['page','rss','section','sitemap','taxonomy','term']
+-- content/_index.md --
+FRONT_MATTER
+-- layouts/index.html --
+{{ .Date.UTC.Format "2006-01-02" }}
+--
+`
+	errorMsg := `ERROR the "date" front matter field is not a parsable date`
+
+	// TOML: unquoted date/time (valid)
+	f := strings.ReplaceAll(files, "FRONT_MATTER", `
++++
+date = 2024-10-01
++++
+	`)
+	b := hugolib.Test(t, f)
+	b.AssertFileContent("public/index.html", "2024-10-01")
+
+	// TOML: string (valid)
+	f = strings.ReplaceAll(files, "FRONT_MATTER", `
++++
+date = "2024-10-01"
++++
+	`)
+	b = hugolib.Test(t, f)
+	b.AssertFileContent("public/index.html", "2024-10-01")
+
+	// TOML: empty string (valid)
+	f = strings.ReplaceAll(files, "FRONT_MATTER", `
++++
+date = ""
++++
+	`)
+	b = hugolib.Test(t, f)
+	b.AssertFileContent("public/index.html", "0001-01-01")
+
+	// TOML: int (valid)
+	f = strings.ReplaceAll(files, "FRONT_MATTER", `
++++
+date = 0
++++
+	`)
+	b = hugolib.Test(t, f)
+	b.AssertFileContent("public/index.html", "1970-01-01")
+
+	// TOML: string (invalid)
+	f = strings.ReplaceAll(files, "FRONT_MATTER", `
++++
+date = "2024-42-42"
++++
+	`)
+	b, _ = hugolib.TestE(t, f)
+	b.AssertLogContains(errorMsg)
+
+	// TOML: bool (invalid)
+	f = strings.ReplaceAll(files, "FRONT_MATTER", `
++++
+date = true
++++
+	`)
+	b, _ = hugolib.TestE(t, f)
+	b.AssertLogContains(errorMsg)
+
+	// TOML: float (invalid)
+	f = strings.ReplaceAll(files, "FRONT_MATTER", `
++++
+date = 6.7
++++
+	`)
+	b, _ = hugolib.TestE(t, f)
+	b.AssertLogContains(errorMsg)
+
+	// JSON: null (valid)
+	f = strings.ReplaceAll(files, "FRONT_MATTER", `
+{
+  "date": null
+}
+	`)
+	b = hugolib.Test(t, f)
+	b.AssertFileContent("public/index.html", "0001-01-01")
+
+	// YAML: null (valid)
+	f = strings.ReplaceAll(files, "FRONT_MATTER", `
+---
+date:
+---
+	`)
+	b = hugolib.Test(t, f)
+	b.AssertFileContent("public/index.html", "0001-01-01")
+}
diff --git a/resources/resource_transformers/cssjs/tailwindcss_integration_test.go b/resources/resource_transformers/cssjs/tailwindcss_integration_test.go
index c6bffd81a..c0d6d3dff 100644
--- a/resources/resource_transformers/cssjs/tailwindcss_integration_test.go
+++ b/resources/resource_transformers/cssjs/tailwindcss_integration_test.go
@@ -36,8 +36,8 @@ func TestTailwindV4Basic(t *testing.T) {
     "url": "https://github.com/bep/hugo-starter-tailwind-basic.git"
   },
   "devDependencies": {
-    "@tailwindcss/cli": "4.0.0-alpha.24",
-    "tailwindcss": "4.0.0-alpha.24"
+    "@tailwindcss/cli": "^4.0.0-alpha.26",
+    "tailwindcss": "^4.0.0-alpha.26"
   },
   "name": "hugo-starter-tailwind-basic",
   "version": "0.1.0"