Skip to content

feat!: new template variable {{versionName}} and change of the behaviour of {{version}} - #1612

Merged
aklinker1 merged 35 commits into
wxt-dev:majorfrom
Tensai75:versionName
Jul 26, 2026
Merged

feat!: new template variable {{versionName}} and change of the behaviour of {{version}}#1612
aklinker1 merged 35 commits into
wxt-dev:majorfrom
Tensai75:versionName

Conversation

@Tensai75

@Tensai75 Tensai75 commented Apr 24, 2025

Copy link
Copy Markdown
Contributor

BREAKING CHANGE: change the behaviour of the template variable {{version}} for artifactTemplate and sourcesTemplate to use manifest.version and add the new template variable {{versionName}} which uses manifest.version_name or, if not available, manifest.version and takes over the previous behaviour of {{version}}

Overview

This PR is a continuation of PR #1604 and the associated discussion and introduces a breaking change to the behaviour of the template variable {{version}} for artifactTemplate and sourcesTemplate. Currently {{version}} uses the version_name from the manifest or, if not available, the version from the manifest. This is unituitive and it is therefore suggested to change the behaviour to only use the version from the manifest and introduce a new template variable {{versionsName}} to take over the previous behaviour of {{version}}:

  • {{version}} --> always uses manifest.version
  • {{versionsName}} --> uses manifest. version_name or fallback to manifest.version
  • {{packageVersion}} --> always uses the version from package.json (which is identical to manifest.version_name) [introduced with PR feat: add {{packageVersion}} as template variable #1604]

This gives the user more and consistent control over the version number used in the filename of generated zip files.

Manual Testing

  1. set the version in package.json to 1.0.0-beta.1
  2. without a custom artifactTemplate or sourcesTemplate in your wxt.config.ts, run wxt zip and wxt zip -b firefox
  3. the resulting zip files should have the following names (defaulting to {{name}}-{{version}}-{{browser}}.zip and {{name}}-{{version}}-sources.zip:
    extensionname-1.0.0-chrome.zip
    extensionname-1.0.0-firefox.zip
    extensionname-1.0.0-sources.zip
    
  4. add the following custom templates to your wxt.config.ts:
    zip: {
      artifactTemplate: "{{name}}-{{versionName}}-{{browser}}.zip",
      sourcesTemplate: "{{name}}-{{versionName}}-sources.zip",
    },
    
  5. run wxt zip and wxt zip -b firefox and the resulting zip files should have the following names:
    extensionname-1.0.0-beta.1-chrome.zip
    extensionname-1.0.0-firefox.zip
    extensionname-1.0.0-sources.zip
    
  6. change the custom templates in your wxt.config.ts to:
    zip: {
      artifactTemplate: "{{name}}-{{packageVersion}}-{{browser}}.zip",
      sourcesTemplate: "{{name}}-{{packageVersion}}-sources.zip",
    },
    
  7. run wxt zip and wxt zip -b firefox and the resulting zip files should have the following names:
    extensionname-1.0.0-beta.1-chrome.zip
    extensionname-1.0.0-beta.1-firefox.zip
    extensionname-1.0.0-beta.1-sources.zip
    

Related Issue

N/A
This breaking change was discussed in PR #1604

…viour of `{{version}}`

BREAKING CHANGE: change the behaviour of the template variable `{{version}}` for artifactTemplate and sourcesTemplate to use `manifest.version` and add the new template variable `{{versionName}}` which uses `manifest.version_name` or, if not available, `manifest.version` and takes over the previous behaviour of `{{version}}`
@netlify

netlify Bot commented Apr 24, 2025

Copy link
Copy Markdown

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 3e9ced4
🔍 Latest deploy log https://app.netlify.com/sites/creative-fairy-df92c4/deploys/680a9ce5bcaf8d0008ac70c2
😎 Deploy Preview https://deploy-preview-1612--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@aklinker1 aklinker1 changed the title feat!: new template variable {{versionName}} and change of the … feat!: new template variable {{versionName}} and change of the behaviour of {{version}} Sep 3, 2025
@aklinker1
aklinker1 changed the base branch from main to major September 3, 2025 13:45
aklinker1
aklinker1 previously approved these changes Sep 3, 2025

@aklinker1 aklinker1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the base to be merged into the next major branch. Not sure when I'll do another major release.

@codecov

codecov Bot commented Sep 3, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.26%. Comparing base (1f95c6c) to head (08631c9).
⚠️ Report is 2 commits behind head on major.

Additional details and impacted files
@@            Coverage Diff             @@
##            major    #1612      +/-   ##
==========================================
- Coverage   79.48%   79.26%   -0.22%     
==========================================
  Files         132      131       -1     
  Lines        3982     3970      -12     
  Branches      908      905       -3     
==========================================
- Hits         3165     3147      -18     
- Misses        728      731       +3     
- Partials       89       92       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aklinker1

aklinker1 commented Sep 3, 2025

Copy link
Copy Markdown
Member

Wait, I still want the default behavior to be the same. So we should update the default templates to use {{versionName}}, right?

PatrykKuniczak and others added 17 commits February 21, 2026 12:40
…` option (wxt-dev#2142)

Co-authored-by: nickbar01234 <nickbar01234gmail.com>
Co-authored-by: Aaron <aaronklinker1@gmail.com>
Co-authored-by: Smit <sm17p@users.noreply.github.com>
Co-authored-by: Florian Metz <me@timeraa.dev>
Co-authored-by: Aaron <aaronklinker1@gmail.com>
@PatrykKuniczak

Copy link
Copy Markdown
Collaborator

@aklinker1 It's possible to be merged into major or you're waiting to merge it immediately after major release on main?

@aklinker1

Copy link
Copy Markdown
Member

Wait, I still want the default behavior to be the same. So we should update the default templates to use {{versionName}}, right?

I had to review previous conversations, but this PR is correct. Merging.

@aklinker1

Copy link
Copy Markdown
Member

Looks like I've got some checks failing on the major branch. Will have to resolve those first.

# Conflicts:
#	.github/workflows/auto-label.yml
#	.github/workflows/vhs.yml
#	MAINTAINERS.md
#	docs/.vitepress/config.ts
#	docs/assets/init-demo.gif
#	docs/guide/essentials/wxt-modules.md
#	docs/guide/resources/upgrading.md
#	packages/analytics/CHANGELOG.md
#	packages/analytics/modules/analytics/client.ts
#	packages/analytics/modules/analytics/types.ts
#	packages/analytics/package.json
#	packages/auto-icons/package.json
#	packages/auto-icons/src/__test__/index.test.ts
#	packages/i18n/CHANGELOG.md
#	packages/i18n/package.json
#	packages/is-background/package.json
#	packages/is-background/src/index.ts
#	packages/wxt/e2e/tests/modules.test.ts
#	packages/wxt/e2e/tests/runners.test.ts
#	packages/wxt/e2e/tests/typescript-project.test.ts
#	packages/wxt/e2e/utils.ts
#	packages/wxt/package.json
#	packages/wxt/src/browser.ts
#	packages/wxt/src/core/builders/vite/index.ts
#	packages/wxt/src/core/builders/vite/plugins/removeEntrypointMainFunction.ts
#	packages/wxt/src/core/create-server.ts
#	packages/wxt/src/core/generate-wxt-dir.ts
#	packages/wxt/src/core/resolve-config.ts
#	packages/wxt/src/core/utils/building/find-entrypoints.ts
#	packages/wxt/src/core/utils/testing/fake-objects.ts
#	packages/wxt/src/types.ts
#	pnpm-lock.yaml
#	templates/react/package.json
#	templates/solid/package.json
#	templates/svelte/package.json
#	templates/vanilla/package.json
#	templates/vue/package.json
@aklinker1

Copy link
Copy Markdown
Member

Sorry for the delay on this, I put it off until right before the next version will be released. Merging once checks pass.

@aklinker1
aklinker1 merged commit 3f2f3b7 into wxt-dev:major Jul 26, 2026
12 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for helping make WXT better!

aklinker1 added a commit that referenced this pull request Jul 26, 2026
…viour of `{{version}}` (#1612)

Co-authored-by: Aaron <aaronklinker1@gmail.com>
aklinker1 added a commit that referenced this pull request Jul 26, 2026
…viour of `{{version}}` (#1612)

Co-authored-by: Aaron <aaronklinker1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants