Skip to content

Commit

Permalink
fix: update micromatch to v4 (#199)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Drops support for Node v6, v8, v10 and v15
  • Loading branch information
SimenB authored Mar 8, 2022
1 parent 8387886 commit 4073291
Show file tree
Hide file tree
Showing 14 changed files with 12,486 additions and 8,310 deletions.
17 changes: 0 additions & 17 deletions .babelrc

This file was deleted.

6 changes: 2 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
"files": ["test.js", "puppeteer.test.js"],
"env": {
"jest": true
},
"rules": {
"no-console": "off"
}
},
{
Expand All @@ -27,6 +24,7 @@
}
],
"rules": {
"prettier/prettier": ["error", { "trailingComma": "all" }]
"prettier/prettier": ["error", { "trailingComma": "all" }],
"no-await-in-loop": "off"
}
}
48 changes: 8 additions & 40 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [6.x, 8.x, 10.x, 12.x, 14.x, 15.x, 16.x, 17.x]
node-version: [12.x, 14.x, 16.x, 17.x]
html-plugin-version: [3, 4, 5]
webpack-version: [4, 5]
exclude:
Expand All @@ -28,26 +28,9 @@ jobs:
# plugin@3 only supports webpack@4
- html-plugin-version: 3
webpack-version: 5
# webpack@5 and plugin@5 does not support node 6 or 8
- node-version: 6.x
webpack-version: 5
- node-version: 6.x
html-plugin-version: 5
- node-version: 8.x
webpack-version: 5
- node-version: 8.x
html-plugin-version: 5
- node-version: 10.x
html-plugin-version: 5
include:
- node-version: 10.x
install-puppeteer: true
- node-version: 12.x
install-puppeteer: true
- node-version: 14.x
install-puppeteer: true
- node-version: 15.x
install-puppeteer: true
# webpack@4 does not support node@17: https://github.com/webpack/webpack/issues/14532
- node-version: 17.x
webpack-version: 4
runs-on: ubuntu-latest

steps:
Expand All @@ -63,11 +46,6 @@ jobs:
run: |
yarn
yarn add --dev html-webpack-plugin@${{matrix.html-plugin-version }} webpack@${{ matrix.webpack-version }}
git checkout yarn.lock
- name: install puppeteer
if: ${{ matrix.install-puppeteer }}
run: |
yarn add --dev puppeteer
yarn example
git checkout yarn.lock
- name: run tests
Expand All @@ -89,9 +67,8 @@ jobs:
node-version: 'lts/*'
cache: yarn
- run: yarn
- name: install puppeteer
- name: build example
run: |
yarn add --dev puppeteer
yarn example
git checkout yarn.lock
- name: run tests
Expand All @@ -101,20 +78,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: yarn
- run: yarn
- run: yarn lint

Expand All @@ -133,7 +101,7 @@ jobs:
cache: yarn
- name: install
run: yarn
- run: npx semantic-release@17
- run: yarn semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@ coverage/
build/
dist/
.eslintcache

# https://yarnpkg.com/advanced/qa#which-files-should-be-gitignored but nested for e2e directories
**/.yarn/*
!**/.yarn/releases
!**/.yarn/plugins
!**/.yarn/sdks
!**/.yarn/versions
**/.pnp.*
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
546 changes: 546 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

785 changes: 785 additions & 0 deletions .yarn/releases/yarn-3.2.0.cjs

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
enableGlobalCache: true

nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-3.2.0.cjs
95 changes: 35 additions & 60 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,20 @@
"lib/",
"index.d.ts"
],
"main": "lib/index.js",
"main": "src/index.js",
"scripts": {
"clean": "del-cli lib/ coverage/ example/*/build example/*/dist",
"prebuild": "npm run clean",
"build": "babel src/ --out-dir lib/",
"postbuild": "prettier lib/* --write",
"cover": "jest --coverage",
"preexample": "npm run clean && npm run build",
"example": "npm run example:dll && npm run example:polyfill",
"clean": "del-cli lib/ coverage/ \"example/*/build\" \"example/*/dist\"",
"cover": "yarn run test --coverage",
"example": "yarn run clean && yarn run example:dll && yarn run example:polyfill",
"example:dll": "webpack --config example/dll/webpack.config.dll.js && webpack --config example/dll/webpack.config.js",
"example:polyfill": "webpack --config example/polyfill/webpack.config.js",
"lint": "eslint --cache .",
"update-license": "licensor --width 72",
"build-and-update-license": "npm run build && npm run update-license",
"prepare": "npm run build",
"pretest": "npm run example",
"test": "jest"
"build-and-update-license": "yarn run update-license",
"test": "jest",
"postinstall": "husky install",
"prepack": "pinst --disable",
"postpack": "pinst --enable"
},
"repository": "SimenB/add-asset-html-webpack-plugin",
"keywords": [
Expand All @@ -37,41 +34,36 @@
},
"homepage": "https://github.com/SimenB/add-asset-html-webpack-plugin#readme",
"dependencies": {
"globby": "^9.0.0",
"micromatch": "^3.1.3",
"p-each-series": "^1.0.0"
"globby": "^9.2.0",
"micromatch": "^4.0.4"
},
"devDependencies": {
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.1",
"@babel/plugin-transform-modules-commonjs": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"babel-jest": "^24.0.0",
"babel-plugin-add-module-exports": "^1.0.0",
"classnames": "^2.2.5",
"del-cli": "^1.1.0",
"eslint": "^5.6.0",
"del-cli": "^4.0.1",
"eslint": "^8.10.0",
"eslint-config-simenb-base": "^15.0.1",
"eslint_d": "^7.1.0",
"express": "^4.17.1",
"html-webpack-plugin": "^4.0.0",
"husky": "^1.0.1",
"jest": "^24.0.0",
"jest-watch-typeahead": "^0.2.0",
"html-webpack-plugin": "^5.2.0",
"husky": "^7.0.0",
"jest": "^27.0.0",
"jest-watch-typeahead": "^1.0.0",
"licensor": "^4.0.0",
"lint-staged": "^7.0.0",
"prettier": "^1.8.2",
"slash": "^2.0.0",
"lint-staged": "^12.3.5",
"pinst": "^3.0.0",
"prettier": "^2.2.1",
"puppeteer": "^13.5.0",
"semantic-release": "^19.0.2",
"slash": "^3.0.0",
"stoppable": "^1.1.0",
"webpack": "^4.0.0",
"webpack-cli": "^3.1.0"
"webpack": "^5.23.0",
"webpack-cli": "^4.5.0"
},
"peerDependencies": {
"html-webpack-plugin": "^3.0.4 || ^4.0.0-0 || ^5.0.0",
"webpack": "^4.0.0 || ^5.0.0"
},
"engines": {
"node": ">=6"
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
},
"jest": {
"testEnvironment": "node",
Expand All @@ -83,35 +75,25 @@
"statements": 100
}
},
"transform": {},
"watchPlugins": [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname"
]
},
"lint-staged": {
"*.js": [
"eslint --fix --cache",
"git add"
],
"*.{md,json,ts}": [
"prettier --write",
"git add"
],
".{eslintrc,babelrc}": [
"prettier --write",
"git add"
]
"*.{js,ts}": "eslint --fix --cache",
"*.{md,json}": "prettier --write",
".eslintrc": "prettier --write"
},
"prettier": {
"singleQuote": true,
"arrowParens": "avoid",
"trailingComma": "all",
"proseWrap": "always",
"overrides": [
{
"files": [
".eslintrc",
".babelrc"
],
"files": ".eslintrc",
"options": {
"parser": "json"
}
Expand All @@ -130,20 +112,13 @@
}
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"release": {
"branches": [
"main"
]
},
"resolutions": {
"**/@types/webpack-sources/source-map": "0.6.1",
"anymatch": "^2.0.0",
"merge2": "~1.2.3",
"stack-utils": "1.0.2"
}
"@semantic-release/npm/npm": "7.20.6"
},
"packageManager": "[email protected]"
}
35 changes: 8 additions & 27 deletions puppeteer.test.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,15 @@
import path from 'path';
import fs from 'fs';
import { promisify } from 'util';
import express from 'express';
import stoppable from 'stoppable';
const path = require('path');
const fs = require('fs');
const { promisify } = require('util');
const express = require('express');
const stoppable = require('stoppable');
const puppeteer = require('puppeteer');

let puppeteer;
let browser;

(() => {
try {
// eslint-disable-next-line global-require,import/no-unresolved,import/no-extraneous-dependencies
puppeteer = require('puppeteer');
} catch (error) {
if (error.code !== 'MODULE_NOT_FOUND') {
throw error;
}
}
})();

if (!puppeteer) {
test.only('Unable to load puppeteer, skipping tests', () => {
console.warn('Unable to load puppeteer, skipping tests');
});
}

beforeAll(async () => {
if (puppeteer) {
browser = await puppeteer.launch();
}
}, 10000);
browser = await puppeteer.launch();
}, 30000);

afterAll(async () => {
if (browser) {
Expand Down
Loading

0 comments on commit 4073291

Please sign in to comment.