author | maintainer | ||
---|---|---|---|
Jack-Works |
|
Hi, Welcome to the Mask Network. Here is some note for developing Mask Network.
Storybooks are deployed to https://compassionate-northcutt-326a3a.netlify.app/
This section is going to help you to set up the development environment of Mask Network.
To develop Mask Network, you need to have ...
- Node 15 or higher
- pnpm 5+
pnpm install
If you encounter with error EACCES: permission denied, open...'
,
please run chown -R $USER /pathToYourProject/Mask
to solve.
pnpm start
is a preset of development command for Chromium-based browsers.
If you need to develop in other environments (for example, firefox), please run pnpm run go
,
it is an interactive CLI tool to help you to learn out how to compose the build flags.
- Open
chrome://extensions
- Switch on "Developer mode"
- Click "Load unpacked version"
- Select
project_root/dist
folder (in development mode)project_root/build
folder (after a production mode build).
- Open
about:debugging#/runtime/this-firefox
- Click "Load Temporary Add-on"
- Select any file in the
dist
folder
This project supports Hot Module Reload which fasten the development process.
To disable HMR, set an environment variable NO_HMR
to true.
To debug background service, click links right after Inspect views
To debug content script, open the devtools in the web page, then you can select context as the following picture describes.
It's important to select the correct context when you're debugging, otherwise you cannot access all the global variables, save as temp variables also fails.
Run the following command to start the React Devtools. It doesn't work if you install it as a browser extension.
pnpx react-devtools
Due to bug facebook/react#20377, React Devtools is conflict with React Fast Refresh.
Please use the following command, it will start the development process in profile mode, which disables React Fast Refresh and enables React Devtools.
pnpx dev profile
master
branch is our developing branch, released
branch points to the latest released version.
Git flow is recommended but not enforced.
Please use Conventional Commits when committing.
npx husky install # on project root directory
lodash
, List of unavailable functions._.chain
(not friendly to tree-shake)._.template
(see #1865)
crypto
, the Node.js built-in library cannot be used in the project. Please use Web Crypto API instead.
Do not try to pick either side of the lockfile.
Drop both "ours" and "theirs" version (then the file will be in the base version).
Then run pnpm install
to up the lockfile to date.