Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Ignore manifest.manifest_version option and warn about incorrect usage #1419

Merged
merged 2 commits into from
Feb 12, 2025

Conversation

aklinker1
Copy link
Collaborator

@aklinker1 aklinker1 commented Feb 12, 2025

Overview

manifest.manifest_version is not how you configure the target manifest version. This PR ignores the option if set (previously, it overwrote the target manifest_version, as described in the issue) and logs a warning telling you that it is configured wrong.

Manual Testing

See unit tests. No manual testing required.

Related Issue

This PR closes #1388.

Copy link

netlify bot commented Feb 12, 2025

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 2f445fe
🔍 Latest deploy log https://app.netlify.com/sites/creative-fairy-df92c4/deploys/67ac3e1a5dddfc000811cac0
😎 Deploy Preview https://deploy-preview-1419--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.

Copy link

pkg-pr-new bot commented Feb 12, 2025

Open in Stackblitz

@wxt-dev/auto-icons

npm i https://pkg.pr.new/@wxt-dev/auto-icons@1419

@wxt-dev/i18n

npm i https://pkg.pr.new/@wxt-dev/i18n@1419

@wxt-dev/module-react

npm i https://pkg.pr.new/@wxt-dev/module-react@1419

@wxt-dev/module-solid

npm i https://pkg.pr.new/@wxt-dev/module-solid@1419

@wxt-dev/module-vue

npm i https://pkg.pr.new/@wxt-dev/module-vue@1419

@wxt-dev/module-svelte

npm i https://pkg.pr.new/@wxt-dev/module-svelte@1419

@wxt-dev/storage

npm i https://pkg.pr.new/@wxt-dev/storage@1419

@wxt-dev/unocss

npm i https://pkg.pr.new/@wxt-dev/unocss@1419

wxt

npm i https://pkg.pr.new/wxt@1419

commit: 2f445fe

Comment on lines +1651 to +1676
describe('manifest_version', () => {
it('should ignore and log a warning when someone sets `manifest_version` inside the manifest', async () => {
const buildOutput = fakeBuildOutput();
const expectedVersion = 2;
setFakeWxt({
logger: mock(),
config: {
command: 'build',
manifestVersion: expectedVersion,
manifest: {
manifest_version: 3,
},
},
});

const { manifest } = await generateManifest([], buildOutput);

expect(manifest.manifest_version).toBe(expectedVersion);
expect(wxt.logger.warn).toBeCalledTimes(1);
expect(wxt.logger.warn).toBeCalledWith(
expect.stringContaining(
'`manifest.manifest_version` config was set, but ignored',
),
);
});
});
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This new test failed before I implemented the fix in this PR.

@aklinker1 aklinker1 marked this pull request as ready for review February 12, 2025 06:22
@aklinker1 aklinker1 requested a review from Timeraa as a code owner February 12, 2025 06:22
Copy link

codecov bot commented Feb 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.09%. Comparing base (fab9fa8) to head (2f445fe).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1419      +/-   ##
==========================================
- Coverage   81.40%   81.09%   -0.32%     
==========================================
  Files         128      128              
  Lines        6272     6278       +6     
  Branches     1068     1070       +2     
==========================================
- Hits         5106     5091      -15     
- Misses       1151     1172      +21     
  Partials       15       15              

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

@aklinker1 aklinker1 merged commit 30b8ba4 into main Feb 12, 2025
18 checks passed
@aklinker1 aklinker1 deleted the manifest_version-fix branch February 12, 2025 14:43
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.

[firefox] Outputted manifest is in v2 format despite manifest_version set to 3
1 participant