@sonar/scan
Version:
SonarQube/SonarCloud Scanner for the JavaScript world
67 lines (66 loc) • 4.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SCANNER_DEPRECATED_PROPERTIES = exports.WINDOWS_WHERE_EXE_PATH = exports.SCANNER_CLI_INSTALL_PATH = exports.SCANNER_CLI_MIRROR = exports.SCANNER_CLI_VERSION = exports.SCANNER_CLI_DEFAULT_BIN_NAME = exports.API_OLD_VERSION_ENDPOINT = exports.API_V2_SCANNER_ENGINE_ENDPOINT = exports.API_V2_JRE_ENDPOINT = exports.API_V2_VERSION_ENDPOINT = exports.DEFAULT_SONAR_EXCLUSIONS = exports.SONAR_PROJECT_FILENAME = exports.ENV_TO_PROPERTY_NAME = exports.NPM_CONFIG_ENV_VAR_PREFIX = exports.ENV_VAR_PREFIX = exports.JRE_ALIAS = exports.SONAR_SCANNER_ALIAS = exports.UNARCHIVE_SUFFIX = exports.SONAR_CACHE_DIR = exports.SONAR_DIR_DEFAULT = exports.SONARQUBE_JRE_PROVISIONING_MIN_VERSION = exports.REGIONS = exports.REGION_US = exports.SONARCLOUD_US_URL_REGEX = exports.SONARCLOUD_URL_REGEX = exports.SONARCLOUD_API_BASE_URL_US = exports.SONARCLOUD_API_BASE_URL = exports.SONARCLOUD_URL_US = exports.SONARCLOUD_URL = exports.SCANNER_BOOTSTRAPPER_NAME = void 0;
/*
* sonar-scanner-npm
* Copyright (C) 2022-2025 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
const types_1 = require("./types");
exports.SCANNER_BOOTSTRAPPER_NAME = 'ScannerNpm';
exports.SONARCLOUD_URL = 'https://sonarcloud.io';
exports.SONARCLOUD_URL_US = 'https://sonarqube.us';
exports.SONARCLOUD_API_BASE_URL = 'https://api.sonarcloud.io';
exports.SONARCLOUD_API_BASE_URL_US = 'https://api.sonarqube.us';
exports.SONARCLOUD_URL_REGEX = /^(https?:\/\/)?(www\.)?(sonarcloud\.io)/;
exports.SONARCLOUD_US_URL_REGEX = /^(https?:\/\/)?(www\.)?(sonarqube\.us)/;
exports.REGION_US = 'us';
exports.REGIONS = [exports.REGION_US];
exports.SONARQUBE_JRE_PROVISIONING_MIN_VERSION = '10.6';
exports.SONAR_DIR_DEFAULT = '.sonar';
exports.SONAR_CACHE_DIR = 'cache';
exports.UNARCHIVE_SUFFIX = '_extracted';
exports.SONAR_SCANNER_ALIAS = 'SonarScanner Engine';
exports.JRE_ALIAS = 'JRE';
exports.ENV_VAR_PREFIX = 'SONAR_SCANNER_';
exports.NPM_CONFIG_ENV_VAR_PREFIX = 'npm_config_sonar_scanner_';
exports.ENV_TO_PROPERTY_NAME = [
['SONAR_BINARY_CACHE', types_1.ScannerProperty.SonarUserHome], // old deprecated format
['SONAR_TOKEN', types_1.ScannerProperty.SonarToken],
['SONAR_HOST_URL', types_1.ScannerProperty.SonarHostUrl],
['SONAR_USER_HOME', types_1.ScannerProperty.SonarUserHome],
['SONAR_ORGANIZATION', types_1.ScannerProperty.SonarOrganization],
];
exports.SONAR_PROJECT_FILENAME = 'sonar-project.properties';
exports.DEFAULT_SONAR_EXCLUSIONS = 'node_modules/**,bower_components/**,jspm_packages/**,typings/**,lib-cov/**';
exports.API_V2_VERSION_ENDPOINT = '/analysis/version';
exports.API_V2_JRE_ENDPOINT = '/analysis/jres';
exports.API_V2_SCANNER_ENGINE_ENDPOINT = '/analysis/engine';
exports.API_OLD_VERSION_ENDPOINT = '/api/server/version';
exports.SCANNER_CLI_DEFAULT_BIN_NAME = 'sonar-scanner';
exports.SCANNER_CLI_VERSION = '6.2.1.4610';
exports.SCANNER_CLI_MIRROR = 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/';
exports.SCANNER_CLI_INSTALL_PATH = 'native-sonar-scanner';
exports.WINDOWS_WHERE_EXE_PATH = 'C:\\Windows\\System32\\where.exe';
exports.SCANNER_DEPRECATED_PROPERTIES = [
[types_1.ScannerProperty.SonarWsTimeout, types_1.ScannerProperty.SonarScannerResponseTimeout],
[types_1.ScannerProperty.HttpProxyHost, types_1.ScannerProperty.SonarScannerProxyHost],
[types_1.ScannerProperty.HttpProxyPort, types_1.ScannerProperty.SonarScannerProxyPort],
[types_1.ScannerProperty.HttpProxyUser, types_1.ScannerProperty.SonarScannerProxyUser],
[types_1.ScannerProperty.HttpProxyPassword, types_1.ScannerProperty.SonarScannerProxyPassword],
[types_1.ScannerProperty.SonarLogin, types_1.ScannerProperty.SonarToken],
];