From 7ee63b6f57029691d88ded10c9a5ec25747bec18 Mon Sep 17 00:00:00 2001 From: Antonio Ribeiro Date: Mon, 6 Jan 2025 10:46:59 +0100 Subject: [PATCH] Make BrowserShot Optional in SitemapGenerator (#558) * Remove the crawler dependencies and make them optional * Add to the docs and remove the symphony suggestion * Add spatie/crawler to require-dev * Improve docs --------- Co-authored-by: Antonio Ribeiro --- README.md | 6 ++++++ composer.json | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b83191e..43fc765 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,12 @@ composer require spatie/laravel-sitemap The package will automatically register itself. +If you intend to use the crawler to generate your sitemap using `SitemapGenerator::create(...)`, you also need to install the [Spatie's Crawler](https://github.com/spatie/crawler) package: + +``` bash +composer require spatie/crawler +``` + If you want to update your sitemap automatically and frequently you need to perform [some extra steps](https://github.com/spatie/laravel-sitemap#generating-the-sitemap-frequently). ## Configuration diff --git a/composer.json b/composer.json index 983bf15..a3edb3b 100644 --- a/composer.json +++ b/composer.json @@ -20,14 +20,13 @@ "guzzlehttp/guzzle": "^7.8", "illuminate/support": "^10.0|^11.0", "nesbot/carbon": "^2.71|^3.0", - "spatie/crawler": "^8.0.1", - "spatie/laravel-package-tools": "^1.16.1", - "symfony/dom-crawler": "^6.3.4|^7.0" + "spatie/laravel-package-tools": "^1.16.1" }, "require-dev": { "mockery/mockery": "^1.6.6", "orchestra/testbench": "^8.14|^9.0", "pestphp/pest": "^2.24", + "spatie/crawler": "^8.4", "spatie/pest-plugin-snapshots": "^2.1", "spatie/phpunit-snapshot-assertions": "^5.1.2", "spatie/temporary-directory": "^2.2" @@ -45,6 +44,9 @@ ] } }, + "suggest": { + "spatie/crawler": "Required to use the crawler feature" + }, "autoload": { "psr-4": { "Spatie\\Sitemap\\": "src"