aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorCyril Sobierajewicz <38043722+cyrilfretlink@users.noreply.github.com>2020-05-12 11:57:31 +0200
committerGitHub <noreply@github.com>2020-05-12 11:57:31 +0200
commit70b79be6cd660b55f401c264c5bfa5fdd5d1f909 (patch)
tree411e8a624f0a1788d4437ae42307fced3e7ab485
parente265ce577dfea922bc3e6ac89f33cab8d104dde2 (diff)
parentfe9b8ac97a6913a0dd6d726eb36321bfe841e38f (diff)
downloadnode-dhall-json-bin-70b79be6cd660b55f401c264c5bfa5fdd5d1f909.tar.gz
node-dhall-json-bin-70b79be6cd660b55f401c264c5bfa5fdd5d1f909.tar.zst
node-dhall-json-bin-70b79be6cd660b55f401c264c5bfa5fdd5d1f909.zip
Merge pull request #4 from cyrilfretlink/remove-yaml-to-dhall
Remove `yaml-to-dhall`
-rw-r--r--package-lock.json2
-rw-r--r--package.json5
-rw-r--r--preinstall.js5
3 files changed, 3 insertions, 9 deletions
diff --git a/package-lock.json b/package-lock.json
index 2769f8a..946bfcf 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
1{ 1{
2 "name": "dhall-json", 2 "name": "dhall-json",
3 "version": "2.0.1", 3 "version": "3.0.0",
4 "lockfileVersion": 1, 4 "lockfileVersion": 1,
5 "requires": true, 5 "requires": true,
6 "dependencies": { 6 "dependencies": {
diff --git a/package.json b/package.json
index 5d7cb78..488e9b5 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
1{ 1{
2 "name": "dhall-json", 2 "name": "dhall-json",
3 "version": "2.0.1", 3 "version": "3.0.0",
4 "description": "NPM package for `dhall-json`, based on https://github.com/justinwoo/npm-psc-package-bin-simple.", 4 "description": "NPM package for `dhall-json`, based on https://github.com/justinwoo/npm-psc-package-bin-simple.",
5 "os": [ 5 "os": [
6 "darwin", 6 "darwin",
@@ -16,8 +16,7 @@
16 "bin": { 16 "bin": {
17 "dhall-to-json": "bin/dhall-to-json.exe", 17 "dhall-to-json": "bin/dhall-to-json.exe",
18 "dhall-to-yaml": "bin/dhall-to-yaml.exe", 18 "dhall-to-yaml": "bin/dhall-to-yaml.exe",
19 "json-to-dhall": "bin/json-to-dhall.exe", 19 "json-to-dhall": "bin/json-to-dhall.exe"
20 "yaml-to-dhall": "bin/yaml-to-dhall.exe"
21 }, 20 },
22 "scripts": { 21 "scripts": {
23 "preinstall": "node ./preinstall.js" 22 "preinstall": "node ./preinstall.js"
diff --git a/preinstall.js b/preinstall.js
index 292b73b..8fdfbfe 100644
--- a/preinstall.js
+++ b/preinstall.js
@@ -62,15 +62,10 @@ const dhallJsonVersion = readVersion("dhall-json");
62 62
63const isLesserThan = (version, upperBound) => 63const isLesserThan = (version, upperBound) =>
64 semver.valid(version) && semver.lt(version, upperBound); 64 semver.valid(version) && semver.lt(version, upperBound);
65const isGreaterThan = (version, lowerBound) =>
66 semver.valid(version) && semver.gt(version, lowerBound);
67 65
68if (isLesserThan(dhallJsonVersion, "1.2.8")) { 66if (isLesserThan(dhallJsonVersion, "1.2.8")) {
69 throw new Error(`This release of the \`${pkg.name}\` npm package installs \`json-to-dhall\`, which isn’t provided by \`dhall-json@<1.2.8\`.`); 67 throw new Error(`This release of the \`${pkg.name}\` npm package installs \`json-to-dhall\`, which isn’t provided by \`dhall-json@<1.2.8\`.`);
70} 68}
71if (isLesserThan(dhallJsonVersion, "1.3.0") || isGreaterThan(dhallJsonVersion, "1.5.0")) {
72 throw new Error(`This release of the \`${pkg.name}\` npm package installs \`yaml-to-dhall\`, which isn’t provided by \`dhall-json@<1.3.0 >1.5.0\`.`);
73}
74 69
75const release = `https://github.com/dhall-lang/dhall-haskell/releases/download/${dhallVersion}/dhall-json-${dhallJsonVersion}`; 70const release = `https://github.com/dhall-lang/dhall-haskell/releases/download/${dhallVersion}/dhall-json-${dhallJsonVersion}`;
76 71