-
Notifications
You must be signed in to change notification settings - Fork 12
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
Upgrade ocliff version and migrate almost all files to ts #80
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed ~60% of the files. Not sure if I'll have time to review the rest though 😅
"prettier": "^2.4.1", | ||
"trace-unhandled": "^2.0.1", | ||
"ts-jest": "^28.0.7", | ||
"ts-node": "^10.9.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be a main dep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it was the case, but it's only needed on dev. Creating a new project with oclif put it in dev dependencies.
Furthermore, typescript is compiled of release
@@ -0,0 +1 @@ | |||
# examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this file necessary?
auth: { | ||
username: kc.getCurrentUser()?.username ?? '', | ||
password: kc.getCurrentUser()?.password ?? '', | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure it's fully equivalent... how about servername
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not present in axios options.
Kube command only add username, password and servername. Types are not compatible between the two.
vi.mock('../utils.js', async (importOriginal) => { | ||
const actual = await importOriginal<typeof import('../utils.js')>(); | ||
return { | ||
...actual, | ||
getCommitMessage: vi.fn(), | ||
getBranchName: vi.fn(), | ||
getCommitId: vi.fn(), | ||
getCommitAncestorWithDefaultBranch: vi.fn(), | ||
getDirectCommitAncestor: vi.fn(), | ||
}; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: not found of setting the mock inbetween import statements
vi.mock('node:child_process', async (importOriginal) => { | ||
const actual = await importOriginal<typeof import('node:child_process')>(); | ||
return { | ||
...actual, | ||
exec: vi.fn(), | ||
}; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
This PR migrate oclif to version 3.5.4 from version 1.x.
Migrate some files that were still in javascript.
Use ESM completely instead of commonjs.
Updated examples.
Use vitest instead of jest for better support os ESM.
One file that I didn't make it specify the context in tasks. The ListrContext is just an alias for
any |undefined