MCPcopy Index your code
hub / github.com/nodejs/node / createBuildOrUpdateInvalidedProject

Function createBuildOrUpdateInvalidedProject

test/fixtures/snapshot/typescript.js:124487–124791  ·  view source on GitHub ↗
(kind, state, project, projectPath, projectIndex, config, buildOrder)

Source from the content-addressed store, hash-verified

124485 BuildStep[BuildStep["Done"] = 8] = "Done";
124486 })(BuildStep || (BuildStep = {}));
124487 function createBuildOrUpdateInvalidedProject(kind, state, project, projectPath, projectIndex, config, buildOrder) {
124488 var step = kind === InvalidatedProjectKind.Build ? BuildStep.CreateProgram : BuildStep.EmitBundle;
124489 var program;
124490 var buildResult;
124491 var invalidatedProjectOfBundle;
124492 return kind === InvalidatedProjectKind.Build ?
124493 {
124494 kind: kind,
124495 project: project,
124496 projectPath: projectPath,
124497 buildOrder: buildOrder,
124498 getCompilerOptions: function () { return config.options; },
124499 getCurrentDirectory: function () { return state.currentDirectory; },
124500 getBuilderProgram: function () { return withProgramOrUndefined(ts.identity); },
124501 getProgram: function () {
124502 return withProgramOrUndefined(function (program) { return program.getProgramOrUndefined(); });
124503 },
124504 getSourceFile: function (fileName) {
124505 return withProgramOrUndefined(function (program) { return program.getSourceFile(fileName); });
124506 },
124507 getSourceFiles: function () {
124508 return withProgramOrEmptyArray(function (program) { return program.getSourceFiles(); });
124509 },
124510 getOptionsDiagnostics: function (cancellationToken) {
124511 return withProgramOrEmptyArray(function (program) { return program.getOptionsDiagnostics(cancellationToken); });
124512 },
124513 getGlobalDiagnostics: function (cancellationToken) {
124514 return withProgramOrEmptyArray(function (program) { return program.getGlobalDiagnostics(cancellationToken); });
124515 },
124516 getConfigFileParsingDiagnostics: function () {
124517 return withProgramOrEmptyArray(function (program) { return program.getConfigFileParsingDiagnostics(); });
124518 },
124519 getSyntacticDiagnostics: function (sourceFile, cancellationToken) {
124520 return withProgramOrEmptyArray(function (program) { return program.getSyntacticDiagnostics(sourceFile, cancellationToken); });
124521 },
124522 getAllDependencies: function (sourceFile) {
124523 return withProgramOrEmptyArray(function (program) { return program.getAllDependencies(sourceFile); });
124524 },
124525 getSemanticDiagnostics: function (sourceFile, cancellationToken) {
124526 return withProgramOrEmptyArray(function (program) { return program.getSemanticDiagnostics(sourceFile, cancellationToken); });
124527 },
124528 getSemanticDiagnosticsOfNextAffectedFile: function (cancellationToken, ignoreSourceFile) {
124529 return withProgramOrUndefined(function (program) {
124530 return (program.getSemanticDiagnosticsOfNextAffectedFile) &&
124531 program.getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile);
124532 });
124533 },
124534 emit: function (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {
124535 if (targetSourceFile || emitOnlyDtsFiles) {
124536 return withProgramOrUndefined(function (program) { var _a, _b; return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); });
124537 }
124538 executeSteps(BuildStep.SemanticDiagnostics, cancellationToken);
124539 if (step === BuildStep.EmitBuildInfo) {
124540 return emitBuildInfo(writeFile, cancellationToken);
124541 }
124542 if (step !== BuildStep.Emit)
124543 return undefined;
124544 return emit(writeFile, cancellationToken, customTransformers);

Callers 2

emitBundleFunction · 0.85

Calls 8

withProgramOrUndefinedFunction · 0.85
withProgramOrEmptyArrayFunction · 0.85
executeStepsFunction · 0.85
emitBuildInfoFunction · 0.85
emitBundleFunction · 0.85
emitFunction · 0.70
emitMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…