How to use the @microsoft/api-extractor.ExtractorConfig.prepare function in @microsoft/api-extractor

To help you get started, we’ve selected a few @microsoft/api-extractor 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 angular / angular / packages / bazel / src / api-extractor / index.ts View on Github external
enabled: !!dtsBundleOut,
      untrimmedFilePath: dtsBundleOut && path.resolve(dtsBundleOut),
    },
    tsdocMetadata: {
      enabled: false,
    }
  };

  const options: IExtractorConfigPrepareOptions = {
    configObject,
    packageJson: undefined,
    packageJsonFullPath: pkgJson,
    configObjectFullPath: undefined,
  };

  const extractorConfig = ExtractorConfig.prepare(options);
  const {succeeded} = Extractor.invoke(extractorConfig, extractorOptions);

  // API extractor errors are emitted by it's logger.
  return succeeded ? 0 : 1;
}
github SkygearIO / skygear-SDK-JS / scripts / dts.js View on Github external
const configObject = ExtractorConfig.loadFile(
    path.join(projectRoot, "api-extractor.json")
  );
  configObject.mainEntryPointFilePath = entrypoint;
  configObject.projectFolder = path.join(projectRoot, `packages/${p}`);
  configObject.dtsRollup.enabled = true;
  configObject.dtsRollup.untrimmedFilePath = path.join(
    projectRoot,
    `packages/${p}/index.d.ts`
  );
  configObject.docModel.apiJsonFilePath = path.join(
    projectRoot,
    `temp/${p}.api.json`
  );

  const extractorConfig = ExtractorConfig.prepare({
    configObject,
    packageJsonFullPath: path.join(projectRoot, `packages/${p}/package.json`),
  });

  const extractorResult = Extractor.invoke(extractorConfig, {
    localBuild: true,
    showVerboseMessages: true,
  });

  if (
    !extractorResult.succeeded ||
    extractorResult.errorCount > 0 ||
    extractorResult.warningCount > 0
  ) {
    console.error(
      `API Extractor completed with ${extractorResult.errorCount} errors` +
github strongloop / loopback-next / packages / tsdocs / src / monorepo-api-extractor.ts View on Github external
function buildExtractorConfig(pkg: LernaPackage, options: ExtractorOptions) {
  const configObj: IConfigFile = createRawExtractorConfig(pkg, options);
  const extractorConfig = ExtractorConfig.prepare({
    configObject: configObj,
    configObjectFullPath: '',
    packageJsonFullPath: pkg.manifestLocation,
  });
  return extractorConfig;
}
github elastic / kibana / src / dev / run_check_core_api_changes.ts View on Github external
enabled: false,
    },
    messages: {
      extractorMessageReporting: {
        default: {
          logLevel: 'warning' as ExtractorLogLevel.Warning,
          addToApiReportFile: true,
        },
        'ae-internal-missing-underscore': {
          logLevel: 'none' as ExtractorLogLevel.None,
          addToApiReportFile: false,
        },
      },
    },
  };
  const con = ExtractorConfig.prepare({
    configObject: config,
    configObjectFullPath: undefined,
    packageJsonFullPath: path.resolve('package.json'),
  });

  return con;
};