Skip to content

Commit

Permalink
fix: remove needless double new lines in console output when the `ver…
Browse files Browse the repository at this point in the history
…bose` 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
  • Loading branch information
webdiscus committed Aug 28, 2023
1 parent 7e4c2c6 commit 8dfe754
Show file tree
Hide file tree
Showing 59 changed files with 1,061 additions and 369 deletions.
113 changes: 113 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Contributing in webpack-remove-empty-scripts

- [Questions and Suggestions](#question)
- [Issues and Bugs](#issue)
- [Feature Requests](#feature)
- [Pull Request Submission Guidelines](#submit-pr)
- [Commit Message Conventions](#commit)

## <a name="question"></a> Got a Question or Suggestion?

If you have questions or suggestions, please create a new [discussion](https://github.com/webdiscus/webpack-remove-empty-scripts/discussions).


## <a name="issue"></a> Found an Issue or Bug?

Before you submit an issue, please search the issue tracker,
maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available.

We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it.

Tell us versions of your environment:

- OS: macOS, Linux, Windows
- version of Node.js
- version of Webpack
- version of the Plugin
- the use-case that fails

Ideally create a small repository with a reproducible issue.


## <a name="feature"></a> Feature Requests?

You can _request_ a new feature by creating an [issue](https://github.com/webdiscus/webpack-remove-empty-scripts/issues).

The title must begins with `[FEATURE]`.


## <a name="submit-pr"></a> Pull Request Submission Guidelines

Before you submit your Pull Request (PR) consider the following guidelines:

- Commit your changes using a descriptive commit message that follows our [commit message conventions](#commit).
- Your PR must have only `one` commit. If you have many commits, please squash all commits into one.
- Please test your pull request:
- new/changed code `must` be completely covered, at last `95%`
- create a new test case under `./test/cases/` directory
- all already existing tests must be passed: `npm test`


## <a name="commit"></a> Commit Conventions

Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
format that includes a **type**, a **scope** and a **subject**:

```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```

The **header** is mandatory and the **scope** of the header is optional.

Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
to read on GitHub as well as in various git tools.

The footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any.

Examples:

```
docs(readme): unpdate usage cases
```

```
fix: error ... on Windows
```

### Type

Must be one of the following:

- **chore**: changes that fall outside of build / docs that do not effect source code (example scopes: package, defaults)
- **docs**: documentation only changes (example scopes: readme, changelog)
- **feat**: a new feature
- **fix**: a bug fix
- **perf**: a code change that improves performance
- **refactor**: a code change that neither fixes a bug nor adds a feature
- **style**: changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons)
- **test**: addition of or updates to Jest tests

### Scope

The scope is subjective & depends on the `type` see above. A good example would be a change to a particular class / module.

### Subject

The subject contains a succinct description of the change:

- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize the first letter
- no dot (.) at the end

### Body

Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
The body should include the description of the change.

### Footer

The footer should contain the reference GitHub issues that this commit **Closes**.
44 changes: 44 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## Types of changes

<!-- Please place an `x` in all [ ] that apply: -->

This PR contains a:

- [ ] **bugfix**
- [ ] new **feature**
- [ ] **code refactor**
- [ ] **test update** <!-- if bug or feature is checked, this should be too -->
- [ ] **typo fix**
- [ ] **docs change**
- [ ] **breaking change** <!-- fix or feature that change existing functionality -->

## Motivation / Use-Case

<!--
Please explain the motivation or use-case for your change.
What existing problem does the PR solve?
If this PR addresses an issue, please link to the issue.
-->

## Breaking Changes

<!--
If this PR introduces a breaking change, please describe the impact and a
migration path for existing applications.
-->

## Additional Info

---

## Checklist

<!-- Go over all the following points, and place an `x` in all the boxes that apply. -->

- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have updated the **CHANGELOG.md**.
- [ ] I have read the **CONTRIBUTING** document.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
28 changes: 17 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
name: Test

on: [ push, pull_request ]
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:

runs-on: ubuntu-latest

integration:
strategy:
matrix:
node-version: [ 12.x, 14.x, 16.x ]
os: [ubuntu-latest]
node-version: [ 14, 16, 18, 20 ]

runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 2
fetch-depth: 1

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install
run: npm i

- name: Run the tests
run: npm run test:coverage

- name: Submit coverage data to codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
flags: integration
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
.DS_Store
.idea
.vscode
.local
_ignored
package-lock.json
coverage
coverage.lcov
node_modules
public
dist
test/output/
test/**/package-lock.json
package-lock.json
yarn.lock
39 changes: 25 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 1.0.4 (2023-08-28)
- 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.0.3 (2023-04-11)
- fix: fix interface syntax in TS
- fix: `options` in constructor now is optional parameter in types for TS.
Expand All @@ -20,17 +31,17 @@
stage: RemoveEmptyScriptsPlugin.STAGE_AFTER_PROCESS_PLUGINS,
})
```
- feat: added new `stage` option.
Webpack plugins use different stages for their functionality.
- feat: add new `stage` option.
Webpack's plugins use different stages for their functionality.
For properly work other plugins can be specified the `stage` when should be removed empty scripts: before or after processing of other webpack plugins.\
For example, using `@wordpress/dependency-extraction-webpack-plugin` the empty scripts must be removed `after` processing all plugins.
Using `webpack-manifest-plugin` the empty scripts must be removed `before` processing other plugins.
- chore: update packages
- test: added the test for using with webpack-manifest-plugin
- test: add the test for using with webpack-manifest-plugin
- docs: update readme

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

## 0.8.3 (2022-09-04)
- docs: update readme
Expand All @@ -46,16 +57,16 @@
- docs: update readme

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

## 0.7.3 (2022-01-30)
- added color verbose output via ANSI color library - ansis
- added the test case for styles imported from javascript
- feat: add color verbose output via ANSI color library - ansis
- feat: add the test case for styles imported from javascript

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

## 0.7.0 (2020-12-21)
- 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.
- 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.
Defaults, `verbose: false`.
- fix: issue `Maximum call stack size exceeded` in all cases, for example, by usage the webpack setting `optimization.concatenateModules: true` and:
- import react
Expand All @@ -78,8 +89,8 @@
- it can be the array of string or RegExp
- added default value of `ignore` as `['/node_modules/']` to ignore resources from `node_modules` path
- fix: the error: `Maximum call stack size exceeded` with webpack setting `optimization.concatenateModules: true`and usage in script imports from `react` and `redux`
- test: added the test case for single style without a scripts in webpack config
- test: added silent mode in tests to suppress output log info in the console
- test: add the test case for single style without a scripts in webpack config
- test: add silent mode in tests to suppress output log info in the console
- chore: update packages

## 0.6.3 (2020-10-25)
Expand All @@ -90,8 +101,8 @@
- chore: update packages

## 0.6.1 (2020-10-20)
- 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.
The Webpack 4 is no longer supported.
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.
The Webpack 4 is no longer supported.

### The changes from original version 0.6.0:

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

0 comments on commit 8dfe754

Please sign in to comment.