
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
@commandkit/legacy
Advanced tools
@commandkit/legacy
Legacy command handler plugin for CommandKit.
npm install @commandkit/legacy
This package provides a commandkit plugin that enables legacy command handler.
import { legacy } from '@commandkit/legacy';
export default defineConfig({
plugins: [legacy()],
});
This plugin also enables HMR for legacy commands, events and validations.
Since localization api is accessed through ctx.locale()
in commandkit, legacy commands are not able to use this api as ctx
is not exposed to legacy commands to maintain backward compatibility. In order to use the localization api with legacy commands, this plugin exposes locale()
hook to access the localization api.
import { locale } from '@commandkit/legacy';
export const data = {
name: 'hello',
description: 'Say hello',
};
export async function run({ interaction }) {
// initialize the localization api
const { t } = locale();
// use the localization api
const message = await t('hello', {
name: interaction.user.username,
});
// send the message
await interaction.reply(message);
}
The
locale()
function can only be called inside therun
function of the legacy command (or any other functions invoked inside therun
function).
FAQs
Legacy command handler plugin for CommandKit
The npm package @commandkit/legacy receives a total of 965 weekly downloads. As such, @commandkit/legacy popularity was classified as not popular.
We found that @commandkit/legacy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.