From 0881fe1be31fdf6763b32d8b9ab2ce1f4b0fa83b Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 8 Feb 2024 08:38:35 -0500 Subject: [PATCH 1/3] fix abi const (#6797) --- .../test/fixtures/{Abi.json => AbiItem.ts} | 19 ++++++++++++++++++- .../test/unit/contract.test.ts | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) rename packages/web3-eth-contract/test/fixtures/{Abi.json => AbiItem.ts} (72%) diff --git a/packages/web3-eth-contract/test/fixtures/Abi.json b/packages/web3-eth-contract/test/fixtures/AbiItem.ts similarity index 72% rename from packages/web3-eth-contract/test/fixtures/Abi.json rename to packages/web3-eth-contract/test/fixtures/AbiItem.ts index 3538463596d..bcc94ce4b02 100644 --- a/packages/web3-eth-contract/test/fixtures/Abi.json +++ b/packages/web3-eth-contract/test/fixtures/AbiItem.ts @@ -1,4 +1,21 @@ -{ +/* +This file is part of web3.js. + +web3.js is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +web3.js is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with web3.js. If not, see . +*/ + +export const Abi = { anonymous: false, constant: true, inputs: [ diff --git a/packages/web3-eth-contract/test/unit/contract.test.ts b/packages/web3-eth-contract/test/unit/contract.test.ts index b2917c86d9c..b55a19c1457 100644 --- a/packages/web3-eth-contract/test/unit/contract.test.ts +++ b/packages/web3-eth-contract/test/unit/contract.test.ts @@ -21,7 +21,7 @@ import { Web3ContractError } from 'web3-errors'; import { Web3Context , Web3ConfigEvent } from 'web3-core'; import { Web3ValidatorError } from 'web3-validator'; import { AbiItem } from 'web3-utils'; -import {Abi} from '../fixtures/Abi.json' +import {Abi} from '../fixtures/AbiItem' import { Contract } from '../../src'; import { sampleStorageContractABI } from '../fixtures/storage'; import { GreeterAbi, GreeterBytecode } from '../shared_fixtures/build/Greeter'; From 0a8f9e42f1ad8c5d8bf28ce487c90b425a2f1ab0 Mon Sep 17 00:00:00 2001 From: Santiago Trujillo Zuluaga Date: Thu, 8 Feb 2024 14:37:41 +0000 Subject: [PATCH 2/3] Added contributing guideliness & code of conduct (#6787) * renamed and moved contributing.md + add contributing to docs section * added prerequisites * added code of conduct * typo * changed statement to install dependencies --- .github/CODE_OF_CONDUCT.md | 76 +++++++++++++++++++++ CONTRIBUTIONS.md => .github/CONTRIBUTING.md | 48 +++++++++++++ 2 files changed, 124 insertions(+) create mode 100644 .github/CODE_OF_CONDUCT.md rename CONTRIBUTIONS.md => .github/CONTRIBUTING.md (59%) diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..9ebc3e40d6c --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behaviour that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behaviour by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behaviour and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behaviour. + +Project maintainers have 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, or to ban temporarily or +permanently any contributor for other behaviours that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. 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. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at info@chainsafe.io. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq \ No newline at end of file diff --git a/CONTRIBUTIONS.md b/.github/CONTRIBUTING.md similarity index 59% rename from CONTRIBUTIONS.md rename to .github/CONTRIBUTING.md index 243e89e27f4..f9790002769 100644 --- a/CONTRIBUTIONS.md +++ b/.github/CONTRIBUTING.md @@ -1,3 +1,50 @@ +# Contributing + +Thank you for contributing to web3.js! We appreciate your interest and welcome any contributions that can help improve our documentation, functionality, addressing bugs, or any other aspects that can contribute to the overall improvement of our project. Before you start contributing, please take a moment to review the guidelines below. + +## Help and Support + +If you face any issues while contributing, or you want any type of support, we encourage you to join our [Discord Community](https://discord.com/invite/3shNX8cqGR) and ask any question in the `#web3js-general` channel, and/or submit a [New Issue](https://github.com/web3/web3.js/issues/new). + +## Prerequisites + +- [NodeJS](https://nodejs.org/) (LTS) +- [Yarn](https://yarnpkg.com/) + +## Contributing to the docs + +1. **Fork the docs:** Start by forking our repository to your GitHub account. + +2. **Clone the repo:** Clone the forked repository to your local machine using the following command +```bash +git clone https://github.com/your-username/web3.js.git +``` +3. **Create a Branch:** Create a new branch for your changes with a descriptive name. + **NOTE: The branch name must include the issue number (if there is no issue created for your contribution, please create one)** +```bash +git checkout -b issue-name-1234 +``` +4. **Navigate to the docs folder:** `cd web3.js/docs/docs` + +5. **Install dependencies:** +```bash +yarn +``` +6. **Make your changes:**... + +7. Check changes in local environment: Run the command `yarn start` and you'll see a local environment in `localhost:3000` with the docs + +8. **Commit your changes:** `git add .` and `git commit -m 'descriptive msg'` + +9. **Push your changes:** +```bash +git push origin branch-name +``` + +10. **Open a Pull request(PR):** Provide a detailed description of your changes, the problem you are solving, and any additional context(you can use the PR template). + +11. **Wait for review**: Before merging any branch into the main branch, it must be approved by 2 devs, after succesfully approved, you can `Squash and merge` your branch, Please be responsive to any feedback on your pull request and make necessary changes based on the review. + ## Guidelines for Pull Requests and Releases (Web3 4.x) This document provides some ground rules for contributors (including the maintainer(s) of @@ -49,3 +96,4 @@ Emergency releases are allowed to shorten waiting periods depending on the sever There is precedent set for this in the 1.2.6 release (see [#3351](https://github.com/ethereum/web3.js/pull/3351)), where the consensus view was to make the smallest change necessary to address the emergency while waiving the `rc` process (meaning many existing additions to master were excluded). This topic is under further org-wide discussion at [ethereum/js-organization#6](https://github.com/ethereum/js-organization/issues/6). + From 9f316124ee25920af74255a4c16eea970509fb6e Mon Sep 17 00:00:00 2001 From: Oleksii Kosynskyi Date: Thu, 8 Feb 2024 11:23:41 -0500 Subject: [PATCH 3/3] add deploy script (#6792) --- .github/workflows/deploy-docs.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/deploy-docs.yaml diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml new file mode 100644 index 00000000000..90fc811671f --- /dev/null +++ b/.github/workflows/deploy-docs.yaml @@ -0,0 +1,28 @@ +name: Docs CloudFlare Deploy +on: + push: + - "4.x" + tags-ignore: + - v4* +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + cache: yarn + node-version: '18' + - run: yarn install --frozen-lockfile + - run: yarn run build:docs + - name: Publish to Cloudflare Pages + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: 2238a825c5aca59233eab1f221f7aefb + projectName: web3-js-docs + directory: ./docs/build + gitHubToken: ${{ secrets.GITHUB_TOKEN }}