Skip to content

Commit

Permalink
Update README.md, CONTRIBUTING.MD
Browse files Browse the repository at this point in the history
  • Loading branch information
gwbaik9717 committed Aug 13, 2024
1 parent fcf1366 commit 3d49d41
Show file tree
Hide file tree
Showing 12 changed files with 105 additions and 39 deletions.
25 changes: 17 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,21 @@ Thanks for contributing!

### Building yorkie-js-sdk

For building yorkie-js-sdk, You'll first need Node.js installed(Node.js version 18+ and npm version 7.10+ are required).
For building yorkie-js-sdk, You'll first need Node.js installed(Node.js version 18+ and pnpm version 9.6+ are required).

- [Node.js](https://nodejs.org/en) (version 18+)
- [npm](https://www.npmjs.com/) (version 7.10+)
- [pnpm](https://pnpm.io/) (version 9.6+)

```bash
# install packages
$ npm install

# In the root directory of the repository.
$ pnpm sdk install

# build
$ npm run build

# In the root directory of the repository.
$ pnpm sdk build
```

To generate proto messages, we use protoc-gen-connect-es, which is a code generator plugin for Protocol Buffer compilers, like buf and protoc. It generates both clients and server definitions from Protocol Buffer schema.
Expand All @@ -55,7 +59,9 @@ For more details, see [@connectrpc/protoc-gen-connect-es](https://github.com/con

```bash
# generate proto messages and the service client stub classes
$ npm run build:proto

# In the root directory of the repository.
$ pnpm sdk build:proto
```

> Primary "source of truth" location of protobuf message is
Expand All @@ -72,7 +78,8 @@ $ docker compose -f docker/docker-compose.yml up --build -d
Start the test in another terminal session.

```bash
$ npm run test
# In the root directory of the repository.
$ pnpm sdk test
```

To get the latest server locally, run the command below then restart containers again:
Expand Down Expand Up @@ -108,7 +115,8 @@ To run only specific suites or tests, use `.only` and execute the following comm
Refer to [Test Filtering](https://vitest.dev/guide/filtering#selecting-suites-and-tests-to-run) in `vitest` for more details:

```bash
$ npm run test {test file path} # e.g. npm run test integration/tree_test.ts
# In the root directory of the repository.
$ pnpm sdk test {test file path} # e.g. pnpm sdk test integration/tree_test.ts
```

### Starting co-editing example with CodeMirror
Expand All @@ -122,7 +130,8 @@ $ docker compose -f docker/docker-compose.yml up --build -d
Start the webpack-dev-server in another terminal session.

```bash
$ npm run dev
# In the root directory of the repository.
$ pnpm sdk dev
```

Open the co-editing example page served by webpack-dev-server in your browser.
Expand Down
14 changes: 9 additions & 5 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,24 @@ $ docker compose -f docker/docker-compose.yml up --build -d
The examples have own local dependencies. So you should install dependencies before running examples.

```bash
# In the directory of the example.
$ npm install
# In the root directory of the repository.
$ pnpm install
```

Then you can run the examples.

```bash
# In the directory of the example.
$ npm run dev
# In the root directory of the repository.
$ pnpm <EXAMPLE-NAME> dev

# Or in the directory of the example.
$ pnpm dev
```

Open the browser and go to the URL that is printed in the terminal.

## Releasing an example to https://yorkie.dev

To release an example, the example should export static files to `./dist` directory when running `npm run build`.
To release an example, the example should export static files to `./dist` directory when running `pnpm <EXAMPLE-NAME> build` in the root directory of the repository or `pnpm build` in the directory of the example.

After the example is merged to the `main` branch, it is automatically deployed to https://yorkie.dev/yorkie-js-sdk/examples/{EXAMPLE-NAME}.
9 changes: 7 additions & 2 deletions examples/nextjs-scheduler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,16 @@ $ docker compose -f docker/docker-compose.yml up --build -d
Then install dependencies and run the demo.

```bash
$ npm install
# In the root directory of the repository.
$ pnpm install
```

Now you can run the demo.

```bash
$ npm run dev
# In the root directory of the repository.
$ pnpm nextjs-scheduler dev

# Or in the directory of the example.
$ pnpm dev
```
9 changes: 7 additions & 2 deletions examples/profile-stack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,16 @@ $ docker compose -f docker/docker-compose.yml up --build -d
Install dependencies

```bash
$ npm install
# In the root directory of the repository.
$ pnpm install
```

Start demo project

```bash
$ npm run dev
# In the root directory of the repository.
$ pnpm profile-stack dev

# Or in the directory of the example.
$ pnpm dev
```
9 changes: 7 additions & 2 deletions examples/react-tldraw/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,16 @@ $ docker compose -f docker/docker-compose.yml up --build -d
Then install dependencies and run the demo.

```bash
$ npm install
# In the root directory of the repository.
$ pnpm install
```

Now you can run the demo.

```bash
$ npm run dev
# In the root directory of the repository.
$ pnpm react-tldraw dev

# Or in the directory of the example.
$ pnpm dev
```
9 changes: 7 additions & 2 deletions examples/react-todomvc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,16 @@ $ docker compose -f docker/docker-compose.yml up --build -d
Then install dependencies and run the demo.

```bash
$ npm install
# In the root directory of the repository.
$ pnpm install
```

Now you can run the demo.

```bash
$ npm run dev
# In the root directory of the repository.
$ pnpm react-todomvc dev

# Or in the directory of the example.
$ pnpm dev
```
18 changes: 14 additions & 4 deletions examples/simultaneous-cursors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
Install dependencies

```bash
$ npm install
# In the root directory of the repository.
$ pnpm install
```

Create an account on [Yorkie Dashboard](https://yorkie.dev/dashboard)
Expand All @@ -30,15 +31,20 @@ VITE_YORKIE_API_KEY='your_key_xxxx'
Start demo project

```bash
$ npm run dev
# In the root directory of the repository.
$ pnpm simultaneous-cursors dev

# Or in the directory of the example.
$ pnpm dev
```

### With local Yorkie server

Install dependencies

```bash
$ npm install
# In the root directory of the repository.
$ pnpm install
```

At project root, run below command to start Yorkie server.
Expand All @@ -57,5 +63,9 @@ VITE_YORKIE_API_KEY=''
Start demo project

```bash
$ npm run dev
# In the root directory of the repository.
$ pnpm simultaneous-cursors dev

# Or in the directory of the example.
$ pnpm dev
```
9 changes: 7 additions & 2 deletions examples/vanilla-codemirror6/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,16 @@ $ docker compose -f docker/docker-compose.yml up --build -d
Install dependencies

```bash
$ npm install
# In the root directory of the repository.
$ pnpm install
```

Start demo project

```bash
$ npm run dev
# In the root directory of the repository.
$ pnpm vanilla-codemirror6 dev

# Or in the directory of the example.
$ pnpm dev
```
18 changes: 14 additions & 4 deletions examples/vanilla-quill/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ This demo shows the real-time collaborative version of the [Quill](https://quill
Install dependencies

```bash
$ npm install
# In the root directory of the repository.
$ pnpm install
```

Create an account on [Yorkie Dashboard](https://yorkie.dev/dashboard)
Expand All @@ -30,15 +31,20 @@ VITE_YORKIE_API_KEY='your_key_xxxx'
Start demo project

```bash
$ npm run dev
# In the root directory of the repository.
$ pnpm vanilla-quill dev

# Or in the directory of the example.
$ pnpm dev
```

### With local Yorkie server

Install dependencies

```bash
$ npm install
# In the root directory of the repository.
$ pnpm install
```

At project root, run below command to start Yorkie.
Expand All @@ -57,5 +63,9 @@ VITE_YORKIE_API_KEY=''
Start demo project

```bash
$ npm run dev
# In the root directory of the repository.
$ pnpm vanilla-quill dev

# Or in the directory of the example.
$ pnpm dev
```
9 changes: 7 additions & 2 deletions examples/vuejs-kanban/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,16 @@ $ docker compose -f docker/docker-compose.yml up --build -d
Install dependencies

```bash
$ npm install
# In the root directory of the repository.
$ pnpm install
```

Start demo project

```bash
$ npm run dev
# In the root directory of the repository.
$ pnpm vuejs-kanban dev

# Or in the directory of the example.
$ pnpm dev
```
11 changes: 7 additions & 4 deletions packages/create-yorkie-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ $ npx create-yorkie-app
The examples have own local dependencies. So you should install dependencies before running examples.

```bash
# In the directory of the example.
$ npm install
# In the root directory of the repository.
$ pnpm install
```

Then you can run the examples.

```bash
# In the directory of the example.
$ npm run dev
# In the root directory of the repository.
$ pnpm <EXAMPLE-NAME> dev

# Or in the directory of the example.
$ pnpm dev
```

Open the browser and go to the URL that is printed in the terminal.
Expand Down
4 changes: 2 additions & 2 deletions packages/devtools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ const doc = new yorkie.Document('docKey', {

To start developing with Yorkie Devtools, follow these steps:

1. Run `npm install` from this directory.
2. Run `npm run build` from this directory.
1. Run `pnpm install` in root directory of the repository.
2. Run `pnpm devtools dev` in the root directory of the repository or `pnpm dev` in the project directory.
3. Open your Chrome browser and go to [chrome://extensions](chrome://extensions).
4. Enable "Developer mode."
5. Click on "Load unpacked" and select the output directory `dist/chrome-mv3-prod`.

0 comments on commit 3d49d41

Please sign in to comment.