Skip to content

Commit eeb7613

Browse files
azahnenPZahnen
andauthored
native desktop plugin (#19)
Co-authored-by: PZahnen <pascal.zahnen@gmx.de>
1 parent e039299 commit eeb7613

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+9343
-3081
lines changed

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@xtracfg:registry=https://dl.interactive-instruments.de/repository/npm/

.vscode/launch.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,26 @@
55
{
66
"version": "0.2.0",
77
"configurations": [
8+
{
9+
"name": "Run Native Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "${workspaceFolder}/data"],
13+
"outFiles": ["${workspaceFolder}/dist/dev/*.js"],
14+
"preLaunchTask": "prelaunch:native"
15+
},
816
{
917
"name": "Run Web Extension ",
10-
"type": "pwa-extensionHost",
18+
"type": "extensionHost",
1119
"debugWebWorkerHost": true,
1220
"request": "launch",
1321
"args": [
1422
"--extensionDevelopmentPath=${workspaceFolder}",
1523
"--extensionDevelopmentKind=web",
1624
"${workspaceFolder}/data"
1725
],
18-
"outFiles": ["${workspaceFolder}/dist/*.js"],
19-
"preLaunchTask": "${defaultBuildTask}",
26+
"outFiles": ["${workspaceFolder}/dist/dev/*.js"],
27+
"preLaunchTask": "prelaunch:web",
2028
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"]
2129
},
2230
{

.vscode/tasks.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,27 @@
44
"version": "2.0.0",
55
"tasks": [
66
{
7+
"label": "prelaunch:native",
78
"type": "npm",
8-
"script": "build:all",
9+
"script": "prelaunch:native",
910
"group": {
1011
"kind": "build",
1112
"isDefault": true
1213
},
1314
"problemMatcher": []
1415
},
1516
{
17+
"label": "prelaunch:web",
1618
"type": "npm",
17-
"script": "watch-web",
19+
"script": "prelaunch:web",
20+
"group": {
21+
"kind": "build"
22+
},
23+
"problemMatcher": []
24+
},
25+
{
26+
"type": "npm",
27+
"script": "watch:web",
1828
"group": "build",
1929
"isBackground": true,
2030
"problemMatcher": "$tsc-watch"

.vscodeignore

Lines changed: 0 additions & 37 deletions
This file was deleted.

.woodpecker/build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
when:
2+
event: [push, tag]
3+
4+
matrix:
5+
PLATFORM:
6+
- darwin-arm64
7+
- linux-arm64
8+
- linux-x64
9+
10+
steps:
11+
native:
12+
image: node:20-alpine
13+
environment:
14+
VSIX_PLATFORM: ${PLATFORM}
15+
commands:
16+
- npm run install:all
17+
- npm run package:native
18+
19+
nexus:
20+
image: rockdrilla/woodpecker-sonatype-nexus
21+
secrets:
22+
- nexus_auth_b64
23+
environment:
24+
#NEXUS_URL: https://dl.interactive-instruments.de
25+
#NEXUS_AUTH_BASE64 is stored as CI variable
26+
NEXUS_REPOSITORY: ldproxy
27+
NEXUS_PATHS: "dist/vsix/*.vsix"
28+
NEXUS_PROPERTIES: "directory=/editor/${CI_COMMIT_TAG:-next}/"
29+
settings:
30+
nexus_url: https://dl.interactive-instruments.de
31+
auth_base64:
32+
from_secret: nexus_auth_b64
33+
# upload: '[{"repository": "ldproxy", "paths": ["dist/vsix/*.vsix"], "directory": "/editor/"}]'
34+
# - repository: ldproxy
35+
# paths:
36+
# - dist/vsix/*.vsix
37+
# directory: /editor/

.woodpecker/check.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
when:
2+
event: push
3+
4+
steps:
5+
test:
6+
image: node:20-alpine
7+
commands:
8+
- npm run install:all
9+
- npm test

.woodpecker/release.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,28 @@
11
when:
22
event: tag
33

4-
pipeline:
4+
depends_on:
5+
- build
6+
7+
steps:
8+
download:
9+
image: alpine/curl
10+
commands:
11+
- mkdir -p dist/vsix
12+
- curl -O --output-dir dist/vsix https://dl.interactive-instruments.de/repository/ldproxy/editor/${CI_COMMIT_TAG}/ldproxy-editor-darwin-arm64-${CI_COMMIT_TAG##v}.vsix
13+
- curl -O --output-dir dist/vsix https://dl.interactive-instruments.de/repository/ldproxy/editor/${CI_COMMIT_TAG}/ldproxy-editor-linux-arm64-${CI_COMMIT_TAG##v}.vsix
14+
- curl -O --output-dir dist/vsix https://dl.interactive-instruments.de/repository/ldproxy/editor/${CI_COMMIT_TAG}/ldproxy-editor-linux-x64-${CI_COMMIT_TAG##v}.vsix
15+
- ls -la dist/vsix
16+
17+
publish:
18+
image: node:20-alpine
19+
environment:
20+
VSCE_PAT:
21+
from_secret: vscode_marketplace_token
22+
commands:
23+
- npm ci --ignore-scripts
24+
- npm run publish
25+
526
docker:
627
image: woodpeckerci/plugin-docker-buildx
728
# TODO: see https://codeberg.org/woodpecker-plugins/docker-buildx/issues/50

.woodpecker/snapshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
when:
22
event: push
33

4-
pipeline:
4+
steps:
55
docker:
66
image: woodpeckerci/plugin-docker-buildx
77
# TODO: see https://codeberg.org/woodpecker-plugins/docker-buildx/issues/50

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
FROM node:20-alpine as extension
22

33
COPY . /src/
4-
RUN cd /src && npm run install:all && npm test && npm run package
4+
RUN cd /src && npm run install:all && npm test && npm run package:web
55

66

7-
FROM ghcr.io/ldproxy/xtracfg:maintenance-v3-528524f4 as xtracfg
7+
FROM ghcr.io/ldproxy/xtracfg:4.2.0 as xtracfg
88

99

1010
FROM codercom/code-server:latest
1111

12-
COPY --chmod=0644 --from=extension /src/dist/ldproxy-editor.vsix /
12+
COPY --chmod=0644 --from=extension /src/dist/vsix/ldproxy-editor-web-*.vsix /ldproxy-editor.vsix
1313
COPY --chmod=0755 --from=extension /src/startup.sh /entrypoint.d/
1414
COPY --chmod=0755 --from=xtracfg /xtracfg /usr/bin/
1515

README.md

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,67 @@
1-
# Editor
1+
# ldproxy for VS Code
22

33
A [VS Code](https://code.visualstudio.com) extension that supports you in creating and updating [ldproxy](https://docs.ldproxy.net) configurations.
44

55
## Current state
66

7-
The first stable release (`v1.0.0`) is available.
8-
9-
### Distribution
10-
11-
Currently the only way to use the extension is the provided docker image that contains an open source version of VS Code for the Web.
7+
- The current stable release is `v1.1.0`.
8+
- It is available as a pre-release on the VS Code Marketplace (currently only for macOS and Linux).
9+
- It can be used as a web application with the docker image that contains an open source version of VS Code for the Web.
1210

1311
### Features
1412

1513
- Command `Create new entities`: provides a graphical wizard to automatically generate provider and service configurations from data sources.
16-
- IntelliSense: shows available properties in YAML configuration files.
14+
- Command `Create new values`: provides a graphical wizard to automatically generate value configurations, currently only MapLibre styles.
15+
- IntelliSense: autocompletion, shows available properties in YAML configuration files.
1716
- Syntax checks: detects unknown or deprecated properties in YAML configuration files.
1817
- Tooltips: shows documentation for properties in YAML configuration files.
1918

20-
## Outlook
19+
### Limitations
20+
21+
- The extension is not yet available for Windows, only MacOS and Linux are supported for now.
22+
- The workspace root needs to be a ldproxy store directory for the extension to work properly. Parent directories that contain multiple store directories are not yet supported, and neither are multi-root workspaces.
23+
- Tile Providers cannot be generated yet.
2124

22-
- `v1.1.0` automatically generate and edit MapLibre styles
23-
- `v2.0.0` general availability of the extension for VS Code Desktop (macOS, Windows, Linux)
25+
### Outlook
26+
27+
- `v2.0.0` general availability of the extension for VS Code Desktop (macOS, Windows, Linux), no known limitations
2428

2529
## Installation
2630

31+
### VS Code Desktop
32+
33+
Open the extensions view from the activity bar and search for _ldproxy_, then install the extension _ldproxy for VS Code_. [This](https://marketplace.visualstudio.com/items?itemName=iide.ldproxy-editor) is a direct link to the extension on the VS Code Marketplace.
34+
35+
When installed, you may open a ldproxy store directory in VS Code, for example by using `File -> Open Folder` or by calling `code` in a terminal. You can then start editing your files.
36+
37+
### Docker
38+
2739
The docker image is available at `ghcr.io/ldproxy/editor`. It expects the workspace to be mounted at `/data`. The application runs on port `80`.
2840

29-
To start the editor with your ldproxy configuration directory in `/home/user/ldproxycfg` and access it at `http://localhost:8080`:
41+
To start the editor with your ldproxy configuration directory in `/path/to/ldproxy/cfg` and access it at `http://localhost:8080`:
3042

3143
```sh
32-
docker run -d -p 8080:80 -v /home/user/ldproxycfg:/data ghcr.io/ldproxy/editor
44+
docker run -d -p 8080:80 -v /path/to/ldproxy/cfg:/data ghcr.io/ldproxy/editor
3345
```
3446

47+
When you open the application at `http://localhost:8080` in the browser, you will see the mounted ldproxy configuration directory on the left. You can now start to edit your files.
48+
3549
> [!NOTE]
3650
> Accessing the editor via `http` only works with `localhost`. If you want to setup an editor for remote access, you need a reverse proxy which provides `https`.
3751
3852
## Usage
3953

40-
When you open the application at `http://localhost:8080` in the browser, you will see the mounted ldproxy configuration directory on the left. You can now start to edit your files.
54+
Unknown or deprecated properties will automatically be marked in open files. Hovering over a property will show the documentation.
4155

4256
For general help, check the documentation for [VS Code](https://code.visualstudio.com/docs).
4357

58+
### IntelliSense (autocompletion)
59+
60+
To get a list of all available properties in a certain place in a YAML configuration file, you can press `Ctrl+Space`. (It is called `Trigger suggest` in the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette), which also shows the configured hotkey.)
61+
You can then use the cursor keys to navigate the suggestions and choose one with `Enter`. You might also start typing before or after triggering to narrow the suggestions.
62+
63+
![](docs/screenshot2.png)
64+
4465
### Creating new entities
4566

4667
When you open the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and start typing `ldproxy`, the command `ldproxy: Create new entities` should appear at the top. Upon selecting, the graphical wizard will open in a new tab.
@@ -50,11 +71,12 @@ It allows you to automatically generate provider and service configurations from
5071
> [!NOTE]
5172
> When trying to access a _PostgreSQL_ database on the same host where the docker container is runnning, you have to use `host.docker.internal` instead of `localhost`.
5273
53-
![](screenshot.png)
74+
![](docs/screenshot.png)
5475

55-
### IntelliSense (autocompletion)
76+
### Creating new values
5677

57-
To get a list of all available properties in a certain place in a YAML configuration file, you can press `Ctrl+Space`. (It is called `Trigger suggest` in the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette), which also shows the configured hotkey.)
58-
You can then use the cursor keys to navigate the suggestions and choose one with `Enter`. You might also start typing before or after triggering to narrow the suggestions.
78+
When you open the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and start typing `ldproxy`, the command `ldproxy: Create new values` should appear near the top. Upon selecting, the graphical wizard will open in a new tab.
79+
80+
It currently only allows you to automatically generate a MapLibre style from a service configuration.
5981

60-
![](screenshot2.png)
82+
![](docs/screenshot3.png)

0 commit comments

Comments
 (0)