GithubHelp home page GithubHelp logo

haili042 / pri Goto Github PK

View Code? Open in Web Editor NEW

This project forked from prijs/pri

0.0 0.0 0.0 4.01 MB

Framework for React applications and components.

Home Page: https://prijs.github.io/pri-docs/

License: MIT License

JavaScript 0.05% TypeScript 99.51% EJS 0.44%

pri's Introduction

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.

pri's People

Contributors

arcthur avatar ascoders avatar charlielau avatar dependabot[bot] avatar fengliner avatar jasonhzq avatar jkmiva avatar lxylona avatar quick-bi avatar sunyimin avatar xile611 avatar zhiheng-zfm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.