diff --git a/.github/workflows/pint-fix.yaml b/.github/workflows/pint-fix.yml similarity index 100% rename from .github/workflows/pint-fix.yaml rename to .github/workflows/pint-fix.yml diff --git a/.github/workflows/pint-lint.yaml b/.github/workflows/pint-lint.yml similarity index 100% rename from .github/workflows/pint-lint.yaml rename to .github/workflows/pint-lint.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5ca9810 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,60 @@ +name: Release + +on: + push: + tags: + - "v*" + +jobs: + release: + name: Prepare & Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v1 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick + tools: composer:v2 + + - name: Install NPM Dependencies + run: npm install + + - name: Install Composer Dependencies + run: composer install + + - name: Compile assets + run: npm run build + + - name: Create zip + run: tar -czvf dist.tar.gz dist + + - name: Get Changelog + id: changelog + uses: statamic/changelog-action@v1 + with: + version: ${{ github.ref }} + + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body: ${{ steps.changelog.outputs.text }} + prerelease: ${{ contains(github.ref, '-beta') }} + + - name: Upload zip to release + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./dist.tar.gz + asset_name: dist.tar.gz + asset_content_type: application/tar+gz diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yml similarity index 100% rename from .github/workflows/tests.yaml rename to .github/workflows/tests.yml diff --git a/.gitignore b/.gitignore index 336a005..50c5063 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ vendor mix-manifest.json .idea composer.lock +resources/dist +.env diff --git a/.phpunit.result.cache b/.phpunit.result.cache index bc7c445..b566487 100644 --- a/.phpunit.result.cache +++ b/.phpunit.result.cache @@ -1 +1 @@ -{"version":1,"defects":{"Statamic\\Importer\\Tests\\ImporterTest::it_can_import_a_csv_file":7,"Statamic\\Importer\\Tests\\ImporterTest::imports_date_fields":2,"Statamic\\Importer\\Tests\\ImporterTest::imports_bard_fields_from_html":8,"Statamic\\Importer\\Tests\\ImporterTest::imports_bard_fields_from_gutenberg":7,"Statamic\\Importer\\Tests\\ImporterTest::imports_slug_fields":2,"Statamic\\Importer\\Tests\\ImporterTest::imports_term_fields":2,"Statamic\\Importer\\Tests\\ImporterTest::imports_user_fields":2,"Statamic\\Importer\\Tests\\ImporterTest::it_can_import_from_xml_files":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_paragraphs":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_text":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_lists":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_quotes":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_html":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_videos_from_youtube":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_other_videos":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_code_blocks":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_video_block":2,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_button_blocks":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_detail_blocks":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_spacer_blocks":7,"Statamic\\Importer\\Tests\\ImporterTest::it_can_import_from_csv_files":7,"Statamic\\Importer\\Tests\\ImporterTest::imports_user_fields_from_wordpress_export":2,"Statamic\\Importer\\Tests\\ImporterTest::imports_assets_field_by_url_where_asset_does_not_exist":7,"Statamic\\Importer\\Tests\\ImporterTest::imports_assets_field_by_path":8,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_image_blocks":8,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_video_block":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_gallery_blocks":7,"Statamic\\Importer\\Tests\\Transformers\\AssetsTransformerTest::imports_assets_field_by_url_and_downloads_assets_that_dont_exist_in_asset_container":7,"Statamic\\Importer\\Tests\\Transformers\\DateTransformerTest::it_parses_date":2,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_parses_date":2,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_parses_date":2,"Statamic\\Importer\\Tests\\Transformers\\BardTransformerTest::it_enables_bard_buttons":7,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_imports_a_new_entry":8,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_updates_an_existing_entry":8,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_spacer_blocks":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_embed_block_with_video_from_youtube":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_code_blocks":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_detail_blocks":7,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_returns_entry_ids":7,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_finds_existing_entries_by_title":7,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_create_new_entries_using_title":7,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_finds_existing_terms_by_title":7,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_create_new_entries_using_title":8,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_finds_existing_entries_by_slug":7,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_create_new_entries_using_slug":8,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_finds_existing_users_by_name":8,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_finds_existing_entries_by_custom_field":8,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_doesnt_create_new_entries_when_create_when_missing_option_is_disabled":7,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_doesnt_create_new_terms_when_create_when_missing_option_is_disabled":7,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_create_new_terms":7,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_doesnt_create_new_users_using_email_when_create_when_missing_option_is_disabled":7,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_returns_user_ids":8,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_finds_existing_users_by_email":8,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_create_new_users_using_email":8,"Statamic\\Importer\\Tests\\Transformers\\DateTransformerTest::it_transforms_dates":7,"Statamic\\Importer\\Tests\\Transformers\\DateTransformerTest::it_transforms_dates_with_time_enabled":7,"Statamic\\Importer\\Tests\\Transformers\\DateTransformerTest::it_transforms_dates_with_time_seconds_enabled":7,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_imports_a_new_user":7,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_updates_an_existing_user":7,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_imports_a_new_term":7,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_updates_an_existing_term":2,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_text":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_list_blocks":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_quotes_blocks":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_image_blocks":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_image_blocks_and_downloads_images_that_dont_exist_in_asset_container":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_gallery_blocks":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_html_block":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_video_block":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_button_blocks":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_separator_blocks":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::returns_output_of_hook":7},"times":{"Statamic\\Importer\\Tests\\ImporterTest::it_can_import_a_csv_file":0.055,"Statamic\\Importer\\Tests\\ImporterTest::imports_date_fields":0.001,"Statamic\\Importer\\Tests\\ImporterTest::imports_bard_fields_from_html":0.009,"Statamic\\Importer\\Tests\\ImporterTest::imports_bard_fields_from_gutenberg":0.027,"Statamic\\Importer\\Tests\\ImporterTest::imports_slug_fields":0.001,"Statamic\\Importer\\Tests\\ImporterTest::imports_term_fields":0.001,"Statamic\\Importer\\Tests\\ImporterTest::imports_user_fields":0.001,"Statamic\\Importer\\Tests\\ImporterTest::it_can_import_from_xml_files":0.012,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_paragraphs":0.013,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_text":0.007,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_lists":0.014,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_quotes":0.013,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_html":0.011,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_videos_from_youtube":0.012,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_other_videos":0.047,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_code_blocks":0.002,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_lists_block":0.001,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_quotes_block":0.001,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_html_block":0.002,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_video_block":0.004,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_video_block_with_video_from_youtube":0.002,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_button_blocks":0.01,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_detail_blocks":0.002,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_separator_blocks":0.001,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_spacer_blocks":0.002,"Statamic\\Importer\\Tests\\ImporterTest::it_can_import_from_csv_files":0.044,"Statamic\\Importer\\Tests\\ImporterTest::imports_user_fields_from_wordpress_export":0.001,"Statamic\\Importer\\Tests\\ImporterTest::imports_assets_field_by_url_where_asset_does_not_exist":0.027,"Statamic\\Importer\\Tests\\ImporterTest::imports_assets_field_by_url":0.008,"Statamic\\Importer\\Tests\\ImporterTest::imports_assets_field_by_path":0.008,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_image_blocks":0.042,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_image_blocks_when_asset_does_not_exist":0.051,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_text":0.013,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_list_blocks":0.001,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_quotes_blocks":0.001,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_image_blocks":0.032,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_image_blocks_and_downloads_images_that_dont_exist_in_asset_container":0.022,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_html_block":0.002,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_video_block":0.002,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_video_block_with_video_from_youtube":0.002,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_code_blocks":0.002,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_button_blocks":0.003,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_detail_blocks":0.002,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_separator_blocks":0.001,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_spacer_blocks":0.002,"Statamic\\Importer\\Tests\\ImporterTest::imports_assets_field_by_url_and_downloads_assets_that_dont_exist_in_asset_container":0.008,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_gallery_blocks":0.006,"Statamic\\Importer\\Tests\\Transformers\\AssetsTransformerTest::imports_assets_field_by_url":0.03,"Statamic\\Importer\\Tests\\Transformers\\AssetsTransformerTest::imports_assets_field_by_url_and_downloads_assets_that_dont_exist_in_asset_container":0.034,"Statamic\\Importer\\Tests\\Transformers\\AssetsTransformerTest::imports_assets_field_by_path":0.032,"Statamic\\Importer\\Tests\\Transformers\\AssetsTransformerTest::it_finds_existing_asset_using_url":0.008,"Statamic\\Importer\\Tests\\Transformers\\AssetsTransformerTest::it_downloads_new_asset_using_url":0.021,"Statamic\\Importer\\Tests\\Transformers\\AssetsTransformerTest::it_finds_existing_asset_using_path":0.002,"Statamic\\Importer\\Tests\\Transformers\\BardTransformerTest::it_converts_html_to_prosemirror":0.007,"Statamic\\Importer\\Tests\\Transformers\\DateTransformerTest::it_parses_date":0.008,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_parses_date":0.001,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_parses_date":0.001,"Statamic\\Importer\\Tests\\Transformers\\BardTransformerTest::it_enables_bard_buttons":0.015,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_embed_block_with_video_from_youtube":0.002,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_imports_a_new_entry":0.006,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_updates_an_existing_entry":0.006,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_text":0.002,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_list_blocks":0.001,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_quotes_blocks":0.001,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_image_blocks":0.011,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_image_blocks_and_downloads_images_that_dont_exist_in_asset_container":0.003,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_gallery_blocks":0.006,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_html_block":0.002,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_video_block":0.002,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_embed_block_with_video_from_youtube":0.002,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_code_blocks":0.002,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_button_blocks":0.003,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_detail_blocks":0.002,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_separator_blocks":0.001,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_spacer_blocks":0.002,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_returns_entry_ids":0.001,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_finds_existing_entries_by_title":0.023,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_create_new_entries_using_title":0.009,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_create_new_entries_using_slug":0.007,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_finds_existing_entries_by_slug":0.007,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_finds_existing_terms_by_title":0.013,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_create_new_entries_using_title":0.008,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_finds_existing_entries_by_slug":0.009,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_create_new_entries_using_slug":0.005,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_finds_existing_users_by_name":0.004,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_finds_existing_entries_by_email":0.028,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_create_new_entries_using_email":0.031,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_finds_existing_entries_by_custom_field":0.006,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_doesnt_create_new_entries_when_create_when_missing_option_is_disabled":0.001,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_finds_existing_terms":0.006,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_create_new_terms":0.006,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_doesnt_create_new_terms_when_create_when_missing_option_is_disabled":0.002,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_doesnt_create_new_users_using_email_when_create_when_missing_option_is_disabled":0.001,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_returns_user_ids":0.001,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_finds_existing_users_by_email":0.006,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_create_new_users_using_email":0.005,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_finds_existing_entries":0.006,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_create_new_entries":0.007,"Statamic\\Importer\\Tests\\Transformers\\DateTransformerTest::it_transforms_dates":0.001,"Statamic\\Importer\\Tests\\Transformers\\DateTransformerTest::it_transforms_dates_with_time_enabled":0.001,"Statamic\\Importer\\Tests\\Transformers\\DateTransformerTest::it_transforms_dates_with_custom_format":0.001,"Statamic\\Importer\\Tests\\Transformers\\DateTransformerTest::it_transforms_dates_with_time_seconds_enabled":0.008,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_imports_a_new_user":0.009,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_updates_an_existing_user":0.003,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_imports_a_new_term":0.007,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_updates_an_existing_term":0.006,"Statamic\\Importer\\Tests\\Transformers\\AssetsTransformerTest::it_doesnt_download_new_asset_when_download_when_missing_option_is_disabled":0.001,"Statamic\\Importer\\Tests\\ImporterTest::transformer_can_be_registered":0.001,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::returns_output_of_hook":0.022,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_returns_hook_output":0.012}} \ No newline at end of file +{"version":1,"defects":{"Statamic\\Importer\\Tests\\ImporterTest::it_can_import_a_csv_file":7,"Statamic\\Importer\\Tests\\ImporterTest::imports_date_fields":2,"Statamic\\Importer\\Tests\\ImporterTest::imports_bard_fields_from_html":8,"Statamic\\Importer\\Tests\\ImporterTest::imports_bard_fields_from_gutenberg":7,"Statamic\\Importer\\Tests\\ImporterTest::imports_slug_fields":2,"Statamic\\Importer\\Tests\\ImporterTest::imports_term_fields":2,"Statamic\\Importer\\Tests\\ImporterTest::imports_user_fields":2,"Statamic\\Importer\\Tests\\ImporterTest::it_can_import_from_xml_files":8,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_paragraphs":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_text":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_lists":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_quotes":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_html":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_videos_from_youtube":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_other_videos":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_code_blocks":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_video_block":2,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_button_blocks":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_detail_blocks":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_spacer_blocks":7,"Statamic\\Importer\\Tests\\ImporterTest::it_can_import_from_csv_files":8,"Statamic\\Importer\\Tests\\ImporterTest::imports_user_fields_from_wordpress_export":2,"Statamic\\Importer\\Tests\\ImporterTest::imports_assets_field_by_url_where_asset_does_not_exist":7,"Statamic\\Importer\\Tests\\ImporterTest::imports_assets_field_by_path":8,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_image_blocks":8,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_video_block":7,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_gallery_blocks":7,"Statamic\\Importer\\Tests\\Transformers\\AssetsTransformerTest::imports_assets_field_by_url_and_downloads_assets_that_dont_exist_in_asset_container":7,"Statamic\\Importer\\Tests\\Transformers\\DateTransformerTest::it_parses_date":2,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_parses_date":2,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_parses_date":2,"Statamic\\Importer\\Tests\\Transformers\\BardTransformerTest::it_enables_bard_buttons":7,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_imports_a_new_entry":8,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_updates_an_existing_entry":8,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_spacer_blocks":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_embed_block_with_video_from_youtube":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_code_blocks":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_detail_blocks":7,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_returns_entry_ids":7,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_finds_existing_entries_by_title":7,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_create_new_entries_using_title":7,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_finds_existing_terms_by_title":7,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_create_new_entries_using_title":8,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_finds_existing_entries_by_slug":7,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_create_new_entries_using_slug":8,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_finds_existing_users_by_name":8,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_finds_existing_entries_by_custom_field":8,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_doesnt_create_new_entries_when_create_when_missing_option_is_disabled":7,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_doesnt_create_new_terms_when_create_when_missing_option_is_disabled":7,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_create_new_terms":7,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_doesnt_create_new_users_using_email_when_create_when_missing_option_is_disabled":7,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_returns_user_ids":8,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_finds_existing_users_by_email":8,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_create_new_users_using_email":8,"Statamic\\Importer\\Tests\\Transformers\\DateTransformerTest::it_transforms_dates":7,"Statamic\\Importer\\Tests\\Transformers\\DateTransformerTest::it_transforms_dates_with_time_enabled":7,"Statamic\\Importer\\Tests\\Transformers\\DateTransformerTest::it_transforms_dates_with_time_seconds_enabled":7,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_imports_a_new_user":8,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_updates_an_existing_user":8,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_imports_a_new_term":8,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_updates_an_existing_term":8,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_text":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_list_blocks":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_quotes_blocks":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_image_blocks":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_image_blocks_and_downloads_images_that_dont_exist_in_asset_container":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_gallery_blocks":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_html_block":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_video_block":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_button_blocks":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_separator_blocks":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::returns_output_of_hook":7,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_image_blocks_but_doesnt_attempt_to_download_assets_that_dont_exist_in_the_asset_container":8},"times":{"Statamic\\Importer\\Tests\\ImporterTest::it_can_import_a_csv_file":0.055,"Statamic\\Importer\\Tests\\ImporterTest::imports_date_fields":0.001,"Statamic\\Importer\\Tests\\ImporterTest::imports_bard_fields_from_html":0.009,"Statamic\\Importer\\Tests\\ImporterTest::imports_bard_fields_from_gutenberg":0.027,"Statamic\\Importer\\Tests\\ImporterTest::imports_slug_fields":0.001,"Statamic\\Importer\\Tests\\ImporterTest::imports_term_fields":0.001,"Statamic\\Importer\\Tests\\ImporterTest::imports_user_fields":0.001,"Statamic\\Importer\\Tests\\ImporterTest::it_can_import_from_xml_files":0.012,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_paragraphs":0.013,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_text":0.007,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_lists":0.014,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_quotes":0.013,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_html":0.011,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_videos_from_youtube":0.012,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_other_videos":0.047,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_code_blocks":0.002,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_lists_block":0.001,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_quotes_block":0.001,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_html_block":0.002,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_video_block":0.004,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_video_block_with_video_from_youtube":0.002,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_button_blocks":0.01,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_detail_blocks":0.002,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_separator_blocks":0.001,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_spacer_blocks":0.002,"Statamic\\Importer\\Tests\\ImporterTest::it_can_import_from_csv_files":0.074,"Statamic\\Importer\\Tests\\ImporterTest::imports_user_fields_from_wordpress_export":0.001,"Statamic\\Importer\\Tests\\ImporterTest::imports_assets_field_by_url_where_asset_does_not_exist":0.027,"Statamic\\Importer\\Tests\\ImporterTest::imports_assets_field_by_url":0.008,"Statamic\\Importer\\Tests\\ImporterTest::imports_assets_field_by_path":0.008,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_image_blocks":0.042,"Statamic\\Importer\\Tests\\GutenbergTest::it_handles_image_blocks_when_asset_does_not_exist":0.051,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_text":0.013,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_list_blocks":0.001,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_quotes_blocks":0.001,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_image_blocks":0.032,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_image_blocks_and_downloads_images_that_dont_exist_in_asset_container":0.022,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_html_block":0.002,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_video_block":0.002,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_video_block_with_video_from_youtube":0.002,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_code_blocks":0.002,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_button_blocks":0.003,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_detail_blocks":0.002,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_separator_blocks":0.001,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_spacer_blocks":0.002,"Statamic\\Importer\\Tests\\ImporterTest::imports_assets_field_by_url_and_downloads_assets_that_dont_exist_in_asset_container":0.008,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_gallery_blocks":0.006,"Statamic\\Importer\\Tests\\Transformers\\AssetsTransformerTest::imports_assets_field_by_url":0.03,"Statamic\\Importer\\Tests\\Transformers\\AssetsTransformerTest::imports_assets_field_by_url_and_downloads_assets_that_dont_exist_in_asset_container":0.034,"Statamic\\Importer\\Tests\\Transformers\\AssetsTransformerTest::imports_assets_field_by_path":0.032,"Statamic\\Importer\\Tests\\Transformers\\AssetsTransformerTest::it_finds_existing_asset_using_url":0.022,"Statamic\\Importer\\Tests\\Transformers\\AssetsTransformerTest::it_downloads_new_asset_using_url":0.027,"Statamic\\Importer\\Tests\\Transformers\\AssetsTransformerTest::it_finds_existing_asset_using_path":0.002,"Statamic\\Importer\\Tests\\Transformers\\BardTransformerTest::it_converts_html_to_prosemirror":0.007,"Statamic\\Importer\\Tests\\Transformers\\DateTransformerTest::it_parses_date":0.008,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_parses_date":0.001,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_parses_date":0.001,"Statamic\\Importer\\Tests\\Transformers\\BardTransformerTest::it_enables_bard_buttons":0.015,"Statamic\\Importer\\Tests\\GutenbergTest::it_transforms_embed_block_with_video_from_youtube":0.002,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_imports_a_new_entry":0.004,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_updates_an_existing_entry":0.008,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_text":0.003,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_list_blocks":0.001,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_quotes_blocks":0.001,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_image_blocks":0.012,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_image_blocks_and_downloads_images_that_dont_exist_in_asset_container":0.003,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_gallery_blocks":0.007,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_html_block":0.002,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_video_block":0.002,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_embed_block_with_video_from_youtube":0.002,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_code_blocks":0.002,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_button_blocks":0.003,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_detail_blocks":0.002,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_separator_blocks":0.001,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_spacer_blocks":0.002,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_returns_entry_ids":0.001,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_finds_existing_entries_by_title":0.023,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_create_new_entries_using_title":0.009,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_create_new_entries_using_slug":0.007,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_finds_existing_entries_by_slug":0.007,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_finds_existing_terms_by_title":0.013,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_create_new_entries_using_title":0.008,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_finds_existing_entries_by_slug":0.009,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_create_new_entries_using_slug":0.005,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_finds_existing_users_by_name":0.007,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_finds_existing_entries_by_email":0.028,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_create_new_entries_using_email":0.031,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_finds_existing_entries_by_custom_field":0.006,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_doesnt_create_new_entries_when_create_when_missing_option_is_disabled":0.001,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_finds_existing_terms":0.006,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_create_new_terms":0.006,"Statamic\\Importer\\Tests\\Transformers\\TermsTransformerTest::it_doesnt_create_new_terms_when_create_when_missing_option_is_disabled":0.001,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_doesnt_create_new_users_using_email_when_create_when_missing_option_is_disabled":0.002,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_returns_user_ids":0.001,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_finds_existing_users_by_email":0.015,"Statamic\\Importer\\Tests\\Transformers\\UsersTransformerTest::it_create_new_users_using_email":0.01,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_finds_existing_entries":0.007,"Statamic\\Importer\\Tests\\Transformers\\EntriesTransformerTest::it_create_new_entries":0.007,"Statamic\\Importer\\Tests\\Transformers\\DateTransformerTest::it_transforms_dates":0.001,"Statamic\\Importer\\Tests\\Transformers\\DateTransformerTest::it_transforms_dates_with_time_enabled":0.003,"Statamic\\Importer\\Tests\\Transformers\\DateTransformerTest::it_transforms_dates_with_custom_format":0.001,"Statamic\\Importer\\Tests\\Transformers\\DateTransformerTest::it_transforms_dates_with_time_seconds_enabled":0.008,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_imports_a_new_user":0.009,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_updates_an_existing_user":0.003,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_imports_a_new_term":0.007,"Statamic\\Importer\\Tests\\Jobs\\ImportItemJobTest::it_updates_an_existing_term":0.006,"Statamic\\Importer\\Tests\\Transformers\\AssetsTransformerTest::it_doesnt_download_new_asset_when_download_when_missing_option_is_disabled":0.001,"Statamic\\Importer\\Tests\\ImporterTest::transformer_can_be_registered":0.001,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::returns_output_of_hook":0.022,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_returns_hook_output":0.001,"Statamic\\Importer\\Tests\\WordPress\\GutenbergTest::it_transforms_image_blocks_but_doesnt_attempt_to_download_assets_that_dont_exist_in_the_asset_container":0.002}} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..825c32f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1 @@ +# Changelog diff --git a/composer.json b/composer.json index 35eb81a..5ad33b0 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,6 @@ { "name": "statamic/importer", + "license": "MIT", "autoload": { "psr-4": { "Statamic\\Importer\\": "src" @@ -11,13 +12,15 @@ } }, "require": { - "statamic/cms": "^5.0", + "statamic/cms": "^5.30.0", "spatie/simple-excel": "^3.7", "symfony/dom-crawler": "^7.1", - "laravel/pint": "^1.18" + "pixelfear/composer-dist-plugin": "^0.1.5" }, "require-dev": { - "orchestra/testbench": "^8.0 || ^9.0.2" + "laravel/pint": "^1.18", + "orchestra/testbench": "^8.0 || ^9.0.2", + "phpunit/phpunit": "^10.0" }, "config": { "allow-plugins": { @@ -33,6 +36,10 @@ "providers": [ "Statamic\\Importer\\ServiceProvider" ] + }, + "download-dist": { + "url": "https://github.com/statamic/importer/releases/download/{$version}/dist.tar.gz", + "path": "dist" } }, "minimum-stability": "dev", diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..2b447ee --- /dev/null +++ b/package-lock.json @@ -0,0 +1,806 @@ +{ + "name": "importer", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "axios": "^0.21.1", + "cross-env": "^7.0.2", + "vue": "^2.6.11" + }, + "devDependencies": { + "@vitejs/plugin-vue2": "^2.2.0", + "laravel-vite-plugin": "^0.7.4", + "vite": "^4.1.4" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz", + "integrity": "sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz", + "integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.25.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.8.tgz", + "integrity": "sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ==", + "dependencies": { + "@babel/types": "^7.25.8" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.25.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.8.tgz", + "integrity": "sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==", + "dependencies": { + "@babel/helper-string-parser": "^7.25.7", + "@babel/helper-validator-identifier": "^7.25.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", + "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", + "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", + "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", + "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", + "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", + "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", + "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", + "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", + "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", + "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", + "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", + "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", + "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", + "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", + "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", + "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", + "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", + "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", + "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", + "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", + "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", + "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@vitejs/plugin-vue2": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue2/-/plugin-vue2-2.3.1.tgz", + "integrity": "sha512-/ksaaz2SRLN11JQhLdEUhDzOn909WEk99q9t9w+N12GjQCljzv7GyvAbD/p20aBUjHkvpGOoQ+FCOkG+mjDF4A==", + "dev": true, + "engines": { + "node": "^14.18.0 || >= 16.0.0" + }, + "peerDependencies": { + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0", + "vue": "^2.7.0-0" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "2.7.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-2.7.16.tgz", + "integrity": "sha512-KWhJ9k5nXuNtygPU7+t1rX6baZeqOYLEforUPjgNDBnLicfHCoi48H87Q8XyLZOrNNsmhuwKqtpDQWjEFe6Ekg==", + "dependencies": { + "@babel/parser": "^7.23.5", + "postcss": "^8.4.14", + "source-map": "^0.6.1" + }, + "optionalDependencies": { + "prettier": "^1.18.2 || ^2.0.0" + } + }, + "node_modules/axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "dependencies": { + "follow-redirects": "^1.14.0" + } + }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" + }, + "node_modules/esbuild": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", + "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.18.20", + "@esbuild/android-arm64": "0.18.20", + "@esbuild/android-x64": "0.18.20", + "@esbuild/darwin-arm64": "0.18.20", + "@esbuild/darwin-x64": "0.18.20", + "@esbuild/freebsd-arm64": "0.18.20", + "@esbuild/freebsd-x64": "0.18.20", + "@esbuild/linux-arm": "0.18.20", + "@esbuild/linux-arm64": "0.18.20", + "@esbuild/linux-ia32": "0.18.20", + "@esbuild/linux-loong64": "0.18.20", + "@esbuild/linux-mips64el": "0.18.20", + "@esbuild/linux-ppc64": "0.18.20", + "@esbuild/linux-riscv64": "0.18.20", + "@esbuild/linux-s390x": "0.18.20", + "@esbuild/linux-x64": "0.18.20", + "@esbuild/netbsd-x64": "0.18.20", + "@esbuild/openbsd-x64": "0.18.20", + "@esbuild/sunos-x64": "0.18.20", + "@esbuild/win32-arm64": "0.18.20", + "@esbuild/win32-ia32": "0.18.20", + "@esbuild/win32-x64": "0.18.20" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/laravel-vite-plugin": { + "version": "0.7.8", + "resolved": "https://registry.npmjs.org/laravel-vite-plugin/-/laravel-vite-plugin-0.7.8.tgz", + "integrity": "sha512-HWYqpQYHR3kEQ1LsHX7gHJoNNf0bz5z5mDaHBLzS+PGLCTmYqlU5/SZyeEgObV7z7bC/cnStYcY9H1DI1D5Udg==", + "dev": true, + "dependencies": { + "picocolors": "^1.0.0", + "vite-plugin-full-reload": "^1.0.5" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "vite": "^3.0.0 || ^4.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.4.47", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", + "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.1.0", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "optional": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/rollup": { + "version": "3.29.5", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.5.tgz", + "integrity": "sha512-GVsDdsbJzzy4S/v3dqWPJ7EfvZJfCHiDqe80IyrF59LYuP+e6U1LJoUqeuqRbwAWoMNoXivMNeNAOf5E22VA1w==", + "dev": true, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=14.18.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "engines": { + "node": ">=4" + } + }, + "node_modules/vite": { + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.5.tgz", + "integrity": "sha512-ifW3Lb2sMdX+WU91s3R0FyQlAyLxOzCSCP37ujw0+r5POeHPwe6udWVIElKQq8gk3t7b8rkmvqC6IHBpCff4GQ==", + "dev": true, + "dependencies": { + "esbuild": "^0.18.10", + "postcss": "^8.4.27", + "rollup": "^3.27.1" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + }, + "peerDependencies": { + "@types/node": ">= 14", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-plugin-full-reload": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/vite-plugin-full-reload/-/vite-plugin-full-reload-1.2.0.tgz", + "integrity": "sha512-kz18NW79x0IHbxRSHm0jttP4zoO9P9gXh+n6UTwlNKnviTTEpOlum6oS9SmecrTtSr+muHEn5TUuC75UovQzcA==", + "dev": true, + "dependencies": { + "picocolors": "^1.0.0", + "picomatch": "^2.3.1" + } + }, + "node_modules/vue": { + "version": "2.7.16", + "resolved": "https://registry.npmjs.org/vue/-/vue-2.7.16.tgz", + "integrity": "sha512-4gCtFXaAA3zYZdTp5s4Hl2sozuySsgz4jy1EnpBHNfpMa9dK1ZCG7viqBPCwXtmgc8nHqUsAu3G4gtmXkkY3Sw==", + "deprecated": "Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details.", + "dependencies": { + "@vue/compiler-sfc": "2.7.16", + "csstype": "^3.1.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..8506632 --- /dev/null +++ b/package.json @@ -0,0 +1,16 @@ +{ + "scripts": { + "dev": "vite", + "build": "vite build" + }, + "dependencies": { + "axios": "^0.21.1", + "cross-env": "^7.0.2", + "vue": "^2.6.11" + }, + "devDependencies": { + "@vitejs/plugin-vue2": "^2.2.0", + "laravel-vite-plugin": "^0.7.4", + "vite": "^4.1.4" + } +} diff --git a/resources/js/components/ImportWizard.vue b/resources/js/components/ImportWizard.vue new file mode 100644 index 0000000..71883ca --- /dev/null +++ b/resources/js/components/ImportWizard.vue @@ -0,0 +1,188 @@ + + + diff --git a/resources/js/components/Mappings.vue b/resources/js/components/Mappings.vue new file mode 100644 index 0000000..8a25059 --- /dev/null +++ b/resources/js/components/Mappings.vue @@ -0,0 +1,212 @@ + + + diff --git a/resources/js/cp.js b/resources/js/cp.js new file mode 100644 index 0000000..bba0cba --- /dev/null +++ b/resources/js/cp.js @@ -0,0 +1,3 @@ +import ImportWizard from './components/ImportWizard.vue'; + +Statamic.$components.register('import-wizard', ImportWizard); diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php new file mode 100644 index 0000000..f77e829 --- /dev/null +++ b/resources/views/index.blade.php @@ -0,0 +1,14 @@ +@extends('statamic::layout') +@section('title', __('Import')) + +@section('content') +
+

{{ __('Import') }}

+
+ + +@stop diff --git a/src/Commands/ImportCommand.php b/src/Commands/ImportCommand.php deleted file mode 100644 index 2043e88..0000000 --- a/src/Commands/ImportCommand.php +++ /dev/null @@ -1,108 +0,0 @@ -comment('Importing...'); - - $config = [ - 'destination' => [ - 'type' => 'entries', - 'collection' => 'posts', - ], - 'unique_key' => 'wordpress_id', - 'mappings' => [ - 'title' => [ - 'key' => 'Title', - ], - 'slug' => [ - 'key' => 'Slug', - ], - 'content' => [ - 'key' => 'Content', - 'assets_base_url' => 'http://wp.dunc.lol/wp-content/uploads/', - ], - 'author' => [ - 'key' => 'Author Email', - 'related_field' => 'email', - 'create_when_missing' => true, - ], - 'date' => [ - 'key' => 'Date', - ], - 'excerpt' => [ - 'key' => 'Excerpt', - ], - 'featured_image' => [ - 'key' => 'Image Path', - 'related_field' => 'path', - // 'base_url' => 'http://wp.dunc.lol/wp-content/uploads/', - ], - 'categories' => [ - 'key' => 'Categories', - 'related_field' => 'title', - 'create_when_missing' => true, - ], - 'other_posts' => [ - 'key' => 'another_post', - 'related_field' => 'wordpress_id', - ], - 'wordpress_id' => [ - 'key' => 'id', - ], - ], - - // 'destination' => [ - // 'collection' => 'pages', - // ], - // 'unique_key' => 'wp:post_id', - // 'mappings' => [ - // 'title' => ['key' => 'title'], - //// 'parent' => ['key' => 'wp:post_parent'], - //// 'date' => ['key' => 'pubDate'], - // 'other_date' => ['key' => 'pubDate'], - // 'wordpress_id' => ['key' => 'wp:post_id'], - // ], - ]; - - Importer::import($config, '/Users/duncan/Downloads/Posts-Export-2024-October-18-1511.csv'); - } -} diff --git a/src/Http/Controllers/ImportController.php b/src/Http/Controllers/ImportController.php new file mode 100644 index 0000000..585def4 --- /dev/null +++ b/src/Http/Controllers/ImportController.php @@ -0,0 +1,35 @@ + cp_route('utilities.import.mappings'), + 'collections' => Collection::all() + ->map(fn ($collection) => ['value' => $collection->handle(), 'label' => $collection->title()]) + ->values(), + 'taxonomies' => Taxonomy::all() + ->map(fn ($taxonomy) => ['value' => $taxonomy->handle(), 'label' => $taxonomy->title()]) + ->values(), + ]); + } + + public function store(ImportRequest $request) + { + Importer::import($request->validated()); + + return [ + 'success' => true, + 'queued' => config('queue.default') !== 'sync', + ]; + } +} diff --git a/src/Http/Controllers/MappingsController.php b/src/Http/Controllers/MappingsController.php new file mode 100644 index 0000000..2f7492f --- /dev/null +++ b/src/Http/Controllers/MappingsController.php @@ -0,0 +1,89 @@ +getBlueprint($request); + + $row = match ($request->type) { + 'csv' => (new Csv([]))->getItems($request->path)->first(), + 'xml' => (new Xml([]))->getItems($request->path)->first(), + }; + + return [ + 'item_options' => collect($row)->map(fn ($value, $key) => [ + 'value' => $key, + 'label' => "<{$key}>: {$value}", + ])->values(), + 'fields' => $blueprint->fields()->all() + ->map(function (Field $field) { + return [ + 'type' => $field->type(), + 'handle' => $field->handle(), + 'display' => $field->display(), + 'config' => $field->config(), + ]; + }) + ->when($request->destination['type'] === 'users', fn ($fields) => $fields->prepend(['handle' => 'email', 'fieldtype' => 'text', 'display' => __('Email')])) + ->when($request->destination['type'] !== 'users', fn ($fields) => $fields->prepend(['handle' => 'slug', 'fieldtype' => 'text', 'display' => __('Slug')])) + ->when($request->destination['type'] !== 'users', fn ($fields) => $fields->prepend(['handle' => 'title', 'fieldtype' => 'text', 'display' => __('Title')])) + // todo: date? + ->unique('handle') + ->values(), + 'unique_keys' => $blueprint->fields()->all() + ->filter(fn ($field) => in_array($field->type(), ['text', 'integer', 'slug'])) + ->map->handle() + ->merge(['title', 'slug']) + ->unique() + ->values() + ]; + } + + protected function getBlueprint(Request $request): Blueprint + { + if ($request->destination['type'] === 'entries') { + return Collection::find($request->destination['collection'])->entryBlueprint(); + } + + if ($request->destination['type'] === 'terms') { + return Taxonomy::find($request->destination['taxonomy'])->termBlueprint(); + } + + if ($request->destination['type'] === 'users') { + return User::blueprint(); + } + } + + protected function getRelatedFieldOptions(Field $field): array + { + if ($field->type() === 'entries') { + return [ + 'collections' => Collection::all()->map->handle()->values(), + ]; + } + + if ($field->type() === 'terms') { + return [ + 'taxonomies' => Taxonomy::all()->map->handle()->values(), + ]; + } + + if ($field->type() === 'users') { + return []; + } + } +} diff --git a/src/Http/Requests/ImportRequest.php b/src/Http/Requests/ImportRequest.php new file mode 100644 index 0000000..7a40b1e --- /dev/null +++ b/src/Http/Requests/ImportRequest.php @@ -0,0 +1,45 @@ + ['required', 'in:xml,csv'], + 'path' => ['required', function (string $attribute, mixed $value, Closure $fail) { + if (! File::exists($value)) { + $fail('The path does not exist.')->translate(); + } + }], + 'destination' => ['required', 'array'], + 'destination.type' => ['required', 'in:entries,terms,users'], + 'destination.collection' => ['required_if:destination.type,entries', function (string $attribute, mixed $value, Closure $fail) { + if ($value && ! Collection::find($value)) { + $fail('The collection does not exist.')->translate(); + } + }], + 'destination.taxonomy' => ['required_if:destination.type,terms', function (string $attribute, mixed $value, Closure $fail) { + if ($value && ! Taxonomy::find($value)) { + $fail('The taxonomy does not exist.')->translate(); + } + }], + 'mappings' => ['required', 'array'], + 'mappings.*.key' => ['nullable', 'string'], + 'unique_key' => ['required', 'string'], + ]; + } +} diff --git a/src/Http/Requests/MappingsRequest.php b/src/Http/Requests/MappingsRequest.php new file mode 100644 index 0000000..e52347d --- /dev/null +++ b/src/Http/Requests/MappingsRequest.php @@ -0,0 +1,42 @@ + ['required', 'in:xml,csv'], + 'path' => ['required', function (string $attribute, mixed $value, Closure $fail) { + if (! File::exists($value)) { + $fail('The path does not exist.')->translate(); + } + }], + 'destination' => ['required', 'array'], + 'destination.type' => ['required', 'in:entries,terms,users'], + 'destination.collection' => ['required_if:destination.type,entries', function (string $attribute, mixed $value, Closure $fail) { + if ($value && ! Collection::find($value)) { + $fail('The collection does not exist.')->translate(); + } + }], + 'destination.taxonomy' => ['required_if:destination.type,terms', function (string $attribute, mixed $value, Closure $fail) { + if ($value && ! Taxonomy::find($value)) { + $fail('The taxonomy does not exist.')->translate(); + } + }], + ]; + } +} diff --git a/src/Importer.php b/src/Importer.php index 8d0fe25..f6762e8 100644 --- a/src/Importer.php +++ b/src/Importer.php @@ -10,14 +10,11 @@ class Importer { protected static $transformers = []; - public static function import(array $config, string $path): void + public static function import(array $config): void { - $extension = pathinfo($path, PATHINFO_EXTENSION); - - $items = match ($extension) { - 'csv' => (new Csv($config))->getItems($path), - 'xml' => (new Xml($config))->getItems($path), - default => throw new \Exception("Couldn't find a source for [{$extension}] files."), + $items = match ($config['type']) { + 'csv' => (new Csv($config))->getItems($config['path']), + 'xml' => (new Xml($config))->getItems($config['path']), }; $items->each(fn (array $item) => ImportItemJob::dispatch($config, $item)); diff --git a/src/Jobs/ImportItemJob.php b/src/Jobs/ImportItemJob.php index 4ea65a9..1bcb3df 100644 --- a/src/Jobs/ImportItemJob.php +++ b/src/Jobs/ImportItemJob.php @@ -27,8 +27,9 @@ public function handle(): void $blueprint = $this->getBlueprint(); $data = collect($this->config('mappings')) + ->reject(fn ($mapping) => empty($mapping['key'])) ->mapWithKeys(function (array $mapping, string $fieldHandle) use ($blueprint) { - $value = Arr::get($this->item, $fieldHandle); + $value = Arr::get($this->item, $mapping['key']); $field = $blueprint->field($fieldHandle); if (! $value) { diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index fc32215..fd41a8a 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -2,6 +2,9 @@ namespace Statamic\Importer; +use Statamic\Facades\Utility; +use Statamic\Importer\Http\Controllers\ImportController; +use Statamic\Importer\Http\Controllers\MappingsController; use Statamic\Providers\AddonServiceProvider; class ServiceProvider extends AddonServiceProvider @@ -15,10 +18,27 @@ class ServiceProvider extends AddonServiceProvider 'users' => Transformers\UsersTransformer::class, ]; + protected $vite = [ + 'publicDirectory' => 'resources/dist', + 'hotFile' => 'vendor/importer/hot', + 'input' => [ + 'resources/js/cp.js', + ], + ]; + public function bootAddon() { foreach ($this->transformers as $fieldtype => $transformer) { Importer::registerTransformer($fieldtype, $transformer); } + + Utility::extend(function () { + Utility::register('import') + ->action([ImportController::class, 'index']) + ->routes(function ($router) { + $router->post('/', [ImportController::class, 'store'])->name('store'); + $router->post('mappings', MappingsController::class)->name('mappings'); + }); + }); } } diff --git a/src/Sources/Csv.php b/src/Sources/Csv.php index ee44b4c..67de359 100644 --- a/src/Sources/Csv.php +++ b/src/Sources/Csv.php @@ -9,12 +9,6 @@ class Csv extends AbstractSource { public function getItems(string $path): LazyCollection { - return SimpleExcelReader::create($path)->getRows()->map(function (array $row) { - return collect($this->config('mappings')) - ->mapWithKeys(function (array $mapping, string $fieldHandle) use ($row) { - return [$fieldHandle => $row[$mapping['key']]]; - }) - ->all(); - }); + return SimpleExcelReader::create($path)->getRows(); } } diff --git a/src/Sources/Xml.php b/src/Sources/Xml.php index 52f805f..64b86c7 100644 --- a/src/Sources/Xml.php +++ b/src/Sources/Xml.php @@ -2,7 +2,6 @@ namespace Statamic\Importer\Sources; -use Illuminate\Support\Arr; use Illuminate\Support\LazyCollection; class Xml extends AbstractSource @@ -13,13 +12,25 @@ public function getItems(string $path): LazyCollection return LazyCollection::make(function () use ($xml) { foreach ($xml->channel->item as $item) { - yield collect($this->config('mappings')) - ->mapWithKeys(function (array $mapping, string $fieldHandle) use ($item) { - $value = (string) Arr::first($item->xpath($mapping['key'])); + $array = []; - return [$fieldHandle => $value]; - }) - ->all(); + foreach ($item as $key => $value) { + $array[$key] = (string) $value; + } + + foreach ($item->getDocNamespaces(true) as $namespace => $uri) { + // Access namespaced elements using the namespace prefix + foreach ($item->children($uri) as $key => $value) { + $array[$namespace . ':' . $key] = (string) $value; + } + + // If you want to access attributes in the namespaced elements + foreach ($item->attributes($uri) as $key => $value) { + $array[$namespace . ':' . $key] = (string) $value; + } + } + + yield $array; } }); } diff --git a/src/Transformers/AbstractTransformer.php b/src/Transformers/AbstractTransformer.php index 4f4320b..9885f77 100644 --- a/src/Transformers/AbstractTransformer.php +++ b/src/Transformers/AbstractTransformer.php @@ -3,6 +3,7 @@ namespace Statamic\Importer\Transformers; use Illuminate\Support\Arr; +use Statamic\Extend\HasFields; use Statamic\Fields\Blueprint; use Statamic\Fields\Field; use Statamic\Importer\Contracts\Transformer; diff --git a/src/WordPress/Gutenberg.php b/src/WordPress/Gutenberg.php index 94dba82..4d891c4 100644 --- a/src/WordPress/Gutenberg.php +++ b/src/WordPress/Gutenberg.php @@ -74,9 +74,14 @@ public static function toBard(array $config, Blueprint $blueprint, Field $field, $asset = static::findOrDownloadAsset( assetContainer: $assetContainer, url: $url, - baseUrl: $config['assets_base_url'] ?? null + baseUrl: $config['assets_base_url'] ?? null, + downloadWhenMissing: $config['assets_download_when_missing'] ?? false ); + if (! $asset) { + return null; + } + return [ 'type' => 'paragraph', 'content' => [ @@ -119,11 +124,13 @@ public static function toBard(array $config, Blueprint $blueprint, Field $field, $asset = static::findOrDownloadAsset( assetContainer: $assetContainer, url: $url, - baseUrl: $config['assets_base_url'] ?? null + baseUrl: $config['assets_base_url'] ?? null, + downloadWhenMissing: $config['assets_download_when_missing'] ?? false ); return $asset?->path(); }) + ->filter() ->all(), ], ], @@ -358,7 +365,7 @@ protected static function renderHtmlToProsemirror(Field $field, string $html) return (new BardAugmentor($field->fieldtype()))->renderHtmlToProsemirror($html)['content'][0]; } - protected static function findOrDownloadAsset(AssetContainerContract $assetContainer, string $url, string $baseUrl): ?Asset + protected static function findOrDownloadAsset(AssetContainerContract $assetContainer, string $url, string $baseUrl, bool $downloadWhenMissing): ?Asset { $path = Str::of($url) ->after(Str::removeRight($baseUrl, '/')) @@ -367,7 +374,7 @@ protected static function findOrDownloadAsset(AssetContainerContract $assetConta $asset = $assetContainer->asset($path); - if (! $asset) { + if (! $asset && $downloadWhenMissing) { $request = Http::get(Str::removeRight($baseUrl, '/').Str::ensureLeft($path, '/')); if (! $request->ok()) { diff --git a/tests/ImporterTest.php b/tests/ImporterTest.php index 6f91a55..c491ac2 100644 --- a/tests/ImporterTest.php +++ b/tests/ImporterTest.php @@ -40,20 +40,19 @@ public function it_can_import_from_csv_files() $this->assertNull(Entry::query()->where('imported_id', 'one')->first()); - Importer::import( - config: [ - 'destination' => ['type' => 'entries', 'collection' => 'team'], - 'unique_key' => 'imported_id', - 'mappings' => [ - 'first_name' => ['key' => 'First Name'], - 'last_name' => ['key' => 'Last Name'], - 'email' => ['key' => 'Email'], - 'role' => ['key' => 'Role'], - 'imported_id' => ['key' => 'ID'], - ], + Importer::import([ + 'type' => 'csv', + 'path' => storage_path('import.csv'), + 'destination' => ['type' => 'entries', 'collection' => 'team'], + 'unique_key' => 'imported_id', + 'mappings' => [ + 'first_name' => ['key' => 'First Name'], + 'last_name' => ['key' => 'Last Name'], + 'email' => ['key' => 'Email'], + 'role' => ['key' => 'Role'], + 'imported_id' => ['key' => 'ID'], ], - path: storage_path('import.csv') - ); + ]); $entry = Entry::query()->where('imported_id', 'one')->first(); @@ -78,8 +77,6 @@ public function it_can_import_from_xml_files() ['handle' => 'content', 'field' => ['type' => 'text']], ['handle' => 'excerpt', 'field' => ['type' => 'text']], ['handle' => 'imported_id', 'field' => ['type' => 'text']], - ['handle' => 'foo', 'field' => ['type' => 'text']], - ['handle' => 'bar', 'field' => ['type' => 'text']], ], ], ], ['handle' => 'date', 'field' => ['type' => 'date']], @@ -101,15 +98,12 @@ public function it_can_import_from_xml_files() Inventore autem reprehenderit et]]> one + - - - - - - - - + + + + XML @@ -117,22 +111,19 @@ public function it_can_import_from_xml_files() $this->assertNull(Entry::query()->where('imported_id', 'one')->first()); - Importer::import( - config: [ - 'destination' => ['type' => 'entries', 'collection' => 'posts'], - 'unique_key' => 'imported_id', - 'mappings' => [ - 'title' => ['key' => 'title'], - 'date' => ['key' => 'pubDate'], - 'content' => ['key' => 'content:encoded'], - 'excerpt' => ['key' => 'excerpt:encoded'], - 'imported_id' => ['key' => 'wp:post_id'], - 'foo' => ['key' => "wp:postmeta[wp:meta_key='foo']/wp:meta_value"], - 'bar' => ['key' => "wp:postmeta[wp:meta_key='bar']/wp:meta_value"], - ], + Importer::import([ + 'type' => 'xml', + 'path' => storage_path('import.xml'), + 'destination' => ['type' => 'entries', 'collection' => 'posts'], + 'unique_key' => 'imported_id', + 'mappings' => [ + 'title' => ['key' => 'title'], + 'date' => ['key' => 'pubDate'], + 'content' => ['key' => 'content:encoded'], + 'excerpt' => ['key' => 'excerpt:encoded'], + 'imported_id' => ['key' => 'wp:post_id'], ], - path: storage_path('import.xml') - ); + ]); $entry = Entry::query()->where('imported_id', 'one')->first(); @@ -141,7 +132,5 @@ public function it_can_import_from_xml_files() $this->assertEquals('2024-06-03', $entry->date()->format('Y-m-d')); $this->assertEquals('

Inventore autem reprehenderit et

', $entry->get('content')); $this->assertEquals('In excepteur ex aliquip laborum velit proident est officia in ex labore do.', $entry->get('excerpt')); - $this->assertEquals('bar', $entry->get('foo')); - $this->assertEquals('baz', $entry->get('bar')); } } diff --git a/tests/Jobs/ImportItemJobTest.php b/tests/Jobs/ImportItemJobTest.php index 4625ab1..57c141a 100644 --- a/tests/Jobs/ImportItemJobTest.php +++ b/tests/Jobs/ImportItemJobTest.php @@ -77,10 +77,10 @@ public function it_imports_a_new_entry() ], ], item: [ - 'first_name' => 'John', - 'last_name' => 'Doe', - 'email' => 'john.doe@example.com', - 'role' => 'CEO', + 'First Name' => 'John', + 'Last Name' => 'Doe', + 'Email' => 'john.doe@example.com', + 'Role' => 'CEO', ] ); @@ -111,10 +111,10 @@ public function it_updates_an_existing_entry() ], ], item: [ - 'first_name' => 'John', - 'last_name' => 'Doe', - 'email' => 'john.doe@example.com', - 'role' => 'CEO', + 'First Name' => 'John', + 'Last Name' => 'Doe', + 'Email' => 'john.doe@example.com', + 'Role' => 'CEO', ] ); @@ -141,7 +141,7 @@ public function it_imports_a_new_term() ], ], item: [ - 'title' => 'Statamic', + 'Title' => 'Statamic', ] ); @@ -167,7 +167,7 @@ public function it_updates_an_existing_term() ], ], item: [ - 'title' => 'Statamic', + 'Title' => 'Statamic', ] ); @@ -194,9 +194,9 @@ public function it_imports_a_new_user() ], ], item: [ - 'first_name' => 'John', - 'last_name' => 'Doe', - 'email' => 'john.doe@example.com', + 'First Name' => 'John', + 'Last Name' => 'Doe', + 'Email' => 'john.doe@example.com', ] ); @@ -225,9 +225,9 @@ public function it_updates_an_existing_user() ], ], item: [ - 'first_name' => 'John', - 'last_name' => 'Doe', - 'email' => 'john.doe@example.com', + 'First Name' => 'John', + 'Last Name' => 'Doe', + 'Email' => 'john.doe@example.com', ] ); diff --git a/tests/WordPress/GutenbergTest.php b/tests/WordPress/GutenbergTest.php index 89ca011..412a9c3 100644 --- a/tests/WordPress/GutenbergTest.php +++ b/tests/WordPress/GutenbergTest.php @@ -226,14 +226,15 @@ public function it_transforms_image_blocks_and_downloads_images_that_dont_exist_ 'https://example.com/wp-content/uploads/2024/10/image.png' => Http::response(UploadedFile::fake()->image('image.png')->size(100)->get()), ]); - Http::preventStrayRequests(); - AssetContainer::make('assets')->disk('public')->save(); Storage::disk('public')->assertMissing('2024/10/image.png'); $output = Gutenberg::toBard( - config: ['assets_base_url' => 'https://example.com/wp-content/uploads'], + config: [ + 'assets_base_url' => 'https://example.com/wp-content/uploads', + 'assets_download_when_missing' => true, + ], blueprint: $this->blueprint, field: $this->blueprint->field('content'), value: <<<'HTML' @@ -261,6 +262,34 @@ public function it_transforms_image_blocks_and_downloads_images_that_dont_exist_ Storage::disk('public')->assertExists('2024/10/image.png'); } + #[Test] + public function it_transforms_image_blocks_but_doesnt_attempt_to_download_assets_that_dont_exist_in_the_asset_container() + { + Http::preventStrayRequests(); + + AssetContainer::make('assets')->disk('public')->save(); + + Storage::disk('public')->assertMissing('2024/10/image.png'); + + $output = Gutenberg::toBard( + config: [ + 'assets_base_url' => 'https://example.com/wp-content/uploads', + 'assets_download_when_missing' => false, + ], + blueprint: $this->blueprint, + field: $this->blueprint->field('content'), + value: <<<'HTML' + +
+ +HTML + ); + + $this->assertEquals([], $output); + + Storage::disk('public')->assertMissing('2024/10/image.png'); + } + #[Test] public function it_transforms_gallery_blocks() { diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..2b7af76 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,14 @@ +import { defineConfig } from 'vite' +import laravel from 'laravel-vite-plugin' +import vue2 from '@vitejs/plugin-vue2' + +export default defineConfig({ + plugins: [ + laravel({ + hotFile: 'resources/dist/hot', + publicDirectory: 'resources/dist', + input: ['resources/js/cp.js'], + }), + vue2(), + ], +})