Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: idleberg/php-wordpress-vite-assets
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.0
Choose a base ref
...
head repository: idleberg/php-wordpress-vite-assets
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Dec 31, 2023

  1. Update composer.json

    idleberg authored Dec 31, 2023
    Copy the full SHA
    5d5908f View commit details
  2. Update README.md

    idleberg authored Dec 31, 2023
    Copy the full SHA
    3483079 View commit details

Commits on May 15, 2024

  1. Copy the full SHA
    ada392d View commit details
  2. Merge branch 'main' of github.com:idleberg/php-wordpress-vite-assets

    idleberg committed May 15, 2024
    Copy the full SHA
    2353300 View commit details
  3. update dependencies

    idleberg committed May 15, 2024
    Copy the full SHA
    636599c View commit details

Commits on May 25, 2024

  1. Updated to support scss

    Manifest contains files with .scss filenames, meaning that the styles are adding script modules too.
    gRoberts84 authored May 25, 2024
    Copy the full SHA
    588ce53 View commit details

Commits on Jun 4, 2024

  1. Updated based on PR feedback

    Updated to specifically check for .css or .scss as per recommendation.
    gRoberts84 authored Jun 4, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    00152cf View commit details
  2. Merge pull request #18 from gRoberts84/bug-fix/scss

    idleberg authored Jun 4, 2024
    Copy the full SHA
    64495d6 View commit details

Commits on Jun 8, 2024

  1. Copy the full SHA
    7ae73b1 View commit details
  2. update PHPDoc comments

    idleberg committed Jun 8, 2024
    Copy the full SHA
    a31f82f View commit details
  3. update stamp

    idleberg committed Jun 8, 2024
    Copy the full SHA
    7057906 View commit details
  4. update dependencies

    idleberg committed Jun 8, 2024
    Copy the full SHA
    d9e483e View commit details
  5. update copyright year

    idleberg committed Jun 8, 2024
    Copy the full SHA
    8815f98 View commit details

Commits on Jun 9, 2024

  1. update copyright notice

    idleberg committed Jun 9, 2024
    Copy the full SHA
    2fac208 View commit details
  2. add dots

    idleberg committed Jun 9, 2024
    Copy the full SHA
    e42c6a9 View commit details
  3. update dependency

    idleberg committed Jun 9, 2024
    Copy the full SHA
    a078b42 View commit details
  4. update documentation

    idleberg committed Jun 9, 2024
    Copy the full SHA
    612bb0d View commit details

Commits on Jul 6, 2024

  1. switch to composer-dependency-analyser

    idleberg committed Jul 6, 2024
    Copy the full SHA
    96cbb1e View commit details
  2. update dependencies

    idleberg committed Jul 6, 2024
    Copy the full SHA
    93b8618 View commit details

Commits on Oct 18, 2024

  1. add stop-on-failure config

    idleberg committed Oct 18, 2024
    Copy the full SHA
    5d15ed9 View commit details

Commits on Oct 27, 2024

  1. add FUNDING.md

    idleberg committed Oct 27, 2024
    Copy the full SHA
    abf66e0 View commit details

Commits on Nov 1, 2024

  1. update dependencies

    idleberg committed Nov 1, 2024
    Copy the full SHA
    8a11b28 View commit details

Commits on Jan 1, 2025

  1. bump copyright year

    idleberg committed Jan 1, 2025
    Copy the full SHA
    a637369 View commit details
  2. bump copyright year

    idleberg committed Jan 1, 2025
    Copy the full SHA
    3dc864c View commit details

Commits on Jan 9, 2025

  1. update dependencies

    idleberg committed Jan 9, 2025
    Copy the full SHA
    c899472 View commit details
  2. support php 8.4

    idleberg committed Jan 9, 2025
    Copy the full SHA
    53df300 View commit details
  3. update vite-manifest

    idleberg committed Jan 9, 2025
    Copy the full SHA
    7d64128 View commit details
Showing with 1,803 additions and 1,781 deletions.
  1. +1 −0 .github/FUNDING.yml
  2. +1 −1 .github/workflows/default.yml
  3. +1 −1 LICENSE
  4. +23 −2 README.md
  5. +10 −5 composer.json
  6. +1,734 −1,752 composer.lock
  7. +32 −19 src/Assets.php
  8. +1 −1 tests/_support/_generated/UnitTesterActions.php
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
buy_me_a_coffee: idleberg
2 changes: 1 addition & 1 deletion .github/workflows/default.yml
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.1', '8.2', '8.3']
php-versions: ['8.1', '8.2', '8.3', '8.4']
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
env:
extensions: intl, pcov
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 Jan T. Sott
Copyright (c) 2022-2025 Jan T. Sott & contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Vite Assets for WordPress

> Adds assets from a [Vite](https://vitejs.dev/) manifest to the WordPress head
> Adds assets from a [Vite](https://vitejs.dev/) manifest to the WordPress head, supports themes and plugins.
[![License](https://img.shields.io/packagist/l/idleberg/wordpress-vite-assets?style=for-the-badge&color=blue)](https://github.com/idleberg/php-wordpress-vite-assets/blob/main/LICENSE)
[![Version](https://img.shields.io/packagist/v/idleberg/wordpress-vite-assets?style=for-the-badge)](https://github.com/idleberg/php-wordpress-vite-assets/releases)
@@ -36,6 +36,27 @@ To get you going, first instantiate the class exposed by this library
new Assets(string $manifestPath, string $baseUri, string $algorithm = "sha256");
```

### Parameters

#### `$manifestPath`

Type: `string`

Specifies the path to the manifest.

#### `$baseUri`

Type: `string`

Specifies the base URI for the assets in the manifest.

#### `$algorithm`

Type: `"sha256"` |`"sha384"` |`"sha512"` | `":manifest:"`
Default: `"sha256"`

Specifies the algorithm used for hashing the assets. This will be used can be used for [subsource integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) when printing script or style tags. You can use `":manifest:"` in conjunction with [vite-plugin-manifest-sri](https://github.com/ElMassimo/vite-plugin-manifest-sri), a plug-in that calculates the hashes at build-time and adds them to the manifest.

**Example**

```php
@@ -135,4 +156,4 @@ $viteAssets->inject("index.ts", [

## License

This work is licensed under [The MIT License](LICENSE)
This work is licensed under [The MIT License](LICENSE).
15 changes: 10 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "idleberg/wordpress-vite-assets",
"description": "Injects assets from a Vite manifest to the Wordpress head",
"description": "Injects assets from a Vite manifest to the Wordpress head, supports themes and plugins",
"type": "library",
"license": "MIT",
"keywords": [
@@ -24,7 +24,7 @@
],
"require": {
"php": ">=8.1",
"idleberg/vite-manifest": "^1.0.0"
"idleberg/vite-manifest": "^1.2.1"
},
"require-dev": {
"codeception/codeception": "^5.0.4",
@@ -33,8 +33,8 @@
"phpstan/phpstan": "^1.9",
"phpstan/extension-installer": "^1.2",
"szepeviktor/phpstan-wordpress": "^1.1",
"brainmaestro/composer-git-hooks": "^3.0@alpha",
"icanhazstring/composer-unused": "^0.8.10"
"brainmaestro/composer-git-hooks": "^3.0.0",
"shipmonk/composer-dependency-analyser": "^1.6"
},
"scripts": {
"format": "vendor/bin/php-cs-fixer fix ./src",
@@ -43,7 +43,7 @@
"vendor/bin/phpstan analyse ./src --memory-limit=512M --level 5",
"vendor/bin/codecept run"
],
"unused": "vendor/bin/composer-unused"
"unused": "vendor/bin/composer-dependency-analyser"
},
"config": {
"allow-plugins": {
@@ -52,6 +52,11 @@
},
"extra": {
"hooks": {
"config": {
"stop-on-failure": [
"pre-commit"
]
},
"pre-commit": [
"composer run format",
"composer run lint",
Loading