From e13b6477b632abcfb16f69eb42583d662abac768 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Tue, 25 Apr 2023 22:39:43 -0400 Subject: [PATCH 1/8] Indicated that this is an ES6 package by setting type=module. --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index a01b6ec..8e0da7e 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ }, "license": "MIT", "author": "Gaurav Vaidya ", + "type": "module", "main": "src/index.js", "bin": { "phyx2owl": "bin/phyx2owl.js", From 7eac66b283f9856ccc8d46411ed442d35838cf2e Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Tue, 25 Apr 2023 22:57:28 -0400 Subject: [PATCH 2/8] newick-js 1.1.1 seems to work. --- package.json | 1 - src/wrappers/PhylogenyWrapper.js | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 8e0da7e..a01b6ec 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ }, "license": "MIT", "author": "Gaurav Vaidya ", - "type": "module", "main": "src/index.js", "bin": { "phyx2owl": "bin/phyx2owl.js", diff --git a/src/wrappers/PhylogenyWrapper.js b/src/wrappers/PhylogenyWrapper.js index df874e3..fc9cd22 100644 --- a/src/wrappers/PhylogenyWrapper.js +++ b/src/wrappers/PhylogenyWrapper.js @@ -5,7 +5,7 @@ const { has } = require('lodash'); /** Used to parse Newick strings. */ -const parseNewick = require('newick-js').parse; +const newickJs = require('newick-js'); /** OWL terms to be used here. */ const owlterms = require('../utils/owlterms'); @@ -73,9 +73,9 @@ class PhylogenyWrapper { }); } - // Finally, try parsing it with parseNewick and see if we get an error. + // Finally, try parsing it with newickJs.parse() and see if we get an error. try { - parseNewick(newickTrimmed); + newickJs.parse(newickTrimmed); } catch (ex) { errors.push({ title: 'Error parsing phylogeny', @@ -152,7 +152,7 @@ class PhylogenyWrapper { // - 'both': Return node labels on both internal and terminal nodes. // Parse the phylogeny (will throw an exception if parsing failed). - const { graph } = parseNewick(this.phylogeny.newick || '()'); + const { graph } = newickJs.parse(this.phylogeny.newick || '()'); const [vertices, arcs] = graph; if (nodeType === 'both') { @@ -252,7 +252,7 @@ class PhylogenyWrapper { // This method provides a similar facility using the newick-js library. // // Throws an exception if the Newick could not be parsed. - const { graph, root, rootWeight } = parseNewick(newick); + const { graph, root, rootWeight } = newickJs.parse(newick); const [, arcs] = graph; // Go through the arcs, assigning 'children' to the appropriate parent node. From eb92963cc1df7b21e7bac6c9b6144d770de1bc4b Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Tue, 25 Apr 2023 23:03:59 -0400 Subject: [PATCH 3/8] Upgraded to v1.1.3 to replicate error. --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1b3e456..40eb6ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "jsonld": "^5.0.0", "lodash": "^4.17.20", "moment": "^2.27.0", - "newick-js": "1.1.1", + "newick-js": "^1.1.1", "retus": "^1.1.1", "yargs": "^15.4.1" }, @@ -4018,9 +4018,9 @@ "dev": true }, "node_modules/newick-js": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/newick-js/-/newick-js-1.1.1.tgz", - "integrity": "sha512-RaSmZTOtyMklxxu1BSR2Gr6LU+XGXvK+Oc5WVSAUCe7YO5XtkWZRN9qbXDnxtkfxGmHa5wNrC/DSMAeiVFTruA==" + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/newick-js/-/newick-js-1.1.3.tgz", + "integrity": "sha512-3QNWYh+4FmZQGyT4HD2MxaEveiwhWO5UWxshJLrqPy9cXYCxhCQQgcV2HbbDWZgXUVou9VmfsvwX+jFe9kGj1w==" }, "node_modules/nice-try": { "version": "1.0.5", diff --git a/package.json b/package.json index a01b6ec..5c31475 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "jsonld": "^5.0.0", "lodash": "^4.17.20", "moment": "^2.27.0", - "newick-js": "1.1.1", + "newick-js": "^1.1.1", "retus": "^1.1.1", "yargs": "^15.4.1" }, From 7cb583439b70989aae97b00d3f7fb9ec03c6495d Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Wed, 5 Jul 2023 00:56:48 -0400 Subject: [PATCH 4/8] Upgraded newick-js to v1.2.1. As per https://github.com/keesey/newick-js/issues/4#issuecomment-1598958525 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 40eb6ca..400097e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "jsonld": "^5.0.0", "lodash": "^4.17.20", "moment": "^2.27.0", - "newick-js": "^1.1.1", + "newick-js": "^1.2.1", "retus": "^1.1.1", "yargs": "^15.4.1" }, @@ -4018,9 +4018,9 @@ "dev": true }, "node_modules/newick-js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/newick-js/-/newick-js-1.1.3.tgz", - "integrity": "sha512-3QNWYh+4FmZQGyT4HD2MxaEveiwhWO5UWxshJLrqPy9cXYCxhCQQgcV2HbbDWZgXUVou9VmfsvwX+jFe9kGj1w==" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/newick-js/-/newick-js-1.2.1.tgz", + "integrity": "sha512-qyZVNtlXmORBf2w9vg2S/5N5mQlU46xDFdPX7SEDZTeSElafNQUelNzR7HWSKcVOpjXiDnBqkvjd5RlEG7/SEA==" }, "node_modules/nice-try": { "version": "1.0.5", diff --git a/package.json b/package.json index 5c31475..6c407f6 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "jsonld": "^5.0.0", "lodash": "^4.17.20", "moment": "^2.27.0", - "newick-js": "^1.1.1", + "newick-js": "^1.2.1", "retus": "^1.1.1", "yargs": "^15.4.1" }, From 0be2d490730995b252169e8453ef5cc3f07c1c7c Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Wed, 5 Jul 2023 00:59:53 -0400 Subject: [PATCH 5/8] Upgraded packages with `npm upgrade`. --- package-lock.json | 72 +++++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/package-lock.json b/package-lock.json index 400097e..a7a6467 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,33 +37,33 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz", - "integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", + "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", "dev": true, "dependencies": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", + "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", + "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-validator-identifier": "^7.22.5", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -116,9 +116,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.21.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.5.tgz", - "integrity": "sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.6.tgz", + "integrity": "sha512-wDb5pWm4WDdF6LFUde3Jl8WzPA+3ZbxYqkC6xAXuD3irdEHN1k0NfTRrJD8ZD378SJ61miMLCqIOXYhd8x+AJQ==", "dev": true, "dependencies": { "regenerator-runtime": "^0.13.11" @@ -220,9 +220,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.1.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.1.1.tgz", - "integrity": "sha512-uKBEevTNb+l6/aCQaKVnUModfEMjAl98lw2Si9P5y4hLu9tm6AlX2ZIoXZX6Wh9lJueYPrGPKk5WMCNHg/u6/A==" + "version": "20.3.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.3.tgz", + "integrity": "sha512-wheIYdr4NYML61AjC8MKj/2jrR/kDQri/CIpVoZwldwhnIrD/j9jIU5bJ8yBKuB2VhpFV7Ab6G2XkBjv9r9Zzw==" }, "node_modules/@types/qs": { "version": "6.9.7", @@ -2182,9 +2182,9 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz", + "integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -2426,12 +2426,13 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3" }, "funding": { @@ -2683,7 +2684,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -3128,9 +3128,9 @@ } }, "node_modules/is-core-module": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz", - "integrity": "sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==", + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", + "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -4045,9 +4045,9 @@ } }, "node_modules/nodejs-file-downloader": { - "version": "4.11.2", - "resolved": "https://registry.npmjs.org/nodejs-file-downloader/-/nodejs-file-downloader-4.11.2.tgz", - "integrity": "sha512-zgLlQcGnYD18R0vGQc8qLUovwQdVvVCKsB5xqO2FMvymWArikhhCuILkTtOuTTOtlnKgJ3RAL8N5efRGdNW3Uw==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/nodejs-file-downloader/-/nodejs-file-downloader-4.12.1.tgz", + "integrity": "sha512-LpfCTNhh805AlLnJnzt1PuEj+RmbrccbAQZ6hBRw2e6QPVR0Qntuo6qqyvPHG5s77/0w0IEKgRAD4nbSnr/X4w==", "dev": true, "dependencies": { "follow-redirects": "^1.15.1", @@ -4393,9 +4393,9 @@ } }, "node_modules/qs": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.1.tgz", - "integrity": "sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==", + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz", + "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==", "dependencies": { "side-channel": "^1.0.4" }, @@ -4433,9 +4433,9 @@ "dev": true }, "node_modules/rdf-canonize": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/rdf-canonize/-/rdf-canonize-3.3.0.tgz", - "integrity": "sha512-gfSNkMua/VWC1eYbSkVaL/9LQhFeOh0QULwv7Or0f+po8pMgQ1blYQFe1r9Mv2GJZXw88Cz/drnAnB9UlNnHfQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/rdf-canonize/-/rdf-canonize-3.4.0.tgz", + "integrity": "sha512-fUeWjrkOO0t1rg7B2fdyDTvngj+9RlUyL92vOdiB7c0FPguWVsniIMjEtHH+meLBO9rzkUlUzBVXgWrjI8P9LA==", "dependencies": { "setimmediate": "^1.0.5" }, From bbb51db2ef48d334f9a18fd74e5fcd1612c89c4a Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Tue, 18 Jul 2023 22:46:02 -0400 Subject: [PATCH 6/8] Updated CHANGELOG.md. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd28bbb..b127cb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this library will be documented in this file. The format is based on [Keep a Changelog] and this project adheres to [Semantic Versioning]. ## [Unreleased] +- PR #127: Upgraded Newick.js to ^1.2.1. ## [1.1.0] - 2023-05-11 - PR #129: Added curator notes to phylorefs and phylogenies. From 0787c471384ca61ff433171bcb506a6f1493faf4 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Tue, 18 Jul 2023 22:47:58 -0400 Subject: [PATCH 7/8] Check if this limits us to Node.js v12+. --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3780de6..9b04311 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - node-version: [10.x, 12.x, 14.x] + node-version: [12.x, 14.x] steps: - uses: actions/checkout@v2 From c50dd3b47f6b951ef3fff68830cf381f28eb162d Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Tue, 18 Jul 2023 22:52:14 -0400 Subject: [PATCH 8/8] Added Node.js v10.x break to CHANGELOG. --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b127cb0..5e07b18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,8 @@ All notable changes to this library will be documented in this file. The format is based on [Keep a Changelog] and this project adheres to [Semantic Versioning]. ## [Unreleased] -- PR #127: Upgraded Newick.js to ^1.2.1. +- PR #127: Upgraded Newick.js to ^1.2.1. This means that we no longer + support Node.js v10.x, which end-of-lifed on April 30, 2021. ## [1.1.0] - 2023-05-11 - PR #129: Added curator notes to phylorefs and phylogenies.