Skip to content

Commit 51a4f42

Browse files
committed
Scan Typescript directly from source without copy in artifacts
1 parent 0f54e40 commit 51a4f42

File tree

6 files changed

+9
-41
lines changed

6 files changed

+9
-41
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@ This could be as simple as running the following command in your Typescript proj
9191
npx --yes @jqassistant/ts-lce
9292
```
9393

94-
- It is recommended to put the cloned source code repository into a directory called `source` within the analysis workspace so that it will also be picked up to import git log data.
95-
96-
- Copy the resulting json file (e.g. `.reports/jqa/ts-output.json`) into the `artifacts/typescript` directory for your analysis work directory. Create the directory, if it doesn't exists. Custom subdirectories within `artifacts/typescript` are also supported.
94+
- The cloned repository or source project needs to be copied into the directory called `source` within the analysis workspace, so that it will also be picked up during scan by [resetAndScan.sh](./scripts/resetAndScan.sh) and optional [importGit.sh](./scripts/importGit.sh).
9795

9896
## :rocket: Getting Started
9997

scripts/configuration/template-neo4jv4-jqassistant.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ jqassistant:
9494
#
9595
# -Djqassistant.store.properties
9696
properties:
97-
json.file.exclude: "*/typescript/*.json"
9897

9998
# The Scanner configuration
10099
scan:
@@ -127,6 +126,7 @@ jqassistant:
127126
# -Djqassistant.scan.properties
128127
properties:
129128
# plugin.property.key: value
129+
json.file.exclude: "*/.reports/jqa/ts-output.json"
130130

131131
# The analyze configuration
132132
analyze:

scripts/configuration/template-neo4jv5-jqassistant.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jqassistant:
127127
# -Djqassistant.scan.properties
128128
properties:
129129
# plugin.property.key: value
130-
json.file.exclude: "*/typescript/*.json"
130+
json.file.exclude: "*/.reports/jqa/ts-output.json"
131131

132132
# The analyze configuration
133133
analyze:

scripts/downloader/downloadTypescriptProject.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,4 @@ fi
179179
usePackageManagerToInstallDependencies
180180
echo "downloadTypescriptProject: Scanning Typescript source using @jqassistant/ts-lce..."
181181
npx --yes @jqassistant/[email protected] --extension React >"./../../runtime/logs/jqassistant-typescript-scan-${projectName}.log" 2>&1 || exit
182-
)
183-
echo "downloadTypescriptProject: Moving scanned results into the artifacts/typescript directory..."
184-
mkdir -p artifacts/typescript
185-
mv -fv "${fullSourceDirectory}/.reports/jqa/ts-output.json" "artifacts/typescript/${fullProjectName}.json"
182+
)

scripts/findTypescriptDataFiles.sh

Lines changed: 0 additions & 29 deletions
This file was deleted.

scripts/resetAndScan.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# CAUTION: This script deletes all relationships and nodes in the Neo4j Graph Database.
66
# Note: The environment variable NEO4J_INITIAL_PASSWORD is required to login to Neo4j.
77

8-
# Requires findTypescriptDataFiles.sh, importGit.sh
8+
# Requires importGit.sh
99

1010
# Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands)
1111
set -o errexit -o pipefail
@@ -60,7 +60,7 @@ else
6060
echo "resetAndScan: jQAssistant configuration won't be changed since it already exists."
6161
fi
6262

63-
# Collect all files and directories to scan
63+
# -- Collect all files and directories to scan ---------------------
6464
directoriesAndFilesToScan=""
6565

6666
# Scan all files in the artifacts directory (e.g. *.ear, *.war, *.jar for Java)
@@ -69,11 +69,13 @@ if [ -d "${ARTIFACTS_DIRECTORY}" ] ; then
6969
fi
7070

7171
# Scan Typescript analysis json data files in the artifacts/typescript directory
72-
typescriptAnalysisFiles="$(source "${SCRIPTS_DIR}/findTypescriptDataFiles.sh")"
72+
typescriptAnalysisFiles="$(find . -type f -path "*/.reports/jqa/ts-output.json" -exec echo typescript:project::{} \; | tr '\n' ',' | sed 's/,$/\n/')"
7373
if [ -n "${typescriptAnalysisFiles}" ]; then
7474
directoriesAndFilesToScan="${directoriesAndFilesToScan},${typescriptAnalysisFiles}"
7575
fi
7676

77+
# ------------------------------------------------------------------
78+
7779
# Use jQAssistant to scan the downloaded artifacts and write the results into the separate, local Neo4j Graph Database
7880
echo "resetAndScan: Using jQAssistant CLI version ${JQASSISTANT_CLI_VERSION} to scan: ${directoriesAndFilesToScan}"
7981

0 commit comments

Comments
 (0)