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

housekeeping: Update dependency node to v18 #2916

Merged
merged 50 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
d64fe2e
housekeeping: Update dependency node to v18
renovate[bot] Feb 13, 2024
2acd6c9
Some other places to update node version min
jdslaugh Feb 13, 2024
1c40ab0
Fixing styling
jdslaugh Feb 15, 2024
e14238a
Merge branch 'main' into renovate/node-18.x
jdslaugh Mar 25, 2024
ba28681
housekeeping: frontend: Updating Yarn to v4 to better support version…
jdslaugh Mar 27, 2024
ab1a1c6
Merge branch 'main' into renovate/node-18.x
jdslaugh Mar 27, 2024
14ada8f
Lint fix
jdslaugh Mar 27, 2024
437540a
Updating to use working-directory
jdslaugh Mar 27, 2024
0440224
Fixing some build issues
jdslaugh Mar 27, 2024
39877ff
Fixing scripts
jdslaugh Mar 27, 2024
00a0cbd
Changing workflow
jdslaugh Mar 27, 2024
c2847f0
Updating linker
jdslaugh Mar 27, 2024
f5ebe5c
Fixing
jdslaugh Mar 27, 2024
c2b6ce4
Updating docs to use latest yarn
jdslaugh Mar 27, 2024
a4e6722
Updating workflow
jdslaugh Mar 27, 2024
e28f2c6
Updating workflow and script
jdslaugh Mar 27, 2024
fea8d06
Removing yarn config update
jdslaugh Mar 27, 2024
f201364
Fixing
jdslaugh Mar 27, 2024
9fe5529
Fixing
jdslaugh Mar 27, 2024
7617cda
Testing enforce version check for Yarn
jdslaugh Mar 27, 2024
e80f035
Adjustments to installs for docs
jdslaugh Mar 27, 2024
ce9db74
Updating install script
jdslaugh Mar 27, 2024
849751c
Changing script location
jdslaugh Mar 27, 2024
2585d35
Fixing shell test
jdslaugh Mar 27, 2024
510359a
Updates to scaffolding
jdslaugh Mar 27, 2024
99c15e1
Readding register call
jdslaugh Mar 28, 2024
487bf43
echo test
jdslaugh Mar 28, 2024
e438c0c
echo test
jdslaugh Mar 28, 2024
a896cef
Removing echo tests and fixing frontend unit test because of debounce
jdslaugh Mar 28, 2024
e34cc0e
Adjusting publish script
jdslaugh Mar 28, 2024
6e9a80d
Updating node version of netlify
jdslaugh Mar 28, 2024
f80dac0
Adjusting copy text and limited actions for gateway-linked
jdslaugh Mar 28, 2024
f1d3dc8
Copy text
jdslaugh Mar 28, 2024
2712540
Adjusting frontend workflow
jdslaugh Mar 28, 2024
3319e06
Merge branch 'main' into renovate/node-18.x
jdslaugh Mar 29, 2024
67be9e4
Updating workflow versions
jdslaugh Mar 29, 2024
18b42c2
Fixing script
jdslaugh Mar 29, 2024
e2d13e7
Restoring limitations on PR pushes for frontend workflows
jdslaugh Apr 2, 2024
2fee137
Restoring name to lowercase
jdslaugh Apr 2, 2024
755d809
Updating gateway script
jdslaugh Apr 3, 2024
ac1d9d8
Fixing unbound variable issue
jdslaugh Apr 4, 2024
5e63151
Merge branch 'main' into renovate/node-18.x
jdslaugh Apr 11, 2024
2aaf5bf
Exporting some interfaces
jdslaugh Apr 11, 2024
d5440e9
Fixing shellcheck
jdslaugh Apr 12, 2024
4fedc71
Removing accidental linked folder
jdslaugh Apr 12, 2024
42d42e2
Merge branch 'main' into renovate/node-18.x
jdslaugh Apr 23, 2024
50d1345
Exporting interfaces
jdslaugh Apr 24, 2024
d318ec0
Exporting interface
jdslaugh Apr 24, 2024
49f51a9
Limiting git precommit hook to only target changed/staged files inste…
jdslaugh Apr 29, 2024
fa5b199
Adjusting main scripts to remove unlimited jobs due to OOM issues
jdslaugh Apr 30, 2024
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
49 changes: 49 additions & 0 deletions .github/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/sh

ROOT_DIR=$(pwd)
FRONTEND_DIR="${ROOT_DIR}/frontend"
BASE_GIT_DIFF_CMD="git diff --name-only --staged --relative=frontend"

if [[ $(${BASE_GIT_DIFF_CMD} -- frontend) ]]; then
echo "Running frontend checks in ${FRONTEND_DIR}..."
cd "${FRONTEND_DIR}"

if [[ $(${BASE_GIT_DIFF_CMD} -- **/**/package.json) ]]; then
echo "\nLinting frontend packages...\n"
{
yarn lint:packages
} || {
echo "\n${FRONTEND_DIR} package lint checks failed, please run \"yarn lint:packages:fix\" and commit the changes."
exit 1
}

echo "\nTesting frontend package constraints...\n"
{
yarn constraints
} || {
echo "\n${FRONTEND_DIR} constraints check failed, please run \"yarn constraints --fix\" and commit the changes."
exit 1
}
fi

STAGED_FILES=$(${BASE_GIT_DIFF_CMD} -- **/**/src)
if [[ ${STAGED_FILES} ]]; then
echo "\nLinting frontend code..."
{
yarn lint:files ${STAGED_FILES}
} || {
echo "\n${FRONTEND_DIR} lint checks failed, please try running \"yarn lint:fix\" and committing the changes."
exit 1
}

echo "\nRunning frontend tests..."
{
yarn test:coverage
} || {
echo "\n${FRONTEND_DIR} tests failed, please fix the issues and commit the changes."
exit 1
}
fi
fi

exit 0
3 changes: 2 additions & 1 deletion .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: '18.x'
check-latest: true
- name: build and verify
run: make api-verify
Expand All @@ -39,3 +39,4 @@ jobs:
go-version: 1.22.x
- name: lint
run: make api-lint

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: '18.x'
check-latest: true
- name: Enforce consistent Yarn version
run: ./tools/install-yarn.sh
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ name: docs
on:
push:
branches:
- main
- main
pull_request:
branches:
- main
- main
paths:
- 'docs/**'
- .github/workflows/docs.yml
- "docs/**"
- .github/workflows/docs.yml
defaults:
run:
working-directory: ./docs/_website
jobs:
lint:
runs-on: ubuntu-latest
Expand All @@ -17,10 +20,10 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: "18.x"
check-latest: true
- name: Enforce consistent Yarn version
run: ./tools/install-yarn.sh
run: ../../tools/install-yarn.sh CWD bin=bin
- name: node_modules cache
id: node-modules-cache
uses: actions/cache@v4
Expand All @@ -30,6 +33,6 @@ jobs:
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn --cwd docs/_website install
run: ./bin/yarn.sh install --immutable
- name: lint
run: yarn --cwd docs/_website lint
run: ./bin/yarn.sh run lint
106 changes: 61 additions & 45 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,30 @@ name: frontend
on:
push:
branches:
- main
- main
pull_request:
branches:
- main
- main
paths:
- 'frontend/**'
- .github/workflows/frontend.yml
- Makefile
- tools/frontend-e2e.sh
- "frontend/**"
- .github/workflows/frontend.yml
- Makefile
- tools/frontend-e2e.sh
env:
FRONTEND_DIR: ./frontend
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: "18.x"
check-latest: true
- name: Enforce consistent Yarn version
run: ./tools/install-yarn.sh
run: make yarn-ensure
- name: node_modules cache
id: node-modules-cache
uses: actions/cache@v4
Expand All @@ -45,20 +48,21 @@ jobs:
key: ${{ runner.os }}-fe-build-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn --cwd frontend install
run: make yarn-install
- name: build
run: yarn --cwd frontend build
run: make frontend
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: "18.x"
check-latest: true
- name: Enforce consistent Yarn version
run: ./tools/install-yarn.sh
run: make yarn-ensure
- name: node_modules cache
id: node-modules-cache
uses: actions/cache@v4
Expand All @@ -68,27 +72,35 @@ jobs:
key: ${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn --cwd frontend install
run: make yarn-install
- name: Compile packages
run: yarn --cwd frontend compile:dev
- run: make frontend-lint
- run: make frontend-verify
- run: yarn --cwd frontend test:licenses
run: yarn run compile:dev
working-directory: ${{ env.FRONTEND_DIR }}
- name: Frontend Lint
run: make frontend-lint
- name: Frontend Verify
run: make frontend-verify
- name: Frontend Constraints
run: yarn constraints
working-directory: ${{ env.FRONTEND_DIR }}
- name: Frontend Test Licenses
run: yarn run test:licenses
working-directory: ${{ env.FRONTEND_DIR }}
test-e2e:
name: test e2e
name: Test [e2e]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
id: setup-go
with:
go-version: 1.22.x
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: "18.x"
check-latest: true
- name: Enforce consistent Yarn version
run: ./tools/install-yarn.sh
run: make yarn-ensure
- name: cypress cache
id: cypress-cache
uses: actions/cache@v4
Expand Down Expand Up @@ -123,30 +135,31 @@ jobs:
${{ runner.os }}-go-build-
- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn --cwd frontend install
run: make yarn-install
- name: Compile packages
run: yarn --cwd frontend compile:dev
run: yarn run compile:dev
working-directory: ${{ env.FRONTEND_DIR }}
- name: Test [e2e]
id: e2e
run: ./tools/frontend-e2e.sh
- name: Upload end-to-end artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure() && steps.e2e.outcome == 'failure'
with:
name: screenshots
path: ./frontend/packages/app/cypress/screenshots
test-unit:
name: test unit
name: Test [unit]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: "18.x"
check-latest: true
- name: Enforce consistent Yarn version
run: ./tools/install-yarn.sh
run: make yarn-ensure
- name: node_modules cache
id: node-modules-cache
uses: actions/cache@v4
Expand All @@ -156,25 +169,27 @@ jobs:
key: ${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn --cwd frontend install
run: make yarn-install
- name: Compile packages
run: yarn --cwd frontend compile:dev
run: yarn run compile:dev
working-directory: ${{ env.FRONTEND_DIR }}
- name: Test [unit]
run: yarn --cwd frontend test:coverage
run: yarn run test:coverage
working-directory: ${{ env.FRONTEND_DIR }}
publish:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: [build, lint, test-unit, test-e2e]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: "18.x"
check-latest: true
registry-url: 'https://registry.npmjs.org'
registry-url: "https://registry.npmjs.org"
- name: Enforce consistent Yarn version
run: ./tools/install-yarn.sh
run: make yarn-ensure
- name: node_modules cache
id: node-modules-cache
uses: actions/cache@v4
Expand All @@ -184,8 +199,9 @@ jobs:
key: ${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn --cwd frontend install
run: make yarn-install
- name: publish
run: yarn --cwd frontend publishBeta
run: yarn run publishBeta
working-directory: ${{ env.FRONTEND_DIR }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/scaffolding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
go-version: 1.22.x
- uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: '18.x'
check-latest: true
- name: scaffold new app
run: yes | go run scaffolder.go -m gateway -p ${{ github.sha }} -o ${{ github.repository_owner }}
Expand Down
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16
v18
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Frontend build.
FROM node:16.20.2-buster as nodebuild
FROM node:18.19.0-buster as nodebuild
COPY ./frontend ./frontend
COPY ./tools/install-yarn.sh ./tools/install-yarn.sh
COPY ./tools/preflight-checks.sh ./tools/preflight-checks.sh
Expand Down
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ api-lint-fix:
tools/compile-protos.sh -c "$(PROJECT_ROOT_DIR)/api" -lf

.PHONY: api-verify # Verify API proto changes include generate frontend and backend assets.
api-verify:
api-verify: yarn-ensure
find backend/api -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} \;
find frontend/api/src -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} \;
rm backend/internal/test/pb/*.go
Expand Down Expand Up @@ -78,7 +78,7 @@ backend-config-validation:

.PHONY: yarn-install # Install frontend dependencies.
yarn-install: yarn-ensure
$(YARN) --cwd frontend install --frozen-lockfile
$(YARN) --cwd frontend install --immutable

.PHONY: backend-integration-test
backend-integration-test:
Expand All @@ -93,7 +93,7 @@ frontend-dev-build: yarn-install
$(YARN) --cwd frontend build:dev

.PHONY: frontend-dev # Start the frontend in development mode.
frontend-dev: yarn-install
frontend-dev: setup-git-hooks yarn-install
$(YARN) --cwd frontend start

.PHONY: frontend-lint # Lint the frontend code.
Expand All @@ -118,11 +118,11 @@ frontend-verify: yarn-ensure

.PHONY: docs # Build all doc assets.
docs: docs-generate yarn-ensure
$(YARN) --cwd docs/_website install --frozen-lockfile && $(YARN) --cwd docs/_website build
$(YARN) --cwd docs/_website install --immutable && $(YARN) --cwd docs/_website build

.PHONY: docs-dev # Start the docs server in development mode.
docs-dev: docs-generate yarn-ensure
$(YARN) --cwd docs/_website install --frozen-lockfile && BROWSER=none $(YARN) --cwd docs/_website start
$(YARN) --cwd docs/_website install --immutable && BROWSER=none $(YARN) --cwd docs/_website start

.PHONY: docs-generate # Generate the documentation content.
docs-generate:
Expand Down Expand Up @@ -189,6 +189,10 @@ preflight-checks-frontend:
preflight-checks-backend:
@tools/preflight-checks.sh backend

.PHONY: setup-git-hooks
setup-git-hooks:
@tools/setup-git-hooks.sh

.PHONY: preflight-checks
preflight-checks:
@tools/preflight-checks.sh
Expand Down
1 change: 1 addition & 0 deletions clutch
Loading
Loading