Skip to content
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
12 changes: 12 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,18 @@
"depNameTemplate": "jQAssistant/jqa-commandline-tool",
"datasourceTemplate": "github-tags",
"extractVersionTemplate": "^REL-?(?<version>.*?)$"
},
{
"fileMatch": [
"^scripts\/profiles\/Neo4jv5\\.sh$",
"^scripts\/profiles\/Default\\.sh$",
"^scripts\/[^\/]*\\.sh$"
],
"matchStrings": [
"npx --yes @jqassistant/ts-lce@?(?<currentValue>.*?)"
],
"depNameTemplate": "jqassistant-plugin/jqassistant-typescript-plugin",
"datasourceTemplate": "github-tags"
}
]
}
8 changes: 7 additions & 1 deletion scripts/configuration/template-neo4jv4-jqassistant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ jqassistant:
# version:
# classifier:
# type:

plugins:
- group-id: org.jqassistant.plugin.typescript
artifact-id: jqassistant-typescript-plugin
version: 1.0.0-RC1
- group-id: org.jqassistant.plugin
artifact-id: jqassistant-npm-plugin
version: 2.0.0
# The store configuration
store:
# URI of the database to connect to. Supported URI schemes are 'file' for embedded databases and 'bolt' for connecting to a running Neo4j instance (3.x+), e.g.
Expand Down
5 changes: 4 additions & 1 deletion scripts/configuration/template-neo4jv5-jqassistant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ jqassistant:
- group-id: org.jqassistant.plugin.typescript
artifact-id: jqassistant-typescript-plugin
version: 1.0.0-RC1

- group-id: org.jqassistant.plugin
artifact-id: jqassistant-npm-plugin
version: 2.0.0

# The store configuration
store:
# URI of the database to connect to. Supported URI schemes are 'file' for embedded databases and 'bolt' for connecting to a running Neo4j instance (3.x+), e.g.
Expand Down
42 changes: 42 additions & 0 deletions scripts/copyPackageJsonFiles.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash

# Copies all package.json files inside the source directory into the artifacts/npm-package-json directory.
# It retains the original folder structure where the package.json files were in.

# This script "jq" ( https://stedolan.github.io/jq ).

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

# Overrideable Defaults
ARTIFACTS_DIRECTORY=${ARTIFACTS_DIRECTORY:-"artifacts"}
SOURCE_DIRECTORY=${SOURCE_DIRECTORY:-"source"}
NPM_PACKAGE_JSON_ARTIFACTS_DIRECTORY=${NPM_PACKAGE_JSON_ARTIFACTS_DIRECTORY:-"npm-package-json"} # Subdirectory of "artifacts" containing the npm package.json files to scan

# Check if the repository is actually a git repository
if [ ! -d "${SOURCE_DIRECTORY}" ]; then
echo "copyPackageJsonFiles: No ${SOURCE_DIRECTORY} directory. Skipping copy of package.json files."
return 0
fi

(
cd "./${SOURCE_DIRECTORY}"

echo "copyPackageJsonFiles: Existing package.json files will be copied from from ${SOURCE_DIRECTORY} to ../${ARTIFACTS_DIRECTORY}/${NPM_PACKAGE_JSON_ARTIFACTS_DIRECTORY}"
echo "copyPackageJsonFiles: Author will be removed as workaround for https://github.com/jqassistant-plugin/jqassistant-npm-plugin/issues/5"

for file in $( find . -path ./node_modules -prune -o -name 'package.json' -print0 | xargs -0 -r -I {}); do
fileDirectory=$(dirname "${file}")
targetDirectory="../${ARTIFACTS_DIRECTORY}/${NPM_PACKAGE_JSON_ARTIFACTS_DIRECTORY}/${fileDirectory}"
# echo "copyPackageJsonFiles: Copying ${file} to ${targetDirectory}"

mkdir -p "${targetDirectory}"
cp "${file}" "${targetDirectory}"

# Workaround until the following issue is resolved:
# https://github.com/jqassistant-plugin/jqassistant-npm-plugin/issues/5
fileName=$(basename "${file}")
jq 'del(.author)' "${targetDirectory}/${fileName}" > "${targetDirectory}/${fileName}.edited"
jq 'del(.contributors)' "${targetDirectory}/${fileName}.edited" > "${targetDirectory}/${fileName}"
done
)
2 changes: 1 addition & 1 deletion scripts/downloader/downloadTypescriptProject.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ fi
cd "${fullSourceDirectory}" || exit
usePackageManagerToInstallDependencies
echo "downloadTypescriptProject: Scanning Typescript source using @jqassistant/ts-lce..."
npx --yes @jqassistant/ts-lce >"./../../runtime/logs/jqassistant-typescript-scan-${projectName}.log" 2>&1 || exit
npx --yes @jqassistant/ts-lce@1.2.0 >"./../../runtime/logs/jqassistant-typescript-scan-${projectName}.log" 2>&1 || exit
)
echo "downloadTypescriptProject: Moving scanned results into the artifacts/typescript directory..."
mkdir -p artifacts/typescript
Expand Down
3 changes: 3 additions & 0 deletions scripts/importGit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ postAggregatedGitLogImport() {
execute_cypher "${GIT_LOG_CYPHER_DIR}/Set_number_of_aggregated_git_commits.cypher"
}

# Create import directory in case it doesn't exist.
mkdir -p "${IMPORT_DIRECTORY}"

# Internal constants
NEO4J_FULL_IMPORT_DIRECTORY=$(cd "${IMPORT_DIRECTORY}"; pwd)

Expand Down
5 changes: 4 additions & 1 deletion scripts/resetAndScanChanged.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Note: "resetAndScan" expects jQAssistant to be installed in the "tools" directory.

# Requires resetAndScan.sh
# Requires resetAndScan.sh, copyPackageJsonFiles.sh

# Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands)
set -o errexit -o pipefail
Expand All @@ -16,6 +16,9 @@ set -o errexit -o pipefail
SCRIPTS_DIR=${SCRIPTS_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )} # Repository directory containing the shell scripts
echo "resetAndScanChanged SCRIPTS_DIR=${SCRIPTS_DIR}"

# Copy
source "${SCRIPTS_DIR}/copyPackageJsonFiles.sh"

# Scan and analyze Artifacts when they were changed
changeDetectionReturnCode=$( source "${SCRIPTS_DIR}/detectChangedArtifacts.sh" --readonly)
if [[ "${changeDetectionReturnCode}" == "0" ]] ; then
Expand Down