Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REVIEW #1

Open
wants to merge 149 commits into
base: review-base
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
8077030
intial version of elm+webpack setup
garbas Mar 28, 2020
0536f6e
Almost got nix-build working
garbas Mar 28, 2020
08ab45d
add some integration packages
garbas Mar 30, 2020
3643fbe
add yarn.lock and direnv integration
garbas Mar 30, 2020
ea09e01
init work on search
garbas Mar 31, 2020
7ba9487
add model for package and option result
garbas Mar 31, 2020
f19216f
make a request to elasticsearch, nothing fancy
garbas Apr 7, 2020
40bd247
add style to the search result
garbas Apr 10, 2020
824e370
deploy to netlify (#1)
garbas Apr 10, 2020
f375311
Remove hourly build (#2)
garbas Apr 11, 2020
f031845
init readme (#3)
garbas Apr 21, 2020
387d70e
somehow in a working starte with bugs and missing features
garbas May 8, 2020
f25b287
make request to the right search page, fixes #4 (#7)
garbas May 8, 2020
99eae10
search on page load and on second search query, fixes #5 (#8)
garbas May 8, 2020
9064063
a single page app and want history pushstate to work so you get clean…
garbas May 8, 2020
3918246
switching to wildcard query (#10)
garbas May 11, 2020
2a75422
Hide details when clicked on result row again (#16)
garbas May 11, 2020
4efb8dd
package and option detailed view (#17)
garbas May 11, 2020
d3c3e2e
preserving item displaying details on page refresh (#19)
garbas May 11, 2020
c47f1c0
Pagination of search results (#20)
garbas May 11, 2020
ce2121e
channel drowdown (#21)
garbas May 11, 2020
645813c
index as keywords (#24)
garbas May 11, 2020
ec4c23f
implement NotAsked, Error and empty search result view (#28)
garbas May 11, 2020
3816a70
import name as keyword (#30)
Mic92 May 14, 2020
042cb40
Use a custom attrname analyzer (#35)
adisbladis May 19, 2020
f4b7ebc
Bool query (#36)
garbas May 20, 2020
2868805
Add top-level attrset to package documents (#37)
adisbladis May 21, 2020
4629bc3
Format and link import script (#44)
garbas May 22, 2020
b264d7a
some logging added and hidden behind --verbose flag (#45)
garbas May 22, 2020
2600984
implemented index alias to make import atomic (#46)
garbas May 22, 2020
c45a158
import channel script should be idempotent (#47)
garbas May 22, 2020
fda96bd
run import-channel every hour for last 3 channels (#48)
garbas May 22, 2020
ae67099
use one index per channel (#54)
garbas Jun 3, 2020
8896ea9
only one evaluation per alias allowed (#56)
garbas Jun 3, 2020
0a6369e
improve nixos options search (#55)
adisbladis Jun 3, 2020
ec5839f
adding a footer and a thank you to bonsai (#57)
garbas Jun 4, 2020
d6803ef
use schema version also in packages index (#58)
garbas Jun 4, 2020
554236f
Import hydra builds (#75)
garbas Jun 9, 2020
b7df41a
reduce the platform list and add platform link to hydra (#76)
garbas Jun 9, 2020
c79de4b
Point to correct github location (#77)
garbas Jun 10, 2020
bddb6c4
fixed (#78)
garbas Jun 10, 2020
7a9d4cd
Reload search results on channel change (#80)
garbas Jun 10, 2020
9413e66
Provide correct link to hydra job or if exists build (#81)
garbas Jun 10, 2020
6905ea4
Preserve search options between packages and options search page (#82)
garbas Jun 10, 2020
12bea73
user attr_name and option_name for showDetailsFor (#83)
garbas Jun 10, 2020
7f2ed39
Fix how we display default/example/description of an option (#86)
garbas Jun 11, 2020
007eee1
Make sure that we dont trap users on search.nixos.org (#87)
garbas Jun 11, 2020
cbec4ad
Nix language primitives are luckily the same as in JSON (#88)
garbas Jun 11, 2020
2983c00
problem with pagination when a number of items in result matches the …
garbas Jun 11, 2020
f3139f5
Fixes wonky selection of item in search result (#90)
garbas Jun 11, 2020
9f3de34
nicer loading spinner (#91)
garbas Jun 11, 2020
2daa4b0
Fix title of the app before it loads (#97)
garbas Jun 12, 2020
6992416
List channel as button group (#98)
garbas Jun 12, 2020
a8b7faa
make nix-build work (#100)
garbas Jun 12, 2020
7a73578
handle 10000 package limit in the UI correctly (#99)
garbas Jun 15, 2020
0fb5f69
use short names for channels now (#101)
garbas Jun 15, 2020
c420d05
improve packages search query (#102)
garbas Jun 18, 2020
bbc97d1
flakify (#106)
garbas Jun 18, 2020
3ecce08
Improve option search ranking (#107)
garbas Jun 19, 2020
b06bac6
Fix cron workflow (#108)
garbas Jun 19, 2020
1f8939b
Suggestions for search field (#74)
adisbladis Jul 2, 2020
3dceb99
add burger icon to show collapsed navbar when on mobile (#111)
garbas Jul 2, 2020
46c7eaa
Some UX fixes for showing suggestions (#112)
garbas Jul 6, 2020
5a5395a
Pointing to correct branch for different channels (#113)
garbas Jul 6, 2020
af66eef
dont show browser autocomplete for query input (#116)
garbas Jul 8, 2020
08c5d99
include query item in search suggestions (#117)
garbas Jul 8, 2020
9b79619
Better define the page we are on (#126)
garbas Jul 9, 2020
5cc46b4
change channel order (#127)
garbas Jul 9, 2020
a3ed203
don't show spinner when empty query is submitted (#128)
garbas Jul 9, 2020
71eba22
add backdrop for suggestions and show suggestions loading spinner the…
garbas Jul 9, 2020
4173453
Adjust ranking of should_match_bool_prefix queries (#130)
garbas Jul 9, 2020
cc5e4a5
Allow to show results alphabetically (#133)
garbas Jul 10, 2020
c048af9
Always use "nixos-*" channels to look up for builds (#139)
garbas Jul 24, 2020
3bf4907
Use nix to install awscli (#140)
garbas Jul 24, 2020
44cbea8
remove suggestions feature (#141)
garbas Jul 24, 2020
cbaf978
add link to issues tracker (#144)
garbas Aug 7, 2020
bbec7b2
search on multiple fields not just package_attr_name or option_name (…
garbas Aug 7, 2020
d96877d
Use english analyzer for descriptions (#110)
adisbladis Aug 8, 2020
818074f
add longDescription to the list of fields we search over (#146)
garbas Aug 10, 2020
91527f1
space should present an OR operation in query (#150)
garbas Aug 21, 2020
e4fec33
Dont reload when showing result item details (#152)
garbas Aug 21, 2020
0ef75fa
allways display default value for fields in result details (#155)
garbas Aug 24, 2020
746b4b1
for node-sass xcodebuild is needed on darwin (#166)
garbas Aug 28, 2020
8175e2b
switch from sass to less (css) (#167)
hmaurer Aug 28, 2020
f10911f
add support for `nix develop` (#159)
zimbatm Aug 28, 2020
6523819
adding cachix to speed up the builds (#169)
garbas Aug 28, 2020
b4a6535
rework ranking queries (#168)
garbas Aug 29, 2020
48c05f6
using whitespace analyzer and not the default one (#172)
garbas Aug 30, 2020
2ffaefe
Using whitespace as analyzer reduces too much the matched items (#174)
garbas Aug 31, 2020
c12f4df
add suffix search (or reverse prefix) (#176)
garbas Sep 1, 2020
2a441c9
when wrong channel is selected (via url) show error (#178)
garbas Sep 3, 2020
7f91e92
maintainer.name field can also be null (#182)
garbas Sep 7, 2020
038ee96
Add OpenSearch specifications for both packages and options. (#190)
zopieux Sep 15, 2020
1ecf99c
in older channels email was conditional (#194)
garbas Sep 17, 2020
5a65c6f
By mistake the default analyzer was used for query (#195)
garbas Sep 17, 2020
86ad9d0
Reworked search query (#197)
garbas Sep 23, 2020
4b9f197
Add nixos 20.09 (#199)
garbas Sep 24, 2020
a2c570e
20.09 -> nixos-20.09beta and unstable -> nixos-21.03pre (#205)
garbas Oct 5, 2020
33c2c8a
Always use NixOS/nixpkgs instead of NixOS/nixpkgs-channels (#208)
andir Oct 7, 2020
a23bcf1
`channel-diff` script (#206)
garbas Oct 7, 2020
adbb224
point to release prefix for 20.09 channel (#212)
garbas Oct 27, 2020
e412085
Support search engine escaping of spaces (+) (#215)
turboMaCk Oct 28, 2020
2de4ef3
Remove cleanUrl and fragment hack (#216)
turboMaCk Oct 28, 2020
fe04d9b
Refactor route structure (#219)
turboMaCk Oct 30, 2020
1407641
Latest stable is now the default channel (#221)
plfaucher Nov 4, 2020
7426982
Update github actions (#227)
garbas Nov 17, 2020
4d505f3
Remove unnecessary jquery, jquery-ui and bootstrap javascript referen…
BenediktSeidl Nov 17, 2020
7ac72dc
recurse into haskell.compiler to find additional Haskell compilers (#…
adamse Nov 17, 2020
29f5f02
Discard effects when routing only query params (#229)
turboMaCk Nov 18, 2020
8dd69e6
awscli -> awscli2 (#234)
garbas Nov 23, 2020
ecf71f5
Fix links to github sources (#232)
turboMaCk Nov 23, 2020
060daed
Refactor the loading and request management (#230)
turboMaCk Nov 28, 2020
7bcf9f1
Fix import scripts, remove 19.09 branch (#239)
ncfavier Nov 30, 2020
3b53d74
AWS_DEFAULT_REGION was missing in our cron github actions (#240)
garbas Nov 30, 2020
d23b777
use lowercase filter on edge analyzer (#241)
garbas Nov 30, 2020
27ff900
Fix package position links (#242)
ncfavier Dec 2, 2020
ba3fe60
import-scripts: fix boolean rendering (#246)
ncfavier Dec 7, 2020
bae5a92
Fix redirect from / to /packages breaking browser back button (#248)
bmwalters Dec 7, 2020
06f5aa9
Add retry to parts of the import script which were failing from time …
garbas Dec 7, 2020
274e657
Pretty print nix examples and default fields in options (#252)
garbas Dec 16, 2020
282d0b1
Fix PATH in Githb Actions (#253)
garbas Dec 17, 2020
aea6789
Improve nix.py (#254)
ncfavier Dec 18, 2020
258e142
switch to main branch and publish to netlify
garbas Dec 18, 2020
153674a
removing ideas from the README.md since we already have them in tickets
garbas Dec 18, 2020
0894321
Fixes support for packages with multiple homepage entries. (#255)
turboMaCk Dec 28, 2020
aa366aa
Implement scroll to package (#257)
turboMaCk Dec 28, 2020
01d682f
Add package / request package link when no results (#256)
turboMaCk Dec 28, 2020
f624c11
Add semanticaly clickable `button` element to result list (#260)
turboMaCk Jan 6, 2021
1c1a3ca
Fix mobile only interactions (#267)
turboMaCk Jan 20, 2021
5bb94c9
Adds faceted search (#261)
garbas Jan 23, 2021
e9bdeae
Remove the defunct "burger menu" and always expand the navigation (#273)
andir Jan 25, 2021
b208c24
Improve copy/paste UX in Options and Packages (#275)
turboMaCk Jan 25, 2021
69efbb6
version should not be shown if it is empty (#278)
garbas Jan 25, 2021
72434f5
Search should be case sensitive (#287)
garbas Feb 6, 2021
cfb5e54
Improving search query (#288)
garbas Feb 7, 2021
7c89b23
Filter on buckets only when there is some bucket selected (#289)
garbas Feb 7, 2021
e5ba056
unstable/21.03pre -> unstable/21.05pre (#297)
garbas Mar 30, 2021
2c4a451
update flake inputs (#298)
garbas Mar 30, 2021
ff8022f
emacs packages have new attr path (#299)
garbas Mar 30, 2021
d1085b8
21.05 release (#311)
garbas Jun 2, 2021
be5aea1
forgot to update the github cron workflow to rebuild last 2 channels
garbas Jun 8, 2021
ce08a87
bump actions versions (#315)
garbas Jun 8, 2021
519f18e
Add dependabot to automate updating of github actions (#316)
garbas Jun 8, 2021
25b085f
Do not show legacy aliases (#309)
jtojnar Jun 8, 2021
42b0e87
import-scripts: fix IndexError for options with no declarations (#330)
ncfavier Aug 2, 2021
5ad7136
Rewrite import script in Rust (#320)
ysndr Aug 17, 2021
af3b494
Flake support/frontend (#324)
ysndr Aug 25, 2021
3402e7d
Don't list unfree packages (#343)
andir Aug 25, 2021
e8fe09e
Fix extra arrow outside the flake context
ysndr Aug 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:

- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: '00:00'
timezone: UTC
open-pull-requests-limit: 10
commit-message:
prefix: "Dependabot"
include: "scope"
69 changes: 69 additions & 0 deletions .github/workflows/cron-flakes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: "Flakes: Hourly import to Elasticsearch"

on:

schedule:
- cron: '0 * * * *'

jobs:

hourly-import-channel:

runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
group:
- "manual"

env:
RUST_LOG: debug
FI_ES_EXISTS_STRATEGY: recreate
FI_ES_URL: ${{ secrets.ELASTICSEARCH_URL }}

steps:

- name: Checking out the repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Installing Nix
uses: cachix/install-nix-action@v13
with:
install_url: https://nixos-nix-install-tests.cachix.org/serve/i6laym9jw3wg9mw6ncyrk6gjx4l34vvx/install
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
extra_nix_config: |
experimental-features = nix-command flakes
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}

- uses: cachix/cachix-action@v10
with:
name: nixos-search
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'

- name: Install unstable channel
run: |
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --update

- name: Installing jq
run: |
nix-env -iA nixpkgs.nixFlakes nixpkgs.jq

- name: Building import_scripts
run: |
nix build ./#packages.x86_64-linux.flake_info

- name: Import ${{ matrix.group }} group
run: |
./result/bin/flake-info --push --elastic-schema-version=$(cat ./VERSION) group ./flakes/${{ matrix.group }}.toml ${{ matrix.group }}
if: github.repository == 'NixOS/nixos-search'

- name: Warmup ${{ matrix.group }} channel
run: |
curl ${{ secrets.ELASTICSEARCH_URL }}/$(cat VERSION)-${{ matrix.group }}/_search | jq '.took'
curl ${{ secrets.ELASTICSEARCH_URL }}/$(cat VERSION)-${{ matrix.group }}/_search | jq '.took'
curl ${{ secrets.ELASTICSEARCH_URL }}/$(cat VERSION)-${{ matrix.group }}/_search | jq '.took'
if: github.repository == 'NixOS/nixos-search'
72 changes: 72 additions & 0 deletions .github/workflows/cron-nixpkgs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: "Nixpkgs: Hourly import to Elasticsearch"

on:

schedule:
- cron: '0 * * * *'
pull_request:

jobs:

import-channel:

runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
channel:
- unstable
- 21.05
- 20.09

env:
RUST_LOG: debug
FI_ES_EXISTS_STRATEGY: abort
FI_ES_URL: ${{ secrets.ELASTICSEARCH_URL }}

steps:

- name: Checking out the repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Installing Nix
uses: cachix/install-nix-action@v13
with:
install_url: https://nixos-nix-install-tests.cachix.org/serve/i6laym9jw3wg9mw6ncyrk6gjx4l34vvx/install
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
extra_nix_config: |
experimental-features = nix-command flakes
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}

- uses: cachix/cachix-action@v10
with:
name: nixos-search
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'

- name: Install unstable channel
run: |
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --update

- name: Installing jq
run: |
nix-env -iA nixpkgs.nixFlakes nixpkgs.jq

- name: Building import_scripts
run: |
nix build ./#packages.x86_64-linux.flake_info

- name: Import ${{ matrix.channel }} channel
run: |
./result/bin/flake-info --push --elastic-schema-version=$(cat ./VERSION) nixpkgs ${{ matrix.channel }}
if: github.repository == 'NixOS/nixos-search'

- name: Warmup ${{ matrix.channel }} channel
run: |
curl ${{ secrets.ELASTICSEARCH_URL }}/latest-$(cat VERSION)-nixpkgs-${{ matrix.channel }}/_search | jq '.took'
curl ${{ secrets.ELASTICSEARCH_URL }}/latest-$(cat VERSION)-nixpkgs-${{ matrix.channel }}/_search | jq '.took'
curl ${{ secrets.ELASTICSEARCH_URL }}/latest-$(cat VERSION)-nixpkgs-${{ matrix.channel }}/_search | jq '.took'
if: github.repository == 'NixOS/nixos-search'
58 changes: 58 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: "Frontend: Build & Deploy to Netlify"
on:
pull_request:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checking out the repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Installing Nix
uses: cachix/install-nix-action@v13

- uses: cachix/cachix-action@v10
with:
name: nixos-search
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'

- name: Install unstable channel
run: |
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --update

- name: Installing NixFlakes
run: |
nix-env -iA nixpkgs.nixFlakes
echo 'experimental-features = nix-command flakes' | sudo tee -a /etc/nix/nix.conf
nix --version
cat /etc/nix/nix.conf
echo "$HOME/.nix-profile/bin" >> $GITHUB_PATH

- name: Building search.nixos.org
run: |
nix build ./#packages.x86_64-linux.frontend
mkdir ./dist
cp -RL ./result/* ./dist/

- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.2
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
with:
production-branch: 'main'
production-deploy: ${{ github.event_name == 'push' }}
publish-dir: './dist'
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: 'Deploy from GitHub Actions'
enable-pull-request-comment: true
enable-commit-comment: true
enable-commit-status: true
overwrites-pull-request-comment: false
if: github.repository == 'NixOS/nixos-search'
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
*.log
.DS_Store
.cache
.idea
.vscode
.node_repl_history
.npm
target/
build/Release
dist
elm-stuff/
eval-*
ignore
import-scripts/import_scripts/__pycache__/
import-scripts/tests/__pycache__/
logs
node_modules
npm-debug.log*
package-lock.json
repl-temp-*
result
src-url
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# search.nixos.org

This repository contains the scripts and the web application for
`search.nixos.org`.


## How this project came to be

Initial idea was to replace NixOS packages and options search which was
fetching one JSON file which contained all packages (or options). This approach
is good for its simple setup, but started to show its problems when packages
number was getting bigger and bigger. I'm sure we could optimize it further,
but ideas what all could we do if there would be some database in the back were
to tempting not to try.

For backend we are using Elasticsearch instance which is kindly sponsored by
[bonsai.io](https://bonsai.io). On the frontend we are using
[Elm](https://elm-lang.org).


## How search works?

The use case we want to solve is that a visitor want to see if a package
exists or to look up certain package's details.

A user wants to converge to a single result if possible. The more characters
are added to a search query the more narrow is search is and we should show
less results.

Very important is also ranking of search results. This will bring more relevant
search results to the top, since a lot of times it is hard to produce search
query that will output only one result item.

A less important, but providing better user experience. are suggestions for
writing better search query. Suggesting feature should guide user to write
better queries which in turn will produce better results.


## Development

To start developing open a terminal and run:

```
$ nix-shell --run "yarn dev"
```

You can point your browser to `http://localhost:3000` and start developing.
Any changes to source files (`./src`) will trigger a hot reload of an
application.


## Deploying

- On each commit to `main` branch a GitHub Action is trigger.
- GitHub Action then builds production version of the web application using
`yarn prod` command.
- The built web application (in `./dist`) is then deployed to Netlify.
- GitHub Action can also be triggered via Pull Request, which if Pull Request
was created from a non-forked repo's branch, will provide a preview url in a
comment.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
88 changes: 88 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{ pkgs ? import <nixpkgs> { }
, version ? pkgs.lib.removeSuffix "\n" (builtins.readFile ./VERSION)
}:
let
package = builtins.fromJSON (builtins.readFile ./package.json);
yarnPkg = pkgs.yarn2nix-moretea.mkYarnPackage rec {
name = "${package.name}-yarn-${package.version}";
src = null;
dontUnpack = true;
packageJSON = ./package.json;
yarnLock = ./yarn.lock;
preConfigure = ''
mkdir ${package.name}
cd ${package.name}
ln -s ${packageJSON} ./package.json
ln -s ${yarnLock} ./yarn.lock
'';
yarnPreBuild = ''
mkdir -p $HOME/.node-gyp/${pkgs.nodejs.version}
echo 9 > $HOME/.node-gyp/${pkgs.nodejs.version}/installVersion
ln -sfv ${pkgs.nodejs}/include $HOME/.node-gyp/${pkgs.nodejs.version}
'';
publishBinsFor =
[
"webpack"
"webpack-dev-server"
];
};
in
pkgs.stdenv.mkDerivation {
name = "${package.name}-${package.version}";
src = pkgs.lib.cleanSource ./.;

preferLocalBuild = true;

buildInputs =
[
yarnPkg
] ++
(with pkgs; [
nodejs
elm2nix
]) ++
(with pkgs.nodePackages; [
yarn
]) ++
(with pkgs.elmPackages; [
elm
elm-format
elm-language-server
elm-test
elm-analyse
]);

configurePhase = pkgs.elmPackages.fetchElmDeps {
elmPackages = import ./elm-srcs.nix;
elmVersion = pkgs.elmPackages.elm.version;
registryDat = ./registry.dat;
};

patchPhase = ''
rm -rf node_modules
ln -sf ${yarnPkg}/libexec/${package.name}/node_modules .
'';

buildPhase = ''
# Yarn writes cache directories etc to $HOME.
export HOME=$PWD/yarn_home
sed -i -e "s|process.env.ELASTICSEARCH_MAPPING_SCHEMA_VERSION|${version}|" src/index.js
yarn prod
'';

installPhase = ''
mkdir -p $out
cp -R ./dist/* $out/
cp netlify.toml $out/
'';
shellHook = ''
rm -rf node_modules
ln -sf ${yarnPkg}/libexec/${package.name}/node_modules .
export PATH=$PWD/node_modules/.bin:$PATH
export ELASTICSEARCH_MAPPING_SCHEMA_VERSION=${version}
echo "============================"
echo "= To develop run: yarn dev ="
echo "============================"
'';

}
Loading