From d13d37a33aba5be2716ee40aff949b45317a5113 Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Thu, 17 Oct 2024 22:49:07 +0200 Subject: [PATCH 1/3] Include freedesktop sdk TypeScript extension --- Makefile | 2 +- build-aux/re.sonny.Workbench.Devel.json | 5 +- build-aux/re.sonny.Workbench.json | 5 +- build-aux/wip/run.js | 14 ++--- data/app.metainfo.xml | 4 ++ src/cli/main.js | 77 ++++++++++++++++++++++++- src/langs/css/CssDocument.js | 2 +- src/langs/javascript/biome.json | 3 +- 8 files changed, 97 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 12ac5ea7a..d9315993d 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ SHELL:=/bin/bash -O globstar setup: flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo - flatpak install --or-update --user --noninteractive flathub org.gnome.Sdk//47 org.flatpak.Builder org.freedesktop.Sdk.Extension.rust-stable//24.08 org.freedesktop.Sdk.Extension.vala//24.08 org.freedesktop.Sdk.Extension.llvm18//24.08 org.freedesktop.Sdk.Extension.node20//24.08 #org.freedesktop.Sdk.Extension.typescript//24.08 + flatpak install --or-update --user --noninteractive flathub org.gnome.Sdk//47 org.flatpak.Builder org.freedesktop.Sdk.Extension.rust-stable//24.08 org.freedesktop.Sdk.Extension.vala//24.08 org.freedesktop.Sdk.Extension.llvm18//24.08 org.freedesktop.Sdk.Extension.node20//24.08 org.freedesktop.Sdk.Extension.typescript//24.08 # flatpak remote-add --user --if-not-exists flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo # flatpak remote-add --user --if-not-exists gnome-nightly https://nightly.gnome.org/gnome-nightly.flatpakrepo # flatpak install --or-update --user --noninteractive gnome-nightly org.gnome.Sdk//master diff --git a/build-aux/re.sonny.Workbench.Devel.json b/build-aux/re.sonny.Workbench.Devel.json index 0bbc6c099..607f7853a 100644 --- a/build-aux/re.sonny.Workbench.Devel.json +++ b/build-aux/re.sonny.Workbench.Devel.json @@ -8,10 +8,11 @@ "org.freedesktop.Sdk.Extension.vala", "org.freedesktop.Sdk.Extension.rust-stable", "org.freedesktop.Sdk.Extension.llvm18", - "org.freedesktop.Sdk.Extension.node20" + "org.freedesktop.Sdk.Extension.node20", + "org.freedesktop.Sdk.Extension.typescript" ], "build-options": { - "append-path": "/usr/lib/sdk/vala/bin:/usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/node20/bin", + "append-path": "/usr/lib/sdk/vala/bin:/usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/node20/bin:/usr/lib/sdk/typescript/bin", "append-ld-library-path": "/usr/lib/sdk/vala/lib" }, "command": "workbench", diff --git a/build-aux/re.sonny.Workbench.json b/build-aux/re.sonny.Workbench.json index 13ed0dac4..f8aea1e24 100644 --- a/build-aux/re.sonny.Workbench.json +++ b/build-aux/re.sonny.Workbench.json @@ -8,10 +8,11 @@ "org.freedesktop.Sdk.Extension.vala", "org.freedesktop.Sdk.Extension.rust-stable", "org.freedesktop.Sdk.Extension.llvm18", - "org.freedesktop.Sdk.Extension.node20" + "org.freedesktop.Sdk.Extension.node20", + "org.freedesktop.Sdk.Extension.typescript" ], "build-options": { - "append-path": "/usr/lib/sdk/vala/bin:/usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/node20/bin", + "append-path": "/usr/lib/sdk/vala/bin:/usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/node20/bin:/usr/lib/sdk/typescript/bin", "append-ld-library-path": "/usr/lib/sdk/vala/lib" }, "command": "workbench", diff --git a/build-aux/wip/run.js b/build-aux/wip/run.js index 0c4b58dd6..1cdeea95c 100755 --- a/build-aux/wip/run.js +++ b/build-aux/wip/run.js @@ -19,13 +19,12 @@ Gio._promisify( "wait_check_finish", ); -// const path = GLib.get_current_dir(); -const path = "/home/sonny/Projects/Workbench"; +const path = GLib.get_current_dir(); console.debug(programInvocationName, programArgs); const argv = minimist(programArgs, { boolean: true }); console.debug(argv); -const [manifest_path] = argv._; +const [manifest_path, ...arg] = argv._; if (!manifest_path) { // eslint-disable-next-line no-restricted-globals print(`${programInvocationName} [--verbose] [--debug] MANIFEST`); @@ -124,7 +123,8 @@ await buildCommand(["meson", "install", "-C", "_build"]); // ]); // starts workbench -await runCommand([manifest.command]); +const command = arg.length ? arg : [manifest.command]; +await runCommand(command); function buildCommand(argv) { let PATH = @@ -165,9 +165,9 @@ async function runCommand(argv) { `--bind-mount=/run/user/1000/doc=/run/user/1000/doc/by-app/${flatpak_id}`, ...manifest["finish-args"], - // Non default permissions - // see Permissions.js - // consider getting installed overrides instead + // Non default permissions, see Permissions.js + // consider getting installed overrides instead with + // flatpak override --user --show re.sonny.Workbench.Devel "--share=network", "--socket=pulseaudio", "--device=input", diff --git a/data/app.metainfo.xml b/data/app.metainfo.xml index 346f2565a..707dde48a 100644 --- a/data/app.metainfo.xml +++ b/data/app.metainfo.xml @@ -55,7 +55,10 @@

Library:

Dependencies: