diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d1aae9cb3..418b107ee 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. @@ -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 @@ -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: @@ -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 @@ -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. diff --git a/examples/README.md b/examples/README.md index c2240c8d0..48c12c845 100644 --- a/examples/README.md +++ b/examples/README.md @@ -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 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 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}. diff --git a/examples/nextjs-scheduler/README.md b/examples/nextjs-scheduler/README.md index 4be342b16..2290d2226 100644 --- a/examples/nextjs-scheduler/README.md +++ b/examples/nextjs-scheduler/README.md @@ -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 ``` diff --git a/examples/profile-stack/README.md b/examples/profile-stack/README.md index 7690d828f..3e553c381 100644 --- a/examples/profile-stack/README.md +++ b/examples/profile-stack/README.md @@ -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 ``` diff --git a/examples/react-tldraw/README.md b/examples/react-tldraw/README.md index d5d6c05fd..e41384e72 100644 --- a/examples/react-tldraw/README.md +++ b/examples/react-tldraw/README.md @@ -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 ``` diff --git a/examples/react-todomvc/README.md b/examples/react-todomvc/README.md index 93dc2af44..2a9bf72ee 100644 --- a/examples/react-todomvc/README.md +++ b/examples/react-todomvc/README.md @@ -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 ``` diff --git a/examples/simultaneous-cursors/README.md b/examples/simultaneous-cursors/README.md index af37c2357..21e57d0c6 100644 --- a/examples/simultaneous-cursors/README.md +++ b/examples/simultaneous-cursors/README.md @@ -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) @@ -30,7 +31,11 @@ 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 @@ -38,7 +43,8 @@ $ npm run dev Install dependencies ```bash -$ npm install +# In the root directory of the repository. +$ pnpm install ``` At project root, run below command to start Yorkie server. @@ -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 ``` diff --git a/examples/vanilla-codemirror6/README.md b/examples/vanilla-codemirror6/README.md index 194f3f690..cd04d7cfc 100644 --- a/examples/vanilla-codemirror6/README.md +++ b/examples/vanilla-codemirror6/README.md @@ -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 ``` diff --git a/examples/vanilla-quill/README.md b/examples/vanilla-quill/README.md index e16e81129..96473286b 100644 --- a/examples/vanilla-quill/README.md +++ b/examples/vanilla-quill/README.md @@ -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) @@ -30,7 +31,11 @@ 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 @@ -38,7 +43,8 @@ $ npm run dev Install dependencies ```bash -$ npm install +# In the root directory of the repository. +$ pnpm install ``` At project root, run below command to start Yorkie. @@ -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 ``` diff --git a/examples/vuejs-kanban/README.md b/examples/vuejs-kanban/README.md index 0446eb1a4..57a434aa8 100644 --- a/examples/vuejs-kanban/README.md +++ b/examples/vuejs-kanban/README.md @@ -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 ``` diff --git a/packages/create-yorkie-app/README.md b/packages/create-yorkie-app/README.md index 80a9a107b..56ac62a26 100644 --- a/packages/create-yorkie-app/README.md +++ b/packages/create-yorkie-app/README.md @@ -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 dev + +# Or in the directory of the example. +$ pnpm dev ``` Open the browser and go to the URL that is printed in the terminal. diff --git a/packages/devtools/README.md b/packages/devtools/README.md index b942c6107..6e0756bd6 100644 --- a/packages/devtools/README.md +++ b/packages/devtools/README.md @@ -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`.