Socket
Socket
Sign inDemoInstall

pri

Package Overview
Dependencies
132
Maintainers
8
Versions
848
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pri

**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.**


Version published
Weekly downloads
22
increased by4.76%
Maintainers
8
Created
Weekly downloads
Ā 

Readme

Source

Pri Ā· npm version

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.

Features

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.

see Docs

Using pri

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

Using pri plugin

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

File Structure

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`.

Inspired

Q&A

Using in windows

fedora. Using windows subsystem for Linux.

Migrate from 0.x/1.x to 2.x

Two steps:

  1. Run npx pri-migrate-one-to-two in your project root path.
  2. Reinstall node_modules.

FAQs

Last updated on 16 Feb 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with āš”ļø by Socket Inc