8000 GitHub - Javaabu/manifest: Laravel asset shipper: lets packages declare their CSS, JS, Sass, TS, React and Vue assets in their service provider, loads them automatically or where the developer chooses, and builds them with Vite · GitHub
[go: up one dir, main page]

Skip to content
JavaabuPublic

About

Laravel asset shipper: lets packages declare their CSS, JS, Sass, TS, React and Vue assets in their service provider, loads them automatically or where the developer chooses, and builds them with Vite

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Manifest

Tests codecov Latest Version on Packagist License: MIT

Ship CSS, Sass, JS, TypeScript, React and Vue from Laravel packages. A package registers its assets in its service provider. Its Blade components load them on the pages they render on, the app's own Vite builds them, Inertia renders the package's pages, and apps override any single file.

// In a package's service provider
$this->registerAssets('filters', __DIR__ . '/../resources', function (Package $package) {
    $package
        ->style('filters', 'css/filters.css')
        ->script('filter-bar', 'js/filter-bar.ts', depends_on: ['filters'])
        ->js()      // import { FilterBar } from '@javaabu/filters'
        ->pages();  // Inertia::render('filters::Index')
});
#[RequiresAssets('filters::filter-bar')]
class FilterBar extends Component {}

Documentation

You'll find the documentation on https://docs.javaabu.com/manifest, and in the docs folder.

AI coding assistants can start from llms.txt. The package ships a Laravel Boost skill and guideline, which Boost finds by itself. See AI assistants.

Quick start

composer require javaabu/manifest
// vite.config.js
import laravel from "laravel-vite-plugin"
import { defineConfig } from "vite"
import manifest from "./vendor/javaabu/manifest/dist/vite.js"

export default defineConfig({
  plugins: [laravel({ input: ["resources/js/app.js"], refresh: true }), manifest()],
})
php artisan manifest:check   # installs what packages need from npm
php artisan manifest:types   # TypeScript paths and Inertia page types
Building Read
An app Installation & Setup, Loading assets in Blade, Inertia pages
A package Registering assets, Building a package

The reference packages are in tests/Fixtures/app/vendor/acme.

Testing

composer test          # PHPUnit
composer lint          # Pint
pnpm install
pnpm lint && pnpm format:check && pnpm typecheck
pnpm build             # dist/, committed
pnpm test:coverage     # Vitest: unit tests, plus real Vite builds and a dev server (needs PHP)
vendor/bin/phpunit --group e2e   # renders pages against that build

Changelog

Please see CHANGELOG for what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email info@javaabu.com instead of using the issue tracker.

License

MIT. See LICENSE.md.

About

Laravel asset shipper: lets packages declare their CSS, JS, Sass, TS, React and Vue assets in their service provider, loads them automatically or where the developer chooses, and builds them with Vite

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0