forked from mirrors/nixpkgs
plausible: update update.sh script
plausible: fix yarn.nix call
This commit is contained in:
parent
9c71958cfa
commit
7857183c0b
|
@ -18,14 +18,14 @@ let
|
|||
owner = "plausible";
|
||||
repo = "analytics";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-mMQqjl3rNwjQGx8SN9PAkQErwiCs1HYSP4HWzevxYbQ=";
|
||||
sha256 = "1d31y7mwvml17w97dm5c4312n0ciq39kf4hz3g80hdzbbn72mi4q";
|
||||
};
|
||||
|
||||
# TODO consider using `mix2nix` as soon as it supports git dependencies.
|
||||
mixFodDeps = beamPackages.fetchMixDeps {
|
||||
pname = "${pname}-deps";
|
||||
inherit src version;
|
||||
sha256 = "sha256-ZQfrTxsLzCWFf3vabOk0vyHWZLw69GJovm3vR+7UbMY=";
|
||||
sha256 = "1ikcskp4gvvdprl65x1spijdc8dz6klnrnkvgy2jbk0b3d7yn1v5";
|
||||
};
|
||||
|
||||
yarnDeps = mkYarnModules {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
"repository": {},
|
||||
"license": "MIT",
|
||||
"version": "1.4.0",
|
||||
"scripts": {
|
||||
"deploy": "$(npm bin)/webpack --mode production",
|
||||
"watch": "$(npm bin)/webpack --mode development --watch",
|
||||
|
@ -64,5 +63,6 @@
|
|||
"stylelint-config-standard": "^20.0.0",
|
||||
"webpack-bundle-analyzer": "^4.4.2"
|
||||
},
|
||||
"name": "assets"
|
||||
"name": "plausible",
|
||||
"version": "v1.4.0"
|
||||
}
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
#
|
||||
# * Add correct `name`/`version` field to `package.json`, otherwise `yarn2nix` fails to
|
||||
# find required dependencies.
|
||||
# * Keep `tailwindcss` on version 2.0.1-compat (on `yarn` it will be upgraded due to the `^`).
|
||||
# This is needed to make sure the entire build still works with `postcss-7` (needed
|
||||
# by plausible).
|
||||
# * Adjust `file:`-dependencies a bit for the structure inside a Nix build.
|
||||
# * Update hashes for the tarball & the fixed-output drv with all `mix`-dependencies.
|
||||
# * Generate `yarn.lock` & `yarn.nix` in a temporary directory.
|
||||
|
@ -29,10 +26,9 @@ fi
|
|||
SRC="https://raw.githubusercontent.com/plausible/analytics/${latest}"
|
||||
|
||||
package_json="$(curl -qf "$SRC/assets/package.json")"
|
||||
export fixed_tailwind_version="$(jq '.dependencies.tailwindcss' -r <<< "$package_json" | sed -e 's,^^,,g')"
|
||||
|
||||
echo "$package_json" \
|
||||
| jq '. + {"name":"plausible","version": $ENV.latest} | .dependencies.tailwindcss = $ENV.fixed_tailwind_version' \
|
||||
| jq '. + {"name":"plausible","version": $ENV.latest}' \
|
||||
| sed -e 's,../deps/,../../tmp/deps/,g' \
|
||||
> $dir/package.json
|
||||
|
||||
|
@ -58,7 +54,6 @@ cp -r "$(nix-build -A plausible.mixFodDeps)" "$tmp_setup_dir/deps"
|
|||
chmod -R u+rwx "$tmp_setup_dir"
|
||||
|
||||
pushd $tmp_setup_dir/assets
|
||||
jq < package.json '.dependencies.tailwindcss = "'"$fixed_tailwind_version"'"' | sponge package.json
|
||||
yarn
|
||||
yarn2nix > "$dir/yarn.nix"
|
||||
cp yarn.lock "$dir/yarn.lock"
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue