Skip to content

Commit 94c92a4

Browse files
authored
Merge pull request #113 from kirschbaum-development/feature/nova-4-support
Nova 4 Upgrade
2 parents 4670bfa + f10a4d1 commit 94c92a4

25 files changed

+312
-216
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
phpunit:
66
runs-on: ubuntu-latest
77
container:
8-
image: kirschbaumdevelopment/laravel-test-runner:7.3.0
8+
image: kirschbaumdevelopment/laravel-test-runner:8.0
99

1010
services:
1111
mysql:
@@ -23,8 +23,7 @@ jobs:
2323
fetch-depth: 1
2424

2525
- name: Configure composer for Nova
26-
run: |
27-
composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_PASSWORD }}"
26+
run: composer config 'http-basic.nova.laravel.com' '${{ secrets.NOVA_USERNAME }}' '${{ secrets.NOVA_LICENSE_KEY }}'
2827

2928
- name: Install composer dependencies
3029
run: |

.github/workflows/code-style.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
php-cs-fixer:
55
runs-on: ubuntu-latest
66
container:
7-
image: kirschbaumdevelopment/laravel-test-runner:7.3.0
7+
image: kirschbaumdevelopment/laravel-test-runner:8.0
88

99
steps:
1010
- uses: actions/checkout@v1

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ composer.phar
66
composer.lock
77
phpunit.xml
88
.phpunit.result.cache
9+
.php-cs-fixer.cache
910
.DS_Store
1011
Thumbs.db
1112
.php_cs.cache
13+
14+
auth.json

.php_cs renamed to .php-cs-fixer.php

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
->ignoreDotFiles(true)
1010
->ignoreVCS(true);
1111

12-
return PhpCsFixer\Config::create()
12+
return (new PhpCsFixer\Config())
1313
->setFinder($finder)
1414
->setRules([
1515
'@PSR2' => true,
@@ -20,9 +20,14 @@
2020
],
2121
'no_singleline_whitespace_before_semicolons' => true,
2222
'no_extra_blank_lines' => [
23-
'break', 'case', 'continue', 'curly_brace_block', 'default',
24-
'extra', 'parenthesis_brace_block', 'return',
25-
'square_brace_block', 'switch', 'throw', 'use', 'useTrait', 'use_trait',
23+
'tokens' => [
24+
'curly_brace_block',
25+
'extra',
26+
'parenthesis_brace_block',
27+
'square_brace_block',
28+
'throw',
29+
'use',
30+
]
2631
],
2732
'cast_spaces' => [
2833
'space' => 'single',
@@ -43,7 +48,7 @@
4348
// 'increment_style' => ['style' => 'post'],
4449
'short_scalar_cast' => true,
4550
'class_attributes_separation' => [
46-
'elements' => ['const', 'method', 'property'],
51+
'elements' => ['method' => 'one',],
4752
],
4853
'no_mixed_echo_print' => [
4954
'use' => 'echo',
@@ -54,7 +59,7 @@
5459
],
5560
'no_empty_statement' => true,
5661
'unary_operator_spaces' => true, // $number ++ becomes $number++
57-
'hash_to_slash_comment' => true, // # becomes //
62+
'single_line_comment_style' => true, // # becomes //
5863
'standardize_not_equals' => true, // <> becomes !=
5964
'native_function_casing' => true,
6065
'ternary_operator_spaces' => true,
@@ -64,16 +69,7 @@
6469
],
6570
'function_typehint_space' => true,
6671
'no_leading_import_slash' => true,
67-
'blank_line_before_statement' => [
68-
'statements' => [
69-
'break', 'case', 'continue',
70-
'declare', 'default', 'die',
71-
'do', 'exit', 'for', 'foreach',
72-
'goto', 'if', 'include',
73-
'include_once', 'require', 'require_once',
74-
'return', 'switch', 'throw', 'try', 'while', 'yield',
75-
],
76-
],
72+
'blank_line_before_statement' => true,
7773
'combine_consecutive_unsets' => true,
7874
'method_chaining_indentation' => true,
7975
'no_whitespace_in_blank_line' => true,
@@ -84,7 +80,7 @@
8480
'compact_nullable_typehint' => true,
8581
'explicit_string_variable' => true,
8682
'no_leading_namespace_whitespace' => true,
87-
'trailing_comma_in_multiline_array' => true,
83+
'trailing_comma_in_multiline' => true,
8884
'not_operator_with_successor_space' => true,
8985
'object_operator_without_whitespace' => true,
9086
'single_blank_line_before_namespace' => true,
@@ -113,7 +109,7 @@
113109
'protected',
114110
'private',
115111
],
116-
'sortAlgorithm' => 'none',
112+
'sort_algorithm' => 'none',
117113
],
118114
'return_type_declaration' => [
119115
'space_before' => 'none',

composer.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
],
88
"license": "MIT",
99
"require": {
10-
"php": ">=7.1.0"
10+
"php": "^7.4|^8.0"
1111
},
1212
"repositories": [
1313
{
@@ -16,11 +16,10 @@
1616
}
1717
],
1818
"require-dev": {
19-
"codedungeon/phpunit-result-printer": "^0.26.2",
20-
"orchestra/testing": "^4.0",
21-
"phpunit/phpunit": "^8.3",
19+
"orchestra/testbench": "^7.4",
20+
"phpunit/phpunit": "^9.5.10",
2221
"mockery/mockery": "^1.1",
23-
"laravel/nova": "*"
22+
"laravel/nova": "4.2"
2423
},
2524
"autoload": {
2625
"psr-4": {

dist/css/field.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

dist/js/field.js

Lines changed: 2 additions & 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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*!
2+
* vuex v4.1.0
3+
* (c) 2022 Evan You
4+
* @license MIT
5+
*/
6+
7+
/**
8+
* @license
9+
* Lodash <https://lodash.com/>
10+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
11+
* Released under MIT license <https://lodash.com/license>
12+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
13+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
14+
*/
15+
16+
/**!
17+
* Sortable 1.14.0
18+
* @author RubaXa <[email protected]>
19+
* @author owenm <[email protected]>
20+
* @license MIT
21+
*/

dist/mix-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"/js/field.js": "/js/field.js",
33
"/css/field.css": "/css/field.css"
4-
}
4+
}

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())

0 commit comments

Comments
 (0)