[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---|---|---| | [esbuild](https://togithub.com/evanw/esbuild) | | minor | `0.20.2` -> `0.21.4` | [![age](https://developer.mend.io/api/mc/badges/age/hermit/esbuild/0.21.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/hermit/esbuild/0.21.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/hermit/esbuild/0.20.2/0.21.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/hermit/esbuild/0.20.2/0.21.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [github.com/alecthomas/assert/v2](https://togithub.com/alecthomas/assert) | require | minor | `v2.7.0` -> `v2.10.0` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2falecthomas%2fassert%2fv2/v2.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2falecthomas%2fassert%2fv2/v2.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2falecthomas%2fassert%2fv2/v2.7.0/v2.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2falecthomas%2fassert%2fv2/v2.7.0/v2.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [github.com/alecthomas/chroma/v2](https://togithub.com/alecthomas/chroma) | require | minor | `v2.13.0` -> `v2.14.0` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2falecthomas%2fchroma%2fv2/v2.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2falecthomas%2fchroma%2fv2/v2.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2falecthomas%2fchroma%2fv2/v2.13.0/v2.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2falecthomas%2fchroma%2fv2/v2.13.0/v2.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [go](https://togithub.com/golang/go) | | patch | `1.22.1` -> `1.22.3` | [![age](https://developer.mend.io/api/mc/badges/age/hermit/go/1.22.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/hermit/go/1.22.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/hermit/go/1.22.1/1.22.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/hermit/go/1.22.1/1.22.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [goreleaser](https://togithub.com/goreleaser/goreleaser) | | minor | `1.24.0` -> `1.26.2` | [![age](https://developer.mend.io/api/mc/badges/age/hermit/goreleaser/1.26.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/hermit/goreleaser/1.26.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/hermit/goreleaser/1.24.0/1.26.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/hermit/goreleaser/1.24.0/1.26.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>evanw/esbuild (esbuild)</summary> ### [`v0.21.4`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#0214) [Compare Source](https://togithub.com/evanw/esbuild/compare/v0.21.3...v0.21.4) - Update support for import assertions and import attributes in node ([#​3778](https://togithub.com/evanw/esbuild/issues/3778)) Import assertions (the `assert` keyword) have been removed from node starting in v22.0.0. So esbuild will now strip them and generate a warning with `--target=node22` or above: ▲ [WARNING] The "assert" keyword is not supported in the configured target environment ("node22") [assert-to-with] example.mjs:1:40: 1 │ import json from "esbuild/package.json" assert { type: "json" } │ ~~~~~~ ╵ with Did you mean to use "with" instead of "assert"? Import attributes (the `with` keyword) have been backported to node 18 starting in v18.20.0. So esbuild will no longer strip them with `--target=node18.N` if `N` is 20 or greater. - Fix `for await` transform when a label is present This release fixes a bug where the `for await` transform, which wraps the loop in a `try` statement, previously failed to also move the loop's label into the `try` statement. This bug only affects code that uses both of these features in combination. Here's an example of some affected code: ```js // Original code async function test() { outer: for await (const x of [Promise.resolve([0, 1])]) { for (const y of x) if (y) break outer throw 'fail' } } // Old output (with --target=es6) function test() { return __async(this, null, function* () { outer: try { for (var iter = __forAwait([Promise.resolve([0, 1])]), more, temp, error; more = !(temp = yield iter.next()).done; more = false) { const x = temp.value; for (const y of x) if (y) break outer; throw "fail"; } } catch (temp) { error = [temp]; } finally { try { more && (temp = iter.return) && (yield temp.call(iter)); } finally { if (error) throw error[0]; } } }); } // New output (with --target=es6) function test() { return __async(this, null, function* () { try { outer: for (var iter = __forAwait([Promise.resolve([0, 1])]), more, temp, error; more = !(temp = yield iter.next()).done; more = false) { const x = temp.value; for (const y of x) if (y) break outer; throw "fail"; } } catch (temp) { error = [temp]; } finally { try { more && (temp = iter.return) && (yield temp.call(iter)); } finally { if (error) throw error[0]; } } }); } ``` - Do additional constant folding after cross-module enum inlining ([#​3416](https://togithub.com/evanw/esbuild/issues/3416), [#​3425](https://togithub.com/evanw/esbuild/issues/3425)) This release adds a few more cases where esbuild does constant folding after cross-module enum inlining. ```ts // Original code: enum.ts export enum Platform { WINDOWS = 'windows', MACOS = 'macos', LINUX = 'linux', } // Original code: main.ts import { Platform } from './enum'; declare const PLATFORM: string; export function logPlatform() { if (PLATFORM == Platform.WINDOWS) console.log('Windows'); else if (PLATFORM == Platform.MACOS) console.log('macOS'); else if (PLATFORM == Platform.LINUX) console.log('Linux'); else console.log('Other'); } // Old output (with --bundle '--define:PLATFORM="macos"' --minify --format=esm) function n(){"windows"=="macos"?console.log("Windows"):"macos"=="macos"?console.log("macOS"):"linux"=="macos"?console.log("Linux"):console.log("Other")}export{n as logPlatform}; // New output (with --bundle '--define:PLATFORM="macos"' --minify --format=esm) function n(){console.log("macOS")}export{n as logPlatform}; ``` - Pass import attributes to on-resolve plugins ([#​3384](https://togithub.com/evanw/esbuild/issues/3384), [#​3639](https://togithub.com/evanw/esbuild/issues/3639), [#​3646](https://togithub.com/evanw/esbuild/issues/3646)) With this release, on-resolve plugins will now have access to the import attributes on the import via the `with` property of the arguments object. This mirrors the `with` property of the arguments object that's already passed to on-load plugins. In addition, you can now pass `with` to the `resolve()` API call which will then forward that value on to all relevant plugins. Here's an example of a plugin that can now be written: ```js const examplePlugin = { name: 'Example plugin', setup(build) { build.onResolve({ filter: /.*/ }, args => { if (args.with.type === 'external') return { external: true } }) } } require('esbuild').build({ stdin: { contents: ` import foo from "./foo" with { type: "external" } foo() `, }, bundle: true, format: 'esm', write: false, plugins: [examplePlugin], }).then(result => { console.log(result.outputFiles[0].text) }) ``` - Formatting support for the `@position-try` rule ([#​3773](https://togithub.com/evanw/esbuild/issues/3773)) Chrome shipped this new CSS at-rule in version 125 as part of the [CSS anchor positioning API](https://developer.chrome.com/blog/anchor-positioning-api). With this release, esbuild now knows to expect a declaration list inside of the `@position-try` body block and will format it appropriately. - Always allow internal string import and export aliases ([#​3343](https://togithub.com/evanw/esbuild/issues/3343)) Import and export names can be string literals in ES2022+. Previously esbuild forbid any usage of these aliases when the target was below ES2022. Starting with this release, esbuild will only forbid such usage when the alias would otherwise end up in output as a string literal. String literal aliases that are only used internally in the bundle and are "compiled away" are no longer errors. This makes it possible to use string literal aliases with esbuild's `inject` feature even when the target is earlier than ES2022. ### [`v0.21.3`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#0213) [Compare Source](https://togithub.com/evanw/esbuild/compare/v0.21.2...v0.21.3) - Implement the decorator metadata proposal ([#​3760](https://togithub.com/evanw/esbuild/issues/3760)) This release implements the [decorator metadata proposal](https://togithub.com/tc39/proposal-decorator-metadata), which is a sub-proposal of the [decorators proposal](https://togithub.com/tc39/proposal-decorators). Microsoft shipped the decorators proposal in [TypeScript 5.0](https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#decorators) and the decorator metadata proposal in [TypeScript 5.2](https://devblogs.microsoft.com/typescript/announcing-typescript-5-2/#decorator-metadata), so it's important that esbuild also supports both of these features. Here's a quick example: ```js // Shim the "Symbol.metadata" symbol Symbol.metadata ??= Symbol('Symbol.metadata') const track = (_, context) => { (context.metadata.names ||= []).push(context.name) } class Foo { @​track foo = 1 @​track bar = 2 } // Prints ["foo", "bar"] console.log(Foo[Symbol.metadata].names) ``` **⚠️ WARNING ⚠️** This proposal has been marked as "stage 3" which means "recommended for implementation". However, it's still a work in progress and isn't a part of JavaScript yet, so keep in mind that any code that uses JavaScript decorator metadata may need to be updated as the feature continues to evolve. If/when that happens, I will update esbuild's implementation to match the specification. I will not be supporting old versions of the specification. - Fix bundled decorators in derived classes ([#​3768](https://togithub.com/evanw/esbuild/issues/3768)) In certain cases, bundling code that uses decorators in a derived class with a class body that references its own class name could previously generate code that crashes at run-time due to an incorrect variable name. This problem has been fixed. Here is an example of code that was compiled incorrectly before this fix: ```js class Foo extends Object { @​(x => x) foo() { return Foo } } console.log(new Foo().foo()) ``` - Fix `tsconfig.json` files inside symlinked directories ([#​3767](https://togithub.com/evanw/esbuild/issues/3767)) This release fixes an issue with a scenario involving a `tsconfig.json` file that `extends` another file from within a symlinked directory that uses the `paths` feature. In that case, the implicit `baseURL` value should be based on the real path (i.e. after expanding all symbolic links) instead of the original path. This was already done for other files that esbuild resolves but was not yet done for `tsconfig.json` because it's special-cased (the regular path resolver can't be used because the information inside `tsconfig.json` is involved in path resolution). Note that this fix no longer applies if the `--preserve-symlinks` setting is enabled. ### [`v0.21.2`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#0212) [Compare Source](https://togithub.com/evanw/esbuild/compare/v0.21.1...v0.21.2) - Correct `this` in field and accessor decorators ([#​3761](https://togithub.com/evanw/esbuild/issues/3761)) This release changes the value of `this` in initializers for class field and accessor decorators from the module-level `this` value to the appropriate `this` value for the decorated element (either the class or the instance). It was previously incorrect due to lack of test coverage. Here's an example of a decorator that doesn't work without this change: ```js const dec = () => function() { this.bar = true } class Foo { @​dec static foo } console.log(Foo.bar) // Should be "true" ``` - Allow `es2023` as a target environment ([#​3762](https://togithub.com/evanw/esbuild/issues/3762)) TypeScript recently [added `es2023`](https://togithub.com/microsoft/TypeScript/pull/58140) as a compilation target, so esbuild now supports this too. There is no difference between a target of `es2022` and `es2023` as far as esbuild is concerned since the 2023 edition of JavaScript doesn't introduce any new syntax features. ### [`v0.21.1`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#0211) - Fix a regression with `--keep-names` ([#​3756](https://togithub.com/evanw/esbuild/issues/3756)) The previous release introduced a regression with the `--keep-names` setting and object literals with `get`/`set` accessor methods, in which case the generated code contained syntax errors. This release fixes the regression: ```js // Original code x = { get y() {} } // Output from version 0.21.0 (with --keep-names) x = { get y: /* @​__PURE__ */ __name(function() { }, "y") }; // Output from this version (with --keep-names) x = { get y() { } }; ``` </details> <details> <summary>alecthomas/assert (github.com/alecthomas/assert/v2)</summary> ### [`v2.10.0`](https://togithub.com/alecthomas/assert/compare/v2.9.0...v2.10.0) [Compare Source](https://togithub.com/alecthomas/assert/compare/v2.9.0...v2.10.0) ### [`v2.9.0`](https://togithub.com/alecthomas/assert/compare/v2.8.1...v2.9.0) [Compare Source](https://togithub.com/alecthomas/assert/compare/v2.8.1...v2.9.0) ### [`v2.8.1`](https://togithub.com/alecthomas/assert/compare/v2.8.0...v2.8.1) [Compare Source](https://togithub.com/alecthomas/assert/compare/v2.8.0...v2.8.1) ### [`v2.8.0`](https://togithub.com/alecthomas/assert/compare/v2.7.0...v2.8.0) [Compare Source](https://togithub.com/alecthomas/assert/compare/v2.7.0...v2.8.0) </details> <details> <summary>alecthomas/chroma (github.com/alecthomas/chroma/v2)</summary> ### [`v2.14.0`](https://togithub.com/alecthomas/chroma/releases/tag/v2.14.0) [Compare Source](https://togithub.com/alecthomas/chroma/compare/v2.13.0...v2.14.0) #### Changelog - [`1e983e7`](https://togithub.com/alecthomas/chroma/commit/1e983e7) lexers/cue: support CUE attributes ([#​961](https://togithub.com/alecthomas/chroma/issues/961)) - [`9347b55`](https://togithub.com/alecthomas/chroma/commit/9347b55) Add Gleam syntax highlighting ([#​959](https://togithub.com/alecthomas/chroma/issues/959)) - [`6b7ffe1`](https://togithub.com/alecthomas/chroma/commit/6b7ffe1) chore(styles): add tokyonight inspired styles ([#​957](https://togithub.com/alecthomas/chroma/issues/957)) - [`736c0ea`](https://togithub.com/alecthomas/chroma/commit/736c0ea) Typescript: Several fixes ([#​952](https://togithub.com/alecthomas/chroma/issues/952)) - [`e5c25d0`](https://togithub.com/alecthomas/chroma/commit/e5c25d0) Org: Keep all newlines ([#​951](https://togithub.com/alecthomas/chroma/issues/951)) - [`d07caa4`](https://togithub.com/alecthomas/chroma/commit/d07caa4) chore(deps): update module github.com/alecthomas/assert/v2 to v2.7.0 ([#​949](https://togithub.com/alecthomas/chroma/issues/949)) - [`5f83664`](https://togithub.com/alecthomas/chroma/commit/5f83664) Vue: Handle more edge cases ([#​950](https://togithub.com/alecthomas/chroma/issues/950)) - [`32c053f`](https://togithub.com/alecthomas/chroma/commit/32c053f) chore(deps): update all non-major dependencies ([#​948](https://togithub.com/alecthomas/chroma/issues/948)) - [`2580aaa`](https://togithub.com/alecthomas/chroma/commit/2580aaa) Add Bazel bzlmod support into Python lexer ([#​947](https://togithub.com/alecthomas/chroma/issues/947)) </details> <details> <summary>golang/go (go)</summary> ### [`v1.22.3`](https://togithub.com/golang/go/compare/go1.22.2...go1.22.3) ### [`v1.22.2`](https://togithub.com/golang/go/compare/go1.22.1...go1.22.2) </details> <details> <summary>goreleaser/goreleaser (goreleaser)</summary> ### [`v1.26.2`](https://togithub.com/goreleaser/goreleaser/releases/tag/v1.26.2) #### Changelog ##### Bug fixes - [`b3d6460`](b3d6460699
): fix(docs): version typo ([#​4878](https://togithub.com/goreleaser/goreleaser/issues/4878)) ([@​nullswan](https://togithub.com/nullswan)) ##### Dependency updates - [`73a22e5`](73a22e56dd
): chore(deps): bump actions/checkout from 4.1.5 to 4.1.6 ([#​4876](https://togithub.com/goreleaser/goreleaser/issues/4876)) ([@​dependabot](https://togithub.com/dependabot)\[bot]) - [`1c66ce4`](1c66ce40d0
): chore(deps): bump anchore/sbom-action from 0.15.11 to 0.16.0 ([#​4881](https://togithub.com/goreleaser/goreleaser/issues/4881)) ([@​dependabot](https://togithub.com/dependabot)\[bot]) - [`39d1f44`](39d1f446f5
): chore(deps): bump cachix/install-nix-action from 26 to 27 ([#​4874](https://togithub.com/goreleaser/goreleaser/issues/4874)) ([@​dependabot](https://togithub.com/dependabot)\[bot]) - [`1d49b22`](1d49b225c6
): chore(deps): bump codecov/codecov-action from 4.4.0 to 4.4.1 ([#​4882](https://togithub.com/goreleaser/goreleaser/issues/4882)) ([@​dependabot](https://togithub.com/dependabot)\[bot]) - [`fae464e`](fae464e278
): chore(deps): bump github.com/caarlos0/env/v11 from 11.0.0 to 11.0.1 ([#​4888](https://togithub.com/goreleaser/goreleaser/issues/4888)) ([@​dependabot](https://togithub.com/dependabot)\[bot]) - [`de796eb`](de796eb4e5
): chore(deps): bump github.com/google/ko from 0.15.2 to 0.15.4 ([#​4885](https://togithub.com/goreleaser/goreleaser/issues/4885)) ([@​dependabot](https://togithub.com/dependabot)\[bot]) - [`b4d768b`](b4d768bf16
): chore(deps): bump github.com/mattn/go-mastodon from 0.0.6 to 0.0.8 ([#​4872](https://togithub.com/goreleaser/goreleaser/issues/4872)) ([@​dependabot](https://togithub.com/dependabot)\[bot]) - [`a82491a`](a82491afe4
): chore(deps): bump github.com/slack-go/slack from 0.12.5 to 0.13.0 ([#​4871](https://togithub.com/goreleaser/goreleaser/issues/4871)) ([@​dependabot](https://togithub.com/dependabot)\[bot]) - [`cf2c47a`](cf2c47a589
): chore(deps): bump github/codeql-action from 2.13.4 to 3.25.5 ([#​4880](https://togithub.com/goreleaser/goreleaser/issues/4880)) ([@​dependabot](https://togithub.com/dependabot)\[bot]) - [`79caa9c`](79caa9c28a
): chore(deps): bump github/codeql-action from 3.25.5 to 3.25.6 ([#​4883](https://togithub.com/goreleaser/goreleaser/issues/4883)) ([@​dependabot](https://togithub.com/dependabot)\[bot]) - [`b534f07`](b534f07d5b
): chore(deps): bump golang from `c24516e` to `f1fe698` ([#​4873](https://togithub.com/goreleaser/goreleaser/issues/4873)) ([@​dependabot](https://togithub.com/dependabot)\[bot]) - [`d7c23c1`](d7c23c168f
): chore(deps): bump golang from `f1fe698` to `b8ded51` ([#​4887](https://togithub.com/goreleaser/goreleaser/issues/4887)) ([@​dependabot](https://togithub.com/dependabot)\[bot]) ##### Documentation updates - [`2023d4b`](2023d4bcc6
): docs: fix winget default path ([#​4875](https://togithub.com/goreleaser/goreleaser/issues/4875)) ([@​lionello](https://togithub.com/lionello)) ##### Build process updates - [`f4cd8fc`](f4cd8fc156
): build: fix changelog not showing dependencies updates ([@​caarlos0](https://togithub.com/caarlos0)) ##### Other work - [`919b132`](919b132e0d
): chore: auto-update generated files ([@​actions-user](https://togithub.com/actions-user)) **Full Changelog**: https://github.com/goreleaser/goreleaser/compare/v1.26.1...v1.26.2 #### Helping out This release is only possible thanks to **all** the support of some **awesome people**! Want to be one of them? You can [sponsor](https://goreleaser.com/sponsors/), get a [Pro License](https://goreleaser.com/pro) or [contribute with code](https://goreleaser.com/contributing). #### Where to go next? - Find examples and commented usage of all options in our [website](https://goreleaser.com/intro/). - Reach out on [Discord](https://discord.gg/RGEBtg8vQ6) and [Twitter](https://twitter.com/goreleaser)! <a href="https://goreleaser.com"><img src="https://raw.githubusercontent.com/goreleaser/artwork/master/opencollective-header.png" with="100%" alt="GoReleaser logo"></a> ### [`v1.26.1`](https://togithub.com/goreleaser/goreleaser/releases/tag/v1.26.1) #### Changelog ##### Security updates - [`19b94f6`](19b94f676f
): sec: GHSA-f6mm-5fc7-3g3c ([@​caarlos0](https://togithub.com/caarlos0)) ##### Bug fixes - [`9cf3bbb`](9cf3bbbc5c
): fix(build): do not print 'go: downloading' bits of go build output ([#​4869](https://togithub.com/goreleaser/goreleaser/issues/4869)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`e466507`](e466507637
): fix(cmd): --draft should only override if set ([@​caarlos0](https://togithub.com/caarlos0)) - [`c5204df`](c5204dfb64
): fix: close HTTP resp body to prevent resource leak ([#​4857](https://togithub.com/goreleaser/goreleaser/issues/4857)) ([@​alexandear](https://togithub.com/alexandear)) - [`7e0155c`](7e0155c557
): fix: disable logs on some commands ([#​4865](https://togithub.com/goreleaser/goreleaser/issues/4865)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`6505654`](6505654c86
): fix: fix nolintlint issues ([#​4854](https://togithub.com/goreleaser/goreleaser/issues/4854)) ([@​alexandear](https://togithub.com/alexandear)) - [`00a376c`](00a376cc64
): refactor: remove unneeded in Go 1.22 loop var copy ([#​4856](https://togithub.com/goreleaser/goreleaser/issues/4856)) ([@​alexandear](https://togithub.com/alexandear)) ##### Documentation updates - [`ba7e915`](ba7e915cd8
): docs: announce v1.26 ([#​4851](https://togithub.com/goreleaser/goreleaser/issues/4851)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`2f56643`](2f56643a63
): docs: update action docs ([@​caarlos0](https://togithub.com/caarlos0)) - [`c148106`](c148106c56
): docs: update old Go website links ([#​4855](https://togithub.com/goreleaser/goreleaser/issues/4855)) ([@​alexandear](https://togithub.com/alexandear)) ##### Build process updates - [`c09c86c`](c09c86cb39
): build: disable appendAssign gocritic check ([@​caarlos0](https://togithub.com/caarlos0)) **Full Changelog**: https://github.com/goreleaser/goreleaser/compare/v1.26.0...v1.26.1 #### Helping out This release is only possible thanks to **all** the support of some **awesome people**! Want to be one of them? You can [sponsor](https://goreleaser.com/sponsors/), get a [Pro License](https://goreleaser.com/pro) or [contribute with code](https://goreleaser.com/contributing). #### Where to go next? - Find examples and commented usage of all options in our [website](https://goreleaser.com/intro/). - Reach out on [Discord](https://discord.gg/RGEBtg8vQ6) and [Twitter](https://twitter.com/goreleaser)! <a href="https://goreleaser.com"><img src="https://raw.githubusercontent.com/goreleaser/artwork/master/opencollective-header.png" with="100%" alt="GoReleaser logo"></a> ### [`v1.26.0`](https://togithub.com/goreleaser/goreleaser/releases/tag/v1.26.0) #### Changelog ##### New Features - [`de72cab`](de72cab5d9
): feat(announce): add BlueSky support ([#​4779](https://togithub.com/goreleaser/goreleaser/issues/4779)) ([@​jghiloni](https://togithub.com/jghiloni)) - [`e538341`](e538341179
): feat(archive): support tar.zst ([#​4825](https://togithub.com/goreleaser/goreleaser/issues/4825)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`39bf666`](39bf6668bc
): feat(changelog): custom commit format ([#​4802](https://togithub.com/goreleaser/goreleaser/issues/4802)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`5d98c69`](5d98c69f0f
): feat(checksum): supports BLAKE2 and SHA-3 ([#​4850](https://togithub.com/goreleaser/goreleaser/issues/4850)) ([@​sorairolake](https://togithub.com/sorairolake)) - [`c1615ea`](c1615ea521
): feat(cmd): release --draft ([#​4771](https://togithub.com/goreleaser/goreleaser/issues/4771)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`c8488dc`](c8488dc825
): feat(gitea): implement `Changelog` function ([#​4794](https://togithub.com/goreleaser/goreleaser/issues/4794)) ([@​appleboy](https://togithub.com/appleboy)) - [`2c93bd7`](2c93bd7c7f
): feat(gitlab): Allow PRs to be created ([#​4793](https://togithub.com/goreleaser/goreleaser/issues/4793)) ([@​baurmatt](https://togithub.com/baurmatt)) - [`5d37c9a`](5d37c9a5a0
): feat: always log build output ([#​4787](https://togithub.com/goreleaser/goreleaser/issues/4787)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`60a1ccc`](60a1cccf57
): feat: isEnvSet tmpl function ([#​4775](https://togithub.com/goreleaser/goreleaser/issues/4775)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`b05a62f`](b05a62fddc
): feat: migrate to new homebrew constuctions (on_arm, on_intel) ([#​4822](https://togithub.com/goreleaser/goreleaser/issues/4822)) ([@​kvendingoldo](https://togithub.com/kvendingoldo)) - [`3cd2e07`](3cd2e07c68
): feat: notarize macos binaries ([#​4774](https://togithub.com/goreleaser/goreleaser/issues/4774)) ([@​caarlos0](https://togithub.com/caarlos0)) ##### Security updates - [`c052ccc`](c052ccc691
): sec(deps): update runc for CVE-2024-3154 ([@​caarlos0](https://togithub.com/caarlos0)) ##### Bug fixes - [`172d6d4`](172d6d4b99
): Revert "fix: temp disable snapcraft" ([#​4830](https://togithub.com/goreleaser/goreleaser/issues/4830)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`b45c3b1`](b45c3b1720
): fix(bluesky): change default env, fix user agent, update tests ([@​caarlos0](https://togithub.com/caarlos0)) - [`bee8665`](bee8665d9e
): fix(brew): cpu conditionals ([#​4814](https://togithub.com/goreleaser/goreleaser/issues/4814)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`14ab459`](14ab459300
): fix(brew): linux brew with extra end ([@​caarlos0](https://togithub.com/caarlos0)) - [`b1723af`](b1723afff2
): fix(gitea): changelog output ([@​caarlos0](https://togithub.com/caarlos0)) - [`fd40f5d`](fd40f5d772
): fix(gitlab): Use start_branch for file creation if branch doesn't exist already ([#​4792](https://togithub.com/goreleaser/goreleaser/issues/4792)) ([@​baurmatt](https://togithub.com/baurmatt)) - [`bf31227`](bf31227b4e
): fix(nfpm): termux platform ([#​4812](https://togithub.com/goreleaser/goreleaser/issues/4812)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`2f87663`](2f876631b3
): fix(nix): update valid licenses ([@​caarlos0](https://togithub.com/caarlos0)) - [`56e0f79`](56e0f79473
): fix(telegram): mdv2escape ProjectName by default ([#​4784](https://togithub.com/goreleaser/goreleaser/issues/4784)) ([@​EpicStep](https://togithub.com/EpicStep)) - [`ca52f85`](ca52f855fc
): fix: bad json tag name ([@​caarlos0](https://togithub.com/caarlos0)) - [`7552d0b`](7552d0b4e0
): fix: lint issues ([@​caarlos0](https://togithub.com/caarlos0)) - [`7982a33`](7982a33a06
): fix: telegram default message ([#​4821](https://togithub.com/goreleaser/goreleaser/issues/4821)) ([@​EpicStep](https://togithub.com/EpicStep)) - [`fbddb70`](fbddb7081d
): fix: temp disable snapcraft ([#​4826](https://togithub.com/goreleaser/goreleaser/issues/4826)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`0a38d90`](0a38d90f66
): fix: typo in User-Agent header value ([#​4765](https://togithub.com/goreleaser/goreleaser/issues/4765)) ([@​alexandear](https://togithub.com/alexandear)) - [`780a3a4`](780a3a40d9
): fix: update SBOM generation to add .json as file type ([#​4781](https://togithub.com/goreleaser/goreleaser/issues/4781)) ([@​cpanato](https://togithub.com/cpanato)) - [`bf79c2c`](bf79c2cf91
): fix: use correct path variable for logging in check command ([#​4756](https://togithub.com/goreleaser/goreleaser/issues/4756)) ([@​hhromic](https://togithub.com/hhromic)) - [`1ed1a62`](1ed1a62b90
): fix: winget paths on windows ([#​4786](https://togithub.com/goreleaser/goreleaser/issues/4786)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`6735555`](673555519a
): refactor: improve switch ([@​caarlos0](https://togithub.com/caarlos0)) - [`ddb60f4`](ddb60f417e
): refactor: improve switch ([@​caarlos0](https://togithub.com/caarlos0)) - [`d5fc94a`](d5fc94a81d
): refactor: optimize strings replacers ([#​4788](https://togithub.com/goreleaser/goreleaser/issues/4788)) ([@​EpicStep](https://togithub.com/EpicStep)) ##### Dependency updates - [`8391ce5`](8391ce56e1
): fix(deps): update go-set to fix armv7 build ([@​caarlos0](https://togithub.com/caarlos0)) ##### Documentation updates - [`9b3f514`](9b3f514449
): docs: description for chocolateys.package_source_url ([#​4763](https://togithub.com/goreleaser/goreleaser/issues/4763)) ([@​alexandear](https://togithub.com/alexandear)) - [`f6615b1`](f6615b138b
): docs: fix typos ([#​4764](https://togithub.com/goreleaser/goreleaser/issues/4764)) ([@​alexandear](https://togithub.com/alexandear)) - [`e21a99a`](e21a99a54b
): docs: improve -p help message ([#​4798](https://togithub.com/goreleaser/goreleaser/issues/4798)) ([@​jftuga](https://togithub.com/jftuga)) - [`7b78e19`](7b78e195e2
): docs: notes on prefixed tags and monorepos ([@​caarlos0](https://togithub.com/caarlos0)) - [`0481e63`](0481e63fb3
): docs: remove mentions to --skip-something flags ([@​caarlos0](https://togithub.com/caarlos0)) - [`919f220`](919f220e71
): docs: update ([@​caarlos0](https://togithub.com/caarlos0)) - [`4015fa3`](4015fa32bc
): docs: update ([@​caarlos0](https://togithub.com/caarlos0)) - [`12d236d`](12d236ded2
): docs: update ([@​caarlos0](https://togithub.com/caarlos0)) - [`2cffcc5`](2cffcc58c5
): docs: update ([@​caarlos0](https://togithub.com/caarlos0)) - [`b7b4883`](b7b4883420
): docs: update ([@​caarlos0](https://togithub.com/caarlos0)) - [`f4c149e`](f4c149e10b
): docs: update USERS.md ([#​4839](https://togithub.com/goreleaser/goreleaser/issues/4839)) ([@​xcloudscript](https://togithub.com/xcloudscript)) - [`faadd02`](faadd02cc1
): docs: update bluesky docs ([@​caarlos0](https://togithub.com/caarlos0)) - [`60f12de`](60f12deae0
): docs: update changelog ([@​caarlos0](https://togithub.com/caarlos0)) - [`7468cf8`](7468cf8556
): docs: update dirty.md deprecated syntax ([#​4766](https://togithub.com/goreleaser/goreleaser/issues/4766)) ([@​johnmaguire](https://togithub.com/johnmaguire)) - [`652fd30`](652fd30c69
): docs: update repository.md ([@​caarlos0](https://togithub.com/caarlos0)) ##### Build process updates - [`1ec2e16`](1ec2e16288
): build: fix nightly job ([@​caarlos0](https://togithub.com/caarlos0)) - [`52dc2cb`](52dc2cb4e4
): build: use latest snapcraft ([#​4849](https://togithub.com/goreleaser/goreleaser/issues/4849)) ([@​caarlos0](https://togithub.com/caarlos0)) ##### Other work - [`3c0c714`](3c0c7148fd
): blob: permit skipping the configuration of the Content-Disposition header ([#​4832](https://togithub.com/goreleaser/goreleaser/issues/4832)) ([@​mvisonneau](https://togithub.com/mvisonneau)) **Full Changelog**: https://github.com/goreleaser/goreleaser/compare/v1.25.1...v1.26.0 #### Helping out This release is only possible thanks to **all** the support of some **awesome people**! Want to be one of them? You can [sponsor](https://goreleaser.com/sponsors/), get a [Pro License](https://goreleaser.com/pro) or [contribute with code](https://goreleaser.com/contributing). #### Where to go next? - Find examples and commented usage of all options in our [website](https://goreleaser.com/intro/). - Reach out on [Discord](https://discord.gg/RGEBtg8vQ6) and [Twitter](https://twitter.com/goreleaser)! <a href="https://goreleaser.com"><img src="https://raw.githubusercontent.com/goreleaser/artwork/master/opencollective-header.png" with="100%" alt="GoReleaser logo"></a> ### [`v1.25.1`](https://togithub.com/goreleaser/goreleaser/releases/tag/v1.25.1) #### Changelog ##### Bug fixes - [`053eccd`](053eccdba0
): fix(release): only change release draft status on new releases ([#​4744](https://togithub.com/goreleaser/goreleaser/issues/4744)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`22b7daa`](22b7daadb4
): fix(release): publish tag with skip_upload ([#​4745](https://togithub.com/goreleaser/goreleaser/issues/4745)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`0ff94f1`](0ff94f13e4
): fix: properly skip docker builds of skipped builds ([#​4747](https://togithub.com/goreleaser/goreleaser/issues/4747)) ([@​caarlos0](https://togithub.com/caarlos0)) ##### Documentation updates - [`d972be9`](d972be9704
): docs: announce v1.25 ([@​caarlos0](https://togithub.com/caarlos0)) - [`6a7a9ba`](6a7a9ba399
): docs: fix deprecation typos ([#​4750](https://togithub.com/goreleaser/goreleaser/issues/4750)) ([@​j178](https://togithub.com/j178)) ##### Build process updates - [`85cb59c`](85cb59c1a0
): build: simplify ([#​4748](https://togithub.com/goreleaser/goreleaser/issues/4748)) ([@​caarlos0](https://togithub.com/caarlos0)) **Full Changelog**: https://github.com/goreleaser/goreleaser/compare/v1.25.0...v1.25.1 #### Helping out This release is only possible thanks to **all** the support of some **awesome people**! Want to be one of them? You can [sponsor](https://goreleaser.com/sponsors/), get a [Pro License](https://goreleaser.com/pro) or [contribute with code](https://goreleaser.com/contributing). #### Where to go next? - Find examples and commented usage of all options in our [website](https://goreleaser.com/intro/). - Reach out on [Discord](https://discord.gg/RGEBtg8vQ6) and [Twitter](https://twitter.com/goreleaser)! <a href="https://goreleaser.com"><img src="https://raw.githubusercontent.com/goreleaser/artwork/master/opencollective-header.png" with="100%" alt="GoReleaser logo"></a> ### [`v1.25.0`](https://togithub.com/goreleaser/goreleaser/releases/tag/v1.25.0) #### Changelog ##### New Features - [`1db9347`](1db9347363
): feat(archives): format override to 'none' to skip certain goos ([#​4730](https://togithub.com/goreleaser/goreleaser/issues/4730)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`4d2bcfd`](4d2bcfdc46
): feat(brew): allow to set headers in the url ([#​4648](https://togithub.com/goreleaser/goreleaser/issues/4648)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`b9b8a65`](b9b8a65618
): feat(brew): sync fork before opening PR ([@​caarlos0](https://togithub.com/caarlos0)) - [`ec7106f`](ec7106fdea
): feat(git): retry git clone on retriable error ([#​4725](https://togithub.com/goreleaser/goreleaser/issues/4725)) ([@​Zebradil](https://togithub.com/Zebradil)) - [`2ecd71e`](2ecd71ee71
): feat(krew): sync fork before opening PR ([@​caarlos0](https://togithub.com/caarlos0)) - [`d9e9e82`](d9e9e82ca7
): feat(nfpm): also allow $NFPM_PASSPHRASE ([#​4633](https://togithub.com/goreleaser/goreleaser/issues/4633)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`42d2db2`](42d2db2021
): feat(nfpm): compression, fields, and predends on debs ([#​4632](https://togithub.com/goreleaser/goreleaser/issues/4632)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`42b6282`](42b6282e46
): feat(nix): sync fork before opening PR ([@​caarlos0](https://togithub.com/caarlos0)) - [`1af98af`](1af98af0b5
): feat(nix): update licenses ([@​caarlos0](https://togithub.com/caarlos0)) - [`ef90821`](ef90821ee7
): feat(pipe/release): Mark GitHub releases as non-draft only after all artifacts are uploaded. ([#​4626](https://togithub.com/goreleaser/goreleaser/issues/4626)) ([@​nichtverstehen](https://togithub.com/nichtverstehen)) - [`500be66`](500be667af
): feat(scoop): sync fork before opening PR ([@​caarlos0](https://togithub.com/caarlos0)) - [`3687c09`](3687c097cd
): feat(winget): sync fork before opening PR ([@​caarlos0](https://togithub.com/caarlos0)) - [`263cd05`](263cd059f2
): feat(winget): update manifest version to 1.6.0 ([#​4658](https://togithub.com/goreleaser/goreleaser/issues/4658)) ([@​vedantmgoyal9](https://togithub.com/vedantmgoyal9)) - [`2498ea7`](2498ea7029
): feat: add metadata to the release ([#​4714](https://togithub.com/goreleaser/goreleaser/issues/4714)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`6e0f426`](6e0f426339
): feat: allow to delete existing artifacts in the release ([#​4711](https://togithub.com/goreleaser/goreleaser/issues/4711)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`54ee014`](54ee014b50
): feat: checksums.split ([#​4707](https://togithub.com/goreleaser/goreleaser/issues/4707)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`7fc9399`](7fc93995b8
): feat: consistently use directory in property names ([#​4737](https://togithub.com/goreleaser/goreleaser/issues/4737)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`566e99a`](566e99ad73
): feat: fig is being sunset, remove ([#​4694](https://togithub.com/goreleaser/goreleaser/issues/4694)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`a00bf7e`](a00bf7e5d6
): feat: support .config dir ([@​caarlos0](https://togithub.com/caarlos0)) - [`b614d64`](b614d646ef
): feat: support netbsd/arm64 ([#​4706](https://togithub.com/goreleaser/goreleaser/issues/4706)) ([@​maxbrunet](https://togithub.com/maxbrunet)) - [`56c5a09`](56c5a09f9a
): feat: support projectID for gitlab CreateFile (brew, nix, etc) ([#​4705](https://togithub.com/goreleaser/goreleaser/issues/4705)) ([@​bradleyjames](https://togithub.com/bradleyjames)) - [`e43604f`](e43604f4a0
): feat: use go 1.22 ([#​4614](https://togithub.com/goreleaser/goreleaser/issues/4614)) ([@​caarlos0](https://togithub.com/caarlos0)) ##### Bug fixes - [`08851dc`](08851dce61
): fix(aur): allow to have multiple AUR configs pointing to the same repo ([#​4712](https://togithub.com/goreleaser/goreleaser/issues/4712)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`554ca5f`](554ca5f3e0
): fix(build): buildmode: pie ([#​4631](https://togithub.com/goreleaser/goreleaser/issues/4631)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`be511eb`](be511eb341
): fix(nix): update licenses ([@​caarlos0](https://togithub.com/caarlos0)) - [`ec22d60`](ec22d60b19
): fix(winget): name is not actually required ([@​caarlos0](https://togithub.com/caarlos0)) - [`8d3cd4c`](8d3cd4cef6
): fix: `run` not being truly POSIX-compliant ([#​4739](https://togithub.com/goreleaser/goreleaser/issues/4739)) ([@​bartekpacia](https://togithub.com/bartekpacia)) - [`c9ca63e`](c9ca63ece7
): fix: adjust unused function params in client mock package ([#​4738](https://togithub.com/goreleaser/goreleaser/issues/4738)) ([@​idnandre](https://togithub.com/idnandre)) - [`dc0de4c`](dc0de4ce59
): fix: artifact filtering ([@​caarlos0](https://togithub.com/caarlos0)) - [`b33f14c`](b33f14c0fa
): fix: better universalbinary message ([#​4627](https://togithub.com/goreleaser/goreleaser/issues/4627)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`e0db6ac`](e0db6ac7fa
): fix: brews.url_headers is not required ([@​caarlos0](https://togithub.com/caarlos0)) - [`5a8b6d4`](5a8b6d41fb
): fix: convert `run` install script to pure POSIX sh ([#​4736](https://togithub.com/goreleaser/goreleaser/issues/4736)) ([@​bartekpacia](https://togithub.com/bartekpacia)) - [`6f356ff`](6f356ffcfa
): fix: do not log `release published` if it is a draft ([#​4691](https://togithub.com/goreleaser/goreleaser/issues/4691)) ([@​nekohasekai](https://togithub.com/nekohasekai)) - [`af97e63`](af97e63dd3
): fix: improve artifact refresh and filtering ([@​caarlos0](https://togithub.com/caarlos0)) - [`0a27203`](0a272037b3
): fix: only build archlinux and aur for supported arches ([#​4695](https://togithub.com/goreleaser/goreleaser/issues/4695)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`c9068b4`](c9068b4b3c
): fix: properly template builds.gobinary ([@​caarlos0](https://togithub.com/caarlos0)) - [`994d01a`](994d01a0ce
): fix: remove repetitive words ([#​4701](https://togithub.com/goreleaser/goreleaser/issues/4701)) ([@​standstaff](https://togithub.com/standstaff)) - [`306999b`](306999b78b
): fix: sort order of brew artifacts ([#​4617](https://togithub.com/goreleaser/goreleaser/issues/4617)) ([@​brianstrauch](https://togithub.com/brianstrauch)) - [`8cd325e`](8cd325eb5a
): fix: support dir in gomod ([#​4729](https://togithub.com/goreleaser/goreleaser/issues/4729)) ([@​caarlos0](https://togithub.com/caarlos0)) - [`05e8b33`](05e8b33a89
): fix: use new refresh func ([@​caarlos0](https://togithub.com/caarlos0)) - [`c54e530`](c54e530902
): refactor: moving config load logic to another file ([@​caarlos0](https://togithub.com/caarlos0)) ##### Documentation updates - [`df3e799`](df3e799bec
): docs(blog): fix broken link ([#​4704](https://togithub.com/goreleaser/goreleaser/issues/4704)) ([@​alexandear](https://togithub.com/alexandear)) - [`6353982`](6353982e33
): docs: Minor edits to 'dockerhub' ([#​4740](https://togithub.com/goreleaser/goreleaser/issues/4740)) ([@​rfay](https://togithub.com/rfay)) - [`fd24a00`](fd24a00e47
): docs: bump setup-go version ([#​4638](https://togithub.com/goreleaser/goreleaser/issues/4638)) ([@​ddymko](https://togithub.com/ddymko)) - [`85f213c`](85f213c9da
): docs: clarify changelog sorting ([@​caarlos0](https://togithub.com/caarlos0)) - [`26c003a`](26c003a076
): docs: dockerhub singular ([@​caarlos0](https://togithub.com/caarlos0)) - [`e539e12`](e539e1256c
): docs: fix broken links ([@​caarlos0](https://togithub.com/caarlos0)) - [`f0abada`](f0abada909
): docs: fix default for `build.id` attribute ([#​4734](https://togithub.com/goreleaser/goreleaser/issues/4734)) ([@​hhromic](https://togithub.com/hhromic)) - [`e354734`](e35473423d
): docs: fix dockerhub missing images property ([@​caarlos0](https://togithub.com/caarlos0)) - [`12fe252`](12fe252827
): docs: fix link ([@​caarlos0](https://togithub.com/caarlos0)) - [`79aa2fc`](79aa2fc319
): docs: fix typo username in dockerhubs example ([#​4733](https://togithub.com/goreleaser/goreleaser/issues/4733)) ([@​rfay](https://togithub.com/rfay)) - [`7baf594`](7baf594a13
): docs: sort the GoReleaser configuration YAML code examples ([#​4652](https://togithub.com/goreleaser/goreleaser/issues/4652)) ([@​cafferata](https://togithub.com/cafferata)) - [`5073bd1`](5073bd1a5f
): docs: update ([@​caarlos0](https://togithub.com/caarlos0)) - [`1f39bdd`](1f39bddcb3
): docs: update ([@​caarlos0](https://togithub.com/caarlos0)) - [`1a9d3f7`](1a9d3f72c6
): docs: update ([@​caarlos0](https://togithub.com/caarlos0)) - [`84e214a`](84e214a809
): docs: update ([@​caarlos0](https://togithub.com/caarlos0)) - [`74c0885`](74c088548f
): docs: update ([@​caarlos0](https://togithub.com/caarlos0)) - [`ec8819a`](ec8819a95c
): docs: update ([@​caarlos0](https://togithub.com/caarlos0)) - [`f36318b`](f36318b6fd
): docs: update CONTRIBUTING ([@​caarlos0](https://togithub.com/caarlos0)) - [`2c892be`](2c892be4f8
): docs: update contributing ([@​caarlos0](https://togithub.com/caarlos0)) - [`fa431f3`](fa431f313d
): docs: update docs ([@​caarlos0](https://togithub.com/caarlos0)) - [`5256f06`](5256f063d0
): docs: update github action ([@​caarlos0](https://togithub.com/caarlos0)) - [`6262ce5`](6262ce5433
): docs: update nix.md ([@​caarlos0](https://togithub.com/caarlos0)) - [`b728f52`](b728f52f68
): docs: update sign docs ([@​caarlos0](https://togithub.com/caarlos0)) - [`932e424`](932e4249af
): docs: update users ([@​caarlos0](https://togithub.com/caarlos0)) - [`b31a2ac`](b31a2acde9
): docs: update users ([@​caarlos0](https://togithub.com/caarlos0)) - [`72a0d9d`](https://togithub. </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on Monday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/alecthomas/chroma). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjM3Ny44IiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Chroma — A general purpose syntax highlighter in pure Go
Chroma takes source code and other structured text and converts it into syntax highlighted HTML, ANSI-coloured text, etc.
Chroma is based heavily on Pygments, and includes translators for Pygments lexers and styles.
Table of Contents
- Supported languages
- Try it
- Using the library
- More detail
- Command-line interface
- Testing lexers
- What's missing compared to Pygments?
Supported languages
Prefix | Language |
---|---|
A | ABAP, ABNF, ActionScript, ActionScript 3, Ada, Agda, AL, Alloy, Angular2, ANTLR, ApacheConf, APL, AppleScript, ArangoDB AQL, Arduino, ArmAsm, AutoHotkey, AutoIt, Awk |
B | Ballerina, Bash, Bash Session, Batchfile, BibTeX, Bicep, BlitzBasic, BNF, BQN, Brainfuck |
C | C, C#, C++, Caddyfile, Caddyfile Directives, Cap'n Proto, Cassandra CQL, Ceylon, CFEngine3, cfstatement, ChaiScript, Chapel, Cheetah, Clojure, CMake, COBOL, CoffeeScript, Common Lisp, Coq, Crystal, CSS, Cython |
D | D, Dart, Dax, Desktop Entry, Diff, Django/Jinja, dns, Docker, DTD, Dylan |
E | EBNF, Elixir, Elm, EmacsLisp, Erlang |
F | Factor, Fennel, Fish, Forth, Fortran, FortranFixed, FSharp |
G | GAS, GDScript, Genshi, Genshi HTML, Genshi Text, Gherkin, GLSL, Gnuplot, Go, Go HTML Template, Go Text Template, GraphQL, Groff, Groovy |
H | Handlebars, Hare, Haskell, Haxe, HCL, Hexdump, HLB, HLSL, HolyC, HTML, HTTP, Hy |
I | Idris, Igor, INI, Io, ISCdhcpd |
J | J, Java, JavaScript, JSON, Julia, Jungle |
K | Kotlin |
L | Lighttpd configuration file, LLVM, Lua |
M | Makefile, Mako, markdown, Mason, Materialize SQL dialect, Mathematica, Matlab, mcfunction, Meson, Metal, MiniZinc, MLIR, Modula-2, MonkeyC, MorrowindScript, Myghty, MySQL |
N | NASM, Natural, Newspeak, Nginx configuration file, Nim, Nix |
O | Objective-C, OCaml, Octave, Odin, OnesEnterprise, OpenEdge ABL, OpenSCAD, Org Mode |
P | PacmanConf, Perl, PHP, PHTML, Pig, PkgConfig, PL/pgSQL, plaintext, Plutus Core, Pony, PostgreSQL SQL dialect, PostScript, POVRay, PowerQuery, PowerShell, Prolog, PromQL, Promela, properties, Protocol Buffer, PRQL, PSL, Puppet, Python, Python 2 |
Q | QBasic, QML |
R | R, Racket, Ragel, Raku, react, ReasonML, reg, Rego, reStructuredText, Rexx, RPMSpec, Ruby, Rust |
S | SAS, Sass, Scala, Scheme, Scilab, SCSS, Sed, Sieve, Smali, Smalltalk, Smarty, Snobol, Solidity, SourcePawn, SPARQL, SQL, SquidConf, Standard ML, stas, Stylus, Svelte, Swift, SYSTEMD, systemverilog |
T | TableGen, Tal, TASM, Tcl, Tcsh, Termcap, Terminfo, Terraform, TeX, Thrift, TOML, TradingView, Transact-SQL, Turing, Turtle, Twig, TypeScript, TypoScript, TypoScriptCssData, TypoScriptHtmlData |
V | V, V shell, Vala, VB.net, verilog, VHDL, VHS, VimL, vue |
W | WDTE, WebGPU Shading Language, Whiley |
X | XML, Xorg |
Y | YAML, YANG |
Z | Z80 Assembly, Zed, Zig |
I will attempt to keep this section up to date, but an authoritative list can be
displayed with chroma --list
.
Try it
Try out various languages and styles on the Chroma Playground.
Using the library
This is version 2 of Chroma, use the import path:
import "github.com/alecthomas/chroma/v2"
Chroma, like Pygments, has the concepts of lexers, formatters and styles.
Lexers convert source text into a stream of tokens, styles specify how token types are mapped to colours, and formatters convert tokens and styles into formatted output.
A package exists for each of these, containing a global Registry
variable
with all of the registered implementations. There are also helper functions
for using the registry in each package, such as looking up lexers by name or
matching filenames, etc.
In all cases, if a lexer, formatter or style can not be determined, nil
will
be returned. In this situation you may want to default to the Fallback
value in each respective package, which provides sane defaults.
Quick start
A convenience function exists that can be used to simply format some source text, without any effort:
err := quick.Highlight(os.Stdout, someSourceCode, "go", "html", "monokai")
Identifying the language
To highlight code, you'll first have to identify what language the code is written in. There are three primary ways to do that:
-
Detect the language from its filename.
lexer := lexers.Match("foo.go")
-
Explicitly specify the language by its Chroma syntax ID (a full list is available from
lexers.Names()
).lexer := lexers.Get("go")
-
Detect the language from its content.
lexer := lexers.Analyse("package main\n\nfunc main()\n{\n}\n")
In all cases, nil
will be returned if the language can not be identified.
if lexer == nil {
lexer = lexers.Fallback
}
At this point, it should be noted that some lexers can be extremely chatty. To mitigate this, you can use the coalescing lexer to coalesce runs of identical token types into a single token:
lexer = chroma.Coalesce(lexer)
Formatting the output
Once a language is identified you will need to pick a formatter and a style (theme).
style := styles.Get("swapoff")
if style == nil {
style = styles.Fallback
}
formatter := formatters.Get("html")
if formatter == nil {
formatter = formatters.Fallback
}
Then obtain an iterator over the tokens:
contents, err := ioutil.ReadAll(r)
iterator, err := lexer.Tokenise(nil, string(contents))
And finally, format the tokens from the iterator:
err := formatter.Format(w, style, iterator)
The HTML formatter
By default the html
registered formatter generates standalone HTML with
embedded CSS. More flexibility is available through the formatters/html
package.
Firstly, the output generated by the formatter can be customised with the following constructor options:
Standalone()
- generate standalone HTML with embedded CSS.WithClasses()
- use classes rather than inlined style attributes.ClassPrefix(prefix)
- prefix each generated CSS class.TabWidth(width)
- Set the rendered tab width, in characters.WithLineNumbers()
- Render line numbers (style withLineNumbers
).WithLinkableLineNumbers()
- Make the line numbers linkable and be a link to themselves.HighlightLines(ranges)
- Highlight lines in these ranges (style withLineHighlight
).LineNumbersInTable()
- Use a table for formatting line numbers and code, rather than spans.
If WithClasses()
is used, the corresponding CSS can be obtained from the formatter with:
formatter := html.New(html.WithClasses(true))
err := formatter.WriteCSS(w, style)
More detail
Lexers
See the Pygments documentation for details on implementing lexers. Most concepts apply directly to Chroma, but see existing lexer implementations for real examples.
In many cases lexers can be automatically converted directly from Pygments by
using the included Python 3 script pygments2chroma_xml.py
. I use something like
the following:
python3 _tools/pygments2chroma_xml.py \
pygments.lexers.jvm.KotlinLexer \
> lexers/embedded/kotlin.xml
See notes in pygments-lexers.txt for a list of lexers, and notes on some of the issues importing them.
Formatters
Chroma supports HTML output, as well as terminal output in 8 colour, 256 colour, and true-colour.
A noop
formatter is included that outputs the token text only, and a tokens
formatter outputs raw tokens. The latter is useful for debugging lexers.
Styles
Chroma styles are defined in XML. The style entries use the same syntax as Pygments.
All Pygments styles have been converted to Chroma using the _tools/style.py
script.
When you work with one of Chroma's styles,
know that the Background
token type provides the default style for tokens. It does so
by defining a foreground color and background color.
For example, this gives each token name not defined in the style a default color
of #f8f8f8
and uses #000000
for the highlighted code block's background:
<entry type="Background" style="#f8f8f2 bg:#000000"/>
Also, token types in a style file are hierarchical. For instance, when CommentSpecial
is not defined, Chroma uses the token style from Comment
. So when several comment tokens use the same color, you'll only need to define Comment
and override the one that has a different color.
For a quick overview of the available styles and how they look, check out the Chroma Style Gallery.
Command-line interface
A command-line interface to Chroma is included.
Binaries are available to install from the releases page.
The CLI can be used as a preprocessor to colorise output of less(1)
,
see documentation for the LESSOPEN
environment variable.
The --fail
flag can be used to suppress output and return with exit status
1 to facilitate falling back to some other preprocessor in case chroma
does not resolve a specific lexer to use for the given file. For example:
export LESSOPEN='| p() { chroma --fail "$1" || cat "$1"; }; p "%s"'
Replace cat
with your favourite fallback preprocessor.
When invoked as .lessfilter
, the --fail
flag is automatically turned
on under the hood for easy integration with lesspipe shipping with
Debian and derivatives;
for that setup the chroma
executable can be just symlinked to ~/.lessfilter
.
Testing lexers
If you edit some lexers and want to try it, open a shell in cmd/chromad
and run:
go run .
A Link will be printed. Open it in your Browser. Now you can test on the Playground with your local changes.
If you want to run the tests and the lexers, open a shell in the root directory and run:
go test ./lexers
When updating or adding a lexer, please add tests. See lexers/README.md for more.
What's missing compared to Pygments?
- Quite a few lexers, for various reasons (pull-requests welcome):
- Pygments lexers for complex languages often include custom code to handle certain aspects, such as Raku's ability to nest code inside regular expressions. These require time and effort to convert.
- I mostly only converted languages I had heard of, to reduce the porting cost.
- Some more esoteric features of Pygments are omitted for simplicity.
- Though the Chroma API supports content detection, very few languages support them. I have plans to implement a statistical analyser at some point, but not enough time.