diff --git a/.craftplugin b/.craftplugin deleted file mode 100644 index 4412ee4..0000000 --- a/.craftplugin +++ /dev/null @@ -1 +0,0 @@ -{"pluginName":"Vite","pluginDescription":"Allows the use of the Vite.js next generation frontend tooling with Craft CMS","pluginVersion":"1.0.0","pluginAuthorName":"nystudio107","pluginVendorName":"nystudio107","pluginAuthorUrl":"https://nystudio107.com","pluginAuthorGithub":"nystudio107","codeComments":"","pluginComponents":["services","settings","twigextensions","variables"],"consolecommandName":"","controllerName":"","cpsectionName":"","elementName":"","fieldName":"","modelName":"","purchasableName":"","recordName":"","serviceName":"Connector","taskName":"","utilityName":"","widgetName":"","apiVersion":"api_version_3_0"} \ No newline at end of file diff --git a/.github/workflows/code-analysis.yaml b/.github/workflows/code-analysis.yaml index b571cde..a6a6066 100644 --- a/.github/workflows/code-analysis.yaml +++ b/.github/workflows/code-analysis.yaml @@ -14,21 +14,27 @@ jobs: fail-fast: false matrix: actions: - - - name: 'PHPStan' + - name: 'PHPStan' run: composer phpstan - - - name: 'Coding Standards' + - name: 'Coding Standards' run: composer fix-cs name: ${{ matrix.actions.name }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - # see https://github.com/shivammathur/setup-php - - uses: shivammathur/setup-php@v2 - with: - php-version: 8.2 - coverage: none - # composer install cache - https://github.com/ramsey/composer-install - - uses: "ramsey/composer-install@v2" - - run: ${{ matrix.actions.run }} + - uses: actions/checkout@v4 + - name: Cache Composer dependencies + uses: actions/cache@v4 + with: + path: /tmp/composer-cache + key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} + - name: Setup PHP + id: setup-php + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + extensions: 'ctype,curl,dom,iconv,imagick,intl,json,mbstring,openssl,pcre,pdo,reflection,spl,zip' + ini-values: post_max_size=256M, max_execution_time=180, memory_limit=512M + tools: composer:v2 + - name: Install Composer dependencies + run: composer install --no-interaction --no-ansi --no-progress + - run: ${{ matrix.actions.run }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 99dcbd0..7264f68 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to this project will be documented in this file. +## 5.0.0-beta.3 - 2024.03.02 +### Added +* Add documentation for Craft Cloud usage with Vite ([#83](https://github.com/nystudio107/craft-vite/pull/83)) +* Add support for clearing Vite caches in response to Craft Cloud's `UpController::EVENT_AFTER_UP` event ([#83](https://github.com/nystudio107/craft-vite/pull/83)) + +### Fixed +* Fixed an issue where the wrong CSS hash would be returned if you were using Vite 3 or earlier ([#80](https://github.com/nystudio107/craft-vite/issues/80)) +* Fixed an issue where `craft.vite.entry()` would fail if you were using Vite 5 or later, due to the `ManifestHelper::fileNameWithoutHash()` function not working correctly ([#24](https://github.com/nystudio107/craft-plugin-vite/issues/24)) + ## 5.0.0-beta.2 - 2024.01.30 ### Added * If the `devServer` is running, the `ViteService::fetch()` method will try to use the `devServerInternal` URL first, falling back on the `devServerPublic` so that `craft.vite.inline()` can pull from the `devServer` if it is running ([#22](https://github.com/nystudio107/craft-plugin-vite/issues/22)) diff --git a/composer.json b/composer.json index fa0cc02..a3d1143 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "nystudio107/craft-vite", "description": "Allows the use of the Vite.js next generation frontend tooling with Craft CMS", "type": "craft-plugin", - "version": "5.0.0-beta.2", + "version": "5.0.0-beta.3", "keywords": [ "craft", "cms", @@ -23,8 +23,9 @@ } ], "require": { - "craftcms/cms": "^5.0.0-alpha.1", - "nystudio107/craft-plugin-vite": "^5.0.0-beta.2" + "php": "^8.2", + "craftcms/cms": "^5.0.0-beta.1", + "nystudio107/craft-plugin-vite": "^5.0.0-beta.3" }, "require-dev": { "craftcms/ecs": "dev-main", @@ -32,7 +33,7 @@ "craftcms/rector": "dev-main" }, "scripts": { - "phpstan": "vendor/bin/phpstan --ansi --memory-limit=1G", + "phpstan": "phpstan --ansi --memory-limit=1G", "check-cs": "ecs check --ansi", "fix-cs": "ecs check --fix --ansi" }, diff --git a/docs/docs/index.md b/docs/docs/index.md index 19b4938..58f155a 100755 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -194,7 +194,6 @@ export default ({command}) => ({ }); ``` - #### Modern + Legacy Config By default, Vite generates JavaScript bundles that work with modern browsers that @@ -359,8 +358,8 @@ services: expose: - '3000' environment: - - HTTP_EXPOSE=${DDEV_ROUTER_HTTP_PORT}:80,${DDEV_MAILHOG_PORT}:8025,3001:3000 - - HTTPS_EXPOSE=${DDEV_ROUTER_HTTPS_PORT}:80,${DDEV_MAILHOG_HTTPS_PORT}:8025,3000:3000 + - HTTP_EXPOSE=${DDEV_ROUTER_HTTP_PORT}:80,${DDEV_MAILPIT_PORT}:8025,3001:3000 + - HTTPS_EXPOSE=${DDEV_ROUTER_HTTPS_PORT}:80,${DDEV_MAILPIT_HTTPS_PORT}:8025,3000:3000 ``` In your `vite.config.js`, the `server.host` should to be set to `0.0.0.0`, and `server.port` set to `3000`: @@ -501,8 +500,16 @@ JavaScript file via Twig in a `