Skip to content

Commit

Permalink
LFS the Lunr Indexes (github#20521)
Browse files Browse the repository at this point in the history
* LFS the Lunr Indexes

* Add a note about installing Git LFS

* Run "install" command

* Update indexes

* Index names
  • Loading branch information
heiskr authored Jul 27, 2021
1 parent 6144b2a commit eddadb8
Show file tree
Hide file tree
Showing 87 changed files with 125 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto

# Explicitly declare text files we want to always be normalized and converted
# to native line endings on checkout.
*.md text
*.json.br filter=lfs diff=lfs merge=lfs -text
3 changes: 3 additions & 0 deletions .husky/post-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-checkout.\n"; exit 2; }
git lfs post-checkout "$@"
3 changes: 3 additions & 0 deletions .husky/post-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-commit.\n"; exit 2; }
git lfs post-commit "$@"
3 changes: 3 additions & 0 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-merge.\n"; exit 2; }
git lfs post-merge "$@"
3 changes: 3 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/pre-push.\n"; exit 2; }
git lfs pre-push "$@"

. "$(dirname "$0")/_/husky.sh"

npm run prevent-pushes-to-main
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ If you spot something new, open an issue using a [template](https://github.com/g

### Ready to make a change? Fork the repo

You'll want to [install Git LFS](https://docs.github.com/en/github/managing-large-files/versioning-large-files/installing-git-large-file-storage).

Fork using GitHub Desktop:

- [Getting started with GitHub Desktop](https://docs.github.com/en/desktop/installing-and-configuring-github-desktop/getting-started-with-github-desktop) will guide you through setting up Desktop.
Expand Down
4 changes: 3 additions & 1 deletion contributing/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ It runs on macOS, Windows, and Linux environments.

You'll need Node.js version 16 to run the site. To install Node.js, [download the "LTS" installer from nodejs.org](https://nodejs.org). If you're using [`nodenv`](https://github.com/nodenv/nodenv), read the [`nodenv` docs](#nodenv) for instructions on switching Node.js versions.

Once you've installed Node.js (which includes the popular `npm` package manager), open Terminal and run the following:
You'll want to [install Git LFS](https://docs.github.com/en/github/managing-large-files/versioning-large-files/installing-git-large-file-storage).

Once you've installed Node.js (which includes the popular `npm` package manager) and Git LFS, open Terminal and run the following:

```sh
git clone https://github.com/github/docs
Expand Down
51 changes: 0 additions & 51 deletions lib/search/cached-index-names.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,7 @@
[
"github-docs-2.17-cn",
"github-docs-2.17-de",
"github-docs-2.17-en",
"github-docs-2.17-es",
"github-docs-2.17-ja",
"github-docs-2.17-pt",
"github-docs-2.18-cn",
"github-docs-2.18-de",
"github-docs-2.18-en",
"github-docs-2.18-es",
"github-docs-2.18-ja",
"github-docs-2.18-pt",
"github-docs-2.19-cn",
"github-docs-2.19-de",
"github-docs-2.19-en",
"github-docs-2.19-es",
"github-docs-2.19-ja",
"github-docs-2.19-pt",
"github-docs-2.20-cn",
"github-docs-2.20-de",
"github-docs-2.20-en",
"github-docs-2.20-es",
"github-docs-2.20-ja",
"github-docs-2.20-pt",
"github-docs-2.21-cn",
"github-docs-2.21-de",
"github-docs-2.21-en",
Expand All @@ -47,36 +26,6 @@
"github-docs-3.1-es",
"github-docs-3.1-ja",
"github-docs-3.1-pt",
"github-docs-custom-rankings-2.18-cn",
"github-docs-custom-rankings-2.18-de",
"github-docs-custom-rankings-2.18-en",
"github-docs-custom-rankings-2.18-es",
"github-docs-custom-rankings-2.18-ja",
"github-docs-custom-rankings-2.18-pt",
"github-docs-custom-rankings-2.19-cn",
"github-docs-custom-rankings-2.19-de",
"github-docs-custom-rankings-2.19-en",
"github-docs-custom-rankings-2.19-es",
"github-docs-custom-rankings-2.19-ja",
"github-docs-custom-rankings-2.19-pt",
"github-docs-custom-rankings-2.20-cn",
"github-docs-custom-rankings-2.20-de",
"github-docs-custom-rankings-2.20-en",
"github-docs-custom-rankings-2.20-es",
"github-docs-custom-rankings-2.20-ja",
"github-docs-custom-rankings-2.20-pt",
"github-docs-custom-rankings-2.21-cn",
"github-docs-custom-rankings-2.21-de",
"github-docs-custom-rankings-2.21-en",
"github-docs-custom-rankings-2.21-es",
"github-docs-custom-rankings-2.21-ja",
"github-docs-custom-rankings-2.21-pt",
"github-docs-custom-rankings-dotcom-cn",
"github-docs-custom-rankings-dotcom-de",
"github-docs-custom-rankings-dotcom-en",
"github-docs-custom-rankings-dotcom-es",
"github-docs-custom-rankings-dotcom-ja",
"github-docs-custom-rankings-dotcom-pt",
"github-docs-dotcom-cn",
"github-docs-dotcom-de",
"github-docs-dotcom-en",
Expand Down
Binary file modified lib/search/indexes/github-docs-2.20-cn-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-2.20-cn.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-2.20-en-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-2.20-en.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-2.20-ja-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-2.20-ja.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-2.21-cn-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-2.21-cn.json.br
Binary file not shown.
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-2.21-de-records.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-2.21-de.json.br
Git LFS file not shown
Binary file modified lib/search/indexes/github-docs-2.21-en-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-2.21-en.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-2.21-es-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-2.21-es.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-2.21-ja-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-2.21-ja.json.br
Binary file not shown.
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-2.21-pt-records.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-2.21-pt.json.br
Git LFS file not shown
Binary file modified lib/search/indexes/github-docs-2.22-cn-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-2.22-cn.json.br
Binary file not shown.
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-2.22-de-records.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-2.22-de.json.br
Git LFS file not shown
Binary file modified lib/search/indexes/github-docs-2.22-en-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-2.22-en.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-2.22-es-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-2.22-es.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-2.22-ja-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-2.22-ja.json.br
Binary file not shown.
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-2.22-pt-records.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-2.22-pt.json.br
Git LFS file not shown
Binary file modified lib/search/indexes/github-docs-3.0-cn-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-3.0-cn.json.br
Binary file not shown.
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-3.0-de-records.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-3.0-de.json.br
Git LFS file not shown
Binary file modified lib/search/indexes/github-docs-3.0-en-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-3.0-en.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-3.0-es-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-3.0-es.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-3.0-ja-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-3.0-ja.json.br
Binary file not shown.
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-3.0-pt-records.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-3.0-pt.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-3.1-cn-records.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-3.1-cn.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-3.1-de-records.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-3.1-de.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-3.1-en-records.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-3.1-en.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-3.1-es-records.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-3.1-es.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-3.1-ja-records.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-3.1-ja.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-3.1-pt-records.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-3.1-pt.json.br
Git LFS file not shown
Binary file modified lib/search/indexes/github-docs-dotcom-cn-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-dotcom-cn.json.br
Binary file not shown.
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-dotcom-de-records.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-dotcom-de.json.br
Git LFS file not shown
Binary file modified lib/search/indexes/github-docs-dotcom-en-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-dotcom-en.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-dotcom-es-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-dotcom-es.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-dotcom-ja-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-dotcom-ja.json.br
Binary file not shown.
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-dotcom-pt-records.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-dotcom-pt.json.br
Git LFS file not shown
Binary file modified lib/search/indexes/github-docs-ghae-cn-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-ghae-cn.json.br
Binary file not shown.
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-ghae-de-records.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-ghae-de.json.br
Git LFS file not shown
Binary file modified lib/search/indexes/github-docs-ghae-en-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-ghae-en.json.br
Binary file not shown.
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-ghae-es-records.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-ghae-es.json.br
Git LFS file not shown
Binary file modified lib/search/indexes/github-docs-ghae-ja-records.json.br
Binary file not shown.
Binary file modified lib/search/indexes/github-docs-ghae-ja.json.br
Binary file not shown.
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-ghae-pt-records.json.br
Git LFS file not shown
3 changes: 3 additions & 0 deletions lib/search/indexes/github-docs-ghae-pt.json.br
Git LFS file not shown
6 changes: 5 additions & 1 deletion script/search/lunr-get-index-names.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url))
const fs = xFs.promises

export default async function getIndexNames() {
return await fs.readdir(path.join(__dirname, '../../lib/search/indexes'))
const indexList = await fs.readdir(path.join(__dirname, '../../lib/search/indexes'))
return indexList
.sort()
.filter((index) => !index.includes('records'))
.map((index) => index.replace('.json.br', ''))
}

0 comments on commit eddadb8

Please sign in to comment.