Skip to content

Commit

Permalink
fix cli messages; change cli entrypoint for upload metadata; docs upd…
Browse files Browse the repository at this point in the history
…ates
  • Loading branch information
wpdas committed Mar 8, 2024
1 parent 8b48300 commit 8607e84
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 19 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

# <div align="center">Além</div>

Alem is a web3 JavaScript / TypeScript library for building user interfaces for NEAR Bos dApps.
Alem is a web3 JavaScript / TypeScript library for building user interfaces for NEAR BOS DApps.

- **Declarative:** Alem makes it painless to create interactive UIs. Design simple views for each state in your application, and Alem will efficiently update and render just the right components when your data changes. Declarative views make your code more predictable, simpler to understand, and easier to debug.
- **Component-Based:** Build encapsulated components that manage their own state, then compose them to make complex UIs. Since component logic is written in JavaScript, you can easily pass rich data through your app.
- **Learn Once, Write Anywhere:** We don't make assumptions about the rest of your technology stack, so you can develop new features in Alem without rewriting existing code.
- **CSS:** Alem supports .css files. Just create them and they will all be included in the application.
- **Easy State Management:** Use state management to make it easier to process data through the application.
- **Easy State Management:** Use state management to make it easier to persist data through the application.
- **Routes System:** An integrated router system that makes it possible to navigate between pages easily.
- **Much more:** Take a look at the other documentation items to learn how to use all the features provided by Alem.

Expand All @@ -19,7 +19,7 @@ Alem is a web3 JavaScript / TypeScript library for building user interfaces for

**You’ll need to have Node 18.0.0 or later version on your local development machine**. You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to switch Node versions between different projects.

Use the command bellow to start an initial boilerplate.
Use the command below to start an initial boilerplate.

### JavaScript

Expand Down
12 changes: 6 additions & 6 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Commands:
dev Run the development server
build Build the project
deploy Deploy the project
upload-data Upload data to SocialDB (app name, description, icon, tags, etc)
upload-metadata Upload metadata to SocialDB (app name, description, icon, tags, etc)
```

#### Command: `dev`
Expand All @@ -35,7 +35,7 @@ Options:
Build the project:

```bash
Usage: bos build
Usage: alem build
```

This will output valid widget code to the `/build` directory.
Expand All @@ -45,13 +45,13 @@ This will output valid widget code to the `/build` directory.
Deploy the project to Near BOS:

```bash
Usage: bos deploy
Usage: alem deploy
```

#### Command: `upload-data`
#### Command: `upload-metadata`

Upload data to SocialDB. This is going to use the data provided by `bos.config.json` file. The content represents the app's details like `name, description, icon, tags, etc`. You can update this information manually by going to the widget metadata tab using the [Near Sandbox](https://near.org/sandbox).
Upload metadata to SocialDB. This is going to use the data provided by `bos.config.json` file. The content represents the app's details like `name, description, icon, tags, etc`. You can update this information manually by going to the widget metadata tab using the [Near Sandbox](https://near.org/sandbox).

```bash
Usage: bos upload-data
Usage: alem upload-metadata
```
8 changes: 5 additions & 3 deletions docs/config-file.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
## Config File

Create an `bos.config.json` file at the root of the project with the following content:
Create a `bos.config.json` file at the root of the project with the following content:

```json
{
// If "true", the app is going to be saved as Index app, the main app of the account. If "false", this is going to use "name" as the widget name. The spaces will be trimmed.
// This is the root path of the app.
// if true: alem-lib.near/widget/Index
// if false: alem-lib.near/widget/alem-docs (it's going to use the slugified "name")
"isIndex": true,
// Account that owns the app.
// The account ID under which the app will be deployed.
"account": "alem-lib.near",
// App name
"name": "Alem Docs",
Expand Down
28 changes: 25 additions & 3 deletions docs/feature-overview.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Feature Overview

Alem is a web3 **JavaScript** / **TypeScript** library for building user interfaces for NEAR Bos dApps.
Alem is a web3 **JavaScript** / **TypeScript** library for building user interfaces for NEAR BOS DApps.

- **Declarative:** Alem makes it painless to create interactive UIs. Design simple views for each state in your application, and Alem will efficiently update and render just the right components when your data changes. Declarative views make your code more predictable, simpler to understand, and easier to debug.
- **Component-Based:** Build encapsulated components that manage their own state, then compose them to make complex UIs. Since component logic is written in JavaScript, you can easily pass rich data through your app.
- **Learn Once, Write Anywhere:** We don't make assumptions about the rest of your technology stack, so you can develop new features in Alem without rewriting existing code.
- **CSS:** Alem supports .css files. Just create them and they will all be included in the application.
- **Easy State Management:** Use state management to make it easier to process data through the application.
- **Easy State Management:** Use state management to make it easier to persist data through the application.
- **Routes System:** An integrated router system that makes it possible to navigate between pages easily.
- **Much more:** Take a look at the other documentation items to learn how to use all the features provided by Alem.

Expand Down Expand Up @@ -44,4 +44,26 @@ export const ComponentB = () => {

## Good to Know

You can't use the same name for instances. Otherwise, the compiler will break.
You can't use the same name for things. Otherwise, the compiler will break.

### Correct

```ts
// fileA.ts
const MyValue = 2;

// fileB.ts
const MyValueB = 5;
```

### Incorrect

The example below will break up the app because both consts are using the same name.

```ts
// fileA.ts
const MyValue = 2;

// fileB.ts
const MyValue = 5;
```
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**You’ll need to have Node 18.0.0 or later version on your local development machine**. You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to switch Node versions between different projects.

Use the command bellow to start an initial boilerplate.
Use the command below to start an initial boilerplate.

### JavaScript

Expand Down
4 changes: 2 additions & 2 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ async function run() {
deployCLI();
});
program
.command("upload-data")
.description("Upload data to SocialDB")
.command("upload-metadata")
.description("Upload metadata to SocialDB")
.argument("[string]", "app name")
.action((appName) => {
uploadDataCLI(appName);
Expand Down
2 changes: 1 addition & 1 deletion lib/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ async function serveDevJson({ useSocket, useGateway, useOpen, port }) {
│ │
└─────────────────────────────────────────────────────────────┘
`);
log.sucess(`bos-workspace runnig on port ${port}!`);
log.sucess(`Alem runnig on port ${port}!`);
})
.on("error", (err) => {
log.error(err);
Expand Down

0 comments on commit 8607e84

Please sign in to comment.