Skip to content

Commit

Permalink
fix (docs): Store copies of Moment & Vis' JS + CSS in (new) third_par…
Browse files Browse the repository at this point in the history
…ty/, and expose it on docs/ site build
  • Loading branch information
vorburger committed Aug 17, 2024
1 parent eb6ad4d commit 8eacb9c
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ repos:
- id: destroyed-symlinks
- id: end-of-file-fixer
# https://github.com/Lucas-C/pre-commit-hooks/issues/70
exclude: ^(LICENSE-header.txt|.*test-random-binary|.*svg|.*.expected)$
exclude: ^(LICENSE-header.txt|.*test-random-binary|.*.svg|.*.expected|third_party/.*)$
- id: trailing-whitespace

- repo: https://github.com/Lucas-C/pre-commit-hooks
Expand All @@ -56,6 +56,7 @@ repos:
- --use-current-year
- id: insert-license
files: \.(java|js)$
exclude: ^(third_party/.*)$
args:
- --no-extra-eol
- --comment-style
Expand Down Expand Up @@ -144,7 +145,7 @@ repos:
- id: prettier
# NOT markdown, because we use markdownlint for that
types_or: [css, html, javascript, json, json5, scss, ts, tsx, yaml]
exclude: ^docs/use|test/|.devcontainer/devcontainer.json
exclude: ^docs/use|test/|.devcontainer/devcontainer.json|third_party/
additional_dependencies:
- [email protected]

Expand Down
Empty file added third_party/BUILD
Empty file.
26 changes: 26 additions & 0 deletions third_party/download.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2023-2024 The Enola <https://enola.dev> Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -euox pipefail

# Moment.js v2.30.1, as seen e.g. in https://momentjs.com/downloads/moment.js
curl -L -o third_party/web/[email protected] https://momentjs.com/downloads/moment.min.js
curl -L -o third_party/web/[email protected] https://momentjs.com/downloads/moment-with-locales.min.js

curl -L -o third_party/web/[email protected] https://unpkg.com/[email protected]/peer/umd/vis-data.min.js
curl -L -o third_party/web/[email protected] https://unpkg.com/[email protected]/peer/umd/vis-timeline-graph2d.min.js
curl -L -o third_party/web/[email protected] https://unpkg.com/[email protected]/styles/vis-timeline-graph2d.min.css
2 changes: 2 additions & 0 deletions third_party/web/[email protected]

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions third_party/web/[email protected]

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions third_party/web/[email protected]

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions third_party/web/[email protected]

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions third_party/web/[email protected]

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions tools/docs/build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ cleanup() {
}
trap cleanup EXIT

# Copy Third Party JS & CSS into docs/BUILT/THIRD_PARTY
rm -rf docs/BUILT/third_party
mkdir docs/BUILT/third_party
find third_party/web/ -type d -exec mkdir -p docs/BUILT/{} \;
find third_party/web/ -type f -exec ln -f {} docs/BUILT/{} \;
rm -f docs/BUILT/third_party/{BUILD*,*.bash}

# Fix up //... links in docs/**/*.md link to GitHub (instead of docs.enola.dev)
find docs/ -type f -name "*.md" -print0 \
| xargs -n 1 -0 sed -i 's|(//|(https://github.com/enola-dev/enola/blob/main/|g'
Expand Down

0 comments on commit 8eacb9c

Please sign in to comment.