Skip to content

Commit

Permalink
adds issue templates, table of contents, contributing guide (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotBraem authored Aug 14, 2024
1 parent 898beb1 commit 9195c1b
Show file tree
Hide file tree
Showing 6 changed files with 277 additions and 23 deletions.
File renamed without changes.
131 changes: 131 additions & 0 deletions .github/ISSUE_TEMPLATE/BOUNTY.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: "Simple Bounty"
description: "Use this template to create a HEROES Simple Bounty via Github bot"
title: "Bounty: "
labels: ["bounty"]
assignees: heroes-bot-test
body:
- type: markdown
attributes:
value: |
Hi! Let's set up your bounty! Please don't change the template - @heroes-bot-test won't be able to help you.
- type: dropdown
id: type
attributes:
label: What talent are you looking for?
options:
- Marketing
- Development
- Design
- Other
- Content
- Research
- Audit

- type: textarea
id: description
attributes:
label: What you need to be done?

- type: dropdown
id: tags
attributes:
label: Tags
description: Add tags that match the topic of the work
multiple: true
options:
- API
- Blockchain
- Community
- CSS
- DAO
- dApp
- DeFi
- Design
- Documentation
- HTML
- Javascript
- NFT
- React
- Rust
- Smart contract
- Typescript
- UI/UX
- web3
- Translation
- Illustration
- Branding
- Copywriting
- Blogging
- Editing
- Video Creation
- Social Media
- Graphic Design
- Transcription
- Product Design
- Artificial Intelligence
- Quality Assurance
- Risk Assessment
- Security Audit
- Bug Bounty
- Code Review
- Blockchain Security
- Smart Contract Testing
- Penetration Testing
- Vulnerability Assessment
- BOS
- News
- Hackathon
- NEARCON2023
- NEARWEEK

- type: input
id: deadline
attributes:
label: Deadline
description: "Set a deadline for your bounty. Please enter the date in format: DD.MM.YYYY"
placeholder: "19.05.2027"

- type: dropdown
id: currencyType
attributes:
label: Currency
description: What is the currency you want to pay?
options:
- USDC.e
- USDT.e
- DAI
- wNEAR
- USDt
- XP
- marmaj
- NEKO
- JUMP
- USDC
- NEARVIDIA
default: 0
validations:
required: true

- type: input
id: currencyAmount
attributes:
label: Amount
description: How much it will be cost?

- type: markdown
attributes:
value: "## Advanced settings"

- type: checkboxes
id: kyc
attributes:
label: KYC
description: "Use HEROES' KYC Verification, only applicants who passed HEROES' KYC can apply and work on this bounty!"
options:
- label: Use KYC Verification

- type: markdown
attributes:
value: |
### This cannot be changed once the bounty is live!
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: ["bug"]
assignees: []
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: How can we reproduce the bug?
description: If you can make the bug happen again, please share the steps involved. If possible please also include a screenshot or a screen recording to help us better understand and resolve the issue.
validations:
required: false
- type: dropdown
id: browsers
attributes:
label: What browsers are you seeing the problem on?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Feature request
description: File a feature request
title: "[Feature]: "
labels: ["enhancement"]
assignees: []
body:
- type: markdown
attributes:
value: |
Have an idea for a feature or change?
- type: textarea
id: description
attributes:
label: What's the feature?
description: Describe the feature, who it would help, and link to any examples from other apps.
validations:
required: true
29 changes: 29 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Contributing Guide

Thank you for considering contributing to this project! Here are some guidelines to help you get started.

## Getting Started

To contribute to this project, follow these steps:

1. Fork the repository on GitHub.
2. Clone your forked repository to your local machine.
3. Make your changes locally.
4. Test your changes to ensure they work as expected.
5. Commit your changes with descriptive commit messages. We like [Semantic Commit Messages](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716).
6. Push your changes to your fork on GitHub.
7. Create a pull request to the main repository.

## Code Style

Please follow the existing code style and conventions used in the project.

## Testing

This repository uses playwright tests, which can be found in [/playwright-tests](./playwright-tests/). Ensure that your changes include appropriate tests and that existing tests pass.

## Submitting Issues

If you encounter any issues or have feature requests, please submit them through GitHub issues. Include as much detail as possible to help us understand and address the problem efficiently.

Thank you for your interest in contributing to this project! Your contributions are greatly appreciated.
89 changes: 66 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,29 @@

`near-social-viewer` is a [web component (custom element)](https://developer.mozilla.org/en-US/docs/Web/API/Web_components) that implements the [near-social-vm](https://github.com/NearSocial/VM) for rendering code stored on-chain in the [SocialDB](https://github.com/NearSocial/social-db) smart contract (social.near). It is the simplest way to create your own [near social viewer](https://github.com/NearSocial/viewer) and it is the easiest method for embedding [Widgets](https://thewiki.near.page/near.social_widgets) into any web application.

<details>
<summary>Table of Contents</summary>

- [Usage](#usage)
- [Attributes](#attributes)
- [Configuration Options](#configuration-options)
- [Local Widget Development](#local-widget-development)
- [Proxy RPC](#proxy-rpc)
- [Redirect Map](#redirect-map)
- [Hot Reload](#hot-reload)
- [Setup & Local Development](#setup--local-development)
- [Installing Dependencies](#installing-dependencies)
- [Running the App](#running-the-app)
- [Building for Production](#building-for-production)
- [Running Tests](#running-tests)
- [Adding VM Custom Elements](#adding-vm-custom-elements)
- [Configuring Ethers](#configuring-ethers)
- [Landing Page for SEO Friendly URLs](#landing-page-for-seo-friendly-urls)
- [Publishing to NEARFS](#publishing-to-nearfs)
- [Contributing](#contributing)

</details>

## Usage

<details open>
Expand Down Expand Up @@ -61,12 +84,12 @@ Once included, you can use the web component in your HTML:

The web component supports several attributes:

* `src`: the src of the widget to render (e.g. `devs.near/widget/default`)
* `code`: raw, valid, stringified widget code to render (e.g. `"return <p>hello world</p>"`)
* `initialprops`: initial properties to be passed to the rendered widget
* `rpc`: rpc url to use for requests within the VM
* `network`: network to connect to for rpc requests & wallet connection
* `config`: options to modify the underlying VM or usage with devtools, see available [configurations](#configuration-options)
- `src`: the src of the widget to render (e.g. `devs.near/widget/default`)
- `code`: raw, valid, stringified widget code to render (e.g. `"return <p>hello world</p>"`)
- `initialprops`: initial properties to be passed to the rendered widget
- `rpc`: rpc url to use for requests within the VM
- `network`: network to connect to for rpc requests & wallet connection
- `config`: options to modify the underlying VM or usage with devtools, see available [configurations](#configuration-options)

## Configuration Options

Expand All @@ -90,7 +113,6 @@ To support specific features of the VM or an accompanying development server, pr
}
```


## Local Widget Development

There are several strategies for accessing local widget code during development.
Expand Down Expand Up @@ -123,33 +145,38 @@ The above strategies require changes to be reflected either on page reload, or f

This feature works best when accompanied with [bos-workspace](https://github.com/nearbuilders/bos-workspace), which will automatically inject a config to the attribute if you provide the path to your web component's dist, or a link to it stored on [NEARFS](https://github.com/vgrichina/nearfs). See more in [Customizing the Gateway](https://github.com/NEARBuilders/bos-workspace?tab=readme-ov-file#customizing-the-gateway). It can be disabled with the `--no-hot` flag.


## Setup & Local Development

Initialize repo:
### Installing dependencies

```cmd
yarn
```bash
yarn install
```

Start the development version:
### Running the app

```cmd
yarn start
First, run the development server:

```bash
yarn run dev
```

Production build:
Open [http://localhost:3000](http://localhost:3000) in your browser to see the result.

```cmd
yarn prod
### Building for production

```bash
yarn run prod
```

Serve the production build:
### Running tests

```cmd
yarn serve:prod
```bash
npm run test
```

See the full [testing guide](./playwright-tests/README.md).

## Adding VM Custom Elements

Since [NearSocial/VM v2.1.0](https://github.com/NearSocial/VM/blob/master/CHANGELOG.md#210), a gateway can register custom elements where the key is the name of the element, and the value is a function that returns a React component. For example:
Expand Down Expand Up @@ -243,12 +270,28 @@ This script will output the CID to terminal, as well as automatically save it un

**Parameters:**

* `signer account`: NEAR account to use for signing IPFS URL update transaction, see [web4-deploy](https://github.com/vgrichina/web4-deploy?tab=readme-ov-file#deploy-fully-on-chain-to-nearfs)
* `signer key`: NEAR account private key to use for signing. Should have base58-encoded key starting with `ed25519:`. Will attempt to sign from keychain (~/.near-credentials/) if not provided.
* `network`: NEAR network to use. Defaults to mainnet.
- `signer account`: NEAR account to use for signing IPFS URL update transaction, see [web4-deploy](https://github.com/vgrichina/web4-deploy?tab=readme-ov-file#deploy-fully-on-chain-to-nearfs)
- `signer key`: NEAR account private key to use for signing. Should have base58-encoded key starting with `ed25519:`. Will attempt to sign from keychain (~/.near-credentials/) if not provided.
- `network`: NEAR network to use. Defaults to mainnet.

This is an example of the NEARFS url, and you should replace with the cid you received above:

<https://ipfs.web4.near.page/ipfs/bafybeiftqwg2qdfhjwuxt5cjvvsxflp6ghhwgz5db3i4tqipocvyzhn2bq/>

After uploading, it normally takes some minutes before the files are visible on NEARFS. When going to the expected URL based on the IPFS address we saw above, we will first see the message `Not found`.

## Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

If you're interested in contributing to this project, please read the [contribution guide](./CONTRIBUTING).

<div align="right">
<a href="https://nearbuilders.org" target="_blank">
<img
src="https://builders.mypinata.cloud/ipfs/QmWt1Nm47rypXFEamgeuadkvZendaUvAkcgJ3vtYf1rBFj"
alt="Near Builders"
height="40"
/>
</a>
</div>

0 comments on commit 9195c1b

Please sign in to comment.