javascript
javascript copied to clipboard
Add missing, but required, dependencies
Summary
Added two missing dependencies that are required but not included: @yoast/feature-flag to components, wicked-good-xpath to helpers.
-
Package(s) involved: -components -helpers
-
Should the change be included in the package changelog?
- [ ] No
- [ ] Yes
-
Should the change be included in one or more plugin changelogs?
- [x] No
- [ ] Free
- [ ] Premium
- [ ] Other (please specify)
-
Package changelog item (if applicable):
-
Plugin changelog item (if applicable):
Test instructions
This PR can be tested by following these steps:
- The original issue was the following when using the monorepo in myyoast:
Error in ./~/@yoast/components/KeywordSuggestions.js
Module not found: '@yoast/feature-flag' in /Users/dieterschalk/Code/Yoast/my-yoast/client/node_modules/@yoast/components
@ ./~/@yoast/components/KeywordSuggestions.js 21:19-49
Error in ./~/@yoast/components/~/@yoast/helpers/getFeed.js
Module not found: 'wicked-good-xpath' in /Users/dieterschalk/Code/Yoast/my-yoast/client/node_modules/@yoast/components/node_modules/@yoast/helpers
@ ./~/@yoast/components/~/@yoast/helpers/getFeed.js 10:23-51
Technically this could be reproduced but it's very specific. In wordpress-seo the error did not appear because it already included the packages itself. The issue can be tested by testing the local components app and make sure everything stays the same. Also make sure there are no build errors. If the changelog entry is included it will also go through the regular testing procedure for release.
Quality assurance
- [x] I have tested this code to the best of my abilities
- [ ] I have added unittests to verify the code works as intended
Fixes #
Adding @yoast/feature-flag to @yoast/components breaks the tests. It seems babel related. This is an example of the errors:
@yoast/components: FAIL tests/IconLabelledButtonTest.js
@yoast/components: ● Test suite failed to run
@yoast/components: /Users/dieter/Yoast/javascript/packages/components/node_modules/@yoast/feature-flag/index.js:53
@yoast/components: export {
@yoast/components: ^^^^^^
@yoast/components:
@yoast/components: SyntaxError: Unexpected token export
@yoast/components: 19 | * @returns {JSX.Element} The translated text including rendered link components.
@yoast/components: 20 | */
@yoast/components: > 21 | const getKeywordResearchArticleLink = () => {
@yoast/components: 22 | const keywordsResearchLinkTranslation = sprintf(
@yoast/components: 23 | __(
@yoast/components: 24 | "Read our %1$sultimate guide to keyword research%2$s to learn " +
@yoast/components:
@yoast/components: at ScriptTransformer._transformAndBuildScript (../../node_modules/jest-runtime/build/script_transformer.js:316:17)
@yoast/components: at Object.<anonymous> (src/KeywordSuggestions.js:21:20)
@yoast/components: FAIL tests/CollapsibleTest.js