Skip to content

Commit

Permalink
Merge branch 'newversion-1.2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayquaza01 committed Dec 29, 2020
2 parents aa74e12 + 8d041c2 commit b0fa3fe
Show file tree
Hide file tree
Showing 38 changed files with 13,892 additions and 5,678 deletions.
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf

[package.json]
[*.json]
indent_size = 2
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin/
47 changes: 19 additions & 28 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
{
"env": {
"browser": true,
"es6": true,
"webextensions": true
},
"extends": "eslint:recommended",
"rules": {
"indent": ["error", 4, { "SwitchCase": 1 }],
"quotes": ["error", "double"],
"semi": ["error", "always"],
"curly": ["error", "all"],
"eqeqeq": ["error", "always"],
"padding-line-between-statements": [
"error",
{
"blankLine": "always",
"prev": "*",
"next": "function"
}
],
"no-trailing-spaces": "error",
"comma-spacing": "error",
"no-nested-ternary": "error",
"max-depth": ["error", 4]
},
"parserOptions": {
"ecmaVersion": 2018
}
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"indent": ["error", 4, { "SwitchCase": 1 }],
"quotes": ["warn", "double"],
"semi": ["warn", "always"],
"eqeqeq": ["error", "always"],
"no-trailing-spaces": "warn",
"comma-spacing": "warn",
"no-nested-ternary": "warn",
"max-depth": ["warn", 4]
}
}
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
* text=auto

*.ts text eol=lf
*.js text eol=lf
*.json text eol=lf
*.html text eol=lf
*.css text eol=lf

*.png binary
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
*.swp
node_modules
node_modules/
dist/
.cache/
web-ext-artifacts/
31 changes: 0 additions & 31 deletions .vscode/launch.json

This file was deleted.

32 changes: 32 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Building History Cleaner 1.3.0

## System Info
* Ubuntu 20.10
* node v14.15.3
* npm 6.14.9
* bash 5.0.17
* For tool and library versions, check package.json

# Building

To build the extension, run:
```shell
# Install node modules
npm install

# Build the extension
# Moves / bundles assets to dist
npm run build:prod

# Zip extension for distribution
npm run build:extension
```
The built files will be in `./dist` and the complete extension will be `./web-ext-artifacts/history_cleaner-1.3.0.zip`

# Testing the extension

To test the extension, run:
```shell
npm run build:dev
```
This will build the extension to `./dist` and rebuild it on file changes. `./dist` can be loaded as a temporary extension in Chrome or Firefox.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
v1.3.0 Changelog
* Rewrote extension in TypeScript
* Option to change idle length
* Option to show notifications when history is deleted
* Option to delete history on startup instead of idle
* Button to manually delete history on options page
* Basic sync support
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# HistoryCleaner
Firefox addon that deletes history older than a specified amount of days.

This addon is inspired by and is a WebExtension port of [Expire History By Days](https://addons.mozilla.org/en-US/firefox/addon/expire-history-by-days/).
Delete your browsing history older than a specified number of days (to do this go into the Firefox Add-ons Manager, find History Cleaner, and set the number of days in Preferences; setting it to “0” will disable history deletion).

Set the number of days to keep history items in the options page. Setting it to 0 will disable history deletion. The deletion will occur when the browser goes idle (after about 1 minute of inactivity).
The History Cleaner icon is from [Material Design Icons](https://materialdesignicons.com/)

The icon is from [Material Design Icons](https://materialdesignicons.com/)

[Link to addon page](https://addons.mozilla.org/en-US/firefox/addon/history-cleaner/)
[AMO](https://addons.mozilla.org/en-US/firefox/addon/history-cleaner/)
18 changes: 18 additions & 0 deletions bin/build/assets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"use strict";
const cpx = require("cpx");

const src = "src/**/*.{json,png}";
const dest = "dist";

/**
* Copys assets to destination folder
* @param {boolean} production
*/
module.exports = function assets(production) {
if (production) {
cpx.copySync(src, dest);
} else {
const watch = cpx.watch(src, dest);
watch.on("copy", (e) => console.log(e.srcPath, "copied to", e.dstPath));
}
}
18 changes: 18 additions & 0 deletions bin/build/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"use strict";
const clean = require("./clean");
const bundle = require("./bundle");
const assets = require("./assets");

async function main() {
process.env.NODE_ENV = process.argv[2];
const prod = process.argv[2] === "production";

console.log("Cleaning...");
await clean();
console.log("Copying assets...");
assets(prod);
console.log("Building bundle...");
await bundle(prod);
}

main();
27 changes: 27 additions & 0 deletions bin/build/bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"use strict";
const Bundler = require("parcel-bundler");

const entryFiles = ["src/**/*.html", "src/background.ts"];

const options = {
watch: true,
target: "browser",
hmr: false,
detailedReport: false,
autoInstall: false
};

/**
* Bundles assets
* @param {boolean} production
*/
module.exports = async function bundle(production) {
if (production) {
options.watch = false;
options.detailedReport = true;
}

const bundler = new Bundler(entryFiles, options);

await bundler.bundle();
}
8 changes: 8 additions & 0 deletions bin/build/clean.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"use strict";
const mkdir = require("make-dir");
const del = require("del");

module.exports = async function clean() {
await mkdir("dist");
await del("dist/*");
}
71 changes: 0 additions & 71 deletions extension/background.js

This file was deleted.

27 changes: 0 additions & 27 deletions extension/manifest.json

This file was deleted.

22 changes: 0 additions & 22 deletions extension/options.css

This file was deleted.

35 changes: 0 additions & 35 deletions extension/options.html

This file was deleted.

Loading

0 comments on commit b0fa3fe

Please sign in to comment.