diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b9cbdfb3..803f2b14d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,51 +14,51 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [16.x] + node-version: [ 18.x ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} - - run: npm install - - run: npm run lint - - run: npm run build - - run: npm run build:examples - - run: docker-compose -f docker/docker-compose-ci.yml up --build -d - - run: npm run test + - run: npm install + - run: npm run lint + - run: npm run build + - run: npm run build:examples + - run: docker-compose -f docker/docker-compose-ci.yml up --build -d + - run: npm run test - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - file: ./coverage/lcov.info - - - name: Run benchmark - run: npm run benchmark | tee output.txt - # Download previous benchmark result from cache (if exists) - - name: Download previous benchmark data - uses: actions/cache@v1 - with: - path: ./cache - key: ${{ runner.os }}-benchmark - # Run `github-action-benchmark` action - - name: Store benchmark result - uses: benchmark-action/github-action-benchmark@v1 - if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} - with: - # What benchmark tool the output.txt came from - tool: 'benchmarkjs' - # Where the output from the benchmark tool is stored - output-file-path: output.txt - # Where the previous data file is stored - external-data-json-path: ./cache/benchmark-data.json - # Workflow will fail when an alert happens - fail-on-alert: false - # GitHub API token to make a commit comment - github-token: ${{ secrets.GITHUB_TOKEN }} - # Enable comment always - comment-always: true - # Save only on the main to compare the benchmarks between PR and base branch - save-data-file: ${{ github.ref == 'refs/heads/main' }} + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + file: ./coverage/lcov.info + + - name: Run benchmark + run: npm run benchmark | tee output.txt + # Download previous benchmark result from cache (if exists) + - name: Download previous benchmark data + uses: actions/cache@v1 + with: + path: ./cache + key: ${{ runner.os }}-benchmark + # Run `github-action-benchmark` action + - name: Store benchmark result + uses: benchmark-action/github-action-benchmark@v1 + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} + with: + # What benchmark tool the output.txt came from + tool: 'benchmarkjs' + # Where the output from the benchmark tool is stored + output-file-path: output.txt + # Where the previous data file is stored + external-data-json-path: ./cache/benchmark-data.json + # Workflow will fail when an alert happens + fail-on-alert: false + # GitHub API token to make a commit comment + github-token: ${{ secrets.GITHUB_TOKEN }} + # Enable comment always + comment-always: true + # Save only on the main to compare the benchmarks between PR and base branch + save-data-file: ${{ github.ref == 'refs/heads/main' }} diff --git a/.github/workflows/github-page-publish.yml b/.github/workflows/github-page-publish.yml index 0c9fc9600..d09648a46 100644 --- a/.github/workflows/github-page-publish.yml +++ b/.github/workflows/github-page-publish.yml @@ -15,7 +15,7 @@ jobs: - name: Setup Node πŸ”§ uses: actions/setup-node@v2 with: - node-version: '16' + node-version: '18' cache: 'npm' cache-dependency-path: package-lock.json diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 2cae10c6c..8f34d6744 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -1,22 +1,22 @@ name: npm-publish on: release: - types: [created] + types: [ created ] jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout πŸ›ŽοΈ - uses: actions/checkout@v2 - - name: Setup Node πŸ”§ - uses: actions/setup-node@v2 - with: - node-version: '16' - cache: 'npm' - cache-dependency-path: package-lock.json - registry-url: 'https://registry.npmjs.org' - - run: npm install - - run: npm run build && npm run publish:prepare - - run: cd bundle && npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Checkout πŸ›ŽοΈ + uses: actions/checkout@v2 + - name: Setup Node πŸ”§ + uses: actions/setup-node@v2 + with: + node-version: '18' + cache: 'npm' + cache-dependency-path: package-lock.json + registry-url: 'https://registry.npmjs.org' + - run: npm install + - run: npm run build && npm run publish:prepare + - run: cd bundle && npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ee6911215..0cad78d15 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,9 @@ ## How to contribute -Yorkie is Apache 2.0 licensed and accepts contributions via GitHub pull requests. This document outlines some of the conventions on commit message formatting, contact points for developers, and other resources to help get contributions into Yorkie. +Yorkie is Apache 2.0 licensed and accepts contributions via GitHub pull requests. This document outlines some of the +conventions on commit message formatting, contact points for developers, and other resources to help get contributions +into Yorkie. ### Contacts @@ -13,7 +15,9 @@ If you have any questions along the way, please don’t hesitate to ask us ### Getting started - Fork the repository on GitHub -- Read the [CONTRIBUTING.md](https://github.com/yorkie-team/yorkie-js-sdk/blob/main/CONTRIBUTING.md#building-yorkie-js-sdk) for build instructions +- Read + the [CONTRIBUTING.md](https://github.com/yorkie-team/yorkie-js-sdk/blob/main/CONTRIBUTING.md#building-yorkie-js-sdk) + for build instructions ## Contribution flow @@ -32,9 +36,9 @@ Thanks for contributing! ### Building yorkie-js-sdk -For building yorkie-js-sdk, You'll first need Node.js installed(Node.js version 16+ and npm version 7.10+ are required). +For building yorkie-js-sdk, You'll first need Node.js installed(Node.js version 18+ and npm version 7.10+ are required). -- [Node.js](https://nodejs.org/en) (version 16+) +- [Node.js](https://nodejs.org/en) (version 18+) - [npm](https://www.npmjs.com/) (version 7.10+) ```bash @@ -54,7 +58,8 @@ How to install protoc-gen-grpc-web: https://github.com/grpc/grpc-web#code-genera $ npm run build:proto ``` -> Primary "source of truth" location of protobuf message is in [yorkie](https://github.com/yorkie-team/yorkie/tree/main/api). We manage the messages in the repository. +> Primary "source of truth" location of protobuf message is +> in [yorkie](https://github.com/yorkie-team/yorkie/tree/main/api). We manage the messages in the repository. ### Testing yorkie-js-sdk with Envoy, Yorkie and MongoDB. @@ -99,11 +104,13 @@ $ open http://0.0.0.0:9000/ ### Code style -In order to format the code, we use [Husky](https://github.com/typicode/husky) to implement git hooks and [Prettier](https://github.com/prettier/prettier) +In order to format the code, we use [Husky](https://github.com/typicode/husky) to implement git hooks +and [Prettier](https://github.com/prettier/prettier) ### Format of the commit message -We follow a rough convention for commit messages that is designed to answer two questions: what changed and why. The subject line should feature the what and the body of the commit should describe the why. +We follow a rough convention for commit messages that is designed to answer two questions: what changed and why. The +subject line should feature the what and the body of the commit should describe the why. ``` Remove the synced seq when detaching the document @@ -114,7 +121,9 @@ the changes should be applied to other replicas before GC. For this detached. ``` -The first line is the subject and should be no longer than 70 characters, the second line is always blank, and other lines should be wrapped at 80 characters. This allows the message to be easier to read on GitHub as well as in various git tools. +The first line is the subject and should be no longer than 70 characters, the second line is always blank, and other +lines should be wrapped at 80 characters. This allows the message to be easier to read on GitHub as well as in various +git tools. ## Contributor License Agreement @@ -122,14 +131,22 @@ We require that all contributors sign our Contributor License Agreement ("CLA") ### Signing the CLA -Open a pull request ("PR") to any of our open source projects to sign the CLA. A bot will comment on the PR asking you to sign the CLA if you haven't already. +Open a pull request ("PR") to any of our open source projects to sign the CLA. A bot will comment on the PR asking you +to sign the CLA if you haven't already. -Follow the steps given by the bot to sign the CLA. This will require you to log in with GitHub. We will only use this information for CLA tracking. You only have to sign the CLA once. Once you've signed the CLA, future contributions to the project will not require you to sign again. +Follow the steps given by the bot to sign the CLA. This will require you to log in with GitHub. We will only use this +information for CLA tracking. You only have to sign the CLA once. Once you've signed the CLA, future contributions to +the project will not require you to sign again. ### Why Require a CLA? -Agreeing to a CLA explicitly states that you are entitled to provide a contribution, that you cannot withdraw permission to use your contribution at a later date, and that Yorkie Team has permission to use your contribution. +Agreeing to a CLA explicitly states that you are entitled to provide a contribution, that you cannot withdraw permission +to use your contribution at a later date, and that Yorkie Team has permission to use your contribution. -This removes any ambiguities or uncertainties caused by not having a CLA and allows users and customers to confidently adopt our projects. At the same time, the CLA ensures that all contributions to our open source projects are licensed under the project's respective open source license, such as Apache-2.0 License. +This removes any ambiguities or uncertainties caused by not having a CLA and allows users and customers to confidently +adopt our projects. At the same time, the CLA ensures that all contributions to our open source projects are licensed +under the project's respective open source license, such as Apache-2.0 License. -Requiring a CLA is a common and well-accepted practice in open source. Major open source projects require CLAs such as Apache Software Foundation projects, Facebook projects, Google projects, Python, Django, and more. Each of these projects remains licensed under permissive OSS licenses such as MIT, Apache, BSD, and more. +Requiring a CLA is a common and well-accepted practice in open source. Major open source projects require CLAs such as +Apache Software Foundation projects, Facebook projects, Google projects, Python, Django, and more. Each of these +projects remains licensed under permissive OSS licenses such as MIT, Apache, BSD, and more. diff --git a/package-lock.json b/package-lock.json index 1d49b061c..0dabe44d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -61,7 +61,7 @@ "yargs": "^17.0.1" }, "engines": { - "node": ">=16.0.0", + "node": ">=18.0.0", "npm": ">=7.1.0" } }, diff --git a/package.json b/package.json index c96d2189a..90cdd766c 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "profile:bundle": "webpack --config ./config/webpack.dev.config.js --profile" }, "engines": { - "node": ">=16.0.0", + "node": ">=18.0.0", "npm": ">=7.1.0" }, "repository": {