Skip to content

Commit 2dbd09c

Browse files
committed
Merge remote-tracking branch 'origin/development'
# Conflicts: # yarn.lock
2 parents 45c2efc + 0611a24 commit 2dbd09c

19 files changed

+2490
-7175
lines changed

.babelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[
44
"@babel/preset-env",
55
{
6+
"corejs": "3",
67
"useBuiltIns": "entry"
78
}
89
],

.eslintrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
2-
"parser": "babel-eslint",
2+
"parser": "@babel/eslint-parser",
33
"plugins": ["prettier"],
44
"rules": {
55
"prettier/prettier": "error"
6-
}
6+
},
7+
"extends": ["prettier", "prettier/prettier", "prettier/react"]
78
}

.vscode/settings.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{
22
"[markdown]": {
33
"editor.formatOnSave": false
4-
}
4+
},
5+
"editor.codeActionsOnSave": {
6+
"source.fixAll": true
7+
},
8+
"editor.tabSize": 4,
9+
"editor.defaultFormatter": "esbenp.prettier-vscode",
10+
"editor.formatOnSave": true,
11+
"editor.formatOnType": true
512
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Works for Chrome, Opera, Edge & Firefox.
4646
> As test runner we use karma, as testing framework mocha.
4747
> As support to assertion we use chai.
4848
49-
## Run & Installation
49+
## Run & Installation
5050

5151
>### Run & Build
5252
>
@@ -76,7 +76,7 @@ Works for Chrome, Opera, Edge & Firefox.
7676

7777
>The following tasks can be used when you want to start developing the extension
7878
>and want to enable live reload -
79-
>`npm run watch-dev` or `yarn watch-dev`
79+
>`npm run watch` or `yarn watch`
8080
8181
## Packaging
8282

karma.conf.js

Lines changed: 0 additions & 55 deletions
This file was deleted.

package.json

Lines changed: 38 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,59 +4,51 @@
44
"description": "Boilerplate for Chrome, FF, Opera extension",
55
"main": "webpack.config.js",
66
"scripts": {
7-
"test": "karma start",
87
"start": "webpack --config webpack.config.dev.js",
9-
"watch-dev": "webpack --config webpack.config.dev.js --watch",
8+
"watch": "webpack --config webpack.config.dev.js --watch",
109
"build": "webpack --config webpack.config.dist.js",
11-
"lint-fix": "eslint --ext js,jsx src --fix"
10+
"lint-fix": "eslint --ext js,jsx src --fix"
1211
},
1312
"author": "Web Dev",
1413
"dependencies": {
15-
"@babel/core": "^7.5.5",
16-
"@babel/plugin-proposal-class-properties": "^7.8.3",
17-
"@babel/polyfill": "^7.8.7",
18-
"@babel/preset-env": "^7.5.5",
19-
"@babel/preset-react": "^7.0.0",
20-
"babel-eslint": "^10.0.2",
21-
"babel-loader": "^8.0.6",
22-
"chai": "^4.2.0",
23-
"clean-webpack-plugin": "^0.1.19",
24-
"copy-webpack-plugin": "^4.6.0",
25-
"css-loader": "^0.28.11",
26-
"enzyme": "^3.10.0",
27-
"enzyme-adapter-react-16": "^1.14.0",
28-
"eslint": "^4.19.1",
29-
"eslint-config-airbnb": "^16.1.0",
30-
"eslint-config-prettier": "^6.0.0",
31-
"eslint-loader": "^2.2.1",
32-
"eslint-plugin-babel": "^5.3.0",
33-
"eslint-plugin-import": "^2.18.2",
34-
"eslint-plugin-jsx-a11y": "^6.2.3",
35-
"eslint-plugin-mocha": "^5.3.0",
36-
"eslint-plugin-node": "^9.1.0",
37-
"eslint-plugin-prettier": "^3.1.0",
38-
"eslint-plugin-react": "^7.14.3",
39-
"html-webpack-plugin": "^3.2.0",
40-
"jest-enzyme": "^6.1.2",
41-
"karma": "^2.0.5",
42-
"karma-chrome-launcher": "^2.2.0",
43-
"karma-cli": "^1.0.1",
44-
"karma-mocha": "^1.3.0",
45-
"karma-sourcemap-loader": "^0.3.7",
46-
"karma-webpack": "^3.0.5",
47-
"mocha": "^5.2.0",
48-
"node-sass": "^4.12.0",
14+
"@babel/core": "^7.12.13",
15+
"@babel/eslint-parser": "^7.12.13",
16+
"@babel/plugin-proposal-class-properties": "^7.12.13",
17+
"@babel/preset-env": "^7.12.13",
18+
"@babel/preset-react": "^7.12.13",
19+
"babel-loader": "^8.2.2",
20+
"clean-webpack-plugin": "^3.0.0",
21+
"copy-webpack-plugin": "^7.0.0",
22+
"core-js": "^3.8.3",
23+
"css-loader": "^5.0.1",
24+
"eslint": "^7.19.0",
25+
"eslint-config-airbnb": "^18.2.1",
26+
"eslint-config-prettier": "^7.2.0",
27+
"eslint-plugin-babel": "^5.3.1",
28+
"eslint-plugin-import": "^2.22.1",
29+
"eslint-plugin-jsx-a11y": "^6.4.1",
30+
"eslint-plugin-prettier": "^3.3.1",
31+
"eslint-plugin-react": "^7.22.0",
32+
"eslint-plugin-react-hooks": "^4.2.0",
33+
"eslint-webpack-plugin": "^2.4.3",
34+
"html-webpack-plugin": "^4.5.1",
35+
"node-sass": "^5.0.0",
4936
"prop-types": "^15.7.2",
50-
"react": "^16.8.6",
51-
"react-dom": "^16.8.6",
52-
"sass-loader": "^7.1.0",
53-
"style-loader": "^0.21.0",
54-
"uglifyjs-webpack-plugin": "^1.3.0",
55-
"webpack": "^4.37.0",
56-
"webpack-cli": "^3.3.6",
57-
"zip-webpack-plugin": "^3.0.0"
37+
"react": "^17.0.1",
38+
"react-dom": "^17.0.1",
39+
"sass-loader": "^10.1.1",
40+
"style-loader": "^2.0.0",
41+
"terser-webpack-plugin": "^5.1.1",
42+
"webpack": "^5.20.0",
43+
"webpack-cli": "^4.5.0",
44+
"zip-webpack-plugin": "^4.0.1"
5845
},
5946
"devDependencies": {
60-
"prettier": "^2.1.2"
47+
"prettier": "^2.2.1"
48+
},
49+
"license": "SEE LICENSE IN LICENSE",
50+
"repository": {
51+
"type": "git",
52+
"url": "https://github.com/WebExp0528/React-Extension-Boilerplate"
6153
}
6254
}

src/components/button/button.spec.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/components/button/button.jsx renamed to src/components/button/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from "react";
22
import PropTypes from "prop-types";
33
import "./button.scss";
44

5-
const Button = (props) => (
5+
export const Button = (props) => (
66
<button className="icbs-button" onClick={props.action}>
77
{props.label}
88
</button>

src/options/index.html

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
11
<!DOCTYPE html>
22
<html>
3-
<head>
4-
<meta charset="utf-8" />
5-
<link href="styles/options.css" rel="stylesheet" />
6-
<meta name="viewport" content="width=device-width,initial-scale=1" />
7-
<title>Options & Settings</title>
8-
</head>
9-
<body class="wrap">
10-
<div class="grid">
11-
<div class="unit whole center-on-mobiles">
12-
<div class="heading">
13-
<h1>Extension Boilerplate</h1>
14-
<p class="lead">
15-
A foundation for creating cross-browser extensions
16-
</p>
17-
</div>
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<link href="styles/options.css" rel="stylesheet" />
7+
<meta name="viewport" content="width=device-width,initial-scale=1" />
8+
<title>Options & Settings</title>
9+
</head>
10+
11+
<body class="wrap">
12+
<div class="grid">
13+
<div class="unit whole center-on-mobiles">
14+
<div class="heading">
15+
<h1>Extension Boilerplate</h1>
16+
<p class="lead">
17+
A foundation for creating cross-browser extensions
18+
</p>
1819
</div>
1920
</div>
21+
</div>
2022

21-
<section id="display-container"></section>
23+
<section id="display-container"></section>
2224

23-
<footer class="main-footer">
24-
<div class="grid">
25-
<div class="unit whole center-on-mobiles">
26-
<p class="text-center text-muted">
27-
&copy; Extension Boilerplate
28-
</p>
29-
</div>
25+
<footer class="main-footer">
26+
<div class="grid">
27+
<div class="unit whole center-on-mobiles">
28+
<p class="text-center text-muted">
29+
&copy; Extension Boilerplate
30+
</p>
3031
</div>
31-
</footer>
32-
</body>
33-
</html>
32+
</div>
33+
</footer>
34+
</body>
35+
36+
</html>
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
2-
import Button from "components/button/button";
3-
import sendMessage from "../../services/comunicationManager";
2+
import Button from "components/Button";
3+
import sendMessage from "./services/comunicationManager";
44

55
function setGreen() {
66
sendMessage("change-color", { color: "green" });
@@ -10,9 +10,11 @@ function setRed() {
1010
sendMessage("change-color", { color: "red" });
1111
}
1212

13-
export default () => (
13+
export const Popup = () => (
1414
<div>
1515
<Button label="green" action={setGreen} />
1616
<Button label="red" action={setRed} />
1717
</div>
1818
);
19+
20+
export default Popup;

0 commit comments

Comments
 (0)