From 5572ed73763a561ef08ebb99a97e3795be54ba2c Mon Sep 17 00:00:00 2001 From: pacien Date: Fri, 25 Sep 2020 17:58:14 +0200 Subject: docs: shorten lines in preformatted blocks to fit narrow screens --- ldgallery-quickstart.7.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ldgallery-quickstart.7.md b/ldgallery-quickstart.7.md index 4c93f51..684e90d 100644 --- a/ldgallery-quickstart.7.md +++ b/ldgallery-quickstart.7.md @@ -32,7 +32,7 @@ A new gallery can be initialised by creating a directory containing a gallery co ``` ./monument-gallery-source -└── gallery.yaml ----------- gallery settings file +└── gallery.yaml ------ gallery settings file ``` __gallery.yaml__ holds the settings of the gallery. @@ -56,9 +56,9 @@ Optionally, some metadata such as a title and some tags can be associated by cre ``` ./monument-gallery-source -├── gallery.yaml ----------- gallery settings file -├── DSC0001.jpg ------------ a picture -└── DSC0001.jpg.yaml ------- its associated optional sidecar metadata file +├── gallery.yaml ------ gallery settings file +├── DSC0001.jpg ------- a picture +└── DSC0001.jpg.yaml -- its associated optional sidecar metadata file ``` The sidecar metadata file "DSC0001.jpg.yaml" can have the following content: -- cgit v1.2.3 From 3e22ce02fb569d1db06e7a8f564c5aa328dfb92e Mon Sep 17 00:00:00 2001 From: pacien Date: Sat, 26 Sep 2020 18:55:09 +0200 Subject: viewer: fix momentum/kinetic scroll on Safari and Firefox on iOS GitHub: closes #253 --- viewer/src/assets/scss/scrollbar.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/viewer/src/assets/scss/scrollbar.scss b/viewer/src/assets/scss/scrollbar.scss index a00b4c2..4ca0a2c 100644 --- a/viewer/src/assets/scss/scrollbar.scss +++ b/viewer/src/assets/scss/scrollbar.scss @@ -23,6 +23,10 @@ .scrollbar { overflow: auto; + + // enable momentum/kinetic scroll on Safari and Firefox on iOS + -webkit-overflow-scrolling: touch; + scrollbar-color: $scrollbar-color transparent; scrollbar-width: thin; &::-webkit-scrollbar { -- cgit v1.2.3 From 36ba63ee29e8d24dcd0d173560d42045210c0965 Mon Sep 17 00:00:00 2001 From: pacien Date: Sun, 27 Sep 2020 22:51:53 +0200 Subject: docs: update short description We're not limited to pictures anymore --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 6a438ca..831ecf8 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,7 @@ ldgallery ========= -A static gallery generator which turns a collection of tagged pictures into a searchable web gallery. +A static gallery generator which turns a collection of tagged pictures and media into a searchable web gallery. The complete list of features, the user manual, demo and download links can be found on the project's website: https://ldgallery.pacien.org. -- cgit v1.2.3 From 5edf60b9f5cc8daff3226f0eaf6f3a64d2662425 Mon Sep 17 00:00:00 2001 From: pacien Date: Sat, 26 Sep 2020 18:55:09 +0200 Subject: viewer: fix momentum/kinetic scroll on Safari and Firefox on iOS GitHub: closes #253 (cherry picked from commit 3e22ce02fb569d1db06e7a8f564c5aa328dfb92e) --- viewer/src/assets/scss/scrollbar.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/viewer/src/assets/scss/scrollbar.scss b/viewer/src/assets/scss/scrollbar.scss index a00b4c2..4ca0a2c 100644 --- a/viewer/src/assets/scss/scrollbar.scss +++ b/viewer/src/assets/scss/scrollbar.scss @@ -23,6 +23,10 @@ .scrollbar { overflow: auto; + + // enable momentum/kinetic scroll on Safari and Firefox on iOS + -webkit-overflow-scrolling: touch; + scrollbar-color: $scrollbar-color transparent; scrollbar-width: thin; &::-webkit-scrollbar { -- cgit v1.2.3 From 6b6c1145ab8e4e6894eb54b1c98fb4b02e0d17b3 Mon Sep 17 00:00:00 2001 From: pacien Date: Sat, 17 Oct 2020 20:54:18 +0200 Subject: viewer: set pointer cursor on collapsible info panel title bar GitHub: closes #269 --- viewer/src/views/PanelLeft.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/viewer/src/views/PanelLeft.vue b/viewer/src/views/PanelLeft.vue index 0ab3aa8..d2a3656 100644 --- a/viewer/src/views/PanelLeft.vue +++ b/viewer/src/views/PanelLeft.vue @@ -37,7 +37,7 @@ :current-tags="currentTags" /> -

+

{{ $t("panelLeft.information.title") }}

@@ -108,6 +108,10 @@ export default class PanelLeft extends Vue { margin-top: 2px; // Fixes a vertical centering issue with the carret } } + + .infoPanelTitleBar { + cursor: pointer; + } } .flexShrinkFully { -- cgit v1.2.3 From 5711823339b53039c80b55b33f633319648748d9 Mon Sep 17 00:00:00 2001 From: zeroinformatique Date: Sat, 17 Oct 2020 22:47:46 +0200 Subject: viewer: fixed the back button which was not working properly anymore (#271) github: resolves #270--- viewer/src/components/LdCommand.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/viewer/src/components/LdCommand.vue b/viewer/src/components/LdCommand.vue index 6059162..2578055 100644 --- a/viewer/src/components/LdCommand.vue +++ b/viewer/src/components/LdCommand.vue @@ -25,10 +25,10 @@ @@ -55,7 +55,7 @@ export default class LdCommand extends Vue { return this.currentItemPath.length <= 1 && !this.$uiStore.searchMode; } - get isEntryPoint(): boolean { + isEntryPoint(): boolean { return history.state?.ldgallery === "ENTRYPOINT"; // Set by MainLayout.vue } -- cgit v1.2.3 From 5e179a35b23282c4613582755de06a91f6991309 Mon Sep 17 00:00:00 2001 From: zeroinformatique Date: Sun, 18 Oct 2020 00:22:04 +0200 Subject: viewer: accessibility: set focus on the main area (#273) github: resolves #177--- viewer/src/views/MainLayout.vue | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/viewer/src/views/MainLayout.vue b/viewer/src/views/MainLayout.vue index 6ef9a3b..9cd518b 100644 --- a/viewer/src/views/MainLayout.vue +++ b/viewer/src/views/MainLayout.vue @@ -22,7 +22,7 @@ - + @@ -43,6 +43,10 @@ export default class MainLayout extends Vue { isLoading: boolean = true; scrollPositions: ScrollPosition = {}; + get contentDiv() { + return this.content.$el as HTMLDivElement; + } + mounted() { history.replaceState({ ldgallery: "ENTRYPOINT" }, ""); this.fetchGalleryItems(); @@ -53,11 +57,15 @@ export default class MainLayout extends Vue { document.body.removeEventListener("fullscreenchange", this.onFullscreenChange); } + moveFocusToContentDiv() { + setTimeout(() => this.contentDiv.focus()); + } + @Watch("$route") routeChanged(newRoute: Route, oldRoute: Route) { - const el = this.content.$el; - this.scrollPositions[oldRoute.path] = el.scrollTop; - this.$nextTick(() => (el.scrollTop = this.scrollPositions[newRoute.path])); + this.scrollPositions[oldRoute.path] = this.contentDiv.scrollTop; + this.$nextTick(() => (this.contentDiv.scrollTop = this.scrollPositions[newRoute.path])); + this.moveFocusToContentDiv(); } fetchGalleryItems() { @@ -66,6 +74,7 @@ export default class MainLayout extends Vue { .fetchConfig() .then(this.$uiStore.initFromConfig) .then(this.$galleryStore.fetchGalleryItems) + .then(this.moveFocusToContentDiv) .finally(() => (this.isLoading = false)) .catch(this.displayError); } @@ -130,6 +139,9 @@ html { left: var(--layout-left); z-index: 3; overflow-x: hidden; + &:focus { + outline: none; + } } } .fullscreen { -- cgit v1.2.3 From 7f2231d86bb72c83f50693ec96526e7d9f47dfb8 Mon Sep 17 00:00:00 2001 From: zeroinformatique Date: Sun, 18 Oct 2020 01:12:07 +0200 Subject: viewer: fix sort order button hitbox (#272) * viewer: fix sort order button hitbox github: resolves #266 * viewer: fix sort order button hover color That was a conflict between the tag's color and the .link color. I enforced .link priority over * viewer: fix sort order button hover color TODO comment about Buefy issues--- viewer/src/assets/scss/global.scss | 2 +- viewer/src/components/LdCommand.vue | 2 +- viewer/src/components/LdCommandSort.vue | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/viewer/src/assets/scss/global.scss b/viewer/src/assets/scss/global.scss index c82e1bc..06d975f 100644 --- a/viewer/src/assets/scss/global.scss +++ b/viewer/src/assets/scss/global.scss @@ -80,7 +80,7 @@ button svg + span { color: $link; cursor: pointer; text-decoration: none; - &:hover { + &:hover, &:hover a { color: $link-hover; } } diff --git a/viewer/src/components/LdCommand.vue b/viewer/src/components/LdCommand.vue index 2578055..5ba8266 100644 --- a/viewer/src/components/LdCommand.vue +++ b/viewer/src/components/LdCommand.vue @@ -78,7 +78,7 @@ export default class LdCommand extends Vue { align-items: center; flex: 0 0 $layout-left; - > a { + > * { // normalise icon active boxes width: $layout-top; line-height: $layout-top; diff --git a/viewer/src/components/LdCommandSort.vue b/viewer/src/components/LdCommandSort.vue index cfaa5c1..4c246e6 100644 --- a/viewer/src/components/LdCommandSort.vue +++ b/viewer/src/components/LdCommandSort.vue @@ -19,8 +19,9 @@ --> -- cgit v1.2.3 From 6b125a393d8ce10bfd9273c24ea1615b335abeba Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 26 Jun 2021 17:44:03 +0200 Subject: viewer/GalleryNavigation: uniquely identify viewer instances by item Fixed error "Object is possibly 'null'" in the template --- viewer/src/views/GalleryNavigation.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/viewer/src/views/GalleryNavigation.vue b/viewer/src/views/GalleryNavigation.vue index c53df66..69198f6 100644 --- a/viewer/src/views/GalleryNavigation.vue +++ b/viewer/src/views/GalleryNavigation.vue @@ -21,7 +21,7 @@
- +
@@ -66,6 +66,10 @@ export default class GalleryNavigation extends Vue { return this.COMPONENT_BY_TYPE[this.$galleryStore.currentItem?.properties.type ?? ItemType.OTHER]; } + get componentKey() { + return this.$galleryStore.currentItem?.path ?? ""; + } + @Watch("path") pathChanged() { this.$galleryStore.setCurrentPath(this.path); -- cgit v1.2.3 From 01fc05f04f3b043fe863f29dad953a2ca1f80fcd Mon Sep 17 00:00:00 2001 From: pacien Date: Mon, 28 Jun 2021 19:07:23 +0200 Subject: ci: configure GitHub Actions This configures GitHub Actions for building the viewer and compiler components and produce archive bundles for Linux and Windows. Those are uploaded as build artifacts instead of automatically being attached to releases like before with Travis CI. This allows manually checking the archives when doing new releases. --- .github/workflows/build.yml | 124 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..aef142b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,124 @@ +name: Build +on: pull_request + +jobs: + build-viewer: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: Lint and build Node.js Vue project + working-directory: viewer + run: | + npm install + npm run lint + npm run build + - uses: actions/upload-artifact@v2 + with: + name: viewer-dist + path: viewer/dist + + # TODO: do not hard-code the CI install path in the output binary + # See https://github.com/ldgallery/ldgallery/issues/286 + build-compiler: + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, windows-latest ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: haskell/actions/setup@v1 + with: + ghc-version: 8.10.4 + enable-stack: true + - name: Build Haskell Stack project + working-directory: compiler + run: | + stack setup --no-terminal + stack build --no-terminal + stack install --local-bin-path dist + - uses: actions/upload-artifact@v2 + with: + name: compiler-dist-${{ matrix.os }} + path: compiler/dist + + # TODO: generate a distro-agnostic Linux package. + # See https://github.com/ldgallery/ldgallery/issues/285 + archive-linux: + needs: [ build-viewer, build-compiler ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Bundle ldgallery viewer + uses: actions/download-artifact@v2 + with: + name: viewer-dist + path: dist/viewer + - name: Bundle ldgallery compiler + uses: actions/download-artifact@v2 + with: + name: compiler-dist-ubuntu-latest + path: dist + - name: Install build dependencies + run: | + sudo apt-get update -qq + sudo apt-get install -y pandoc + - name: Build manuals + run: | + pandoc --standalone --to man ldgallery-quickstart.7.md --output dist/ldgallery-quickstart.7 + pandoc --standalone --to man compiler/ldgallery.1.md --output dist/ldgallery.1 + pandoc --standalone --to man viewer/ldgallery-viewer.7.md --output dist/ldgallery-viewer.7 + cp changelog.md dist/ + cp license.md dist/ + - uses: actions/upload-artifact@v2 + with: + name: archive-linux-amd64 + path: dist + + archive-windows: + needs: [ build-viewer, build-compiler ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Bundle ldgallery viewer + uses: actions/download-artifact@v2 + with: + name: viewer-dist + path: dist/viewer + - name: Bundle ldgallery compiler + uses: actions/download-artifact@v2 + with: + name: compiler-dist-windows-latest + path: dist + - name: Install build dependencies + run: | + sudo apt-get update -qq + sudo apt-get install -y pandoc wget p7zip-full + - name: Copy scripts + run: | + mkdir dist/scripts + cp scripts/win_* dist/scripts/ + - name: Build manuals + run: | + pandoc --standalone --to html ldgallery-quickstart.7.md --output dist/ldgallery-quickstart.7.html + pandoc --standalone --to html compiler/ldgallery.1.md --output dist/ldgallery.1.html + pandoc --standalone --to html viewer/ldgallery-viewer.7.md --output dist/ldgallery-viewer.7.html + pandoc --standalone --to html changelog.md --output dist/changelog.html + pandoc --standalone --to html license.md --output dist/license.html + # TODO: automatically get the latest imagemagick version, since old archives disappear from the website + # See https://github.com/ldgallery/ldgallery/issues/281 + - name: Bundle ImageMagick + run: | + wget -O magick.zip \ + https://download.imagemagick.org/ImageMagick/download/binaries/ImageMagick-7.1.0-2-portable-Q16-x64.zip + 7z e magick.zip -odist/ magick.exe + 7z e magick.zip -so LICENSE.txt > dist/magick.license.txt + 7z e magick.zip -so NOTICE.txt > dist/magick.notice.txt + 7z e magick.zip -so README.txt > dist/magick.readme.txt + - uses: actions/upload-artifact@v2 + with: + name: archive-win64 + path: dist -- cgit v1.2.3 From c7c731d404592f04ba72c148d6f94a7717fe84f8 Mon Sep 17 00:00:00 2001 From: pacien Date: Mon, 28 Jun 2021 20:20:16 +0200 Subject: ci: configure cache for haskell stack --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aef142b..d877ffc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,13 +30,19 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: ~/.stack + key: compiler-${{ runner.os }}-${{ hashFiles('compiler/stack.yaml') }} - uses: haskell/actions/setup@v1 with: ghc-version: 8.10.4 enable-stack: true - name: Build Haskell Stack project working-directory: compiler + shell: bash run: | + STACK_ROOT=~/.stack # make it the same on all platforms stack setup --no-terminal stack build --no-terminal stack install --local-bin-path dist -- cgit v1.2.3 From b70e61507d63e442d75eee8b978498fa6f6b0dd8 Mon Sep 17 00:00:00 2001 From: pacien Date: Mon, 28 Jun 2021 20:43:24 +0200 Subject: ci: automatically use latest imagemagick minor version in bundle The archives of deprecated minor versions tend to disappear from the website. This patch makes the CI locate and fetch the latest minor version automatically for inclusion in the bundle archive. GitHub: closes #281 --- .github/workflows/build.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d877ffc..48b0819 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -102,7 +102,7 @@ jobs: - name: Install build dependencies run: | sudo apt-get update -qq - sudo apt-get install -y pandoc wget p7zip-full + sudo apt-get install -y pandoc wget curl html-xml-utils p7zip-full - name: Copy scripts run: | mkdir dist/scripts @@ -114,16 +114,20 @@ jobs: pandoc --standalone --to html viewer/ldgallery-viewer.7.md --output dist/ldgallery-viewer.7.html pandoc --standalone --to html changelog.md --output dist/changelog.html pandoc --standalone --to html license.md --output dist/license.html - # TODO: automatically get the latest imagemagick version, since old archives disappear from the website - # See https://github.com/ldgallery/ldgallery/issues/281 - name: Bundle ImageMagick run: | - wget -O magick.zip \ - https://download.imagemagick.org/ImageMagick/download/binaries/ImageMagick-7.1.0-2-portable-Q16-x64.zip - 7z e magick.zip -odist/ magick.exe - 7z e magick.zip -so LICENSE.txt > dist/magick.license.txt - 7z e magick.zip -so NOTICE.txt > dist/magick.notice.txt - 7z e magick.zip -so README.txt > dist/magick.readme.txt + MAGICK_ARCHIVES="https://download.imagemagick.org/ImageMagick/download/binaries/" + MAGICK_LATEST=$( \ + curl --silent "$MAGICK_ARCHIVES" \ + | hxclean \ + | hxselect 'a::attr(href)' -c -s '\n' \ + | grep -m1 '^ImageMagick-7.*portable-Q16-x64.zip$' ) + mkdir -p ~/downloads + wget --timestamping --directory-prefix ~/downloads "$MAGICK_ARCHIVES/$MAGICK_LATEST" + 7z e ~/downloads/"$MAGICK_LATEST" -odist/ magick.exe + 7z e ~/downloads/"$MAGICK_LATEST" -so LICENSE.txt > dist/magick.license.txt + 7z e ~/downloads/"$MAGICK_LATEST" -so NOTICE.txt > dist/magick.notice.txt + 7z e ~/downloads/"$MAGICK_LATEST" -so README.txt > dist/magick.readme.txt - uses: actions/upload-artifact@v2 with: name: archive-win64 -- cgit v1.2.3 From 262889d771480b8df677bd0ce4b73d92a786f93c Mon Sep 17 00:00:00 2001 From: pacien Date: Mon, 28 Jun 2021 21:05:39 +0200 Subject: ci: configure cache for bundle resources --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 48b0819..0b14231 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,6 +89,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: ~/downloads + key: archive-windows-vendored - name: Bundle ldgallery viewer uses: actions/download-artifact@v2 with: -- cgit v1.2.3 From 4892a176f86051174effc55dde275387a549c824 Mon Sep 17 00:00:00 2001 From: pacien Date: Mon, 28 Jun 2021 23:08:23 +0200 Subject: ci: enable HDRI for bundled imagemagick --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b14231..55cd0a8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -125,7 +125,7 @@ jobs: curl --silent "$MAGICK_ARCHIVES" \ | hxclean \ | hxselect 'a::attr(href)' -c -s '\n' \ - | grep -m1 '^ImageMagick-7.*portable-Q16-x64.zip$' ) + | grep -m1 '^ImageMagick-7.*portable-Q16-HDRI-x64.zip$' ) mkdir -p ~/downloads wget --timestamping --directory-prefix ~/downloads "$MAGICK_ARCHIVES/$MAGICK_LATEST" 7z e ~/downloads/"$MAGICK_LATEST" -odist/ magick.exe -- cgit v1.2.3 From 65a3b5b0e8f599a03fac6d8d7d788d97c7f196a3 Mon Sep 17 00:00:00 2001 From: pacien Date: Mon, 28 Jun 2021 23:08:49 +0200 Subject: ci: remove travis CI (replaced by GitHub Actions) --- .travis.yml | 125 ------------------------------------------------------------ 1 file changed, 125 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 23be533..0000000 --- a/.travis.yml +++ /dev/null @@ -1,125 +0,0 @@ -language: generic - -jobs: - include: - - name: release-linux - language: generic - dist: bionic - - deploy: - provider: releases - edge: true - token: - secure: zRJV96jl3zchT88YAtT6irCXgm96qVcIokVmCHrzcAXsRHgTHQURKcdpPzFdZQnNkxwfS1akA3fW5icr+U6WZIxIe56sHYEaBg7VXR1RiGW/qNOAhSvbJGva75iUllTiELa2FL2gEb8bNhVOy3+bQr5Z7RMeHFiC4FFmbMvaQhd5ss3yR5+bqKufEuJPDpFap93XHUoczXH+lXp1v90Cia1gskHsSl+YgfGWQAc89yOxETwFOSqr3CScZGV6oJpGM2rsflN5arFS/8JqDwuemttfrt74wDdKR4Mk94tcqXqMrledUsXR1NEjWAEWW6QMj05ztZ76TkT2hKpG+WVmUTaJjNKS+RJnf4WKzv1vo2EHZuAuPvwR21NGVYTxvV4o3Zvs4YODGXiUxQgeF5LFA3jbZw9ODyloStUV7zIPqzL7qJEIehnMtkjo2JPav5ORz6B7GwVrDC4LJHn95on3/3Voo3mPeyepoz1gFoh3iovTKAc+IXQXGOhT7cATP9DAWLO/Epct7hWPCEflm+oSS4rNiVbMW/61O3yIpxgkJ/oTsixLk6LOhWNdr2hfP95nAtD+It7LSsJABmWJ0FVO9RtQC7fLmEPaoGdZIdeRk/0yig9vA78Y+q46B6LBalmZO+0V60rdLdrnggJsyt3DZKM/4Z+QUwe494NodE7hU9U= - on: - tags: true - overwrite: true - cleanup: false - file: ldgallery-linux-amd64.tar.gz - - cache: - directories: - - viewer/node_modules - - "$HOME/.stack" - - before_install: - - nvm install 12.16.2 - - nvm use 12.16.2 - - mkdir -p ~/.local/bin - - export PATH=$HOME/.local/bin:$PATH - - travis_retry curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz - | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' - - sudo apt-get update -qq - - sudo apt-get install -y pandoc - - install: - - cd viewer - - npm install - - cd .. - - cd compiler - - stack setup --no-terminal - - cd .. - - script: - - mkdir dist - - cd viewer - - npm run lint - - npm run build -- --dest ../dist/viewer - - cd .. - - cd compiler - - stack build --no-terminal - - stack install --local-bin-path ../dist/ - - cd .. - - pandoc --standalone --to man ldgallery-quickstart.7.md --output dist/ldgallery-quickstart.7 - - pandoc --standalone --to man compiler/ldgallery.1.md --output dist/ldgallery.1 - - pandoc --standalone --to man viewer/ldgallery-viewer.7.md --output dist/ldgallery-viewer.7 - - cp changelog.md license.md dist/ - - tar -cvzf ldgallery-linux-amd64.tar.gz dist - - #============================================================= - - - name: release-win64 - if: tag IS present OR branch IN (master, staging) - language: shell - os: windows - - deploy: - provider: releases - edge: true - token: - secure: zRJV96jl3zchT88YAtT6irCXgm96qVcIokVmCHrzcAXsRHgTHQURKcdpPzFdZQnNkxwfS1akA3fW5icr+U6WZIxIe56sHYEaBg7VXR1RiGW/qNOAhSvbJGva75iUllTiELa2FL2gEb8bNhVOy3+bQr5Z7RMeHFiC4FFmbMvaQhd5ss3yR5+bqKufEuJPDpFap93XHUoczXH+lXp1v90Cia1gskHsSl+YgfGWQAc89yOxETwFOSqr3CScZGV6oJpGM2rsflN5arFS/8JqDwuemttfrt74wDdKR4Mk94tcqXqMrledUsXR1NEjWAEWW6QMj05ztZ76TkT2hKpG+WVmUTaJjNKS+RJnf4WKzv1vo2EHZuAuPvwR21NGVYTxvV4o3Zvs4YODGXiUxQgeF5LFA3jbZw9ODyloStUV7zIPqzL7qJEIehnMtkjo2JPav5ORz6B7GwVrDC4LJHn95on3/3Voo3mPeyepoz1gFoh3iovTKAc+IXQXGOhT7cATP9DAWLO/Epct7hWPCEflm+oSS4rNiVbMW/61O3yIpxgkJ/oTsixLk6LOhWNdr2hfP95nAtD+It7LSsJABmWJ0FVO9RtQC7fLmEPaoGdZIdeRk/0yig9vA78Y+q46B6LBalmZO+0V60rdLdrnggJsyt3DZKM/4Z+QUwe494NodE7hU9U= - on: - tags: true - overwrite: true - cleanup: false - file: ldgallery-win64.zip - - cache: - directories: - - viewer/node_modules - - "$HOME/.stack" - - env: - - NVM_HOME="$ProgramData/nvm/" - - NVM_SYMLINK="$ProgramData/nvm/nodejs/" - - STACK_ROOT="$ProgramData/haskell/" - - before_install: - - export "PATH=$NVM_HOME:$NVM_SYMLINK:$STACK_ROOT:$PATH" - - echo $PATH - - choco install nvm - - nvm install 12.16.2 - - nvm use 12.16.2 - - choco install haskell-stack - - install: - - cd viewer - - npm install - - cd .. - - cd compiler - - stack setup --no-terminal - - cd .. - - script: - - mkdir dist - - cd viewer - - npm run lint - - npm run build -- --dest ../dist/viewer - - cd .. - - cd compiler - - stack build --no-terminal - - stack install --local-bin-path ../dist/ - - cd .. - - mkdir dist/scripts - - cp scripts/win_* dist/scripts/ - - cp ldgallery-quickstart.7.md dist/ldgallery-quickstart.7.md - - cp viewer/ldgallery-viewer.7.md dist/ldgallery-viewer.7.md - - cp compiler/ldgallery.1.md dist/ldgallery.1.md - - cp changelog.md license.md dist/ - - curl --fail --output magick.zip -L https://imagemagick.org/download/binaries/ImageMagick-7.0.10-30-portable-Q16-x64.zip - - 7z e magick.zip -odist/ magick.exe - - 7z e magick.zip -so LICENSE.txt > dist/magick.license.txt - - 7z e magick.zip -so NOTICE.txt > dist/magick.notice.txt - - 7z e magick.zip -so README.txt > dist/magick.readme.txt - - 7z a -r -tzip ldgallery-win64.zip ./dist/* - -- cgit v1.2.3 From f0d2b69bcdd43754142c5d39e5539c0c21f724f0 Mon Sep 17 00:00:00 2001 From: pacien Date: Tue, 29 Jun 2021 00:19:15 +0200 Subject: ci: pin operating systems versions To improve reproducibility. --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 55cd0a8..caabbc6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ on: pull_request jobs: build-viewer: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 @@ -26,7 +26,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-latest, windows-latest ] + os: [ ubuntu-20.04, windows-2019 ] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -55,7 +55,7 @@ jobs: # See https://github.com/ldgallery/ldgallery/issues/285 archive-linux: needs: [ build-viewer, build-compiler ] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - name: Bundle ldgallery viewer @@ -66,7 +66,7 @@ jobs: - name: Bundle ldgallery compiler uses: actions/download-artifact@v2 with: - name: compiler-dist-ubuntu-latest + name: compiler-dist-ubuntu-20.04 path: dist - name: Install build dependencies run: | @@ -86,7 +86,7 @@ jobs: archive-windows: needs: [ build-viewer, build-compiler ] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - uses: actions/cache@v2 @@ -101,7 +101,7 @@ jobs: - name: Bundle ldgallery compiler uses: actions/download-artifact@v2 with: - name: compiler-dist-windows-latest + name: compiler-dist-windows-2019 path: dist - name: Install build dependencies run: | -- cgit v1.2.3 From 4964ee35dfb4b9b58f5791b20df13e34fa89e3ed Mon Sep 17 00:00:00 2001 From: pacien Date: Tue, 29 Jun 2021 00:22:13 +0200 Subject: ci: pin node version to match vue recommendations --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index caabbc6..532c1f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,8 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: - node-version: 12.x + # Latest version officially tested for Vue + node-version: 12.16.1 - name: Lint and build Node.js Vue project working-directory: viewer run: | -- cgit v1.2.3 From 671a372d87ff8311956f9158e8885ffc254fe1bc Mon Sep 17 00:00:00 2001 From: pacien Date: Tue, 29 Jun 2021 13:14:14 +0200 Subject: compiler: add "portable" target This adds a build flag for generating a portable version of the compiler binary which make it look in its own runtime directory for its assets. This is useful in particular for the portable release tarballs which contain the web viewer at the same location instead of a pre-defined one in the FHS. GitHub: closes #286 --- compiler/app/Main.hs | 29 +++++++++++++---------------- compiler/app/ViewerDist.hs | 39 +++++++++++++++++++++++++++++++++++++++ compiler/package.yaml | 14 +++++++++++++- 3 files changed, 65 insertions(+), 17 deletions(-) create mode 100644 compiler/app/ViewerDist.hs diff --git a/compiler/app/Main.hs b/compiler/app/Main.hs index dc97b38..3e6f254 100644 --- a/compiler/app/Main.hs +++ b/compiler/app/Main.hs @@ -19,7 +19,7 @@ module Main where import GHC.Generics (Generic) -import Paths_ldgallery_compiler (version, getDataFileName) +import Paths_ldgallery_compiler (version) import Control.Monad (when) import Data.Functor ((<&>)) import Data.Maybe (isJust) @@ -31,7 +31,7 @@ import System.Console.CmdArgs import Compiler import Files (readDirectory, copyTo, remove) - +import ViewerDist (viewerDistPath) newtype ViewerConfig = ViewerConfig { galleryRoot :: String @@ -106,10 +106,7 @@ main = do opts <- cmdArgs options buildGallery opts - - when (isJust $ withViewer opts) $ do - viewerDist <- viewerDistPath $ withViewer opts - deployViewer viewerDist opts + deployViewer opts where gallerySubdir :: String @@ -118,11 +115,6 @@ main = viewerConfig :: ViewerConfig viewerConfig = ViewerConfig (gallerySubdir ++ "/") - viewerDistPath :: Maybe FilePath -> IO FilePath - viewerDistPath (Just "") = getDataFileName "viewer" - viewerDistPath (Just dist) = return dist - viewerDistPath Nothing = fail "No viewer distribution" - buildGallery :: Options -> IO () buildGallery opts = checkDistinctPaths (inputDir opts) (outputDir opts) @@ -146,10 +138,11 @@ main = | isJust withViewer = outputDir gallerySubdir | otherwise = outputDir - deployViewer :: FilePath -> Options -> IO () - deployViewer distPath Options{outputDir, cleanOutput} = + deployViewer :: Options -> IO () + deployViewer Options{withViewer = Nothing} = pure () + deployViewer Options{withViewer = Just viewerPath, outputDir, cleanOutput} = when cleanOutput (cleanViewerDir outputDir) - >> copyViewer distPath outputDir + >> viewerDistOr viewerPath >>= deployTo outputDir >> writeJSON (outputDir "config.json") viewerConfig where @@ -159,8 +152,12 @@ main = <&> filter (/= gallerySubdir) >>= mapM_ (remove . (target )) - copyViewer :: FilePath -> FilePath -> IO () - copyViewer dist target = + viewerDistOr :: FilePath -> IO FilePath + viewerDistOr "" = viewerDistPath + viewerDistOr custom = pure custom + + deployTo :: FilePath -> FilePath -> IO () + deployTo target dist = putStrLn "Copying viewer webapp" >> readDirectory dist >>= copyTo target diff --git a/compiler/app/ViewerDist.hs b/compiler/app/ViewerDist.hs new file mode 100644 index 0000000..2b80ffc --- /dev/null +++ b/compiler/app/ViewerDist.hs @@ -0,0 +1,39 @@ +-- ldgallery - A static generator which turns a collection of tagged +-- pictures into a searchable web gallery. +-- +-- Copyright (C) 2021 Pacien TRAN-GIRARD +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU Affero General Public License as +-- published by the Free Software Foundation, either version 3 of the +-- License, or (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU Affero General Public License for more details. +-- +-- You should have received a copy of the GNU Affero General Public License +-- along with this program. If not, see . + +{-# LANGUAGE CPP #-} + +module ViewerDist where + +#ifndef FLAG_PORTABLE + +import Paths_ldgallery_compiler (getDataFileName) + +viewerDistPath = getDataFileName "viewer" + +#else + +import Data.Functor ((<&>)) +import System.FilePath (takeDirectory, ()) +import System.Environment (getExecutablePath) + +viewerDistPath = fmap takeDirectory getExecutablePath <&> ( "viewer") + +#endif + +viewerDistPath :: IO FilePath diff --git a/compiler/package.yaml b/compiler/package.yaml index faa2174..b02a40a 100644 --- a/compiler/package.yaml +++ b/compiler/package.yaml @@ -5,7 +5,7 @@ github: "pacien/ldgallery" license: AGPL-3 author: "Pacien TRAN-GIRARD, Guillaume FOUET" maintainer: "" -copyright: "2019-2020 Pacien TRAN-GIRARD, Guillaume FOUET" +copyright: "2019-2021 Pacien TRAN-GIRARD, Guillaume FOUET" extra-source-files: - readme.md @@ -54,6 +54,15 @@ data-files: ["**/*"] library: source-dirs: src +flags: + portable: + description: > + Make the output binary portable. + It will look in its own runtime location for its assets instead of + absolute installation paths. + manual: true + default: false + executables: ldgallery: main: Main.hs @@ -64,6 +73,9 @@ executables: - -with-rtsopts=-N dependencies: - ldgallery-compiler + when: + - condition: flag(portable) + cpp-options: -DFLAG_PORTABLE tests: ldgallery-compiler-test: -- cgit v1.2.3 From 35458421aef45475bc1145a22c4eaa7b7638fb65 Mon Sep 17 00:00:00 2001 From: pacien Date: Tue, 29 Jun 2021 13:19:02 +0200 Subject: ci: compile the portable version of the compiler So that the generated build artifacts and release tarballs are portable. --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 532c1f7..9395862 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,8 +45,10 @@ jobs: run: | STACK_ROOT=~/.stack # make it the same on all platforms stack setup --no-terminal - stack build --no-terminal - stack install --local-bin-path dist + stack build --no-terminal \ + --flag ldgallery-compiler:portable \ + --copy-bins \ + --local-bin-path dist - uses: actions/upload-artifact@v2 with: name: compiler-dist-${{ matrix.os }} -- cgit v1.2.3 From 744588264310f189c711fe4bf52ce0bc0aab0b70 Mon Sep 17 00:00:00 2001 From: pacien Date: Tue, 29 Jun 2021 13:21:08 +0200 Subject: doc: remove obsolete note on asset path for portable archives It is no longer necessary for the user to explicitly specify the path of the viewer distribution directory when using a portable archive, since the compiler built with the "portable" flag now automatically looks at its runtime location. --- ldgallery-quickstart.7.md | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/ldgallery-quickstart.7.md b/ldgallery-quickstart.7.md index 684e90d..e8ccfb1 100644 --- a/ldgallery-quickstart.7.md +++ b/ldgallery-quickstart.7.md @@ -2,7 +2,7 @@ pagetitle: Quickstart guide - ldgallery title: LDGALLERY-QUICKSTART(7) ldgallery author: Pacien TRAN-GIRARD, Guillaume FOUET -date: 2020-09-19 (v2.0) +date: 2021-06-29 (SNAPSHOT) --- # ABOUT @@ -85,16 +85,6 @@ ldgallery \ --output-dir ./monument-gallery-output ``` -If the compiler was installed manually through the extraction of a pre-built archive, -it might be necessary to specify the full path of the installation: - -```sh -/ldgallery \ - --with-viewer=/viewer \ - --input-dir ./monument-gallery-source \ - --output-dir ./monument-gallery-output -``` - Running the command above produces a directory named "monument-gallery-output" in the current directory, which contains the compiled gallery and a web viewer ready to be copied to some web server. @@ -125,7 +115,7 @@ The ldgallery source code is available on . # LICENSE -Copyright (C) 2019-2020 Pacien TRAN-GIRARD and Guillaume FOUET. +Copyright (C) 2019-2021 Pacien TRAN-GIRARD and Guillaume FOUET. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -- cgit v1.2.3 From 083f0658399afc206ea0751415d54a50d2aa4fe9 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Tue, 29 Jun 2021 16:53:44 +0200 Subject: compiler: updated build script with arguments matching the CI --- compiler/.gitignore | 1 + scripts/dev_win_build.cmd | 5 ----- scripts/dev_win_build_compiler.cmd | 5 +++++ 3 files changed, 6 insertions(+), 5 deletions(-) delete mode 100644 scripts/dev_win_build.cmd create mode 100644 scripts/dev_win_build_compiler.cmd diff --git a/compiler/.gitignore b/compiler/.gitignore index 778e7ef..3415fc8 100644 --- a/compiler/.gitignore +++ b/compiler/.gitignore @@ -1,3 +1,4 @@ .stack-work/ +dist/ ldgallery-compiler.cabal *~ \ No newline at end of file diff --git a/scripts/dev_win_build.cmd b/scripts/dev_win_build.cmd deleted file mode 100644 index ed96211..0000000 --- a/scripts/dev_win_build.cmd +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -cd ..\compiler\ -stack setup -stack build -pause \ No newline at end of file diff --git a/scripts/dev_win_build_compiler.cmd b/scripts/dev_win_build_compiler.cmd new file mode 100644 index 0000000..d88aa5d --- /dev/null +++ b/scripts/dev_win_build_compiler.cmd @@ -0,0 +1,5 @@ +@echo off +cd ..\compiler\ +stack setup +stack build --flag ldgallery-compiler:portable --copy-bins --local-bin-path dist +pause -- cgit v1.2.3 From 9a72f5d3a2251b438017b08eec673bb800636e91 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Thu, 1 Jul 2021 19:37:53 +0200 Subject: viewer: Script domain naming convention --- scripts/dev_win_build_compiler.cmd | 5 ---- scripts/dev_win_compile_example.cmd | 10 ------- scripts/dev_win_compiler_build.cmd | 5 ++++ scripts/dev_win_compiler_compile_example.cmd | 10 +++++++ scripts/dev_win_compiler_help.cmd | 5 ++++ scripts/dev_win_help.cmd | 5 ---- scripts/dev_win_start_vueui.cmd | 44 ---------------------------- 7 files changed, 20 insertions(+), 64 deletions(-) delete mode 100644 scripts/dev_win_build_compiler.cmd delete mode 100644 scripts/dev_win_compile_example.cmd create mode 100644 scripts/dev_win_compiler_build.cmd create mode 100644 scripts/dev_win_compiler_compile_example.cmd create mode 100644 scripts/dev_win_compiler_help.cmd delete mode 100644 scripts/dev_win_help.cmd delete mode 100644 scripts/dev_win_start_vueui.cmd diff --git a/scripts/dev_win_build_compiler.cmd b/scripts/dev_win_build_compiler.cmd deleted file mode 100644 index d88aa5d..0000000 --- a/scripts/dev_win_build_compiler.cmd +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -cd ..\compiler\ -stack setup -stack build --flag ldgallery-compiler:portable --copy-bins --local-bin-path dist -pause diff --git a/scripts/dev_win_compile_example.cmd b/scripts/dev_win_compile_example.cmd deleted file mode 100644 index 35134c0..0000000 --- a/scripts/dev_win_compile_example.cmd +++ /dev/null @@ -1,10 +0,0 @@ -@echo off -SET rebuild=--rebuild -CHOICE /M "Rebuild all ('--rebuild' argument)?" -IF ERRORLEVEL 2 SET rebuild= -echo. -cd ..\compiler\ - -@echo on -stack exec ldgallery -- %rebuild% --clean-output -i=../example/src/ -o=../example/out/ -@pause diff --git a/scripts/dev_win_compiler_build.cmd b/scripts/dev_win_compiler_build.cmd new file mode 100644 index 0000000..d88aa5d --- /dev/null +++ b/scripts/dev_win_compiler_build.cmd @@ -0,0 +1,5 @@ +@echo off +cd ..\compiler\ +stack setup +stack build --flag ldgallery-compiler:portable --copy-bins --local-bin-path dist +pause diff --git a/scripts/dev_win_compiler_compile_example.cmd b/scripts/dev_win_compiler_compile_example.cmd new file mode 100644 index 0000000..35134c0 --- /dev/null +++ b/scripts/dev_win_compiler_compile_example.cmd @@ -0,0 +1,10 @@ +@echo off +SET rebuild=--rebuild +CHOICE /M "Rebuild all ('--rebuild' argument)?" +IF ERRORLEVEL 2 SET rebuild= +echo. +cd ..\compiler\ + +@echo on +stack exec ldgallery -- %rebuild% --clean-output -i=../example/src/ -o=../example/out/ +@pause diff --git a/scripts/dev_win_compiler_help.cmd b/scripts/dev_win_compiler_help.cmd new file mode 100644 index 0000000..f0bdb98 --- /dev/null +++ b/scripts/dev_win_compiler_help.cmd @@ -0,0 +1,5 @@ +@echo off +cd ..\compiler\ +stack exec ldgallery -- --help +@echo. +@pause diff --git a/scripts/dev_win_help.cmd b/scripts/dev_win_help.cmd deleted file mode 100644 index f0bdb98..0000000 --- a/scripts/dev_win_help.cmd +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -cd ..\compiler\ -stack exec ldgallery -- --help -@echo. -@pause diff --git a/scripts/dev_win_start_vueui.cmd b/scripts/dev_win_start_vueui.cmd deleted file mode 100644 index e1a124d..0000000 --- a/scripts/dev_win_start_vueui.cmd +++ /dev/null @@ -1,44 +0,0 @@ -@echo off -set NODE_VERSION=12.16.1 -set VUECLI_VERSION=4.2.3 -cd ..\viewer\ - -chcp 65001 -echo. -echo === nvm install === -nvm install %NODE_VERSION% -nvm list | find /i "%NODE_VERSION% (Currently" -if errorlevel 1 ( - echo. - echo === nvm use %NODE_VERSION% === - nvm use %NODE_VERSION% - - echo. - echo === npm install @vue/cli@%VUECLI_VERSION% === - ping localhost -n 3 >NUL - cmd /c npm install -g @vue/cli@%VUECLI_VERSION% -) -echo. -vue --version | find /i "%VUECLI_VERSION%" -if errorlevel 1 ( - echo ====================================================================== - echo Warning: vue/cli doesn't match the requested version: %VUECLI_VERSION% - echo. - echo CTRL+C to quit and update, or press a key to ignore this warning... - echo ====================================================================== - echo. - pause -) -echo. -echo === npm install === -cmd /c npm install -echo. -echo === npm prune === -cmd /c npm prune -echo. -echo === npm dedupe === -cmd /c npm dedupe -echo. -echo === vue ui === -title Vue UI - server -vue ui -- cgit v1.2.3 From 011cb4bcf271125b6d216f8def027b154954f25d Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Thu, 1 Jul 2021 19:38:49 +0200 Subject: viewer: Switch to YARN instead of NPM GitHub: closes #287 --- .github/workflows/build.yml | 10 +- scripts/dev_win_viewer_deps_install.cmd | 22 + viewer/.browserslistrc | 7 +- viewer/package-lock.json | 14182 ------------------------------ viewer/package.json | 2 +- viewer/yarn.lock | 9366 ++++++++++++++++++++ 6 files changed, 9399 insertions(+), 14190 deletions(-) create mode 100644 scripts/dev_win_viewer_deps_install.cmd delete mode 100644 viewer/package-lock.json create mode 100644 viewer/yarn.lock diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9395862..190a0df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,14 +8,14 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: - # Latest version officially tested for Vue - node-version: 12.16.1 + # Latest version officially tested for Ld + node-version: 12.22.2 - name: Lint and build Node.js Vue project working-directory: viewer run: | - npm install - npm run lint - npm run build + yarn + yarn run lint + yarn run build - uses: actions/upload-artifact@v2 with: name: viewer-dist diff --git a/scripts/dev_win_viewer_deps_install.cmd b/scripts/dev_win_viewer_deps_install.cmd new file mode 100644 index 0000000..9e2330d --- /dev/null +++ b/scripts/dev_win_viewer_deps_install.cmd @@ -0,0 +1,22 @@ +@echo off +set NODE_VERSION=12.22.2 +cd ..\viewer\ + +chcp 65001 +echo. +echo === nvm install === +nvm install %NODE_VERSION% +nvm list | find /i "%NODE_VERSION% (Currently" +if errorlevel 1 ( + echo. + echo === nvm use %NODE_VERSION% === + nvm use %NODE_VERSION% + + ping localhost -n 3 >NUL + cmd /c npm install -g yarn +) +echo. +echo === yarn deps === +cmd /c rmdir /s /q .\node_modules\ +cmd /c yarn +echo. diff --git a/viewer/.browserslistrc b/viewer/.browserslistrc index d6471a3..d9789a7 100644 --- a/viewer/.browserslistrc +++ b/viewer/.browserslistrc @@ -1,2 +1,5 @@ -> 1% -last 2 versions +# Polyfills for ES2020+ + +chrome > 78 +firefox > 72 +edge > 78 diff --git a/viewer/package-lock.json b/viewer/package-lock.json deleted file mode 100644 index 4785b3e..0000000 --- a/viewer/package-lock.json +++ /dev/null @@ -1,14182 +0,0 @@ -{ - "name": "ldgallery-viewer", - "version": "2.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@babel/code-frame": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", - "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, - "@babel/compat-data": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.10.3.tgz", - "integrity": "sha512-BDIfJ9uNZuI0LajPfoYV28lX8kyCPMHY6uY4WH1lJdcicmAfxCK5ASzaeV0D/wsUaRH/cLk+amuxtC37sZ8TUg==", - "dev": true, - "requires": { - "browserslist": "^4.12.0", - "invariant": "^2.2.4", - "semver": "^5.5.0" - }, - "dependencies": { - "browserslist": { - "version": "4.12.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.2.tgz", - "integrity": "sha512-MfZaeYqR8StRZdstAK9hCKDd2StvePCYp5rHzQCPicUjfFliDgmuaBNPHYUTpAywBN8+Wc/d7NYVFkO0aqaBUw==", - "dev": true, - "requires": { - "caniuse-lite": "^1.0.30001088", - "electron-to-chromium": "^1.3.483", - "escalade": "^3.0.1", - "node-releases": "^1.1.58" - } - }, - "caniuse-lite": { - "version": "1.0.30001090", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001090.tgz", - "integrity": "sha512-QzPRKDCyp7RhjczTPZaqK3CjPA5Ht2UnXhZhCI4f7QiB5JK6KEuZBxIzyWnB3wO4hgAj4GMRxAhuiacfw0Psjg==", - "dev": true - }, - "electron-to-chromium": { - "version": "1.3.483", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.483.tgz", - "integrity": "sha512-+05RF8S9rk8S0G8eBCqBRBaRq7+UN3lDs2DAvnG8SBSgQO3hjy0+qt4CmRk5eiuGbTcaicgXfPmBi31a+BD3lg==", - "dev": true - }, - "node-releases": { - "version": "1.1.58", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.58.tgz", - "integrity": "sha512-NxBudgVKiRh/2aPWMgPR7bPTX0VPmGx5QBwCtdHitnqFE5/O8DeBXuIMH1nwNnw/aMo6AjOrpsHzfY3UbUJ7yg==", - "dev": true - } - } - }, - "@babel/core": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.3.tgz", - "integrity": "sha512-5YqWxYE3pyhIi84L84YcwjeEgS+fa7ZjK6IBVGTjDVfm64njkR2lfDhVR5OudLk8x2GK59YoSyVv+L/03k1q9w==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.10.3", - "@babel/generator": "^7.10.3", - "@babel/helper-module-transforms": "^7.10.1", - "@babel/helpers": "^7.10.1", - "@babel/parser": "^7.10.3", - "@babel/template": "^7.10.3", - "@babel/traverse": "^7.10.3", - "@babel/types": "^7.10.3", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.1", - "json5": "^2.1.2", - "lodash": "^4.17.13", - "resolve": "^1.3.2", - "semver": "^5.4.1", - "source-map": "^0.5.0" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.3.tgz", - "integrity": "sha512-fDx9eNW0qz0WkUeqL6tXEXzVlPh6Y5aCDEZesl0xBGA8ndRukX91Uk44ZqnkECp01NAZUdCAl+aiQNGi0k88Eg==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.3" - } - }, - "@babel/highlight": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.3.tgz", - "integrity": "sha512-Ih9B/u7AtgEnySE2L2F0Xm0GaM729XqqLfHkalTsbjXGyqmf/6M0Cu0WpvqueUlW+xk88BHw9Nkpj49naU+vWw==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.10.3", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } - } - }, - "@babel/generator": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.3.tgz", - "integrity": "sha512-drt8MUHbEqRzNR0xnF8nMehbY11b1SDkRw03PSNH/3Rb2Z35oxkddVSi3rcaak0YJQ86PCuE7Qx1jSFhbLNBMA==", - "dev": true, - "requires": { - "@babel/types": "^7.10.3", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } - } - }, - "@babel/helper-annotate-as-pure": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.1.tgz", - "integrity": "sha512-ewp3rvJEwLaHgyWGe4wQssC2vjks3E80WiUe2BpMb0KhreTjMROCbxXcEovTrbeGVdQct5VjQfrv9EgC+xMzCw==", - "dev": true, - "requires": { - "@babel/types": "^7.10.1" - } - }, - "@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.10.3.tgz", - "integrity": "sha512-lo4XXRnBlU6eRM92FkiZxpo1xFLmv3VsPFk61zJKMm7XYJfwqXHsYJTY6agoc4a3L8QPw1HqWehO18coZgbT6A==", - "dev": true, - "requires": { - "@babel/helper-explode-assignable-expression": "^7.10.3", - "@babel/types": "^7.10.3" - } - }, - "@babel/helper-compilation-targets": { - "version": "7.10.2", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.10.2.tgz", - "integrity": "sha512-hYgOhF4To2UTB4LTaZepN/4Pl9LD4gfbJx8A34mqoluT8TLbof1mhUlYuNWTEebONa8+UlCC4X0TEXu7AOUyGA==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.10.1", - "browserslist": "^4.12.0", - "invariant": "^2.2.4", - "levenary": "^1.1.1", - "semver": "^5.5.0" - }, - "dependencies": { - "browserslist": { - "version": "4.12.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.2.tgz", - "integrity": "sha512-MfZaeYqR8StRZdstAK9hCKDd2StvePCYp5rHzQCPicUjfFliDgmuaBNPHYUTpAywBN8+Wc/d7NYVFkO0aqaBUw=="