Skip to content

Commit

Permalink
Rewrite of the plugin (#404)
Browse files Browse the repository at this point in the history
* feat: rewrite the plugin to pay off technological debt

It's a big commit as it contains a major rewrite of the plugin. The features included are:
 * Support for TypeScript Watch API controlled by webpack
 * Support for TypeScript Solution Builder API (projectReferences)
 * Support for TypeScript Incremental API
 * Support for Yarn PnP
 * Support for EsLint
 * TypeScript extensions infrastructure
 * Support for Vue.js (TypeScript Watch API)
 * E2E Tests
 * Support for Webpack 5
 * Unified issues processing (include, exclude, issues hook)
 * External configuration
 * Integration with webpack-dev-server with async: true mode
 * Default skipLibCheck: true option
 * --json output of stats will not be polluted

BREAKING CHANGE: 🧨 Dropped support for Node 6 and Node 8
BREAKING CHANGE: 🧨 Changed options format
BREAKING CHANGE: 🧨 Changed plugin hooks
BREAKING CHANGE: 🧨 Minimum TypeScript >=2.7.0
  • Loading branch information
piotr-oles authored May 23, 2020
1 parent 8cb608a commit 1d22d62
Show file tree
Hide file tree
Showing 271 changed files with 10,138 additions and 9,663 deletions.
Binary file added .DS_Store
Binary file not shown.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/src/types/**
/lib/**
15 changes: 9 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ module.exports = {
tryExtensions: ['.js', '.json', '.ts', '.d.ts']
}
},
rules: {
'no-process-exit': 'off', // to investigate if we should throw an error instead of process.exit()
'node/no-unsupported-features/es-builtins': 'off',
'node/no-unsupported-features/es-syntax': 'off'
},
overrides: [
{
files: ['*.ts'],
Expand All @@ -24,7 +19,15 @@ module.exports = {
],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-namespace': 'off' // maybe we should consider enabling it in the future
'@typescript-eslint/no-use-before-define': 'off',
'node/no-unsupported-features/es-syntax': 'off'
}
},
{
files: ['*.spec.ts'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
'node/no-missing-import': 'off'
}
}
]
Expand Down
Binary file added .github/.DS_Store
Binary file not shown.
32 changes: 8 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: CI/CD
on: [push, pull_request]
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -39,21 +39,8 @@ jobs:
needs: build
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
node:
- '6'
- '8'
- '10'
- '12'
packages:
- [email protected] ts-loader@^5.0.0 vue-loader@^15.2.4
- webpack@^4.0.0 ts-loader@^5.0.0 vue-loader@^15.2.4
exclude:
- node: '6'
packages: '[email protected] ts-loader@^5.0.0 vue-loader@^15.2.4'
node: [10, 12] # add 14 when we drop support for webpack 4 as fsevents 1 is not compatible with node 14
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v1

Expand All @@ -74,10 +61,7 @@ jobs:
${{ runner.os }}-node-${{ matrix.node }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-engines

- name: Replace dependencies
run: yarn add ${{ matrix.packages }} -D --ignore-engines
run: yarn install --frozen-lockfile

- name: Download build artifact
uses: actions/download-artifact@v1
Expand All @@ -86,17 +70,17 @@ jobs:

- name: Run unit tests
run: yarn test:unit
- name: Run integration tests
run: yarn test:integration

- name: Run e2e tests
run: yarn test:e2e

release:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GH_PERSONAL_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
needs: [build, test]
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta')
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta')
steps:
- uses: actions/checkout@v1

Expand Down
18 changes: 4 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
# Logs
logs
*.log
npm-debug.log*

# Package artifacts
lib
!test/**/lib

# Package archive used by e2e tests
fork-ts-checker-webpack-plugin.tgz

# Coverage directory used by tools like istanbul
coverage

# Tmp directory for integration test
tmp

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm
package-lock.json

# Optional REPL history
.node_repl_history

# Editor directories and files
.idea
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.9.11
10
5 changes: 1 addition & 4 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"singleQuote": true,
"semi": true,
"tabWidth": 2,
"useTabs": false,
"printWidth": 80
"printWidth": 100
}
582 changes: 285 additions & 297 deletions README.md

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions babel.config.js

This file was deleted.

18 changes: 9 additions & 9 deletions changelog.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@ module.exports = {
types: {
feat: {
description: 'A new feature',
value: 'feat'
value: 'feat',
},
fix: {
description: 'A bug fix',
value: 'fix'
value: 'fix',
},
refactor: {
description: 'A code change that neither adds a feature or fixes a bug',
value: 'refactor'
value: 'refactor',
},
perf: {
description: 'A code change that improves performance',
value: 'perf'
value: 'perf',
},
test: {
description: 'Adding missing tests',
value: 'test'
value: 'test',
},
chore: {
description: 'Build process, CI or auxiliary tool changes',
value: 'chore'
value: 'chore',
},
docs: {
description: 'Documentation only changes',
value: 'docs'
}
}
value: 'docs',
},
},
};
11 changes: 10 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
setupFilesAfterEnv: ['./test/setup.ts']
setupFilesAfterEnv: ['./test/setup.ts'],
rootDir: '.',
moduleNameMapper: {
'^lib/(.*)$': '<rootDir>/lib/$1',
},
globals: {
'ts-jest': {
tsConfig: './test/tsconfig.json',
},
},
};
118 changes: 51 additions & 67 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,14 @@
"version": "0.0.0-semantic-release",
"description": "Runs typescript type checker and linter on separate process.",
"keywords": [
"awesome-typescript-loader",
"checker",
"fast",
"fork",
"increment",
"linter",
"webpack",
"plugin",
"speed",
"ts-loader",
"type",
"typescript",
"webpack",
"webpack-plugin"
"webpack"
],
"bugs": {
"url": "https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/issues"
Expand All @@ -31,18 +26,19 @@
"John Reilly <[email protected]> (https://blog.johnnyreilly.com)"
],
"files": [
"lib"
"./lib"
],
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"build": "rimraf lib && tsc --version && tsc --project \"./src\"",
"lint": "eslint ./src ./test --ext .ts --ext .js --ignore-pattern '/test/fixtures/**' --ignore-pattern '/test/tmp/**'",
"test": "yarn build && yarn test:unit && yarn test:integration",
"test:unit": "jest unit",
"test:integration": "jest integration && rimraf tmp",
"precommit": "lint-staged && yarn build && yarn test:unit",
"commit": "./node_modules/.bin/git-cz"
"build": "cross-env rimraf lib && cross-env tsc --version && cross-env tsc",
"lint": "cross-env eslint ./src ./test --ext .ts",
"test": "yarn build && yarn test:unit && yarn test:e2e",
"test:unit": "cross-env jest unit",
"test:pack": "yarn pack --filename fork-ts-checker-webpack-plugin.tgz",
"test:e2e": "yarn test:pack && cross-env jest e2e --ci --runInBand --bail --verbose",
"precommit": "cross-env lint-staged && yarn build && yarn test:unit",
"commit": "cross-env git-cz"
},
"husky": {
"hooks": {
Expand All @@ -56,76 +52,64 @@
]
},
"lint-staged": {
"linters": {
"*.js": [
"eslint --fix",
"prettier --write",
"git add"
],
"*.ts": [
"prettier --write",
"git add"
]
}
"*.ts": "eslint --fix"
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"dependencies": {
"babel-code-frame": "^6.22.0",
"@babel/code-frame": "^7.8.3",
"chalk": "^2.4.1",
"micromatch": "^3.1.10",
"cosmiconfig": "^6.0.0",
"deepmerge": "^4.2.2",
"fs-extra": "^9.0.0",
"memfs": "^3.1.2",
"minimatch": "^3.0.4",
"schema-utils": "1.0.0",
"semver": "^5.6.0",
"tapable": "^1.0.0",
"worker-rpc": "^0.1.0"
"tapable": "^1.0.0"
},
"devDependencies": {
"@commitlint/config-conventional": "^7.5.0",
"@types/babel-code-frame": "^6.20.1",
"@types/jest": "^24.0.11",
"@types/lodash": "^4.14.134",
"@types/micromatch": "^3.1.0",
"@commitlint/config-conventional": "^8.3.4",
"@types/babel__code-frame": "^7.0.1",
"@types/cross-spawn": "^6.0.2",
"@types/eslint": "^6.8.0",
"@types/fs-extra": "^8.1.0",
"@types/jest": "^25.2.1",
"@types/minimatch": "^3.0.1",
"@types/mock-fs": "^4.10.0",
"@types/mock-require": "^2.0.0",
"@types/node": "^11.0.0",
"@types/rimraf": "^2.0.2",
"@types/semver": "^5.5.0",
"@types/webpack": "^4.4.19",
"@typescript-eslint/eslint-plugin": "^2.12.0",
"@typescript-eslint/parser": "^2.12.0",
"commitlint": "^7.5.2",
"copy-dir": "^0.4.0",
"css-loader": "0.28.11",
"@types/node": "^13.11.1",
"@types/rimraf": "^3.0.0",
"@types/schema-utils": "1.0.0",
"@types/semver": "^7.1.0",
"@types/webpack": "^4.41.11",
"@typescript-eslint/eslint-plugin": "^2.27.0",
"@typescript-eslint/parser": "^2.27.0",
"commitlint": "^8.3.5",
"cross-env": "^7.0.2",
"cross-spawn": "^7.0.2",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.7.0",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-prettier": "^3.1.2",
"git-cz": "^3.0.1",
"husky": "^1.1.4",
"jest": "^24.7.1",
"lint-staged": "^8.0.5",
"lodash": "^4.17.11",
"mock-fs": "^4.3.0",
"mock-require": "^3.0.2",
"nativescript-vue-template-compiler": "^2.4.0",
"prettier": "^1.14.3",
"rimraf": "^3.0.0",
"ts-jest": "^24.2.0",
"ts-loader": "^5.0.0",
"typescript": "^3.0.1",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.3",
"git-cz": "^4.3.1",
"husky": "^4.2.5",
"jest": "^25.3.0",
"lint-staged": "^10.1.3",
"mock-fs": "^4.11.0",
"prettier": "^2.0.4",
"rimraf": "^3.0.2",
"strip-ansi": "^6.0.0",
"tree-kill": "^1.2.2",
"ts-jest": "^25.3.1",
"typescript": "^3.8.3",
"unixify": "^1.0.0",
"vue": "^2.5.16",
"vue-class-component": "^6.1.1",
"vue-loader": "^15.2.4",
"vue-template-compiler": "^2.5.16",
"webpack": "^4.0.0"
"webpack": "^4.42.1"
},
"engines": {
"node": ">=6.11.5",
"node": ">=10",
"yarn": ">=1.0.0"
}
}
Loading

0 comments on commit 1d22d62

Please sign in to comment.