First off, thank you for considering contributing to Dismoi. Dismoi is a community of great people like you, dedicated to bring the best information to others.
Take note of the code of conduct.
Most members of the team do speak 🇫🇷 French but not all as their mother tongue. Since the team is international, we use 🇬🇧 English as the default lang in code, docs, issues, etc.
For extension i18n strategy see I18N.md 🇫🇷
This section guides you through submitting a bug report. Following these guidelines helps maintainers and the community understand your report 📝, reproduce the behavior 💻 💻, and find related reports 🔎.
Explain the problem and include additional details to help maintainers reproduce the problem:
- Use a clear and descriptive title for the issue to identify the problem.
- Describe the exact steps which reproduce the problem in as many details as possible.
- Provide specific examples to demonstrate the steps.
Provide more context by answering these questions:
- Use a clear and descriptive title for the issue to identify the suggestion.
- Provide a step-by-step description of the suggested enhancement in as many details as possible.
- Provide specific examples to demonstrate the steps.
- Describe the current behavior and explain which behavior you expected to see instead and why.
- Explain why this enhancement would be useful to most users.
Unsure where to begin contributing ? You can start by looking through these [Help wanted issues][help-wanted] issues.
The process described here has several goals:
- Improve or at least maintain the quality
- Fix problems that are important to users
- Enable a sustainable system for maintainers to review contributions
After you submit your pull request, verify that all status checks are passing
What if the status checks are failing?
If a status check is failing, and you believe that the failure is unrelated to your change, please leave a comment on the pull request explaining why you believe the failure is unrelated. A maintainer will re-run the status check for you. If we conclude that the failure was a false positive, then we will open an issue to track that problem with our status check suite.While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted.
This code base consists in a set of 3 apps, written in typescript
, forming together a larger app, the Dismoi browser extension.
You should respect the following directory structure:
src/
api/
APIs related code (Dismoi backend)app/
apps and commonsbackground/
an app maintaining the long-term state (see background script on the mdn)profiles/
areact
app managing subscriptionscontent/
areact
app injected in the web pageslmem/
all domain related code
assets/
fonts, images, etc.components/
components library, organised with the atomic design methodologywebext/
all web extension related code
manifest/
base and environment specific web-extension manifeststest/
@deprecated
_prefer using a_.spec.ts
in the same directory of the tested file*app/
for Redux actions and reducers, and for React components (using enzyme).integration/
runtime tests for built web-extensions.
You can lint both TypeScript and CSS by running:
yarn lint
Code style rules are available in .eslintrc.json
.
You can manually lint *.ts
files by running the following command:
yarn lint:ts
Component are written with styled-components
.
Styling rules are available in
.stylelintrc
.
You can manually lint the styled components by running the following command:
yarn lint:css
For each new Component.ts
a new Component.story.ts
should be added.
We follow conventional commits since version 1.0.0 and we use Semantic Release to build and publish new releases.
The feat flag, in the commit, forces
semantic-release
, to increment the minor version number of the future production release.
SENTRY_ORG
, SENTRY_PROJECT
, SENTRY_DSN
and SENTRY_ENABLED
are committed in staging and production .env file because they are no secret, and we know the values we want to use depending on the environment.
Env var SENTRY_SEND_VERSION
is not defined in any .env file but forced by npm script when using buildVersion
instead of build
script, thus triggering the upload of the built version to Sentry service.
Such operation (that you should not have to run on your machine) does need a .sentryclirc file with the user token
to complete:
[auth]
token=4d786d88c7d9436282c35b4eb82ae2dfeaff5ee296e3404ba3654ab62c151b73
Note: You'll find your token here https://sentry.io/settings/account/api/auth-tokens/
We use Redux DevTools to inspect Redux actions and state changes. Once installed, from the Redux DevTools extension’s context menu, choose “Open Remote DevTools” for remote monitoring.
Environment variables are taken from multiple .env
files.
From highest to lowest priority:
.env.${NODE_ENV}.local
.env.${NODE_ENV}
.env.local
.env
In development you should create a copy of .env.development.example
to .env.development
and adjust the values.
To run automation, create a copy of .env.example
to .env
and adjust values.
Note: The test environment ignores local files.
Note 2: This configuration was inspired by Parcel
List of environments:
staging
: staging extension onstaging
APIproding
: staging extension onproduction
APIproduction
: production ready extension onproduction
API
To build production packages
You can build any variations of the extension by playing with environment variables and this webpack
command:
NODE_ENV=production|proding|staging, FACET=dismoi|lmel webpack --mode=production --env.PLATFORM=firefox|chromium --env.SENTRY_ENABLED
For each
feature
,fix
, etc... we create a new branch and then a PR withmaster
as the target branch.
Once the PR is merged into master
a build is triggered on SemaphoreCI
staging
and proding
environment are automatically deployed on Clever Cloud on a new push on the master
branch:
DisMoi production
profiles app is available at https://www.dismoi.io/eclaireurs/.
This is a Wordpress page and the Js bundles are actually hosted at https://profiles.dismoi.io/ and imported in https://www.dismoi.io/eclaireurs/ :
https://profiles.dismoi.io/js/profiles.bundle.js?ver=3.77.1 https://profiles.dismoi.io/js/1.chunk.js?ver=3.77.1 ```
- Deployment on Clever Cloud is done via git :
git remote add production-profiles git+ssh://[email protected]/app_b47e0ed5-d153-4cc4-a306-28fe156c5cee.git
git checkout master
git push production-profiles HEAD
- You may then update the Js bundle version in the Divi theme options, to force cache refresh:
- https://www.dismoi.io/wp-admin/customize.php?et_customizer_option_set=theme
- VERSION JS BUNDLE POUR LA PAGE "LES CONTRIBUTEURS"
Once the build passes, an automatic semantic-release
script is triggered.
Roughly, this deploy process bumps the version number in package.json
and build each packages for each platform and each environment:
Once built each package is released on Github and on Firefox store as unlisted
version (not Chrome because the publication on the Chrome store may take a while -- days -- to be validated).
See the detailed deploy steps
./release.config.js
in project root directory.
These deployments process are manual, and are triggered from Semaphore
once the staging has been functionally validated.
Make you sure have access to semaphore and wait until the last master built is completed with success: https://semaphoreci.com/lmem/extension/branches/master
- Then click on the last master build and click "Deploy manually".
- Tick one of the
Firefox: Production
,Chromium: Staging & Proding
,Chromium: Production
, checkboxes
chrome webstore account:
Ask for the password from a super user! OR A super user may add your own google account to the developer group.
To generate your own tokens and deploy from your local environment : https://github.com/DrewML/chrome-webstore-upload/blob/master/How%20to%20generate%20Google%20API%20keys.md
In order for the Mozilla review to complete successfully, please the following steps :
- Use SemaphoreCI to deploy to
Firefox production
- Download the source code archive of the version you want to deploy to production extension (
Source code (tar.gz)
) - Once version is available in Developer Hub, click on the version number, and upload the
tar.gz
inSource code
field.
There are still issues at Mozilla preventing us to upload the source code automatically.