Skip to content

Commit

Permalink
Add kafka extension (raycast#5077)
Browse files Browse the repository at this point in the history
* Add kafka extension

- chore: prepare for public store
- chore: package.json
- fix: package-lock
- chore: move extensions
- chore: package.json
- fix: package-lock
- feat: rename extensions in package.json
- feat: rename vault command
- fix: screenshots resolution
- feat: add changelog
- feat: add screeshots
- fix: package-lock
- fix: github package.json name
- fix: github extension
- fix: package-lock
- feat: update icon
- feat: rename github to github pulls
- feat: rename github to github pulls
- fix: publish workflow
- deps: update (raycast#18)
- feat: add multiple login methods (raycast#17)
- feat(vault): add favorite namespaces easy switch (raycast#16)
- feat(kafka): add list section (raycast#10)
- feat(vault): add options to disable write and/or delete (raycast#9)
- feat: move to npm (raycast#8)
- feat: white icon for menu bar and display lag even if currently loading (raycast#7)
- ci: rename list extensions -> list for matrix
- ci: rename list extensions -> list for matrix
- ci: conditional publish on changes files
- chore(kafka-menu-bar): update log (raycast#6)
- feat: reusable list extensions workflow
- fix: publish workflow
- fix: publish workflow (raycast#5)
- feat: add publish workflow
- fix: ci (raycast#4)
- feat: add actions
- feat: add dependabot
- feat: monorepo
- docs: improve kafka documentation
- docs: add kakfa doc link in readme
- feat: add conf to hide consumers without lag
- feat: add metadata extractor
- feat: add partitions in topics and improve compacted tag
- fix: kafka extension icon
- feat(kafka): new extension
- deps: update raycast
- feat(vault): add paste to current app
- feat(vault): add favorites management
- chore(doc): improve documentation
- Merge pull request raycast#2 from fonimus/feat/license
- Merge pull request #1 from fonimus/feat/build-sh
- Merge pull request raycast#3 from fonimus/feat/git-ignore
- feat(vault): add list/create/delete entities
- feat(github): improve list accessories
- feat(github): improve list accessories
- feat(github): remove pr number when details are shown
- fix(github): remove labels from list temporarily (bug in raycast/extensions raycast#3359)
- chore(git): add .gitignore
- chore(license): add MIT license
- chore(build): add extension builder
- feat(github): improve left icon for bots, waiting, etc
- feat(github): improve left icon for bots, waiting, etc
- feat(github): add pr number in navigation and set approval as left icon
- fix(vault): typo
- chore(deps): migrate to last raycast version
- chore(all): reformat with prettier
- fix(vault): fix logo dimension
- ♻️ Remove unused url preference
- 🐛 Remove console logs
- 🔧 Fix readme
- 🔧 Add dsstore to gitignore
- 🔧 Update manifests
- ✨(vault) Save show technical paths in cache
- ✨(github) Add draft information
- ✨(vault) Add folder recursive deletion
- ✨(vault) Add json validation when adding new version
- ✨ Add tint color in icons
- ✨ Add tint color in icons, add mark in user avatar
- 🔨 Add react hooks eslint plugin
- 🐛 Fix reloading issue
- ✨ Add owner name in repo list and copy pr url in clipboard
- 🔧 Remove organization from preferences
- ✨ Add approve action, add possibility to show/hide details, add number of approvals in list/detail
- ♻️ Use useCallback hook and make actions methods components
- ♻️ Use usePromise from raycast utils when possible
- 🐛 Fix system sound by replacing unnecessary submit form action by standard action
- ♻️ Use useCachedState from raycast utils
- 🎉 Init project with vault and github extensions
- Initial commit

* fix: wrong package.json and lock file

* fix: remove unused asset

* feat: add dark icon, prettify menu bar dropdown

* feat: add reload shortcut

* fix: remove ssl kafkajs configuration from default
  • Loading branch information
fonimus committed Mar 14, 2023
1 parent 2794dd9 commit 74eee87
Show file tree
Hide file tree
Showing 20 changed files with 4,655 additions and 0 deletions.
23 changes: 23 additions & 0 deletions extensions/kafka/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"root": true,
"env": {
"es2020": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"react-hooks"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"react-hooks/rules-of-hooks": "error",
// Vérifie les règles des Hooks
"react-hooks/exhaustive-deps": "warn"
// Vérifie les tableaux de dépendances
}
}
8 changes: 8 additions & 0 deletions extensions/kafka/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# node
node_modules

# intellij
.idea

# macos
.DS_Store
4 changes: 4 additions & 0 deletions extensions/kafka/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"printWidth": 120,
"singleQuote": false
}
12 changes: 12 additions & 0 deletions extensions/kafka/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Kafka Changelog

## [Added kafka] - 2023-03-01

### Kafka command

- List and consult topic configurations
- List consumers with state, members and overall lag

### Kafka menu bar command

Have kafka in menu bar with background actualization every 5 minutes
90 changes: 90 additions & 0 deletions extensions/kafka/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Kafka extension

> Extension to quickly consult topics and consumers of kafka broker
## Configuration

| Name | Required | Default | Example | Description |
|-----------------------------|----------|-------------|------------------------|-------------------------------------------------------------------|
| configDirectory | Yes | `~/.kafka/` | `/kafka-config/` | Configuration directory containing [env files](#environment-file) |
| extractRegex | No | - | `topic_(.*)_(.*)_(.*)` | Regex to extract information from topic name |
| extractTitleGroup | No | - | 1 | Group to get from regex to display title |
| extractSubTitleGroup | No | - | 2 | Group to get from regex to display subtitle |
| extractMetadataNameAndGroup | No | - | Application=3 | Extract metadata from regex |

Note: in this example, with a topic named `topic_NAME_OWNER_APP`, the title
would be **NAME**, the subtitle **OWNER**, and in the side panel we would have
the following metadata **Application=APP**. If you don't set extractRegex full
topic name will be displayed.

### Environment file

Environment file must be a json in the configuration directory with following
fields :

````typescript
export interface KafkaEnv {
// env name to display on raycast dropdown
name: string;
// to filter topics by keyword(s)
filterTopics?: string[];
// to filter consumers by keyword(s)
filterConsumers?: string[];
// kafka js configuration for broker, authentication, etc
kafkaJs: KafkaConfig;
}
````

Following [kafkaJS](https://kafka.js.org/) configuration is used by default :

````typescript
const defaultConfiguration = {
connectionTimeout: 10000,
requestTimeout: 30000,
logLevel: logLevel.ERROR
};
````

More info on configuring
[kafkaJS](https://kafka.js.org/) [here](https://kafka.js.org/docs/configuration)

_Example_

````json
{
"name": "Dev",
"filterTopics": [
"my-prefix-for-dev"
],
"filterConsumers": [
"dev",
"def"
],
"kafkaJs": {
"brokers": [
"kafka-host:kafka-port"
],
"sasl": {
"mechanism": "plain",
"username": "user",
"password": "password"
}
}
}

````

## Kafka command

- List and consult topic configurations
- List consumers with state, members and overall lag

## Kafka menu bar command

Have kafka in menu bar with background actualization every 5 minutes

## Configuration

| Name | Required | Default | Description |
|----------------|----------|---------|------------------------------------------------|
| hideWithoutLag | No | false | Hide consumers without lag to avoid long lists |
Binary file added extensions/kafka/assets/kafka-menu-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extensions/kafka/assets/kafka-menu-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extensions/kafka/assets/kafka.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extensions/kafka/metadata/kafka-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extensions/kafka/metadata/kafka-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extensions/kafka/metadata/kafka-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extensions/kafka/metadata/kafka-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 74eee87

Please sign in to comment.