Skip to content

Commit 302ae96

Browse files
authored
Merge pull request #38 from aeksco/feature/add-tailwind
Version 2.0.0
2 parents fcc03c2 + 95fcdcb commit 302ae96

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+6668
-7396
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## Prerequisites
2+
3+
Please answer the following questions for yourself before submitting an issue:
4+
5+
- [ ] I am running the latest version
6+
- [ ] I checked the documentation and found no answer
7+
- [ ] I checked to make sure that this issue has not already been filed
8+
- [ ] I'm reporting the issue to the correct repository (for multi-repository projects)
9+
10+
## Context
11+
12+
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
13+
14+
## Expected Behavior
15+
16+
If relevant, please describe the behavior you are expecting
17+
18+
## Current Behavior
19+
20+
If relevant, describe the current behavior
21+
22+
## Failure Information (for bugs)
23+
24+
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.
25+
26+
### Steps to Reproduce
27+
28+
Please provide detailed steps for reproducing the issue.
29+
30+
1. step 1
31+
2. step 2
32+
3. you get it...
33+
34+
### Failure Logs
35+
36+
Please include any relevant log snippets or files here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Description
2+
3+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
4+
5+
Fixes # (issue)
6+
7+
## Type of change
8+
9+
Please delete options that are not relevant.
10+
11+
- [ ] Bug fix (non-breaking change which fixes an issue)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
- [ ] This change requires a documentation update
15+
16+
## How Has This Been Tested?
17+
18+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
19+
20+
## Checklist:
21+
22+
- [ ] My code follows the style guidelines of this project
23+
- [ ] I have performed a self-review of my own code
24+
- [ ] I have commented my code, particularly in hard-to-understand areas
25+
- [ ] I have made corresponding changes to the documentation
26+
- [ ] My changes generate no new warnings
27+
- [ ] I have added tests that prove my fix is effective or that my feature works
28+
- [ ] New and existing unit tests pass locally with my changes
29+
- [ ] Any dependent changes have been merged and published in downstream modules
30+
- [ ] I have checked my code and corrected any misspellings

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
dist/js/*
2-
.vscode
32
storybook-static/*
43

54
/node_modules

.storybook/main.js

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,21 @@ const path = require("path");
44
module.exports = {
55
stories: ["../src/**/*.stories.tsx"],
66
addons: [
7-
"@storybook/addon-actions/register",
8-
"@storybook/addon-viewport/register",
7+
"@storybook/addon-essentials",
8+
"@storybook/addon-interactions",
99
],
10+
// Enable the Storybook Interactions debugger
11+
// Docs: https://storybook.js.org/addons/@storybook/addon-interactions
12+
features: {
13+
interactionsDebugger: true,
14+
},
15+
// Configure Storybook to use Webpack@5.x
16+
// Docs: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#webpack-5
17+
core: {
18+
builder: "webpack5",
19+
},
1020
webpackFinal: async (config) => {
11-
config.module.rules.push({
12-
exclude: /node_modules/,
13-
test: /\.scss$/,
14-
use: [
15-
{
16-
loader: "style-loader", // Creates style nodes from JS strings
17-
},
18-
{
19-
loader: "css-loader", // Translates CSS into CommonJS
20-
},
21-
{
22-
loader: "sass-loader", // Compiles Sass to CSS
23-
},
24-
],
25-
});
26-
21+
// Setup @src path resolution for TypeScript files
2722
config.resolve = {
2823
...config.resolve,
2924
extensions: [".ts", ".tsx", ".js"],
@@ -32,6 +27,7 @@ module.exports = {
3227
},
3328
};
3429

30+
// Setup module replacement for mocked webextension-polyfill
3531
config.plugins = [
3632
...config.plugins,
3733
new webpack.NormalModuleReplacementPlugin(
@@ -57,6 +53,42 @@ module.exports = {
5753
),
5854
];
5955

56+
// Remove the default .css webpack module rule
57+
// This is necessary because we use both global CSS and CSS modules
58+
// in the extension and in Storybook
59+
config.module.rules = config.module.rules.filter((r) => {
60+
if (".css".match(r.test)) {
61+
return false;
62+
}
63+
return true
64+
})
65+
66+
// Treat src/css/app.css as a global stylesheet
67+
config.module.rules.push({
68+
test: /\app.css$/,
69+
use: [
70+
"style-loader",
71+
"css-loader",
72+
"postcss-loader",
73+
],
74+
})
75+
76+
// Load .module.css files as CSS modules
77+
config.module.rules.push({
78+
test: /\.module.css$/,
79+
use: [
80+
"style-loader",
81+
{
82+
loader: "css-loader",
83+
options: {
84+
modules: true,
85+
},
86+
},
87+
"postcss-loader",
88+
],
89+
})
90+
91+
// Return the final Webpack configuration
6092
return config;
6193
},
6294
};

.storybook/preview.js

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,2 @@
1-
import {
2-
addParameters,
3-
addDecorator,
4-
INITIAL_VIEWPORTS,
5-
} from "@storybook/react";
6-
import { withConsole, setConsoleOptions } from "@storybook/addon-console";
7-
import { withInfo } from "@storybook/addon-info";
8-
9-
// Configure Viewports addon
10-
addParameters({
11-
viewport: {
12-
viewports: INITIAL_VIEWPORTS,
13-
defaultViewport: "someDefault",
14-
},
15-
});
16-
17-
// You'll start to receive all console messages, warnings, errors in your action logger panel - Everything except HMR logs.
18-
setConsoleOptions({
19-
panelExclude: [],
20-
});
21-
22-
// Setup StoryInfo addon
23-
addDecorator(withInfo);
24-
25-
// You'll receive console outputs as a console,
26-
// warn and error actions in the panel. You might want to know from
27-
// what stories they come. In this case, add withConsole decorator:
28-
addDecorator((storyFn, context) => withConsole()(storyFn)(context));
1+
// Import global app.css file
2+
import "../src/css/app.css";

.vscode/extensions.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4+
// List of extensions which should be recommended for users of this workspace.
5+
"recommendations": [
6+
"esbenp.prettier-vscode",
7+
"bradlc.vscode-tailwindcss"
8+
],
9+
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
10+
"unwantedRecommendations": []
11+
}

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"css.lint.unknownAtRules": "ignore"
4+
}

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
### v2.0.0
2+
3+
- Bump `version` field in `package.json` to `2.0.0`
4+
- Upgrade `react` + `react-dom` to version `17.x`
5+
- Upgrade Storybook to version `6.4`
6+
- Upgrade `webpack` to `5.x`
7+
- Storybook stories written in Component Story Format
8+
- Add Tailwind@3.x with CSS modules
9+
- Removed Bootstrap and SCSS
10+
- Add `CONTRIBUTING.md`
11+
- Add `CHANGELOG.md`
12+
- Add `CODE_OF_CONDUCT.md`
13+
- Add `.github/PULL_REQUEST_TEMPLATE.md`
14+
- Add `.github/ISSUE_TEMPLATE.md`
15+
- Simplify Storybook tooling
16+
- Updated placeholder icon for extension
17+
- Verified support for Microsoft Edge
18+
- Updated `README.md` screenshots
19+
- Add `.vscode` directory with workplace settings and recommended extensions

CODE_OF_CONDUCT.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Code of Conduct
2+
3+
All participants of `react-typescript-web-extension-starter` are expected to abide by our Code of Conduct, both online and during in-person events that are hosted and/or associated with `react-typescript-web-extension-starter`.
4+
5+
## The Pledge
6+
7+
In the interest of fostering an open and welcoming environment, we pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
8+
9+
## The Standards
10+
11+
Examples of behaviour that contributes to creating a positive environment include:
12+
13+
- Using welcoming and inclusive language
14+
- Being respectful of differing viewpoints and experiences
15+
- Gracefully accepting constructive criticism
16+
17+
Examples of unacceptable behaviour by participants include:
18+
19+
- Trolling, insulting/derogatory comments, public or private harassment
20+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
21+
- Not being respectful to reasonable communication boundaries, such as 'leave me alone,' 'go away,' or 'I’m not discussing this with you.'
22+
- The usage of sexualised language or imagery and unwelcome sexual attention or advances
23+
- Demonstrating the graphics or any other content you know may be considered disturbing
24+
- Starting and/or participating in arguments related to politics
25+
- Other conduct which you know could reasonably be considered inappropriate in a professional setting.
26+
27+
## Enforcement
28+
29+
Violations of the Code of Conduct may be reported by sending an email to `aeksco at gmail.com`. All reports will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Further details of specific enforcement policies may be posted separately.
30+
31+
We hold the right and responsibility to remove comments or other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any members for other behaviours that they deem inappropriate, threatening, offensive, or harmful.
32+
33+
## Attribution
34+
35+
This Code of Conduct is adapted from dev.to.

CONTRIBUTING.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Contributing Guide
2+
3+
Welcome and thanks for stopping by! There are many ways to contribute, including submitting bug reports, improving documentation, submitting feature requests, reviewing new submissions, or contributing code that can be incorporated into the project.
4+
5+
**Table of Contents:**
6+
7+
1. [Code of Conduct](#code-of-conduct)
8+
2. [Questions](#questions)
9+
3. [Feature Requests](#feature-requests)
10+
4. [Reporting Bugs](#reporting-bugs)
11+
5. [Contributing Code](#contributing-code)
12+
13+
## Code of Conduct
14+
15+
By participating in this project, you agree to abide by our [Code of Conduct][0].
16+
17+
## Questions
18+
19+
Please open a GitHub issue if you have any questions about the project.
20+
21+
## Feature Requests
22+
23+
Please request new features by opening a GitHub issue.
24+
25+
## Reporting Bugs
26+
27+
**If you find a security vulnerability, do NOT open an issue. Email aeksco@gmail.COM instead.**
28+
29+
Please check open issues before opening a new ticket. Also, provide any references to FAQs or debugging guides that you might have.
30+
31+
## Contributing Code
32+
33+
Unsure where to begin contributing to this project? You can start by looking through open `help-wanted` issues!
34+
35+
Working on your first open source project or pull request? Here are some helpful tutorials:
36+
37+
- [How to Contribute to an Open Source Project on GitHub][1]
38+
- [Make a Pull Request][2]
39+
- [First Timers Only][3]
40+
41+
[0]: CODE_OF_CONDUCT.md
42+
[1]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github
43+
[2]: http://makeapullrequest.com/
44+
[3]: http://www.firsttimersonly.com

0 commit comments

Comments
 (0)