Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fork-ts-checker-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
222
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fork-ts-checker-webpack-plugin - npm Package Compare versions

Comparing version 6.1.1 to 7.0.0-alpha.1

lib/typescript-reporter/reporter/ControlledCompilerHost.d.ts

2

lib/ForkTsCheckerWebpackPlugin.js

@@ -68,3 +68,3 @@ "use strict";

*/
ForkTsCheckerWebpackPlugin.version = '6.1.1'; // will be replaced by the @semantic-release/exec
ForkTsCheckerWebpackPlugin.version = '7.0.0-alpha.1'; // will be replaced by the @semantic-release/exec
/**

@@ -71,0 +71,0 @@ * Default pool for the plugin concurrency limit

@@ -34,3 +34,3 @@ "use strict";

hooks.waiting.call(stats.compilation);
configuration.logger.issues.log(chalk_1.default.cyan('Issues checking in progress...'));
configuration.logger.issues.log(chalk_1.default.blue('Issues checking in progress...'));
}

@@ -37,0 +37,0 @@ else {

@@ -79,3 +79,3 @@ "use strict";

}
const report = yield reporter.getReport(change);
const report = yield reporter.getReport(change, state.watching);
resolve(report);

@@ -82,0 +82,0 @@ report

@@ -21,3 +21,3 @@ "use strict";

let queuedChanges = [];
const aggregatedReporter = Object.assign(Object.assign({}, reporter), { getReport: (change) => __awaiter(this, void 0, void 0, function* () {
const aggregatedReporter = Object.assign(Object.assign({}, reporter), { getReport: (change, watching) => __awaiter(this, void 0, void 0, function* () {
if (!pendingPromise) {

@@ -32,3 +32,3 @@ let resolvePending;

return reporter
.getReport(change)
.getReport(change, watching)
.then((report) => (Object.assign(Object.assign({}, report), { close() {

@@ -52,3 +52,3 @@ return __awaiter(this, void 0, void 0, function* () {

queuedChanges = [];
return aggregatedReporter.getReport(change);
return aggregatedReporter.getReport(change, watching);
}

@@ -55,0 +55,0 @@ else {

@@ -39,4 +39,4 @@ "use strict";

}),
getReport: (change) => __awaiter(this, void 0, void 0, function* () {
const reportId = yield rpcClient.dispatchCall(ReporterRpcProcedure_1.getReport, change);
getReport: (change, watching) => __awaiter(this, void 0, void 0, function* () {
const reportId = yield rpcClient.dispatchCall(ReporterRpcProcedure_1.getReport, { change, watching });
return {

@@ -62,3 +62,3 @@ getDependencies() {

disconnect: () => Promise.all(clients.map((client) => client.disconnect())).then(() => undefined),
getReport: (change) => Promise.all(clients.map((client) => client.getReport(change))).then((reports) => ({
getReport: (change, watching) => Promise.all(clients.map((client) => client.getReport(change, watching))).then((reports) => ({
getDependencies: () => Promise.all(reports.map((report) => report.getDependencies())).then((dependencies) => dependencies.reduce((mergedDependencies, singleDependencies) => ({

@@ -65,0 +65,0 @@ files: Array.from(new Set([...mergedDependencies.files, ...singleDependencies.files])),

@@ -6,3 +6,6 @@ import { RpcProcedure } from '../../rpc';

declare const configure: RpcProcedure<object, void>;
declare const getReport: RpcProcedure<FilesChange, void>;
declare const getReport: RpcProcedure<{
change: FilesChange;
watching: boolean;
}, void>;
declare const getDependencies: RpcProcedure<void, Dependencies>;

@@ -9,0 +12,0 @@ declare const getIssues: RpcProcedure<void, Issue[]>;

@@ -22,7 +22,7 @@ "use strict";

const reporter = reporterFactory(configuration);
rpcService.addCallHandler(ReporterRpcProcedure_1.getReport, (change) => __awaiter(this, void 0, void 0, function* () {
rpcService.addCallHandler(ReporterRpcProcedure_1.getReport, ({ change, watching }) => __awaiter(this, void 0, void 0, function* () {
if (report) {
throw new Error(`Close previous report before opening the next one.`);
}
report = yield reporter.getReport(change);
report = yield reporter.getReport(change, watching);
}));

@@ -29,0 +29,0 @@ rpcService.addCallHandler(ReporterRpcProcedure_1.getDependencies, () => {

import { FilesChange } from './FilesChange';
import { Report } from './Report';
interface Reporter {
getReport(change: FilesChange): Promise<Report>;
getReport(change: FilesChange, watching: boolean): Promise<Report>;
}
export { Reporter };

@@ -11,2 +11,9 @@ "use strict";

};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -16,2 +23,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

Object.defineProperty(exports, "__esModule", { value: true });
const ts = __importStar(require("typescript"));
const path_1 = __importDefault(require("path"));

@@ -26,2 +34,3 @@ const TypeScriptIssueFactory_1 = require("../issue/TypeScriptIssueFactory");

const TypeScriptPerformance_1 = require("../profile/TypeScriptPerformance");
const ControlledCompilerHost_1 = require("./ControlledCompilerHost");
function createTypeScriptReporter(configuration) {

@@ -32,4 +41,6 @@ let parsedConfiguration;

let configurationChanged = false;
let compilerHost;
let watchCompilerHost;
let watchSolutionBuilderHost;
let program;
let watchProgram;

@@ -57,7 +68,7 @@ let solutionBuilder;

}
function getDiagnosticsOfBuilderProgram(builderProgram) {
function getDiagnosticsOfProgram(program) {
const diagnostics = [];
if (configuration.diagnosticOptions.syntactic) {
performance.markStart('Syntactic Diagnostics');
diagnostics.push(...builderProgram.getSyntacticDiagnostics());
diagnostics.push(...program.getSyntacticDiagnostics());
performance.markEnd('Syntactic Diagnostics');

@@ -67,3 +78,3 @@ }

performance.markStart('Global Diagnostics');
diagnostics.push(...builderProgram.getGlobalDiagnostics());
diagnostics.push(...program.getGlobalDiagnostics());
performance.markEnd('Global Diagnostics');

@@ -73,3 +84,3 @@ }

performance.markStart('Semantic Diagnostics');
diagnostics.push(...builderProgram.getSemanticDiagnostics());
diagnostics.push(...program.getSemanticDiagnostics());
performance.markEnd('Semantic Diagnostics');

@@ -79,3 +90,3 @@ }

performance.markStart('Declaration Diagnostics');
diagnostics.push(...builderProgram.getDeclarationDiagnostics());
diagnostics.push(...program.getDeclarationDiagnostics());
performance.markEnd('Declaration Diagnostics');

@@ -166,3 +177,3 @@ }

return {
getReport: ({ changedFiles = [], deletedFiles = [] }) => __awaiter(this, void 0, void 0, function* () {
getReport: ({ changedFiles = [], deletedFiles = [] }, watching) => __awaiter(this, void 0, void 0, function* () {
// clear cache to be ready for next iteration and to free memory

@@ -176,4 +187,6 @@ system.clearCache();

dependencies = undefined;
compilerHost = undefined;
watchCompilerHost = undefined;
watchSolutionBuilderHost = undefined;
program = undefined;
watchProgram = undefined;

@@ -253,3 +266,3 @@ solutionBuilder = undefined;

const projectName = getProjectNameOfBuilderProgram(builderProgram);
const diagnostics = getDiagnosticsOfBuilderProgram(builderProgram);
const diagnostics = getDiagnosticsOfProgram(builderProgram);
// update diagnostics

@@ -276,3 +289,3 @@ diagnosticsPerProject.set(projectName, diagnostics);

}
else {
else if (watching) {
// watch compiler case

@@ -289,3 +302,3 @@ // ensure watch compiler host exists

const projectName = getProjectNameOfBuilderProgram(builderProgram);
const diagnostics = getDiagnosticsOfBuilderProgram(builderProgram);
const diagnostics = getDiagnosticsOfProgram(builderProgram);
// update diagnostics

@@ -312,2 +325,19 @@ diagnosticsPerProject.set(projectName, diagnostics);

}
else {
if (!compilerHost) {
compilerHost = ControlledCompilerHost_1.createControlledCompilerHost(typescript, parsedConfiguration, system, extensions);
}
if (!program) {
program = ts.createProgram({
rootNames: parsedConfiguration.fileNames,
options: parsedConfiguration.options,
projectReferences: parsedConfiguration.projectReferences,
host: compilerHost,
});
}
const diagnostics = getDiagnosticsOfProgram(program);
const projectName = getConfigFilePathFromCompilerOptions(program.getCompilerOptions());
// update diagnostics
diagnosticsPerProject.set(projectName, diagnostics);
}
changedFiles.forEach((changedFile) => {

@@ -314,0 +344,0 @@ if (system) {

{
"name": "fork-ts-checker-webpack-plugin",
"version": "6.1.1",
"version": "7.0.0-alpha.1",
"description": "Runs typescript type checker and linter on separate process.",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc