chore: update wxt and fix dev config#878
Conversation
Deploying asbplayer with
|
| Latest commit: |
1f64ad5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f482e81a.asbplayer.pages.dev |
| Branch Preview URL: | https://chore-update-wxt-and-fix-dev.asbplayer.pages.dev |
killergerbah
left a comment
There was a problem hiding this comment.
Thanks, yea this will be useful. I've probably wasted a lot of time uninstalling the dev version so I could install the prod version and vice versa.
extension/wxt.config.ts
Outdated
| manifest: ({ browser, mode }) => { | ||
| const version = '1.14.0'; | ||
| const isDev = mode === 'development'; | ||
| const name = `${extName}${isDev ? ' (Dev)' : ''}: Language-learning with subtitles`; |
There was a problem hiding this comment.
Extract this part into variable?
isDev ? ' (Dev)' : ''
IMO that would be more readable
extension/wxt.config.ts
Outdated
| version: '1.14.0', | ||
| action: { default_title: 'asbplayer' }, | ||
| version, | ||
| action: { default_title: `${extName}${isDev ? ' (Dev)' : ''}` }, |
There was a problem hiding this comment.
Can use that variable here too
extension/wxt.config.ts
Outdated
| update_url: 'https://killergerbah.github.io/asbplayer/firefox-extension-updates.json', | ||
| id: geckoId, | ||
| ...(isDev | ||
| ? {} |
There was a problem hiding this comment.
In general wondering if we can group these isDev branches together. Since we have geckoId assigned using isDev ternary expression, and update_url is also assigned using isDev ternary expression, just in a different place. In case it's possible to make things more readable without a lot of effort.
There was a problem hiding this comment.
yeah I think I have something that's a bit cleaner now, though with the nested conditionals it's still not perfect
The dev and production versions were conflicting in weird ways which basically forced you to uninstall the production one before loading in the dev one. This allows them to be installed side by side (though you probably should only enable one at a time), and adds a Dev label to easily tell them apart. Chrome doesn't need an explicit key in dev mode since it seems to make a stable one based on the path name.
Added bonus is I found out about artifactTemplate and sourcesTemplate to override the default zip names that were pulling from the package.json before (i.e. projectextension).