Installations
npm install egg-react-typescript-boilerplate
Developer Guide
Typescript
No
Module System
N/A
Min. Node Version
>=10.0.0
Node Version
18.20.4
NPM Version
10.7.0
Score
45.5
Supply Chain
80.1
Quality
67.7
Maintenance
30
Vulnerability
95.1
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (56.77%)
JavaScript (43.23%)
Developer
Download Statistics
Total Downloads
5,973
Last Day
3
Last Week
17
Last Month
67
Last Year
514
GitHub Statistics
56 Stars
52 Commits
20 Forks
4 Watching
6 Branches
1 Contributors
Package Meta Information
Latest Version
5.1.2
Package Id
egg-react-typescript-boilerplate@5.1.2
Unpacked Size
567.64 kB
Size
468.08 kB
File Count
82
NPM Version
10.7.0
Node Version
18.20.4
Publised On
08 Sept 2024
Total Downloads
Cumulative downloads
Total Downloads
5,973
Last day
200%
3
Compared to previous day
Last week
466.7%
17
Compared to previous week
Last month
219%
67
Compared to previous month
Last year
-39.5%
514
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
28
egg-react-typescript-boilerplate
基于 Egg + React + TypeScript + Webpack 服务端渲染工程骨架
版本
- Egg 版本: ^2.x.x
- Node 版本: Node ^8.x.x+,
- Webpack 版本: ^4.x.x
- React 版本: ^16.0.0
- TypeScript: ^3.0.0
文档
特性
-
支持 Egg Node 端代码和前端代码 TypeScript 编写和构建
-
支持 Node 和 asyncData 方式获取数据进行渲染
-
支持多页面(MPA) 和 单页面(SPA) 服务端渲染(SSR)和前端渲染(CSR)
-
支持 AntD 按需加载和主题配置功能以及 MobX 应用
-
支持 Webpack 时时编译和热更新,
npm run dev
一键启动应用 -
支持开发环境, 测试环境,正式环境 Webpack 编译
依赖
运行
安装依赖
1npm install
本地启动应用
1npm run dev
应用访问: http://127.0.0.1:7001
构建文件
- TypeScript Egg 构建
1npm run tsc
- TypeScript 前端工程构建
1npm run build
打包部署
- 先运行
npm run tsc
和npm run build
构建 TypeScript Egg 代码和 TypeScript 前端代码 - 项目代码和构建代码一起打包代码
- 应用部署后,通过
npm start
启动应用
开发
编写前端代码
添加
${root}/app/web/page/demo.tsx
前端代码
1'use strict'; 2import React, { Component } from 'react'; 3class Demo extends Component<any, any> { 4 render() { 5 const { title, article } = this.props; 6 return <div> 7 <h1 className="easy-article-detail-title">{title}</h1> 8 <h3 className="easy-article-detail-title">{article.title}</h3> 9 <div>{article.content}</div> 10 </div>; 11 } 12} 13export default Demo;
编写 Node 代码
添加
${root}/app/controller/demo.ts
Node 代码
1import { Controller, Context } from 'egg'; 2 3export default class DemoController extends Controller { 4 public async index(ctx: Context) { 5 const title = 'Node 直接获取渲染数据'; 6 const article = await ctx.service.article.query({ id: Number(id) }); 7 await ctx.render('demo.js', { title, article }); 8 } 9}
Egg 路由配置
添加
${root}/app/router.ts
Egg 路由配置
1import { Application } from 'egg'; 2export default (app: Application) => { 3 const { router, controller } = app; 4 router.get('/demo', controller.demo.index); 5};
Webpack 构建配置
添加
${root}/webpack.config.js
新增页面 entry 配置
1module.exports = { 2 entry: { 3 demo: 'app/web/page/demo.tsx', 4 } 5}
License
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 0/28 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 2 are checked with a SAST tool
Reason
40 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-qxrj-hx23-xp82
- Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-wm7h-9275-46v2
- Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm
- Warn: Project is vulnerable to: GHSA-phwq-j96m-2c2q
- Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6
- Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx
- Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-pfq8-rq6v-vf5m
- Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-h9rv-jmmf-4pgx
- Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
1.7
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More