New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@midwayjs/locate

Package Overview
Dependencies
Maintainers
7
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@midwayjs/locate

Locating midway application locations

  • 1.8.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
542
decreased by-38.34%
Maintainers
7
Weekly downloads
 
Created
Source

midway locate

GitHub license GitHub tag Build Status Test Coverage PRs Welcome

扫描仓库目录结构,找出 midway 的代码位置。

API

import { Locator } from '@midwayjs/locate';

const locator = new Locator();
const result = await locator.run();
console.log(result);

Return

  • result
    • cwd 当前命令执行路径,一般是项目根目录
    • midwayRoot midway 项目根目录,根据 package.json 查找
    • tsCodeRoot typescript 构建时获取的代码根路径,比如 src/controller/a.ts 和 src/controller/b.ts,tsc 构建时,会在 dist 目录中输出 a.js 和 b.js,这个时候根路径为 src/controller
    • tsConfigFilePath tsconfig.json 的路径,从 tsCodeRoot 到 midwayRoot 之间的最接近的 tsconfig 文件
    • tsBuildRoot 根据 tsconfig.json,获取到的构建输出的目录
    • integrationProject: 是否是一体化项目
    • integrationProjectType: 项目类型
    • usingDependencies: 使用的依赖,一体化项目会根据 tsCodeRoot 分析使用的依赖(package.json 的子集),其他项目直接读取 package.json 中的依赖
    • usingDependenciesVersion: 带版本,同上

其他

可以在 package.json 中传入 tsCodeRoottsBuildRoot,但是以 run 的参数为主。

{
  "midway-integration": {
    "tsCodeRoot": "src/apis",
    "tsBuildRoot": "build/faas"
  }
}

支持目录

  • 纯 midway 项目
  • midway + 前端(分目录)
  • midway + 前端(合目录)
  • 纯 midway-faas
  • midway-faas + 前端(分目录)
  • midway-faas + 前端(合目录)

License

MIT

Keywords

FAQs

Package last updated on 18 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc