Skip to content

Commit

Permalink
Merge branch 'release/4.0.8' into v4
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Jan 30, 2024
2 parents c5d4a71 + 14eac81 commit f652387
Show file tree
Hide file tree
Showing 20 changed files with 3,179 additions and 1,954 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build-and-deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: Build and Deploy Docs
env:
DOCS_DEST_DIR: /vite/
DOCS_DEST_DIR: /vite/v4/
on:
push:
branches:
- v1
- v4
paths:
- 'docs/**'
pull_request:
branches:
- v1
- v4
paths:
- 'docs/**'
workflow_dispatch:
Expand All @@ -22,11 +22,11 @@ jobs:
strategy:
fail-fast: true
matrix:
node-version: [14.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
Expand All @@ -35,7 +35,7 @@ jobs:
- name: rsync deployments
uses: burnett01/[email protected]
with:
switches: -avzr --delete
switches: -avzr
path: ./dist/
remote_path: ${{ secrets.NYS_DOCS_ROOT }}${{ env.DOCS_DEST_DIR }}
remote_host: ${{ secrets.NYS_DEPLOY_REMOTE_HOST }}
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/code-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Code Analysis

on:
pull_request: null
push:
branches:
- develop-v4
workflow_dispatch:
permissions:
contents: read
jobs:
code_analysis:
strategy:
fail-fast: false
matrix:
actions:
-
name: 'PHPStan'
run: composer phpstan
-
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.0
coverage: none
# composer install cache - https://github.com/ramsey/composer-install
- uses: "ramsey/composer-install@v2"
- run: ${{ matrix.actions.run }}
202 changes: 11 additions & 191 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

All notable changes to this project will be documented in this file.

## 4.0.8 - 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))
* Add `phpstan` and `ecs` code linting
* Add `code-analysis.yaml` GitHub action

### Changed
* Updated docs to use node 20 & a new sitemap plugin
* PHPstan code cleanup
* ECS code cleanup

## 4.0.7 - 2023.12.08
### Fixed
* Fixed a type error if you passed an array of entries into the `errorEntry` config ([#76](https://github.com/nystudio107/craft-vite/issues/76))
Expand Down Expand Up @@ -61,200 +72,9 @@ All notable changes to this project will be documented in this file.
* Cache the status of the devServer for the duration of the request

## 4.0.0-beta.2 - 2022.03.04

### Fixed

* Updated types for Craft CMS `4.0.0-alpha.1` via Rector

## 4.0.0-beta.1 - 2022.02.07

### Added

* Initial Craft CMS 4 compatibility

## 1.0.23 - 2022.01.21

### Fixed

* Removed errant debugging code

## 1.0.22 - 2022.01.20

### Added

* Added support for [subresource integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity)
via plugins like [vite-plugin-manifest-sri](https://github.com/ElMassimo/vite-plugin-manifest-sri)

## 1.0.21 - 2022.01.17

### Added

* Added a `vite-script-loaded` event dispatched to `document` so listeners can be notified after a script
loads ([#310](https://github.com/nystudio107/craft-imageoptimize/issues/310))

## 1.0.20 - 2021.12.16

### Fixed

* Fixed a regression caused by [#5](https://github.com/nystudio107/craft-plugin-vite/pull/5) to ensure assets load on
production ([#6](https://github.com/nystudio107/craft-plugin-vite/issues/6))

## 1.0.19 - 2021.12.15

### Added

* Added the `.entry()` function to retrieve and entry from the `manifest.json` to a JavaScript file, CSS file, or asset

## 1.0.18 - 2021.12.14

### Fixed

* Fixed an issue where the needle/haystack logic was reversed in `strpos()` which could cause it to not match properly
in some setups ([#5](https://github.com/nystudio107/craft-plugin-vite/pull/5))

## 1.0.17 - 2021.10.21

### Fixed

* Fixed an issue with potentially duplicated `modulepreload` links by adding tags via an associative
array ([#16](https://github.com/nystudio107/craft-vite/issues/16))

## 1.0.16 - 2021.09.18

### Added

* Added `craft.vite.asset()` to retrive assets such as images that are imported in JavaScript or CSS

## 1.0.15 - 2021.08.25

### Changed

* Changed the `DEVMODE_CACHE_DURATION` to `1` second ([#3](https://github.com/nystudio107/craft-plugin-vite/issues/3))

## 1.0.14 - 2021.08.10

### Added

* Added [Preload Directives Generation](https://vitejs.dev/guide/features.html#preload-directives-generation) that will
automatically generate `<link rel="modulepreload">` directives for entry chunks and their direct
imports ([PR#2](https://github.com/nystudio107/craft-plugin-vite/pull/2))

## 1.0.13 - 2021.07.14

### Added

* Added a `craft.vite.devServerRunning()` method to allow you to determine if the Vite dev server is running or not from
your Twig templates ([#10](https://github.com/nystudio107/craft-vite/issues/10))

## 1.0.12 - 2021.07.14

### Changed

* Switched the `checkDevServer` test file to `@vite/client` to accommodate with the change in Vite `^2.4.0` to use
the `.mjs` extension ([#11](https://github.com/nystudio107/craft-vite/issues/11))

## 1.0.11 - 2021.06.29

### Changed

* Roll back the automatic inclusion of `@vite/client.js` ([#9](https://github.com/nystudio107/craft-vite/issues/9))

## 1.0.10 - 2021.06.28

### Changed

* Always include the `@vite/client.js` script if the dev server is
running ([#9](https://github.com/nystudio107/craft-vite/issues/9))

## 1.0.9 - 2021.06.05

### Added

* Added `craft.vite.getCssHash()` that returns the content hash for the build CSS assets

## 1.0.8 - 2021.06.05

### Added

* Added `craft.vite.includeCriticalCssTags()` to make it easy to include inline Critical CSS generated
via `rollup-plugin-critical`

## 1.0.7 - 2021.05.21

### Added

* Added a `includeReactRefreshShim` setting that will automatically include the
required [shim for `react-refresh`](https://vitejs.dev/guide/backend-integration.html#backend-integration) when the
Vite dev server is running ([#5](https://github.com/nystudio107/craft-vite/issues/5))

### Changed

* Removed custom user/agent header that was a holdover from `curl`
* Re-worked how the various JavaScript shims are stored and injected

## 1.0.6 - 2021.05.20

### Changed

* Change the default `useDevServer` setting
to `App::env('ENVIRONMENT') === 'dev'` ([#6](https://github.com/nystudio107/craft-vite/issues/6))
* Refactored the code from a monolithic `ViteService` to helpers, as appropriate

### Fixed

* Fixed an issue where it was outputting `type="nomodule"` for legacy scripts, when it should have just been `nomodule`

## 1.0.5 - 2021.05.14

### Added

* Moved the live reload through Twig errors to the ViteService so that plugins can get it too
* Added `.inline()` to allow for inlining of local or remote files in your templates, with a caching layer

### Changed

* Use `registerJsFile()` instead of `registerScript()`
* Make the cache last for 30 seconds with `devMode` on
* Refactored to `ViteVariableInterface` & `ViteVariableTrait`

## 1.0.4 - 2021.05.08

### Added

* Added the `devServerInternal` setting back in, along with `checkDevServer` for people who want the fallback
behavior ([#2](https://github.com/nystudio107/craft-vite/issues/2))

### Changed

* Use `PRIMARY_SITE_URL` in the default config instead of `SITE_URL`
* Switch over to VitePress for the docs

## 1.0.3 - 2021.05.07

### Changed

* Crawl the `manifest.json` dependency graph recursively to look for CSS files

### Fixed

* Don't call any AssetManager methods in the component `init()` method during console requests

## 1.0.2 - 2021-05-06

### Changed

* Removed entirely the `devServerInternal` setting, which isn't necessary (we just depend on you setting
the `useDevServer` flag correctly instead), and added setup complexity

## 1.0.1 - 2021-05-04

### Changed

* Added initial documentation
* Updated default `config.php`

## 1.0.0 - 2021-05-03

### Added

* Initial release
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
The MIT License (MIT)

Copyright (c) 2021 nystudio107
Copyright (c) nystudio107

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15 changes: 13 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "4.0.7",
"version": "4.0.8",
"keywords": [
"craft",
"cms",
Expand All @@ -24,7 +24,17 @@
],
"require": {
"craftcms/cms": "^4.0.0",
"nystudio107/craft-plugin-vite": "^4.0.8"
"nystudio107/craft-plugin-vite": "^4.0.9"
},
"require-dev": {
"craftcms/ecs": "dev-main",
"craftcms/phpstan": "dev-main",
"craftcms/rector": "dev-main"
},
"scripts": {
"phpstan": "vendor/bin/phpstan --ansi --memory-limit=1G",
"check-cs": "ecs check --ansi",
"fix-cs": "ecs check --fix --ansi"
},
"config": {
"allow-plugins": {
Expand All @@ -40,6 +50,7 @@
}
},
"extra": {
"changelogUrl": "https://raw.githubusercontent.com/nystudio107/craft-vite/v4/CHANGELOG.md",
"class": "nystudio107\\vite\\Vite",
"handle": "vite",
"name": "Vite"
Expand Down
6 changes: 4 additions & 2 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
ARG TAG=14-alpine
FROM nystudio107/node-dev-base:$TAG
ARG TAG=20-alpine
FROM node:$TAG

RUN npm install -g npm@^10.0.0

WORKDIR /app/

Expand Down
Loading

0 comments on commit f652387

Please sign in to comment.