Compare commits
2
Commits
203b573168
..
v0.2.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
541fde0e5a | ||
|
|
28f7e7ccc2 |
No files matched your search
@@ -0,0 +1,106 @@
|
||||
name: Build and Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: archlinux
|
||||
container:
|
||||
image: node:25
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install mise
|
||||
run: |
|
||||
curl -fsSL https://mise.run | sh
|
||||
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Install pnpm
|
||||
run: |
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
mise trust
|
||||
mise install pnpm
|
||||
mise reshim
|
||||
echo "$HOME/.local/share/mise/shims" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Install just
|
||||
run: |
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
|
||||
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y libglib2.0-dev glib-networking zip
|
||||
|
||||
- name: Install project dependencies
|
||||
run: pnpm install --frozen-lockfile --ignore-scripts
|
||||
|
||||
- name: Build and package extension
|
||||
run: just build-package
|
||||
|
||||
- name: Upload extension package
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: prettyborders-extension
|
||||
path: prettyborders.zip
|
||||
retention-days: 30
|
||||
|
||||
release:
|
||||
needs: build
|
||||
runs-on: archlinux
|
||||
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||
environment:
|
||||
name: production
|
||||
container:
|
||||
image: node:25
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: prettyborders-extension
|
||||
|
||||
- name: Get version from package.json
|
||||
id: get_version
|
||||
run: |
|
||||
VERSION=$(node -p "require('./package.json').version")
|
||||
echo "version=v${VERSION}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Create Gitea Release
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
run: |
|
||||
curl -X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"tag_name": "${{ steps.get_version.outputs.version }}",
|
||||
"name": "Release ${{ steps.get_version.outputs.version }}",
|
||||
"body": "Automated release of prettyborders GNOME extension ${{ steps.get_version.outputs.version }}\n\n## Installation\nDownload prettyborders.zip and install it as a GNOME extension."
|
||||
}' \
|
||||
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases"
|
||||
|
||||
- name: Upload Release Asset
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
run: |
|
||||
RELEASE_ID=$(curl -H "Authorization: token ${GITEA_TOKEN}" \
|
||||
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/tags/${{ steps.get_version.outputs.version }}" | \
|
||||
grep -Po '"id":\s*\K[0-9]+' | head -1)
|
||||
|
||||
curl -X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-F "attachment=@prettyborders.zip" \
|
||||
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=prettyborders.zip"
|
||||
Vendored
+9
-3
@@ -1,4 +1,10 @@
|
||||
import "@girs/gjs";
|
||||
import "@girs/gjs/ambient";
|
||||
import "@girs/gjs/dom";
|
||||
import "@girs/gnome-shell/ambient";
|
||||
import "@girs/gnome-shell/extensions/global";
|
||||
import "@girs/glib-2.0/ambient";
|
||||
import "@girs/gio-2.0/ambient";
|
||||
import "@girs/gobject-2.0/ambient";
|
||||
import "@girs/gtk-4.0/ambient";
|
||||
import "@girs/adw-1/ambient";
|
||||
import "@girs/st-51/ambient";
|
||||
import "@girs/meta-51/ambient";
|
||||
import "@girs/shell-51/ambient";
|
||||
+3
-1
@@ -5,6 +5,8 @@
|
||||
"shell-version": [
|
||||
"47",
|
||||
"48",
|
||||
"49"
|
||||
"49",
|
||||
"50",
|
||||
"51"
|
||||
]
|
||||
}
|
||||
+15
-28
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "prettyborders",
|
||||
"version": "0.2.2",
|
||||
"version": "0.2.3",
|
||||
"description": "A TypeScript GNOME Extension for Pretty Borders around your active window",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
@@ -21,32 +21,19 @@
|
||||
"lint": "eslint ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.27.0",
|
||||
"@girs/gjs": "4.0.0-beta.38",
|
||||
"@girs/gnome-shell": "49.0.1",
|
||||
"eslint": "^9.27.0",
|
||||
"eslint-plugin-jsdoc": "^50.6.17",
|
||||
"typescript": "^5.8.3",
|
||||
"typescript-eslint": "^8.56.1"
|
||||
},
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
"@girs/cairo-1.0": "1.0.0-4.0.0-beta.38",
|
||||
"@girs/freetype2-2.0": "2.0.0-4.0.0-beta.38",
|
||||
"@girs/gdk-4.0": "4.0.0-4.0.0-beta.38",
|
||||
"@girs/gdkpixbuf-2.0": "2.0.0-4.0.0-beta.38",
|
||||
"@girs/gio-2.0": "2.86.0-4.0.0-beta.38",
|
||||
"@girs/gjs": "4.0.0-beta.38",
|
||||
"@girs/glib-2.0": "2.86.0-4.0.0-beta.38",
|
||||
"@girs/gmodule-2.0": "2.0.0-4.0.0-beta.38",
|
||||
"@girs/gobject-2.0": "2.86.0-4.0.0-beta.38",
|
||||
"@girs/graphene-1.0": "1.0.0-4.0.0-beta.38",
|
||||
"@girs/gsk-4.0": "4.0.0-4.0.0-beta.38",
|
||||
"@girs/gtk-4.0": "4.20.1-4.0.0-beta.38",
|
||||
"@girs/harfbuzz-0.0": "11.5.0-4.0.0-beta.38",
|
||||
"@girs/mtk-17": "17.0.0-4.0.0-beta.38",
|
||||
"@girs/pango-1.0": "1.57.0-4.0.0-beta.38",
|
||||
"@girs/pangocairo-1.0": "1.0.0-4.0.0-beta.38"
|
||||
}
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@girs/adw-1": "^5.5.0",
|
||||
"@girs/gio-2.0": "^5.5.0",
|
||||
"@girs/gjs": "^5.5.0",
|
||||
"@girs/glib-2.0": "^5.5.0",
|
||||
"@girs/gobject-2.0": "^5.5.0",
|
||||
"@girs/gtk-4.0": "^5.5.0",
|
||||
"@girs/meta-51": "^5.5.0",
|
||||
"@girs/shell-51": "^5.5.0",
|
||||
"@girs/st-51": "^5.5.0",
|
||||
"eslint": "^10.12.0",
|
||||
"eslint-plugin-jsdoc": "^65.3.4",
|
||||
"typescript": "^6.0.3",
|
||||
"typescript-eslint": "^8.71.2"
|
||||
}
|
||||
}
|
||||
Generated
+766
-917
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,2 @@
|
||||
minimumReleaseAgeExclude:
|
||||
- eslint-plugin-jsdoc@65.3.4
|
||||
+5
-2
@@ -2,20 +2,23 @@
|
||||
"compilerOptions": {
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"rootDir": "./src",
|
||||
"outDir": "./dist",
|
||||
"sourceMap": false,
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"target": "ES2022",
|
||||
"lib": [
|
||||
"ES2022"
|
||||
],
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"ambient.d.ts",
|
||||
"types/**/*.d.ts",
|
||||
"src/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
],
|
||||
]
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* GNOME Shell runtime globals.
|
||||
*
|
||||
* The `global` object is created by the shell before an extension is loaded and
|
||||
* has no `.gir`, so it is not covered by the generated `@girs/*-51` packages.
|
||||
* Upstream ships these in `@girs/gnome-shell`, but its GNOME 51 build
|
||||
* (51.0.0-alpha.1) is unpublished, and v50 pulls St-18/Meta-18 types that
|
||||
* collide with the -51 packages. Declaring the few symbols we use keeps the
|
||||
* project on GNOME 51 types and installable from the registry.
|
||||
*
|
||||
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/environment.js
|
||||
*/
|
||||
import type Shell from "@girs/shell-51";
|
||||
|
||||
declare global {
|
||||
/** Global shell object created by GNOME Shell on startup. */
|
||||
const global: Shell.Global;
|
||||
}
|
||||
|
||||
export {};
|
||||
Vendored
+86
@@ -0,0 +1,86 @@
|
||||
/**
|
||||
* Ambient declarations for the GNOME Shell JavaScript modules this extension
|
||||
* imports.
|
||||
*
|
||||
* Shell's JavaScript API has no `.gir`, so generated `@girs/*` types do not
|
||||
* cover it. Upstream maintains those types in `@girs/gnome-shell`, but its
|
||||
* GNOME 51 support (51.0.0-alpha.1) is unpublished on npm, and v50 depends on
|
||||
* St-18/Meta-18 types that conflict with the -51 packages this project uses.
|
||||
* Only the symbols actually imported here are declared; extend as needed.
|
||||
*
|
||||
* Signatures follow GNOME Shell 51:
|
||||
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/extensions/extension.js
|
||||
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/extensions/prefs.js
|
||||
*/
|
||||
|
||||
declare module "resource:///org/gnome/shell/extensions/extension.js" {
|
||||
import type Gio from "@girs/gio-2.0";
|
||||
|
||||
/** Parsed contents of the extension's `metadata.json`. */
|
||||
export interface ExtensionMetadata {
|
||||
uuid: string;
|
||||
name: string;
|
||||
description: string;
|
||||
"shell-version"?: string[];
|
||||
"settings-schema"?: string;
|
||||
"gettext-domain"?: string;
|
||||
url?: string;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
/**
|
||||
* Base class for an extension's `extension.js` default export.
|
||||
*
|
||||
* GNOME Shell 51 requires `disable()` to stay synchronous; returning a
|
||||
* promise now throws.
|
||||
*/
|
||||
export class Extension {
|
||||
constructor(metadata: ExtensionMetadata);
|
||||
|
||||
readonly metadata: ExtensionMetadata;
|
||||
readonly uuid: string;
|
||||
readonly path: string;
|
||||
|
||||
/** Returns a {@link Gio.Settings} for the extension's schema. */
|
||||
getSettings(schema?: string | null, subdir?: string | null): Gio.Settings;
|
||||
|
||||
/** Marks the extension's settings as translatable. */
|
||||
translateConfig(): void;
|
||||
|
||||
/** Opens the extension's preferences dialog, if it has one. */
|
||||
openPreferences(): void;
|
||||
|
||||
enable(): void;
|
||||
disable(): void;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js" {
|
||||
import type Gio from "@girs/gio-2.0";
|
||||
import type Adw from "@girs/adw-1";
|
||||
|
||||
/** Marks a string for translation and returns the translation. */
|
||||
export function gettext(str: string): string;
|
||||
|
||||
/** Pluralised form of {@link gettext}. */
|
||||
export function ngettext(fid: string, fidPlural: string, n: number): string;
|
||||
|
||||
/** Context-sensitive form of {@link gettext}. */
|
||||
export function pgettext(context: string, str: string): string;
|
||||
|
||||
/** Base class for an extension's `prefs.js` default export. */
|
||||
export class ExtensionPreferences {
|
||||
readonly metadata: Record<string, unknown>;
|
||||
readonly uuid: string;
|
||||
readonly path: string;
|
||||
|
||||
/** Returns a {@link Gio.Settings} for the extension's schema. */
|
||||
getSettings(schema?: string | null, subdir?: string | null): Gio.Settings;
|
||||
|
||||
/** Marks the extension's settings as translatable. */
|
||||
translateConfig(): void;
|
||||
|
||||
/** Called by the shell to populate the preferences window. */
|
||||
fillPreferencesWindow(window: Adw.PreferencesWindow): Promise<void> | void;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user