0.0.8 • Published 7 months ago

@bettergi/cli v0.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

本项目是一个为Better Genshin Impact 设计的 JavaScript 脚本开发脚手架,旨在帮助开发者快速创建脚本项目。

快速开始

使用 @bettergi/create-script 快速创建 JavaScript 脚本项目:

使用 npm

npm create @bettergi/script

使用 pnpm

pnpm create @bettergi/script

安装

npm install --save-dev @bettergi/cli

用法

创建配置文件

在工作目录下创建一个 bettergi.config.ts (或 .js, .cjs, .mjs) 配置文件。

import { defineConfig } from "@bettergi/cli/config";

export default defineConfig({
  // 构建配置项
  main: "main.ts",
  // ...

  // 调试配置项
  bettergi: {},

  // 脚本清单
  manifest: {},

  // UI配置项
  settings: []
});

创建 TypeScript 配置文件

在工作目录下创建一个 tsconfig.json 配置文件。

{
  "include": ["main.ts", "./src/**/*.ts"],
  "compilerOptions": {
    "target": "ESNext",
    "module": "ESNext",
    "moduleResolution": "Node",
    "esModuleInterop": true,
    "declaration": false,
    "lib": ["ESNext"],
    "skipLibCheck": true,
    "strict": true,
    "alwaysStrict": false,
    "removeComments": false,
    "noEmitOnError": true,
    "types": ["@bettergi/types"]
  }
}

BetterGI 使用 ClearScript 的 V8 引擎来执行脚本,多数新特性支持较为良好。若环境出现特性兼容性问题,请自行修改 target 等配置。

开发模式

npx bettergi-cli --watch

构建脚本

npx bettergi-cli
0.0.8

7 months ago

0.0.7

7 months ago

0.0.6

7 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago