-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds contributing guide, examples (#72)
* adds contributing guide and updates dist * update to yarn * unignore yarn lock * update node to 18 * removes linter
- Loading branch information
1 parent
b1cd036
commit 0b4f592
Showing
155 changed files
with
15,601 additions
and
25,885 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,13 +80,14 @@ jobs: | |
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "18" | ||
cache: yarn | ||
|
||
- name: Install bos-workspace globally | ||
run: | | ||
if [ "${{ inputs.bw-legacy }}" = "true" ]; then | ||
npm install -g [email protected] | ||
yarn global add [email protected] | ||
else | ||
npm install -g bos-workspace | ||
npm global add bos-workspace | ||
fi | ||
- name: Build and deploy the workspace | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Contributing Guide | ||
|
||
Thank you for considering contributing to bos-workspace! Here are some guidelines to help you get started. | ||
|
||
## Getting Started | ||
|
||
To contribute to bos-workspace, follow these steps: | ||
|
||
1. Fork the repository on GitHub. | ||
2. Clone your forked repository to your local machine. | ||
3. Make your changes locally, see the [examples](./examples/) for how to do this. | ||
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 jest unit tests, which can be found in [/tests](./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 bos-workspace! Your contributions are greatly appreciated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Examples | ||
|
||
This folder contains example apps demonstrating the various functionalities and use cases of the bos-workspace CLI. They serve as a reference for users to understand how to interact with the tool and leverage its features, as well as an environemnt for testing changes during development of this tool. | ||
|
||
## Contents | ||
|
||
- `/single`: Demonstrates basic usage of a single App. It is a reproduction of the [Guest Book](https://docs.near.org/tutorials/examples/guest-book) and is configured with aliases in both mainnet and testnet. | ||
- `/multi`: Demonstrates basic usage of a Workspace with multiple apps. The `bos.workspace.json` makes reference to two simple Apps. | ||
|
||
## Usage | ||
|
||
To use these examples while developing the CLI locally, follow the below steps: | ||
|
||
1. From the root directory, ensure that you have installed the necessary dependencies, `yarn` | ||
2. Run the `dev` script to watch for changes, `yarn dev` | ||
3. Run one of the examples, referencing the local cli, e.g. `../bin/bw.js dev` or `../bin/bw.js ws dev` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"account": "goodbyenothing.near" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"goodbyenothing.near": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
return <p>goodbye nothing</p>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"account": "helloworld.near" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"helloworld.near": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
return <p>hello world</p>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
apps: ["./app1", "./app2", "./apps/*"] | ||
} | ||
"apps": ["./apps/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"contract": "hello.near-examples.near" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"contract": "hello.near-examples.testnet" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
{ | ||
accounts: { | ||
deploy: "deploy.near", | ||
signer: "signer.near", | ||
dev: "dev.near" | ||
}, | ||
format: true, | ||
overrides: { | ||
testnet: { | ||
account: "testing.testnet", | ||
format: false, | ||
aliasesSrc: ["src/aliases.testnet.json"] | ||
"account": "quickstart.near", | ||
"aliases": ["./aliases.mainnet.json"], | ||
"overrides": { | ||
"testnet": { | ||
"account": "quickstart.testnet", | ||
"aliases": ["./aliases.testnet.json"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"quickstart.near": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
const CONTRACT = "${alias_contract}"; // this will get replaced by bos-workspace according to -n {network_env} | ||
const storedGreeting = Near.view(CONTRACT, "get_greeting") ?? "hello world"; | ||
|
||
if (!storedGreeting || context.loading) { | ||
return "Loading..."; | ||
} | ||
|
||
const [greeting, setGreeting] = useState(storedGreeting); | ||
const [showSpinner, setShowSpinner] = useState(false); | ||
const loggedIn = !!context.accountId; | ||
|
||
const onInputChange = ({ target }) => { | ||
setGreeting(target.value); | ||
}; | ||
|
||
const onBtnClick = () => { | ||
setShowSpinner(true); | ||
Near.call(CONTRACT, "set_greeting", { greeting }); | ||
setShowSpinner(false); | ||
}; | ||
|
||
const Main = styled.div` | ||
font-family: -apple-system, BlinkMacSystemFont, Segoe UI | ||
`; | ||
|
||
// Render | ||
return ( | ||
<Main> | ||
<div className="text-center"> | ||
<h3 className="font-weight-bold"> Hello Near </h3> | ||
<p className="small font-weight-light"> | ||
A greeting stored in | ||
<span className="text-danger">{CONTRACT}</span> | ||
</p> | ||
</div> | ||
<div className="container py-4 px-5 text-dark bg-light rounded"> | ||
<h2 className="text-center"> | ||
The contract says: | ||
<span className="text-primary"> {greeting} </span> | ||
</h2> | ||
|
||
<div class="p-4"> | ||
<div className="input-group" hidden={!loggedIn}> | ||
<input placeholder="Store a new greeting" onChange={onInputChange} /> | ||
<button className="btn btn-primary" onClick={onBtnClick}> | ||
<span hidden={showSpinner}>Save</span> | ||
<i | ||
className="spinner-border spinner-border-sm" | ||
hidden={!showSpinner} | ||
></i> | ||
</button> | ||
</div> | ||
|
||
<p className="text-center py-2" hidden={loggedIn}> | ||
Login to change the greeting | ||
</p> | ||
</div> | ||
</div> | ||
</Main> | ||
); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.