-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update dependencies * Wip * Fix tests * Wip * Changelog * Readme * Screenshot * Wip * Fix
- Loading branch information
1 parent
45f4567
commit cd157b4
Showing
38 changed files
with
356 additions
and
840 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,20 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
brances: [main] | ||
|
||
branches: [1.x, 2.x] | ||
jobs: | ||
test: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v2 | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
fetch-depth: 1 | ||
- env: | ||
php-version: 8.0 | ||
- run: composer config http-basic.nova.laravel.com $NOVA_USERNAME $NOVA_PASSWORD | ||
env: | ||
NOVA_USERNAME: ${{ secrets.NOVA_USERNAME }} | ||
NOVA_PASSWORD: ${{ secrets.NOVA_PASSWORD }} | ||
run: | | ||
composer config http-basic.nova.laravel.com $NOVA_USERNAME $NOVA_PASSWORD | ||
composer install -n --prefer-dist --no-ansi --no-progress --no-suggest --no-scripts | ||
- uses: ramsey/composer-install@v2 | ||
- run: vendor/bin/phpunit --testdox --colors=always | ||
- run: | | ||
npm install | ||
npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"/js/tool.js": "/js/tool.js" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,22 @@ | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"dev": "NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | ||
"watch": "NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | ||
"prod": "NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | ||
"test": "jest --verbose" | ||
"dev": "mix", | ||
"watch": "mix watch", | ||
"prod": "mix --production" | ||
}, | ||
"devDependencies": { | ||
"@vue/test-utils": "^1.0.0-beta.29", | ||
"codemirror": "^5.49.0", | ||
"cross-env": "^6.0.0", | ||
"jest": "^24.8.0", | ||
"laravel-mix": "^1.0", | ||
"vue-jest": "^3.0.4" | ||
"@vue/compiler-sfc": "^3.2.22", | ||
"codemirror": "^5.65.2", | ||
"laravel-mix": "^6.0.41", | ||
"lodash": "^4.17.21", | ||
"prettier": "^2.6.2", | ||
"vue": "^3.2.33", | ||
"vue-loader": "^17.0.0" | ||
}, | ||
"dependencies": { | ||
"vue": "^2.5.0" | ||
}, | ||
"jest": { | ||
"moduleFileExtensions": [ | ||
"js", | ||
"vue" | ||
], | ||
"moduleNameMapper": { | ||
"^@/(.*)$": "<rootDir>/resources/js/$1" | ||
}, | ||
"transform": { | ||
"^.+\\.js$": "babel-jest", | ||
"^.+\\.vue$": "vue-jest" | ||
}, | ||
"testMatch": [ | ||
"<rootDir>/tests/js/**/*.spec.js" | ||
] | ||
}, | ||
"babel": { | ||
"env": { | ||
"test": { | ||
"presets": [ | ||
[ | ||
"env", | ||
{ | ||
"targets": { | ||
"node": "current" | ||
} | ||
} | ||
] | ||
] | ||
} | ||
} | ||
"prettier": { | ||
"printWidth": 140, | ||
"tabWidth": 4, | ||
"singleQuote": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
colors="true"> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true"> | ||
<testsuites> | ||
<testsuite name="Nova Settings Tool Tests"> | ||
<testsuite name="Nova Settings Tool"> | ||
<directory>./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<coverage processUncoveredFiles="true"> | ||
<include> | ||
<directory suffix=".php">./src</directory> | ||
</include> | ||
</coverage> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,75 @@ | ||
<template> | ||
<default-setting :setting="setting" :errors="errors || []"> | ||
|
||
<template slot="setting"> | ||
|
||
<div class="form-input-bordered px-0 overflow-hidden"> | ||
<textarea ref="textarea" :id="setting.key"/> | ||
</div> | ||
|
||
</template> | ||
|
||
</default-setting> | ||
<DefaultSetting :setting="setting" :errors="errors || []"> | ||
<div class="form-input form-input-bordered px-0 overflow-hidden"> | ||
<textarea ref="txt" :id="setting.key" /> | ||
</div> | ||
</DefaultSetting> | ||
</template> | ||
|
||
<script> | ||
import DefaultSetting from './DefaultSetting' | ||
import CodeMirror from 'codemirror' | ||
import 'codemirror/mode/php/php' | ||
import 'codemirror/mode/javascript/javascript' | ||
import 'codemirror/mode/css/css' | ||
import 'codemirror/mode/htmlmixed/htmlmixed' | ||
import 'codemirror/mode/markdown/markdown' | ||
import 'codemirror/mode/yaml/yaml' | ||
import 'codemirror/mode/shell/shell' | ||
import CodeMirror from 'codemirror'; | ||
import 'codemirror/keymap/vim'; | ||
import 'codemirror/mode/css/css'; | ||
import 'codemirror/mode/dockerfile/dockerfile'; | ||
import 'codemirror/mode/htmlmixed/htmlmixed'; | ||
import 'codemirror/mode/javascript/javascript'; | ||
import 'codemirror/mode/markdown/markdown'; | ||
import 'codemirror/mode/nginx/nginx'; | ||
import 'codemirror/mode/php/php'; | ||
import 'codemirror/mode/shell/shell'; | ||
import 'codemirror/mode/sql/sql'; | ||
import 'codemirror/mode/vue/vue'; | ||
import 'codemirror/mode/xml/xml'; | ||
import 'codemirror/mode/yaml/yaml'; | ||
import 'codemirror/mode/yaml-frontmatter/yaml-frontmatter'; | ||
import DefaultSetting from './DefaultSetting.vue'; | ||
export default { | ||
components: { DefaultSetting }, | ||
components: { | ||
DefaultSetting, | ||
}, | ||
props: { | ||
setting: Object, | ||
errors: Array, | ||
}, | ||
data: () => ({ | ||
codemirror: null, | ||
}), | ||
computed: { | ||
doc() { | ||
return this.codemirror.getDoc() | ||
}, | ||
}, | ||
emits: ['update'], | ||
codemirror: null, | ||
mounted() { | ||
this.codemirror = CodeMirror.fromTextArea(this.$refs.textarea, { | ||
this.codemirror = CodeMirror.fromTextArea(this.$refs.txt, { | ||
indentUnit: 4, | ||
lineNumbers: true, | ||
mode: this.setting.language, | ||
theme: 'solarized light', | ||
viewportMargin: Infinity, | ||
}) | ||
this.doc.setValue(this.setting.value || '') | ||
this.doc.on('change', (cm, change) => { | ||
}); | ||
this.codemirror?.getDoc()?.on('change', (cm, changeObj) => { | ||
this.$emit('update', { | ||
key: this.setting.key, | ||
value: cm.getValue(), | ||
}) | ||
}) | ||
}); | ||
}); | ||
this.codemirror?.getDoc()?.setValue(this.setting.value); | ||
this.codemirror?.setSize('100%'); | ||
}, | ||
} | ||
}; | ||
</script> | ||
<style src="codemirror/lib/codemirror.css"/> | ||
<style src="codemirror/theme/solarized.css"/> | ||
|
||
<style> | ||
@import 'codemirror/lib/codemirror.css'; | ||
@import 'codemirror/theme/solarized.css'; | ||
@import url(https://cdn.jsdelivr.net/gh/tonsky/[email protected]/distr/fira_code.css); | ||
.CodeMirror { | ||
font-family: "Fira Code", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; | ||
font-family: 'Fira Code', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; | ||
font-size: 14px; | ||
line-height: 1.75; | ||
font-weight: 500; | ||
-moz-box-shadow: none !important; | ||
-webkit-box-shadow: none !important; | ||
box-shadow: none !important; | ||
} | ||
.cm-s-solarized.cm-s-light { | ||
background-color: #fdf6e3 !important; | ||
color: #657b83 !important; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,33 @@ | ||
<template> | ||
<setting-wrapper :stacked="setting.stacked"> | ||
|
||
<div class="w-1/5 px-8" :class="setting.stacked ? 'pt-6' : 'py-6'"> | ||
|
||
<setting-label :label-for="setting.key" :class="{ 'mb-2': setting.help }"> | ||
<SettingWrapper :stacked="setting.stacked"> | ||
<div class="px-8 mt-2 md:mt-0" :class="setting.stacked ? 'md:pt-5 w-full' : 'w-full md:w-1/5 md:py-5'"> | ||
<SettingLabel :label-for="setting.key" :class="{ 'mb-2': setting.help }"> | ||
{{ __(setting.label) }} | ||
</setting-label> | ||
|
||
</SettingLabel> | ||
</div> | ||
|
||
<div class="py-6 px-8" :class="settingClasses"> | ||
|
||
<slot name="setting"/> | ||
|
||
<setting-help class="error-text text-danger" v-if="errors.length"> | ||
{{ errors[0] }} | ||
</setting-help> | ||
|
||
<setting-help v-if="setting.help"> | ||
{{ __(setting.help) }} | ||
</setting-help> | ||
|
||
<div class="mt-1 md:mt-0 pb-5 px-8" :class="setting.stacked ? 'md:pt-5 w-full' : 'w-full md:w-3/5 md:py-5'"> | ||
<slot /> | ||
<SettingHelp class="mt-2 help-text-error" v-if="errors.length">{{ errors[0] }}</SettingHelp> | ||
<SettingHelp class="mt-2 help-text" v-if="setting.help" v-html="__(setting.help)" /> | ||
</div> | ||
|
||
</setting-wrapper> | ||
</SettingWrapper> | ||
</template> | ||
|
||
<script> | ||
import SettingHelp from './SettingHelp' | ||
import SettingLabel from './SettingLabel' | ||
import SettingWrapper from './SettingWrapper' | ||
import SettingHelp from './SettingHelp.vue'; | ||
import SettingLabel from './SettingLabel.vue'; | ||
import SettingWrapper from './SettingWrapper.vue'; | ||
export default { | ||
components: { SettingHelp, SettingLabel, SettingWrapper }, | ||
components: { | ||
SettingHelp, | ||
SettingLabel, | ||
SettingWrapper, | ||
}, | ||
props: { | ||
setting: Object, | ||
fullWidth: Boolean, | ||
errors: Array, | ||
}, | ||
computed: { | ||
settingClasses() { | ||
return this.fullWidth ? (this.setting.stacked ? 'w-full' : 'w-4/5') : 'w-1/2' | ||
}, | ||
}, | ||
} | ||
}; | ||
</script> |
Oops, something went wrong.