Skip to content

Commit 8dfe754

Browse files
committed
fix: remove needless double new lines in console output when the verbose option is enabled
- chore: add Community Standards files - chore: update dev packages - test: remove the test strategy for node versions 12.x on GitHub to allows use the latest dev packages. The plugin is still compatible with node 12.x. - test: add the test strategies for node versions 18.x and 20.x on GitHub - test: refactor test utilities - test: add tests for alternative way using the html-bundler-webpack-plugin - docs: update readme
1 parent 7e4c2c6 commit 8dfe754

File tree

59 files changed

+1061
-369
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1061
-369
lines changed

.github/CONTRIBUTING.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Contributing in webpack-remove-empty-scripts
2+
3+
- [Questions and Suggestions](#question)
4+
- [Issues and Bugs](#issue)
5+
- [Feature Requests](#feature)
6+
- [Pull Request Submission Guidelines](#submit-pr)
7+
- [Commit Message Conventions](#commit)
8+
9+
## <a name="question"></a> Got a Question or Suggestion?
10+
11+
If you have questions or suggestions, please create a new [discussion](https://github.com/webdiscus/webpack-remove-empty-scripts/discussions).
12+
13+
14+
## <a name="issue"></a> Found an Issue or Bug?
15+
16+
Before you submit an issue, please search the issue tracker,
17+
maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available.
18+
19+
We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it.
20+
21+
Tell us versions of your environment:
22+
23+
- OS: macOS, Linux, Windows
24+
- version of Node.js
25+
- version of Webpack
26+
- version of the Plugin
27+
- the use-case that fails
28+
29+
Ideally create a small repository with a reproducible issue.
30+
31+
32+
## <a name="feature"></a> Feature Requests?
33+
34+
You can _request_ a new feature by creating an [issue](https://github.com/webdiscus/webpack-remove-empty-scripts/issues).
35+
36+
The title must begins with `[FEATURE]`.
37+
38+
39+
## <a name="submit-pr"></a> Pull Request Submission Guidelines
40+
41+
Before you submit your Pull Request (PR) consider the following guidelines:
42+
43+
- Commit your changes using a descriptive commit message that follows our [commit message conventions](#commit).
44+
- Your PR must have only `one` commit. If you have many commits, please squash all commits into one.
45+
- Please test your pull request:
46+
- new/changed code `must` be completely covered, at last `95%`
47+
- create a new test case under `./test/cases/` directory
48+
- all already existing tests must be passed: `npm test`
49+
50+
51+
## <a name="commit"></a> Commit Conventions
52+
53+
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
54+
format that includes a **type**, a **scope** and a **subject**:
55+
56+
```
57+
<type>(<scope>): <subject>
58+
<BLANK LINE>
59+
<body>
60+
<BLANK LINE>
61+
<footer>
62+
```
63+
64+
The **header** is mandatory and the **scope** of the header is optional.
65+
66+
Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
67+
to read on GitHub as well as in various git tools.
68+
69+
The footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any.
70+
71+
Examples:
72+
73+
```
74+
docs(readme): unpdate usage cases
75+
```
76+
77+
```
78+
fix: error ... on Windows
79+
```
80+
81+
### Type
82+
83+
Must be one of the following:
84+
85+
- **chore**: changes that fall outside of build / docs that do not effect source code (example scopes: package, defaults)
86+
- **docs**: documentation only changes (example scopes: readme, changelog)
87+
- **feat**: a new feature
88+
- **fix**: a bug fix
89+
- **perf**: a code change that improves performance
90+
- **refactor**: a code change that neither fixes a bug nor adds a feature
91+
- **style**: changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons)
92+
- **test**: addition of or updates to Jest tests
93+
94+
### Scope
95+
96+
The scope is subjective & depends on the `type` see above. A good example would be a change to a particular class / module.
97+
98+
### Subject
99+
100+
The subject contains a succinct description of the change:
101+
102+
- use the imperative, present tense: "change" not "changed" nor "changes"
103+
- don't capitalize the first letter
104+
- no dot (.) at the end
105+
106+
### Body
107+
108+
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
109+
The body should include the description of the change.
110+
111+
### Footer
112+
113+
The footer should contain the reference GitHub issues that this commit **Closes**.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## Types of changes
2+
3+
<!-- Please place an `x` in all [ ] that apply: -->
4+
5+
This PR contains a:
6+
7+
- [ ] **bugfix**
8+
- [ ] new **feature**
9+
- [ ] **code refactor**
10+
- [ ] **test update** <!-- if bug or feature is checked, this should be too -->
11+
- [ ] **typo fix**
12+
- [ ] **docs change**
13+
- [ ] **breaking change** <!-- fix or feature that change existing functionality -->
14+
15+
## Motivation / Use-Case
16+
17+
<!--
18+
Please explain the motivation or use-case for your change.
19+
What existing problem does the PR solve?
20+
If this PR addresses an issue, please link to the issue.
21+
-->
22+
23+
## Breaking Changes
24+
25+
<!--
26+
If this PR introduces a breaking change, please describe the impact and a
27+
migration path for existing applications.
28+
-->
29+
30+
## Additional Info
31+
32+
---
33+
34+
## Checklist
35+
36+
<!-- Go over all the following points, and place an `x` in all the boxes that apply. -->
37+
38+
- [ ] My code follows the code style of this project.
39+
- [ ] My change requires a change to the documentation.
40+
- [ ] I have updated the documentation accordingly.
41+
- [ ] I have updated the **CHANGELOG.md**.
42+
- [ ] I have read the **CONTRIBUTING** document.
43+
- [ ] I have added tests to cover my changes.
44+
- [ ] All new and existing tests passed.

.github/workflows/test.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,40 @@
11
name: Test
22

3-
on: [ push, pull_request ]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
410

511
jobs:
6-
build:
7-
8-
runs-on: ubuntu-latest
9-
12+
integration:
1013
strategy:
1114
matrix:
12-
node-version: [ 12.x, 14.x, 16.x ]
15+
os: [ubuntu-latest]
16+
node-version: [ 14, 16, 18, 20 ]
1317

18+
runs-on: ${{ matrix.os }}
1419
steps:
1520
- name: Checkout repository
16-
uses: actions/checkout@v2
21+
uses: actions/checkout@v3
1722
with:
18-
fetch-depth: 2
23+
fetch-depth: 1
1924

2025
- name: Set up Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v1
26+
uses: actions/setup-node@v3
2227
with:
2328
node-version: ${{ matrix.node-version }}
2429

2530
- name: Install dependencies
26-
run: npm install
31+
run: npm i
2732

2833
- name: Run the tests
2934
run: npm run test:coverage
3035

3136
- name: Submit coverage data to codecov
32-
uses: codecov/codecov-action@v1
37+
uses: codecov/codecov-action@v3
3338
with:
39+
flags: integration
3440
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
.DS_Store
22
.idea
3+
.vscode
4+
.local
35
_ignored
4-
package-lock.json
56
coverage
67
coverage.lcov
78
node_modules
89
public
910
dist
1011
test/output/
12+
test/**/package-lock.json
13+
package-lock.json
14+
yarn.lock

CHANGELOG.md

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## 1.0.4 (2023-08-28)
2+
- fix: remove needless double new lines in console output when the `verbose` option is enabled
3+
- chore: add Community Standards files
4+
- chore: update dev packages
5+
- test: remove the test strategy for node versions 12.x on GitHub to allows use the latest dev packages.
6+
The plugin is still compatible with node 12.x.
7+
- test: add the test strategies for node versions 18.x and 20.x on GitHub
8+
- test: refactor test utilities
9+
- test: add tests for alternative way using the html-bundler-webpack-plugin
10+
- docs: update readme
11+
112
## 1.0.3 (2023-04-11)
213
- fix: fix interface syntax in TS
314
- fix: `options` in constructor now is optional parameter in types for TS.
@@ -20,17 +31,17 @@
2031
stage: RemoveEmptyScriptsPlugin.STAGE_AFTER_PROCESS_PLUGINS,
2132
})
2233
```
23-
- feat: added new `stage` option.
24-
Webpack plugins use different stages for their functionality.
34+
- feat: add new `stage` option.
35+
Webpack's plugins use different stages for their functionality.
2536
For properly work other plugins can be specified the `stage` when should be removed empty scripts: before or after processing of other webpack plugins.\
2637
For example, using `@wordpress/dependency-extraction-webpack-plugin` the empty scripts must be removed `after` processing all plugins.
2738
Using `webpack-manifest-plugin` the empty scripts must be removed `before` processing other plugins.
2839
- chore: update packages
29-
- test: added the test for using with webpack-manifest-plugin
40+
- test: add the test for using with webpack-manifest-plugin
3041
- docs: update readme
3142

3243
## 0.8.4 (2022-09-08)
33-
- fix: fixed last stable version of ansis in package.json to avoid issues in dependency
44+
- fix: fix last stable version of ansis in package.json to avoid issues in dependency
3445

3546
## 0.8.3 (2022-09-04)
3647
- docs: update readme
@@ -46,16 +57,16 @@
4657
- docs: update readme
4758

4859
## 0.8.0 (2022-04-01)
49-
- feat: added new option `remove` to define custom RegExp for generated assets that must be removed
60+
- feat: add new option `remove` to define custom RegExp for generated assets that must be removed
5061
- chore: update packages
5162

5263
## 0.7.3 (2022-01-30)
53-
- added color verbose output via ANSI color library - ansis
54-
- added the test case for styles imported from javascript
64+
- feat: add color verbose output via ANSI color library - ansis
65+
- feat: add the test case for styles imported from javascript
5566

5667
## 0.7.2 (2021-12-13)
57-
- feat: added new option `enable` to enable / disable the plugin, e.g. by development
58-
- feat: added supports of `RegExp` for option `extensions`
68+
- feat: add new option `enable` to enable / disable the plugin, e.g. by development
69+
- feat: add supports of `RegExp` for option `extensions`
5970
- chore: remove deprecated option `silent`, use `verbose` to show process information (no braking change)
6071
- chore: add GitHub workflow + codecov
6172
- chore: update packages
@@ -65,7 +76,7 @@
6576
- fix: the issue infinite recursion by collect of resources from dependency modules by usage in react app some big components with many thousands dependencies
6677

6778
## 0.7.0 (2020-12-21)
68-
- chore: deprecate the `silent` option, it will be removed on Juni 30, 2021. Use option `verbose: true` to show in console each removed empty file.
79+
- chore: deprecate the `silent` option, it will be removed on Jun 30, 2021. Use option `verbose: true` to show in console each removed empty file.
6980
Defaults, `verbose: false`.
7081
- fix: issue `Maximum call stack size exceeded` in all cases, for example, by usage the webpack setting `optimization.concatenateModules: true` and:
7182
- import react
@@ -78,8 +89,8 @@
7889
- it can be the array of string or RegExp
7990
- added default value of `ignore` as `['/node_modules/']` to ignore resources from `node_modules` path
8091
- fix: the error: `Maximum call stack size exceeded` with webpack setting `optimization.concatenateModules: true`and usage in script imports from `react` and `redux`
81-
- test: added the test case for single style without a scripts in webpack config
82-
- test: added silent mode in tests to suppress output log info in the console
92+
- test: add the test case for single style without a scripts in webpack config
93+
- test: add silent mode in tests to suppress output log info in the console
8394
- chore: update packages
8495

8596
## 0.6.3 (2020-10-25)
@@ -90,8 +101,8 @@
90101
- chore: update packages
91102

92103
## 0.6.1 (2020-10-20)
93-
- The fork of original [webpack-fix-style-only-entries](https://github.com/fqborges/webpack-fix-style-only-entries) (ver. 0.6.0) for support only Webpack 5 and above.
94-
The Webpack 4 is no longer supported.
104+
The fork of original [webpack-fix-style-only-entries](https://github.com/fqborges/webpack-fix-style-only-entries) (ver. 0.6.0) for support only Webpack 5 and above.
105+
The Webpack 4 is no longer supported.
95106

96107
### The changes from original version 0.6.0:
97108

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[Code of Conduct](https://github.com/openjs-foundation/code-and-learn/blob/master/CODE_OF_CONDUCT.md)

0 commit comments

Comments
 (0)