@codacy/tools-unsupported-tools

中文文档
0.28.0发布于 2026/11/09MITTypeScriptCommonJS近 30 天下载 1.2万

Generated manifest of Codacy Cloud tools without a local analyzer (descriptors + patterns)

原始使用文档
文档目录9 节
  1. Table of Contents
  2. Overview
  3. What "unsupported" means
  4. Contents
  5. Framework mappings
  6. Regenerating the manifest
  7. How it's consumed
  8. Development
  9. Notes for maintainers

@codacy/tools-unsupported-tools

Table of Contents

Overview

This package holds a generated, committed manifest of every Codacy Cloud tool that does not have a local analyzer adapter in this CLI — the "unsupported" (cloud-only) tools. It lets the CLI treat those tools as first-class citizens of the configuration and of the info / analyze / init flows, even though they are never executed locally.

What "unsupported" means

A tool is tracked here when it is in the Codacy catalog (/api/v3/tools), has no local adapter (its UUID is not referenced by any sibling tool package's prefetch script), and is trackable — i.e. not deprecated and not client-side/standalone-only (those run only in the customer environment).

Descriptors carry unsupported: true, which is how the rest of the CLI tells them apart from real adapters.

Contents

  • src/descriptors.json — one AdapterDescriptor per tool (unsupported: true, uuid set, supportedRunners: ["container"]).
  • src/patterns/<toolId>.json — that tool's full pattern set (same shape as a supported adapter's patterns.json). Tools with no patterns have no file.
  • src/index.ts — exports unsupportedDescriptors (eager, tiny) and loadUnsupportedPatterns(toolId) (lazy disk read, cached).
  • src/framework-mappings.json — hand-curated framework matching rules (see below).

Framework mappings

Several cloud-only tools ship framework-specific patterns (PHPCS → CakePHP/WordPress/Drupal/Magento/ Symfony; dartanalyzer → Flutter/Angular; SonarCSharp → ASP.NET Core/Entity Framework/xUnit/…; CodeNarc → Grails/Spock/…; Codacy ScalaMeta Pro → Play Framework). src/framework-mappings.json maps tool ID → FrameworkMappings so init --auto can include those patterns only when the framework is actually detected (and exclude them otherwise), exactly like supported tools.

  • It is hand-curated and committed — unlike descriptors.json/patterns/, it is not touched by generate, so it survives regeneration. index.ts merges it onto each descriptor's frameworkMappings at load time.
  • Choose the mechanism per tool from its pattern shape: prefixes when pattern IDs are namespaced by framework (e.g. PHPCS_CakePHP_), tags otherwise (e.g. flutter, aspnetcore, grails).
  • Each key must be a DEPENDENCY_ENTITIES key (packages/tooling/src/dependency-entities.ts) — the stable slug, not the display name — since that is what auto-init matches against. Labels are copy and get reworded (angular is Angular 2+, angular-dart is AngularDart), so the key is what keeps a Dart tool's patterns from gating on an npm dependency. If discovery cannot detect the framework yet, add a telltale to the right ecosystem module in packages/runner/src/discover/ecosystems/.
  • test/framework-mappings.test.ts enforces that every key maps to a real tool, the merge applied, and every prefix/tag still matches ≥1 committed pattern (guards against drift after regeneration).
  • Codacy ScalaMeta Pro: its six Custom_Scala_Play* patterns are all default-on and read Play's request/header API, so before being mapped they fired in every Scala repo. play-framework is detected from the sbt-plugin coordinate addSbtPlugin declares and from the conf/routes layout — Play is declared as an sbt plugin, which is why the telltale keys on group:artifact. Its other 80 patterns carry no tags at all and are genuinely general Scala rules, so they stay universal.

Regenerating the manifest

From the repo root:

pnpm generate-unsupported

or from this package:

pnpm generate

The script (scripts/generate.mjs) fetches the catalog, subtracts locally supported tools (by UUID, read from sibling prefetch scripts — no list to keep in sync), filters out deprecated/client-side tools, and rewrites descriptors.json + patterns/. Commit the result. On network failure it warns and exits 0, leaving committed files untouched.

Run this whenever Codacy adds/removes tools or you implement a new local adapter (which should then disappear from this manifest on the next regeneration).

How it's consumed

  • packages/cli/src/index.ts registers every descriptor via registerUnsupportedTool() so they appear in getRegisteredDescriptors().
  • init --auto calls loadUnsupportedPatterns() to fill cloud-only tools offline.
  • init --remote / --default fetch patterns from the API at runtime, so they do not read this package's pattern files — only its descriptors/registration.

Development

pnpm build   # tsup bundle + copy src/patterns → dist/patterns
pnpm test    # manifest shape + drift invariants
pnpm lint

loadUnsupportedPatterns reads dist/patterns/<toolId>.json at runtime (__dirname-relative) and src/patterns/ during tests.

Notes for maintainers

  • The patterns directory is recreated on every generate run so removed tools don't leave stale files behind.
  • The package is named with the @codacy/tools- prefix on purpose: the CLI keeps those external from its bundle, so __dirname resolves to this package's own dist/ and the pattern files are found.
  • filePatterns is ["*"] for all entries — unsupported tools never route files locally, so the value is cosmetic.

版本与发布记录

@codacy/tools-unsupported-tools 共发布 20 个版本,首次发布于 2026/06/23;过去 12 个月发布了 20 个版本。

版本发布日期距今
0.28.0latest2026/11/09今天
0.27.12026/11/054 天前
0.27.02026/11/036 天前
0.26.02026/10/3010 天前
0.25.02026/10/1921 天前
0.24.02026/09/251 个月前

关于 @codacy/tools-unsupported-tools 的常见问题

@codacy/tools-unsupported-tools 是什么?

Generated manifest of Codacy Cloud tools without a local analyzer (descriptors + patterns)

如何安装 @codacy/tools-unsupported-tools?

在项目目录运行 npm install @codacy/tools-unsupported-tools,或使用 pnpm add / yarn add / bun add。

@codacy/tools-unsupported-tools 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@codacy/tools-unsupported-tools 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@codacy/tools-unsupported-tools 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@codacy/tools-unsupported-tools 可以商用吗?

@codacy/tools-unsupported-tools 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@codacy/tools-unsupported-tools 的下载量有多少?

根据 npm 官方下载统计,@codacy/tools-unsupported-tools 在 2026/10/10 – 2026/11/08 这 30 天内被下载 11,795 次,日均约 393 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@codacy/tools-unsupported-tools 还在维护吗?

最新版本 0.28.0 发布于 2026/11/09(今天);至今共发布 20 个版本,其中过去 12 个月发布了 20 个;首次发布于 2026/06/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。