Skip to content

Commit 77f4488

Browse files
committed
Use 'artifacts/typescript' for Typescript analysis json files.
Configure the jQAssistant json plugin so that it ignores those files. Otherwise they will be imported as json and as Typescript nodes.
1 parent d9f29c4 commit 77f4488

File tree

7 files changed

+32
-17
lines changed

7 files changed

+32
-17
lines changed

GETTING_STARTED.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,35 @@ Please read through the [Prerequisites](./README.md#hammer_and_wrench-prerequisi
1010

1111
## Start an analysis
1212

13-
1. Create a directory for all analysis projects
13+
1. Create a directory for all analysis projects.
1414

1515
```shell
1616
mkdir temp
1717
cd temp
1818
```
1919

20-
1. Create a working directory for your specific analysis
20+
1. Create a working directory for your specific analysis.
2121

2222
```shell
2323
mkdir MyFirstAnalysis
2424
cd MyFirstAnalysis
2525
```
2626

27-
1. Choose an initial password for Neo4j if not already done
27+
1. Choose an initial password for Neo4j if not already done.
2828

2929
```shell
3030
export NEO4J_INITIAL_PASSWORD=theinitialpasswordthatihavechosenforneo4j
3131
```
3232

33-
1. Create the `artifacts` directory for the code to be analyzed (without `cd` afterwards)
33+
1. Create the `artifacts` directory for the code to be analyzed (without `cd` afterwards).
3434

3535
```shell
3636
mkdir artifacts
3737
```
3838

39-
1. Move the artifacts (Java jar or Typescript analysis json files) you want to analyze into the `artifacts` directory
39+
1. Move the artifacts (e.g. Java jars json files) you want to analyze into the `artifacts` directory.
40+
41+
1. Optionally, create a subdirectory `typescript` inside the `artifacts` directory and move the Typescript analysis json files you want to analyze into it.
4042

4143
1. Optionally, create a `source` directory and clone the corresponding source code into it to also gather git log data.
4244

@@ -46,9 +48,9 @@ Please read through the [Prerequisites](./README.md#hammer_and_wrench-prerequisi
4648
./../../scripts/downloader/downloadAxonFramework.sh <version>
4749
```
4850

49-
1. Optionally use a script to download artifacts from Maven ([details](./COMMANDS.md#download-maven-artifacts-to-analyze))
51+
1. Optionally use a script to download artifacts from Maven ([details](./COMMANDS.md#download-maven-artifacts-to-analyze)).
5052

51-
1. Start the analysis
53+
1. Start the analysis.
5254

5355
- Without any additional dependencies:
5456

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ This could be as simple as running the following command in your Typescript proj
9393

9494
- 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.
9595

96-
- Copy the resulting json file (e.g. `.reports/jqa/ts-output.json`) into the `artifacts` directory for your analysis work directory. Custom subdirectories within `artifacts` are also supported.
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.
9797

9898
## :rocket: Getting Started
9999

scripts/configuration/template-neo4jv4-jqassistant.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ jqassistant:
8888
#
8989
# -Djqassistant.store.properties
9090
properties:
91+
json.file.exclude: "*/typescript/*.json"
9192

9293
# The Scanner configuration
9394
scan:

scripts/configuration/template-neo4jv5-jqassistant.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ jqassistant:
124124
# -Djqassistant.scan.properties
125125
properties:
126126
# plugin.property.key: value
127+
json.file.exclude: "*/typescript/*.json"
127128

128129
# The analyze configuration
129130
analyze:

scripts/downloader/downloadAntDesign.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ fi
4747
echo "download${ANALYSIS_NAME}: Analyzing source..."
4848
npx --yes @jqassistant/ts-lce >./../runtime/logs/jqassistant-typescript-scan.log 2>&1 || exit
4949
)
50-
mkdir -p artifacts
51-
mv -nv "${SOURCE_DIRECTORY}/.reports/jqa/ts-output.json" "artifacts/ts-ant-design-${PROJECT_VERSION}.json"
50+
mkdir -p artifacts/typescript
51+
mv -nv "${SOURCE_DIRECTORY}/.reports/jqa/ts-output.json" "artifacts/typescript/ant-design-${PROJECT_VERSION}.json"
5252
################################################################

scripts/downloader/downloadReactRouter.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ git clone https://github.com/remix-run/react-router.git "${SOURCE_DIRECTORY}"
4646
pnpm install --frozen-lockfile || exit
4747
npx --yes @jqassistant/ts-lce >./../runtime/logs/jqassistant-typescript-scan.log 2>&1 || exit
4848
)
49-
mkdir -p artifacts
50-
mv -nv "${SOURCE_DIRECTORY}/.reports/jqa/ts-output.json" "artifacts/ts-react-router-${PROJECT_VERSION}.json"
49+
mkdir -p artifacts/typescript
50+
mv -nv "${SOURCE_DIRECTORY}/.reports/jqa/ts-output.json" "artifacts/typescript/react-router-${PROJECT_VERSION}.json"
5151
################################################################

scripts/findTypescriptDataFiles.sh

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
11
#!/usr/bin/env bash
22

3-
# Echoes a list of Typescript data files starting with "ts-" and having extension "json" in the artifacts directory of sub directories.
3+
# Echoes a list of Typescript analysis data json files in the directory "artifacts/typescript" or subdirectories and having extension "json".
44
# Each name will be prefixed by "typescript:project::"and separated by one space character.
55
# This list is meant to be used after the "-f" line command option for the jQAssistant scan command to include Typescript data files.
6+
# Note: The directory name "typescript" (env TYPESCRIPT_ARTIFACTS_DIRECTORY) within "artifacts" is a convention
7+
# that is then also used to exclude those json files from being analyzed by the json plugin.
68

79
# Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands)
810
set -o errexit -o pipefail
911

10-
ARTIFACTS_DIRECTORY=${ARTIFACTS_DIRECTORY:-"artifacts"}
12+
ARTIFACTS_DIRECTORY=${ARTIFACTS_DIRECTORY:-"artifacts"} # Working directory containing the artifacts to be analyzed
13+
TYPESCRIPT_ARTIFACTS_DIRECTORY=${TYPESCRIPT_ARTIFACTS_DIRECTORY:-"typescript"} # Subdirectory of "artifacts" containing the typescript analysis result json files for import
1114

1215
# Check if the artifacts directory exists
1316
if [ ! -d "./${ARTIFACTS_DIRECTORY}" ] ; then
14-
echo "" # The artifact directory doesn't exist. There is no file at all.
15-
exit 0
17+
echo "findTypescriptDataFiles: No files to analyze because of missing directory ${ARTIFACTS_DIRECTORY}" >&2
18+
echo "" # The artifact directory doesn't exist. There is no file to analyze.
19+
return 0
1620
fi
1721

18-
find "./${ARTIFACTS_DIRECTORY}" -type f -name 'ts-*.json' -exec echo {} \; | sed 's/^/typescript:project::/' | tr '\n' ' '
22+
# Check if there is a typescript directory within the artifacts directory
23+
if [ ! -d "./${ARTIFACTS_DIRECTORY}/${TYPESCRIPT_ARTIFACTS_DIRECTORY}" ] ; then
24+
echo "findTypescriptDataFiles: No files to analyze because of missing directory ${ARTIFACTS_DIRECTORY}/${TYPESCRIPT_ARTIFACTS_DIRECTORY}" >&2
25+
echo "" # The directory artifact/typescript doesn't exist. There is no file to analyze.
26+
return 0
27+
fi
28+
29+
find "./${ARTIFACTS_DIRECTORY}/${TYPESCRIPT_ARTIFACTS_DIRECTORY}" -type f -name '*.json' -exec echo {} \; | sed 's/^/typescript:project::/' | tr '\n' ' '

0 commit comments

Comments
 (0)