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

feat: remove prepublish script when creating template with Semaphore CLI #882

Merged
merged 4 commits into from
Oct 23, 2024

Conversation

0xshikhar
Copy link
Contributor

feat: to remove the prepublish script from the scripts object of the package.json file of every cli template when the template is downloaded using the Semaphore CLI.

Related Issue(s)

Closes Issue#591

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have run yarn format and yarn lint without getting any errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

The idea is to remove the prepublish script from the scripts object of the package.json file of
every cli template when the template is downloaded using the CLI.

BREAKING CHANGE: n
Copy link
Member

@vplasencia vplasencia left a comment

Choose a reason for hiding this comment

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

Hey @0xshikhar it looks great! Thank you. Would you mind moving the new removePrePublishScript function to a new file called removePrePublishScript.ts? Similar to the getGroupIds.ts file.

Then the function will be something like export default function removePrePublishScript(...

@0xshikhar
Copy link
Contributor Author

Hey @vplasencia, just created a separate file for removePrePublishScript function to a new file called removePrePublishScript.ts. Thanks for your guidance.

Copy link
Member

@vplasencia vplasencia left a comment

Choose a reason for hiding this comment

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

Hey @0xshikhar! Great! Thank you!

Since the updatedPackageJsonContent variable has the correct content, maybe it's better to use it directly to list the available scripts in line 121 instead of reading from the package.json file again. Then that line would be:

const { scripts } = JSON.parse(updatedPackageJsonContent)

instead of:

const { scripts } = JSON.parse(readFileSync(`${currentDirectory}/${projectDirectory}/package.json`, "utf8"))

What do you think?

@0xshikhar
Copy link
Contributor Author

Hey @vplasencia, yes I also think that will be better - not to call the function again. Just updated the PR. Thanks !

Copy link
Member

@vplasencia vplasencia left a comment

Choose a reason for hiding this comment

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

Great work @0xshikhar! Thank you very much! 🙏

@vplasencia vplasencia merged commit 3be1726 into semaphore-protocol:main Oct 23, 2024
5 checks passed
Copy link

gitpoap-bot bot commented Oct 23, 2024

Congrats, your important contribution to this open-source project has earned you a GitPOAP!

GitPOAP: 2024 Semaphore Contributor:

GitPOAP: 2024 Semaphore Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.

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.

Remove prepublish script in the CLI monorepo templates from the published package
2 participants