oclif / core

Node.js Open CLI Framework. Built by Salesforce.

Home Page:https://oclif.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upgrading to a version after 3.20.0 causes issues with hooks

gitfish opened this issue · comments

It appears that after updating to 3.20.0 none of the custom hooks in my plugin work. I'm guessing it's maybe due to the change in this line:

const {filePath, isESM, module} = await loadWithData(p, await tsPath(p.root, hook.target, p))

whereas with version 3.20.0 it was:

const {filePath, isESM, module} = await loadWithData(p, await tsPath(p.root, hook, p))

This change would suggest that I have to update my config as outlined here (to add a target and identifier): #945

or I'm probably missing something (such as other code converting the hook entries into this structure).

Our plugin is still built to output commonjs with good old tsc, so not sure whether that's related (and whether we need to stick with a version < 3.21.0 if that's the case) - but I would have thought the code could check the type of the hook entry value to cover off all cases.

Cheers,

@gitfish I'm not seeing this on my end - can you create a repository that replicates the issue? Thanks!

Yeah, observing some strange stuff. No issue on my local machine with this, but in one of our devops containers it's presenting the hook config as a string instead of with identifier and target. More digging required on this side.

It's almost like this piece of code is not running (which I don't really see as possible):

function determineHookOptions(hook: string | HookOptions): HookOptions {