Skip to content

Commit

Permalink
Merge pull request #41 from yousifalraheem/chore/update-dependencies
Browse files Browse the repository at this point in the history
Chore/update dependencies
  • Loading branch information
yousifalraheem authored Mar 29, 2022
2 parents 9251925 + e82c4dd commit 440cd02
Show file tree
Hide file tree
Showing 36 changed files with 32,115 additions and 33,406 deletions.
10 changes: 10 additions & 0 deletions .babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": { "node": "current" }
}
]
]
}
12 changes: 12 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"env": {
"node": true,
"browser": true,
"es2021": true
},
"extends": ["eslint:recommended", "prettier"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
}
}
24 changes: 13 additions & 11 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Release
on:
push:
branches:
- main
- main

jobs:
publish-npm:
Expand Down
32 changes: 20 additions & 12 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,29 @@ on:

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x]
node-version: [14.x, 16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build
- run: npm test
- run: npm run test:project
- run: npm run build:docs
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Installing dependencies
run: npm ci && npm ci --prefix test-project
- name: Checking formatting with Prettier
run: npm run format:check
- name: Checking code with ESLint
run: npm run lint
- name: Building the package
run: npm run build
- name: Running tests
run: npm test
- name: Testing the package in a temporary project
run: npm run test:project
- name: Building the documentation
run: npm run build:docs
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit "$1"
7 changes: 7 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

echo eslint --fix . &&
echo "✅ eslint finished successfully" &&
prettier --write --ignore-unknown . &&
echo "✅ Prettier finished successfully"
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage
dist
node_modules
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"printWidth": 120,
"singleQuote": false,
"arrowParens": "avoid",
"semi": true,
"tabWidth": 2,
"trailingComma": "all"
}
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[![https://img.shields.io/npm/v/rollup-plugin-summary](https://img.shields.io/npm/v/rollup-plugin-summary)](https://www.npmjs.com/package/rollup-plugin-summary)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=sebgroup/frontend-tools)](https://dependabot.com)
![https://img.shields.io/github/languages/top/yousifalraheem/rollup-plugin-summary](https://img.shields.io/github/languages/top/yousifalraheem/rollup-plugin-summary)
![https://img.shields.io/npm/l/rollup-plugin-summary](https://img.shields.io/npm/l/rollup-plugin-summary)
![npm bundle size](https://img.shields.io/bundlephobia/minzip/rollup-plugin-summary)
[![codecov](https://codecov.io/gh/yousifalraheem/rollup-plugin-summary/branch/master/graph/badge.svg)](https://codecov.io/gh/yousifalraheem/rollup-plugin-summary)
[![Release](https://github.com/yousifalraheem/rollup-plugin-summary/actions/workflows/release.yml/badge.svg)](https://github.com/yousifalraheem/rollup-plugin-summary/actions/workflows/release.yml)

# rollup-plugin-summary

A rollup plugin that summarizes the output of the build. Under the hood, it uses [rollup-plugin-filesize](https://www.npmjs.com/package/rollup-plugin-filesize) to calculate file sizes and display them in a tabular form using [as-table](https://www.npmjs.com/package/as-table) and color it with [chalk](https://www.npmjs.com/package/chalk).

<img src="docs/assets/sample_output.png" alt="Sample output" />
Expand All @@ -33,17 +33,16 @@ yarn add -D rollup-plugin-summary

## Usage

File: *`rollup.config.js`*
File: _`rollup.config.js`_

```javascript
import summary from 'rollup-plugin-summary';
import summary from "rollup-plugin-summary";

export default {
plugins: [
summary(),
]
}
plugins: [summary()],
};
```

<!-- github-only-start -->

<hr/>
Expand All @@ -57,4 +56,5 @@ Read the full [documentation](https://yousifalraheem.github.io/rollup-plugin-sum
## License

MIT

<!-- github-only-end -->
1 change: 0 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Security Policy


## Reporting a Vulnerability

Please submit an issue and I will try to fix it as soon as I can. 🙂
12 changes: 0 additions & 12 deletions babel.config.js

This file was deleted.

3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
};
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
theme: jekyll-theme-cayman
theme: jekyll-theme-cayman
14 changes: 7 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ Here is an example of how it's used:

```javascript
{
plugins: [
summary({
warnLow: 1000,
warnHigh: 3000,
showMinifiedSize: false
})
]
plugins: [
summary({
warnLow: 1000,
warnHigh: 3000,
showMinifiedSize: false,
}),
];
}
```

Expand Down
98 changes: 49 additions & 49 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
import { Plugin } from 'rollup';
import { Plugin } from "rollup";

declare interface SummaryPrint {
Name: string;
Size: string;
Minified: string;
Gzipped: string;
Brotli: string;
Name: string;
Size: string;
Minified: string;
Gzipped: string;
Brotli: string;
}

declare interface SummaryOptions {
/**
* Minimum size in bytes to be highlighted in yellow.
* @default 5000
* @description
* This is used to warn (in yellow) about the files whom on the brink of exceeding the acceptable pre-defined file size
*/
warnLow?: number;
/**
* Minimum size in bytes to be highlighted in red.
* @default 10000
* @description
* This is used to alert (in red) about files that exceeded the acceptable pre-defined file size
*/
warnHigh?: number;
/**
* Minimum total size in bytes to be highlighted in yellow.
* @default 200000
* @description
* This is used to warn (in yellow) about the total build size if it comes nearly below maximum acceptable pre-defined size
*/
totalLow?: number;
/**
* Minimum total size in bytes to be highlighted in red.
* @default 300000
* @description
* This is used to alert (in red) about the total build size if it exceeds the acceptable pre-defined size
*/
totalHigh?: number;
/**
* Show file size in Brotli compression.
* @default true
*/
showBrotliSize?: boolean;
/**
* Show file size minified.
* @default true
*/
showMinifiedSize?: boolean;
/**
* Show file size Gzipped.
* @default true
*/
showGzippedSize?: boolean;
/**
* Minimum size in bytes to be highlighted in yellow.
* @default 5000
* @description
* This is used to warn (in yellow) about the files whom on the brink of exceeding the acceptable pre-defined file size
*/
warnLow?: number;
/**
* Minimum size in bytes to be highlighted in red.
* @default 10000
* @description
* This is used to alert (in red) about files that exceeded the acceptable pre-defined file size
*/
warnHigh?: number;
/**
* Minimum total size in bytes to be highlighted in yellow.
* @default 200000
* @description
* This is used to warn (in yellow) about the total build size if it comes nearly below maximum acceptable pre-defined size
*/
totalLow?: number;
/**
* Minimum total size in bytes to be highlighted in red.
* @default 300000
* @description
* This is used to alert (in red) about the total build size if it exceeds the acceptable pre-defined size
*/
totalHigh?: number;
/**
* Show file size in Brotli compression.
* @default true
*/
showBrotliSize?: boolean;
/**
* Show file size minified.
* @default true
*/
showMinifiedSize?: boolean;
/**
* Show file size Gzipped.
* @default true
*/
showGzippedSize?: boolean;
}

/**
Expand Down
Loading

0 comments on commit 440cd02

Please # to comment.