From 17a1daf8c40469d3bc089d5e71f960e1e2fcd4e4 Mon Sep 17 00:00:00 2001 From: Matt Boutet Date: Fri, 3 Feb 2023 10:41:18 -0500 Subject: [PATCH 1/8] Stopgap fix for marked dependency issue --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 05ebddc..2800b92 100644 --- a/package.json +++ b/package.json @@ -44,8 +44,8 @@ "@hapipal/toys": "3.x.x", "bin-v8-flags-filter": ">=1.2.0 <2", "glob": "7.x.x", - "marked": "1.x.x", - "marked-terminal": "4.x.x", + "marked": "4.0.16", + "marked-terminal": "5.x.x", "mkdirp": "1.x.x", "mo-walk": ">=1.1.0 <2", "pkg-dir": "5.x.x", From d02fa5f86a176414007d4cb41951e4df07bc864e Mon Sep 17 00:00:00 2001 From: Matt Boutet Date: Sun, 19 Feb 2023 20:30:00 -0500 Subject: [PATCH 2/8] Update test to reflect new wording of error message --- test/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/index.js b/test/index.js index 12b248c..3374175 100644 --- a/test/index.js +++ b/test/index.js @@ -1090,7 +1090,8 @@ describe('hpal', () => { expect(err).to.be.instanceof(Error); expect(err).to.not.be.instanceof(DisplayError); - expect(err.message).to.contain('Cannot read property \'version\' of null'); + expect(err.message).to.contain('Cannot read properties of null (reading \'version\')'); + }); it('errors when can\'t find a manifest for an unknown reason.', async (flags) => { From cd132d881ffd6149cb91629a3dfbad5a88b76482 Mon Sep 17 00:00:00 2001 From: Matt Boutet Date: Sun, 19 Feb 2023 21:04:02 -0500 Subject: [PATCH 3/8] Update marked-terminal version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2800b92..d9b3089 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "bin-v8-flags-filter": ">=1.2.0 <2", "glob": "7.x.x", "marked": "4.0.16", - "marked-terminal": "5.x.x", + "marked-terminal": "^5.1.0", "mkdirp": "1.x.x", "mo-walk": ">=1.1.0 <2", "pkg-dir": "5.x.x", From 0aa6c5b5fa2aa23068318304b2ef7baa72952557 Mon Sep 17 00:00:00 2001 From: Matt Boutet Date: Wed, 22 Feb 2023 20:01:57 -0500 Subject: [PATCH 4/8] Update travis config to match what toys is using. Copypasta here, as I'm not a travis user, so this might get reverted --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0209611..4de56eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,3 @@ import: - - source: hapipal/ci-config-travis:os_all.yml@master - - source: hapipal/ci-config-travis:node_js.yml@master - - source: hapipal/ci-config-travis:hapi_all.yml@master + - source: hapipal/ci-config-travis:node_js.yml@hapi-v21 + - source: hapipal/ci-config-travis:hapi_all.yml@hapi-v21 \ No newline at end of file From 80c250687429784ffb5b5613025de6bfbeb74e9c Mon Sep 17 00:00:00 2001 From: Matt Boutet Date: Wed, 22 Feb 2023 20:35:46 -0500 Subject: [PATCH 5/8] Add 21 to version normalization regex --- test/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/index.js b/test/index.js index 3374175..37f126b 100644 --- a/test/index.js +++ b/test/index.js @@ -1011,7 +1011,7 @@ describe('hpal', () => { return { calls, cleanup }; }; - const normalizeVersion = (str) => str.replace(/(19|20)\.[\d]+\.[\d]+/g, '20.x.x'); + const normalizeVersion = (str) => str.replace(/(19|20|21)\.[\d]+\.[\d]+/g, '20.x.x'); it('errors when fetching docs 404s.', async (flags) => { From 2cbcedeab4fc4234bf3711ae29f2a308df0bdee9 Mon Sep 17 00:00:00 2001 From: Matt Boutet Date: Thu, 23 Feb 2023 09:45:15 -0500 Subject: [PATCH 6/8] Drop support for node v12 and v14 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d9b3089..6d8e6f2 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "hapi pal CLI", "main": "lib/index.js", "engines": { - "node": ">=12" + "node": ">=16" }, "directories": { "test": "test" From 37b40a49a8354e4e90729920b3bf37de55653a87 Mon Sep 17 00:00:00 2001 From: Matt Boutet Date: Thu, 23 Feb 2023 14:09:11 -0500 Subject: [PATCH 7/8] Update travis config to point at different branch. Update to readme --- .travis.yml | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4de56eb..e6dc057 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,3 @@ import: - - source: hapipal/ci-config-travis:node_js.yml@hapi-v21 - - source: hapipal/ci-config-travis:hapi_all.yml@hapi-v21 \ No newline at end of file + - source: hapipal/ci-config-travis:node_js.yml@node-v16-min + - source: hapipal/ci-config-travis:hapi_all.yml@node-v16-min \ No newline at end of file diff --git a/README.md b/README.md index a215c30..d525839 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ npx @hapipal/hpal docs --ver 20.0.0 h.response ``` ## Usage -> The hpal CLI is intended for use with hapi v19+ and nodejs v12+ (_see v2 for lower support_). +> The hpal CLI is intended for use with hapi v20+ and nodejs v16+ (_see v3 for lower support_). ``` Usage: hpal From 10e7246b5e1e4a341aad717c3c6eb59883ea4e40 Mon Sep 17 00:00:00 2001 From: Matt Boutet Date: Thu, 23 Feb 2023 20:28:41 -0500 Subject: [PATCH 8/8] npm init in v9 exits with code 0 on abort, so update how we detect that when running hpal new. Also update lab to pick up new global leak handling --- lib/commands/new.js | 13 ++++++------- package.json | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/commands/new.js b/lib/commands/new.js index a49c173..8f08ec1 100644 --- a/lib/commands/new.js +++ b/lib/commands/new.js @@ -149,17 +149,16 @@ internals.npmInit = (cwd, ctx) => { data = data.toString(); - if (data.toLowerCase().includes('is this ok?')) { - ctx.options.in.once('data', () => subproc.stdin.end()); + // npm init exits with code 0 if aborted in npm v9, so we + // must explicitly check for abort here. + if (data.toLowerCase().includes('aborted')) { + return reject(new Error(`Init aborted`)); } }); - subproc.once('close', (code) => { - - if (code !== 0) { - return reject(new Error(`Failed with code: ${code}`)); - } + subproc.once('close', (code, signal) => { + subproc.stdin.end(); return resolve(); }); }); diff --git a/package.json b/package.json index 6d8e6f2..f2d94d5 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "@hapi/boom": "9.x.x", "@hapi/code": "8.x.x", "@hapi/hapi": "20.x.x", - "@hapi/lab": "24.x.x", + "@hapi/lab": "25.x.x", "@hapipal/haute-couture": "4.x.x", "@types/hapi__hapi": "20.x.x", "coveralls": "3.x.x",