Skip to content

Commit

Permalink
chore: update tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait authored Feb 5, 2024
1 parent 7d5b559 commit 41f4a7b
Show file tree
Hide file tree
Showing 137 changed files with 8,192 additions and 5,831 deletions.
43 changes: 43 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"version": "0.2",
"language": "en,en-gb",
"words": [
"commitlint",
"chunkhash",
"concat",
"systemjs",
"tapable",
"templatehash",
"blueimp",
"selfclosed",
"nocheck",
"iife",
"appcache",
"subresource",
"startuml",
"autonumber",
"enduml",
"chunksorter",
"urlencode",
"sortmode",
"harddisk",
"Sileghem",
"Bname",
"Bfile",
"webpackconfig",
"specialattribute",
"dircompare"
],
"ignorePaths": [
"CHANGELOG.md",
"coverage",
"package.json",
"**/dist/**",
"**/__snapshots__/**",
"**/fixtures/**",
"package-lock.json",
"node_modules",
"coverage",
"*.log"
]
}
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
root = true

[*]
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
Expand Down
31 changes: 31 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
env: {
node: true,
commonjs: true,
es2021: true,
},
extends: "eslint:recommended",
ignorePatterns: ["**/dist/**/*.js", "**/spec/fixtures/**/*.js"],
overrides: [
{
files: [".eslintrc.{js,cjs}"],
parserOptions: {
sourceType: "script",
},
},
{
env: {
browser: true,
es2021: true,
},
files: ["**/examples/**"],
parserOptions: {
sourceType: "script",
},
},
],
parserOptions: {
ecmaVersion: "latest",
},
rules: {},
};
8 changes: 3 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Bug report
about: Create a 🕷 report to help us improve

---

<!-- If you deleting this template this issue is very likely to be closed -->
Expand All @@ -19,8 +18,8 @@ about: Create a 🕷 report to help us improve
<!--
Please provide a minimal example how to reproduce your problem..
Delete all plugins which are unrelated
Delete all loaders which are unrelated
Delete all plugins which are unrelated
Delete all loaders which are unrelated
Delete the production webpack config if your bug happens on develop
Delete the develop webpack config if your bug happens only on production
Expand All @@ -30,7 +29,7 @@ Feel free to use this codebox template as a starting point: https://codesandbox.
## Environment 🖥

<!--
To help you we need to know which versions you using otherwise it is impossible to help you.
To help you we need to know which versions you using otherwise it is impossible to help you.
Please run the following commands to see your current versions:
```
Expand All @@ -40,4 +39,3 @@ npm ls webpack
npm ls html-webpack-plugin
```
-->

1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
Expand Down
22 changes: 9 additions & 13 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@

- We realize there is a lot of data requested here. We ask only that you do your best to provide as much information as possible so we can better help you.
- Support questions are better asked in one of the following locations:
- [Stack Overflow](http://stackoverflow.com/questions/tagged/html-webpack-plugin)
- [Stack Overflow](http://stackoverflow.com/questions/tagged/html-webpack-plugin)
- Ensure the issue isn't already reported.
- Should be reproducible with the latest version of `html-webpack-plugin`.
- (Ensure `npm ls html-webpack-plugin` matches ![](https://img.shields.io/npm/v/html-webpack-plugin.svg))

*Delete the above section and the instructions in the sections below before submitting*
- (Ensure `npm ls html-webpack-plugin` matches ![](https://img.shields.io/npm/v/html-webpack-plugin.svg))

_Delete the above section and the instructions in the sections below before submitting_

## Description

If this is a feature request, explain why it should be added. Specific use-cases are best.

For bug reports, please provide as much *relevant* info as possible.
For bug reports, please provide as much _relevant_ info as possible.

### Error Message & Stack Trace

Expand Down Expand Up @@ -50,23 +49,20 @@ module.exports = {
Copy your template file:

```html
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<title>My App</title>
</head>
<body>
</body>
<head>
<title>My App</title>
</head>
<body></body>
</html>
```


## Relevant Links

- If your project is public, link to the repo so we can investigate directly.
- **BONUS POINTS:** Create a [minimal reproduction](http://stackoverflow.com/help/mcve) and upload it to GitHub. This will get you the fastest support.


## Environment

Tell us which operating system you are using, as well as which versions of Node.js, npm, webpack, and html-webpack-plugin. Run the following to get it quickly:
Expand Down
1 change: 0 additions & 1 deletion .github/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ lockComment: false

# Number of days of inactivity before a closed issue or pull request is locked
daysUntilLock: 30

4 changes: 2 additions & 2 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
**This issue had no activity for at least half a year.**
It's subject to automatic issue closing if there is no activity in the next 15 days.
It's subject to automatic issue closing if there is no activity in the next 15 days.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
closeComment: false
82 changes: 67 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,86 @@ on:
branches:
- main
jobs:
lint:
name: Lint - ${{ matrix.os }} - Node v${{ matrix.node-version }}

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

strategy:
matrix:
os: [ubuntu-latest]
node-version: [lts/*]

runs-on: ${{ matrix.os }}

concurrency:
group: lint-${{ matrix.os }}-v${{ matrix.node-version }}-${{ github.ref }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Security audit
run: npm run security -- --only=prod

- name: Check commit message
uses: wagoid/commitlint-github-action@v5

build:
name: test Node ${{ matrix.node }} Webpack ${{ matrix.webpack }} ${{ matrix.os }}
timeout-minutes: 15

runs-on: ${{ matrix.os }}

concurrency:
group: test-${{ matrix.os }}-v${{ matrix.node-version }}-${{ matrix.webpack-version }}-${{ github.ref }}
cancel-in-progress: true

strategy:
matrix:
node: ['10.x', '12.x', '14.x', '16.x', '18.x', '20.x']
node: ["10.x", "12.x", "14.x", "16.x", "18.x", "20.x"]
os: [ubuntu-latest, windows-latest, macOS-latest]
webpack: ['5']
webpack: [latest]

steps:
- name: LF
run: git config --global core.autocrlf false
- name: Setup Git
if: matrix.os == 'windows-latest'
run: git config --global core.autocrlf input

- name: Checkout repo
uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
node-version: ${{ matrix.node-version }}
cache: "npm"

- name: Install Dependencies
run: npm install --ignore-scripts --force --legacy-peer-deps
- name: Install dependencies
run: npm ci

- name: Install Webpack ${{ matrix.webpack }}
run: npm install --ignore-scripts --force --legacy-peer-deps webpack@${{ matrix.webpack }}
- name: Install webpack ${{ matrix.webpack-version }}
if: matrix.webpack-version != 'latest'
run: npm i webpack@${{ matrix.webpack-version }}

- name: Test
run: npm test -- --forceExit || npm test -- --forceExit || npm test -- --forceExit
- name: Run tests for webpack version ${{ matrix.webpack-version }}
run: npm run test:coverage -- --ci

- name: Submit coverage data to codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
npm-debug.*.log
yarn.lock
npm-debug.log.*
/.idea/
.eslintcache
.cspellcache
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no-install commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no-install lint-staged
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/coverage
/dist
/node_modules
/spec/fixtures
CHANGELOG.md
examples/*/dist
Loading

0 comments on commit 41f4a7b

Please sign in to comment.