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: beta extension bundle #209

Merged
merged 3 commits into from
Oct 11, 2024
Merged

fix: beta extension bundle #209

merged 3 commits into from
Oct 11, 2024

Conversation

VanishMax
Copy link
Contributor

@VanishMax VanishMax commented Oct 11, 2024

Relates to penumbra-zone/web#1811

The extension relies on the .env file that sets the PRAX variable with the chrome extension ID. This ID is then used to correctly inject the provider to web pages. The build process didn't consider it, and the BETA extension injected the prod ID. The client package, in its turn, always checks the injected id matches chrome manifest to avoid security breaches, – it all means the BETA package didn't work completely.

This PR fixes the issue with BETA extension not being built correctly:

  • Separates webpack bundles into the prod and beta versions
  • Removes the .env files in favor of string replacements
  • Beta bundle produces the beta-dist directory
  • Beta bundle also modifies the manifest.json file to update favicons and info about the extension

@VanishMax VanishMax requested a review from a team October 11, 2024 08:04
@VanishMax VanishMax self-assigned this Oct 11, 2024
import path from 'node:path';
import config from './webpack.config.js';

dotenv.config({ path: '.env', override: true });
Copy link
Contributor

Choose a reason for hiding this comment

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

question: would it make it simpler if we didn't have an env file at all and just put the ids in the respective prod vs beta webpack configs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I like that! Removed the .env files in favor of string replacements

@VanishMax VanishMax merged commit 30d3dea into main Oct 11, 2024
3 checks passed
@VanishMax VanishMax deleted the fix/beta-bundle branch October 11, 2024 10:08
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.

2 participants