npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tomjs/vscode-dev

v3.0.2

Published

Some development tools to simplify the development of vscode extensions

Downloads

44

Readme

@tomjs/vscode-dev

npm node-current (scoped) NPM

English | 中文

一些开发工具,用于简化 vscode 扩展 的开发

特性

  • 基于 locales 生成 package.nls.jsonpackage.nls.*.json, 支持 i18n Ally。使用 @tomjs/vscodei18n.t 方法支持国际化。
  • 基于 package.jsoncontributes.* 生成 vscode.d.ts,给部分 vscode 方法加强代码提示

安装

# pnpm
pnpm add @tomjs/vscode-dev -D

# yarn
yarn add @tomjs/vscode-dev -D

# npm
npm add @tomjs/vscode-dev -D

使用

  • CLI
$ vscode-dev --help

vscode-dev/3.0.0

Usage:
  $ vscode-dev [cwd]

Commands:
  [cwd]  Generate package.nls.json and vscode.d.ts for vscode extension development

For more info, run any command with the `--help` flag:
  $ vscode-dev --help

Options:
  --config [config]       The config file path
  --locales [locales]     Specify i18n directory (default: locales)
  --lang [lang]           Specify i18n source language (default: en)
  --dts-dir [dtsDir]      Specify the output directory of d.ts. If not specified, generated in the order "types", "extension", "src", "."
  --dts-name [dtsName]    Specify the output file name of d.ts (default: vscode.d.ts)
  --builtin [...builtin]  Builtin commands
  -w, --watch             Watch mode
  --verbose               Display verbose output
  -h, --help              Display this message
  -v, --version           Display version number

vscode.d.ts

// generated by @tomjs/vscode-dev
import '@tomjs/vscode';

declare module '@tomjs/vscode' {
  type I18nMessageType = 'description' | 'displayName' | 'tomjs.commands.hello';

  interface NlsI18n {
    t(message: I18nMessageType, ...args: Array<string | number | boolean>): string;
    t(message: I18nMessageType, args: Record<string, any>): string;
    t(
      ...params:
        | [message: I18nMessageType, ...args: Array<string | number | boolean>]
        | [message: I18nMessageType, args: Record<string, any>]
    ): string;
  }
}

declare module 'vscode' {
  export type BuiltinCommand = undefined;
  export type UserCommand = 'tomjs.xxx.showHello';

  export namespace commands {
    export function registerCommand(
      command: UserCommand,
      callback: (...args: any[]) => any,
      thisArg?: any,
    ): Disposable;

    export function registerTextEditorCommand(
      command: UserCommand,
      callback: (textEditor: TextEditor, edit: TextEditorEdit, ...args: any[]) => void,
      thisArg?: any,
    ): Disposable;

    export function executeCommand<T = unknown>(
      command: BuiltinCommand | UserCommand,
      ...rest: any[]
    ): Thenable<T>;
  }

  export interface Command {
    command?: BuiltinCommand | UserCommand;
  }

  export interface StatusBarItem {
    command?: BuiltinCommand | UserCommand;
  }
}

配置文件

  • package.json 文件中的 vscode 属性。
  • .vscoderc.js.vscoderc.ts.vscoderc.mjs.vscoderc.cjs 文件。(要了解有关如何加载 JS 文件的更多信息,请参阅“加载 JS 模块”。)
  • vscode.config.jsvscode.config.tsvscode.config.mjsvscode.config.cjs 文件。(要了解有关如何加载 JS 文件的更多信息,请参阅 “加载 JS 模块”。)

关联