diff options
26 files changed, 1143 insertions, 1112 deletions
diff --git a/example/config.json b/example/config.json index 51baf84..6483257 100644 --- a/example/config.json +++ b/example/config.json | |||
@@ -1,3 +1,3 @@ | |||
1 | { | 1 | { |
2 | "galleryRoot": "out/" | 2 | "galleryRoot": "out/" |
3 | } \ No newline at end of file | 3 | } |
diff --git a/scripts/.gitignore b/scripts/.gitignore new file mode 100644 index 0000000..2cb7368 --- /dev/null +++ b/scripts/.gitignore | |||
@@ -0,0 +1 @@ | |||
local_* | |||
diff --git a/scripts/readme.md b/scripts/readme.md new file mode 100644 index 0000000..9bb97ec --- /dev/null +++ b/scripts/readme.md | |||
@@ -0,0 +1,24 @@ | |||
1 | # ldgallery scripts | ||
2 | |||
3 | Some utilities. | ||
4 | Prefix the filename of your custom script with "local_", they are git-ignored. | ||
5 | |||
6 | ## Build | ||
7 | |||
8 | ### win_build.cmd | ||
9 | |||
10 | Build the compiler. See {../compiler/readme.md} | ||
11 | |||
12 | ### win_help.cmd | ||
13 | |||
14 | Shows the compiler's command line help. | ||
15 | |||
16 | ### win_compile_example.cmd | ||
17 | |||
18 | Compile the example gallery, for demonstration purposes. See {../example/readme.md} | ||
19 | |||
20 | ### win_generate_yaml_files.cmd | ||
21 | |||
22 | Generates template YAML files for your gallery. | ||
23 | Copy this CMD to your pictures folder. | ||
24 | |||
diff --git a/compiler/win_build.cmd b/scripts/win_build.cmd index 33559fa..ed96211 100644 --- a/compiler/win_build.cmd +++ b/scripts/win_build.cmd | |||
@@ -1,4 +1,5 @@ | |||
1 | @echo off | 1 | @echo off |
2 | cd ..\compiler\ | ||
2 | stack setup | 3 | stack setup |
3 | stack build | 4 | stack build |
4 | pause \ No newline at end of file | 5 | pause \ No newline at end of file |
diff --git a/compiler/win_compile_example.cmd b/scripts/win_compile_example.cmd index 3a52f73..1226269 100644 --- a/compiler/win_compile_example.cmd +++ b/scripts/win_compile_example.cmd | |||
@@ -3,6 +3,7 @@ SET rebuild=--rebuild | |||
3 | CHOICE /M "Rebuild all ('--rebuild' argument)?" | 3 | CHOICE /M "Rebuild all ('--rebuild' argument)?" |
4 | IF ERRORLEVEL 2 SET rebuild= | 4 | IF ERRORLEVEL 2 SET rebuild= |
5 | echo. | 5 | echo. |
6 | cd ..\compiler\ | ||
6 | 7 | ||
7 | @echo on | 8 | @echo on |
8 | stack exec ldgallery-compiler-exe -- %rebuild% --clean-output -i=../example/src/ -o=../example/out/ | 9 | stack exec ldgallery-compiler-exe -- %rebuild% --clean-output -i=../example/src/ -o=../example/out/ |
diff --git a/scripts/win_generate_yaml_files.cmd b/scripts/win_generate_yaml_files.cmd new file mode 100644 index 0000000..edb7f91 --- /dev/null +++ b/scripts/win_generate_yaml_files.cmd | |||
@@ -0,0 +1,21 @@ | |||
1 | @echo off | ||
2 | |||
3 | REM Copy this file to your picture directory to quickly generate the YAML templates | ||
4 | REM =============================================================================== | ||
5 | |||
6 | for %%f in (*.jpg,*.png,*.gif) do ( | ||
7 | if exist "%%f.yaml" goto CONTINUE | ||
8 | @echo %%f | ||
9 | ( | ||
10 | echo title: %%f | ||
11 | echo. | ||
12 | echo datetime: | ||
13 | echo. | ||
14 | echo description: | ||
15 | echo. | ||
16 | echo tags: | ||
17 | echo - not_tagged | ||
18 | ) >> "%%f.yaml" | ||
19 | :CONTINUE | ||
20 | rem | ||
21 | ) | ||
diff --git a/compiler/win_help.cmd b/scripts/win_help.cmd index d720f65..117205a 100644 --- a/compiler/win_help.cmd +++ b/scripts/win_help.cmd | |||
@@ -1,4 +1,5 @@ | |||
1 | @echo off | 1 | @echo off |
2 | cd ..\compiler\ | ||
2 | stack exec ldgallery-compiler-exe -- --help | 3 | stack exec ldgallery-compiler-exe -- --help |
3 | @echo. | 4 | @echo. |
4 | @pause | 5 | @pause |
diff --git a/viewer/win_start_vueui.cmd b/scripts/win_start_vueui.cmd index cee15e8..b79a7b7 100644 --- a/viewer/win_start_vueui.cmd +++ b/scripts/win_start_vueui.cmd | |||
@@ -1,6 +1,7 @@ | |||
1 | @echo off | 1 | @echo off |
2 | set NODE_VERSION=12.14.0 | 2 | set NODE_VERSION=12.14.0 |
3 | set VUECLI_VERSION=4.1.1 | 3 | set VUECLI_VERSION=4.2.2 |
4 | cd ..\viewer\ | ||
4 | 5 | ||
5 | chcp 65001 | 6 | chcp 65001 |
6 | echo. | 7 | echo. |
@@ -18,6 +19,17 @@ if errorlevel 1 ( | |||
18 | cmd /c npm install -g @vue/cli@%VUECLI_VERSION% | 19 | cmd /c npm install -g @vue/cli@%VUECLI_VERSION% |
19 | ) | 20 | ) |
20 | echo. | 21 | echo. |
22 | npm view -g @vue/cli version | find /i "%VUECLI_VERSION%" | ||
23 | if errorlevel 1 ( | ||
24 | echo ====================================================================== | ||
25 | echo Warning: vue/cli doesn't match the requested version: %VUECLI_VERSION% | ||
26 | echo. | ||
27 | echo CTRL+C to quit and update, or press a key to ignore this warning... | ||
28 | echo ====================================================================== | ||
29 | echo. | ||
30 | pause | ||
31 | ) | ||
32 | echo. | ||
21 | echo === npm install === | 33 | echo === npm install === |
22 | cmd /c npm install | 34 | cmd /c npm install |
23 | echo. | 35 | echo. |
diff --git a/viewer/.eslintrc.js b/viewer/.eslintrc.js index 40d2a11..e1ad89b 100644 --- a/viewer/.eslintrc.js +++ b/viewer/.eslintrc.js | |||
@@ -13,6 +13,7 @@ module.exports = { | |||
13 | rules: { | 13 | rules: { |
14 | "no-console": "off", | 14 | "no-console": "off", |
15 | "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off", | 15 | "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off", |
16 | 'eol-last': ['warn', 'always'], | ||
16 | 'vue/attribute-hyphenation': 'warn', | 17 | 'vue/attribute-hyphenation': 'warn', |
17 | 'vue/html-closing-bracket-spacing': 'warn', | 18 | 'vue/html-closing-bracket-spacing': 'warn', |
18 | 'vue/html-end-tags': 'error', | 19 | 'vue/html-end-tags': 'error', |
@@ -24,7 +25,7 @@ module.exports = { | |||
24 | 'vue/v-bind-style': 'warn', | 25 | 'vue/v-bind-style': 'warn', |
25 | 'vue/v-on-style': 'warn', | 26 | 'vue/v-on-style': 'warn', |
26 | 'vue/attributes-order': 'warn', | 27 | 'vue/attributes-order': 'warn', |
27 | 'vue/this-in-template': 'warn' | 28 | 'vue/this-in-template': 'warn', |
28 | }, | 29 | }, |
29 | 30 | ||
30 | parserOptions: { | 31 | parserOptions: { |
diff --git a/viewer/.vscode/tasks.json b/viewer/.vscode/tasks.json index 3c02098..102002d 100644 --- a/viewer/.vscode/tasks.json +++ b/viewer/.vscode/tasks.json | |||
@@ -9,7 +9,10 @@ | |||
9 | "group": { | 9 | "group": { |
10 | "kind": "build", | 10 | "kind": "build", |
11 | "isDefault": true | 11 | "isDefault": true |
12 | } | 12 | }, |
13 | "problemMatcher": [ | ||
14 | "$tsc" | ||
15 | ] | ||
13 | }, | 16 | }, |
14 | { | 17 | { |
15 | "type": "npm", | 18 | "type": "npm", |
@@ -17,6 +20,20 @@ | |||
17 | "problemMatcher": [ | 20 | "problemMatcher": [ |
18 | "$tsc" | 21 | "$tsc" |
19 | ] | 22 | ] |
23 | }, | ||
24 | { | ||
25 | "type": "npm", | ||
26 | "script": "lint-autoformat", | ||
27 | "problemMatcher": [ | ||
28 | "$tsc" | ||
29 | ] | ||
30 | }, | ||
31 | { | ||
32 | "type": "npm", | ||
33 | "script": "lint", | ||
34 | "problemMatcher": [ | ||
35 | "$tsc" | ||
36 | ] | ||
20 | } | 37 | } |
21 | ] | 38 | ] |
22 | } \ No newline at end of file | 39 | } \ No newline at end of file |
diff --git a/viewer/babel.config.js b/viewer/babel.config.js index 7102a6e..1378522 100644 --- a/viewer/babel.config.js +++ b/viewer/babel.config.js | |||
@@ -1,7 +1,5 @@ | |||
1 | module.exports = { | 1 | module.exports = { |
2 | presets: ["@vue/cli-plugin-babel/preset"], | 2 | presets: ["@vue/cli-plugin-babel/preset"], |
3 | plugins: [ | 3 | plugins: [ |
4 | '@babel/plugin-proposal-optional-chaining', | ||
5 | '@babel/plugin-proposal-nullish-coalescing-operator', | ||
6 | ], | 4 | ], |
7 | }; | 5 | }; |
diff --git a/viewer/package-lock.json b/viewer/package-lock.json index 4b778a3..87825c8 100644 --- a/viewer/package-lock.json +++ b/viewer/package-lock.json | |||
@@ -14,28 +14,28 @@ | |||
14 | } | 14 | } |
15 | }, | 15 | }, |
16 | "@babel/compat-data": { | 16 | "@babel/compat-data": { |
17 | "version": "7.8.1", | 17 | "version": "7.8.5", |