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

Create def script for easier lib def creation #4125

Merged
merged 6 commits into from
Sep 30, 2021

Conversation

Brianzchen
Copy link
Member

@Brianzchen Brianzchen commented Aug 23, 2021

Create a handy script inspired from #4042 that will create a basic structure for new type def configured to an appropriate lowest supported version as recommended in contribution guide.

Comes built with a lib def file plus a test file with base structure

Usage: ./create_def.sh lib-name 1.x.x

Skeleton File/Folder Structure

sample when running ./create_def.sh test 1.x.x
Screen Shot 2021-08-28 at 4 31 14 pm

Script Error Handling

Screen Shot 2021-08-23 at 11 55 58 pm

@Brianzchen
Copy link
Member Author

@FezVrasta not exactly what you were asking for but what do you think? Should remove a lot of small mistakes with repetition when creating a new lib def

@gantoine gantoine self-assigned this Aug 30, 2021
@gantoine
Copy link
Member

Could/should this be a command instead of a bash file? That way we can add it to the docs and help menu.

@Brianzchen
Copy link
Member Author

Could/should this be a command instead of a bash file? That way we can add it to the docs and help menu.

Sorry @gantoine what do you mean? Do you want this to be a node command that lives in cli/package.json and then is exposed via a bash script as opposed to being a bash script itself? I was basically copying the way ./quick_run_def_tests.sh gets used.

@gantoine
Copy link
Member

Yeah exactly! In the same way you'd run flow-typed create-stub lib-name, you could run flow-typed create-def lib-name 1.x.x. Then we could add it to the help menu and the wiki here on Github.

@Brianzchen
Copy link
Member Author

@gantoine Made a change, let me know if it's what you're looking for. Learnt more about the cli so that was good experience :)

Copy link
Contributor

@AndrewSouthpaw AndrewSouthpaw left a comment

Choose a reason for hiding this comment

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

Looks great. @Brianzchen looks like maybe you didn't push the latest changes turning it into a CLI command?

CONTRIBUTING.md Show resolved Hide resolved
@gantoine gantoine merged commit 46e5816 into flow-typed:master Sep 30, 2021
@Brianzchen Brianzchen deleted the create-def branch September 30, 2021 04:33
@gantoine gantoine added the cli Related to CLI tool label Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to CLI tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants