Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: build for node 20 [#1096] #1094

Merged
merged 21 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'airbnb-base',
'prettier',
'plugin:@typescript-eslint/recommended',
'plugin:jsdoc/recommended',
'prettier',
],
root: true,
plugins: ['@typescript-eslint', 'prettier', 'jsdoc'],
Expand All @@ -16,7 +16,7 @@ module.exports = {
},
},
react: {
version: '16.0',
version: '18.0',
},
},
env: {
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: "CodeQL"
name: 'CodeQL'

on:
push:
branches: [ main ]
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
branches: [main]
schedule:
- cron: '24 2 * * 4'

Expand All @@ -19,14 +19,14 @@ jobs:
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: 'javascript'
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: 'javascript'

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
29 changes: 10 additions & 19 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
group: publish-${{ github.ref }}

env:
NODE_VERSION: 16.x
NODE_VERSION: 20.x

jobs:
publish-npm:
Expand All @@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@v4

- name: Use Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
Expand All @@ -32,23 +32,25 @@ jobs:
- name: Get cache settings
id: cache-settings
run: |
echo "::set-output name=firebase-tools::$(yarn list -s --depth=0 --pattern firebase-tools | tail -n 1 | sed 's/.*@//g')"
fbToolsVersion=$(yarn info firebase-tools --json --name-only | sed 's/.*@npm\://g' | sed 's/"$//')
echo "firebase-tools version $fbToolsVersion"
echo "firebase-tools=$fbToolsVersion" >> $GITHUB_OUTPUT

- name: Cache Firebase Emulator Binaries
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/firebase/emulators
key: ${{ runner.os }}-firebase-${{ steps.cache-settings.outputs.firebase-tools }}
key: ${{ runner.os }}-${{ matrix.node-version }}-firebase-${{ steps.cache-settings.outputs.firebase-tools }}

- name: Configure package manager
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm config set '//registry.npmjs.org/:_authToken' ${{ env.NPM_TOKEN }}
yarn config set npmAuthToken ${{ env.NPM_TOKEN }}
npm whoami

- name: Install Dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable

- name: Check For Lint
run: yarn lint
Expand All @@ -59,19 +61,8 @@ jobs:
- name: Run Build
run: yarn build

# Skipped due to Error: "npm ERR! Missing script: "size-build""
# - name: Size Check
# uses: andresz1/size-limit-action@v1.0.0
# env:
# CI_JOB_NUMBER: 1
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Size Check
run: $(yarn bin)/size-limit

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
uses: cycjimmy/semantic-release-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
33 changes: 18 additions & 15 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,53 +12,56 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [18.x, 20.x]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Get cache settings
id: cache-settings
run: |
echo "::set-output name=firebase-tools::$(yarn list -s --depth=0 --pattern firebase-tools | tail -n 1 | sed 's/.*@//g')"
fbToolsVersion=$(yarn info firebase-tools --json --name-only | sed 's/.*@npm\://g' | sed 's/"$//')
echo "firebase-tools version $fbToolsVersion"
echo "firebase-tools=$fbToolsVersion" >> $GITHUB_OUTPUT

- name: Cache Firebase Emulator Binaries
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/firebase/emulators
key: ${{ runner.os }}-${{ matrix.node-version }}-firebase-${{ steps.cache-settings.outputs.firebase-tools }}

- name: Install Dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable

- name: Check For Lint
run: yarn lint

- name: Check Formatting
run: yarn format:check

- name: Run Unit Tests + Coverage
run: yarn test:cov

- name: Upload Test Coverage
uses: codecov/codecov-action@v3
if: matrix.node-version == '16.x'
if: matrix.node-version == '20.x'
with:
fail_ci_if_error: false

- name: Run Build
run: yarn build

# Skipped due to Error: "npm ERR! Missing script: "size-build""
# - name: Size Check
# uses: andresz1/size-limit-action@v1.0.0
# env:
# CI_JOB_NUMBER: 1
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Size Check
run: $(yarn bin)/size-limit
uses: andresz1/size-limit-action@v1
if: matrix.node-version == '20.x'
env:
CI_JOB_NUMBER: 1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
skip_step: install # Skip install since it happens above
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,11 @@ es
*.log*
.nyc_output/**
coverage/**
**/*.eslintcache
**/*.eslintcache
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
5 changes: 1 addition & 4 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit $1
yarn commitlint --edit $1
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
6 changes: 3 additions & 3 deletions .mocharc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

module.exports = {
require: ['ts-node/register', './test/setup.ts'],
require: ['./test/setup.ts'],
recursive: true,
timeout: 5000
};
timeout: 5000,
};
4 changes: 2 additions & 2 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@istanbuljs/nyc-config-typescript"
}
"extends": "@istanbuljs/nyc-config-typescript"
}
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.yarn/*
yarn.lock
node_modules
*.log
Loading
Loading