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

feat(sites-29416)!: Add support for importing non-image assets #7

Merged
merged 18 commits into from
Feb 26, 2025

Conversation

ManasMaji
Copy link
Member

@ManasMaji ManasMaji commented Feb 26, 2025

Enhance the importer to also import non-image assets that are linked in the page : pdf | doc | excel | videos
SITES-29416

Motivation and Context

To allow users to import all type of assets to AEM for Crosswalk use case.

BREAKING CHANGE: The API getImageUrlsFromMarkdown has been renamed to getAssetUrlsFromMarkdown, to align more accurately to what it is doing.

@@ -10,9 +10,9 @@
* governing permissions and limitations under the License.
*/
import { createJcrPackage } from './package/packaging.js';
import { getImageUrlsFromMarkdown } from './package/image-mapping.js';
import { getAssetUrlsFromMarkdown } from './package/asset-mapping.js';
Copy link
Collaborator

Choose a reason for hiding this comment

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

requires a full version bump when releasing!

@@ -18,6 +18,9 @@ const imageRegex = /!\[([^\]]*)]\(([^) "]+)(?: *"([^"]*)")?\)|!\[([^\]]*)]\[([^\
// Regex for reference definitions
const referenceRegex = /\[([^\]]+)]:\s*(\S+)/g;

// Regex for non-image asset links (PDFs, docs, excel etc.)
const nonImageAssetRegex = /(?:\[(.*?)\]|\[.*?\])\(([^)]+\.(?:pdf|doc|docx|xls|xlsx|ppt|pptx|odt|ods|odp|rtf|txt|csv))\)|\[(.*?)\]:\s*(\S+\.(?:pdf|doc|docx|xls|xlsx|ppt|pptx|odt|ods|odp|rtf|txt|csv))/gi;
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need a unit test to validate that we are catching the different types of assets.

@ManasMaji ManasMaji changed the title feat: SITES-29416 [Xwalk] Add support for importing non-image assets feat(SITES-29416): Add support for importing non-image assets Feb 26, 2025
@ManasMaji ManasMaji changed the title feat(SITES-29416): Add support for importing non-image assets feat(sites-29416): Add support for importing non-image assets Feb 26, 2025
Base automatically changed from asset-folder-name to main February 26, 2025 15:34
@bhellema bhellema changed the title feat(sites-29416): Add support for importing non-image assets feat(sites-29416)!: Add support for importing non-image assets Feb 26, 2025
@ManasMaji ManasMaji merged commit ef4b444 into main Feb 26, 2025
4 checks passed
@ManasMaji ManasMaji deleted the other-assets branch February 26, 2025 16:09
github-actions bot pushed a commit that referenced this pull request Feb 26, 2025
# [2.0.0](v1.1.2...v2.0.0) (2025-02-26)

* feat(sites-29416)!: Add support for importing non-image assets ([#7](#7)) ([ef4b444](ef4b444))

### BREAKING CHANGES

* The API getImageUrlsFromMarkdown has been renamed to getAssetUrlsFromMarkdown, to align more accurately to what it is doing.

Co-authored-by: Ben Helleman <bhellema@adobe.com>
Copy link

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants