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

Use pnpm as package manager for react-router #148

Merged
merged 3 commits into from
May 28, 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
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
4 changes: 2 additions & 2 deletions jupyter/NodeEmbeddingsTypescript.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
"source": [
"def prepare_node_embeddings_for_2d_visualization(embeddings: pd.DataFrame) -> pd.DataFrame:\n",
" \"\"\"\n",
" Reduces the dimensionality of the node embeddings (e.g. 64 floating point numbers in an array)\n",
" Reduces the dimensionality of the node embeddings (e.g. 32 floating point numbers in an array)\n",
" to two dimensions for 2D visualization.\n",
" see https://scikit-learn.org/stable/modules/generated/sklearn.manifold.TSNE.html#sklearn.manifold.TSNE\n",
" \"\"\"\n",
Expand Down Expand Up @@ -448,7 +448,7 @@
" \"dependencies_projection_node\": \"Module\",\n",
" \"dependencies_projection_weight_property\": \"lowCouplingElement25PercentWeight\",\n",
" \"dependencies_projection_write_property\": \"embeddingsHashGNN\",\n",
" \"dependencies_projection_embedding_dimension\":\"64\"\n",
" \"dependencies_projection_embedding_dimension\":\"32\"\n",
"}\n",
"embeddings = create_node_embeddings(\"../cypher/Node_Embeddings/Node_Embeddings_2d_Hash_GNN_Stream.cypher\", typescript_module_embeddings_parameters)\n",
"node_embeddings_for_visualization = prepare_node_embeddings_for_2d_visualization(embeddings)\n",
Expand Down
1 change: 1 addition & 0 deletions jupyter/OverviewJava.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@
"name": "JohT"
}
],
"code_graph_analysis_pipeline_data_validation": "ValidateJavaTypes",
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
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
2 changes: 1 addition & 1 deletion scripts/reports/NodeEmbeddingsCsv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ MODULE_PROJECTION="dependencies_projection=typescript-module-embeddings"
MODULE_NODE="dependencies_projection_node=Module"
MODULE_WEIGHT="dependencies_projection_weight_property=lowCouplingElement25PercentWeight"
MODULE_DIMENSIONS="dependencies_projection_embedding_dimension=32"
MODULE_DIMENSIONS_HASHGNN="dependencies_projection_embedding_dimension=64"
MODULE_DIMENSIONS_HASHGNN="dependencies_projection_embedding_dimension=32"

if createUndirectedDependencyProjection "${MODULE_PROJECTION}" "${MODULE_NODE}" "${MODULE_WEIGHT}"; then
time nodeEmbeddingsWithFastRandomProjection "${MODULE_PROJECTION}" "${MODULE_NODE}" "${MODULE_WEIGHT}" "${MODULE_DIMENSIONS}"
Expand Down