1.0.88 • Published 10 months ago

@meanmail/devshift v1.0.88

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
10 months ago

DevShift Plugin Builder

A tool for building DevShift extensions for JetBrains IDEs.

Installation

npm install -g @meanmail/devshift

Or use it directly with npx:

npx @meanmail/devshift build <source-path> <output-path>

Usage

  1. Create a directory for your extension with the following files:

    • extension.json: Contains metadata about your extension
    • extension.ts: Contains the code for your extension (will be compiled to extension.mjs)
  2. Run the builder:

@meanmail/devshift build <source-path> <output-path>

Where:

  • <source-path> is the path to the directory containing your extension files
  • <output-path> is the path where the plugin will be generated

Extension Structure

extension.json

The extension.json file contains metadata about your extension:

{
  "id": "com.example.myplugin",
  "name": "My Plugin",
  "version": "1.0.0",
  "description": "A description of my plugin",
  "author": "Your Name",
  "license": "MIT",
  "url": "https://example.com"
}

Required fields:

  • id: Unique identifier for the plugin
  • name: Display name of the plugin
  • version: Version of the plugin
  • description: Short description of the plugin
  • author: Author of the plugin
  • license: License of the plugin

Optional fields:

  • url: URL for the plugin

extension.ts and extension.mjs

The extension.ts file contains the code for your extension, which will be compiled to extension.mjs. It should export two functions:

// ES module syntax - no need to import 'ide' as it's available in the global scope

export function activate() {
  // Called when the plugin is activated
  ide.showMessage('Hello!', 'Hello from the extension!')
}

export function deactivate() {
  // Called when the plugin is deactivated
  ide.showMessage('Goodbye!', 'Goodbye from the extension!')
}

IDE API

The following API is available to your extension through the global ide object:

showMessage(title: string, message: string): void

Shows an information message to the user.

  • title: The title of the message
  • message: The content of the message

Example:

ide.showMessage('Hello!', 'Hello from the extension!')

Building the Plugin

After running the builder, you'll get a directory structure that can be built using Gradle:

cd <output-path>/<plugin-name>
./gradlew buildPlugin

The built plugin will be available in the build/distributions directory.

Type Definitions

Type definitions for the IDE API are included in the package. To use them in your TypeScript project, add a reference to the types:

/// <reference path="node_modules/@meanmail/devshift/dist/types/ide-api.d.ts" />

Or import them directly:

import '@meanmail/devshift/dist/types/ide-api';

Development Tools

Type Checking

The project includes TypeScript for static type checking. You can run type checking without compiling the code using:

npm run type-check

This will help catch type errors before runtime.

Linting

ESLint is configured for code quality and consistency. You can run the linter using:

npm run lint

To automatically fix linting issues:

npm run lint:fix

The linting rules are configured in .eslintrc.js and include TypeScript-specific rules to ensure code quality.

1.0.88

10 months ago

1.0.87

10 months ago

1.0.86

10 months ago

1.0.85

10 months ago

1.0.84

10 months ago

1.0.83

10 months ago

1.0.82

10 months ago

1.0.81

10 months ago

1.0.80

10 months ago

1.0.79

10 months ago

1.0.78

10 months ago

1.0.77

10 months ago

1.0.76

10 months ago

1.0.75

10 months ago

1.0.74

10 months ago

1.0.73

10 months ago

1.0.72

10 months ago

1.0.71

10 months ago

1.0.70

10 months ago

1.0.69

10 months ago

1.0.68

10 months ago

1.0.67

10 months ago

1.0.66

10 months ago

1.0.65

10 months ago

1.0.64

10 months ago

1.0.63

10 months ago

1.0.62

10 months ago

1.0.61

10 months ago

1.0.60

10 months ago

1.0.59

10 months ago

1.0.58

10 months ago

1.0.57

10 months ago

1.0.56

10 months ago

1.0.55

10 months ago

1.0.54

10 months ago

1.0.53

10 months ago

1.0.52

10 months ago

1.0.51

10 months ago

1.0.50

11 months ago

1.0.49

11 months ago

1.0.48

11 months ago

1.0.47

11 months ago

1.0.46

11 months ago

1.0.45

11 months ago

1.0.44

11 months ago

1.0.43

11 months ago

1.0.42

11 months ago

1.0.41

11 months ago

1.0.40

11 months ago

1.0.39

11 months ago

1.0.38

11 months ago

1.0.37

11 months ago

1.0.36

11 months ago

1.0.35

11 months ago

1.0.34

11 months ago

1.0.33

11 months ago

1.0.32

11 months ago

1.0.31

11 months ago

1.0.30

11 months ago

1.0.29

11 months ago

1.0.28

11 months ago

1.0.27

11 months ago

1.0.26

11 months ago

1.0.25

11 months ago

1.0.24

11 months ago

1.0.23

11 months ago

1.0.22

11 months ago

1.0.21

11 months ago

1.0.20

11 months ago

1.0.19

11 months ago

1.0.18

11 months ago

1.0.17

11 months ago

1.0.16

11 months ago

1.0.15

11 months ago

1.0.14

11 months ago

1.0.13

11 months ago

1.0.12

11 months ago

1.0.11

11 months ago

1.0.10

11 months ago

1.0.9

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago