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

chore: Full conversion to typescript (#29) #74

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

SharpSeeEr
Copy link

There are some TODO: comments scattered around in places where I honestly had no idea what to do.

Copy link
Member

@TimothyJones TimothyJones left a comment

Choose a reason for hiding this comment

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

I took a quick look. Impressive amount of work!

I'm not clear on what some of the TODO comments mean - could you perhaps update them to become tasks rather than notes? Am I right in thinking that they would need to be addressed before release?

Also, looks like there's only one test converted, is that right?

// // default: defaults[propName] ? defaults[propName] : property.default,
// // group: 'Preset Configuration:',
// });
// });
Copy link
Member

Choose a reason for hiding this comment

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

There are a lot of comments in this file - are they supposed to be still commented?

Copy link
Author

Choose a reason for hiding this comment

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

It was the end of my day and I wanted to get the changes pushed up to get other eyes on them so I was in a hurry and didn't do any cleanup. :)

Copy link
Author

Choose a reason for hiding this comment

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

Oh, also, the commented code at the bottom of the file was meant to dynamically add the properties from the spec to yargs, so if they changed anything in the spec the yargs config would automatically get updated. So I intentionally left this here to make sure that everyone was okay with removing it.

It doesn't really help, as the code depends on having those properties, and if the spec changed we would still have to update the code.

As for all the commented default: lines, I did that because the --help output looked awful. I think a better solution would be to add an .epilogue() with a link to the docs that explain what the default values are.

}
} else {
config = JSON.parse(readFileSync(configPath))
return {}
Copy link
Member

Choose a reason for hiding this comment

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

Nice change 👍

@@ -39,7 +39,7 @@ function getTypeofLockFile (cwd = '.') {
})
}

const detectPMByLockFile = async (cwd) => {
const detectPMByLockFile = async (cwd: string) => {
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be exported too, so the interface is the same

@TimothyJones
Copy link
Member

Looks like the build failure is real, too: https://github.com/absolute-version/commit-and-tag-version/actions/runs/4672719409/jobs/8275798247?pr=74#step:9:174

Error: lib/lifecycles/bump.ts(6,26): error TS7016: Could not find a declaration file for module 'dotgitignore'. '/home/runner/work/commit-and-tag-version/commit-and-tag-version/node_modules/dotgitignore/index.js' implicitly has an 'any' type.

@TimothyJones
Copy link
Member

Sorry I didn't get to your other PR in time - I wanted to comment and say that incremental PRs with settings updates would be a good approach - we could potentially have done the tests + lint first without touching the implementation, then merged that in to the typescript branch. That comment seems obsolete now, though 😂

@SharpSeeEr
Copy link
Author

I 100% agree that incremental PR's are the way to go. In my rush I opened this against master rather than the typescript conversion branch, which would allow more incremental PR's. I also screwed up by not renaming each file and then committing the change before making modifications so it shows as a rename instead of a delete and add.

As far as the build goes I didn't even try. I knew it wouldn't build at this stage. I'll work on converting the tests next.

@TimothyJones
Copy link
Member

I'm afraid I'm not really sure what to do with this one - I don't think we can really call it a full conversion unless it builds.

What state is it currently in? I might convert it to a draft while the build doesn't run.

@TimothyJones TimothyJones marked this pull request as draft June 2, 2023 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants