Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into htmlparser2
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s committed Jul 25, 2023
2 parents 2da7c14 + c4a7ae0 commit 66a63a9
Show file tree
Hide file tree
Showing 36 changed files with 10,783 additions and 10,719 deletions.
1 change: 1 addition & 0 deletions .commitlintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extends: non-conventional
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

8 changes: 0 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
{
"extends": "standard",
"env": {
"es2021": true,
"node": true
},
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"rules": {
"semi": [
"error",
Expand Down
52 changes: 52 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Bug Report
title: "[Bug]: "
description: File a bug report

body:
- type: markdown
attributes:
value: Thanks for taking the time to fill out this bug report!
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also describe the steps to reproduce the problem and what did you expect to happen?
placeholder: Tell us what you see!
validations:
required: true
- type: input
id: version
attributes:
label: Version
description: What version of html-minifier are you using? If it is not latest, make sure to try reproducing the issue in latest version.
placeholder: v7.0.x
validations:
required: true
- type: dropdown
id: browsers
attributes:
label: What browsers are you seeing the problem on?
multiple: true
options:
- Firefox
- Chrome
- Safari
- type: input
id: link-to-reproduce
attributes:
label: Link to reproduce
description: A Github repo or a stackblitz/codesandbox link to reproduce the issue and speedup the process
placeholder: "https://stackblitz.com/edit/..."
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: dropdown
id: submit-pr
attributes:
label: Willing to submit a PR?
options:
- 'Yes'
- 'No'
45 changes: 45 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Benchmark

on: workflow_dispatch

env:
NODE_VERSION: 16

jobs:
benchmark:
name: Benchmarks
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm

- name: Install Dependencies
run: npm ci

- name: Install Benchmark dependencies
run: npm ci
working-directory: ./benchmarks

- name: Benchmarks
run: npm run benchmark
working-directory: ./benchmarks

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: Update report
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
branch: benchmarks
title: Update benchmarks
body: |
Update benchmarks
add-paths: |
README.md
12 changes: 6 additions & 6 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
strategy:
matrix:
platform: [ubuntu-latest]
node: [12, 14, 16, 17]
node: [14, 16, 18, 'current']
name: CI - Node ${{ matrix.node }} (${{ matrix.platform }})
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: npm
Expand All @@ -27,12 +27,12 @@ jobs:
strategy:
matrix:
platform: [ubuntu-latest]
node: [12, 14, 16, 17]
node: [14, 16, 18, 'current']
name: CI - Node ${{ matrix.node }} (${{ matrix.platform }})
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: npm
Expand Down
45 changes: 32 additions & 13 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,50 @@ on:
push:
branches: master

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages-${{ github.workflow }}-${{ github.ref }}

jobs:
deploy:
build:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16

- name: Setup Pages
uses: actions/configure-pages@v1

- name: Install dependencies
run: npm ci

- name: Rollup
- name: Build lib
run: npm run build

- name: Build
- name: Build site
run: npm run build:docs

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
- name: Upload build artifact
uses: actions/upload-pages-artifact@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./demo/build
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
path: './demo/build'

deploy:
runs-on: ubuntu-latest
needs: build

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
47 changes: 47 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish

on:
push:
tags: v*

env:
NODE_VERSION: 16

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
environment:
name: npm
url: https://npm.im/html-minifier-terser

permissions:
contents: read
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: "https://registry.npmjs.org"
cache: npm

- run: node --version
- run: npm --version

- name: Install Dependencies
run: npm ci

- name: Build
run: npm run build

- name: Run Tests
run: npm run test

- run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,5 @@ $RECYCLE.BIN/
build/
temp/
tmp/
benchmarks/sources/*.html
benchmarks/generated/
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

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

npx --no-install lint-staged
npx --no -- lint-staged
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm test
2 changes: 1 addition & 1 deletion .lintstagedrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"*.js": eslint --fix
"*.{js,cjs}": eslint --fix --ignore-path .gitignore

0 comments on commit 66a63a9

Please sign in to comment.