-
Notifications
You must be signed in to change notification settings - Fork 843
Move over @automattic/social-previews package from Calypso with git history
#46313
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
Move over @automattic/social-previews package from Calypso with git history
#46313
Conversation
* fix(deps): update babel monorepo * Dedupe @babel scope Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Sergio Cinos <[email protected]>
) * Move Domain to the top of the preview * Fix linter complaint * Ensure text content stays within body boundaries * Add ellipsis to long domains * Ensure title wraps for very long words * Remove box shadow around preview area * Change description color * Update title font size and line height * Update text font family * Update URL & description font size and line height * Article: Clamp description after one line * Add background and border * Update border of image placeholder * Update background color of image placeholder * Apply border to preview image and placeholder alike
* Truncate description for improved a11y * Visually clamp description after two lines * Increase border radius * Combine shared styles * Visually clamp description after three lines for small summary preview * Update tests to reflect changes
* Social Previews: fix twitter social preview overflow * Social Previews: version bump * Social Previews: add max-width to preview-area Co-authored-by: cpap <[email protected]>
#45613 * Enables linting inside markdown blocks tagged as `js` or `javascript` * Disables some code style rules inside markdown code blocks to allow simpler examples * Apply automatic eslint fixes for JS blocks in markdown files * Manually fix code broken by eslint autofixer #45639 * Enable remark rule 'no-literal-urls' and fix existing violations of this rule #45644 * Enable remark rule 'heading-increments' and fix existing violations of this rule #45645 * Enable remark rule 'no-heading-punctuation' and fix existing violations of this rule * Adds capacity to disable rules using comments Co-authored-by: Sara Marcondes <[email protected]>
* Disable some lint rules for codeblocks in markdown files * [markdown] Fix lint errors in `apps/notifications` (#45803) * [markdown] Fix lint errors in `client` (#45804) * [markdown] Fix lint errors in `packages/babel-plugin-transform-wpcalypso-async` (#45805) * [markdown] Fix lint errors in `packages/calypso-color-schemes` (#45807) * [markdown] Fix lint errors in `packages/calypso-polyfills` (#45808) * [markdown] Fix lint errors in `packages/components` (#45809) * [markdown] Fix lint errors in `packages/data-stores` (#45810) * [markdown] Fix lint errors in `packages/eslint-plugin-wpcalypso` (#45811) * [markdown] Fix lint errors in `packages/i18n-calypso` (#45812) * [markdown] Fix lint errors in `packages/i18n-calypso-cli` (#45813) * [markdown] Fix lint errors in `packages/material-design-icons` (#45814) * [markdown] Fix lint errors in `packages/media-library` (#45815) * [markdown] Fix lint errors in `packages/photon` (#45816) * [markdown] Fix lint errors in `packages/popup-monitor` (#45817) * [markdown] Fix lint errors in `packages/react-i18n` (#45818) * [markdown] Fix lint errors in `packages/request-external-access` (#45819) * [markdown] Fix lint errors in `packages/social-previews` (#45820) * [markdown] Fix lint errors in `packages/viewport` (#45821) * [markdown] Fix lint errors in `packages/viewport-react` (#45822) * [markdown] Fix lint errors in `packages/webpack-extensive-lodash-replacement-plugin` (#45823) * [markdown] Fix lint errors in `packages/webpack-inline-constant-exports-plugin` (#45824) * [markdown] Fix lint errors in `packages/wpcom.js` (#45825) * [markdown] Fix lint errors in `packages/wpcom-proxy-request` (#45826) * [markdown] Fix lint errors in `packages/calypso-build` (#45806)
…es (#45953) * Ebables rule `import/no-extraneous-dependencies` for all packages * Configure exceptions for import/no-extraneous-dependencies * Adds missing dependencies
* Re-introduce calypso:main * Adds missing resolver to jest config * Change composite-checkout's webpack config to support calypso:src * Bundle packages in the monorepo to * Simplify resolver * Delete redundant packagesInMonorepo
* Re-introduce calypso:main * Bundle packages in the monorepo to * Create a preset for jest * Use the new jest-preset also for packages/shopping-cart * Fix bad merge Co-authored-by: Jarda Snajdr <[email protected]>
* fix(deps): update babel monorepo * Force `evergreen` to include browsers that don't support optional chaining to avoid problems with webpack 4 * Drop direct import of @storybook/preset-typescript Co-authored-by: Sergio Cinos <[email protected]>
* Deduplicate eslint-plugin-react-hooks (#48861) * Deduplicate eslint-scope (#48862) * Fix dependencies of eslint-plugin-wpcalypso (#48858) * Add devDependency to eslint * Update yarn.lock * Deduplicate es-abstract (#48860) * Deduplicate es-abstract * Deduplicate es-abstract * Clean up yarn.lock * Adds missing dependencies (#48916) * Update lodash to 4.17.20 (#48908) * Update lodash to 4.17.20 * Update yarn.lock * Update chromedrvier to 87.0.5 (#48905)
* fix(deps): update wordpress monorepo * Use new colors * Tests: update names of internal data control types * Tests: fix selector resolution tests by waiting for one more state update * Fix SftpCard tests by mocking window.matchMedia * Type with hooks * Fix Editing Toolkit build * Remove types/wordpress packages * Fix incorrect usage of i18n context in Gutenboarding * Use original colors where the color modifications were too disruptive * Restore __experimentalMainDashboardButton in expermental features e2e tests * FSE: add type definitions for @wordpress/edit-post module * Final yarn.lock update * e2e: remove test for edit-site as we're testing on edit-post page * Gutenboarding: use granular selectors from onboarding store * Disable the Gutenboarding e2e test Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Sergio Cinos <[email protected]> Co-authored-by: Jon Surrell <[email protected]> Co-authored-by: Marko Andrijasevic <[email protected]>
* Update to webpack 5 * Clean up yarn.lock changes * ExternalModulesWriter: descend into concatenated modules when searching for externals Co-authored-by: Jarda Snajdr <[email protected]>
…encies (#50516) * Add missing dev dependencies * Add missing newline
* chore(deps): update dependency webpack to ^5.24.4 Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Sergio Cinos <[email protected]>
* fix(deps): update lodash monorepo to ^4.17.21 Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Sergio Cinos <[email protected]>
* fix(deps): update babel monorepo * Deduplicate packages Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Sergio Cinos <[email protected]>
* fix(deps): update wordpress monorepo * Fix test environment for window origin * Fix eslint config * Fix lint error related to _blank + rel * Add dependency on jest-environment-jsdom * Add COMPONENT_SYSTEM_PHASE to reduce bundle size * Update wp-env to v4 * Bust GH actions cache Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: sarayourfriend <[email protected]> Co-authored-by: Sergio Cinos <[email protected]>
…fication (#51295) * Move css minification from WebpackRTLPlugin to calypso-build * Prepare release of @automattic/webpack-rtl-plugin * Prepare release of @automattic/calypso-build 8.0.0
…CSS minification (#51295)" (#51449) This reverts commit ec4fac8.
* Bring back "build: Simplify WebpackRTLPlugin, use CssMinimizerPlugin for CSS minification (#51295)" This reverts commit 8c7191e. * Add rtl files to the chunk tree so they can be picked by assets-writer
* chore(deps): update dependency webpack to ^5.30.0 * Update snapshots Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Sergio Cinos <[email protected]>
Ensures that the "Social Previews" feature wraps text properly for Twitter
Co-authored-by: Renovate Bot <[email protected]>
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
|
Since we want to do a regular git merge here, instead of a squash merge, I wonder if I should squash my commits I added after the git migration. 🤔 Or should I extract those extra changes to a new branch based off of this one and then merge that in a single commit? |
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.
Pull request overview
This PR migrates the @automattic/social-previews package from Calypso to the Jetpack monorepo with preserved git history. The package provides React components for previewing social media posts across various platforms (Facebook, Twitter, LinkedIn, Instagram, Mastodon, Nextdoor, Threads, Tumblr, Bluesky, and Google Search).
Key Changes
- Updated dependency reference from external npm package to workspace package
- Added build configuration (tsup, TypeScript, Jest) for monorepo integration
- Migrated comprehensive test suite with 657 test cases
- Preserved complete source code including helpers, types, and platform-specific preview components
Reviewed changes
Copilot reviewed 160 out of 162 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
projects/plugins/jetpack/package.json |
Updated dependency from external npm to workspace package |
projects/plugins/jetpack/changelog/add-social-previews-package |
Added changelog entry for the migration |
projects/js-packages/social-previews/tsup.config.ts |
Build configuration using tsup with SASS support |
projects/js-packages/social-previews/tsconfig.json |
TypeScript configuration extending jetpack-js-tools |
projects/js-packages/social-previews/tests/jest.config.cjs |
Jest test configuration with jsdom environment |
projects/js-packages/social-previews/tests/*.test.tsx |
Comprehensive test suite for preview components |
projects/js-packages/social-previews/src/** |
Complete source code with platform-specific implementations |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Coverage Summary107 files are newly checked for coverage. Only the first 5 are listed here.
Full summary · PHP report · JS report Coverage check overridden by
I don't care about code coverage for this PR
|
3fabd29 to
17360ae
Compare
|
OK, I have extracted all the changes I made here into a separate PR (#46315) to make it easier to review. Let us merge that PR into this one as a single commit and then merge this one without squashing the commits. |
|
Marking as "DO NOT MERGE" just to help everyone remember we can't merge it until disabling the requirement for squash merges. |
|
History looks to be imported correctly. 👍 |
* Update package metadata in package.json * Update git config * Use tsup for bundling * Use stable as current version and update changelogs * Update consumer workspaces to use the workspace version * pnpm reformat-files * Format style files * Use module import syntax for SCSS * Create composer.json * Update README.md * Fix lints * Fix tests * Migrate tests to TS * Improve and re-use baseDomain * Use tsconfig.base.json * Update changelog to fix version headings * Fix CodeQL warnings * Fix lints * Fix doc block comments * Apply suggestions from @anomiex Co-authored-by: Brad Jorsch <[email protected]> * Move react and react-dom to dev and peer dependencies * Apply suggestions from @anomiex * Update README to remove unnecessary prerequisites --------- Co-authored-by: Brad Jorsch <[email protected]>
anomiex
left a comment
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.
LGTM. Reminder that this should be done as a merge commit, not the normal squash.
An alternative to #46302 with preservation of git history
Social Previews package is used more in Jetpack than in Calypso - See pdWQjU-1uF-p2
Closes SOCIAL-268
Proposed changes:
@automattic/social-previewspackage from Calypso with git historyOther information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions: