Skip to content

Commit e7d217c

Browse files
committed
refactor!: update repo
1 parent 7834861 commit e7d217c

31 files changed

+5161
-5035
lines changed

.eslintrc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"extends": [
3-
"@nuxtjs/eslint-config-typescript"
4-
]
2+
"extends": ["eslint-config-unjs"],
3+
"rules": {
4+
"unicorn/prevent-abbreviations": 0,
5+
"unicorn/no-null": 0
6+
}
57
}

.github/workflows/ci.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ on:
1111
jobs:
1212
ci:
1313
runs-on: ubuntu-latest
14-
1514
steps:
16-
- uses: actions/checkout@v3
17-
- uses: actions/setup-node@v2
15+
- uses: actions/checkout@v4
16+
- run: corepack enable
17+
- uses: actions/setup-node@v4
1818
with:
19-
node-version: '16'
20-
cache: yarn
21-
- run: yarn install
22-
- run: yarn prepack
23-
- run: yarn lint
24-
- run: npx node ./node_modules/.bin/mocha ./test/*.test.*
19+
node-version: 18
20+
cache: "pnpm"
21+
- run: pnpm install
22+
- run: pnpm lint
23+
- run: pnpm build
24+
- run: pnpm test:types
25+
- run: pnpm mocha ./test/*.test.*
26+
# - uses: codecov/codecov-action@v3

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/node_modules
2+
/dist
3+
test/**/dist
4+
pnpm-lock.yaml

.prettierrc

Whitespace-only changes.

CHANGELOG.md

Lines changed: 144 additions & 245 deletions
Large diffs are not rendered by default.

LICENSE

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
Copyright JS Foundation and other contributors
1+
MIT License
22

3-
Permission is hereby granted, free of charge, to any person obtaining
4-
a copy of this software and associated documentation files (the
5-
'Software'), to deal in the Software without restriction, including
6-
without limitation the rights to use, copy, modify, merge, publish,
7-
distribute, sublicense, and/or sell copies of the Software, and to
8-
permit persons to whom the Software is furnished to do so, subject to
9-
the following conditions:
3+
Copyright (c) Pooya Parsa <[email protected]>
104

11-
The above copyright notice and this permission notice shall be
12-
included in all copies or substantial portions of the Software.
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
1311

14-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
[![Standard JS][standard-js-src]][standard-js-href]
21
[![npm version][npm-version-src]][npm-version-href]
32
[![npm downloads][npm-downloads-src]][npm-downloads-href]
43
[![package phobia][package-phobia-src]][package-phobia-href]
54
[![github actions][checks-src]][checks-href]
65

7-
86
<div align="center">
97
<!-- replace with accurate logo e.g from https://worldvectorlogo.com/ -->
108
<img width="200" height="200" hspace="25" src="./assets/logo.svg">
@@ -61,49 +59,50 @@ Then add the reporter as a plugin to your webpack config.
6159
**webpack.config.js**
6260

6361
```js
64-
const webpack = require('webpack');
65-
const WebpackBar = require('webpackbar');
62+
const webpack = require("webpack");
63+
const WebpackBar = require("webpackbar");
6664

6765
module.exports = {
6866
context: path.resolve(__dirname),
69-
devtool: 'source-map',
70-
entry: './entry.js',
67+
devtool: "source-map",
68+
entry: "./entry.js",
7169
output: {
72-
filename: './output.js',
73-
path: path.resolve(__dirname)
70+
filename: "./output.js",
71+
path: path.resolve(__dirname),
7472
},
75-
plugins: [
76-
new WebpackBar()
77-
]
73+
plugins: [new WebpackBar()],
7874
};
7975
```
8076

8177
<h2 align="center">Options</h2>
8278

8379
### `name`
84-
- Default: `webpack`
80+
81+
- Default: `webpack`
8582

8683
Name.
8784

8885
### `color`
89-
- Default: `green`
86+
87+
- Default: `green`
9088

9189
Primary color (can be HEX like `#xxyyzz` or a web color like `green`).
9290

9391
### `profile`
94-
- Default: `false`
92+
93+
- Default: `false`
9594

9695
Enable profiler.
9796

9897
### `fancy`
9998

100-
- Default: `true` when not in CI or testing mode.
99+
- Default: `true` when not in CI or testing mode.
101100

102101
Enable bars reporter.
103102

104103
### `basic`
105104

106-
- Default: `true` when running in minimal environments.
105+
- Default: `true` when running in minimal environments.
107106

108107
Enable a simple log reporter (only start and end).
109108

@@ -112,7 +111,8 @@ Enable a simple log reporter (only start and end).
112111
Register a custom reporter.
113112

114113
### `reporters`
115-
- Default: `[]`
114+
115+
- Default: `[]`
116116

117117
Register an Array of your custom reporters. (Same as `reporter` but array)
118118

@@ -158,36 +158,27 @@ A reporter should be instance of a class or plain object and functions for speci
158158

159159
`context` is the reference to the plugin. You can use `context.state` to access status.
160160

161-
162161
**Schema of `context.state`:**
163162

164163
```js
165164
{
166-
start,
167-
progress,
168-
message,
169-
details,
170-
request,
171-
hasErrors
165+
start, progress, message, details, request, hasErrors;
172166
}
173167
```
174168

175169
<h2 align="center">License</h2>
176170

177-
MIT - Made with 💖 By Nuxt.js team!
171+
[MIT](./LICENSE)
178172

179173
<!-- Refs -->
174+
180175
[standard-js-src]: https://flat.badgen.net/badge/code%20style/standard/green
181176
[standard-js-href]: https://standardjs.com
182-
183177
[npm-version-src]: https://flat.badgen.net/npm/v/webpackbar/latest
184178
[npm-version-href]: https://npmjs.com/package/webpackbar
185-
186179
[npm-downloads-src]: https://flat.badgen.net/npm/dm/webpackbar
187180
[npm-downloads-href]: https://npmjs.com/package/webpackbar
188-
189181
[package-phobia-src]: https://flat.badgen.net/packagephobia/install/webpackbar
190182
[package-phobia-href]: https://packagephobia.now.sh/result?p=webpackbar
191-
192183
[checks-src]: https://flat.badgen.net/github/checks/nuxt-contrib/webpackbar/master
193184
[checks-href]: https://github.com/nuxt-contrib/webpackbar/actions

build.config.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import { defineBuildConfig } from 'unbuild'
1+
import { defineBuildConfig } from "unbuild";
22

33
export default defineBuildConfig({
44
declaration: true,
5-
emitCJS: true,
6-
inlineDependencies: true,
7-
entries: [
8-
'src/index'
9-
],
10-
externals: [
11-
'webpack'
12-
]
13-
})
5+
rollup: {
6+
emitCJS: true,
7+
inlineDependencies: true,
8+
},
9+
entries: ["src/index"],
10+
externals: ["webpack"],
11+
});

package.json

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,38 @@
1515
"dist"
1616
],
1717
"scripts": {
18+
"build": "unbuild",
1819
"dev": "webpack --config ./playground/webpack.config.cjs",
19-
"lint": "eslint --ext .ts,.mjs",
20+
"lint": "eslint --ext .ts,.mjs . && prettier -c .",
21+
"lint:fix": "eslint --fix --ext .ts,.mjs . && prettier -w .",
2022
"prepack": "unbuild",
21-
"release": "yarn test && standard-version && npm publish && git push --follow-tags",
22-
"test": "yarn lint && mocha ./test/*.test.*"
23+
"release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
24+
"test": "pnpm lint && mocha ./test/*.test.*"
2325
},
2426
"dependencies": {
25-
"chalk": "^4.1.2",
27+
"ansi-escapes": "^6.2.0",
28+
"chalk": "^5.3.0",
2629
"consola": "^3.2.3",
30+
"figures": "^6.0.1",
31+
"markdown-table": "^3.0.3",
2732
"pretty-time": "^1.1.0",
28-
"std-env": "^3.3.3"
33+
"std-env": "^3.5.0",
34+
"wrap-ansi": "^9.0.0"
2935
},
3036
"devDependencies": {
31-
"markdown-table": "^3.0.3",
32-
"figures": "^4.0.1",
33-
"ansi-escapes": "^5.0.0",
34-
"wrap-ansi": "^8.1.0",
35-
"@nuxtjs/eslint-config-typescript": "latest",
36-
"@types/mocha": "^9.1.1",
37-
"@types/node": "latest",
38-
"codecov": "latest",
39-
"eslint": "latest",
40-
"jiti": "latest",
41-
"memory-fs": "latest",
42-
"mocha": "latest",
43-
"standard-version": "latest",
44-
"typescript": "latest",
45-
"unbuild": "latest",
46-
"webpack": "latest",
47-
"webpack-cli": "latest"
37+
"@types/mocha": "^10.0.4",
38+
"@types/node": "^20.9.1",
39+
"changelogen": "^0.5.5",
40+
"eslint": "^8.53.0",
41+
"eslint-config-unjs": "^0.2.1",
42+
"jiti": "^1.21.0",
43+
"memory-fs": "^0.5.0",
44+
"mocha": "^10.2.0",
45+
"prettier": "^3.1.0",
46+
"typescript": "^5.2.2",
47+
"unbuild": "^2.0.0",
48+
"webpack": "^5.89.0",
49+
"webpack-cli": "^5.1.4"
4850
},
4951
"peerDependencies": {
5052
"webpack": "3 || 4 || 5"

playground/index.mjs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
/* eslint-disable */
2-
3-
import 'chalk';
4-
import 'eslint';
5-
import 'standard-version';
1+
// eslint-disable-next-line unicorn/import-style
2+
import "chalk";
3+
import "eslint";
4+
import "standard-version";

0 commit comments

Comments
 (0)