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

Prioritise default configurations from alephium.config.ts #295

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

simerplaha
Copy link
Member

@simerplaha simerplaha commented Sep 19, 2024

Towards resolving Default Settings in #291.

This PR ensures that when a build configuration is missing from alephium.config.ts, its default value mentioned in the documentation is used:

  • sourceDir will be defaulted to contracts.
  • artifactDir is always set to None because currently we do not make any use of it. Issue Implement deployment #84 will decide its fate.
  • All compilerOptions are defaulted to false. Although the documentation does not mention this, I'm assuming this is what's expected.

The function that merged compilerOptions from ralph.json and alephium.config.ts is removed. If the file alephium.config.ts is available, the defaults compilerOptions (all false) from alephium.config.ts, defined or not, are used and the ones in ralph.json are overwritten.

This ensures that alephium.config.ts and its defaults are always prioritised over any configuration defined in ralph.json.

A new project containing a *.ral file will still start compilation. But when an empty alephium.config.ts is created, that *.ral file will have to be moved to the contracts directory (alephium.config.ts's default) for compilation.

@simerplaha simerplaha requested a review from tdroxler September 19, 2024 02:33
Copy link
Member

@tdroxler tdroxler left a comment

Choose a reason for hiding this comment

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

LGTM, I tested it with the alephium template, works fine

@simerplaha simerplaha merged commit 14ec108 into master Sep 19, 2024
3 checks passed
@simerplaha simerplaha deleted the handle_ts_defaults branch September 19, 2024 05:41
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