import type { BundledPluginSource } from "../plugins/bundled-sources.js"; import { PLUGIN_INSTALL_ERROR_CODE } from "../plugins/install.js"; import { shortenHomePath } from "../utils.js";
export function resolveBundledInstallPlanBeforeNpm(params: {
rawSpec: string;
findBundledSource: BundledLookup;
}): { bundledSource: BundledPluginSource; warning: string } | null { if (!isBareNpmPackageName(params.rawSpec)) { returnnull;
} const bundledSource = params.findBundledSource({
kind: "pluginId",
value: params.rawSpec,
}); if (!bundledSource) { returnnull;
} return {
bundledSource,
warning: `Using bundled plugin "${bundledSource.pluginId}" from ${shortenHomePath(bundledSource.localPath)} for bare install spec "${params.rawSpec}". To install an npm package with the same name, use a scoped package name (for example @scope/${params.rawSpec}).`,
};
}
export function resolveBundledInstallPlanForNpmFailure(params: {
rawSpec: string;
code?: string;
findBundledSource: BundledLookup;
}): { bundledSource: BundledPluginSource; warning: string } | null { if (params.code !== PLUGIN_INSTALL_ERROR_CODE.NPM_PACKAGE_NOT_FOUND) { returnnull;
} const bundledSource = params.findBundledSource({
kind: "npmSpec",
value: params.rawSpec,
}); if (!bundledSource) { returnnull;
} return {
bundledSource,
warning: `npm package unavailable for ${params.rawSpec}; using bundled plugin at ${shortenHomePath(bundledSource.localPath)}.`,
};
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.