feat!: new template variable `{{versionName}}` and change of the behaviour 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}}
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 usesmanifest.version{{versionsName}}--> usesmanifest. version_nameor fallback tomanifest.version{{packageVersion}}--> always uses the version from package.json (which is identical tomanifest.version_name) [introduced with PR #1604]
This gives the user more and consistent control over the version number used in the filename of generated zip files.
Manual Testing
- set the version in
package.jsonto1.0.0-beta.1 - without a custom artifactTemplate or sourcesTemplate in your
wxt.config.ts, runwxt zipandwxt zip -b firefox - the resulting zip files should have the following names (defaulting to
{{name}}-{{version}}-{{browser}}.zipand{{name}}-{{version}}-sources.zip:extensionname-1.0.0-chrome.zip extensionname-1.0.0-firefox.zip extensionname-1.0.0-sources.zip - add the following custom templates to your
wxt.config.ts:zip: { artifactTemplate: "{{name}}-{{versionName}}-{{browser}}.zip", sourcesTemplate: "{{name}}-{{versionName}}-sources.zip", }, - run
wxt zipandwxt zip -b firefoxand 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 - change the custom templates in your
wxt.config.tsto:zip: { artifactTemplate: "{{name}}-{{packageVersion}}-{{browser}}.zip", sourcesTemplate: "{{name}}-{{packageVersion}}-sources.zip", }, - run
wxt zipandwxt zip -b firefoxand 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
Deploy Preview for creative-fairy-df92c4 ready!
| Name | Link |
|---|---|
| Latest commit | 3e9ced47b60e65187ffac72d4b3aa945cd533138 |
| 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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 80.88%. Comparing base (bb63004) to head (87d9f79).
Additional details and impacted files
@@ Coverage Diff @@
## major #1612 +/- ##
==========================================
- Coverage 80.98% 80.88% -0.11%
==========================================
Files 131 131
Lines 6679 6680 +1
Branches 1094 1092 -2
==========================================
- Hits 5409 5403 -6
- Misses 1259 1266 +7
Partials 11 11
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Wait, I still want the default behavior to be the same. So we should update the default templates to use {{versionName}}, right?