diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 302f1c34d..84db79a54 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,96 +1,64 @@ - # TBD Code of Conduct -TBD builds infrastructure for the next wave of innovation in financial services β€” which we believe will be decentralized, permissionless, and non-custodial. This means opening the global economy to everyone. We extend the same principles of inclusion to our developer ecosystem. We are excited to build with you. So we will ensure our community is truly open, transparent and inclusive. Because of the global nature of our project, diversity and inclusivity is paramount to our success. We not only welcome diverse perspectives, we **need** them! - -The code of conduct below reflects the expectations for ourselves and for our community. +TBD builds infrastructure for the next wave of innovation in financial services β€” which we believe will be decentralized, permissionless, and non-custodial. This means opening the global economy to everyone. We extend the same principles of inclusion to our developer ecosystem. We are excited to build with you, so we will ensure our community is truly open, transparent, and inclusive. Because of the global nature of our project, diversity and inclusivity are paramount to our success. We not only welcome diverse perspectives; we **need** them! +The code of conduct below reflects the expectations for ourselves and our community. ## Our Pledge -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, physical appearance, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, caste, color, religion, or sexual -identity and orientation. +As members, contributors, and leaders, we pledge to make participation in our community a harassment-free experience for everyone, regardless of age, physical appearance, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. ## Our Standards -Examples of behavior that contributes to a positive environment for our -community include: +Examples of behavior that contribute to a positive environment for our community include: * Demonstrating empathy and kindness toward other people * Being respectful and welcoming of differing opinions, viewpoints, and experiences * Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the overall - community +* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or advances of - any kind +* The use of sexualized language or imagery, and sexual attention or advances of any kind * Trolling, insulting or derogatory comments, and personal or political attacks * Public or private harassment -* Publishing others' private information, such as a physical or email address, - without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting +* Publishing others' private information, such as a physical or email address, without their explicit permission +* Other conduct that could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities -The TBD Open Source Governance Committee (GC) is responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. +The TBD Open Source Governance Committee (GC) is responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. -The GC has the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. +The GC has the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned with this Code of Conduct and will communicate reasons for moderation decisions when appropriate. ## Scope -This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event, or any space where the project is listed as part of your profile. +This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. Examples of representing a project or community include using an official project email address, posting via an official social media account, or acting as an appointed representative at an online or offline event, or any space where the project is listed as part of your profile. ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the TBD Open Source Governance Committee (GC) at -`tbd-open-source-governance@@squareup.com`. -All complaints will be reviewed and investigated promptly and fairly. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the TBD Open Source Governance Committee (GC) at `tbd-open-source-governance@squareup.com`. All complaints will be reviewed and investigated promptly and fairly. -The GC is obligated to respect the privacy and security of the -reporter of any incident. +The GC is obligated to respect the privacy and security of the reporter of any incident. ## Enforcement Guidelines -The GC will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: +The GC will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: ### 1. Correction -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. -**Consequence**: A private, written warning from the GC, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. +**Consequence**: A private, written warning from the GC, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. ### 2. Warning -**Community Impact**: A violation through a single incident or series of -actions. +**Community Impact**: A violation through a single incident or series of actions. -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media and forums. +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media and forums. Although this list cannot be exhaustive, we explicitly honor diversity in age, culture, ethnicity, gender identity or expression, language, national origin, political beliefs, profession, race, religion, sexual orientation, socioeconomic status, and technical ability. We will not tolerate discrimination based on any of the protected characteristics above, including participants with disabilities. @@ -98,30 +66,20 @@ Violating these terms may lead to a temporary or permanent ban. ### 3. Temporary Ban -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. +**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. ### 4. Permanent Ban -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. +**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. -**Consequence**: A permanent ban from any sort of public interaction within the -community. +**Consequence**: A permanent ban from any sort of public interaction within the community. ## Attribution -This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), -version 2.1, available on [the contributor Convenant website](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html). +This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1, available on [the Contributor Covenant website](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html). -Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). -For answers to common questions about this code of conduct, see the [FAQs on the Contributor Covenant website](https://www.contributor-covenant.org/faq). Translations are available on the [translations page](https://www.contributor-covenant.org/translations). +For answers to common questions about this code of conduct, see the [FAQs on the Contributor Covenant website](https://www.contributor-covenant.org/faq). Translations are available on the [translations page](https://www.contributor-covenant.org/translations). \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 86082492a..2f313ef24 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,14 +1,14 @@ # Contribution Guide -This repo acts as a reference implementation of the Decentralized Web Node (DWN) specification. Before getting started, we highly recommend that you read the [DWN spec doc](https://identity.foundation/decentralized-web-node/spec/). The specification is still in a draft / incomplete state. Anything related to the general architecture, features, or bugs with respect to DWN in general are best addressed via issues and pull requests within the [spec repo](https://github.com/decentralized-identity/decentralized-web-node). During early development, we'll be working on the specification and implementation in parallel. If you're confused about where to post your question, bug, or feature request, don't sweat! Go ahead and post it in either repo and we'll go ahead and move it if need be. +This repo acts as a reference implementation of the Decentralized Web Node (DWN) specification. Before getting started, we highly recommend that you read the [DWN spec doc](https://identity.foundation/decentralized-web-node/spec/). The specification is still in a draft/incomplete state. Anything related to the general architecture, features, or bugs with respect to DWN should be addressed via issues and pull requests within the [spec repo](https://github.com/decentralized-identity/decentralized-web-node). During early development, we'll be working on the specification and implementation in parallel. If you're confused about where to post your question, bug, or feature request, don't sweat! Go ahead and post it in either repo, and we'll move it if necessary. The general process we hope to follow is: - Submit a proposal as a PR in the DWN spec repo. -- Iterate on the PR until it gets pulled into `main`. -- Implement said proposal in this repo and submit a PR -- Iterate on PR until its ready for `main` +- Iterate on the PR until it gets merged into `main`. +- Implement the proposal in this repo and submit a PR. +- Iterate on the PR until it's ready for `main`. -Given that we're still in early stages of development, this contribution guide will certainly change as we near a beta release. Until then, things will be a bit ragtag but there's still plenty of opportunities for contribution. +Given that we're still in the early stages of development, this contribution guide will certainly change as we near a beta release. Until then, things will be a bit ragtag, but there are still plenty of opportunities for contribution. As we work our way towards a beta release, we'll be creating more focused issues with the following labels: - `bug` @@ -16,43 +16,41 @@ As we work our way towards a beta release, we'll be creating more focused issues - `good first issue` - `help wanted` -These issues are excellent candidates for contribution and we'd be thrilled to get all the help we can get! You can take a look at all of the Issues that match the labels above [on the Issues tab](https://github.com/TBD54566975/dwn-sdk-js/issues?q=is%3Aopen+label%3A%22help+wanted%22%2C%22good+first+issue%22%2C%22documentation%22%2C%22bug%22+) +These issues are excellent candidates for contribution, and we'd be thrilled to get all the help we can get! You can take a look at all the issues that match the labels above [on the Issues tab](https://github.com/TBD54566975/dwn-sdk-js/issues?q=is%3Aopen+label%3A%22help+wanted%22%2C%22good+first+issue%22%2C%22documentation%22%2C%22bug%22+). We suggest the following process when picking up one of these issues: -- Check to see if anyone is already working on the issue by looking to see if the issue has a `WIP` tag. -- Fork the repo and create a branch named the issue number you're taking on -- Push that branch and create a draft PR -- paste a link to the draft PR in the issue you're tackling -- We'll add the `WIP` tag for you -- work away. Feel free to ask any/all questions that crop up along the way -- Switch the draft PR to "Ready for review" +- Check to see if anyone is already working on the issue by looking for a `WIP` tag. +- Fork the repo and create a branch named after the issue number you're taking on. +- Push that branch and create a draft PR. +- Paste a link to the draft PR in the issue you're tackling. +- We'll add the `WIP` tag for you. +- Work away. Feel free to ask any questions that arise along the way. +- Switch the draft PR to "Ready for review." ## πŸŽ‰ Hacktoberfest 2024 πŸŽ‰ -`dwn-sdk-js` is a participating in Hacktoberfest 2024! We’re so excited for your contributions, and have created a wide variety of issues so that anyone can contribute. Whether you're a seasoned developer or a first-time open source contributor, there's something for everyone. +`dwn-sdk-js` is participating in Hacktoberfest 2024! We’re excited for your contributions and have created a wide variety of issues so that anyone can contribute. Whether you're a seasoned developer or a first-time open-source contributor, there's something for everyone. ### Here's how you can get started: 1. Read the [code of conduct](https://github.com/TBD54566975/dwn-sdk-js/blob/main/CODE_OF_CONDUCT.md). 2. Choose a task from this project's Hacktoberfest issues in our [Project Hub](https://github.com/TBD54566975/dwn-sdk-js/issues/806). Each issue has the 🏷️ `hacktoberfest` label. -5. Comment ".take" on the corresponding issue to get assigned the task. -6. Fork the repository and create a new branch for your work. -7. Make your changes and submit a pull request. -8. Wait for review and address any feedback. +3. Comment ".take" on the corresponding issue to get assigned the task. +4. Fork the repository and create a new branch for your work. +5. Make your changes and submit a pull request. +6. Wait for review and address any feedback. ### πŸ† Leaderboard & Prizes -Be among the top 10 with the most points to snag custom swag just for you from our TBD shop! To earn your place in the leaderboard, we have created a points system that is explained below. As you complete tasks, you will automatically be granted a certain # of points. +Be among the top 10 with the most points to snag custom swag just for you from our TBD shop! To earn your place on the leaderboard, we have created a points system that is explained below. As you complete tasks, you will automatically be granted a certain number of points. #### Point System | Weight | Points Awarded | Description | |---------|-------------|-------------| | 🐭 **Small** | 5 points | For smaller tasks that take limited time to complete and/or don't require any product knowledge. | | 🐰 **Medium** | 10 points | For average tasks that take additional time to complete and/or require some product knowledge. | -| πŸ‚ **Large** | 15 points | For heavy tasks that takes lots of time to complete and/or possibly require deep product knowledge. | +| πŸ‚ **Large** | 15 points | For heavy tasks that take a lot of time to complete and/or possibly require deep product knowledge. | #### Prizes -Top 10 contributors with the most points will be awarded TBD x Hacktoberfest 2024 swag. The Top 3 contributors will have special swag customized with your GitHub handle in a very limited design. (more info in our Discord) - - +The top 10 contributors with the most points will be awarded TBD x Hacktoberfest 2024 swag. The top 3 contributors will receive special swag customized with your GitHub handle in a very limited design. (More info in our Discord.) ### πŸ‘©β€ Need help? Need help or have questions? Feel free to reach out by connecting with us in our [Discord community](https://discord.gg/tbd) to get direct help from our team in the `#hacktoberfest` project channel. @@ -66,10 +64,10 @@ Happy contributing! | Requirement | Tested Version | Installation Instructions | | ----------- | -------------- | ------------------------- | -| `Node.js` | `v18.17.0` | There are many ways to install `Node.js`. Feel free to choose whichever approach you feel the most comfortable with. If you don't have a preferred installation method, you can visit the official [downloads](https://nodejs.org/en/download/) page and choose the the appropriate installer respective to your operating system | +| `Node.js` | `v18.17.0` | There are many ways to install `Node.js`. Feel free to choose whichever approach you feel most comfortable with. If you don't have a preferred installation method, you can visit the official [downloads](https://nodejs.org/en/download/) page and choose the appropriate installer for your operating system. | ### Running tests -* Running the `npm run test:node` command from the root of the project will run all tests using node. +* Running the `npm run test:node` command from the root of the project will run all tests using Node. * This is run via CI whenever a pull request is opened, or a commit is pushed to a branch that has an open PR. * Running the `npm run test:browser` command from the root of the project will run the tests in browser environments. * Please make sure there are no failing tests before switching your PR to ready for review! This validation is automated when you open a new pull request. @@ -78,11 +76,11 @@ Happy contributing! Here is a guide on how to develop and test a custom implementation of the backend storage for DWN: 1. Implement one or a combination of the `DataStore`, `MessageStore`, and `EventLog` interfaces. -1. Import the `TestSuite` class for a new mocha test. -1. Invoke `TestSuite.runStoreDependentTests(...)` in `mocha`, this will run all store dependent tests. -1. Make sure that all store dependent tests pass. +2. Import the `TestSuite` class for a new Mocha test. +3. Invoke `TestSuite.runStoreDependentTests(...)` in Mocha; this will run all store-dependent tests. +4. Make sure that all store-dependent tests pass. -> NOTE: currently the test suite is only exported in the ESM module. +> NOTE: Currently, the test suite is only exported in the ESM module. Example code: ```ts @@ -100,30 +98,30 @@ describe('Custom data store implementation', () => { ### Running benchmarks -Benchmarks should be run directly using `node` (e.g. `node benchmarks/store/index/search-index.js`). +Benchmarks should be run directly using `node` (e.g., `node benchmarks/store/index/search-index.js`). Note that some benchmarks require that `npm run build` has been run beforehand. -Any dependencies needed by benchmarks should be in `devDependencies` (e.g. `index-store` for `node benchmarks/store/index/index-store.js`). +Any dependencies needed by benchmarks should be in `devDependencies` (e.g., `index-store` for `node benchmarks/store/index/index-store.js`). ### Code Style -Our preferred code style has been codified into `eslint` rules. Feel free to take a look [at the relevant `.eslintrc` file](https://github.com/TBD54566975/dwn-sdk-js/blob/main/.eslintrc.cjs). Running `npm run lint` will auto-format as much as `eslint` can. Everything it wasn't able to will be printed out as errors or warnings. Please make sure to run `npm run lint` before switching your PR to ready for review! We hope to have this automated via a github action very soon. +Our preferred code style has been codified into `eslint` rules. Feel free to take a look [at the relevant `.eslintrc` file](https://github.com/TBD54566975/dwn-sdk-js/blob/main/.eslintrc.cjs). Running `npm run lint` will auto-format as much as `eslint` can. Everything it wasn't able to format will be printed out as errors or warnings. Please make sure to run `npm run lint` before switching your PR to ready for review! We hope to have this automated via a GitHub action very soon. ### Code Guidelines -1. A `TODO` in comment must always link to a GitHub issue. +1. A `TODO` comment must always link to a GitHub issue. ### Available NPM Commands -| command | description | -| --------------------------------- | ------------------------------------------------------------------------------------------------------------------ | -| `npm run test:node` | runs tests and type checking | -| `npm run test:node-grep` | runs specific tests matching a pattern. Requires the -g option. For example: `npm run test:node-grep -g "RecordsReadHandler.handle"` | -| `npm run test:browser` | runs tests against browser bundles in headless browser | -| `npm run test:browser-debug` | runs tests against browser bundles in debug-ready Chrome | -| `npm run build` | transpiles `ts` -> `js` as `esm` and `cjs`, generates `esm` and `umd` bundles, and generates all type declarations | -| `npm run build:esm` | transpiles ts -> js as `esm` | -| `npm run build:cjs` | transpiles ts -> js as `cjs` | -| `npm run build:bundles` | generates `esm` and `umd` bundles | -| `npm run build:declarations` | generates all type declarations | -| `npm run clean` | deletes `dist` dir | -| `npm run lint` | runs linter and displays all problems | -| `npm run lint:fix` | runs linter and attempts to auto-fix all problems | +| Command | Description | +|----------------------------------|--------------------------------------------------------------------------------------------------------------------| +| `npm run test:node` | Runs tests and type checking | +| `npm run test:node-grep` | Runs specific tests matching a pattern. Requires the `-g` option. For example: `npm run test:node-grep -g "RecordsReadHandler.handle"` | +| `npm run test:browser` | Runs tests against browser bundles in headless browser | +| `npm run test:browser-debug` | Runs tests against browser bundles in debug-ready Chrome | +| `npm run build` | Transpiles `ts` -> `js` as `esm` and `cjs`, generates `esm` and `umd` bundles, and generates all type declarations | +| `npm run build:esm` | Transpiles `ts` -> `js` as `esm` | +| `npm run build:cjs` | Transpiles `ts` -> `js` as `cjs` | +| `npm run build:bundles` | Generates `esm` and `umd` bundles | +| `npm run build:declarations` | Generates all type declarations | +| `npm run clean` | Deletes the `dist` directory | +| `npm run lint` | Runs linter and displays all problems | +| `npm run lint:fix` | Runs linter and attempts to auto-fix all problems | \ No newline at end of file