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

Stopgap fix for marked dependency issue #58

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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@node-v16-min
- source: hapipal/ci-config-travis:hapi_all.yml@node-v16-min
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <command> <options>
Expand Down
13 changes: 6 additions & 7 deletions lib/commands/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "hapi pal CLI",
"main": "lib/index.js",
"engines": {
"node": ">=12"
"node": ">=16"
},
"directories": {
"test": "test"
Expand Down Expand Up @@ -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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a special reason this version is pinned, or can we use ^4.0.16?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The markdown parsing change comes in at 4.0.17, which breaks some of hpal's tests, so I pinned it to this specific version.

"marked-terminal": "^5.1.0",
"mkdirp": "1.x.x",
"mo-walk": ">=1.1.0 <2",
"pkg-dir": "5.x.x",
Expand All @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {

Expand Down Expand Up @@ -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) => {
Expand Down