saber13812002/nova-packages-tool
Composer 安装命令:
composer require saber13812002/nova-packages-tool
包简介
Tool for Laravel Nova Packages Development
README 文档
README
This library provides a versioning laravel-nova mixins dependency for 3rd party packages built for Laravel Nova.
Why?
laravel-nova may introduce breaking and none breaking improvements from time to time. To maintain compatibility all 3rd party packages should rebuild their packages each time Laravel Nova released a new version.
By skipping this process and depending on the severity of the changes it may result in your application no longer working and you are locked to an older version and have to wait each affecting 3rd packages to update their code.
Pros
nova-kit/nova-packages-toolreduces the maintaining hurdle for each 3rd party package utilizinglaravel-nova.- The
distgenerated file will be reduced since 3rd party package is no longer required to buildlaravel-novasource code.
Cons
- Each time Laravel Nova made a new release, you need to wait until
nova-kit/nova-packages-toolmake a new compatible release.
Installation
To install through composer, run the following command from terminal:
composer require "nova-kit/nova-packages-tool:^1.0"
Next, make sure your application's composer.json contains the following command under script.post-autoload-dump:
{
"script" : {
"post-autoload-dump": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
]
}
}
Usages
First, you need to add webpack.external alias to laravel-nova and comment the existing reference to vendor/laravel/nova/resources/js/mixins/js/packages.js under nova.mix.js:
webpackConfig.externals = { vue: 'Vue', 'laravel-nova': 'LaravelNova' } // webpackConfig.resolve.alias = { // ...(webpackConfig.resolve.alias || {}), // 'laravel-nova': path.join( // __dirname, // 'vendor/laravel/nova/resources/js/mixins/packages.js' // ), // }
This would allow your package to depends on laravel-nova from external source and no longer compiled it locally.
Theme Switched Event
Instead of manually registering custom MutationObserver on each package, you can now listen to a single nova-theme-switched event:
Nova.$on('nova-theme-switched', ({ theme, element }) => { if (theme === 'dark') { element.add('package-dark') } else { element.remove('package-dark') } })
Nightly Build
Those who just can't wait for compatible release you have to option to use our nightly build by running the following command on your Laravel Nova application:
composer require nova-kit/nova-packages-tool:"dev-next as 1.999.999"
saber13812002/nova-packages-tool 适用场景与选型建议
saber13812002/nova-packages-tool 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 06 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 saber13812002/nova-packages-tool 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 saber13812002/nova-packages-tool 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-06-02