-
Notifications
You must be signed in to change notification settings - Fork 101
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: add comment to config #3345
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
30e9c99
to
f2d6b7f
Compare
// Add values | ||
const resultWithValues = Object.keys(VALUES_BY_PARAM_NAME).reduce((acc, propName) => { | ||
return acc.replace(new RegExp(`("${propName}".* )(".*")(.*)$`, 'gm'), `$1${VALUES_BY_PARAM_NAME[propName]}$3`) | ||
}, resultWithComments) |
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.
this helps to solve the issue serialising the provider, see description of the PR
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.
Looks great!
b78e6ef
to
44de9c8
Compare
Summary
Follow up on #3337
This PR allows us to easily add comments to the params in the generated sippet, additionally makes some proposals to improve the documentation, and add identation support to show better the config in the HTML snippet
Add comments
Before:
After:
Allow to add values to params
Some values like the
ethereum.provider
where not added because they don't serialise too well.This PR also adds a simple way to add it back:
Before:
After:
Remove some parameters
It also removes the
env
parameter. I think makes people more confused than it helps them. If they want, they can still find it in the docsI actually don't love this parameter. I think it should be the
baseURL
that we pass. But probably is fine by now. Maybe someone wants to use an IPFS oneSanitize params moved to a const
Add identation support to improve HTML snippet
Before:
After:
Change some config descriptions
Changed the documentation for some config params
Test
Open the modal and check the 3 snipets