Skip to content

Commit

Permalink
Merge pull request #136 from chrisblossom/node-12
Browse files Browse the repository at this point in the history
fix typescript, test node 12 and package updates
  • Loading branch information
chrisblossom committed May 6, 2019
2 parents 9e23e7b + 4fcb6f0 commit 336dbcb
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 25 deletions.
17 changes: 17 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,22 @@ jobs:
- ~/.npm
key: v1-dependencies-{{ checksum "_node_version" }}-{{ checksum "_npm_version" }}
- run: npm run test.ci
test-node12:
docker:
- image: circleci/node:12
steps:
- checkout
- run: node --version > _node_version && npm --version > _npm_version && cat _node_version && cat _npm_version
- restore_cache:
keys:
- v1-dependencies-{{ checksum "_node_version" }}-{{ checksum "_npm_version" }}
- run: node --version && npm --version
- run: npm install
- save_cache:
paths:
- ~/.npm
key: v1-dependencies-{{ checksum "_node_version" }}-{{ checksum "_npm_version" }}
- run: npm run test.ci

workflows:
version: 2
Expand All @@ -64,3 +80,4 @@ workflows:
- test-node6
- test-node8
- test-node10
- test-node12
3 changes: 3 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ environment:
- nodejs_version: '6'
- nodejs_version: '8'
- nodejs_version: '10'
# TODO: Uncomment and remove once appveyor supports node 12 https://github.com/appveyor/ci/issues/2921
# - nodejs_version: '12'

install:
- ps: Install-Product node $env:nodejs_version
- set PATH=%APPDATA%\npm;%PATH%
Expand Down
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,34 +49,34 @@
"webpack": "*"
},
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.3.4",
"@babel/preset-env": "^7.3.4",
"@babel/cli": "^7.4.4",
"@babel/core": "^7.4.4",
"@babel/preset-env": "^7.4.4",
"@babel/preset-typescript": "^7.3.3",
"@chrisblossom/eslint-config": "^4.0.10",
"@types/jest": "^24.0.9",
"@types/node": "^11.10.4",
"@types/jest": "^24.0.12",
"@types/node": "^12.0.0",
"@types/read-pkg-up": "^3.0.1",
"@types/webpack": "^4.4.25",
"babel-jest": "^24.1.0",
"babel-plugin-add-module-exports": "^1.0.0",
"codecov": "^3.2.0",
"babel-jest": "^24.8.0",
"babel-plugin-add-module-exports": "^1.0.2",
"codecov": "^3.3.0",
"cross-env": "^5.2.0",
"del-cli": "^1.1.0",
"eslint": "^5.15.0",
"eslint": "^5.16.0",
"execa": "^1.0.0",
"husky": "^1.3.1",
"jest": "^24.1.0",
"lint-staged": "^8.1.5",
"husky": "^2.2.0",
"jest": "^24.8.0",
"lint-staged": "^8.1.6",
"listr": "^0.14.3",
"prettier": "^1.16.4",
"prettier": "^1.17.0",
"read-pkg-up": "^4.0.0",
"semver": "^5.6.0",
"temp-sandbox": "^1.0.17",
"typescript": "^3.3.3333",
"webpack": "^4.29.6"
"semver": "^6.0.0",
"temp-sandbox": "^2.0.0",
"typescript": "^3.4.5",
"webpack": "^4.30.0"
},
"dependencies": {
"del": "^4.0.0"
"@types/webpack": "^4.4.31",
"del": "^4.1.1"
}
}
4 changes: 2 additions & 2 deletions src/clean-webpack-plugin.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Configuration, Stats } from 'webpack';
import path from 'path';
import TempSandbox from 'temp-sandbox';
import { Configuration, Stats } from 'webpack';
import { TempSandbox } from 'temp-sandbox';
import getWebpackVersion from '../dev-utils/get-webpack-version';

const webpackVersion = getWebpackVersion();
Expand Down
9 changes: 5 additions & 4 deletions src/clean-webpack-plugin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Compiler, Stats } from 'webpack';
import path from 'path';
import { sync as delSync } from 'del';
import { Compiler, Stats } from 'webpack';

export interface Options {
/**
Expand Down Expand Up @@ -229,7 +229,8 @@ class CleanWebpackPlugin {
/**
* Fetch Webpack's output asset files
*/
const assets = stats.toJson().assets.map((asset: { name: string }) => {
const assets = stats.toJson().assets || [];
const assetList = assets.map((asset: { name: string }) => {
return asset.name;
});

Expand All @@ -239,15 +240,15 @@ class CleanWebpackPlugin {
* (relies on del's cwd: outputPath option)
*/
const staleFiles = this.currentAssets.filter((previousAsset) => {
const assetCurrent = assets.includes(previousAsset) === false;
const assetCurrent = assetList.includes(previousAsset) === false;

return assetCurrent;
});

/**
* Save assets for next compilation
*/
this.currentAssets = assets.sort();
this.currentAssets = assetList.sort();

const removePatterns = [];

Expand Down

0 comments on commit 336dbcb

Please sign in to comment.