Skip to content

Commit 74d33fc

Browse files
committed
chore: upgrade to jest 23 and babel 7
BREAKING CHANGE: Drops support for node 4
1 parent cf3fa7f commit 74d33fc

File tree

9 files changed

+2339
-1839
lines changed

9 files changed

+2339
-1839
lines changed

.babelrc

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
{
22
"presets": [
3-
["env", {
4-
"modules": false,
5-
"targets": {
6-
"node": 4
7-
},
8-
"exclude": [
9-
"transform-regenerator",
10-
// These are not _really_ needed for node@4
11-
"transform-es2015-classes",
12-
"transform-es2015-block-scoping",
13-
"transform-es2015-arrow-functions"
14-
]
15-
}]
3+
[
4+
"@babel/preset-env",
5+
{
6+
"modules": false,
7+
"targets": {
8+
"node": 6
9+
}
10+
}
11+
]
1612
],
1713
"plugins": [
1814
"add-module-exports",
19-
"transform-inline-imports-commonjs"
20-
],
21-
"retainLines": true
15+
["@babel/plugin-transform-modules-commonjs", { "lazy": true }]
16+
]
2217
}

.eslintrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@
77
"env": {
88
"jest": true
99
}
10+
},
11+
{
12+
"files": "example/**/*",
13+
"env": {
14+
"node": true
15+
},
16+
"rules": {
17+
"import/no-extraneous-dependencies": [
18+
"error",
19+
{ "devDependencies": true }
20+
],
21+
// Off becuase stuff is generated later
22+
"import/no-unresolved": "off"
23+
}
1024
}
1125
],
1226
"rules": {

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ language: node_js
22
node_js:
33
- 8
44
- 6
5-
- 4
65
- node
76
os:
87
- linux

CHANGELOG.md

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,142 +8,146 @@ https://github.com/SimenB/add-asset-html-webpack-plugin/releases
88

99
## [Unreleased]
1010

11+
### Changed
12+
13+
- Drop support for Node 4
14+
1115
## [2.1.3] - 2018-03-03
1216

1317
### Fixes
1418

15-
* Webpack 4 compatibility
19+
- Webpack 4 compatibility
1620

1721
### Changed
1822

19-
* Replace Bluebird with `p-each-series`
20-
* Replace `minimatch` with `micromatch`
23+
- Replace Bluebird with `p-each-series`
24+
- Replace `minimatch` with `micromatch`
2125

2226
## [2.1.2] - 2017-09-15
2327

2428
### Fixes
2529

26-
* Fix TypeScript definition file
27-
* Allows an array of options in the plugin constructor
28-
* Added `files` property to options
30+
- Fix TypeScript definition file
31+
- Allows an array of options in the plugin constructor
32+
- Added `files` property to options
2933

3034
## [2.1.1] - 2017-08-16
3135

3236
### Fixes
3337

34-
* Fix typo in readme (`filter` -> `files`)
38+
- Fix typo in readme (`filter` -> `files`)
3539

3640
## [2.1.0] - 2017-08-07
3741

3842
### Added
3943

40-
* Support globby string as filepath option (#78, thanks @Genuifx and @NumerHero)
44+
- Support globby string as filepath option (#78, thanks @Genuifx and @NumerHero)
4145

4246
## [2.0.1] - 2017-04-23
4347

4448
### Fixes
4549

46-
* Support only string as option to files
50+
- Support only string as option to files
4751

4852
## [2.0.0] - 2017-04-23
4953

5054
### Breaking
5155

52-
* Drop support for `node<4`
56+
- Drop support for `node<4`
5357

5458
### Added
5559

56-
* Add `files` option
57-
* Allows you to only include a given asset in certain html files
58-
* Ported from https://npm.im/html-webpack-include-assets-plugin
60+
- Add `files` option
61+
- Allows you to only include a given asset in certain html files
62+
- Ported from https://npm.im/html-webpack-include-assets-plugin
5963

6064
## [1.0.2] - 2016-08-07
6165

6266
### Fixes
6367

64-
* Fix TypeScript definition file (#22, thanks @hh10k)
68+
- Fix TypeScript definition file (#22, thanks @hh10k)
6569

6670
## [1.0.1] - 2016-08-06
6771

6872
### Fixes
6973

70-
* Make `require` work without `.default` again (Fixes #20)
74+
- Make `require` work without `.default` again (Fixes #20)
7175

7276
## [1.0.0] - 2016-07-29
7377

7478
### Breaking
7579

76-
* Rename `filname` to `filepath`, which makes much more sense
80+
- Rename `filname` to `filepath`, which makes much more sense
7781

7882
### Added
7983

80-
* A Changelog!
81-
* A first attempt to add typings
82-
* Tests for 100% coverage (#17)
83-
* `outputPath` option (#16, thanks @wadahiro)
84+
- A Changelog!
85+
- A first attempt to add typings
86+
- Tests for 100% coverage (#17)
87+
- `outputPath` option (#16, thanks @wadahiro)
8488

8589
### Fixes
8690

87-
* Fix wrong documentation
91+
- Fix wrong documentation
8892

8993
### Internal
9094

91-
* Centralise linting
95+
- Centralise linting
9296

9397
## [0.4.0] - 2016-07-21
9498

9599
### Added
96100

97-
* `publicPath` option (#9, thanks @wadahiro)
101+
- `publicPath` option (#9, thanks @wadahiro)
98102

99103
### Internal
100104

101-
* Lint the code on travis
105+
- Lint the code on travis
102106

103107
## [0.3.0] - 2016-07-15
104108

105109
### Added
106110

107-
* Add `hash` option to append a hash to the filename (#8, thanks @wadahiro)
111+
- Add `hash` option to append a hash to the filename (#8, thanks @wadahiro)
108112

109113
### Changed
110114

111-
* Added a note in the readme regarding what version of `html-webpack-plugin` is
115+
- Added a note in the readme regarding what version of `html-webpack-plugin` is
112116
needed
113117

114118
### Internal
115119

116-
* Use AirBnB ESLint config instead of Standard
120+
- Use AirBnB ESLint config instead of Standard
117121

118122
## [0.2.0] - 2016-05-30
119123

120124
### Added
121125

122-
* Allow passing an array of files to the plugin (#6)
126+
- Allow passing an array of files to the plugin (#6)
123127

124128
## [0.1.0] - 2016-05-28
125129

126130
### Changed
127131

128-
* Pass `htmlPluginData` to the callback (#5, thanks @RyanEwen)
132+
- Pass `htmlPluginData` to the callback (#5, thanks @RyanEwen)
129133

130134
## [0.0.3] - 2016-03-17
131135

132136
### Changed
133137

134-
* Use `html-webpack-plugin-before-html-generation` as the event from
138+
- Use `html-webpack-plugin-before-html-generation` as the event from
135139
`html-webpack-plugin`
136140

137141
## [0.0.2] - 2016-02-27
138142

139143
### Added
140144

141-
* A Changelog!
142-
* Use `publicPath` from webpack config if available
145+
- A Changelog!
146+
- Use `publicPath` from webpack config if available
143147

144148
#### Internal
145149

146-
* Fix URL to repo in package.json
150+
- Fix URL to repo in package.json
147151

148152
## [0.0.1] - 2016-02-27
149153

appveyor.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ init:
33

44
environment:
55
matrix:
6-
- nodejs_version: 4
76
- nodejs_version: 6
8-
- nodejs_version: 7
7+
- nodejs_version: 8
98

109
# Install scripts. (runs after repo cloning)
1110
install:

example/.eslintrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

package.json

Lines changed: 49 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22
"name": "add-asset-html-webpack-plugin",
33
"version": "2.1.3",
44
"description": "Add a JS or CSS assets to a generated HTML file",
5-
"files": ["lib/", "index.d.ts"],
5+
"files": [
6+
"lib/",
7+
"index.d.ts"
8+
],
69
"main": "lib/index.js",
710
"scripts": {
811
"clean": "del-cli lib/ coverage/ example/build example/dist",
9-
"compile": "babel src/ --out-dir lib/",
12+
"build": "babel src/ --out-dir lib/",
1013
"cover": "jest --coverage",
11-
"preexample": "npm run clean && npm run compile",
12-
"example":
13-
"webpack --config example/webpack.config.dll.js && webpack --config example/webpack.config.js",
14+
"preexample": "npm run clean && npm run build",
15+
"example": "webpack --config example/webpack.config.dll.js && webpack --config example/webpack.config.js",
1416
"lint": "eslint .",
1517
"update-license": "licensor --width 72",
16-
"compile-and-update-license": "npm run compile && npm run update-license",
18+
"build-and-update-license": "npm run build && npm run update-license",
1719
"preversion": "npm run travis && npm run update-license",
18-
"prepublish":
19-
"not-in-install && npm run compile-and-update-license || in-install",
20+
"prepublish": "not-in-install && npm run build-and-update-license || in-install",
2021
"postpublish": "git push --follow-tags",
2122
"pretest": "npm run lint",
2223
"test": "jest",
@@ -25,7 +26,11 @@
2526
"precommit": "lint-staged"
2627
},
2728
"repository": "SimenB/add-asset-html-webpack-plugin",
28-
"keywords": ["dll", "html-webpack-plugin", "webpack"],
29+
"keywords": [
30+
"dll",
31+
"html-webpack-plugin",
32+
"webpack"
33+
],
2934
"author": "Simen Bekkhus <[email protected]>",
3035
"license": "MIT",
3136
"bugs": {
@@ -38,29 +43,33 @@
3843
"p-each-series": "^1.0.0"
3944
},
4045
"devDependencies": {
41-
"babel-cli": "^6.26.0",
42-
"babel-plugin-add-module-exports": "^0.2.1",
43-
"babel-plugin-transform-inline-imports-commonjs": "^1.2.0",
44-
"babel-preset-env": "^1.6.0",
46+
"@babel/cli": "^7.0.0",
47+
"@babel/core": "^7.0.1",
48+
"@babel/plugin-transform-modules-commonjs": "^7.0.0",
49+
"@babel/preset-env": "^7.0.0",
50+
"babel-core": "^7.0.0-bridge.0",
51+
"babel-jest": "^23.6.0",
52+
"babel-plugin-add-module-exports": "^1.0.0",
4553
"classnames": "^2.2.5",
4654
"del-cli": "^1.1.0",
47-
"eslint": "^4.6.1",
48-
"eslint-config-simenb-base": "^14.0.0",
49-
"eslint_d": "^5.1.0",
55+
"eslint": "^5.6.0",
56+
"eslint-config-simenb-base": "^15.0.0",
57+
"eslint_d": "^7.1.0",
5058
"html-webpack-plugin": "^2.10.0",
5159
"husky": "^0.14.3",
5260
"in-publish": "^2.0.0",
53-
"jest": "^21.1.0",
61+
"jest": "^23.6.0",
62+
"jest-watch-typeahead": "^0.2.0",
5463
"licensor": "^4.0.0",
55-
"lint-staged": "^6.0.0",
64+
"lint-staged": "^7.0.0",
5665
"prettier": "^1.8.2",
5766
"webpack": "^3.5.6"
5867
},
5968
"peerDependencies": {
6069
"html-webpack-plugin": "^2.10.0 || ^3.0.4"
6170
},
6271
"engines": {
63-
"node": ">=4"
72+
"node": ">=6"
6473
},
6574
"jest": {
6675
"testEnvironment": "node",
@@ -71,19 +80,35 @@
7180
"lines": 100,
7281
"statements": 100
7382
}
74-
}
83+
},
84+
"watchPlugins": [
85+
"jest-watch-typeahead/filename",
86+
"jest-watch-typeahead/testname"
87+
]
7588
},
7689
"lint-staged": {
77-
"*.js": ["eslint --fix", "git add"],
78-
"*.{md,json}": ["prettier --write", "git add"],
79-
".eslintrc": ["prettier --write", "git add"]
90+
"*.js": [
91+
"eslint --fix",
92+
"git add"
93+
],
94+
"*.{md,json}": [
95+
"prettier --write",
96+
"git add"
97+
],
98+
".{eslintrc,babelrc}": [
99+
"prettier --write",
100+
"git add"
101+
]
80102
},
81103
"prettier": {
82104
"singleQuote": true,
83105
"trailingComma": "all",
84106
"overrides": [
85107
{
86-
"files": ".eslintrc",
108+
"files": [
109+
".eslintrc",
110+
".babelrc"
111+
],
87112
"options": {
88113
"parser": "json"
89114
}

0 commit comments

Comments
 (0)