Skip to content

Commit

Permalink
Drop node 16 support (#653)
Browse files Browse the repository at this point in the history
Drop node.js 16 supports due to node.js 16 is deprecated since 11st
Sep, 2023.

- https://nodejs.org/en/blog/announcements/nodejs16-eol
- https://nodejs.dev/en/about/releases/
  • Loading branch information
blurfx authored Sep 23, 2023
1 parent c0f7abc commit 795cd30
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 75 deletions.
88 changes: 44 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
2 changes: 1 addition & 1 deletion .github/workflows/github-page-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -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 }}
43 changes: 30 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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
Expand All @@ -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.

Expand Down Expand Up @@ -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
Expand All @@ -114,22 +121,32 @@ 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

We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution.

### 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.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 795cd30

Please sign in to comment.