Skip to content

Commit 9048fd9

Browse files
authored
feat(cli-hooks): output node warnings to stderr for debugging outputs (#2152)
1 parent 15e1ce0 commit 9048fd9

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

packages/cli-hooks/src/get-hooks.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,11 @@ if (fs.realpathSync(process.argv[1]) === fileURLToPath(import.meta.url)) {
4343
* @returns {SDKInterface} Information about the hooks currently supported.
4444
*/
4545
export default function getHooks() {
46-
// NODE_NO_WARNINGS=1 silences node process warnings. These warnings can occur
47-
// on some node version (e.g. v23.2.0) and cause invalid JSON hook responses.
4846
return {
4947
hooks: {
50-
doctor: 'NODE_NO_WARNINGS=1 npx -q --no-install -p @slack/cli-hooks slack-cli-doctor',
51-
'check-update': 'NODE_NO_WARNINGS=1 npx -q --no-install -p @slack/cli-hooks slack-cli-check-update',
52-
'get-manifest': 'NODE_NO_WARNINGS=1 npx -q --no-install -p @slack/cli-hooks slack-cli-get-manifest',
48+
doctor: 'npx -q --no-install -p @slack/cli-hooks slack-cli-doctor',
49+
'check-update': 'npx -q --no-install -p @slack/cli-hooks slack-cli-check-update',
50+
'get-manifest': 'npx -q --no-install -p @slack/cli-hooks slack-cli-get-manifest',
5351
start: 'npx -q --no-install -p @slack/cli-hooks slack-cli-start',
5452
},
5553
config: {

packages/cli-hooks/src/get-hooks.spec.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,9 @@ import getHooks from './get-hooks.js';
66
describe('get-hooks implementation', async () => {
77
it('should return scripts for required hooks', async () => {
88
const { hooks } = getHooks();
9-
assert(hooks.doctor === 'NODE_NO_WARNINGS=1 npx -q --no-install -p @slack/cli-hooks slack-cli-doctor');
10-
assert(
11-
hooks['check-update'] === 'NODE_NO_WARNINGS=1 npx -q --no-install -p @slack/cli-hooks slack-cli-check-update',
12-
);
13-
assert(
14-
hooks['get-manifest'] === 'NODE_NO_WARNINGS=1 npx -q --no-install -p @slack/cli-hooks slack-cli-get-manifest',
15-
);
9+
assert(hooks.doctor === 'npx -q --no-install -p @slack/cli-hooks slack-cli-doctor');
10+
assert(hooks['check-update'] === 'npx -q --no-install -p @slack/cli-hooks slack-cli-check-update');
11+
assert(hooks['get-manifest'] === 'npx -q --no-install -p @slack/cli-hooks slack-cli-get-manifest');
1612
assert(hooks.start === 'npx -q --no-install -p @slack/cli-hooks slack-cli-start');
1713
});
1814

0 commit comments

Comments
 (0)