Skip to content

Latest commit

 

History

History
130 lines (83 loc) · 3.95 KB

File metadata and controls

130 lines (83 loc) · 3.95 KB

🛠️ Developing the Apex Log Analyzer Extension

Welcome to the development guide for the Apex Log Analyzer VS Code extension! This document will walk you through the steps required to get started with the development environment, build the extension, and contribute to the project.

  • The source code is written in TypeScript.
  • The lana directory contains the source code for the VS Code Extension.
  • The log-viewer directory contains the source code for the webview displayed by the extension but does not depend on VSCode.

📚 Table of Contents

  1. Prerequisites
  2. Setting Up the Development Environment
  3. Building and Bundling
  4. Running the Extension Locally
  5. Packaging the Extension

🔧 Prerequisites

Before you start developing, make sure you have the following tools installed:

Once you’ve got these ready, you’re all set to get started! 🚀

👨‍💻 Setting Up the Development Environment

To get started, clone this repository and install the necessary dependencies.

  1. Create a fork of the repository first
  2. Clone the repository:
git clone https://github.com/your-username/apex-log-analyzer.git
cd apex-log-analyzer
  1. Install dependencies:

    Use pnpm to install project dependencies:

pnpm i

⚙️ Building and Bundling

You can build the extension and prepare it for local development, run the watcher to re build automatically or production use. Here's how:

  1. Watch Build:

    To build the extension without minification and then watch for file changes in the lana and log-viewer source, rebuilding incrementally, for a fast dev experience, use:

pnpm watch
  1. Development Build:

    To build the extension without minification (fast for local development), use:

pnpm build:dev
  1. Production Build:

    To create a production-ready build with minification, use:

pnpm build

(Experimental)

The following commands are also available and use rolldown as a replacement for rollup. The are faster but since rolldown is beta something do not work correctly e.g css bundling in js.

  1. pnpm watch:fast
  2. pnpm build:dev:fast
  3. pnpm build:fast

🚀 Running the Extension Locally

Once you’ve built the extension or run the watcher, you can run it inside a local VS Code instance for testing and development.

  1. Start the extension host:

    • Open the Run and Debug panel in VS Code (CMD/CTRL + Shift + D).
    • Select Run Extension from the dropdown.
    • Click the green play button to launch a new VS Code window (the extension host).
  2. Refresh the extension host:

    If you're using the watch mode (see below), refresh the extension host view by pressing CMD/CTRL + R or clicking the restart icon.

🧪 Testing Your Changes

Make sure your changes don’t break anything. If you’re working on a feature or bug fix that requires tests, be sure to add or update the relevant tests.

Run Tests Locally: If you have added or modified tests, you can run them with:

pnpm test

or run the tests from the test explorer in VScode

Ensure all tests pass before submitting your pull request.

📦 Packaging the Extension

This is for information only packaging and releasing is handled in Github. Once you're ready to package the extension for distribution:

  1. Ensure that you’ve installed the dependencies:
pnpm install
  1. Package the extension:
cd lana
vsce package --no-dependencies

This command will create a .vsix file that you can distribute or install locally.