Skip to content

Commit f45e8c5

Browse files
committed
#20 Update assets to support Nova v4
1 parent 164f19c commit f45e8c5

File tree

13 files changed

+101
-48
lines changed

13 files changed

+101
-48
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
max_line_length = 120
11+
tab_width = 4
12+
13+
[*.{yml,yaml}]
14+
indent_size = 2

.github/workflows/run-tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ jobs:
1010
matrix:
1111
os: [ ubuntu-latest ]
1212
php: [ 8.0, 8.1 ]
13-
laravel: [ 8.* ]
13+
laravel: [ 8.*, 9.* ]
1414
dependency-version: [ prefer-stable ]
1515
include:
1616
- laravel: 8.*
1717
testbench: 6.*
18+
- laravel: 9.*
19+
testbench: 7.*
1820

1921
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
2022

@@ -36,7 +38,7 @@ jobs:
3638
3739
- name: Install dependencies
3840
run: |
39-
composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_PASSWORD }}"
41+
composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_4_LICENSE_KEY }}"
4042
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
4143
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
4244
env:

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ To access it, please use `savingCallback()` method (see an extended example belo
4343
Basic field config:
4444

4545
```php
46+
use \InteractionDesignFoundation\NovaUnlayerField\Unlayer;
47+
4648
public function fields()
4749
{
48-
return [
50+
return [
4951
Unlayer::make('Content', 'design')->config([
5052
'projectId' => config('unlayer.project_id'),
5153

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
"require": {
1111
"php": ">=8.0",
1212
"ext-json": "*",
13-
"laravel/nova": "^3.0"
13+
"laravel/nova": "^4.0"
1414
},
1515
"require-dev": {
16-
"orchestra/testbench": "^6.0",
16+
"orchestra/testbench": "^7.0",
1717
"phpunit/phpunit": "^9.5"
1818
},
1919
"repositories": [
2020
{
21-
"type": "composer", "url": "https://nova.laravel.com"
21+
"type": "composer",
22+
"url": "https://nova.laravel.com"
2223
}
2324
],
2425
"autoload": {
@@ -44,6 +45,6 @@
4445
"minimum-stability": "dev",
4546
"prefer-stable": true,
4647
"scripts": {
47-
"test": "phpunit"
48+
"test": "phpunit --colors=always"
4849
}
4950
}

dist/js/field.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/field.js.LICENSE.txt

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
/*!
2-
* Determine if an object is a Buffer
3-
*
4-
* @author Feross Aboukhadijeh <https://feross.org>
5-
* @license MIT
6-
*/
7-
8-
/**
9-
* @license
10-
* Lodash <https://lodash.com/>
11-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
12-
* Released under MIT license <https://lodash.com/license>
13-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
14-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
2+
* vuex v4.0.2
3+
* (c) 2021 Evan You
4+
* @license MIT
155
*/

dist/mix-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"/js/field.js": "/js/field.js?id=91285b3fc9d7bd26b92f"
2+
"/js/field.js": "/js/field.js?id=7f5d3737502d8dbd08b746be701720e6"
33
}

nova.mix.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
const mix = require('laravel-mix')
2+
const webpack = require('webpack')
3+
const path = require('path')
4+
5+
class NovaExtension {
6+
name() {
7+
return 'nova-extension'
8+
}
9+
10+
register(name) {
11+
this.name = name
12+
}
13+
14+
webpackPlugins() {
15+
return new webpack.ProvidePlugin({
16+
_: 'lodash',
17+
Errors: 'form-backend-validation',
18+
})
19+
}
20+
21+
webpackConfig(webpackConfig) {
22+
webpackConfig.externals = {
23+
vue: 'Vue',
24+
}
25+
26+
webpackConfig.resolve.alias = {
27+
...(webpackConfig.resolve.alias || {}),
28+
'laravel-nova': path.join(
29+
__dirname,
30+
'../../vendor/laravel/nova/resources/js/mixins/packages.js'
31+
),
32+
}
33+
34+
webpackConfig.output = {
35+
uniqueName: this.name,
36+
}
37+
}
38+
}
39+
40+
mix.extend('nova', new NovaExtension())

package.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
{
2-
"private": false,
2+
"private": true,
33
"engines": {
4-
"node": "^14.0"
4+
"node": ">=16.0"
55
},
66
"scripts": {
77
"dev": "npm run development",
88
"development": "mix",
99
"watch": "mix watch",
10+
"watch-poll": "mix watch -- --watch-options-poll=1000",
1011
"hot": "mix watch --hot",
1112
"prod": "npm run production",
12-
"production": "mix --production"
13+
"production": "mix --production",
14+
"nova:install": "npm --prefix='../../vendor/laravel/nova' ci"
1315
},
1416
"devDependencies": {
17+
"@vue/compiler-sfc": "^3.2.22",
18+
"form-backend-validation": "^2.3.3",
1519
"laravel-mix": "^6.0.41",
16-
"laravel-nova": "^1.0",
17-
"vue-loader": "^15.9.8",
18-
"vue-template-compiler": "^2.6.14"
20+
"lodash": "^4.17.21",
21+
"postcss": "^8.3.11",
22+
"vue-loader": "^16.8.3"
1923
},
20-
"dependencies": {
21-
"vue": "^2.5.0"
22-
}
24+
"dependencies": {}
2325
}

resources/js/components/DetailField.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<template>
2-
<panel-item :field="field">
2+
<PanelItem :field="field">
33
<template slot="value">
44
<div class="overflow-hidden">
55
<iframe :id="iframeId" sandbox="allow-scripts allow-same-origin" importance="low" width="100%"></iframe>
66
</div>
77
</template>
8-
</panel-item>
8+
</PanelItem>
99
</template>
1010

1111
<script>

0 commit comments

Comments
 (0)