add nova
This commit is contained in:
10
nova/src/Console/asset-stubs/.gitignore
vendored
Normal file
10
nova/src/Console/asset-stubs/.gitignore
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/.idea
|
||||
/vendor
|
||||
/node_modules
|
||||
package-lock.json
|
||||
composer.phar
|
||||
composer.lock
|
||||
phpunit.xml
|
||||
.phpunit.result.cache
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
29
nova/src/Console/asset-stubs/composer.json
Normal file
29
nova/src/Console/asset-stubs/composer.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "{{ name }}",
|
||||
"description": "A Laravel Nova asset.",
|
||||
"keywords": [
|
||||
"laravel",
|
||||
"nova"
|
||||
],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^7.3|^8.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"{{ escapedNamespace }}\\": "src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"{{ escapedNamespace }}\\AssetServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
||||
24
nova/src/Console/asset-stubs/nova.mix.js
Normal file
24
nova/src/Console/asset-stubs/nova.mix.js
Normal file
@@ -0,0 +1,24 @@
|
||||
const mix = require('laravel-mix')
|
||||
const webpack = require('webpack')
|
||||
|
||||
class NovaExtension {
|
||||
name() {
|
||||
return 'nova-extension'
|
||||
}
|
||||
|
||||
register(name) {
|
||||
this.name = name
|
||||
}
|
||||
|
||||
webpackConfig(webpackConfig) {
|
||||
webpackConfig.externals = {
|
||||
vue: 'Vue',
|
||||
}
|
||||
|
||||
webpackConfig.output = {
|
||||
uniqueName: this.name,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mix.extend('nova', new NovaExtension())
|
||||
20
nova/src/Console/asset-stubs/package.json
Normal file
20
nova/src/Console/asset-stubs/package.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "npm run development",
|
||||
"development": "mix",
|
||||
"watch": "mix watch",
|
||||
"watch-poll": "mix watch -- --watch-options-poll=1000",
|
||||
"hot": "mix watch --hot",
|
||||
"prod": "npm run production",
|
||||
"production": "mix --production",
|
||||
"nova:install": "npm --prefix='../../vendor/laravel/nova' ci"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/compiler-sfc": "^3.2.22",
|
||||
"laravel-mix": "^6.0.41",
|
||||
"postcss": "^8.3.11",
|
||||
"vue-loader": "^16.8.3"
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
||||
1
nova/src/Console/asset-stubs/postcss.config.js
Normal file
1
nova/src/Console/asset-stubs/postcss.config.js
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = {}
|
||||
1
nova/src/Console/asset-stubs/resources/css/asset.css
Normal file
1
nova/src/Console/asset-stubs/resources/css/asset.css
Normal file
@@ -0,0 +1 @@
|
||||
/* Nova Asset CSS */
|
||||
5
nova/src/Console/asset-stubs/resources/js/asset.js
Normal file
5
nova/src/Console/asset-stubs/resources/js/asset.js
Normal file
@@ -0,0 +1,5 @@
|
||||
// import {{ class }} from './components/{{ class }}'
|
||||
|
||||
// Nova.booting(app => {
|
||||
// app.component('{{ name }}', {{ class }})
|
||||
// })
|
||||
33
nova/src/Console/asset-stubs/src/AssetServiceProvider.stub
Normal file
33
nova/src/Console/asset-stubs/src/AssetServiceProvider.stub
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Laravel\Nova\Events\ServingNova;
|
||||
use Laravel\Nova\Nova;
|
||||
|
||||
class AssetServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
Nova::serving(function (ServingNova $event) {
|
||||
Nova::script('{{ component }}', __DIR__.'/../dist/js/asset.js');
|
||||
Nova::style('{{ component }}', __DIR__.'/../dist/css/asset.css');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
14
nova/src/Console/asset-stubs/webpack.mix.js
Normal file
14
nova/src/Console/asset-stubs/webpack.mix.js
Normal file
@@ -0,0 +1,14 @@
|
||||
let mix = require('laravel-mix')
|
||||
let path = require('path')
|
||||
|
||||
require('./nova.mix')
|
||||
|
||||
mix
|
||||
.setPublicPath('dist')
|
||||
.js('resources/js/asset.js', 'js')
|
||||
.vue({ version: 3 })
|
||||
.css('resources/css/asset.css', 'css')
|
||||
.alias({
|
||||
'@': path.join(__dirname, 'resources/js/'),
|
||||
})
|
||||
.nova('{{ name }}')
|
||||
Reference in New Issue
Block a user