Skip to content

Commit

Permalink
Merge pull request #32 from ParkerM/develop
Browse files Browse the repository at this point in the history
v0.0.4
  • Loading branch information
ParkerM authored May 21, 2021
2 parents abc7469 + a0d387c commit 6574193
Show file tree
Hide file tree
Showing 15 changed files with 1,584 additions and 1,496 deletions.
2 changes: 2 additions & 0 deletions .commitlintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
extends:
- "@commitlint/config-conventional"
1 change: 0 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ plugins:
extends:
- plugin:no-unsanitized/DOM
- plugin:@typescript-eslint/recommended
- prettier/@typescript-eslint
- plugin:prettier/recommended
rules:
comma-dangle:
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Lint Commit Messages

on: pull_request

jobs:
commitlint:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v2
with:
configFile: .commitlintrc.yml
41 changes: 35 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on: push

jobs:
lint:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: '12.x'
node-version: '14'
- name: Install dependencies
run: yarn --frozen-lockfile

Expand All @@ -21,15 +21,44 @@ jobs:
run: yarn run lint:web-ext

test:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: '12.x'
node-version: '14'
- name: Install dependencies
run: yarn --frozen-lockfile

- name: Jest tests
run: yarn run test:coverage

- name: Upload coverage artifacts
if: ${{ github.ref == 'refs/heads/develop' }}
uses: actions/upload-artifact@v2
with:
name: coverage-report
path: coverage

report:
if: ${{ github.ref == 'refs/heads/develop' }}
needs: test
runs-on: ubuntu-20.04

steps:
- name: Download coverage report
uses: actions/download-artifact@v2
with:
name: coverage-report
path: coverage

- name: Generate coverage badge
run: npx make-coverage-badge --output-path ./coverage/lcov-report/badge.svg

- name: Publish coverage report
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./coverage/lcov-report
destination_dir: coverage
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ on:
jobs:
release:
name: Build Release
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: '12.x'
node-version: '14'
- name: Install dependencies
run: yarn --frozen-lockfile

Expand Down
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
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"

yarn commitlint --edit
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.0.4](https://github.com/ParkerM/close-tabs-to-left/compare/v0.0.3...v0.0.4) (2021-05-21)

**Note:** Version bump for initial CHANGELOG.md and conventional-changelog integration


### [0.0.3](https://github.com/ParkerM/close-tabs-to-left/compare/v0.0.2...v0.0.3) (2021-02-23)

#### Features
* Basic i18n support

#### Bug Fixes
* Pinned tabs are now ignored


### [0.0.2](https://github.com/ParkerM/close-tabs-to-left/compare/v0.0.1...v0.0.2) (2020-06-13)

#### Features
* The menu item is now greyed-out when there are no tabs to the left
* Removed tacky icon from menu item


### [0.0.1](https://github.com/ParkerM/close-tabs-to-left/tree/v0.0.1) (2020-03-18)

#### Features
* Initial release
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# close-tabs-to-left
<p align="left">
<a href="https://github.com/ParkerM/close-tabs-to-left/actions"><img alt="CI status" src="https://github.com/ParkerM/close-tabs-to-left/workflows/CI/badge.svg"></a>
<a href="https://parkerm.github.io/close-tabs-to-left/coverage"><img alt="Coverage report" src="https://parkerm.github.io/close-tabs-to-left/coverage/badge.svg"></a>
</p>

Firefox extension that adds "Close Tabs to the Left" context menu entry.
Expand All @@ -9,8 +10,8 @@ Firefox extension that adds "Close Tabs to the Left" context menu entry.
See [package.json](./package.json) for more info on the yarn scripts mentioned here.

### Requirements
- Node.js 12+
- yarn 1.2+
- Node.js 14
- yarn 1.22+

### Install
```bash
Expand All @@ -37,6 +38,18 @@ yarn start
```
See `start:dev-es` in [package.json](./package.json) for a working configuration.

### Generate changelog
Generates and commits a changelog and version bumps based on conventional commit rules.

```bash
yarn run stage
```

The following scripts are also provided to override automatic semver detection:
* `yarn run stage:patch`
* `yarn run stage:minor`
* `yarn run stage:major`

### Build and package release
Outputs a production-ready build artifact to `./web-ext-artifacts`.

Expand Down
9 changes: 9 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,13 @@ module.exports = {
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.ts$',
moduleFileExtensions: ['ts', 'js'],
setupFilesAfterEnv: ['./src/setupTests.ts'],
coverageReporters: [
// defaults
'json',
'lcov',
'text',
'clover',
// required for make-coverage-badge
'json-summary',
],
};
6 changes: 4 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"default_locale": "en",
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "0.0.3",
"version": "0.0.4",
"homepage_url": "https://github.com/ParkerM/close-tabs-to-left",
"developer": {
"name": "Parker Mauney",
Expand All @@ -16,7 +16,9 @@
}
},
"background": {
"scripts": ["dist/background.js"]
"scripts": [
"dist/background.js"
]
},
"permissions": [
"menus",
Expand Down
37 changes: 22 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "close-tabs-to-left",
"version": "0.0.3",
"version": "0.0.4",
"main": "index.js",
"license": "MIT",
"repository": "github:ParkerM/close-tabs-to-left",
Expand All @@ -14,36 +14,43 @@
"test:coverage": "jest --coverage",
"build": "webpack --mode=development",
"build-release": "webpack --mode=production",
"stage": "npx standard-version --skip.tag",
"stage:patch": "yarn run stage --release-as patch",
"stage:minor": "yarn run stage --release-as minor",
"stage:major": "yarn run stage --release-as major",
"pack": "web-ext build",
"release": "yarn run build-release && yarn run pack"
"release": "yarn run build-release && yarn run pack",
"prepare": "husky install"
},
"engines": {
"node": ">=12.x",
"node": "^14.x",
"yarn": "^1.x"
},
"private": true,
"devDependencies": {
"@types/jest": "^26.0.20",
"@typescript-eslint/eslint-plugin": "^4.15.2",
"@typescript-eslint/parser": "^4.15.2",
"clean-webpack-plugin": "^3.0.0",
"eslint": "^7.20.0",
"eslint-config-prettier": "^7.2.0",
"@commitlint/cli": "^12.1.1",
"@commitlint/config-conventional": "^12.1.1",
"@types/jest": "^26.0.22",
"@typescript-eslint/eslint-plugin": "^4.20.0",
"@typescript-eslint/parser": "^4.20.0",
"eslint": "^7.23.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-no-unsanitized": "^3.1.4",
"eslint-plugin-prettier": "^3.3.1",
"husky": "^6.0.0",
"jest": "^26.6.3",
"mockzilla": "^0.9.0",
"mockzilla-webextension": "^0.9.0",
"prettier": "^2.2.1",
"source-map-loader": "^2.0.1",
"source-map-support": "^0.5.19",
"ts-jest": "^26.5.1",
"ts-loader": "^8.0.17",
"typescript": "^4.1.5",
"web-ext": "^5.5.0",
"ts-jest": "^26.5.4",
"ts-loader": "^8.1.0",
"typescript": "^4.2.3",
"web-ext": "^6.0.0",
"webextension-polyfill-ts": "^0.25.0",
"webpack": "^5.24.0",
"webpack-cli": "^4.5.0"
"webpack": "^5.30.0",
"webpack-cli": "^4.6.0"
},
"dependencies": {}
}
2 changes: 1 addition & 1 deletion web-ext-config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const globalIgnorePatterns = ['src', 'coverage', '*.json', '*.lock', '*.js', 'README.md', 'dist/*.map'];
const globalIgnorePatterns = ['src', 'coverage', '*.json', '*.lock', '*.js', 'CHANGELOG.md', 'README.md', 'dist/*.map'];
const globalIncludePatterns = ['manifest.json'];
const createFileFilter = (ignore = [], include = []) =>
globalIgnorePatterns.concat(ignore).concat(globalIncludePatterns.concat(include).map(s => `!${s}`));
Expand Down
3 changes: 1 addition & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path');
const {CleanWebpackPlugin} = require('clean-webpack-plugin');

module.exports = {
mode: 'development', // explicitly provide --mode=production for prod builds
Expand All @@ -10,8 +9,8 @@ module.exports = {
output: {
filename: '[name].js',
path: __dirname + '/dist',
clean: true,
},
plugins: [new CleanWebpackPlugin()],
devtool: 'source-map',
resolve: {
extensions: ['.ts', '.js', '.json'],
Expand Down
Loading

0 comments on commit 6574193

Please sign in to comment.