restful-react 项目教程

restful-react 项目教程

restful-reactA consistent, declarative way of interacting with RESTful backends, featuring code-generation from Swagger and OpenAPI specs 🔥项目地址:https://gitcode.com/gh_mirrors/re/restful-react

1. 项目的目录结构及介绍

restful-react 项目的目录结构如下:

restful-react/
├── dist/
├── examples/
├── src/
├── package.json
├── README.md
├── tsconfig.json
└── ...
  • dist/:编译后的文件目录。
  • examples/:示例代码目录。
  • src/:源代码目录。
  • package.json:项目的配置文件,包含依赖、脚本等信息。
  • README.md:项目说明文档。
  • tsconfig.json:TypeScript 配置文件。

2. 项目的启动文件介绍

项目的启动文件主要在 package.json 中定义的脚本中体现:

"scripts": {
  "start": "tsdx watch",
  "test": "tsdx test",
  "lint": "tsdx lint",
  "build": "run-p build:*",
  "build:project": "tsdx build",
  "build:bin": "tsc && rollup -c rollup.config.js",
  "postbuild": "rimraf dist/**/*test*",
  "version": "auto-changelog -p && git add CHANGELOG.md",
  "examples": "run-p example:*",
  "example:github": "node dist/bin/restful-react.js import --github OAI:OpenAPI-Specification:master:examples/v3.0/petstore.yaml --output examples/petstoreFromGithubSpec.tsx",
  "example:url": "node dist/bin/restful-react.js import --url https://petstore.swagger.io/v2/swagger.json --output examples/petstoreFromUrlSpec.tsx",
  "example:file": "node dist/bin/restful-react.js import --file examples/petstore.yaml --output examples/petstoreFromFileSpec.tsx",
  "example:advanced": "node dist/bin/restful-react.js import --config examples/restful-react.config.js"
}
  • start:启动开发服务器。
  • test:运行测试。
  • lint:运行代码检查。
  • build:构建项目。
  • examples:运行示例代码。

3. 项目的配置文件介绍

项目的配置文件主要包括 package.jsontsconfig.json

package.json

package.json 文件包含了项目的基本信息、依赖、脚本等:

{
  "name": "restful-react",
  "version": "15.9.4",
  "description": "A consistent declarative way of interacting with RESTful backends featuring code-generation from Swagger and OpenAPI specs",
  "keywords": [
    "rest",
    "restful",
    "react",
    "react-component",
    "fetch",
    "data fetching"
  ],
  "homepage": "https://github.com/contiamo/restful-react",
  "bugs": "https://github.com/contiamo/restful-react/issues",
  "license": "MIT",
  "contributors": [
    {
      "name": "Tejas Kumar",
      "email": "tejas@tejas.qa",
      "url": "https://twitter.com/tejaskumar_"
    },
    {
      "name": "Fabien Bernard",
      "email": "fabien@contiamo.com",
      "url": "https://fabien0102.com/en"
    }
  ],
  "files": [
    "dist"
  ],
  "bin": {
    "restful-react": "dist/bin/restful-react.js"
  },
  "main": "dist/index.js",
  "typings": "dist/index.d.ts",
  "module": "dist/restful-react.esm.js",
  "repository": {
    "type": "git",
    "url": "https://github.com/contiamo/restful-react"
  },
  "scripts": {
    "start": "tsdx watch",
    "test": "

restful-reactA consistent, declarative way of interacting with RESTful backends, featuring code-generation from Swagger and OpenAPI specs 🔥项目地址:https://gitcode.com/gh_mirrors/re/restful-react

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

乔如黎

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值