Skip to content

Commit

Permalink
chore(docs, config): optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
dockfries committed May 27, 2024
1 parent 68a48b6 commit e166eae
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
7 changes: 5 additions & 2 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Because the CLI internally calls the `github HTTP API`, if your network environm
#### Example

```sh
#Install the CLI tool globally
# Install the CLI tool globally
pnpm add @infernus/create-app -g

# Create a project
Expand All @@ -37,12 +37,15 @@ infernus create <appName>
# all operations' dependencies can be followed by a version number,
# it is similar to the syntax of npm packages.
infernus add openmultiplayer/open.mp samp-incognito/samp-streamer-plugin@^2.9.6
# Server environment installation dependencies (not handling inc files)
# production mode install deps (not copy inc files)
infernus add samp-incognito/samp-streamer-plugin@^2.9.6 -p

# Install all existing dependencies, similar to sampctl ensure
infernus install

# same as above, production mode install deps (not copy inc files)
infernus install -p

# Uninstall one or more dependencies
infernus remove openmultiplayer/open.mp samp-incognito/samp-streamer-plugin@^2.9.6

Expand Down
15 changes: 9 additions & 6 deletions docs/zh-CN/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,23 @@ pnpm dlx @infernus/create-app create
#### 示例

```sh
#全局安装cli工具
# 全局安装cli工具
pnpm add @infernus/create-app -g

# 创建一个项目
infernus create <appName>

# 安装一个或多个依赖,所有操作的依赖后面都可以跟版本号,它类似于npm包的语法
infernus add openmultiplayer/open.mp samp-incognito/samp-streamer-plugin@^2.9.6
# 服务端环境安装依赖(不处理inc文件)
# 服务端环境安装依赖(不复制inc文件)
infernus add samp-incognito/samp-streamer-plugin@^2.9.6 -p

# 安装现有所有依赖,类似于sampctl ensure
infernus install

# 同上, 但生产模式安装依赖 (不复制inc文件)
infernus install -p

# 卸载一个或多个依赖
infernus remove openmultiplayer/open.mp samp-incognito/samp-streamer-plugin@^2.9.6

Expand Down Expand Up @@ -89,11 +92,11 @@ git clone git@github.com:dockfries/infernus-starter.git
cd infernus-starter

# 修改config.json中的rcon密码
vim config.json # 您不一定需要用vim,任意编辑器都可以
vim config.json # 您不一定需要用vim任意编辑器都可以

"rcon": {
"password": "changeme" # 把changeme换成您自己的密码
},
}
```

:::warning
Expand All @@ -113,8 +116,8 @@ vim config.json # 您不一定需要用vim,任意编辑器都可以

```json
"pawn": {
"main_scripts": ["polyfill_raknet 1"],
},
"main_scripts": ["polyfill_raknet 1"]
}
```

### 安装依赖并运行
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/src/utils/dep.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "node:path";
import decompress from "decompress";
import semver from "semver";
import path from "node:path";
import fs from "fs-extra";
import fg from "fast-glob";
import inquirer from "inquirer";
Expand Down
4 changes: 2 additions & 2 deletions packages/create-app/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import path from "node:path";
import os from "node:os";
import axios from "axios";
import path from "path";
import HttpsProxyAgent from "https-proxy-agent";
import fs from "fs-extra";
import cliProgress from "cli-progress";
import chalk from "chalk";
import type { OctokitOptions } from "@octokit/core";
import { Octokit } from "@octokit/core";
import os from "node:os";
import { readGlobalConfig } from "./config";

let delayTry = 500;
Expand Down
9 changes: 4 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import path from "path";
import path from "node:path";
import { createRequire } from "node:module";

const require = createRequire(import.meta.url);
const { compilerOptions } = require("./tsconfig.json");

import esbuild from "rollup-plugin-esbuild";
import del from "rollup-plugin-delete";
import externals from "rollup-plugin-node-externals";
import dts from "rollup-plugin-dts";
import { typescriptPaths } from "rollup-plugin-typescript-paths";
import json from "@rollup/plugin-json";

const require = createRequire(import.meta.url);
const { compilerOptions } = require("./tsconfig.json");

const packagesDir = path.resolve("./packages");
const packageDir = path.resolve(packagesDir, process.env.TARGET);

Expand Down

0 comments on commit e166eae

Please sign in to comment.