@freelensapp/extension-example
Version:
Example of a Freelens extension (renamed to @freelensapp/example-extension)
104 lines (71 loc) • 2.87 kB
Markdown
# @freelensapp/extension-example
<!-- markdownlint-disable MD013 -->
[](https://freelens.app)
[](https://github.com/freelensapp/freelens)
[](https://github.com/freelensapp/freelens-extension-example)
[](https://github.com/freelensapp/freelens-extension-example/actions/workflows/integration-tests.yaml)
[](https://www.npmjs.com/package/@freelensapp/extension-example)
<!-- markdownlint-enable MD013 -->
<!-- markdownlint-disable MD036 -->
**Warning! This extension is renamed to @freelensapp/example-extension**
This repository serves as an example how to build and publish extensions for
Freelens application.
## Requirements
- Kubernetes >= 1.24
- Freelens >= 1.3.2
## API supported
- example.freelens.app/v1alpha1
To install Custom Resource Definition for this example run:
```sh
kubectl apply -f examples/crds/customresourcedefinition.yaml
```
Examples provide a resource for test:
```sh
kubectl apply -f examples/test/example.yaml
```
## Install
To install open Freelens and go to Extensions (`ctrl`+`shift`+`E` or
`cmd`+`shift`+`E`), and install `@freelensapp/extension-example`.
or:
Use a following URL in the browser:
[freelens://app/extensions/install/%40freelensapp%2Fextension-example](freelens://app/extensions/install/%40freelensapp%2Fextension-example)
## Build from the source
You can build the extension using this repository.
### Prerequisites
Use [NVM](https://github.com/nvm-sh/nvm) or
[mise-en-place](https://mise.jdx.dev/) or
[windows-nvm](https://github.com/coreybutler/nvm-windows) to install the
required Node.js version.
From the root of this repository:
```sh
nvm install
# or
mise install
# or
winget install CoreyButler.NVMforWindows
nvm install 22.15.1
nvm use 22.15.1
```
Install Pnpm:
```sh
corepack install
# or
curl -fsSL https://get.pnpm.io/install.sh | sh -
# or
winget install pnpm.pnpm
```
### Build extension
```sh
pnpm i
pnpm build
pnpm pack
```
### Install built extension
The tarball for the extension will be placed in the current directory. In
Freelens, navigate to the Extensions list and provide the path to the tarball
to be loaded, or drag and drop the extension tarball into the Freelens window.
After loading for a moment, the extension should appear in the list of enabled
extensions.
## License
Copyright (c) 2025 Freelens Authors.
[MIT License](https://opensource.org/licenses/MIT)