Pri is a toolkit for building web applications with React. Helps you deal with everything with develop, so you can focus on the business logic.
Pri can help you develop project and component.
- ๐ฑ Auto router. File-based routing out of the box.
- ๐ Mdx support. Write markdown page easily, just create a file using
.md
or.mdx
as suffixes. - ๐ Static export. Very easy to deploy to github pages.
- ๐ข Mocks. Using service worker to mock request!
- ๐ WebUI. You can create page, or config files by click button in webui!
- ๐ Dynamic Import. Automatic page level dynamic routing.
- ๐ฅ Typescript. 100% typescript source code, for project maintainability considerations, only TS projects are supported!
- ๐๏ธ Configuration file auto creator. Never worry about configuration files and updates of configuration files. This is automatic.
- ๐ Auto dll. Speed up hot loader.
- ๐ Pluginable. 20+ built-in plugins, and more community plug-ins.
- 0๏ธโฃ Zero-config.
Pri is used as a npm package installed in your project.
# 1. Create an empty folder, install pri locally.
$ npm i pri --save # /workspace/my-empty-folder
# 2. Init project files, and you will have following npm scripts.
$ npx pri init # Choose project or component.
# Start dev server
$ npm start
# Start docs server
$ npm run docs
# Build
$ npm run build
# Test
$ npm test
Read more npm scripts.
# Preview of production environment
$ npm run preview
# See bundle size analyse
$ npm run analyse
# Bundle to one file
$ npm run bundle
# Format all sources code
$ npm run format
Installing the pri plugin into the project will take effect.
For example, using pri-plugin-dob:
npm i pri-plugin-dob --save
# Now all plugin works
npm start
Project:
.
โโโ .temp # Gitignored. Temporary file folder.
โโโ coverage # Gitignored. Code coverage folder.
โโโ dist # Gitignored. Dist folder, auto generated by `npm run build`.
โโโ tests # Tests folder.
โโโ src # Source files folder.
โ โโโ pages # Page files.
โ โโโ layouts # Layout files.
โ โโโ components # Component files.
โ โโโ utils # Util files.
โโโ priconfig.json # Config file.
โโโ ...other-files # Auto generated by `npx pri init`.
Component:
.
โโโ .temp # Gitignored. Temporary file folder.
โโโ coverage # Gitignored. Code coverage folder.
โโโ dist # Gitignored. Dist folder, auto generated by `npm run build`.
โโโ tests # Tests folder.
โโโ src # Source files folder. Anything here.
โโโ priconfig.json # Config file.
โโโ ...other-files # Auto generated by `npx pri init`.
fedora. Using windows subsystem for Linux.
Two steps:
- Run
npx pri-migrate-one-to-two
in your project root path. - Reinstall node_modules.