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

Documenting build drawbacks processing alephium.config.ts #278

Open
simerplaha opened this issue Aug 26, 2024 · 0 comments
Open

Documenting build drawbacks processing alephium.config.ts #278

simerplaha opened this issue Aug 26, 2024 · 0 comments

Comments

@simerplaha
Copy link
Member

simerplaha commented Aug 26, 2024

Following PRs #277 & #239, this issue documents the current drawbacks when processing alephium.config.ts.

1. Comments #277

In the following config, the comment value false is set in ralph.json instead of the intended true.

compilerOptions: {
    ignoreUnusedConstantsWarnings: true,
    // ignoreUnusedConstantsWarnings: false,
  },

2. Static values #277

All values are restricted to being static values. Functions or environment variables are not processed.

sourceDir: getDirectory('contracts'),  
compilerOptions: {
  ignoreUnusedConstantsWarnings: someFunction(),
},

3. Parsing #277

As sourceDir is typed incorrectly, without the ending single quote, the entire trailing string is caputured and set into ralph.json's contractPath field, resulting in the following error:

image

4. Error reporting #277

Although changes are made in alpehium.config.ts, input errors are reported in ralph.json.

image

5. Learning curve #239

Having two build files (alpehium.config.ts & ralph.json) increases learning curve for developers.

  • Some configurations are defined in alpehium.config.ts, that are copied into ralph.json programatically.
  • While other LSP specific configurations such as dependencyPath must be defined in ralph.json manually.

This dual configuration approach can lead to confusion, as developers must be aware of which settings belong in which file.

Additionally, implementing library support in issue #44 would also add another configuration in ralph.json:

"dependencies": {
    "web3": "0.38.0",
    "ralph-test": "0.0.0",
    "data-structures": "0.0.0"
  }

6. Introduces Mutation #239

Processing alephium.config.ts introduces mutating the ralph.json file which is client owned. Initial goal was to not introduce code that mutate a file which is owned by the client or any file, as mentioned in this issue "DO NOT introduce code on the server that deletes or overwrites files in the developer's workspace.".

@simerplaha simerplaha changed the title Documenting drawbacks of processing alephium.conf.ts Documenting drawbacks of processing alephium.config.ts Aug 28, 2024
@simerplaha simerplaha changed the title Documenting drawbacks of processing alephium.config.ts Documenting build drawbacks processing alephium.config.ts Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant