ts-mysql-plugin 项目教程

ts-mysql-plugin 项目教程

ts-mysql-pluginA typescript language service plugin that gives superpowers to SQL tagged template literals.项目地址:https://gitcode.com/gh_mirrors/ts/ts-mysql-plugin

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

ts-mysql-plugin/
├── dist/
│   └── index.js
├── src/
│   ├── index.ts
│   └── ...
├── e2e/
│   ├── ...
│   └── ...
├── package.json
├── tsconfig.json
├── README.md
├── LICENSE
└── ...
  • dist/: 编译后的 JavaScript 文件存放目录。
  • src/: TypeScript 源代码目录,包含项目的核心逻辑。
  • e2e/: 端到端测试目录,包含项目的测试代码。
  • package.json: 项目的配置文件,包含依赖、脚本等信息。
  • tsconfig.json: TypeScript 配置文件,定义编译选项。
  • README.md: 项目说明文档。
  • LICENSE: 项目许可证文件。

2. 项目的启动文件介绍

项目的启动文件是 src/index.ts,该文件是 TypeScript 语言服务插件的入口点。它负责初始化插件并提供对 SQL 标签模板字符串的增强功能。

3. 项目的配置文件介绍

package.json

{
  "name": "ts-mysql-plugin",
  "version": "1.0.1",
  "description": "A typescript language service plugin that gives superpowers to SQL tagged template literals, Specifically aimed at the MySQL syntax",
  "license": "MIT",
  "repository": "segmentio/ts-mysql-plugin",
  "author": "Steven Miller (https://github.com/stevenmiller888)",
  "keywords": [
    "typescript",
    "extension",
    "vscode",
    "plugin",
    "mysql",
    "sql"
  ],
  "files": [
    "dist"
  ],
  "main": "dist/index.js",
  "scripts": {
    "pub": "np",
    "test": "jest --forceExit --runInBand",
    "lint": "eslint src/**/*.ts",
    "build": "tsc",
    "watch": "tsc -b -w",
    "clean": "rm -rf dist"
  },
  "prettier": {
    "semi": false
  },
  "dependencies": {
    "typescript": "^4.0.0",
    "markdown-table": "^2.0.0",
    "ts-simple-type": "^1.0.0",
    "ts-mysql-parser": "^1.0.0",
    "ts-mysql-analyzer": "^1.0.0",
    "ts-mysql-autocomplete": "^1.0.0",
    "typescript-template-language-service-decorator": "^1.0.0"
  }
}
  • name: 项目名称。
  • version: 项目版本号。
  • description: 项目描述。
  • license: 项目许可证。
  • repository: 项目代码仓库地址。
  • author: 项目作者。
  • keywords: 项目关键词。
  • files: 项目发布时包含的文件。
  • main: 项目入口文件。
  • scripts: 项目脚本命令,如发布、测试、构建等。
  • prettier: Prettier 配置。
  • dependencies: 项目依赖包。

tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "outDir": "./dist",
    "rootDir": "./src"
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules", "dist"]
}
  • compilerOptions: TypeScript 编译选项。
    • target: 编译目标版本。
    • module: 模块系统。
    • strict: 启用严格模式。
    • esModuleInterop: 启用 ES 模块互操作。
    • skipLibCheck: 跳过库文件检查。
    • forceConsistentCasingInFileNames: 强制文件名大小写一致。
    • outDir: 输出目录。
    • rootDir: 源代码根目录。
  • include: 包含的文件。
  • exclude: 排除的文件。

ts-mysql-pluginA typescript language service plugin that gives superpowers to SQL tagged template literals.项目地址:https://gitcode.com/gh_mirrors/ts/ts-mysql-plugin

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

张姿桃Erwin

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

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

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

打赏作者

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

抵扣说明:

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

余额充值