Skip to content

Commit

Permalink
Use pnpm as package manager for react-router.
Browse files Browse the repository at this point in the history
The react-router project recently switched from yarn to pnpm which
  • Loading branch information
JohT committed May 27, 2024
1 parent 6cd422c commit 1fe5f83
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/typescript-code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
distribution: 'adopt'
java-version: ${{ matrix.java }}

- name: Setup Node.js for Graph Visualization
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: 'graph-visualization/.nvmrc'
Expand Down Expand Up @@ -112,6 +112,11 @@ jobs:
key:
${{ runner.os }}-${{ hashFiles('**/*.sh') }}

- name: Setup pnpm for react-router
uses: pnpm/[email protected]
with:
version: 8.10.5

- name: Download ${{ env.PROJECT_NAME }}-${{ env.REACT_ROUTER_VERSION }}
working-directory: temp
run: |
Expand Down
14 changes: 11 additions & 3 deletions scripts/downloader/downloadReactRouter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@

# Note: This script is meant to be started within the temporary analysis directory (e.g. "temp/AnalysisName/")

# Note: react-router uses pnpm as package manager which needs to be installed

# Requires downloadMavenArtifact.sh

# Fail on any error (errexit = exit on first error, errtrace = error inherited from sub-shell ,pipefail exist on errors within piped commands)
set -o errexit -o errtrace -o pipefail

# Get the analysis name from the middle part of the current file name (without prefix "download" and without extension)
SCRIPT_FILE_NAME="$(basename -- "${BASH_SOURCE[0]}")"
SCRIPT_FILE_NAME_WITHOUT_EXTENSION="${SCRIPT_FILE_NAME%%.*}"
Expand All @@ -29,15 +34,18 @@ fi
PROJECT_VERSION=$1
echo "download${ANALYSIS_NAME}: PROJECT_VERSION=${PROJECT_VERSION}"

# Create runtime logs directory if it hasn't existed yet
mkdir -p ./runtime/logs

################################################################
# Download react-router source files to be analyzed
################################################################
git clone https://github.com/remix-run/react-router.git source
(
cd source || exit
git checkout "react-router@${PROJECT_VERSION}"
yarn install || yarn
npx --yes @jqassistant/ts-lce >jqassostant-typescript-scan.log
git checkout "react-router@${PROJECT_VERSION}" || exit
pnpm install --frozen-lockfile || exit
npx --yes @jqassistant/ts-lce >./../runtime/logs/jqassostant-typescript-scan.log 2>&1 || exit
)
mkdir -p artifacts
mv -nv "source/.reports/jqa/ts-output.json" "artifacts/ts-react-router-${PROJECT_VERSION}.json"
Expand Down

0 comments on commit 1fe5f83

Please sign in to comment.