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

initial draft for template args rules #195

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

technophile-04
Copy link
Collaborator

Description:

The initial draft for initial rules.

I think this should probably be merged after #175.

After #175 we can update other config files to follow the same patterns like updating tailwind.config, nextjs.config etc.

- Use `<name>Override` (object) to extend existing variables/objects
- Can reference variables in two ways:
- `$$$variableName` - For variables already defined in template
- `${variableName}` - For variables defined in your `preConfigContent`
Copy link
Member

Choose a reason for hiding this comment

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

as I understand there's no difference if variable is defined inside template or preconfigured content. See #175 , both deployerPrivateKey (used as [$$$deployerPrivatekey]) and providerApiKey (used for example as https://eth-sepolia.g.alchemy.com/v2/\${providerApiKey} defined inside template

For me, the key difference is:
$$$variableName - When we need to remove "" or '' around the variable or expression in resulting object.
Works for any variable types. Examples:
apiKey: "$$$etherscanOptimisticApiKey" => apiKey: etherscanOptimisticApiKey;
accounts: ["$$$deployerPrivateKey"] => accounts: [deployerPrivateKey]
Expression:
enabled: '$$$process.env.MAINNET_FORKING_ENABLED === "true"', => enabled: process.env.MAINNET_FORKING_ENABLED === "true"

${variableName} - when we need to use the variable inside the string. Works for strings and for js stringifyable primitives like number or boolean

},
mainnet: {
url: `https://eth-mainnet.g.alchemy.com/v2/$$$providerApiKey`,
accounts: ["$$$deployerPrivateKey"],
Copy link
Member

Choose a reason for hiding this comment

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

we need to define deployerPrivateKey somewhere in example

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.

2 participants