Skip to content

Commit c788a42

Browse files
Merge pull request #558 from Anastasia-Labs/docs/update-content
docs update content
2 parents c7460c8 + 0b3b421 commit c788a42

14 files changed

Lines changed: 972 additions & 599 deletions

CONTRIBUTING.md

Lines changed: 70 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
# Contributing to Lucid Evolution
22

3-
Amazing to hear that you're interested in contributing to Lucid Evolution!
3+
👋 Welcome to the Lucid Evolution community!
44

5-
This document outlines how you can contribute to make Lucid Evolution better than it was before. Lucid Evolution is a monorepo, make sure you're working in the correct package when making changes. Maintain backwards compatibility unless explicitly discussed and agreed upon for a major version change and when possible be mindful of performance implications, especially for core functionality
5+
This guide will help you get started with contributing to Lucid Evolution. Our goal is to make the contribution process transparent and collaborative for everyone involved.
6+
7+
Lucid Evolution is structured as a monorepo with multiple packages. Each package serves a specific purpose, so please make sure you're working in the appropriate package when making changes. While we encourage innovation, we also value stability for our users, so please:
8+
9+
- Maintain backward compatibility unless a breaking change is explicitly agreed upon for a major version release
10+
- Consider performance implications when modifying core functionality
11+
- Follow the existing coding patterns and practices
12+
13+
Let's build amazing Cardano tools together!
614

715
## Ways to Contribute
816

@@ -14,59 +22,92 @@ This document outlines how you can contribute to make Lucid Evolution better tha
1422

1523
## Development Process
1624

17-
We use GitHub to host code, track issues and feature requests, and accept pull requests
25+
We use GitHub to host code, track issues and feature requests, and accept pull requests.
1826

1927
### Pull Requests
2028

2129
Pull requests are the best way to propose changes. Write clear, concise commit messages. Following the conventional commits specification is a valuable best practice, we actively welcome your pull requests:
2230

23-
1. Fork the repo and create your branch. Naming your branches with a prefix indicating the type of change (e.g., feature/, bugfix/, docs/) followed by a brief description greatly helps the maintainers
31+
1. Fork the repo and create your branch. Naming your branches with a prefix indicating the type of change (e.g., `feature/`, `bugfix/`, `docs/`) followed by a brief description greatly helps the maintainers
2432
2. If you've added code that should be tested, add tests
2533
3. If you've changed APIs, update the documentation
2634
4. Write and update tests for your changes. Run `pnpm test` to ensure all tests pass
2735
5. Make sure your code lints
2836
6. Ensure your changes pass all CI checks before requesting a review
29-
7. Issue your suggestion
37+
7. Issue your pull request
3038

3139
### Coding Style
3240

33-
- Follow the existing coding style in the project
3441
- Adhere to the ESLint configuration provided in the repository
35-
- Run `pnpm run lint` / `pnpm list` to ensure your code follows our style guidelines
36-
- Run `pnpm format` (with Prettier) / `pnpm format-check` to format your code
42+
- Run `pnpm lint` to ensure your code follows our style guidelines
43+
- Run `pnpm format` (with Prettier) or `pnpm format-check` to format your code
44+
45+
## Local Testing
3746

38-
### Local Testing
47+
Lucid Evolution uses Vitest for testing. There are two main types of tests:
3948

40-
Before running tests locally, you need to ensure that specific environment variables are correctly set. These variables are needed for interacting with the necessary APIs (Kupo / Ogmios) during testing. Follow the steps below to configure your environment:
49+
1. **Unit and emulator tests** - These can run without external dependencies
50+
2. **On-chain integration tests** - These require API keys and network access
4151

42-
- Create the .env files:
52+
### Setting Up Test Environment
4353

44-
Under packages/lucid, create an .env file with the following variables:
54+
For full test coverage, including on-chain tests, you need to set up environment variables:
55+
56+
#### Step 1: Create `.env` files
57+
58+
Under `packages/lucid`, create an `.env` file with the following variables:
4559

4660
```
4761
VITE_API_URL="https://cardano-preprod.blockfrost.io/api/v0/"
48-
VITE_BLOCKFROST_KEY=""
49-
VITE_SEED=""
50-
VITE_MAESTRO_KEY=""
51-
VITE_BLOCKFROST_KEY_MAINNET=""
52-
VITE_KUPO_KEY="your_kupo_key_here"
53-
VITE_OGMIOS_KEY="your_ogmios_key_here"
62+
VITE_BLOCKFROST_KEY="your_blockfrost_preprod_key"
63+
VITE_SEED="your_test_wallet_seed_phrase"
64+
VITE_MAESTRO_KEY="your_maestro_key"
65+
VITE_BLOCKFROST_KEY_MAINNET="your_blockfrost_mainnet_key"
66+
VITE_KUPO_URL="your_kupo_endpoint_url"
67+
VITE_OGMIOS_URL="your_ogmios_endpoint_url"
5468
```
5569

56-
Under packages/provider, create an .env file with the following variables:
70+
Under `packages/provider`, create an `.env` file with the following variables:
5771

5872
```
59-
VITE_KUPO_KEY="your_kupo_key_here"
60-
VITE_OGMIOS_KEY="your_ogmios_key_here"
73+
VITE_KUPO_URL="your_kupo_endpoint_url"
74+
VITE_OGMIOS_URL="your_ogmios_endpoint_url"
6175
```
6276

63-
You will not be using API keys directly but `Authenticated HTTP Endpoint URL` (`https://dmtr_ogmios......`)
77+
#### Step 2: Obtain Required Keys
78+
79+
- **Blockfrost**: Register at [blockfrost.io](https://blockfrost.io) to get API keys for both Preprod and Mainnet
80+
- **Maestro**: Get an API key from [gomaestro.org](https://www.gomaestro.org)
81+
- **Kupo & Ogmios**: For these services, you'll need the full authenticated HTTP endpoint URLs, not just API keys. You can run these services locally or use a provider that offers them.
82+
- **Test Wallet**: Create a test wallet with funds on the Preprod network for on-chain tests
83+
84+
### Running Tests
85+
86+
```bash
87+
# Run all tests across packages
88+
pnpm test
89+
90+
# Run tests for a specific package
91+
pnpm --filter @lucid-evolution/lucid test
92+
93+
# Run a specific test file
94+
pnpm --filter @lucid-evolution/lucid test -- path/to/test/file.test.ts
95+
96+
# Run tests in watch mode
97+
pnpm --filter @lucid-evolution/lucid test -- --watch
98+
```
99+
100+
### Testing Without API Keys
101+
102+
Many unit tests and emulator-based tests will run without external API keys. The test suite is designed to skip on-chain tests if the required environment variables are not present. This allows you to:
64103

65-
If you encounter any issues while running the tests, double-check that all the environment variables are correctly set and that the keys are valid. Also, ensure that your local setup mirrors the environment in which the tests are expected to run
104+
1. Develop and test core functionality without requiring external resources
105+
2. Run the CI pipeline without exposing sensitive API keys
106+
3. Focus on specific test suites during development
66107

67108
## Reporting Bugs
68109

69-
We use GitHub issues to track bugs. Report a bug by [opening a new issue](https://github.com/Anastasia-Labs/lucid-evolution/issues/new)
110+
We use GitHub issues to track bugs. Report a bug by [opening a new issue](https://github.com/Anastasia-Labs/lucid-evolution/issues/new).
70111

71112
### Bug Report Guidelines
72113

@@ -82,20 +123,20 @@ A good bug report should include:
82123

83124
## Suggesting Enhancements
84125

85-
We welcome suggestions for enhancements. Please create an issue to discuss your idea before making significant changes
126+
We welcome suggestions for enhancements. Please create an issue to discuss your idea before making significant changes.
86127

87128
## Documentation
88129

89-
Improving documentation is a great way to contribute. This includes both inline code comments and our external documentation. Update the documentation in the `docs` folder for any user-facing changes. Using changesets to document your changes help both you and the mainters to have a better overview for the idea you are contributing with
130+
Improving documentation is a great way to contribute. This includes both inline code comments and our external documentation. Update the documentation in the `docs` folder for any user-facing changes. Using changesets to document your changes helps both you and the maintainers to have a better overview of the idea you are contributing.
90131

91-
(Run `pnpm changeset` to create a new changeset this is required for CI)
132+
Run `pnpm changeset` to create a new changeset (this is required for CI).
92133

93134
## License
94135

95-
By contributing to Lucid Evolution, you agree that your contributions will be licensed under its MIT License
136+
By contributing to Lucid Evolution, you agree that your contributions will be licensed under its MIT License.
96137

97138
## Questions?
98139

99-
Don't hesitate to ask. You can open an issue or reach out to the maintainers directly. Anastasia Labs team and community actively discuss our opinions in our [discord](https://discord.gg/s89P9gpEff)
140+
Don't hesitate to ask. You can open an issue or reach out to the maintainers directly. Anastasia Labs team and community actively discuss our opinions in our [Discord](https://discord.gg/s89P9gpEff).
100141

101142
Thank you for contributing to Lucid Evolution!

0 commit comments

Comments
 (0)