How to use the @ts-common/azure-js-dev-tools.resolvePath function in @ts-common/azure-js-dev-tools

To help you get started, we’ve selected a few @ts-common/azure-js-dev-tools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-sdk-for-js / .scripts / checkEverything.ts View on Github external
}

if (baseReference !== headReference) {
  const diffResult: GitDiffResult = gitDiff(baseReference, headReference);
  changedFiles.push(...diffResult.filesChanged);
  if (!changedFiles || changedFiles.length === 0) {
    logger.logInfo(`Found no changes between "${baseReference}" and "${headReference}".`);
  } else {
    logger.logVerbose(`Found the following changed files`)
    for (const changedFilePath of changedFiles) {
      logger.logVerbose(changedFilePath);
    }
  }
}

const repositoryFolderPath: string = resolvePath(__dirname, "..");
const packagesFolderPath: string = joinPath(repositoryFolderPath, "sdk");
const packageFolderPaths: string[] | undefined = getPackageFolderPaths(packagesFolderPath);

let exitCode: number = 0;
if (!packageFolderPaths) {
  logger.logError(`The packages folder (${packagesFolderPath}) doesn't exist.`);
} else {
  logger.logVerbose(`Found ${packageFolderPaths.length} package folders.`);
  for (const packageFolderPath of packageFolderPaths) {
    const packageFolderPathWithSep: string = normalize(packageFolderPath + path.posix.sep);
    const shouldCheck = !!changedFiles && contains(changedFiles, (changedFilePath: string) => normalize(changedFilePath).startsWith(packageFolderPathWithSep));
    if (shouldCheck) {
      exitCode += checkEverything({
        logger,
        checkPackageJsonVersionOptions: {
          startPath: packageFolderPath
github Azure / azure-sdk-for-js / .scripts / local.ts View on Github external
import { resolvePath, changeClonedDependenciesTo } from "@ts-common/azure-js-dev-tools";

const packagePath: string = resolvePath(__dirname, "..");
changeClonedDependenciesTo(packagePath, "local");
github Azure / autorest.typescript / .scripts / dependenciesOptions.ts View on Github external
import { ChangeClonedDependenciesToOptions, joinPath, resolvePath, Logger, getDefaultLogger, wrapLogger } from "@ts-common/azure-js-dev-tools";

const repositoryFolderPath: string = resolvePath(__dirname, "..");
const testFolderPath: string = joinPath(repositoryFolderPath, "test");
const multiapiFolderPath: string = joinPath(testFolderPath, "multiapi");
const multiapiPackagesFolderPath: string = joinPath(multiapiFolderPath, "packages");
export const dependenciesOptions: ChangeClonedDependenciesToOptions = {
  packageFolders: [
    {
      path: repositoryFolderPath,
      dependenciesToIgnore: ["autorest"]
    },
    joinPath(testFolderPath, "azuremetadata/generated/Lro"),
    joinPath(testFolderPath, "metadata/generated/BodyComplex"),
    {
      path: joinPath(multiapiPackagesFolderPath, "multiapi-test-2018-02-01"),
      runNPMInstall: false
    },
    {