Skip to content

Commit

Permalink
Merge branch 'main' into chore/update_cosmiconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-oles committed Oct 29, 2023
2 parents d63698a + c999a13 commit 6ab8a1b
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 34 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
needs: [build, test]
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/intercept-done-to-get-dev-server-tap.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type webpack from 'webpack';
import type * as webpack from 'webpack';

import { getInfrastructureLogger } from '../infrastructure-logger';
import type { ForkTsCheckerWebpackPluginConfig } from '../plugin-config';
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/tap-after-compile-to-add-dependencies.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type webpack from 'webpack';
import type * as webpack from 'webpack';

import { getInfrastructureLogger } from '../infrastructure-logger';
import type { ForkTsCheckerWebpackPluginConfig } from '../plugin-config';
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/tap-after-compile-to-get-issues.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type webpack from 'webpack';
import type * as webpack from 'webpack';

import { getInfrastructureLogger } from '../infrastructure-logger';
import type { Issue } from '../issue';
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/tap-after-environment-to-patch-watching.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type webpack from 'webpack';
import type * as webpack from 'webpack';

import { getInfrastructureLogger } from '../infrastructure-logger';
import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/tap-done-to-async-get-issues.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chalk from 'chalk';
import type webpack from 'webpack';
import type * as webpack from 'webpack';

import { statsFormatter } from '../formatter/stats-formatter';
import { createWebpackFormatter } from '../formatter/webpack-formatter';
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/tap-error-to-log-message.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chalk from 'chalk';
import type webpack from 'webpack';
import type * as webpack from 'webpack';

import type { ForkTsCheckerWebpackPluginConfig } from '../plugin-config';
import { getPluginHooks } from '../plugin-hooks';
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/tap-stop-to-terminate-workers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type webpack from 'webpack';
import type * as webpack from 'webpack';

import { getInfrastructureLogger } from '../infrastructure-logger';
import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';
Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure-logger.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type webpack from 'webpack';
import type * as webpack from 'webpack';

export interface InfrastructureLogger {
log(...args: unknown[]): void;
Expand Down
2 changes: 1 addition & 1 deletion src/issue/issue-config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type webpack from 'webpack';
import type * as webpack from 'webpack';

import { createIssuePredicateFromIssueMatch } from './issue-match';
import type { IssuePredicateOption, IssueOptions } from './issue-options';
Expand Down
2 changes: 1 addition & 1 deletion src/issue/issue-webpack-error.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path';

import chalk from 'chalk';
import webpack from 'webpack';
import * as webpack from 'webpack';

import type { FormatterPathType } from '../formatter';
import { forwardSlash } from '../utils/path/forward-slash';
Expand Down
2 changes: 1 addition & 1 deletion src/plugin-config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type webpack from 'webpack';
import type * as webpack from 'webpack';

import type { FormatterConfig } from './formatter';
import { createFormatterConfig } from './formatter';
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { cosmiconfigSync } from 'cosmiconfig';
import merge from 'deepmerge';
import type { JSONSchema7 } from 'json-schema';
import { validate } from 'schema-utils';
import type webpack from 'webpack';
import type * as webpack from 'webpack';

import { tapAfterCompileToAddDependencies } from './hooks/tap-after-compile-to-add-dependencies';
import { tapAfterEnvironmentToPatchWatching } from './hooks/tap-after-environment-to-patch-watching';
Expand Down
2 changes: 1 addition & 1 deletion src/typescript/type-script-worker-config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import type webpack from 'webpack';
import type * as webpack from 'webpack';

import type { TypeScriptConfigOverwrite } from './type-script-config-overwrite';
import type { TypeScriptDiagnosticsOptions } from './type-script-diagnostics-options';
Expand Down
38 changes: 25 additions & 13 deletions src/typescript/worker/lib/diagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,32 @@ export function invalidateDiagnostics(): void {

export function getDiagnosticsOfProgram(program: ts.Program | ts.BuilderProgram): ts.Diagnostic[] {
const programDiagnostics: ts.Diagnostic[] = [];

if (config.diagnosticOptions.syntactic) {
programDiagnostics.push(...program.getSyntacticDiagnostics());
}
if (config.diagnosticOptions.global) {
programDiagnostics.push(...program.getGlobalDiagnostics());
}
if (config.diagnosticOptions.semantic) {
programDiagnostics.push(...program.getSemanticDiagnostics());
}
if (config.diagnosticOptions.declaration) {
programDiagnostics.push(...program.getDeclarationDiagnostics());
try {
if (config.diagnosticOptions.syntactic) {
programDiagnostics.push(...program.getSyntacticDiagnostics());
}
if (config.diagnosticOptions.global) {
programDiagnostics.push(...program.getGlobalDiagnostics());
}
if (config.diagnosticOptions.semantic) {
programDiagnostics.push(...program.getSemanticDiagnostics());
}
if (config.diagnosticOptions.declaration) {
programDiagnostics.push(...program.getDeclarationDiagnostics());
}
} catch (e) {
if (e instanceof Error) {
programDiagnostics.push({
code: 1,
category: 1,
messageText: `TSC compiler crashed: ${e.message}
${e.stack}`,
file: undefined,
start: undefined,
length: undefined,
});
}
}

return programDiagnostics;
}

Expand Down
2 changes: 1 addition & 1 deletion src/watch/watch-file-system.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { EventEmitter } from 'events';

import type webpack from 'webpack';
import type * as webpack from 'webpack';

// watchpack v1 and v2 internal interface
interface Watchpack extends EventEmitter {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/typescript/type-script-worker-config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path from 'path';

import type { TypeScriptWorkerConfig } from 'src/typescript/type-script-worker-config';
import type { TypeScriptWorkerOptions } from 'src/typescript/type-script-worker-options';
import type webpack from 'webpack';
import type * as webpack from 'webpack';

describe('typescript/type-scripts-worker-config', () => {
let compiler: webpack.Compiler;
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7930,9 +7930,9 @@ wide-align@^1.1.2:
string-width "^1.0.2 || 2"

word-wrap@^1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c"
integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==
version "1.2.4"
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.4.tgz#cb4b50ec9aca570abd1f52f33cd45b6c61739a9f"
integrity sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==

wordwrap@^1.0.0, wordwrap@~1.0.0:
version "1.0.0"
Expand Down

0 comments on commit 6ab8a1b

Please sign in to comment.