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
Added possibility to allow trusted vendors to change code outside their namespace (#3156) #3266
Conversation
|
@0m3r I like the direction where this is going. I am a little bit afraid that having this part of the .env makes a bit harder than necessary to administer though. Ideally the decision to add a vendor as trusted is done on a per project basis rather than on a per environment basis. It could lead to hard to track down issues once you end up with a list longer than a few vendors. Ideally this configuration could live in a file that is part of the checked in code for the project. packages.json might a good fit as part of this:
to
|
Hi @0m3r. I totally agree with @fooman from my point of view this would be very nice if we can do this via kind regards, Lars |
what about core team opinion? |
@supernova-at agreed with me on this yesterday would be cool if you can do it |
@larsroettig, @supernova-at review this commit e29c51e, please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @0m3r,
The code looks good pls. Add test coverage, fix the two failing test cases and run yarn run prettier.
packages/peregrine/lib/targets/__tests__/peregrine-targets.spec.js
packages/venia-ui/lib/targets/__tests__/venia-ui-targets.spec.js
Thank you in advance. Also, I recommend joining as Slack then we answer questions mutch faster
Can I fix test fails in "my" code? something like below const fs = require('fs');
...
const context = path.resolve(__dirname, '../../../../../');
const configPath = path.resolve(context, 'package.json');
try {
if (fs.existsSync(configPath)) {
const config = require(configPath)['pwa-studio'];
return config && config['trusted_vendors'] ? config['trusted_vendors'] : [];
//file exists
}
} catch(err) {
// console.error(err)
}
return []; |
Hi @jimbo. kind regards., Lars |
One think about Extension
Should be prevented in every case a Verification Steps
@jimbo if we accept this from the core team we should ask also for adding test case to https://github.com/larsroettig/pwa-studio/blob/e5d4c42855627c4365fb3313f52837945a30aeb4/packages/pwa-buildpack/lib/WebpackTools/__tests__/MagentoResolver.spec.js |
I think it's great. We can certainly do more to expose components + API, as we do for talons, but this is a great way to relieve people's pain while we figure out those details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@0m3r Add support for monorepo and I think @larsroettig was also requesting test coverage if possible. Otherwise this looks perfect, nice work 👍
packages/pwa-buildpack/lib/WebpackTools/ModuleTransformConfig.js
Outdated
Show resolved
Hide resolved
packages/pwa-buildpack/lib/WebpackTools/ModuleTransformConfig.js
Outdated
Show resolved
Hide resolved
about tests I did not find ModuleTransformConfig.spec.js |
@0m3r Existing code appears to be tested by integration tests in other packages, there is no unit test. Instead of building all that out in this scope, I've created a manual test that we'll run during regression and aim to automate if it becomes a priority. Thank you for the contribution. ✅ QA Passed |
Gives the possibility to add trusted vendors in package.json
and add custom checking into the file: packages/pwa-buildpack/lib/WebpackTools/ModuleTransformConfig.js _assertAllowedToTransform
Description
Added possibility to allow trusted vendors to change code outside their namespace
Related Issue
Closes #3156.
Acceptance
@sirugh
@zetlen
Verification Stakeholders
@jerschipper
@Jordaneisenburger
Verification Steps
in your project root package.json
in your extension intercept.js ('@vendor/extension/lib/intercept.js')