From b8b18c67ebb7de831f98804b870c7b8f58a69750 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 14:04:08 +0000 Subject: [PATCH 01/60] build(deps): bump platformdirs from 4.2.0 to 4.2.1 in /code Bumps [platformdirs](https://github.com/platformdirs/platformdirs) from 4.2.0 to 4.2.1. - [Release notes](https://github.com/platformdirs/platformdirs/releases) - [Changelog](https://github.com/platformdirs/platformdirs/blob/main/CHANGES.rst) - [Commits](https://github.com/platformdirs/platformdirs/compare/4.2.0...4.2.1) --- updated-dependencies: - dependency-name: platformdirs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- code/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/requirements.txt b/code/requirements.txt index fcd9a23a3..58212da99 100644 --- a/code/requirements.txt +++ b/code/requirements.txt @@ -32,9 +32,9 @@ lsprotocol==2023.0.1 \ --hash=sha256:c75223c9e4af2f24272b14c6375787438279369236cd568f596d4951052a60f2 \ --hash=sha256:cc5c15130d2403c18b734304339e51242d3018a05c4f7d0f198ad6e0cd21861d # via pygls -platformdirs==4.2.0 \ - --hash=sha256:0614df2a2f37e1a662acbd8e2b25b92ccf8632929bc6d43467e17fe89c75e068 \ - --hash=sha256:ef0cc731df711022c174543cb70a9b5bd22e5a9337c8624ef2c2ceb8ddad8768 +platformdirs==4.2.1 \ + --hash=sha256:031cd18d4ec63ec53e82dceaac0417d218a6863f7745dfcc9efe7793b7039bdf \ + --hash=sha256:17d5a1161b3fd67b390023cb2d3b026bbd40abde6fdb052dfbd3a29c3ba22ee1 # via -r requirements.in pygls==1.3.1 \ --hash=sha256:140edceefa0da0e9b3c533547c892a42a7d2fd9217ae848c330c53d266a55018 \ From 54687d7514eb4533be3b1280299541c1a1b3f985 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 18:08:28 +0000 Subject: [PATCH 02/60] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) - [github.com/pre-commit/mirrors-mypy: v1.9.0 → v1.10.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.9.0...v1.10.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 25e0683f6..05600638d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 24.4.0 + rev: 24.4.2 hooks: - id: black @@ -28,7 +28,7 @@ repos: args: [--settings-file=lib/esbonio/pyproject.toml] - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v1.9.0' + rev: 'v1.10.0' hooks: - id: mypy name: mypy (scripts) From c7f535748c59f6944a818c6bfa78a47773743104 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Mon, 29 Apr 2024 19:32:06 +0100 Subject: [PATCH 03/60] docs: Document equivalent sphinx-build flags --- docs/lsp/howto/migrate-to-v1.rst | 82 +++++++++++++++++++------------- 1 file changed, 48 insertions(+), 34 deletions(-) diff --git a/docs/lsp/howto/migrate-to-v1.rst b/docs/lsp/howto/migrate-to-v1.rst index 16fed68ba..fb9d0d9ba 100644 --- a/docs/lsp/howto/migrate-to-v1.rst +++ b/docs/lsp/howto/migrate-to-v1.rst @@ -15,13 +15,15 @@ This guide covers the breaking changes between the ``v0.x`` and ``v1.x`` version Installation Changes -------------------- -Previously, you would have had to install ``esbonio`` as a development dependency for every project you wished to use it in. -In ``v1.x`` this is no longer necessary, in fact, it's recommended you remove it from all of your project specific environments:: +Previously, it was recommended to install ``esbonio`` as a development dependency for each project you wished to use with. +This was because ``esbonio`` would run Sphinx as part of its own process and therefore need access to your project's dependencies. + +In ``v1.x`` Sphinx is now run in a separate process so this is no longer necessary, in fact, it's recommended you remove it from your project specific environments:: (env) $ pip uninstall esbonio -Instead, you should now have a single, global installation that can be reused across projects. -We recommend that you use `pipx `__ to manage this installation for you:: +Instead, you can now have a single, global installation that is reused across projects. +It's recommended that you use `pipx `__ to manage this installation for you:: $ pipx install esbonio # Installs esbonio globally in an isolated environment $ pipx upgrade esbonio # Upgrade esbonio and its dependencies @@ -37,7 +39,7 @@ Configuration Changes With the release of ``v1.x``, Esbonio's configuration system has been overhauled, see :ref:`lsp-configuration` for all of the available configuration options and methods. -While ``esbonio`` can now be installed globally, it still needs access to your project's development environment in order to properly understand it. +While ``esbonio`` can now be installed globally, it still needs access to your project's development environment in order launch Sphinx correctly. This means the two most imporant configuration values are - :esbonio:conf:`esbonio.sphinx.pythonCommand`: For telling ``esbonio`` the command it needs to run in order to use the correct Python environment. @@ -45,32 +47,44 @@ This means the two most imporant configuration values are The following table outlines the configuration options that have been removed in ``v1.x`` and what their correpsonding replacement is -+-----------------------------------------+-------------------------------------------------+-------------+ -| Removed Option | Replacement | Notes | -+=========================================+=================================================+=============+ -| - ``esbonio.server.hideSphinxOutput`` | :esbonio:conf:`esbonio.sphinx.buildCommand` | | -| - ``esbonio.sphinx.buildDir`` | | | -| - ``esbonio.sphinx.builderName`` | | | -| - ``esbonio.sphinx.confDir`` | | | -| - ``esbonio.sphinx.doctreeDir`` | | | -| - ``esbonio.sphinx.forceFullBuild`` | | | -| - ``esbonio.sphinx.keepGoing`` | | | -| - ``esbonio.sphinx.makeMode`` | | | -| - ``esbonio.sphinx.numJobs`` | | | -| - ``esbonio.sphinx.quiet`` | | | -| - ``esbonio.sphinx.silent`` | | | -| - ``esbonio.sphinx.srcDir`` | | | -| - ``esbonio.sphinx.tags`` | | | -| - ``esbonio.sphinx.verbosity`` | | | -| - ``esbonio.sphinx.warningIsError`` | | | -+-----------------------------------------+-------------------------------------------------+-------------+ -| ``esbonio.server.logLevel`` | :esbonio:conf:`esbonio.logging.level` | | -+-----------------------------------------+-------------------------------------------------+-------------+ -| ``esbonio.server.logFilter`` | :esbonio:conf:`esbonio.logging.config` | | -+-----------------------------------------+-------------------------------------------------+-------------+ -| ``esbonio.server.enabledInPyFiles`` | :esbonio:conf:`esbonio.server.documentSelector` | VSCode only | -+-----------------------------------------+-------------------------------------------------+-------------+ -| - ``esbonio.server.installBehavior`` | N/A | VSCode only,| -| - ``esbonio.server.updateBehavior`` | | no longer | -| - ``esbonio.server.updateFrequency`` | | required. | -+-----------------------------------------+-------------------------------------------------+-------------+ ++-----------------------------------------+-------------------------------------------------+--------------------------------------------------------------+ +| Removed Option | Replacement | Notes | ++=========================================+=================================================+==============================================================+ +| - ``esbonio.sphinx.builderName`` | :esbonio:conf:`esbonio.sphinx.buildCommand` | Pass ``-b `` to | +| - ``esbonio.sphinx.srcDir`` | | ``sphinx-build`` | +| - ``esbonio.sphinx.buildDir`` | | | ++-----------------------------------------+-------------------------------------------------+--------------------------------------------------------------+ +| ``esbonio.sphinx.confDir`` | :esbonio:conf:`esbonio.sphinx.buildCommand` | Use ``-c `` | ++-----------------------------------------+-------------------------------------------------+--------------------------------------------------------------+ +| ``esbonio.sphinx.doctreeDir`` | :esbonio:conf:`esbonio.sphinx.buildCommand` | Use ``-d `` | ++-----------------------------------------+-------------------------------------------------+--------------------------------------------------------------+ +| ``esbonio.sphinx.forceFullBuild`` | :esbonio:conf:`esbonio.sphinx.buildCommand` | Use ``-E`` | ++-----------------------------------------+-------------------------------------------------+--------------------------------------------------------------+ +| ``esbonio.sphinx.keepGoing`` | :esbonio:conf:`esbonio.sphinx.buildCommand` | Use ``--keep-going`` | ++-----------------------------------------+-------------------------------------------------+--------------------------------------------------------------+ +| ``esbonio.sphinx.makeMode`` | :esbonio:conf:`esbonio.sphinx.buildCommand` | Pass ``-M `` to | +| | | ``sphinx-build`` | ++-----------------------------------------+-------------------------------------------------+--------------------------------------------------------------+ +| ``esbonio.sphinx.numJobs`` | :esbonio:conf:`esbonio.sphinx.buildCommand` | Use ``-j `` | ++-----------------------------------------+-------------------------------------------------+--------------------------------------------------------------+ +| ``esbonio.sphinx.quiet`` | :esbonio:conf:`esbonio.sphinx.buildCommand` | Use ``-q`` | ++-----------------------------------------+-------------------------------------------------+--------------------------------------------------------------+ +| ``esbonio.sphinx.tags`` | :esbonio:conf:`esbonio.sphinx.buildCommand` | Use ``-t`` | ++-----------------------------------------+-------------------------------------------------+--------------------------------------------------------------+ +| ``esbonio.sphinx.verbosity`` | :esbonio:conf:`esbonio.sphinx.buildCommand` | Use ``-v`` | ++-----------------------------------------+-------------------------------------------------+--------------------------------------------------------------+ +| ``esbonio.sphinx.warningIsError`` | :esbonio:conf:`esbonio.sphinx.buildCommand` | Use ``-W`` | ++-----------------------------------------+-------------------------------------------------+--------------------------------------------------------------+ +| - ``esbonio.server.hideSphinxOutput`` | :esbonio:conf:`esbonio.sphinx.buildCommand` | Use ``-Q`` | +| - ``esbonio.sphinx.silent`` | | | ++-----------------------------------------+-------------------------------------------------+--------------------------------------------------------------+ +| ``esbonio.server.logLevel`` | :esbonio:conf:`esbonio.logging.level` | | ++-----------------------------------------+-------------------------------------------------+--------------------------------------------------------------+ +| ``esbonio.server.logFilter`` | :esbonio:conf:`esbonio.logging.config` | | ++-----------------------------------------+-------------------------------------------------+--------------------------------------------------------------+ +| ``esbonio.server.enabledInPyFiles`` | :esbonio:conf:`esbonio.server.documentSelector` | VSCode only | ++-----------------------------------------+-------------------------------------------------+--------------------------------------------------------------+ +| - ``esbonio.server.installBehavior`` | N/A | VSCode only, no longer required. | +| - ``esbonio.server.updateBehavior`` | | | +| - ``esbonio.server.updateFrequency`` | | | ++-----------------------------------------+-------------------------------------------------+--------------------------------------------------------------+ From b1fb6ab90b195f50e58c07b295418b15aaf0daa1 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Mon, 29 Apr 2024 20:09:24 +0100 Subject: [PATCH 04/60] docs: Resolve cross references This makes the :esbonio:conf: actually work --- docs/ext/domain.py | 54 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/docs/ext/domain.py b/docs/ext/domain.py index 6dda6bbf3..39b4d8ba9 100644 --- a/docs/ext/domain.py +++ b/docs/ext/domain.py @@ -1,4 +1,6 @@ -from typing import Dict +from __future__ import annotations + +import typing from docutils.parsers.rst import directives from sphinx import addnodes @@ -7,7 +9,19 @@ from sphinx.domains import Domain from sphinx.domains import ObjType from sphinx.roles import XRefRole -from sphinx.util.typing import OptionSpec +from sphinx.util.nodes import make_id +from sphinx.util.nodes import make_refnode + +if typing.TYPE_CHECKING: + from typing import Dict + from typing import Optional + from typing import Tuple + + from docutils.nodes import Element + from sphinx.addnodes import pending_xref + from sphinx.builders import Builder + from sphinx.environment import BuildEnvironment + from sphinx.util.typing import OptionSpec def config_scope(argument: str): @@ -45,6 +59,15 @@ def handle_signature(self, sig: str, signode: addnodes.desc_signature) -> str: signode += addnodes.desc_name(sig, sig) return sig + def add_target_and_index( + self, name: str, sig: str, signode: addnodes.desc_signature + ) -> None: + node_id = make_id(self.env, self.state.document, term=name) + signode["ids"].append(node_id) + + domain: EsbonioDomain = self.env.domains["esbonio"] + domain.config_values[name] = (self.env.docname, node_id) + class EsbonioDomain(Domain): """A domain dedicated to documenting the esbonio language server""" @@ -64,6 +87,33 @@ class EsbonioDomain(Domain): "conf": XRefRole(), } + initial_data = { + "config_values": {}, + } + + @property + def config_values(self) -> dict[str, Tuple[str, str]]: + return self.data.setdefault("config_values", {}) + + def resolve_xref( + self, + env: BuildEnvironment, + fromdocname: str, + builder: Builder, + type: str, + target: str, + node: pending_xref, + contnode: Element, + ) -> Optional[Element]: + """Resolve cross references""" + + if (entry := self.config_values.get(target, None)) is None: + return None + + return make_refnode( + builder, fromdocname, entry[0], entry[1], [contnode], target + ) + def setup(app: Sphinx): app.add_domain(EsbonioDomain) From adf9d6a153edcbf720a75165b56b950f482583ef Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Wed, 1 May 2024 18:19:59 +0000 Subject: [PATCH 05/60] Initial pass at a .devcontainer.json definition --- .devcontainer/Dockerfile | 7 +++ .devcontainer/devcontainer.json | 28 ++++++++++ .devcontainer/tools.mk | 95 +++++++++++++++++++++++++++++++++ .vscode/extensions.json | 5 +- 4 files changed, 132 insertions(+), 3 deletions(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/tools.mk diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000..6752bc3e0 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,7 @@ +FROM mcr.microsoft.com/devcontainers/base:jammy + +COPY tools.mk / + +RUN ls /home -l && \ + su vscode -c "make -f tools.mk tools" \ + && rm tools.mk diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..f375b9028 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,28 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu +{ + "name": "Ubuntu", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + // "image": "mcr.microsoft.com/devcontainers/base:jammy" + "build": { + "dockerfile": "Dockerfile" + }, + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "uname -a", + // Configure tool-specific properties. + "customizations": { + "vscode": { + "extensions": [ + "charliermarsh.ruff", + "ms-python.python", + "tamasfe.even-better-toml" + ] + } + } + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.devcontainer/tools.mk b/.devcontainer/tools.mk new file mode 100644 index 000000000..5e0d5bc3c --- /dev/null +++ b/.devcontainer/tools.mk @@ -0,0 +1,95 @@ +BIN:=$(HOME)/.local/bin + +HATCH := $(BIN)/hatch +HATCH_VERSION = 1.9.7 + +PY38 := $(BIN)/python3.8 +PY39 := $(BIN)/python3.9 +PY310 := $(BIN)/python3.10 +PY311 := $(BIN)/python3.11 +PY312 := $(BIN)/python3.12 + +# Set a default python +PY := $(BIN)/python + +NPM := $(BIN)/npm +NODE := $(BIN)/node +NODE_VERSION := 18.20.2 +NODE_DIR := $(HOME)/.local/node + +tools: $(HATCH) $(PY38) $(PY39) $(PY310) $(PY311) $(PY312) $(PY) $(NPM) $(NODE) + $(HATCH) --version + $(PY38) --version + $(PY39) --version + $(PY310) --version + $(PY311) --version + $(PY312) --version + $(PY) --version + $(NODE) --version + PATH=$(BIN) $(NPM) --version + +$(HATCH): + curl -L --output /tmp/hatch.tar.gz https://github.com/pypa/hatch/releases/download/hatch-v$(HATCH_VERSION)/hatch-$(HATCH_VERSION)-x86_64-unknown-linux-gnu.tar.gz + tar -xf /tmp/hatch.tar.gz -C /tmp + rm /tmp/hatch.tar.gz + + [ -d $(BIN) ] || mkdir -p $(BIN) + mv /tmp/hatch-$(HATCH_VERSION)-x86_64-unknown-linux-gnu $(HATCH) + + $@ --version + touch $@ + +$(PY38): $(HATCH) + $(HATCH) python find 3.8 || $(HATCH) python install 3.8 + ln -s $$($(HATCH) python find 3.8) $@ + + $@ --version + touch $@ + +$(PY39): $(HATCH) + $(HATCH) python find 3.9 || $(HATCH) python install 3.9 + ln -s $$($(HATCH) python find 3.9) $@ + + $@ --version + touch $@ + +$(PY310): $(HATCH) + $(HATCH) python find 3.10 || $(HATCH) python install 3.10 + ln -s $$($(HATCH) python find 3.10) $@ + + $@ --version + touch $@ + +$(PY311): $(HATCH) + $(HATCH) python find 3.11 || $(HATCH) python install 3.11 + ln -s $$($(HATCH) python find 3.11) $@ + + $@ --version + touch $@ + +$(PY312): $(HATCH) + $(HATCH) python find 3.12 || $(HATCH) python install 3.12 + ln -s $$($(HATCH) python find 3.12) $@ + + $@ --version + touch $@ + +$(PY): $(PY312) + ln -s $< $@ + $@ --version + touch $@ + +$(NPM): + curl -L --output /tmp/node.tar.xz https://nodejs.org/dist/v$(NODE_VERSION)/node-v$(NODE_VERSION)-linux-x64.tar.xz + tar -xJf /tmp/node.tar.xz -C /tmp + rm /tmp/node.tar.xz + + [ -d $(NODE_DIR) ] || mkdir -p $(NODE_DIR) + mv /tmp/node-v$(NODE_VERSION)-linux-x64/* $(NODE_DIR) + + [ -d $(BIN) ] || mkdir -p $(BIN) + ln -s $(NODE_DIR)/bin/node $(NODE) + ln -s $(NODE_DIR)/bin/npm $(NPM) + + $(NODE) --version + PATH=$(BIN) $(NPM) --version diff --git a/.vscode/extensions.json b/.vscode/extensions.json index bf6f24fcc..a65ea7964 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,8 +1,7 @@ { "recommendations": [ + "charliermarsh.ruff", "ms-python.python", - "ms-python.black-formatter", - "ms-python.isort", - "swyddfa.esbonio" + "tamasfe.even-better-toml" ] } From 0b833b0d3a3ee7e5989c1dbd1817c1a5d7a0d388 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Wed, 1 May 2024 19:59:47 +0100 Subject: [PATCH 06/60] workflow: Build and push devcontainer to registry --- .github/workflows/devenv.yml | 54 ++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/devenv.yml diff --git a/.github/workflows/devenv.yml b/.github/workflows/devenv.yml new file mode 100644 index 000000000..8d0de7367 --- /dev/null +++ b/.github/workflows/devenv.yml @@ -0,0 +1,54 @@ +name: 'Build devcontainer' +on: + pull_request: + branches: + - develop + paths: + - '.devcontainer/**' + + push: + branches: + - develop + paths: + - '.devcontainer/**' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }}-devenv + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to the Container registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + id: push + uses: docker/build-push-action@v5 + with: + context: .devcontainer/ + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 36051a03c82b6f6fbb18ee3ac9d445b8d641e86c Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Thu, 2 May 2024 16:46:54 +0000 Subject: [PATCH 07/60] devenv: Add some global python tools --- .devcontainer/tools.mk | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/.devcontainer/tools.mk b/.devcontainer/tools.mk index 5e0d5bc3c..9b8d192c0 100644 --- a/.devcontainer/tools.mk +++ b/.devcontainer/tools.mk @@ -1,8 +1,5 @@ BIN:=$(HOME)/.local/bin -HATCH := $(BIN)/hatch -HATCH_VERSION = 1.9.7 - PY38 := $(BIN)/python3.8 PY39 := $(BIN)/python3.9 PY310 := $(BIN)/python3.10 @@ -11,22 +8,23 @@ PY312 := $(BIN)/python3.12 # Set a default python PY := $(BIN)/python +PY_INTERPRETERS := $(PY) $(PY38) $(PY39) $(PY310) $(PY311) $(PY312) + +HATCH := $(BIN)/hatch +HATCH_VERSION = 1.9.7 +PRE_COMMIT := $(BIN)/pre-commit +TOWNCRIER := $(BIN)/towncrier +PY_TOOLS := $(HATCH) $(PRE_COMMIT) $(TOWNCRIER) + +# Node JS NPM := $(BIN)/npm NODE := $(BIN)/node NODE_VERSION := 18.20.2 NODE_DIR := $(HOME)/.local/node -tools: $(HATCH) $(PY38) $(PY39) $(PY310) $(PY311) $(PY312) $(PY) $(NPM) $(NODE) - $(HATCH) --version - $(PY38) --version - $(PY39) --version - $(PY310) --version - $(PY311) --version - $(PY312) --version - $(PY) --version - $(NODE) --version - PATH=$(BIN) $(NPM) --version +tools: $(PY_INTERPRETERS) $(PY_TOOLS) $(NPM) $(NODE) + for prog in $^ ; do echo -n "$${prog}\t" ; $${prog} --version; done $(HATCH): curl -L --output /tmp/hatch.tar.gz https://github.com/pypa/hatch/releases/download/hatch-v$(HATCH_VERSION)/hatch-$(HATCH_VERSION)-x86_64-unknown-linux-gnu.tar.gz @@ -79,6 +77,16 @@ $(PY): $(PY312) $@ --version touch $@ +$(PRE_COMMIT): $(PY) + $(PY) -m pip install --user pre-commit + $@ --version + touch $@ + +$(TOWNCRIER): $(PY) + $(PY) -m pip install --user towncrier + $@ --version + touch $@ + $(NPM): curl -L --output /tmp/node.tar.xz https://nodejs.org/dist/v$(NODE_VERSION)/node-v$(NODE_VERSION)-linux-x64.tar.xz tar -xJf /tmp/node.tar.xz -C /tmp From 6683c550869a535fa62c30d3ce62faa12a458fbc Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Thu, 2 May 2024 18:29:57 +0100 Subject: [PATCH 08/60] devenv: Tag container as latest --- .github/workflows/devenv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/devenv.yml b/.github/workflows/devenv.yml index 8d0de7367..a6b5ce54d 100644 --- a/.github/workflows/devenv.yml +++ b/.github/workflows/devenv.yml @@ -50,5 +50,5 @@ jobs: with: context: .devcontainer/ push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} + tags: latest labels: ${{ steps.meta.outputs.labels }} From 08b71260b42ae79448f4a361ad6378125a9250c2 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Thu, 2 May 2024 18:32:41 +0100 Subject: [PATCH 09/60] devenv: Add worklow_dispatch trigger --- .github/workflows/devenv.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/devenv.yml b/.github/workflows/devenv.yml index a6b5ce54d..aad644d97 100644 --- a/.github/workflows/devenv.yml +++ b/.github/workflows/devenv.yml @@ -1,5 +1,8 @@ name: 'Build devcontainer' on: + + workflow_dispatch: + pull_request: branches: - develop From ab2db6de61cf67e2b8fdc0212efae8c04aac31f0 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Thu, 2 May 2024 18:40:04 +0100 Subject: [PATCH 10/60] devenv: I think the tag needs to include image name and registry --- .github/workflows/devenv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/devenv.yml b/.github/workflows/devenv.yml index aad644d97..3133a5c74 100644 --- a/.github/workflows/devenv.yml +++ b/.github/workflows/devenv.yml @@ -53,5 +53,5 @@ jobs: with: context: .devcontainer/ push: ${{ github.event_name != 'pull_request' }} - tags: latest + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest labels: ${{ steps.meta.outputs.labels }} From e1a70e8b256422e6c53cf3eac0933975a24ee70e Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Thu, 2 May 2024 19:47:24 +0100 Subject: [PATCH 11/60] devenv: Use tools from environment, where possible Initially, I had wanted to also use the devcontainer in the CI pipelines so that there was a consistent environment used everywhere. However, the devcontainer is built with a `vscode` user so all tools live under `/home/vscode/.local/bin`. But when the container is run by Github Actions, `HOME` is set to something like `/github/home` so none of the pre-installed tools are found! Not only does this lead to re-installing all the required tools with each build, scripts like `make_release.py` break as they expect tools like `hatch` to be sitting on the `PATH`. I did find that there is a `devcontainers/ci` action available which looks like it could work, but has its own set of trade-offs with would require re-designing the pipelines altogether... Instead, this commit introduces a pattern which *assuming it works* should lead to a much nicer experience all around: TOOL ?= $(or $(shell command v tool), $(BIN)/tool) where - `?=` means the expression is only evaluated if `TOOL` is not already set. Allowing someone to override it at invocation time e.g. `TOOL=/path/to/tool make ` - `$(shell command -v tool)` will resolve to the full path to the `tool` executable, if it exists on the user's `PATH` - `$(BIN)/tool`, being the second option passed to `$(or` this will be the fallback option if the user does not already have `tool` available on their `PATH` When coupled with the `$(TOOL):` rules, this has the effect of installing the given tool, only if the user does not have a version of it installed already. Hopefully, this should mean that the `Makefiles` will be useful both inside and outside of a devcontainer! --- .devcontainer/tools.mk | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.devcontainer/tools.mk b/.devcontainer/tools.mk index 9b8d192c0..4aa1283d4 100644 --- a/.devcontainer/tools.mk +++ b/.devcontainer/tools.mk @@ -1,25 +1,25 @@ -BIN:=$(HOME)/.local/bin +BIN ?= $(HOME)/.local/bin -PY38 := $(BIN)/python3.8 -PY39 := $(BIN)/python3.9 -PY310 := $(BIN)/python3.10 -PY311 := $(BIN)/python3.11 -PY312 := $(BIN)/python3.12 +PY38 ?= $(or $(shell command -v python3.8), $(BIN)/python3.8) +PY39 ?= $(or $(shell command -v python3.9), $(BIN)/python3.9) +PY310 ?= $(or $(shell command -v python3.10), $(BIN)/python3.10) +PY311 ?= $(or $(shell command -v python3.11), $(BIN)/python3.11) +PY312 ?= $(or $(shell command -v python3.12), $(BIN)/python3.12) # Set a default python -PY := $(BIN)/python +PY ?= $(or $(shell command -v python), $(BIN)/python) PY_INTERPRETERS := $(PY) $(PY38) $(PY39) $(PY310) $(PY311) $(PY312) -HATCH := $(BIN)/hatch +HATCH ?= $(or $(shell command -v hatch), $(BIN)/hatch) HATCH_VERSION = 1.9.7 -PRE_COMMIT := $(BIN)/pre-commit -TOWNCRIER := $(BIN)/towncrier +PRE_COMMIT ?= $(or $(shell command -v pre-commit), $(BIN)/pre-commit) +TOWNCRIER ?= $(or $(shell command -v towncrier), $(BIN)/towncrier) PY_TOOLS := $(HATCH) $(PRE_COMMIT) $(TOWNCRIER) # Node JS -NPM := $(BIN)/npm -NODE := $(BIN)/node +NPM ?= $(or $(shell command -v npm), $(BIN)/npm) +NODE ?= $(or $(shell command -v node), $(BIN)/node) NODE_VERSION := 18.20.2 NODE_DIR := $(HOME)/.local/node From 3641d53a7a11897076c42ce02e486acd91f018c0 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Fri, 3 May 2024 23:30:46 +0100 Subject: [PATCH 12/60] devenv: Only define targets when tool is not available An issue with the previous approach is that if the target exists and happened to be older than the tool used to bootstrap it, `make` would try to re-install it! Instead when falling back to an existing install we don't define a target at all, sidestepping the issue. This commit also introduces some `define` rules allowing us to write a template rule once and initialize it multiple times with different parameters - useful for defining multiple versions of Python! --- .devcontainer/tools.mk | 124 ++++++++++++++++++++++++----------------- 1 file changed, 72 insertions(+), 52 deletions(-) diff --git a/.devcontainer/tools.mk b/.devcontainer/tools.mk index 4aa1283d4..518123ccf 100644 --- a/.devcontainer/tools.mk +++ b/.devcontainer/tools.mk @@ -1,91 +1,105 @@ BIN ?= $(HOME)/.local/bin -PY38 ?= $(or $(shell command -v python3.8), $(BIN)/python3.8) -PY39 ?= $(or $(shell command -v python3.9), $(BIN)/python3.9) -PY310 ?= $(or $(shell command -v python3.10), $(BIN)/python3.10) -PY311 ?= $(or $(shell command -v python3.11), $(BIN)/python3.11) -PY312 ?= $(or $(shell command -v python3.12), $(BIN)/python3.12) +HATCH_VERSION = 1.10.0 +NODE_VERSION := 18.20.2 -# Set a default python -PY ?= $(or $(shell command -v python), $(BIN)/python) -PY_INTERPRETERS := $(PY) $(PY38) $(PY39) $(PY310) $(PY311) $(PY312) +# The versions of Python we support +PYXX_versions := 3.8 3.9 3.10 3.11 3.12 +PY_INTERPRETERS = +# Hatch is not only used for building packages, but bootstrapping any missing +# interpreters HATCH ?= $(or $(shell command -v hatch), $(BIN)/hatch) -HATCH_VERSION = 1.9.7 -PRE_COMMIT ?= $(or $(shell command -v pre-commit), $(BIN)/pre-commit) -TOWNCRIER ?= $(or $(shell command -v towncrier), $(BIN)/towncrier) - -PY_TOOLS := $(HATCH) $(PRE_COMMIT) $(TOWNCRIER) - -# Node JS -NPM ?= $(or $(shell command -v npm), $(BIN)/npm) -NODE ?= $(or $(shell command -v node), $(BIN)/node) -NODE_VERSION := 18.20.2 -NODE_DIR := $(HOME)/.local/node - -tools: $(PY_INTERPRETERS) $(PY_TOOLS) $(NPM) $(NODE) - for prog in $^ ; do echo -n "$${prog}\t" ; $${prog} --version; done $(HATCH): curl -L --output /tmp/hatch.tar.gz https://github.com/pypa/hatch/releases/download/hatch-v$(HATCH_VERSION)/hatch-$(HATCH_VERSION)-x86_64-unknown-linux-gnu.tar.gz tar -xf /tmp/hatch.tar.gz -C /tmp rm /tmp/hatch.tar.gz - [ -d $(BIN) ] || mkdir -p $(BIN) + test -d $(BIN) || mkdir -p $(BIN) mv /tmp/hatch-$(HATCH_VERSION)-x86_64-unknown-linux-gnu $(HATCH) $@ --version touch $@ -$(PY38): $(HATCH) - $(HATCH) python find 3.8 || $(HATCH) python install 3.8 - ln -s $$($(HATCH) python find 3.8) $@ +# This effectively defines a function `PYXX` that takes a Python version number +# (e.g. 3.8) and expands it out into a common block of code that will ensure a +# verison of that interpreter is available to be used. +# +# The is perhaps a bit more complicated than I'd like, but it should mean that +# the project's makefiles are useful both inside and outside of a devcontainer. +# +# `PYXX` has the following behavior: +# - If possible, it will reuse the user's existing version of Python +# i.e. $(shell command -v pythonX.X) +# +# - The user may force a specific interpreter to be used by setting the +# variable when running make e.g. PYXX=/path/to/pythonX.X make ... +# +# - Otherwise, `make` will use `$(HATCH)` to install the given version of +# Python under `$(BIN)` +# +# See: https://www.gnu.org/software/make/manual/html_node/Eval-Function.html +define PYXX = - $@ --version - touch $@ +PY$(subst .,,$1) ?= $$(shell command -v python$1) -$(PY39): $(HATCH) - $(HATCH) python find 3.9 || $(HATCH) python install 3.9 - ln -s $$($(HATCH) python find 3.9) $@ +ifeq ($$(strip $$(PY$(subst .,,$1))),) - $@ --version - touch $@ +PY$(subst .,,$1) := $$(BIN)/python$1 -$(PY310): $(HATCH) - $(HATCH) python find 3.10 || $(HATCH) python install 3.10 - ln -s $$($(HATCH) python find 3.10) $@ +$$(PY$(subst .,,$1)): $$(HATCH) + $$(HATCH) python find $1 || $$(HATCH) python install $1 + ln -s $$$$($$(HATCH) python find $1) $$@ - $@ --version - touch $@ + $$@ --version + touch $$@ -$(PY311): $(HATCH) - $(HATCH) python find 3.11 || $(HATCH) python install 3.11 - ln -s $$($(HATCH) python find 3.11) $@ +endif - $@ --version - touch $@ +PY_INTERPRETERS += $$(PY$(subst .,,$1)) +endef -$(PY312): $(HATCH) - $(HATCH) python find 3.12 || $(HATCH) python install 3.12 - ln -s $$($(HATCH) python find 3.12) $@ +# Uncomment the following line to see what this expands into. +#$(foreach version,$(PYXX_versions),$(info $(call PYXX,$(version)))) +$(foreach version,$(PYXX_versions),$(eval $(call PYXX,$(version)))) - $@ --version - touch $@ +# Set a default `python` command if there is not one already +PY ?= $(shell command -v python) + +ifeq ($(strip $(PY)),) +PY := $(BIN)/python $(PY): $(PY312) ln -s $< $@ $@ --version touch $@ +endif + +PY_INTERPRETERS += $(PY) +#$(info $(PY_INTERPRETERS)) + +PRE_COMMIT ?= $(shell command -v pre-commit) + +ifeq ($(strip $(PRE_COMMIT)),) +PRE_COMMIT := $(BIN)/pre-commit $(PRE_COMMIT): $(PY) $(PY) -m pip install --user pre-commit $@ --version touch $@ +endif -$(TOWNCRIER): $(PY) - $(PY) -m pip install --user towncrier - $@ --version - touch $@ +PY_TOOLS := $(HATCH) $(PRE_COMMIT) + +# Node JS +NPM ?= $(shell command -v npm) + +ifeq ($(strip $(NPM)),) + +NPM := $(BIN)/npm +NODE := $(BIN)/node +NODE_DIR := $(HOME)/.local/node $(NPM): curl -L --output /tmp/node.tar.xz https://nodejs.org/dist/v$(NODE_VERSION)/node-v$(NODE_VERSION)-linux-x64.tar.xz @@ -101,3 +115,9 @@ $(NPM): $(NODE) --version PATH=$(BIN) $(NPM) --version + +endif + +# One command to bootstrap all tools and check their versions +tools: $(PY_INTERPRETERS) $(PY_TOOLS) $(NPM) + for prog in $^ ; do echo -n "$${prog}\t" ; PATH=$(BIN) $${prog} --version; done From 8cc05775bf10d1cf4b21eef87d6e9fafbfc153e6 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Wed, 1 May 2024 18:21:47 +0000 Subject: [PATCH 13/60] devenv: Automate VSCode devenv creation --- Makefile | 54 +------------------------------------------------ code/Makefile | 44 ++++++++++++++++++++++++++++++++++++++++ code/hatch.toml | 10 +++++++++ code/tox.ini | 23 --------------------- 4 files changed, 55 insertions(+), 76 deletions(-) create mode 100644 code/Makefile create mode 100644 code/hatch.toml delete mode 100644 code/tox.ini diff --git a/Makefile b/Makefile index 7f92c86eb..ae64af694 100644 --- a/Makefile +++ b/Makefile @@ -1,53 +1 @@ -.PHONY: preview-completion-docs completion-docs venv npm - -VENV := .env - -ifeq ($(CI),true) - PYTHON=python -endif - -# Default python env. -ifndef PYTHON - PYTHON=$(VENV)/bin/python -endif - -# ---------------------------------------- Development Environments ------------------------------------------- -$(VENV)/bin/python: - python3 -m venv $(VENV) - $@ -m pip install --upgrade pip - $@ -m pip install -r docs/requirements.txt - $@ -m pip install -e lib/esbonio[dev] - $@ -m pip install -e lib/esbonio-extensions[dev] - -venv: $(VENV)/bin/python - -code/node_modules: code/package.json code/package-lock.json - npm --prefix ./code/ install - -npm: code/node_modules - -# ---------------------------------------- Tests, Lints, Tools etc. ------------------------------------------- -mypy: $(PYTHON) - mypy --namespace-packages --explicit-package-bases -p esbonio - -# ---------------------------------------- CompletionItem Documentation --------------------------------------- -DOCUTILS_COMPLETION_DOCS=lib/esbonio/esbonio/lsp/rst/roles.json lib/esbonio/esbonio/lsp/rst/directives.json -SPHINX_COMPLETION_DOCS=lib/esbonio/esbonio/lsp/sphinx/roles.json lib/esbonio/esbonio/lsp/sphinx/directives.json -COMPLETION_DOCS=$(SPHINX_COMPLETION_DOCS) $(DOCUTILS_COMPLETION_DOCS) - -# '&:' Indicates that the multiple targets listed are 'grouped' and that they are produced together from running -# the command below once. This prevents the command being run once for each file produced. -# https://www.gnu.org/software/make/manual/html_node/Multiple-Targets.html -# -# '$^' Expands into the list of dependencies of the target (python .... in this case) -# https://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html#Automatic-Variables -$(DOCUTILS_COMPLETION_DOCS) &: $(PYTHON) scripts/generate_docutils_documentation.py - $^ -o lib/esbonio/esbonio/lsp/rst/ - -$(SPHINX_COMPLETION_DOCS) &: $(PYTHON) scripts/generate_sphinx_documentation.py - $^ -o lib/esbonio/esbonio/lsp/sphinx/ - -completion-docs: $(COMPLETION_DOCS) - -preview-completion-docs: $(COMPLETION_DOCS) - $(PYTHON) scripts/preview_documentation.py $(COMPLETION_DOCS) +include .devcontainer/tools.mk diff --git a/code/Makefile b/code/Makefile new file mode 100644 index 000000000..ad31dc4fb --- /dev/null +++ b/code/Makefile @@ -0,0 +1,44 @@ +include ../.devcontainer/tools.mk + +ESBONIO ?= --pre esbonio + +.PHONY: dist dev-deps release-deps + +watch: dev-deps $(NPM) + -test -d dist && rm -r dist + $(NPM) run watch + +compile: dev-deps $(NPM) + -test -d dist && rm -r dist + $(NPM) run compile + +dist: release-deps $(NPM) + -test -d dist && rm -r dist + $(NPM) run package + +# Ensures the version of esbonio in ../lib/esbonio is used. +dev-deps: node_modules/.installed bundled/libs/.installed + -test -d bundled/libs/esbonio-*.dist-info && rm -r bundled/libs/esbonio-*.dist-info + -test -L bundled/libs/esbonio || rm -r bundled/libs/esbonio + if [ ! -f bundled/libs/esbonio/__main__.py ]; then \ + test -L bundled/libs/esbonio && rm bundled/libs/esbonio; \ + ln -s $(shell pwd)/../lib/esbonio/esbonio bundled/libs/esbonio; \ + fi + +# Ensures the latest version of esbonio from PyPi is used. +release-deps: node_modules/.installed bundled/libs/.installed + -test -L bundled/libs/esbonio && rm bundled/libs/esbonio + test -d bundled/libs/esbonio-*.dist-info || $(PY38) -m pip install -t ./bundled/libs --no-cache-dir --implementation py --no-deps --upgrade $(ESBONIO) + +requirements.txt: $(HATCH) requirements.in + $(HATCH) run deps:update + +bundled/libs/.installed: $(PY38) requirements.txt + -test -d bundled/libs && rm -r bundled/libs + $(PY38) --version + $(PY38) -m pip install -t ./bundled/libs --no-cache-dir --implementation py --no-deps --upgrade -r ./requirements.txt + touch $@ + +node_modules/.installed: package.json package-lock.json $(NPM) + $(NPM) ci + touch $@ diff --git a/code/hatch.toml b/code/hatch.toml new file mode 100644 index 000000000..df070ec3e --- /dev/null +++ b/code/hatch.toml @@ -0,0 +1,10 @@ +[envs.deps] +python = "3.8" +dependencies = ["pip-tools"] +skip-install = true + +[envs.deps.scripts] +update = [ + "python --version", + "pip-compile --resolver=backtracking --generate-hashes --upgrade requirements.in", +] diff --git a/code/tox.ini b/code/tox.ini deleted file mode 100644 index 0296ac9d1..000000000 --- a/code/tox.ini +++ /dev/null @@ -1,23 +0,0 @@ -[tox] -min_version = 4.0 - -[testenv:bundle-deps] -basepython = python3.8 -description = Install dependencies -skip_install = true -commands = - python --version - python -c "import sys; v = sys.version_info; sys.exit(v.major != 3 or v.minor != 8)" - python -m pip install -t ./bundled/libs --no-cache-dir --implementation py --no-deps --upgrade -r ./requirements.txt - python -m pip install -t ./bundled/libs --no-cache-dir --implementation py --no-deps --upgrade {env:ESBONIO_WHL} - -[testenv:update-deps] -basepython = python3.8 -description = Update bundled dependency versions -skip_install = true -deps = - pip-tools -commands = - python --version - python -c "import sys; v = sys.version_info; sys.exit(v.major != 3 or v.minor != 8)" - pip-compile --resolver=backtracking --generate-hashes --upgrade ./requirements.in From 35c0eea27631ce2b6e4a2b901eb10feaeee78493 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Wed, 1 May 2024 18:22:14 +0000 Subject: [PATCH 14/60] code: Bump requirements --- code/requirements.txt | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/code/requirements.txt b/code/requirements.txt index 58212da99..605a5505f 100644 --- a/code/requirements.txt +++ b/code/requirements.txt @@ -2,21 +2,21 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --generate-hashes ./requirements.in +# pip-compile --generate-hashes requirements.in # aiosqlite==0.20.0 \ --hash=sha256:36a1deaca0cac40ebe32aac9977a6e2bbc7f5189f23f4a54d5908986729e5bd6 \ --hash=sha256:6d35c8c256637f4672f843c31021464090805bf925385ac39473fb16eaaca3d7 # via -r requirements.in -attrs==23.1.0 \ - --hash=sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04 \ - --hash=sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015 +attrs==23.2.0 \ + --hash=sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30 \ + --hash=sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1 # via # cattrs # lsprotocol -cattrs==23.2.2 \ - --hash=sha256:66064e2060ea207c5a48d065ab1910c10bb8108c28f3df8d1a7b1aa6b19d191b \ - --hash=sha256:b790b1c2be1ce042611e33f740e343c2593918bbf3c1cc88cdddac4defc09655 +cattrs==23.2.3 \ + --hash=sha256:0341994d94971052e9ee70662542699a3162ea1e0c62f7ce1b4a57f563685108 \ + --hash=sha256:a934090d95abaa9e911dac357e3a8699e0b4b14f8529bcc7d2b1ad9d51672b9f # via # lsprotocol # pygls @@ -24,9 +24,9 @@ docutils==0.20.1 \ --hash=sha256:96f387a2c5562db4476f09f13bbab2192e764cac08ebbf3a34a95d9b1e4a59d6 \ --hash=sha256:f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b # via -r requirements.in -exceptiongroup==1.2.0 \ - --hash=sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14 \ - --hash=sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68 +exceptiongroup==1.2.1 \ + --hash=sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad \ + --hash=sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16 # via cattrs lsprotocol==2023.0.1 \ --hash=sha256:c75223c9e4af2f24272b14c6375787438279369236cd568f596d4951052a60f2 \ @@ -44,9 +44,9 @@ tomli==2.0.1 \ --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f # via -r requirements.in -typing-extensions==4.8.0 \ - --hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \ - --hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef +typing-extensions==4.11.0 \ + --hash=sha256:83f085bd5ca59c80295fc2a82ab5dac679cbe02b9f33f7d83af68e241bea51b0 \ + --hash=sha256:c1f94d72897edaf4ce775bb7558d5b79d8126906a14ea5ed1635921406c0387a # via # aiosqlite # cattrs From 7cd2b9d0621e1b6086f4f4520e40b5f687a40062 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Wed, 1 May 2024 18:22:57 +0000 Subject: [PATCH 15/60] lsp: Start using hatch environments --- lib/esbonio/Makefile | 11 ++++------- lib/esbonio/hatch.toml | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/lib/esbonio/Makefile b/lib/esbonio/Makefile index 03bcea6f2..66cdc77a3 100644 --- a/lib/esbonio/Makefile +++ b/lib/esbonio/Makefile @@ -1,9 +1,6 @@ -PY ?= 310 +include ../../.devcontainer/tools.mk -.PHONY: develop test +.PHONY: dist -develop: - nix develop .#py$(PY) - -test: - nix develop .#py$(PY) --command pytest +dist: $(HATCH) + $(HATCH) build diff --git a/lib/esbonio/hatch.toml b/lib/esbonio/hatch.toml index 079b35675..1b99f1bbf 100644 --- a/lib/esbonio/hatch.toml +++ b/lib/esbonio/hatch.toml @@ -7,3 +7,28 @@ include = ["esbonio", "tests", "CHANGES.rst"] [build.targets.wheel] packages = ["esbonio"] + +[envs.unit] +dependencies = ["pytest", "pytest-cov", "pytest-lsp>=0.3.1,<1"] + +[[envs.unit.matrix]] +python = ["3.8", "3.9", "3.10", "3.11", "3.12"] + +[envs.unit.scripts] +test = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=esbonio.server tests/server" + +[envs.e2e] +template = "unit" +extra-dependencies = [ + "furo", + "sphinx-design", + "myst-parser", + "sphinx~={matrix:sphinx}.0", +] + +[[envs.e2e.matrix]] +python = ["3.8", "3.9", "3.10", "3.11", "3.12"] +sphinx = ["5", "6", "7"] + +[envs.e2e.scripts] +test = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=esbonio tests/sphinx-agent tests/e2e" From 4a8786fab3721f9349e8f46dd00caa26af978f70 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Wed, 1 May 2024 20:31:53 +0100 Subject: [PATCH 16/60] devenv: Default to using the image from ghcr.io --- .devcontainer/devcontainer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f375b9028..aac2d51f9 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,10 +3,10 @@ { "name": "Ubuntu", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - // "image": "mcr.microsoft.com/devcontainers/base:jammy" - "build": { - "dockerfile": "Dockerfile" - }, + "image": "ghcr.io/swyddfa/esbonio-devenv:latest", + // "build": { + // "dockerfile": "Dockerfile" + // }, // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, // Use 'forwardPorts' to make a list of ports inside the container available locally. From 27cd03bdad31cb360a1b4fc795af0212f4dcd738 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Thu, 2 May 2024 16:48:28 +0000 Subject: [PATCH 17/60] devenv: Add make release target --- code/Makefile | 6 +++++- lib/esbonio/Makefile | 3 +++ scripts/make_release.py | 11 +++++++---- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/code/Makefile b/code/Makefile index ad31dc4fb..227255abb 100644 --- a/code/Makefile +++ b/code/Makefile @@ -2,7 +2,7 @@ include ../.devcontainer/tools.mk ESBONIO ?= --pre esbonio -.PHONY: dist dev-deps release-deps +.PHONY: dist dev-deps release-deps release watch: dev-deps $(NPM) -test -d dist && rm -r dist @@ -16,6 +16,10 @@ dist: release-deps $(NPM) -test -d dist && rm -r dist $(NPM) run package +release: $(TOWNCRIER) $(HATCH) $(PY) + $(PY) ../scripts/make_release.py lsp + $(PY) ../scripts/make_release.py vscode + # Ensures the version of esbonio in ../lib/esbonio is used. dev-deps: node_modules/.installed bundled/libs/.installed -test -d bundled/libs/esbonio-*.dist-info && rm -r bundled/libs/esbonio-*.dist-info diff --git a/lib/esbonio/Makefile b/lib/esbonio/Makefile index 66cdc77a3..358390165 100644 --- a/lib/esbonio/Makefile +++ b/lib/esbonio/Makefile @@ -4,3 +4,6 @@ include ../../.devcontainer/tools.mk dist: $(HATCH) $(HATCH) build + +release: $(TOWNCRIER) $(HATCH) $(PY) + $(PY) ../scripts/make_release.py lsp diff --git a/scripts/make_release.py b/scripts/make_release.py index ff7e201a8..c036b6813 100755 --- a/scripts/make_release.py +++ b/scripts/make_release.py @@ -6,6 +6,7 @@ - Commit, tag and push the new version (if it's a release) - Export the tag name and release date for use later on in the pipeline. """ + import argparse import io import json @@ -27,6 +28,8 @@ ENV = os.environ.get("GITHUB_ENV", "") STEP_SUMMARY = os.environ.get("GITHUB_STEP_SUMMARY", "") +REPO = pathlib.Path(__file__).parent.parent.resolve() + class Output: """An output destination that can be logged to. @@ -78,7 +81,7 @@ class Component(TypedDict): """The prefix to give to version bump commit messages for this component.""" src: str - """The directory containing the component, relative to repo root.""" + """The directory containing the component.""" tag_prefix: str """The prefix to give to tagged versions of this component.""" @@ -93,7 +96,7 @@ class Component(TypedDict): bump_minor="minor", bump_patch="patch", commit_prefix="Esbonio Extensions Release v", - src="lib/esbonio-extensions", + src=str(REPO / "lib/esbonio-extensions"), tag_prefix="esbonio-extensions-v", ), Component( @@ -103,7 +106,7 @@ class Component(TypedDict): bump_minor="b", bump_patch="b", commit_prefix="Esbonio Language Server Release v", - src="lib/esbonio", + src=str(REPO / "lib/esbonio"), tag_prefix="esbonio-language-server-v", ), Component( @@ -113,7 +116,7 @@ class Component(TypedDict): bump_minor="minor", bump_patch="patch", commit_prefix="Esbonio VSCode Extension Release v", - src="code", + src=str(REPO / "code"), tag_prefix="esbonio-vscode-extension-v", ), ] From 7e4d9e761e4d09d26ac8d10300b2424f208d32a4 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Thu, 2 May 2024 19:23:19 +0100 Subject: [PATCH 18/60] workflow: Use makefile where possible --- .github/workflows/vscode-pr.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vscode-pr.yml b/.github/workflows/vscode-pr.yml index 1b3844683..bb51ddbb4 100644 --- a/.github/workflows/vscode-pr.yml +++ b/.github/workflows/vscode-pr.yml @@ -35,7 +35,7 @@ jobs: - run: | python --version python -m pip install --upgrade pip - python -m pip install --upgrade hatch tox towncrier 'importlib-resources<6' + python -m pip install --upgrade hatch towncrier name: Install Build Tools - run: | @@ -57,10 +57,7 @@ jobs: # Use in-repo version of esbonio for dev builds echo "whl=${ESBONIO_WHL}" - ESBONIO_WHL=${ESBONIO_WHL} tox run -e bundle-deps - - npm ci --prefer-offline - npm run package + ESBONIO=${ESBONIO_WHL} make dist id: assets name: Package Extension From 768104d49cd854939175902b15386d052dcd3af9 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Fri, 3 May 2024 23:36:37 +0100 Subject: [PATCH 19/60] vscode: Update launch and task definitions --- .vscode/launch.json | 5 +---- .vscode/tasks.json | 19 ++++++++----------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 42e8d7c8f..3bd2b184d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -36,10 +36,7 @@ "outFiles": [ "${workspaceRoot}/code/dist/node/**/*.js" ], - // "preLaunchTask": "${defaultBuildTask}", - "env": { - // "VSCODE_LSP_DEBUG": "true" - } + "preLaunchTask": "${defaultBuildTask}", }, { "name": "VSCode Web Extension", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 25fc86497..d0181bd9d 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -2,9 +2,13 @@ "version": "2.0.0", "tasks": [ { - "type": "npm", - "script": "watch", + "label": "npm: watch", + "type": "process", "isBackground": true, + "command": "make", + "args": [ + "watch" + ], "options": { "cwd": "${workspaceRoot}/code" }, @@ -14,17 +18,10 @@ }, "presentation": { "panel": "dedicated", - "reveal": "never" + "reveal": "always" }, "problemMatcher": [ - { - "base": "$tsc-watch", - "background": { - "activeOnStart": true, - "beginsPattern": "asset .*", - "endsPattern": "webpack .* compiled .*" - } - } + "$tsc-watch" ] }, { From 1a01b7f3902214c5662e094d4b32ddf7e1f718a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 14:25:31 +0000 Subject: [PATCH 20/60] build(deps-dev): bump @vscode/vsce from 2.26.0 to 2.26.1 in /code Bumps [@vscode/vsce](https://github.com/Microsoft/vsce) from 2.26.0 to 2.26.1. - [Release notes](https://github.com/Microsoft/vsce/releases) - [Commits](https://github.com/Microsoft/vsce/compare/v2.26.0...v2.26.1) --- updated-dependencies: - dependency-name: "@vscode/vsce" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- code/package-lock.json | 18 +++++++++--------- code/package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/package-lock.json b/code/package-lock.json index 83dffd4df..ee6682c0a 100644 --- a/code/package-lock.json +++ b/code/package-lock.json @@ -1,12 +1,12 @@ { "name": "esbonio", - "version": "0.93.1", + "version": "0.94.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "esbonio", - "version": "0.93.1", + "version": "0.94.0", "license": "MIT", "dependencies": { "@vscode/python-extension": "^1.0.5", @@ -17,7 +17,7 @@ "@types/glob": "^8.1.0", "@types/node": "^18", "@types/vscode": "1.78.0", - "@vscode/vsce": "^2.26.0", + "@vscode/vsce": "^2.26.1", "esbuild": "^0.20.2", "ovsx": "^0.9.1", "typescript": "^5.4.5" @@ -640,9 +640,9 @@ } }, "node_modules/@vscode/vsce": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.26.0.tgz", - "integrity": "sha512-v54ltgMzUG8lGY0kAgaOlry57xse1RlWzes9FotfGEx+Fr05KeR8rZicQzEMDmi9QnOgVWHuiEq+xA2HWkAz+Q==", + "version": "2.26.1", + "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.26.1.tgz", + "integrity": "sha512-QOG6Ht7V93nhwcBxPWcG33UK0qDGEoJdg0xtVeaTN27W6PGdMJUJGTPhB/sNHUIFKwvwzv/zMAHvDgMNXbcwlA==", "dev": true, "dependencies": { "@azure/identity": "^4.1.0", @@ -3135,9 +3135,9 @@ "integrity": "sha512-uYhXUrL/gn92mfqhjAwH2+yGOpjloBxj9ekoL4BhUsKcyJMpEg6WlNf3S3si+5x9zlbHHe7FYQNjZEbz1ymI9Q==" }, "@vscode/vsce": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.26.0.tgz", - "integrity": "sha512-v54ltgMzUG8lGY0kAgaOlry57xse1RlWzes9FotfGEx+Fr05KeR8rZicQzEMDmi9QnOgVWHuiEq+xA2HWkAz+Q==", + "version": "2.26.1", + "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.26.1.tgz", + "integrity": "sha512-QOG6Ht7V93nhwcBxPWcG33UK0qDGEoJdg0xtVeaTN27W6PGdMJUJGTPhB/sNHUIFKwvwzv/zMAHvDgMNXbcwlA==", "dev": true, "requires": { "@azure/identity": "^4.1.0", diff --git a/code/package.json b/code/package.json index 9d738186d..fdb7c708a 100644 --- a/code/package.json +++ b/code/package.json @@ -38,7 +38,7 @@ "@types/glob": "^8.1.0", "@types/node": "^18", "@types/vscode": "1.78.0", - "@vscode/vsce": "^2.26.0", + "@vscode/vsce": "^2.26.1", "esbuild": "^0.20.2", "ovsx": "^0.9.1", "typescript": "^5.4.5" From 7d62e953b7ff2a96ba2a4f3a0e6e0911b1d6bfa4 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Thu, 9 May 2024 18:49:24 +0100 Subject: [PATCH 21/60] devenv: Add support for installating hatch on multiple architectures --- .devcontainer/tools.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.devcontainer/tools.mk b/.devcontainer/tools.mk index 518123ccf..d46958789 100644 --- a/.devcontainer/tools.mk +++ b/.devcontainer/tools.mk @@ -1,5 +1,10 @@ +ARCH ?= $(shell arch) BIN ?= $(HOME)/.local/bin +ifeq ($(strip $(ARCH)),) +$(error Unable to determine platform architecture) +endif + HATCH_VERSION = 1.10.0 NODE_VERSION := 18.20.2 @@ -12,12 +17,12 @@ PY_INTERPRETERS = HATCH ?= $(or $(shell command -v hatch), $(BIN)/hatch) $(HATCH): - curl -L --output /tmp/hatch.tar.gz https://github.com/pypa/hatch/releases/download/hatch-v$(HATCH_VERSION)/hatch-$(HATCH_VERSION)-x86_64-unknown-linux-gnu.tar.gz + curl -L --output /tmp/hatch.tar.gz https://github.com/pypa/hatch/releases/download/hatch-v$(HATCH_VERSION)/hatch-$(HATCH_VERSION)-$(ARCH)-unknown-linux-gnu.tar.gz tar -xf /tmp/hatch.tar.gz -C /tmp rm /tmp/hatch.tar.gz test -d $(BIN) || mkdir -p $(BIN) - mv /tmp/hatch-$(HATCH_VERSION)-x86_64-unknown-linux-gnu $(HATCH) + mv /tmp/hatch-$(HATCH_VERSION)-$(ARCH)-unknown-linux-gnu $(HATCH) $@ --version touch $@ From db47cff273e709c51a5b5330c9ed16e732038ab8 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Thu, 9 May 2024 18:50:36 +0100 Subject: [PATCH 22/60] devenv: Use `python3` not `python` `python3` is probably the more portable option - and should guard against selecting python 2.x if that's still hanging around. --- .devcontainer/tools.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/tools.mk b/.devcontainer/tools.mk index d46958789..452ffbfca 100644 --- a/.devcontainer/tools.mk +++ b/.devcontainer/tools.mk @@ -70,7 +70,7 @@ endef $(foreach version,$(PYXX_versions),$(eval $(call PYXX,$(version)))) # Set a default `python` command if there is not one already -PY ?= $(shell command -v python) +PY ?= $(shell command -v python3) ifeq ($(strip $(PY)),) PY := $(BIN)/python From 08164a0ea493b37b67dc91a79417d358addbb5ab Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Thu, 9 May 2024 18:53:20 +0100 Subject: [PATCH 23/60] lsp: Use hatch's new test command --- .github/workflows/lsp-pr.yml | 7 ++--- lib/esbonio/.gitignore | 1 + lib/esbonio/Makefile | 12 ++++++-- lib/esbonio/hatch.toml | 30 +++++++++--------- lib/esbonio/tox.ini | 60 ------------------------------------ 5 files changed, 28 insertions(+), 82 deletions(-) delete mode 100644 lib/esbonio/tox.ini diff --git a/.github/workflows/lsp-pr.yml b/.github/workflows/lsp-pr.yml index 785c8cd50..cd5246a28 100644 --- a/.github/workflows/lsp-pr.yml +++ b/.github/workflows/lsp-pr.yml @@ -64,14 +64,11 @@ jobs: - run: | python --version - python -m pip install --upgrade pip - python -m pip install --upgrade tox + python -m pip install --upgrade hatch name: Setup Environment - run: | cd lib/esbonio - version=$(echo ${{ matrix.python-version }} | tr -d .) - python -m tox run -e `tox -l | grep $version | tr '\n' ','` - shell: bash + hatch test -i py=${{ matrix.python-version }} name: Run Tests diff --git a/lib/esbonio/.gitignore b/lib/esbonio/.gitignore index b2be92b7d..3b0d2daec 100644 --- a/lib/esbonio/.gitignore +++ b/lib/esbonio/.gitignore @@ -1 +1,2 @@ +.coverage* result diff --git a/lib/esbonio/Makefile b/lib/esbonio/Makefile index 358390165..5573879f5 100644 --- a/lib/esbonio/Makefile +++ b/lib/esbonio/Makefile @@ -1,9 +1,17 @@ include ../../.devcontainer/tools.mk -.PHONY: dist + +# Global flags to pass to hatch, e.g. -v, --no-color etc. +HATCH_ARGS = + +.PHONY: dist release test dist: $(HATCH) - $(HATCH) build + $(HATCH) $(HATCH_ARGS) build + +test: ARGS ?= -i py=$(shell $(PY) -c 'import sys;v=sys.version_info;print(f"{v.major}.{v.minor}")') +test: $(HATCH) $(PY) + $(HATCH) $(HATCH_ARGS) test $(ARGS) release: $(TOWNCRIER) $(HATCH) $(PY) $(PY) ../scripts/make_release.py lsp diff --git a/lib/esbonio/hatch.toml b/lib/esbonio/hatch.toml index 1b99f1bbf..f7c151e6b 100644 --- a/lib/esbonio/hatch.toml +++ b/lib/esbonio/hatch.toml @@ -8,27 +8,27 @@ include = ["esbonio", "tests", "CHANGES.rst"] [build.targets.wheel] packages = ["esbonio"] -[envs.unit] -dependencies = ["pytest", "pytest-cov", "pytest-lsp>=0.3.1,<1"] +[envs.hatch-test] +default-args = ["tests/server"] +extra-dependencies = ["pytest-lsp>=0.3.1,<1"] +matrix-name-format = "{variable}{value}" -[[envs.unit.matrix]] +[[envs.hatch-test.matrix]] python = ["3.8", "3.9", "3.10", "3.11", "3.12"] -[envs.unit.scripts] -test = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=esbonio.server tests/server" +[[envs.hatch-test.matrix]] +python = ["3.8", "3.9", "3.10", "3.11", "3.12"] +sphinx = ["5", "6", "7"] -[envs.e2e] -template = "unit" -extra-dependencies = [ +[envs.hatch-test.overrides] +matrix.sphinx.dependencies = [ "furo", "sphinx-design", "myst-parser", - "sphinx~={matrix:sphinx}.0", + { value = "sphinx>=5,<6", if = ["5"] }, + { value = "sphinx>=6,<7", if = ["6"] }, + { value = "sphinx>=7,<8", if = ["7"] }, ] -[[envs.e2e.matrix]] -python = ["3.8", "3.9", "3.10", "3.11", "3.12"] -sphinx = ["5", "6", "7"] - -[envs.e2e.scripts] -test = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=esbonio tests/sphinx-agent tests/e2e" +[envs.hatch-test.overrides.matrix.sphinx.default-args] +value = ["tests/sphinx-agent", "tests/e2e"] diff --git a/lib/esbonio/tox.ini b/lib/esbonio/tox.ini deleted file mode 100644 index 361150496..000000000 --- a/lib/esbonio/tox.ini +++ /dev/null @@ -1,60 +0,0 @@ -[tox] -isolated_build = True -skip_missing_interpreters = true -min_version = 4.0 -envlist = py{38,39,310,311,312}, py{38,39,310,311,312}-sphinx{5,6,7} - -[testenv:py{38,39,310,311,312}] -description = "Run the test suite for the server component of esbonio" -package = wheel -wheel_build_env = .pkg -deps = - - py38: importlib-resources>6,<6.2 - - coverage[toml] - pytest - pytest-lsp>=0.3.1 -set_env = COVERAGE_PROCESS_START={toxinidir}/pyproject.toml -commands_pre = - python -c 'import pathlib; pathlib.Path("{env_site_packages_dir}/cov.pth").write_text("import coverage; coverage.process_startup()")' - coverage erase -commands = - coverage run -m pytest tests/server {posargs} -commands_post = - coverage combine - coverage report - -[testenv:py{38,39,310,311,312}-sphinx{5,6,7}] -description = "Run the test suite for the sphinx agent component of esbonio" -deps = - sphinx5: sphinx>=5,<6 - sphinx6: sphinx>=6,<7 - sphinx7: sphinx>=7,<8 - - # Needed to build the demo site. - furo - sphinx-design - myst-parser - - coverage[toml] - pytest - pytest-lsp>=0.3.1 - pytest-asyncio>=0.23.3 -set_env = COVERAGE_PROCESS_START={toxinidir}/pyproject.toml -commands_pre = - python -c 'import pathlib; pathlib.Path("{env_site_packages_dir}/cov.pth").write_text("import coverage; coverage.process_startup()")' - coverage erase -commands = - python ../../scripts/check-sphinx-version.py - pytest {posargs:tests/sphinx-agent tests/e2e} -commands_post = - coverage combine - coverage report - -[testenv:pkg] -description = "Package esbonio for distribution" -deps = - build -skip_install = True -commands = python -m build From baf15ce4b7ca154798ba4f3f37adc404b7e08b9d Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Thu, 9 May 2024 18:55:05 +0100 Subject: [PATCH 24/60] lsp: Split directive support into multiple features Rather than try and have a single `Directives` language feature that does all the work of discovering directives, suggesting completions AND making it all work for both rst and myst, this commit breaks the work up between multiple `LanguageFeatures`. There is a backend `Directives` feature, that will provide an API that the various frontend features can use. Then there is the `RstDirectives` and `MystDirectives` features that build on the backend to surface the relevant features for their respective syntax. At the moment they are nearly identical however, they are now free to diverge to better support their associated syntax. --- lib/esbonio/esbonio/server/cli.py | 2 + .../server/features/directives/__init__.py | 78 +-------------- .../esbonio/server/features/myst/__init__.py | 0 .../server/features/myst/directives.py | 95 +++++++++++++++++++ .../esbonio/server/features/rst/__init__.py | 0 .../esbonio/server/features/rst/directives.py | 95 +++++++++++++++++++ 6 files changed, 197 insertions(+), 73 deletions(-) create mode 100644 lib/esbonio/esbonio/server/features/myst/__init__.py create mode 100644 lib/esbonio/esbonio/server/features/myst/directives.py create mode 100644 lib/esbonio/esbonio/server/features/rst/__init__.py create mode 100644 lib/esbonio/esbonio/server/features/rst/directives.py diff --git a/lib/esbonio/esbonio/server/cli.py b/lib/esbonio/esbonio/server/cli.py index 2de49a408..6b443e785 100644 --- a/lib/esbonio/esbonio/server/cli.py +++ b/lib/esbonio/esbonio/server/cli.py @@ -70,6 +70,8 @@ def main(argv: Optional[Sequence[str]] = None): "esbonio.server.features.preview_manager", "esbonio.server.features.directives", "esbonio.server.features.roles", + "esbonio.server.features.rst.directives", + "esbonio.server.features.myst.directives", "esbonio.server.features.sphinx_support.diagnostics", "esbonio.server.features.sphinx_support.symbols", "esbonio.server.features.sphinx_support.directives", diff --git a/lib/esbonio/esbonio/server/features/directives/__init__.py b/lib/esbonio/esbonio/server/features/directives/__init__.py index fdbc4d461..5d03bc22e 100644 --- a/lib/esbonio/esbonio/server/features/directives/__init__.py +++ b/lib/esbonio/esbonio/server/features/directives/__init__.py @@ -4,13 +4,8 @@ import typing import attrs -from lsprotocol import types from esbonio import server -from esbonio.sphinx_agent.types import MYST_DIRECTIVE -from esbonio.sphinx_agent.types import RST_DIRECTIVE - -from . import completion if typing.TYPE_CHECKING: from typing import Any @@ -45,13 +40,16 @@ def suggest_directives( class DirectiveFeature(server.LanguageFeature): - """Support for directives.""" + """'Backend' support for directives. + + It's this language feature's responsibility to provide an API that exposes the + information a "frontend" language feature may want. + """ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._providers: Dict[int, DirectiveProvider] = {} - self._insert_behavior = "replace" def add_provider(self, provider: DirectiveProvider): """Register a directive provider. @@ -63,72 +61,6 @@ def add_provider(self, provider: DirectiveProvider): """ self._providers[id(provider)] = provider - completion_triggers = [RST_DIRECTIVE, MYST_DIRECTIVE] - - def initialized(self, params: types.InitializedParams): - """Called once the initial handshake between client and server has finished.""" - self.configuration.subscribe( - "esbonio.server.completion", - server.CompletionConfig, - self.update_configuration, - ) - - def update_configuration( - self, event: server.ConfigChangeEvent[server.CompletionConfig] - ): - """Called when the user's configuration is updated.""" - self._insert_behavior = event.value.preferred_insert_behavior - - async def completion( - self, context: server.CompletionContext - ) -> Optional[List[types.CompletionItem]]: - """Provide completion suggestions for directives.""" - - groups = context.match.groupdict() - - # Are we completing a directive's options? - if "directive" not in groups: - return await self.complete_options(context) - - # Don't offer completions for targets - if (groups["name"] or "").startswith("_"): - return None - - # Are we completing the directive's argument? - directive_end = context.match.span()[0] + len(groups["directive"]) - complete_directive = groups["directive"].endswith(("::", "}")) - - if complete_directive and directive_end < context.position.character: - return await self.complete_arguments(context) - - return await self.complete_directives(context) - - async def complete_options(self, context: server.CompletionContext): - return None - - async def complete_arguments(self, context: server.CompletionContext): - return None - - async def complete_directives( - self, context: server.CompletionContext - ) -> Optional[List[types.CompletionItem]]: - """Return completion suggestions for the available directives.""" - - language = self.server.get_language_at(context.doc, context.position) - render_func = completion.get_directive_renderer(language, self._insert_behavior) - if render_func is None: - return None - - items = [] - for directive in await self.suggest_directives(context): - if (item := render_func(context, directive)) is not None: - items.append(item) - - if len(items) > 0: - return items - - return None - async def suggest_directives( self, context: server.CompletionContext ) -> List[Directive]: diff --git a/lib/esbonio/esbonio/server/features/myst/__init__.py b/lib/esbonio/esbonio/server/features/myst/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/lib/esbonio/esbonio/server/features/myst/directives.py b/lib/esbonio/esbonio/server/features/myst/directives.py new file mode 100644 index 000000000..0caac1b03 --- /dev/null +++ b/lib/esbonio/esbonio/server/features/myst/directives.py @@ -0,0 +1,95 @@ +from __future__ import annotations + +import typing + +from lsprotocol import types + +from esbonio import server +from esbonio.server.features.directives import DirectiveFeature +from esbonio.server.features.directives import completion +from esbonio.sphinx_agent.types import MYST_DIRECTIVE + +if typing.TYPE_CHECKING: + from typing import List + from typing import Optional + + +class MystDirectives(server.LanguageFeature): + """A frontend to directives for MyST syntax.""" + + def __init__(self, directives: DirectiveFeature, *args, **kwargs): + super().__init__(*args, **kwargs) + + self.directives = directives + self._insert_behavior = "replace" + + completion_triggers = [MYST_DIRECTIVE] + + def initialized(self, params: types.InitializedParams): + """Called once the initial handshake between client and server has finished.""" + self.configuration.subscribe( + "esbonio.server.completion", + server.CompletionConfig, + self.update_configuration, + ) + + def update_configuration( + self, event: server.ConfigChangeEvent[server.CompletionConfig] + ): + """Called when the user's configuration is updated.""" + self._insert_behavior = event.value.preferred_insert_behavior + + async def completion( + self, context: server.CompletionContext + ) -> Optional[List[types.CompletionItem]]: + """Provide completion suggestions for directives.""" + + groups = context.match.groupdict() + + # Are we completing a directive's options? + if "directive" not in groups: + return await self.complete_options(context) + + # Don't offer completions for targets + if (groups["name"] or "").startswith("_"): + return None + + # Are we completing the directive's argument? + directive_end = context.match.span()[0] + len(groups["directive"]) + complete_directive = groups["directive"].endswith("}") + + if complete_directive and directive_end < context.position.character: + return await self.complete_arguments(context) + + return await self.complete_directives(context) + + async def complete_options(self, context: server.CompletionContext): + return None + + async def complete_arguments(self, context: server.CompletionContext): + return None + + async def complete_directives( + self, context: server.CompletionContext + ) -> Optional[List[types.CompletionItem]]: + """Return completion suggestions for the available directives.""" + + language = self.server.get_language_at(context.doc, context.position) + render_func = completion.get_directive_renderer(language, self._insert_behavior) + if render_func is None: + return None + + items = [] + for directive in await self.directives.suggest_directives(context): + if (item := render_func(context, directive)) is not None: + items.append(item) + + if len(items) > 0: + return items + + return None + + +def esbonio_setup(esbonio: server.EsbonioLanguageServer, directives: DirectiveFeature): + myst_directives = MystDirectives(directives, esbonio) + esbonio.add_feature(myst_directives) diff --git a/lib/esbonio/esbonio/server/features/rst/__init__.py b/lib/esbonio/esbonio/server/features/rst/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/lib/esbonio/esbonio/server/features/rst/directives.py b/lib/esbonio/esbonio/server/features/rst/directives.py new file mode 100644 index 000000000..5d0cb74af --- /dev/null +++ b/lib/esbonio/esbonio/server/features/rst/directives.py @@ -0,0 +1,95 @@ +from __future__ import annotations + +import typing + +from lsprotocol import types + +from esbonio import server +from esbonio.server.features.directives import DirectiveFeature +from esbonio.server.features.directives import completion +from esbonio.sphinx_agent.types import RST_DIRECTIVE + +if typing.TYPE_CHECKING: + from typing import List + from typing import Optional + + +class RstDirectives(server.LanguageFeature): + """A frontend to directives for reStructuredText syntax.""" + + def __init__(self, directives: DirectiveFeature, *args, **kwargs): + super().__init__(*args, **kwargs) + + self.directives = directives + self._insert_behavior = "replace" + + completion_triggers = [RST_DIRECTIVE] + + def initialized(self, params: types.InitializedParams): + """Called once the initial handshake between client and server has finished.""" + self.configuration.subscribe( + "esbonio.server.completion", + server.CompletionConfig, + self.update_configuration, + ) + + def update_configuration( + self, event: server.ConfigChangeEvent[server.CompletionConfig] + ): + """Called when the user's configuration is updated.""" + self._insert_behavior = event.value.preferred_insert_behavior + + async def completion( + self, context: server.CompletionContext + ) -> Optional[List[types.CompletionItem]]: + """Provide completion suggestions for directives.""" + + groups = context.match.groupdict() + + # Are we completing a directive's options? + if "directive" not in groups: + return await self.complete_options(context) + + # Don't offer completions for targets + if (groups["name"] or "").startswith("_"): + return None + + # Are we completing the directive's argument? + directive_end = context.match.span()[0] + len(groups["directive"]) + complete_directive = groups["directive"].endswith("::") + + if complete_directive and directive_end < context.position.character: + return await self.complete_arguments(context) + + return await self.complete_directives(context) + + async def complete_options(self, context: server.CompletionContext): + return None + + async def complete_arguments(self, context: server.CompletionContext): + return None + + async def complete_directives( + self, context: server.CompletionContext + ) -> Optional[List[types.CompletionItem]]: + """Return completion suggestions for the available directives.""" + + language = self.server.get_language_at(context.doc, context.position) + render_func = completion.get_directive_renderer(language, self._insert_behavior) + if render_func is None: + return None + + items = [] + for directive in await self.directives.suggest_directives(context): + if (item := render_func(context, directive)) is not None: + items.append(item) + + if len(items) > 0: + return items + + return None + + +def esbonio_setup(esbonio: server.EsbonioLanguageServer, directives: DirectiveFeature): + rst_directives = RstDirectives(directives, esbonio) + esbonio.add_feature(rst_directives) From 90689ea39336334616b98e861f29a6b3e2a10caf Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Thu, 9 May 2024 19:50:06 +0100 Subject: [PATCH 25/60] devenv: Use pipx to install pre-commit Hopefully, this can sidestep any issues with not having pip available in the user's default Python installation --- .devcontainer/tools.mk | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.devcontainer/tools.mk b/.devcontainer/tools.mk index 452ffbfca..4b0c4cc0a 100644 --- a/.devcontainer/tools.mk +++ b/.devcontainer/tools.mk @@ -84,18 +84,33 @@ endif PY_INTERPRETERS += $(PY) #$(info $(PY_INTERPRETERS)) +PIPX ?= $(shell command -v pipx) + +ifeq ($(strip $(PIPX)),) +PIPX := $(BIN)/pipx +PIPX_VERSION := 1.5.0 + +$(PIPX): + curl -L -o $(BIN)/pipx.pyz https://github.com/pypa/pipx/releases/download/$(PIPX_VERSION)/pipx.pyz + echo '#!/bin/bash\nexec $(PY) $(BIN)/pipx.pyz "$$@"' > $(PIPX) + + chmod +x $(PIPX) + $@ --version + touch $@ +endif + PRE_COMMIT ?= $(shell command -v pre-commit) ifeq ($(strip $(PRE_COMMIT)),) PRE_COMMIT := $(BIN)/pre-commit -$(PRE_COMMIT): $(PY) - $(PY) -m pip install --user pre-commit +$(PRE_COMMIT): $(PIPX) + $(PIPX) install pre-commit $@ --version touch $@ endif -PY_TOOLS := $(HATCH) $(PRE_COMMIT) +PY_TOOLS := $(HATCH) $(PIPX) $(PRE_COMMIT) # Node JS NPM ?= $(shell command -v npm) From f595fd35ec8b2d99d2ab189b5ae85452192a83ec Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Thu, 9 May 2024 20:20:39 +0100 Subject: [PATCH 26/60] devenv: Install python3-venv --- .devcontainer/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 6752bc3e0..901cad098 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -2,6 +2,8 @@ FROM mcr.microsoft.com/devcontainers/base:jammy COPY tools.mk / -RUN ls /home -l && \ - su vscode -c "make -f tools.mk tools" \ +RUN apt-get update \ + && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -y install --no-install-recommends python3-venv \ + && su vscode -c "make -f tools.mk tools" \ && rm tools.mk From 2acd8081a3ca0582f4dde563abd7328fa225ef7f Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Fri, 10 May 2024 22:19:23 +0100 Subject: [PATCH 27/60] lsp: Switch to using hatch fmt (i.e. ruff) Leaning further into the hatch workflow, this swaps out the combination of `black`, `isort` and `flake8` with `ruff` which can do all three with only minor differences in formatting --- .pre-commit-config.yaml | 21 +- lib/esbonio/hatch.toml | 4 + lib/esbonio/pyproject.toml | 5 - lib/esbonio/ruff.toml | 78 +++++ lib/esbonio/ruff_defaults.toml | 557 +++++++++++++++++++++++++++++++++ lib/esbonio/setup.cfg | 3 - 6 files changed, 644 insertions(+), 24 deletions(-) create mode 100644 lib/esbonio/ruff.toml create mode 100644 lib/esbonio/ruff_defaults.toml delete mode 100644 lib/esbonio/setup.cfg diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 05600638d..13ab20d71 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,24 +8,13 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace -- repo: https://github.com/psf/black - rev: 24.4.2 +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.4.4 hooks: - - id: black + - id: ruff + args: [--fix] -- repo: https://github.com/PyCQA/flake8 - rev: 7.0.0 - hooks: - - id: flake8 - exclude: 'scripts/sphinx-app.py' - args: [--config=lib/esbonio/setup.cfg] - -- repo: https://github.com/pycqa/isort - rev: 5.13.2 - hooks: - - id: isort - name: isort (python) - args: [--settings-file=lib/esbonio/pyproject.toml] + - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy rev: 'v1.10.0' diff --git a/lib/esbonio/hatch.toml b/lib/esbonio/hatch.toml index f7c151e6b..6af300a74 100644 --- a/lib/esbonio/hatch.toml +++ b/lib/esbonio/hatch.toml @@ -32,3 +32,7 @@ matrix.sphinx.dependencies = [ [envs.hatch-test.overrides.matrix.sphinx.default-args] value = ["tests/sphinx-agent", "tests/e2e"] + +[envs.hatch-static-analysis] +config-path = "ruff_defaults.toml" +dependencies = ["ruff==0.4.4"] diff --git a/lib/esbonio/pyproject.toml b/lib/esbonio/pyproject.toml index 2ba0f831f..a61afc976 100644 --- a/lib/esbonio/pyproject.toml +++ b/lib/esbonio/pyproject.toml @@ -58,11 +58,6 @@ exclude_also = [ "if typing.TYPE_CHECKING:", ] -[tool.isort] -force_single_line = true -known_first_party = ["esbonio"] -profile = "black" - [tool.pytest.ini_options] addopts = "--doctest-glob='*.txt'" asyncio_mode = "auto" diff --git a/lib/esbonio/ruff.toml b/lib/esbonio/ruff.toml new file mode 100644 index 000000000..590131318 --- /dev/null +++ b/lib/esbonio/ruff.toml @@ -0,0 +1,78 @@ +extend = "ruff_defaults.toml" +extend-exclude = ["tests/workspaces/**/conf.py"] +line-length = 88 +indent-width = 4 + +[format] +# Be like black where possible +quote-style = "double" +indent-style = "space" +line-ending = "auto" +skip-magic-trailing-comma = false + +[lint] +ignore = [ + "BLE001", # catch Exception: + "INP001", # Complains about namespace packages + "PT018", # Assertion should be broken down into multiple parts + "TRY003", # Exception message defined outside of class + + # The following were added when migrating to ruff, we might want to consider + # enabling some of these again at some point. + "A002", # argument shadowing + "ARG001", # unused function argument + "ARG002", # unused method argument + "C405", # rewrite as set literal + "C408", # dict(x=y) + "C416", # Unecessary dict comprehension + "C419", # Unecessary list comprehension + "E402", # module import not at top of file + "EM101", # raise ValueError("Literal string, not variable") + "EM102", # raise ValueError(f"-string, not variable") + "FBT001", # boolean arguments + "FBT002", # boolean arguments + "FLY002", # f-string alternative available + "G003", # logging statement uses f-string + "G004", # logging statement uses + + "G201", # logging.error(.., exc_info=True) + "N801", # naming conventions + "N802", # naming conventions + "N806", # naming conventions + "PERF401", # use list comprehension + "PERF402", # use list or list.copy + "PLR2004", # magic values + "PLW2901", # overwriting for-loop variable + "PT006", # Complains about how `pytest.mark.parametrize` parameters are passed + "PT011", # pytest.raises(ValueError) + "RET503", # Missing return + "RET504", # Unecessary assignment before return + "RET505", # Unecessary elif after return + "RUF001", # ambiguous characters + "RUF012", # Mutable ClassVar annotation... + "RUF015", # Prefer next(iter(...)) + "SIM102", # Use single if + "SIM105", # Use contextlib.suppress(...) + "SIM108", # Use ternary operator + "SIM115", # Use key in dict + "SIM118", # Use key in dict + "SLF001", # private member access + "TCH001", # move import to type checking block + "TCH002", # move import to type checking block + "TCH003", # move import to type checking block + "TID252", # Absolute vs relative imports + "TRY300", # Move statement to else block +] + +[lint.per-file-ignores] +"**/tests/**/*" = [ + "S", + "SLF001", # private member accessed + "T201", # print found +] + +[lint.isort] +force-single-line = true + +[lint.pyupgrade] +# At least for now... +keep-runtime-typing = true diff --git a/lib/esbonio/ruff_defaults.toml b/lib/esbonio/ruff_defaults.toml new file mode 100644 index 000000000..18aaec501 --- /dev/null +++ b/lib/esbonio/ruff_defaults.toml @@ -0,0 +1,557 @@ +line-length = 120 + +[format] +docstring-code-format = true +docstring-code-line-length = 80 + +[lint] +select = [ + "A001", + "A002", + "A003", + "ARG001", + "ARG002", + "ARG003", + "ARG004", + "ARG005", + "ASYNC100", + "ASYNC101", + "ASYNC102", + "B002", + "B003", + "B004", + "B005", + "B006", + "B007", + "B008", + "B009", + "B010", + "B011", + "B012", + "B013", + "B014", + "B015", + "B016", + "B017", + "B018", + "B019", + "B020", + "B021", + "B022", + "B023", + "B024", + "B025", + "B026", + "B028", + "B029", + "B030", + "B031", + "B032", + "B033", + "B034", + "B035", + "B904", + "B905", + "BLE001", + "C400", + "C401", + "C402", + "C403", + "C404", + "C405", + "C406", + "C408", + "C409", + "C410", + "C411", + "C413", + "C414", + "C415", + "C416", + "C417", + "C418", + "C419", + "COM818", + "DTZ001", + "DTZ002", + "DTZ003", + "DTZ004", + "DTZ005", + "DTZ006", + "DTZ007", + "DTZ011", + "DTZ012", + "E101", + "E401", + "E402", + "E701", + "E702", + "E703", + "E711", + "E712", + "E713", + "E714", + "E721", + "E722", + "E731", + "E741", + "E742", + "E743", + "E902", + "E999", + "EM101", + "EM102", + "EM103", + "EXE001", + "EXE002", + "EXE003", + "EXE004", + "EXE005", + "F401", + "F402", + "F403", + "F404", + "F405", + "F406", + "F407", + "F501", + "F502", + "F503", + "F504", + "F505", + "F506", + "F507", + "F508", + "F509", + "F521", + "F522", + "F523", + "F524", + "F525", + "F541", + "F601", + "F602", + "F621", + "F622", + "F631", + "F632", + "F633", + "F634", + "F701", + "F702", + "F704", + "F706", + "F707", + "F722", + "F811", + "F821", + "F822", + "F823", + "F841", + "F842", + "F901", + "FA100", + "FA102", + "FBT001", + "FBT002", + "FLY002", + "G001", + "G002", + "G003", + "G004", + "G010", + "G101", + "G201", + "G202", + "I001", + "I002", + "ICN001", + "ICN002", + "ICN003", + "INP001", + "INT001", + "INT002", + "INT003", + "ISC003", + "LOG001", + "LOG002", + "LOG007", + "LOG009", + "N801", + "N802", + "N803", + "N804", + "N805", + "N806", + "N807", + "N811", + "N812", + "N813", + "N814", + "N815", + "N816", + "N817", + "N818", + "N999", + "PERF101", + "PERF102", + "PERF401", + "PERF402", + "PGH005", + "PIE790", + "PIE794", + "PIE796", + "PIE800", + "PIE804", + "PIE807", + "PIE808", + "PIE810", + "PLC0105", + "PLC0131", + "PLC0132", + "PLC0205", + "PLC0208", + "PLC0414", + "PLC3002", + "PLE0100", + "PLE0101", + "PLE0116", + "PLE0117", + "PLE0118", + "PLE0237", + "PLE0241", + "PLE0302", + "PLE0307", + "PLE0604", + "PLE0605", + "PLE1142", + "PLE1205", + "PLE1206", + "PLE1300", + "PLE1307", + "PLE1310", + "PLE1507", + "PLE1700", + "PLE2502", + "PLE2510", + "PLE2512", + "PLE2513", + "PLE2514", + "PLE2515", + "PLR0124", + "PLR0133", + "PLR0206", + "PLR0402", + "PLR1701", + "PLR1711", + "PLR1714", + "PLR1722", + "PLR2004", + "PLR5501", + "PLW0120", + "PLW0127", + "PLW0129", + "PLW0131", + "PLW0406", + "PLW0602", + "PLW0603", + "PLW0711", + "PLW1508", + "PLW1509", + "PLW1510", + "PLW2901", + "PLW3301", + "PT001", + "PT002", + "PT003", + "PT006", + "PT007", + "PT008", + "PT009", + "PT010", + "PT011", + "PT012", + "PT013", + "PT014", + "PT015", + "PT016", + "PT017", + "PT018", + "PT019", + "PT020", + "PT021", + "PT022", + "PT023", + "PT024", + "PT025", + "PT026", + "PT027", + "PYI001", + "PYI002", + "PYI003", + "PYI004", + "PYI005", + "PYI006", + "PYI007", + "PYI008", + "PYI009", + "PYI010", + "PYI011", + "PYI012", + "PYI013", + "PYI014", + "PYI015", + "PYI016", + "PYI017", + "PYI018", + "PYI019", + "PYI020", + "PYI021", + "PYI024", + "PYI025", + "PYI026", + "PYI029", + "PYI030", + "PYI032", + "PYI033", + "PYI034", + "PYI035", + "PYI036", + "PYI041", + "PYI042", + "PYI043", + "PYI044", + "PYI045", + "PYI046", + "PYI047", + "PYI048", + "PYI049", + "PYI050", + "PYI051", + "PYI052", + "PYI053", + "PYI054", + "PYI055", + "PYI056", + "PYI058", + "RET503", + "RET504", + "RET505", + "RET506", + "RET507", + "RET508", + "RSE102", + "RUF001", + "RUF002", + "RUF003", + "RUF005", + "RUF006", + "RUF007", + "RUF008", + "RUF009", + "RUF010", + "RUF012", + "RUF013", + "RUF015", + "RUF016", + "RUF017", + "RUF018", + "RUF019", + "RUF020", + "RUF100", + "S101", + "S102", + "S103", + "S104", + "S105", + "S106", + "S107", + "S108", + "S110", + "S112", + "S113", + "S201", + "S202", + "S301", + "S302", + "S303", + "S304", + "S305", + "S306", + "S307", + "S308", + "S310", + "S311", + "S312", + "S313", + "S314", + "S315", + "S316", + "S317", + "S318", + "S319", + "S320", + "S321", + "S323", + "S324", + "S501", + "S502", + "S503", + "S504", + "S505", + "S506", + "S507", + "S508", + "S509", + "S601", + "S602", + "S604", + "S605", + "S606", + "S607", + "S608", + "S609", + "S611", + "S612", + "S701", + "S702", + "SIM101", + "SIM102", + "SIM103", + "SIM105", + "SIM107", + "SIM108", + "SIM109", + "SIM110", + "SIM112", + "SIM113", + "SIM114", + "SIM115", + "SIM116", + "SIM117", + "SIM118", + "SIM201", + "SIM202", + "SIM208", + "SIM210", + "SIM211", + "SIM212", + "SIM220", + "SIM221", + "SIM222", + "SIM223", + "SIM300", + "SIM910", + "SIM911", + "SLF001", + "SLOT000", + "SLOT001", + "SLOT002", + "T100", + "T201", + "T203", + "TCH001", + "TCH002", + "TCH003", + "TCH004", + "TCH005", + "TCH010", + "TD004", + "TD005", + "TD006", + "TD007", + "TID251", + "TID252", + "TID253", + "TRIO100", + "TRIO105", + "TRIO109", + "TRIO110", + "TRIO115", + "TRY002", + "TRY003", + "TRY004", + "TRY201", + "TRY300", + "TRY301", + "TRY302", + "TRY400", + "TRY401", + "UP001", + "UP003", + "UP004", + "UP005", + "UP006", + "UP007", + "UP008", + "UP009", + "UP010", + "UP011", + "UP012", + "UP013", + "UP014", + "UP015", + "UP017", + "UP018", + "UP019", + "UP020", + "UP021", + "UP022", + "UP023", + "UP024", + "UP025", + "UP026", + "UP027", + "UP028", + "UP029", + "UP030", + "UP031", + "UP032", + "UP033", + "UP034", + "UP035", + "UP036", + "UP037", + "UP038", + "UP039", + "UP040", + "UP041", + "W291", + "W292", + "W293", + "W505", + "W605", + "YTT101", + "YTT102", + "YTT103", + "YTT201", + "YTT202", + "YTT203", + "YTT204", + "YTT301", + "YTT302", + "YTT303", +] + +[lint.per-file-ignores] +"**/scripts/*" = [ + "INP001", + "T201", +] +"**/tests/**/*" = [ + "PLC1901", + "PLR2004", + "PLR6301", + "S", + "TID252", +] + +[lint.flake8-tidy-imports] +ban-relative-imports = "all" + +[lint.isort] +known-first-party = ["esbonio"] + +[lint.flake8-pytest-style] +fixture-parentheses = false +mark-parentheses = false diff --git a/lib/esbonio/setup.cfg b/lib/esbonio/setup.cfg deleted file mode 100644 index d13cdbaad..000000000 --- a/lib/esbonio/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[flake8] -max-line-length = 88 -ignore = E501,W503,E402,E203,E701,E704 From a3dfe14c7c6c040848b93995afd63ff519b40450 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Fri, 10 May 2024 22:21:44 +0100 Subject: [PATCH 28/60] lsp Initial batch of ruff lint fixes --- lib/esbonio/esbonio/server/feature.py | 6 ++---- .../features/sphinx_manager/client_subprocess.py | 13 ++++++++----- .../server/features/sphinx_manager/config.py | 2 +- .../server/features/sphinx_support/symbols.py | 2 +- lib/esbonio/esbonio/server/server.py | 2 +- lib/esbonio/esbonio/sphinx_agent/database.py | 4 ++-- .../esbonio/sphinx_agent/handlers/diagnostics.py | 2 +- .../esbonio/sphinx_agent/handlers/symbols.py | 2 +- lib/esbonio/tests/e2e/test_sphinx_manager.py | 4 ++-- lib/esbonio/tests/server/test_configuration.py | 2 +- lib/esbonio/tests/sphinx-agent/test_sa_unit.py | 2 +- scripts/sphinx-app.py | 1 + 12 files changed, 22 insertions(+), 20 deletions(-) diff --git a/lib/esbonio/esbonio/server/feature.py b/lib/esbonio/esbonio/server/feature.py index e34712a5d..c4332cb14 100644 --- a/lib/esbonio/esbonio/server/feature.py +++ b/lib/esbonio/esbonio/server/feature.py @@ -81,7 +81,7 @@ def document_open(self, params: types.DidOpenTextDocumentParams) -> MaybeAsyncNo def document_save(self, params: types.DidSaveTextDocumentParams) -> MaybeAsyncNone: """Called when a text document is saved.""" - completion_triggers: List["re.Pattern"] = [] + completion_triggers: List[re.Pattern] = [] def completion(self, context: CompletionContext) -> CompletionResult: """Called when a completion request matches one of the specified triggers.""" @@ -90,13 +90,11 @@ def document_symbol( self, params: types.DocumentSymbolParams ) -> DocumentSymbolResult: """Called when a document symbols request is received.""" - ... def workspace_symbol( self, params: types.WorkspaceSymbolParams ) -> WorkspaceSymbolResult: """Called when a workspace symbols request is received.""" - ... @attrs.define @@ -120,7 +118,7 @@ class CompletionContext: doc: TextDocument """The document within which the completion request was made.""" - match: "re.Match" + match: re.Match """The match object describing the site of the completion request.""" position: types.Position diff --git a/lib/esbonio/esbonio/server/features/sphinx_manager/client_subprocess.py b/lib/esbonio/esbonio/server/features/sphinx_manager/client_subprocess.py index 06fca953d..777fbbb98 100644 --- a/lib/esbonio/esbonio/server/features/sphinx_manager/client_subprocess.py +++ b/lib/esbonio/esbonio/server/features/sphinx_manager/client_subprocess.py @@ -14,9 +14,9 @@ from pygls.client import JsonRPCClient from pygls.protocol import JsonRPCProtocol -import esbonio.sphinx_agent.types as types from esbonio.server import EventSource from esbonio.server import Uri +from esbonio.sphinx_agent import types from .client import ClientState from .config import SphinxConfig @@ -59,7 +59,7 @@ def __init__( *args, **kwargs, ): - super().__init__(protocol_cls=protocol_cls, *args, **kwargs) # type: ignore[misc] + super().__init__(*args, protocol_cls=protocol_cls, **kwargs) # type: ignore[misc] self.id = str(uuid4()) """The client's id.""" @@ -317,7 +317,7 @@ def make_test_sphinx_client(config: SphinxConfig) -> SubprocessSphinxClient: @client.feature("window/logMessage") def _(params): - print(params.message, file=sys.stderr) + print(params.message, file=sys.stderr) # noqa: T201 @client.feature("$/progress") def _on_progress(params): @@ -354,14 +354,17 @@ def get_start_command(config: SphinxConfig, logger: logging.Logger): if config.enable_dev_tools: # Assumes that the user has `lsp-devtools` available on their PATH # TODO: Windows support - result = subprocess.run(["command", "-v", "lsp-devtools"], capture_output=True) + result = subprocess.run( + ["command", "-v", "lsp-devtools"], capture_output=True, check=False # noqa: S607 + ) + if result.returncode == 0: lsp_devtools = result.stdout.decode("utf8").strip() command.extend([lsp_devtools, "agent", "--"]) else: stderr = result.stderr.decode("utf8").strip() - logger.debug("Unable to locate lsp-devtools command", stderr) + logger.debug("Unable to locate lsp-devtools command\n%s", stderr) command.extend([*config.python_command, "-m", "sphinx_agent"]) return command diff --git a/lib/esbonio/esbonio/server/features/sphinx_manager/config.py b/lib/esbonio/esbonio/server/features/sphinx_manager/config.py index ba92489f0..781c5802a 100644 --- a/lib/esbonio/esbonio/server/features/sphinx_manager/config.py +++ b/lib/esbonio/esbonio/server/features/sphinx_manager/config.py @@ -227,7 +227,7 @@ def _resolve_build_command(self, uri: Uri, logger: logging.Logger) -> List[str]: logger.debug("Trying path: %s", current) if conf_py.exists(): cache = platformdirs.user_cache_dir("esbonio", "swyddfa") - project = hashlib.md5(str(current).encode()).hexdigest() + project = hashlib.md5(str(current).encode()).hexdigest() # noqa: S324 build_dir = str(pathlib.Path(cache, project)) return ["sphinx-build", "-M", "dirhtml", str(current), str(build_dir)] diff --git a/lib/esbonio/esbonio/server/features/sphinx_support/symbols.py b/lib/esbonio/esbonio/server/features/sphinx_support/symbols.py index c50413ad7..0d39b6a05 100644 --- a/lib/esbonio/esbonio/server/features/sphinx_support/symbols.py +++ b/lib/esbonio/esbonio/server/features/sphinx_support/symbols.py @@ -77,7 +77,7 @@ async def workspace_symbol( uri = Uri.parse(uri_str) range_ = self.converter.structure(json.loads(range_json), types.Range) - if detail != "" and name != detail: + if detail not in {"", name}: display_name = f"{name} {detail}" else: display_name = name diff --git a/lib/esbonio/esbonio/server/server.py b/lib/esbonio/esbonio/server/server.py index e41a6bb91..3201e271f 100644 --- a/lib/esbonio/esbonio/server/server.py +++ b/lib/esbonio/esbonio/server/server.py @@ -447,7 +447,7 @@ def _get_setup_arguments( args[name] = server continue - from .feature import LanguageFeature # noqa: F402 + from .feature import LanguageFeature if issubclass(type_, LanguageFeature): # Try and obtain an instance of the requested language feature. diff --git a/lib/esbonio/esbonio/sphinx_agent/database.py b/lib/esbonio/esbonio/sphinx_agent/database.py index d794db924..80be9e26f 100644 --- a/lib/esbonio/esbonio/sphinx_agent/database.py +++ b/lib/esbonio/esbonio/sphinx_agent/database.py @@ -88,7 +88,7 @@ def clear_table(self, table: Table, **kwargs): """ # TODO: Is there a way to pass the table name as a '?' parameter? - base_query = f"DELETE FROM {table.name}" + base_query = f"DELETE FROM {table.name}" # noqa: S608 where: List[str] = [] parameters: List[Any] = [] @@ -140,5 +140,5 @@ def insert_values(self, table: Table, values: List[Tuple]): cursor = self.db.cursor() placeholder = "(" + ",".join(["?" for _ in range(len(values[0]))]) + ")" - cursor.executemany(f"INSERT INTO {table.name} VALUES {placeholder}", values) + cursor.executemany(f"INSERT INTO {table.name} VALUES {placeholder}", values) # noqa: S608 self.db.commit() diff --git a/lib/esbonio/esbonio/sphinx_agent/handlers/diagnostics.py b/lib/esbonio/esbonio/sphinx_agent/handlers/diagnostics.py index 70c47d1b3..cc7b60240 100644 --- a/lib/esbonio/esbonio/sphinx_agent/handlers/diagnostics.py +++ b/lib/esbonio/esbonio/sphinx_agent/handlers/diagnostics.py @@ -43,7 +43,7 @@ def setup(app: Sphinx): app.connect("config-inited", init_db) app.connect("source-read", clear_diagnostics) - # TODO + # TODO: Support for Sphinx v7+ # app.connect("include-read") app.connect("build-finished", sync_diagnostics) diff --git a/lib/esbonio/esbonio/sphinx_agent/handlers/symbols.py b/lib/esbonio/esbonio/sphinx_agent/handlers/symbols.py index 4364686f1..258ef294a 100644 --- a/lib/esbonio/esbonio/sphinx_agent/handlers/symbols.py +++ b/lib/esbonio/esbonio/sphinx_agent/handlers/symbols.py @@ -107,7 +107,7 @@ def astext(self): return self["text"] -def dummy_role(name, rawtext, text, lineno, inliner, options={}, content=[]): +def dummy_role(name, rawtext, text, lineno, inliner, options=None, content=None): node = a_role() node.line = lineno diff --git a/lib/esbonio/tests/e2e/test_sphinx_manager.py b/lib/esbonio/tests/e2e/test_sphinx_manager.py index c5c52c7f9..4f860bc5f 100644 --- a/lib/esbonio/tests/e2e/test_sphinx_manager.py +++ b/lib/esbonio/tests/e2e/test_sphinx_manager.py @@ -30,12 +30,12 @@ ServerManager = Callable[[Any], Tuple[EsbonioLanguageServer, SphinxManager]] -@pytest.fixture() +@pytest.fixture def demo_workspace(uri_for): return uri_for("workspaces", "demo") -@pytest.fixture() +@pytest.fixture def docs_workspace(uri_for): return uri_for("..", "..", "..", "docs") diff --git a/lib/esbonio/tests/server/test_configuration.py b/lib/esbonio/tests/server/test_configuration.py index a109c444c..2480a11c6 100644 --- a/lib/esbonio/tests/server/test_configuration.py +++ b/lib/esbonio/tests/server/test_configuration.py @@ -26,7 +26,7 @@ class ExampleConfig: log_names: List[str] = attrs.field(factory=list) -@pytest.fixture() +@pytest.fixture def server(event_loop): """Return a server instance for testing.""" _server = EsbonioLanguageServer(loop=event_loop) diff --git a/lib/esbonio/tests/sphinx-agent/test_sa_unit.py b/lib/esbonio/tests/sphinx-agent/test_sa_unit.py index f9668866f..65462879f 100644 --- a/lib/esbonio/tests/sphinx-agent/test_sa_unit.py +++ b/lib/esbonio/tests/sphinx-agent/test_sa_unit.py @@ -34,7 +34,7 @@ def application_args(**kwargs) -> Dict[str, Any]: "warningiserror": False, } - for arg in {"srcdir", "outdir", "confdir", "doctreedir"}: + for arg in ("srcdir", "outdir", "confdir", "doctreedir"): if arg in kwargs: kwargs[arg] = str(pathlib.Path(kwargs[arg]).resolve()) diff --git a/scripts/sphinx-app.py b/scripts/sphinx-app.py index 753cba21d..91ba9eecb 100644 --- a/scripts/sphinx-app.py +++ b/scripts/sphinx-app.py @@ -29,6 +29,7 @@ >>> app """ +# ruff: noqa: F401 import inspect import pathlib From 3b3325c34d924a1ebf7ce8834a8949e62a466bcf Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Fri, 10 May 2024 22:22:35 +0100 Subject: [PATCH 29/60] lsp: Initial ruff based formatting --- lib/esbonio/esbonio/server/events.py | 1 - .../esbonio/server/features/preview_manager/__init__.py | 4 ---- .../esbonio/server/features/preview_manager/preview.py | 1 - .../server/features/sphinx_manager/client_subprocess.py | 4 +++- lib/esbonio/esbonio/server/server.py | 4 ++-- lib/esbonio/esbonio/sphinx_agent/app.py | 1 - lib/esbonio/tests/server/test_patterns.py | 6 +++--- 7 files changed, 8 insertions(+), 13 deletions(-) diff --git a/lib/esbonio/esbonio/server/events.py b/lib/esbonio/esbonio/server/events.py index d44e16334..255ee6299 100644 --- a/lib/esbonio/esbonio/server/events.py +++ b/lib/esbonio/esbonio/server/events.py @@ -21,7 +21,6 @@ class EventSource: # etc know which events are possible etc. def __init__(self, logger: Optional[logging.Logger] = None): - self.logger = logger or logging.getLogger(__name__) """The logging instance to use.""" diff --git a/lib/esbonio/esbonio/server/features/preview_manager/__init__.py b/lib/esbonio/esbonio/server/features/preview_manager/__init__.py index 8b44002ac..5436926f9 100644 --- a/lib/esbonio/esbonio/server/features/preview_manager/__init__.py +++ b/lib/esbonio/esbonio/server/features/preview_manager/__init__.py @@ -146,7 +146,6 @@ async def scroll_view(self, line: int): self.webview.scroll(line) async def preview_file(self, params, retry=True): - if self.preview is None: return None @@ -161,15 +160,12 @@ async def preview_file(self, params, retry=True): return None if (build_path := await project.get_build_path(src_uri)) is None: - # The client might not have built the project yet. if client.id not in self.built_clients and retry is True: - # Only retry this once. await self.sphinx.trigger_build(src_uri) return await self.preview_file(params, retry=False) else: - self.logger.debug( "Unable to preview file '%s', not included in build output.", src_uri, diff --git a/lib/esbonio/esbonio/server/features/preview_manager/preview.py b/lib/esbonio/esbonio/server/features/preview_manager/preview.py index a69d2aa46..1bae234d1 100644 --- a/lib/esbonio/esbonio/server/features/preview_manager/preview.py +++ b/lib/esbonio/esbonio/server/features/preview_manager/preview.py @@ -58,7 +58,6 @@ class PreviewServer: """The http server that serves the built content.""" def __init__(self, logger: logging.Logger, config: PreviewConfig, executor: Any): - self.config = config """The current configuration.""" diff --git a/lib/esbonio/esbonio/server/features/sphinx_manager/client_subprocess.py b/lib/esbonio/esbonio/server/features/sphinx_manager/client_subprocess.py index 777fbbb98..e2a8c6405 100644 --- a/lib/esbonio/esbonio/server/features/sphinx_manager/client_subprocess.py +++ b/lib/esbonio/esbonio/server/features/sphinx_manager/client_subprocess.py @@ -355,7 +355,9 @@ def get_start_command(config: SphinxConfig, logger: logging.Logger): # Assumes that the user has `lsp-devtools` available on their PATH # TODO: Windows support result = subprocess.run( - ["command", "-v", "lsp-devtools"], capture_output=True, check=False # noqa: S607 + ["command", "-v", "lsp-devtools"], # noqa: S607 + capture_output=True, + check=False, ) if result.returncode == 0: diff --git a/lib/esbonio/esbonio/server/server.py b/lib/esbonio/esbonio/server/server.py index 3201e271f..e90754a9d 100644 --- a/lib/esbonio/esbonio/server/server.py +++ b/lib/esbonio/esbonio/server/server.py @@ -174,8 +174,8 @@ def load_extension(self, name: str, setup: Callable): from esbonio.lsp.roles import Roles from esbonio.lsp.sphinx import SphinxLanguageServer - def esbonio_setup(rst: SphinxLanguageServer, roles: Roles): - ... + + def esbonio_setup(rst: SphinxLanguageServer, roles: Roles): ... In this example the setup function is requesting instances of the :class:`~esbonio.lsp.sphinx.SphinxLanguageServer` and the diff --git a/lib/esbonio/esbonio/sphinx_agent/app.py b/lib/esbonio/esbonio/sphinx_agent/app.py index 90bfdff38..7edbcb086 100644 --- a/lib/esbonio/esbonio/sphinx_agent/app.py +++ b/lib/esbonio/esbonio/sphinx_agent/app.py @@ -17,7 +17,6 @@ def setup_logging(app: Sphinx, status: IO, warning: IO): - # Run the usual setup sphinx_log_setup(app, status, warning) diff --git a/lib/esbonio/tests/server/test_patterns.py b/lib/esbonio/tests/server/test_patterns.py index 83a047e91..3d6747670 100644 --- a/lib/esbonio/tests/server/test_patterns.py +++ b/lib/esbonio/tests/server/test_patterns.py @@ -308,7 +308,7 @@ def test_myst_role_regex(string, expected): As with most test cases, this one is parameterized with the following arguments:: - (":ref:", {"name": "ref"}), + ((":ref:", {"name": "ref"}),) (".. directive::", None) The first argument is the string to test the pattern against, the second a @@ -767,7 +767,7 @@ def test_rst_role_regex(string, expected): As with most test cases, this one is parameterized with the following arguments:: - (":ref:", {"name": "ref"}), + ((":ref:", {"name": "ref"}),) (".. directive::", None) The first argument is the string to test the pattern against, the second a @@ -900,7 +900,7 @@ def test_default_role_regex(string, expected): As with most test cases, this one is parameterized with the following arguments:: - (":ref:", {"name": "ref"}), + ((":ref:", {"name": "ref"}),) (".. directive::", None) The first argument is the string to test the pattern against, the second a From 07d89337ecca8bbee2559ccefed0b9c65b8db660 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Fri, 10 May 2024 22:22:54 +0100 Subject: [PATCH 30/60] devenv: Add make targets for pre-commit --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Makefile b/Makefile index ae64af694..dcb3caa25 100644 --- a/Makefile +++ b/Makefile @@ -1 +1,13 @@ include .devcontainer/tools.mk + +.PHONY: lint enable-pre-commit disable-pre-commit + +lint: $(PRE_COMMIT) + $(PRE_COMMIT) run --all-files + + +enable-pre-commit: $(PRE_COMMIT) + $(PRE_COMMIT) install + +disable-pre-commit: $(PRE_COMMIT) + $(PRE_COMMIT) uninstall From 3f0d245b00b75bb8449024c1b045e91983238d5a Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Sun, 12 May 2024 20:40:34 +0100 Subject: [PATCH 31/60] lsp: Split role support into multiple features As with directives, this commit splits the monolithic `Roles` feature into a backend feature and two frontend features. The original `Roles` feature is responsible for providing the API used by the frontend features. The `RstRoles` and `MystRoles` features use the backend to provide features for the reStructuredText and MyST syntaxes respectively. Note that this is already proving useful as the `MystRoles` feature does not need the "backtracking" code the `RstRoles` feature uses to determine if a completion is an actual role, or a directive's option. --- lib/esbonio/esbonio/server/cli.py | 2 + .../esbonio/server/features/myst/roles.py | 90 ++++++++++++++ .../esbonio/server/features/roles/__init__.py | 99 +-------------- .../esbonio/server/features/rst/roles.py | 115 ++++++++++++++++++ 4 files changed, 212 insertions(+), 94 deletions(-) create mode 100644 lib/esbonio/esbonio/server/features/myst/roles.py create mode 100644 lib/esbonio/esbonio/server/features/rst/roles.py diff --git a/lib/esbonio/esbonio/server/cli.py b/lib/esbonio/esbonio/server/cli.py index 6b443e785..343a501fb 100644 --- a/lib/esbonio/esbonio/server/cli.py +++ b/lib/esbonio/esbonio/server/cli.py @@ -71,7 +71,9 @@ def main(argv: Optional[Sequence[str]] = None): "esbonio.server.features.directives", "esbonio.server.features.roles", "esbonio.server.features.rst.directives", + "esbonio.server.features.rst.roles", "esbonio.server.features.myst.directives", + "esbonio.server.features.myst.roles", "esbonio.server.features.sphinx_support.diagnostics", "esbonio.server.features.sphinx_support.symbols", "esbonio.server.features.sphinx_support.directives", diff --git a/lib/esbonio/esbonio/server/features/myst/roles.py b/lib/esbonio/esbonio/server/features/myst/roles.py new file mode 100644 index 000000000..2ee724d75 --- /dev/null +++ b/lib/esbonio/esbonio/server/features/myst/roles.py @@ -0,0 +1,90 @@ +from __future__ import annotations + +import typing + +from lsprotocol import types + +from esbonio import server +from esbonio.server.features.roles import RolesFeature +from esbonio.server.features.roles import completion +from esbonio.sphinx_agent.types import MYST_ROLE + +if typing.TYPE_CHECKING: + from typing import List + from typing import Optional + + +class MystRoles(server.LanguageFeature): + """A frontend to roles for MyST syntax.""" + + def __init__(self, roles: RolesFeature, *args, **kwargs): + super().__init__(*args, **kwargs) + + self.roles = roles + self._insert_behavior = "replace" + + completion_triggers = [MYST_ROLE] + + def initialized(self, params: types.InitializedParams): + """Called once the initial handshake between client and server has finished.""" + self.configuration.subscribe( + "esbonio.server.completion", + server.CompletionConfig, + self.update_configuration, + ) + + def update_configuration( + self, event: server.ConfigChangeEvent[server.CompletionConfig] + ): + """Called when the user's configuration is updated.""" + self._insert_behavior = event.value.preferred_insert_behavior + + async def completion( + self, context: server.CompletionContext + ) -> Optional[List[types.CompletionItem]]: + """Provide completion suggestions for roles.""" + + groups = context.match.groupdict() + target = groups["target"] + + # All text matched by the regex + text = context.match.group(0) + start, end = context.match.span() + + if target: + target_index = start + text.find(target) + + # Only trigger target completions if the request was made from within + # the target part of the role. + if target_index <= context.position.character <= end: + return await self.complete_targets(context) + + return await self.complete_roles(context) + + async def complete_targets(self, context: server.CompletionContext): + return None + + async def complete_roles( + self, context: server.CompletionContext + ) -> Optional[List[types.CompletionItem]]: + """Return completion suggestions for the available roles""" + + language = self.server.get_language_at(context.doc, context.position) + render_func = completion.get_role_renderer(language, self._insert_behavior) + if render_func is None: + return None + + items = [] + for role in await self.roles.suggest_roles(context): + if (item := render_func(context, role)) is not None: + items.append(item) + + if len(items) > 0: + return items + + return None + + +def esbonio_setup(esbonio: server.EsbonioLanguageServer, roles: RolesFeature): + rst_roles = MystRoles(roles, esbonio) + esbonio.add_feature(rst_roles) diff --git a/lib/esbonio/esbonio/server/features/roles/__init__.py b/lib/esbonio/esbonio/server/features/roles/__init__.py index 75b68a092..26c22ce22 100644 --- a/lib/esbonio/esbonio/server/features/roles/__init__.py +++ b/lib/esbonio/esbonio/server/features/roles/__init__.py @@ -4,14 +4,8 @@ import typing import attrs -from lsprotocol import types from esbonio import server -from esbonio.sphinx_agent.types import MYST_ROLE -from esbonio.sphinx_agent.types import RST_DIRECTIVE -from esbonio.sphinx_agent.types import RST_ROLE - -from . import completion if typing.TYPE_CHECKING: from typing import Any @@ -44,13 +38,16 @@ def suggest_roles( class RolesFeature(server.LanguageFeature): - """Support for roles.""" + """Backend support for roles. + + It's this language feature's responsibility to provide an API that exposes the + information a frontend feature may want. + """ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._providers: Dict[int, RoleProvider] = {} - self._insert_behavior = "replace" def add_provider(self, provider: RoleProvider): """Register a role provider. @@ -62,92 +59,6 @@ def add_provider(self, provider: RoleProvider): """ self._providers[id(provider)] = provider - def initialized(self, params: types.InitializedParams): - """Called once the initial handshake between client and server has finished.""" - self.configuration.subscribe( - "esbonio.server.completion", - server.CompletionConfig, - self.update_configuration, - ) - - def update_configuration( - self, event: server.ConfigChangeEvent[server.CompletionConfig] - ): - """Called when the user's configuration is updated.""" - self._insert_behavior = event.value.preferred_insert_behavior - - completion_triggers = [MYST_ROLE, RST_ROLE] - - async def completion( - self, context: server.CompletionContext - ) -> Optional[List[types.CompletionItem]]: - """Provide completion suggestions for roles.""" - - language = self.server.get_language_at(context.doc, context.position) - groups = context.match.groupdict() - target = groups["target"] - - # All text matched by the regex - text = context.match.group(0) - start, end = context.match.span() - - if target: - target_index = start + text.find(target) - - # Only trigger target completions if the request was made from within - # the target part of the role. - if target_index <= context.position.character <= end: - return await self.complete_targets(context) - - # If there's no indent, or this is a markdown document, then this can only be a - # role definition - indent = context.match.group(1) - if indent == "" or language == "markdown": - return await self.complete_roles(context) - - # Otherwise, search backwards until we find a blank line or an unindent - # so that we can determine the appropriate context. - linum = context.position.line - 1 - - try: - line = context.doc.lines[linum] - except IndexError: - return await self.complete_roles(context) - - while linum >= 0 and line.startswith(indent): - linum -= 1 - line = context.doc.lines[linum] - - # Unless we are within a directive's options block, we should offer role - # suggestions - if RST_DIRECTIVE.match(line): - return [] - - return await self.complete_roles(context) - - async def complete_targets(self, context: server.CompletionContext): - return None - - async def complete_roles( - self, context: server.CompletionContext - ) -> Optional[List[types.CompletionItem]]: - """Return completion suggestions for the available roles""" - - language = self.server.get_language_at(context.doc, context.position) - render_func = completion.get_role_renderer(language, self._insert_behavior) - if render_func is None: - return None - - items = [] - for role in await self.suggest_roles(context): - if (item := render_func(context, role)) is not None: - items.append(item) - - if len(items) > 0: - return items - - return None - async def suggest_roles(self, context: server.CompletionContext) -> List[Role]: """Suggest roles that may be used, given a completion context. diff --git a/lib/esbonio/esbonio/server/features/rst/roles.py b/lib/esbonio/esbonio/server/features/rst/roles.py new file mode 100644 index 000000000..2a7b92028 --- /dev/null +++ b/lib/esbonio/esbonio/server/features/rst/roles.py @@ -0,0 +1,115 @@ +from __future__ import annotations + +import typing + +from lsprotocol import types + +from esbonio import server +from esbonio.server.features.roles import RolesFeature +from esbonio.server.features.roles import completion +from esbonio.sphinx_agent.types import RST_DIRECTIVE +from esbonio.sphinx_agent.types import RST_ROLE + +if typing.TYPE_CHECKING: + from typing import List + from typing import Optional + + +class RstRoles(server.LanguageFeature): + """A frontend to roles for reStructuredText syntax.""" + + def __init__(self, roles: RolesFeature, *args, **kwargs): + super().__init__(*args, **kwargs) + + self.roles = roles + self._insert_behavior = "replace" + + completion_triggers = [RST_ROLE] + + def initialized(self, params: types.InitializedParams): + """Called once the initial handshake between client and server has finished.""" + self.configuration.subscribe( + "esbonio.server.completion", + server.CompletionConfig, + self.update_configuration, + ) + + def update_configuration( + self, event: server.ConfigChangeEvent[server.CompletionConfig] + ): + """Called when the user's configuration is updated.""" + self._insert_behavior = event.value.preferred_insert_behavior + + async def completion( + self, context: server.CompletionContext + ) -> Optional[List[types.CompletionItem]]: + """Provide completion suggestions for roles.""" + + groups = context.match.groupdict() + target = groups["target"] + + # All text matched by the regex + text = context.match.group(0) + start, end = context.match.span() + + if target: + target_index = start + text.find(target) + + # Only trigger target completions if the request was made from within + # the target part of the role. + if target_index <= context.position.character <= end: + return await self.complete_targets(context) + + # If there's no indent, then this can only be a + # role definition + indent = context.match.group(1) + if indent == "": + return await self.complete_roles(context) + + # Otherwise, search backwards until we find a blank line or an unindent + # so that we can determine the appropriate context. + linum = context.position.line - 1 + + try: + line = context.doc.lines[linum] + except IndexError: + return await self.complete_roles(context) + + while linum >= 0 and line.startswith(indent): + linum -= 1 + line = context.doc.lines[linum] + + # Unless we are within a directive's options block, we should offer role + # suggestions + if RST_DIRECTIVE.match(line): + return [] + + return await self.complete_roles(context) + + async def complete_targets(self, context: server.CompletionContext): + return None + + async def complete_roles( + self, context: server.CompletionContext + ) -> Optional[List[types.CompletionItem]]: + """Return completion suggestions for the available roles""" + + language = self.server.get_language_at(context.doc, context.position) + render_func = completion.get_role_renderer(language, self._insert_behavior) + if render_func is None: + return None + + items = [] + for role in await self.roles.suggest_roles(context): + if (item := render_func(context, role)) is not None: + items.append(item) + + if len(items) > 0: + return items + + return None + + +def esbonio_setup(esbonio: server.EsbonioLanguageServer, roles: RolesFeature): + rst_roles = RstRoles(roles, esbonio) + esbonio.add_feature(rst_roles) From e845b73300f4525520c9f4e4b88f641411c39928 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 14:31:00 +0000 Subject: [PATCH 32/60] build(deps): bump semver from 7.6.0 to 7.6.2 in /code Bumps [semver](https://github.com/npm/node-semver) from 7.6.0 to 7.6.2. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v7.6.0...v7.6.2) --- updated-dependencies: - dependency-name: semver dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- code/package-lock.json | 28 +++++++++++++--------------- code/package.json | 2 +- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/code/package-lock.json b/code/package-lock.json index ee6682c0a..448561c58 100644 --- a/code/package-lock.json +++ b/code/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "@vscode/python-extension": "^1.0.5", - "semver": "^7.6.0", + "semver": "^7.6.2", "vscode-languageclient": "^9.0.1" }, "devDependencies": { @@ -1871,6 +1871,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -2333,12 +2334,9 @@ "dev": true }, "node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", - "dependencies": { - "lru-cache": "^6.0.0" - }, + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "bin": { "semver": "bin/semver.js" }, @@ -2746,7 +2744,8 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, "node_modules/yauzl": { "version": "2.10.0", @@ -4083,6 +4082,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, "requires": { "yallist": "^4.0.0" } @@ -4449,12 +4449,9 @@ "dev": true }, "semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", - "requires": { - "lru-cache": "^6.0.0" - } + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==" }, "set-blocking": { "version": "2.0.0", @@ -4772,7 +4769,8 @@ "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, "yauzl": { "version": "2.10.0", diff --git a/code/package.json b/code/package.json index fdb7c708a..62a76059c 100644 --- a/code/package.json +++ b/code/package.json @@ -31,7 +31,7 @@ ], "dependencies": { "@vscode/python-extension": "^1.0.5", - "semver": "^7.6.0", + "semver": "^7.6.2", "vscode-languageclient": "^9.0.1" }, "devDependencies": { From 8ba56522c398eced7e108df2be6299f6518d5a13 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 14:31:13 +0000 Subject: [PATCH 33/60] build(deps-dev): bump esbuild from 0.20.2 to 0.21.2 in /code Bumps [esbuild](https://github.com/evanw/esbuild) from 0.20.2 to 0.21.2. - [Release notes](https://github.com/evanw/esbuild/releases) - [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md) - [Commits](https://github.com/evanw/esbuild/compare/v0.20.2...v0.21.2) --- updated-dependencies: - dependency-name: esbuild dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- code/package-lock.json | 382 ++++++++++++++++++++--------------------- code/package.json | 2 +- 2 files changed, 192 insertions(+), 192 deletions(-) diff --git a/code/package-lock.json b/code/package-lock.json index 448561c58..287f82e8b 100644 --- a/code/package-lock.json +++ b/code/package-lock.json @@ -18,7 +18,7 @@ "@types/node": "^18", "@types/vscode": "1.78.0", "@vscode/vsce": "^2.26.1", - "esbuild": "^0.20.2", + "esbuild": "^0.21.2", "ovsx": "^0.9.1", "typescript": "^5.4.5" }, @@ -235,9 +235,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", - "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.2.tgz", + "integrity": "sha512-/c7hocx0pm14bHQlqUVKmxwdT/e5/KkyoY1W8F9lk/8CkE037STDDz8PXUP/LE6faj2HqchvDs9GcShxFhI78Q==", "cpu": [ "ppc64" ], @@ -251,9 +251,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", - "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.2.tgz", + "integrity": "sha512-G1ve3b4FeyJeyCjB4MX1CiWyTaIJwT9wAYE+8+IRA53YoN/reC/Bf2GDRXAzDTnh69Fpl+1uIKg76DiB3U6vwQ==", "cpu": [ "arm" ], @@ -267,9 +267,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", - "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.2.tgz", + "integrity": "sha512-SGZKngoTWVUriO5bDjI4WDGsNx2VKZoXcds+ita/kVYB+8IkSCKDRDaK+5yu0b5S0eq6B3S7fpiEvpsa2ammlQ==", "cpu": [ "arm64" ], @@ -283,9 +283,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", - "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.2.tgz", + "integrity": "sha512-1wzzNoj2QtNkAYwIcWJ66UTRA80+RTQ/kuPMtEuP0X6dp5Ar23Dn566q3aV61h4EYrrgGlOgl/HdcqN/2S/2vg==", "cpu": [ "x64" ], @@ -299,9 +299,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", - "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.2.tgz", + "integrity": "sha512-ZyMkPWc5eTROcLOA10lEqdDSTc6ds6nuh3DeHgKip/XJrYjZDfnkCVSty8svWdy+SC1f77ULtVeIqymTzaB6/Q==", "cpu": [ "arm64" ], @@ -315,9 +315,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", - "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.2.tgz", + "integrity": "sha512-K4ZdVq1zP9v51h/cKVna7im7G0zGTKKB6bP2yJiSmHjjOykbd8DdhrSi8V978sF69rkwrn8zCyL2t6I3ei6j9A==", "cpu": [ "x64" ], @@ -331,9 +331,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", - "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.2.tgz", + "integrity": "sha512-4kbOGdpA61CXqadD+Gb/Pw3YXamQGiz9mal/h93rFVSjr5cgMnmJd/gbfPRm+3BMifvnaOfS1gNWaIDxkE2A3A==", "cpu": [ "arm64" ], @@ -347,9 +347,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", - "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.2.tgz", + "integrity": "sha512-ShS+R09nuHzDBfPeMUliKZX27Wrmr8UFp93aFf/S8p+++x5BZ+D344CLKXxmY6qzgTL3mILSImPCNJOzD6+RRg==", "cpu": [ "x64" ], @@ -363,9 +363,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", - "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.2.tgz", + "integrity": "sha512-nnGXjOAv+7cM3LYRx4tJsYdgy8dGDGkAzF06oIDGppWbUkUKN9SmgQA8H0KukpU0Pjrj9XmgbWqMVSX/U7eeTA==", "cpu": [ "arm" ], @@ -379,9 +379,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", - "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.2.tgz", + "integrity": "sha512-Hdu8BL+AmO+eCDvvT6kz/fPQhvuHL8YK4ExKZfANWsNe1kFGOHw7VJvS/FKSLFqheXmB3rTF3xFQIgUWPYsGnA==", "cpu": [ "arm64" ], @@ -395,9 +395,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", - "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.2.tgz", + "integrity": "sha512-m73BOCW2V9lcj7RtEMi+gBfHC6n3+VHpwQXP5offtQMPLDkpVolYn1YGXxOZ9hp4h3UPRKuezL7WkBsw+3EB3Q==", "cpu": [ "ia32" ], @@ -411,9 +411,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", - "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.2.tgz", + "integrity": "sha512-84eYHwwWHq3myIY/6ikALMcnwkf6Qo7NIq++xH0x+cJuUNpdwh8mlpUtRY+JiGUc60yu7ElWBbVHGWTABTclGw==", "cpu": [ "loong64" ], @@ -427,9 +427,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", - "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.2.tgz", + "integrity": "sha512-9siSZngT0/ZKG+AH+/agwKF29LdCxw4ODi/PiE0F52B2rtLozlDP92umf8G2GPoVV611LN4pZ+nSTckebOscUA==", "cpu": [ "mips64el" ], @@ -443,9 +443,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", - "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.2.tgz", + "integrity": "sha512-y0T4aV2CA+ic04ULya1A/8M2RDpDSK2ckgTj6jzHKFJvCq0jQg8afQQIn4EM0G8u2neyOiNHgSF9YKPfuqKOVw==", "cpu": [ "ppc64" ], @@ -459,9 +459,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", - "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.2.tgz", + "integrity": "sha512-x5ssCdXmZC86L2Li1qQPF/VaC4VP20u/Zm8jlAu9IiVOVi79YsSz6cpPDYZl1rfKSHYCJW9XBfFCo66S5gVPSA==", "cpu": [ "riscv64" ], @@ -475,9 +475,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", - "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.2.tgz", + "integrity": "sha512-NP7fTpGSFWdXyvp8iAFU04uFh9ARoplFVM/m+8lTRpaYG+2ytHPZWyscSsMM6cvObSIK2KoPHXiZD4l99WaxbQ==", "cpu": [ "s390x" ], @@ -491,9 +491,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", - "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.2.tgz", + "integrity": "sha512-giZ/uOxWDKda44ZuyfKbykeXznfuVNkTgXOUOPJIjbayJV6FRpQ4zxUy9JMBPLaK9IJcdWtaoeQrYBMh3Rr4vQ==", "cpu": [ "x64" ], @@ -507,9 +507,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", - "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.2.tgz", + "integrity": "sha512-IeFMfGFSQfIj1d4XU+6lkbFzMR+mFELUUVYrZ+jvWzG4NGvs6o53ReEHLHpYkjRbdEjJy2W3lTekTxrFHW7YJg==", "cpu": [ "x64" ], @@ -523,9 +523,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", - "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.2.tgz", + "integrity": "sha512-48QhWD6WxcebNNaE4FCwgvQVUnAycuTd+BdvA/oZu+/MmbpU8pY2dMEYlYzj5uNHWIG5jvdDmFXu0naQeOWUoA==", "cpu": [ "x64" ], @@ -539,9 +539,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", - "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.2.tgz", + "integrity": "sha512-90r3nTBLgdIgD4FCVV9+cR6Hq2Dzs319icVsln+NTmTVwffWcCqXGml8rAoocHuJ85kZK36DCteii96ba/PX8g==", "cpu": [ "x64" ], @@ -555,9 +555,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", - "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.2.tgz", + "integrity": "sha512-sNndlsBT8OeE/MZDSGpRDJlWuhjuUz/dn80nH0EP4ZzDUYvMDVa7G87DVpweBrn4xdJYyXS/y4CQNrf7R2ODXg==", "cpu": [ "arm64" ], @@ -571,9 +571,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", - "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.2.tgz", + "integrity": "sha512-Ti2QChGNFzWhUNNVuU4w21YkYTErsNh3h+CzvlEhzgRbwsJ7TrWQqRzW3bllLKKvTppuF3DJ3XP1GEg11AfrEQ==", "cpu": [ "ia32" ], @@ -587,9 +587,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", - "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.2.tgz", + "integrity": "sha512-VEfTCZicoZnZ6sGkjFPGRFFJuL2fZn2bLhsekZl1CJslflp2cJS/VoKs1jMk+3pDfsGW6CfQVUckP707HwbXeQ==", "cpu": [ "x64" ], @@ -1248,9 +1248,9 @@ } }, "node_modules/esbuild": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", - "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.2.tgz", + "integrity": "sha512-LmHPAa5h4tSxz+g/D8IHY6wCjtIiFx8I7/Q0Aq+NmvtoYvyMnJU0KQJcqB6QH30X9x/W4CemgUtPgQDZFca5SA==", "dev": true, "hasInstallScript": true, "bin": { @@ -1260,29 +1260,29 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.20.2", - "@esbuild/android-arm": "0.20.2", - "@esbuild/android-arm64": "0.20.2", - "@esbuild/android-x64": "0.20.2", - "@esbuild/darwin-arm64": "0.20.2", - "@esbuild/darwin-x64": "0.20.2", - "@esbuild/freebsd-arm64": "0.20.2", - "@esbuild/freebsd-x64": "0.20.2", - "@esbuild/linux-arm": "0.20.2", - "@esbuild/linux-arm64": "0.20.2", - "@esbuild/linux-ia32": "0.20.2", - "@esbuild/linux-loong64": "0.20.2", - "@esbuild/linux-mips64el": "0.20.2", - "@esbuild/linux-ppc64": "0.20.2", - "@esbuild/linux-riscv64": "0.20.2", - "@esbuild/linux-s390x": "0.20.2", - "@esbuild/linux-x64": "0.20.2", - "@esbuild/netbsd-x64": "0.20.2", - "@esbuild/openbsd-x64": "0.20.2", - "@esbuild/sunos-x64": "0.20.2", - "@esbuild/win32-arm64": "0.20.2", - "@esbuild/win32-ia32": "0.20.2", - "@esbuild/win32-x64": "0.20.2" + "@esbuild/aix-ppc64": "0.21.2", + "@esbuild/android-arm": "0.21.2", + "@esbuild/android-arm64": "0.21.2", + "@esbuild/android-x64": "0.21.2", + "@esbuild/darwin-arm64": "0.21.2", + "@esbuild/darwin-x64": "0.21.2", + "@esbuild/freebsd-arm64": "0.21.2", + "@esbuild/freebsd-x64": "0.21.2", + "@esbuild/linux-arm": "0.21.2", + "@esbuild/linux-arm64": "0.21.2", + "@esbuild/linux-ia32": "0.21.2", + "@esbuild/linux-loong64": "0.21.2", + "@esbuild/linux-mips64el": "0.21.2", + "@esbuild/linux-ppc64": "0.21.2", + "@esbuild/linux-riscv64": "0.21.2", + "@esbuild/linux-s390x": "0.21.2", + "@esbuild/linux-x64": "0.21.2", + "@esbuild/netbsd-x64": "0.21.2", + "@esbuild/openbsd-x64": "0.21.2", + "@esbuild/sunos-x64": "0.21.2", + "@esbuild/win32-arm64": "0.21.2", + "@esbuild/win32-ia32": "0.21.2", + "@esbuild/win32-x64": "0.21.2" } }, "node_modules/escape-string-regexp": { @@ -2940,163 +2940,163 @@ } }, "@esbuild/aix-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", - "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.2.tgz", + "integrity": "sha512-/c7hocx0pm14bHQlqUVKmxwdT/e5/KkyoY1W8F9lk/8CkE037STDDz8PXUP/LE6faj2HqchvDs9GcShxFhI78Q==", "dev": true, "optional": true }, "@esbuild/android-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", - "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.2.tgz", + "integrity": "sha512-G1ve3b4FeyJeyCjB4MX1CiWyTaIJwT9wAYE+8+IRA53YoN/reC/Bf2GDRXAzDTnh69Fpl+1uIKg76DiB3U6vwQ==", "dev": true, "optional": true }, "@esbuild/android-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", - "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.2.tgz", + "integrity": "sha512-SGZKngoTWVUriO5bDjI4WDGsNx2VKZoXcds+ita/kVYB+8IkSCKDRDaK+5yu0b5S0eq6B3S7fpiEvpsa2ammlQ==", "dev": true, "optional": true }, "@esbuild/android-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", - "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.2.tgz", + "integrity": "sha512-1wzzNoj2QtNkAYwIcWJ66UTRA80+RTQ/kuPMtEuP0X6dp5Ar23Dn566q3aV61h4EYrrgGlOgl/HdcqN/2S/2vg==", "dev": true, "optional": true }, "@esbuild/darwin-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", - "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.2.tgz", + "integrity": "sha512-ZyMkPWc5eTROcLOA10lEqdDSTc6ds6nuh3DeHgKip/XJrYjZDfnkCVSty8svWdy+SC1f77ULtVeIqymTzaB6/Q==", "dev": true, "optional": true }, "@esbuild/darwin-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", - "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.2.tgz", + "integrity": "sha512-K4ZdVq1zP9v51h/cKVna7im7G0zGTKKB6bP2yJiSmHjjOykbd8DdhrSi8V978sF69rkwrn8zCyL2t6I3ei6j9A==", "dev": true, "optional": true }, "@esbuild/freebsd-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", - "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.2.tgz", + "integrity": "sha512-4kbOGdpA61CXqadD+Gb/Pw3YXamQGiz9mal/h93rFVSjr5cgMnmJd/gbfPRm+3BMifvnaOfS1gNWaIDxkE2A3A==", "dev": true, "optional": true }, "@esbuild/freebsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", - "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.2.tgz", + "integrity": "sha512-ShS+R09nuHzDBfPeMUliKZX27Wrmr8UFp93aFf/S8p+++x5BZ+D344CLKXxmY6qzgTL3mILSImPCNJOzD6+RRg==", "dev": true, "optional": true }, "@esbuild/linux-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", - "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.2.tgz", + "integrity": "sha512-nnGXjOAv+7cM3LYRx4tJsYdgy8dGDGkAzF06oIDGppWbUkUKN9SmgQA8H0KukpU0Pjrj9XmgbWqMVSX/U7eeTA==", "dev": true, "optional": true }, "@esbuild/linux-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", - "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.2.tgz", + "integrity": "sha512-Hdu8BL+AmO+eCDvvT6kz/fPQhvuHL8YK4ExKZfANWsNe1kFGOHw7VJvS/FKSLFqheXmB3rTF3xFQIgUWPYsGnA==", "dev": true, "optional": true }, "@esbuild/linux-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", - "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.2.tgz", + "integrity": "sha512-m73BOCW2V9lcj7RtEMi+gBfHC6n3+VHpwQXP5offtQMPLDkpVolYn1YGXxOZ9hp4h3UPRKuezL7WkBsw+3EB3Q==", "dev": true, "optional": true }, "@esbuild/linux-loong64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", - "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.2.tgz", + "integrity": "sha512-84eYHwwWHq3myIY/6ikALMcnwkf6Qo7NIq++xH0x+cJuUNpdwh8mlpUtRY+JiGUc60yu7ElWBbVHGWTABTclGw==", "dev": true, "optional": true }, "@esbuild/linux-mips64el": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", - "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.2.tgz", + "integrity": "sha512-9siSZngT0/ZKG+AH+/agwKF29LdCxw4ODi/PiE0F52B2rtLozlDP92umf8G2GPoVV611LN4pZ+nSTckebOscUA==", "dev": true, "optional": true }, "@esbuild/linux-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", - "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.2.tgz", + "integrity": "sha512-y0T4aV2CA+ic04ULya1A/8M2RDpDSK2ckgTj6jzHKFJvCq0jQg8afQQIn4EM0G8u2neyOiNHgSF9YKPfuqKOVw==", "dev": true, "optional": true }, "@esbuild/linux-riscv64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", - "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.2.tgz", + "integrity": "sha512-x5ssCdXmZC86L2Li1qQPF/VaC4VP20u/Zm8jlAu9IiVOVi79YsSz6cpPDYZl1rfKSHYCJW9XBfFCo66S5gVPSA==", "dev": true, "optional": true }, "@esbuild/linux-s390x": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", - "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.2.tgz", + "integrity": "sha512-NP7fTpGSFWdXyvp8iAFU04uFh9ARoplFVM/m+8lTRpaYG+2ytHPZWyscSsMM6cvObSIK2KoPHXiZD4l99WaxbQ==", "dev": true, "optional": true }, "@esbuild/linux-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", - "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.2.tgz", + "integrity": "sha512-giZ/uOxWDKda44ZuyfKbykeXznfuVNkTgXOUOPJIjbayJV6FRpQ4zxUy9JMBPLaK9IJcdWtaoeQrYBMh3Rr4vQ==", "dev": true, "optional": true }, "@esbuild/netbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", - "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.2.tgz", + "integrity": "sha512-IeFMfGFSQfIj1d4XU+6lkbFzMR+mFELUUVYrZ+jvWzG4NGvs6o53ReEHLHpYkjRbdEjJy2W3lTekTxrFHW7YJg==", "dev": true, "optional": true }, "@esbuild/openbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", - "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.2.tgz", + "integrity": "sha512-48QhWD6WxcebNNaE4FCwgvQVUnAycuTd+BdvA/oZu+/MmbpU8pY2dMEYlYzj5uNHWIG5jvdDmFXu0naQeOWUoA==", "dev": true, "optional": true }, "@esbuild/sunos-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", - "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.2.tgz", + "integrity": "sha512-90r3nTBLgdIgD4FCVV9+cR6Hq2Dzs319icVsln+NTmTVwffWcCqXGml8rAoocHuJ85kZK36DCteii96ba/PX8g==", "dev": true, "optional": true }, "@esbuild/win32-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", - "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.2.tgz", + "integrity": "sha512-sNndlsBT8OeE/MZDSGpRDJlWuhjuUz/dn80nH0EP4ZzDUYvMDVa7G87DVpweBrn4xdJYyXS/y4CQNrf7R2ODXg==", "dev": true, "optional": true }, "@esbuild/win32-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", - "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.2.tgz", + "integrity": "sha512-Ti2QChGNFzWhUNNVuU4w21YkYTErsNh3h+CzvlEhzgRbwsJ7TrWQqRzW3bllLKKvTppuF3DJ3XP1GEg11AfrEQ==", "dev": true, "optional": true }, "@esbuild/win32-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", - "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.2.tgz", + "integrity": "sha512-VEfTCZicoZnZ6sGkjFPGRFFJuL2fZn2bLhsekZl1CJslflp2cJS/VoKs1jMk+3pDfsGW6CfQVUckP707HwbXeQ==", "dev": true, "optional": true }, @@ -3595,34 +3595,34 @@ "dev": true }, "esbuild": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", - "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.2.tgz", + "integrity": "sha512-LmHPAa5h4tSxz+g/D8IHY6wCjtIiFx8I7/Q0Aq+NmvtoYvyMnJU0KQJcqB6QH30X9x/W4CemgUtPgQDZFca5SA==", "dev": true, "requires": { - "@esbuild/aix-ppc64": "0.20.2", - "@esbuild/android-arm": "0.20.2", - "@esbuild/android-arm64": "0.20.2", - "@esbuild/android-x64": "0.20.2", - "@esbuild/darwin-arm64": "0.20.2", - "@esbuild/darwin-x64": "0.20.2", - "@esbuild/freebsd-arm64": "0.20.2", - "@esbuild/freebsd-x64": "0.20.2", - "@esbuild/linux-arm": "0.20.2", - "@esbuild/linux-arm64": "0.20.2", - "@esbuild/linux-ia32": "0.20.2", - "@esbuild/linux-loong64": "0.20.2", - "@esbuild/linux-mips64el": "0.20.2", - "@esbuild/linux-ppc64": "0.20.2", - "@esbuild/linux-riscv64": "0.20.2", - "@esbuild/linux-s390x": "0.20.2", - "@esbuild/linux-x64": "0.20.2", - "@esbuild/netbsd-x64": "0.20.2", - "@esbuild/openbsd-x64": "0.20.2", - "@esbuild/sunos-x64": "0.20.2", - "@esbuild/win32-arm64": "0.20.2", - "@esbuild/win32-ia32": "0.20.2", - "@esbuild/win32-x64": "0.20.2" + "@esbuild/aix-ppc64": "0.21.2", + "@esbuild/android-arm": "0.21.2", + "@esbuild/android-arm64": "0.21.2", + "@esbuild/android-x64": "0.21.2", + "@esbuild/darwin-arm64": "0.21.2", + "@esbuild/darwin-x64": "0.21.2", + "@esbuild/freebsd-arm64": "0.21.2", + "@esbuild/freebsd-x64": "0.21.2", + "@esbuild/linux-arm": "0.21.2", + "@esbuild/linux-arm64": "0.21.2", + "@esbuild/linux-ia32": "0.21.2", + "@esbuild/linux-loong64": "0.21.2", + "@esbuild/linux-mips64el": "0.21.2", + "@esbuild/linux-ppc64": "0.21.2", + "@esbuild/linux-riscv64": "0.21.2", + "@esbuild/linux-s390x": "0.21.2", + "@esbuild/linux-x64": "0.21.2", + "@esbuild/netbsd-x64": "0.21.2", + "@esbuild/openbsd-x64": "0.21.2", + "@esbuild/sunos-x64": "0.21.2", + "@esbuild/win32-arm64": "0.21.2", + "@esbuild/win32-ia32": "0.21.2", + "@esbuild/win32-x64": "0.21.2" } }, "escape-string-regexp": { diff --git a/code/package.json b/code/package.json index 62a76059c..23c00df86 100644 --- a/code/package.json +++ b/code/package.json @@ -39,7 +39,7 @@ "@types/node": "^18", "@types/vscode": "1.78.0", "@vscode/vsce": "^2.26.1", - "esbuild": "^0.20.2", + "esbuild": "^0.21.2", "ovsx": "^0.9.1", "typescript": "^5.4.5" }, From dd04d3a2ef16b33ec272fdc7c234b56d549ea9a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 14:15:41 +0000 Subject: [PATCH 34/60] build(deps-dev): bump esbuild from 0.21.2 to 0.21.3 in /code Bumps [esbuild](https://github.com/evanw/esbuild) from 0.21.2 to 0.21.3. - [Release notes](https://github.com/evanw/esbuild/releases) - [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md) - [Commits](https://github.com/evanw/esbuild/compare/v0.21.2...v0.21.3) --- updated-dependencies: - dependency-name: esbuild dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- code/package-lock.json | 382 ++++++++++++++++++++--------------------- code/package.json | 2 +- 2 files changed, 192 insertions(+), 192 deletions(-) diff --git a/code/package-lock.json b/code/package-lock.json index 287f82e8b..9d73805ef 100644 --- a/code/package-lock.json +++ b/code/package-lock.json @@ -18,7 +18,7 @@ "@types/node": "^18", "@types/vscode": "1.78.0", "@vscode/vsce": "^2.26.1", - "esbuild": "^0.21.2", + "esbuild": "^0.21.3", "ovsx": "^0.9.1", "typescript": "^5.4.5" }, @@ -235,9 +235,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.2.tgz", - "integrity": "sha512-/c7hocx0pm14bHQlqUVKmxwdT/e5/KkyoY1W8F9lk/8CkE037STDDz8PXUP/LE6faj2HqchvDs9GcShxFhI78Q==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.3.tgz", + "integrity": "sha512-yTgnwQpFVYfvvo4SvRFB0SwrW8YjOxEoT7wfMT7Ol5v7v5LDNvSGo67aExmxOb87nQNeWPVvaGBNfQ7BXcrZ9w==", "cpu": [ "ppc64" ], @@ -251,9 +251,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.2.tgz", - "integrity": "sha512-G1ve3b4FeyJeyCjB4MX1CiWyTaIJwT9wAYE+8+IRA53YoN/reC/Bf2GDRXAzDTnh69Fpl+1uIKg76DiB3U6vwQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.3.tgz", + "integrity": "sha512-bviJOLMgurLJtF1/mAoJLxDZDL6oU5/ztMHnJQRejbJrSc9FFu0QoUoFhvi6qSKJEw9y5oGyvr9fuDtzJ30rNQ==", "cpu": [ "arm" ], @@ -267,9 +267,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.2.tgz", - "integrity": "sha512-SGZKngoTWVUriO5bDjI4WDGsNx2VKZoXcds+ita/kVYB+8IkSCKDRDaK+5yu0b5S0eq6B3S7fpiEvpsa2ammlQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.3.tgz", + "integrity": "sha512-c+ty9necz3zB1Y+d/N+mC6KVVkGUUOcm4ZmT5i/Fk5arOaY3i6CA3P5wo/7+XzV8cb4GrI/Zjp8NuOQ9Lfsosw==", "cpu": [ "arm64" ], @@ -283,9 +283,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.2.tgz", - "integrity": "sha512-1wzzNoj2QtNkAYwIcWJ66UTRA80+RTQ/kuPMtEuP0X6dp5Ar23Dn566q3aV61h4EYrrgGlOgl/HdcqN/2S/2vg==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.3.tgz", + "integrity": "sha512-JReHfYCRK3FVX4Ra+y5EBH1b9e16TV2OxrPAvzMsGeES0X2Ndm9ImQRI4Ket757vhc5XBOuGperw63upesclRw==", "cpu": [ "x64" ], @@ -299,9 +299,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.2.tgz", - "integrity": "sha512-ZyMkPWc5eTROcLOA10lEqdDSTc6ds6nuh3DeHgKip/XJrYjZDfnkCVSty8svWdy+SC1f77ULtVeIqymTzaB6/Q==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.3.tgz", + "integrity": "sha512-U3fuQ0xNiAkXOmQ6w5dKpEvXQRSpHOnbw7gEfHCRXPeTKW9sBzVck6C5Yneb8LfJm0l6le4NQfkNPnWMSlTFUQ==", "cpu": [ "arm64" ], @@ -315,9 +315,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.2.tgz", - "integrity": "sha512-K4ZdVq1zP9v51h/cKVna7im7G0zGTKKB6bP2yJiSmHjjOykbd8DdhrSi8V978sF69rkwrn8zCyL2t6I3ei6j9A==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.3.tgz", + "integrity": "sha512-3m1CEB7F07s19wmaMNI2KANLcnaqryJxO1fXHUV5j1rWn+wMxdUYoPyO2TnAbfRZdi7ADRwJClmOwgT13qlP3Q==", "cpu": [ "x64" ], @@ -331,9 +331,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.2.tgz", - "integrity": "sha512-4kbOGdpA61CXqadD+Gb/Pw3YXamQGiz9mal/h93rFVSjr5cgMnmJd/gbfPRm+3BMifvnaOfS1gNWaIDxkE2A3A==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.3.tgz", + "integrity": "sha512-fsNAAl5pU6wmKHq91cHWQT0Fz0vtyE1JauMzKotrwqIKAswwP5cpHUCxZNSTuA/JlqtScq20/5KZ+TxQdovU/g==", "cpu": [ "arm64" ], @@ -347,9 +347,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.2.tgz", - "integrity": "sha512-ShS+R09nuHzDBfPeMUliKZX27Wrmr8UFp93aFf/S8p+++x5BZ+D344CLKXxmY6qzgTL3mILSImPCNJOzD6+RRg==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.3.tgz", + "integrity": "sha512-tci+UJ4zP5EGF4rp8XlZIdq1q1a/1h9XuronfxTMCNBslpCtmk97Q/5qqy1Mu4zIc0yswN/yP/BLX+NTUC1bXA==", "cpu": [ "x64" ], @@ -363,9 +363,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.2.tgz", - "integrity": "sha512-nnGXjOAv+7cM3LYRx4tJsYdgy8dGDGkAzF06oIDGppWbUkUKN9SmgQA8H0KukpU0Pjrj9XmgbWqMVSX/U7eeTA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.3.tgz", + "integrity": "sha512-f6kz2QpSuyHHg01cDawj0vkyMwuIvN62UAguQfnNVzbge2uWLhA7TCXOn83DT0ZvyJmBI943MItgTovUob36SQ==", "cpu": [ "arm" ], @@ -379,9 +379,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.2.tgz", - "integrity": "sha512-Hdu8BL+AmO+eCDvvT6kz/fPQhvuHL8YK4ExKZfANWsNe1kFGOHw7VJvS/FKSLFqheXmB3rTF3xFQIgUWPYsGnA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.3.tgz", + "integrity": "sha512-vvG6R5g5ieB4eCJBQevyDMb31LMHthLpXTc2IGkFnPWS/GzIFDnaYFp558O+XybTmYrVjxnryru7QRleJvmZ6Q==", "cpu": [ "arm64" ], @@ -395,9 +395,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.2.tgz", - "integrity": "sha512-m73BOCW2V9lcj7RtEMi+gBfHC6n3+VHpwQXP5offtQMPLDkpVolYn1YGXxOZ9hp4h3UPRKuezL7WkBsw+3EB3Q==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.3.tgz", + "integrity": "sha512-HjCWhH7K96Na+66TacDLJmOI9R8iDWDDiqe17C7znGvvE4sW1ECt9ly0AJ3dJH62jHyVqW9xpxZEU1jKdt+29A==", "cpu": [ "ia32" ], @@ -411,9 +411,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.2.tgz", - "integrity": "sha512-84eYHwwWHq3myIY/6ikALMcnwkf6Qo7NIq++xH0x+cJuUNpdwh8mlpUtRY+JiGUc60yu7ElWBbVHGWTABTclGw==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.3.tgz", + "integrity": "sha512-BGpimEccmHBZRcAhdlRIxMp7x9PyJxUtj7apL2IuoG9VxvU/l/v1z015nFs7Si7tXUwEsvjc1rOJdZCn4QTU+Q==", "cpu": [ "loong64" ], @@ -427,9 +427,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.2.tgz", - "integrity": "sha512-9siSZngT0/ZKG+AH+/agwKF29LdCxw4ODi/PiE0F52B2rtLozlDP92umf8G2GPoVV611LN4pZ+nSTckebOscUA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.3.tgz", + "integrity": "sha512-5rMOWkp7FQGtAH3QJddP4w3s47iT20hwftqdm7b+loe95o8JU8ro3qZbhgMRy0VuFU0DizymF1pBKkn3YHWtsw==", "cpu": [ "mips64el" ], @@ -443,9 +443,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.2.tgz", - "integrity": "sha512-y0T4aV2CA+ic04ULya1A/8M2RDpDSK2ckgTj6jzHKFJvCq0jQg8afQQIn4EM0G8u2neyOiNHgSF9YKPfuqKOVw==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.3.tgz", + "integrity": "sha512-h0zj1ldel89V5sjPLo5H1SyMzp4VrgN1tPkN29TmjvO1/r0MuMRwJxL8QY05SmfsZRs6TF0c/IDH3u7XYYmbAg==", "cpu": [ "ppc64" ], @@ -459,9 +459,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.2.tgz", - "integrity": "sha512-x5ssCdXmZC86L2Li1qQPF/VaC4VP20u/Zm8jlAu9IiVOVi79YsSz6cpPDYZl1rfKSHYCJW9XBfFCo66S5gVPSA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.3.tgz", + "integrity": "sha512-dkAKcTsTJ+CRX6bnO17qDJbLoW37npd5gSNtSzjYQr0svghLJYGYB0NF1SNcU1vDcjXLYS5pO4qOW4YbFama4A==", "cpu": [ "riscv64" ], @@ -475,9 +475,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.2.tgz", - "integrity": "sha512-NP7fTpGSFWdXyvp8iAFU04uFh9ARoplFVM/m+8lTRpaYG+2ytHPZWyscSsMM6cvObSIK2KoPHXiZD4l99WaxbQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.3.tgz", + "integrity": "sha512-vnD1YUkovEdnZWEuMmy2X2JmzsHQqPpZElXx6dxENcIwTu+Cu5ERax6+Ke1QsE814Zf3c6rxCfwQdCTQ7tPuXA==", "cpu": [ "s390x" ], @@ -491,9 +491,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.2.tgz", - "integrity": "sha512-giZ/uOxWDKda44ZuyfKbykeXznfuVNkTgXOUOPJIjbayJV6FRpQ4zxUy9JMBPLaK9IJcdWtaoeQrYBMh3Rr4vQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.3.tgz", + "integrity": "sha512-IOXOIm9WaK7plL2gMhsWJd+l2bfrhfilv0uPTptoRoSb2p09RghhQQp9YY6ZJhk/kqmeRt6siRdMSLLwzuT0KQ==", "cpu": [ "x64" ], @@ -507,9 +507,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.2.tgz", - "integrity": "sha512-IeFMfGFSQfIj1d4XU+6lkbFzMR+mFELUUVYrZ+jvWzG4NGvs6o53ReEHLHpYkjRbdEjJy2W3lTekTxrFHW7YJg==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.3.tgz", + "integrity": "sha512-uTgCwsvQ5+vCQnqM//EfDSuomo2LhdWhFPS8VL8xKf+PKTCrcT/2kPPoWMTs22aB63MLdGMJiE3f1PHvCDmUOw==", "cpu": [ "x64" ], @@ -523,9 +523,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.2.tgz", - "integrity": "sha512-48QhWD6WxcebNNaE4FCwgvQVUnAycuTd+BdvA/oZu+/MmbpU8pY2dMEYlYzj5uNHWIG5jvdDmFXu0naQeOWUoA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.3.tgz", + "integrity": "sha512-vNAkR17Ub2MgEud2Wag/OE4HTSI6zlb291UYzHez/psiKarp0J8PKGDnAhMBcHFoOHMXHfExzmjMojJNbAStrQ==", "cpu": [ "x64" ], @@ -539,9 +539,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.2.tgz", - "integrity": "sha512-90r3nTBLgdIgD4FCVV9+cR6Hq2Dzs319icVsln+NTmTVwffWcCqXGml8rAoocHuJ85kZK36DCteii96ba/PX8g==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.3.tgz", + "integrity": "sha512-W8H9jlGiSBomkgmouaRoTXo49j4w4Kfbl6I1bIdO/vT0+0u4f20ko3ELzV3hPI6XV6JNBVX+8BC+ajHkvffIJA==", "cpu": [ "x64" ], @@ -555,9 +555,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.2.tgz", - "integrity": "sha512-sNndlsBT8OeE/MZDSGpRDJlWuhjuUz/dn80nH0EP4ZzDUYvMDVa7G87DVpweBrn4xdJYyXS/y4CQNrf7R2ODXg==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.3.tgz", + "integrity": "sha512-EjEomwyLSCg8Ag3LDILIqYCZAq/y3diJ04PnqGRgq8/4O3VNlXyMd54j/saShaN4h5o5mivOjAzmU6C3X4v0xw==", "cpu": [ "arm64" ], @@ -571,9 +571,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.2.tgz", - "integrity": "sha512-Ti2QChGNFzWhUNNVuU4w21YkYTErsNh3h+CzvlEhzgRbwsJ7TrWQqRzW3bllLKKvTppuF3DJ3XP1GEg11AfrEQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.3.tgz", + "integrity": "sha512-WGiE/GgbsEwR33++5rzjiYsKyHywE8QSZPF7Rfx9EBfK3Qn3xyR6IjyCr5Uk38Kg8fG4/2phN7sXp4NPWd3fcw==", "cpu": [ "ia32" ], @@ -587,9 +587,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.2.tgz", - "integrity": "sha512-VEfTCZicoZnZ6sGkjFPGRFFJuL2fZn2bLhsekZl1CJslflp2cJS/VoKs1jMk+3pDfsGW6CfQVUckP707HwbXeQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.3.tgz", + "integrity": "sha512-xRxC0jaJWDLYvcUvjQmHCJSfMrgmUuvsoXgDeU/wTorQ1ngDdUBuFtgY3W1Pc5sprGAvZBtWdJX7RPg/iZZUqA==", "cpu": [ "x64" ], @@ -1248,9 +1248,9 @@ } }, "node_modules/esbuild": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.2.tgz", - "integrity": "sha512-LmHPAa5h4tSxz+g/D8IHY6wCjtIiFx8I7/Q0Aq+NmvtoYvyMnJU0KQJcqB6QH30X9x/W4CemgUtPgQDZFca5SA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.3.tgz", + "integrity": "sha512-Kgq0/ZsAPzKrbOjCQcjoSmPoWhlcVnGAUo7jvaLHoxW1Drto0KGkR1xBNg2Cp43b9ImvxmPEJZ9xkfcnqPsfBw==", "dev": true, "hasInstallScript": true, "bin": { @@ -1260,29 +1260,29 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.2", - "@esbuild/android-arm": "0.21.2", - "@esbuild/android-arm64": "0.21.2", - "@esbuild/android-x64": "0.21.2", - "@esbuild/darwin-arm64": "0.21.2", - "@esbuild/darwin-x64": "0.21.2", - "@esbuild/freebsd-arm64": "0.21.2", - "@esbuild/freebsd-x64": "0.21.2", - "@esbuild/linux-arm": "0.21.2", - "@esbuild/linux-arm64": "0.21.2", - "@esbuild/linux-ia32": "0.21.2", - "@esbuild/linux-loong64": "0.21.2", - "@esbuild/linux-mips64el": "0.21.2", - "@esbuild/linux-ppc64": "0.21.2", - "@esbuild/linux-riscv64": "0.21.2", - "@esbuild/linux-s390x": "0.21.2", - "@esbuild/linux-x64": "0.21.2", - "@esbuild/netbsd-x64": "0.21.2", - "@esbuild/openbsd-x64": "0.21.2", - "@esbuild/sunos-x64": "0.21.2", - "@esbuild/win32-arm64": "0.21.2", - "@esbuild/win32-ia32": "0.21.2", - "@esbuild/win32-x64": "0.21.2" + "@esbuild/aix-ppc64": "0.21.3", + "@esbuild/android-arm": "0.21.3", + "@esbuild/android-arm64": "0.21.3", + "@esbuild/android-x64": "0.21.3", + "@esbuild/darwin-arm64": "0.21.3", + "@esbuild/darwin-x64": "0.21.3", + "@esbuild/freebsd-arm64": "0.21.3", + "@esbuild/freebsd-x64": "0.21.3", + "@esbuild/linux-arm": "0.21.3", + "@esbuild/linux-arm64": "0.21.3", + "@esbuild/linux-ia32": "0.21.3", + "@esbuild/linux-loong64": "0.21.3", + "@esbuild/linux-mips64el": "0.21.3", + "@esbuild/linux-ppc64": "0.21.3", + "@esbuild/linux-riscv64": "0.21.3", + "@esbuild/linux-s390x": "0.21.3", + "@esbuild/linux-x64": "0.21.3", + "@esbuild/netbsd-x64": "0.21.3", + "@esbuild/openbsd-x64": "0.21.3", + "@esbuild/sunos-x64": "0.21.3", + "@esbuild/win32-arm64": "0.21.3", + "@esbuild/win32-ia32": "0.21.3", + "@esbuild/win32-x64": "0.21.3" } }, "node_modules/escape-string-regexp": { @@ -2940,163 +2940,163 @@ } }, "@esbuild/aix-ppc64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.2.tgz", - "integrity": "sha512-/c7hocx0pm14bHQlqUVKmxwdT/e5/KkyoY1W8F9lk/8CkE037STDDz8PXUP/LE6faj2HqchvDs9GcShxFhI78Q==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.3.tgz", + "integrity": "sha512-yTgnwQpFVYfvvo4SvRFB0SwrW8YjOxEoT7wfMT7Ol5v7v5LDNvSGo67aExmxOb87nQNeWPVvaGBNfQ7BXcrZ9w==", "dev": true, "optional": true }, "@esbuild/android-arm": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.2.tgz", - "integrity": "sha512-G1ve3b4FeyJeyCjB4MX1CiWyTaIJwT9wAYE+8+IRA53YoN/reC/Bf2GDRXAzDTnh69Fpl+1uIKg76DiB3U6vwQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.3.tgz", + "integrity": "sha512-bviJOLMgurLJtF1/mAoJLxDZDL6oU5/ztMHnJQRejbJrSc9FFu0QoUoFhvi6qSKJEw9y5oGyvr9fuDtzJ30rNQ==", "dev": true, "optional": true }, "@esbuild/android-arm64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.2.tgz", - "integrity": "sha512-SGZKngoTWVUriO5bDjI4WDGsNx2VKZoXcds+ita/kVYB+8IkSCKDRDaK+5yu0b5S0eq6B3S7fpiEvpsa2ammlQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.3.tgz", + "integrity": "sha512-c+ty9necz3zB1Y+d/N+mC6KVVkGUUOcm4ZmT5i/Fk5arOaY3i6CA3P5wo/7+XzV8cb4GrI/Zjp8NuOQ9Lfsosw==", "dev": true, "optional": true }, "@esbuild/android-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.2.tgz", - "integrity": "sha512-1wzzNoj2QtNkAYwIcWJ66UTRA80+RTQ/kuPMtEuP0X6dp5Ar23Dn566q3aV61h4EYrrgGlOgl/HdcqN/2S/2vg==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.3.tgz", + "integrity": "sha512-JReHfYCRK3FVX4Ra+y5EBH1b9e16TV2OxrPAvzMsGeES0X2Ndm9ImQRI4Ket757vhc5XBOuGperw63upesclRw==", "dev": true, "optional": true }, "@esbuild/darwin-arm64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.2.tgz", - "integrity": "sha512-ZyMkPWc5eTROcLOA10lEqdDSTc6ds6nuh3DeHgKip/XJrYjZDfnkCVSty8svWdy+SC1f77ULtVeIqymTzaB6/Q==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.3.tgz", + "integrity": "sha512-U3fuQ0xNiAkXOmQ6w5dKpEvXQRSpHOnbw7gEfHCRXPeTKW9sBzVck6C5Yneb8LfJm0l6le4NQfkNPnWMSlTFUQ==", "dev": true, "optional": true }, "@esbuild/darwin-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.2.tgz", - "integrity": "sha512-K4ZdVq1zP9v51h/cKVna7im7G0zGTKKB6bP2yJiSmHjjOykbd8DdhrSi8V978sF69rkwrn8zCyL2t6I3ei6j9A==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.3.tgz", + "integrity": "sha512-3m1CEB7F07s19wmaMNI2KANLcnaqryJxO1fXHUV5j1rWn+wMxdUYoPyO2TnAbfRZdi7ADRwJClmOwgT13qlP3Q==", "dev": true, "optional": true }, "@esbuild/freebsd-arm64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.2.tgz", - "integrity": "sha512-4kbOGdpA61CXqadD+Gb/Pw3YXamQGiz9mal/h93rFVSjr5cgMnmJd/gbfPRm+3BMifvnaOfS1gNWaIDxkE2A3A==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.3.tgz", + "integrity": "sha512-fsNAAl5pU6wmKHq91cHWQT0Fz0vtyE1JauMzKotrwqIKAswwP5cpHUCxZNSTuA/JlqtScq20/5KZ+TxQdovU/g==", "dev": true, "optional": true }, "@esbuild/freebsd-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.2.tgz", - "integrity": "sha512-ShS+R09nuHzDBfPeMUliKZX27Wrmr8UFp93aFf/S8p+++x5BZ+D344CLKXxmY6qzgTL3mILSImPCNJOzD6+RRg==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.3.tgz", + "integrity": "sha512-tci+UJ4zP5EGF4rp8XlZIdq1q1a/1h9XuronfxTMCNBslpCtmk97Q/5qqy1Mu4zIc0yswN/yP/BLX+NTUC1bXA==", "dev": true, "optional": true }, "@esbuild/linux-arm": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.2.tgz", - "integrity": "sha512-nnGXjOAv+7cM3LYRx4tJsYdgy8dGDGkAzF06oIDGppWbUkUKN9SmgQA8H0KukpU0Pjrj9XmgbWqMVSX/U7eeTA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.3.tgz", + "integrity": "sha512-f6kz2QpSuyHHg01cDawj0vkyMwuIvN62UAguQfnNVzbge2uWLhA7TCXOn83DT0ZvyJmBI943MItgTovUob36SQ==", "dev": true, "optional": true }, "@esbuild/linux-arm64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.2.tgz", - "integrity": "sha512-Hdu8BL+AmO+eCDvvT6kz/fPQhvuHL8YK4ExKZfANWsNe1kFGOHw7VJvS/FKSLFqheXmB3rTF3xFQIgUWPYsGnA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.3.tgz", + "integrity": "sha512-vvG6R5g5ieB4eCJBQevyDMb31LMHthLpXTc2IGkFnPWS/GzIFDnaYFp558O+XybTmYrVjxnryru7QRleJvmZ6Q==", "dev": true, "optional": true }, "@esbuild/linux-ia32": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.2.tgz", - "integrity": "sha512-m73BOCW2V9lcj7RtEMi+gBfHC6n3+VHpwQXP5offtQMPLDkpVolYn1YGXxOZ9hp4h3UPRKuezL7WkBsw+3EB3Q==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.3.tgz", + "integrity": "sha512-HjCWhH7K96Na+66TacDLJmOI9R8iDWDDiqe17C7znGvvE4sW1ECt9ly0AJ3dJH62jHyVqW9xpxZEU1jKdt+29A==", "dev": true, "optional": true }, "@esbuild/linux-loong64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.2.tgz", - "integrity": "sha512-84eYHwwWHq3myIY/6ikALMcnwkf6Qo7NIq++xH0x+cJuUNpdwh8mlpUtRY+JiGUc60yu7ElWBbVHGWTABTclGw==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.3.tgz", + "integrity": "sha512-BGpimEccmHBZRcAhdlRIxMp7x9PyJxUtj7apL2IuoG9VxvU/l/v1z015nFs7Si7tXUwEsvjc1rOJdZCn4QTU+Q==", "dev": true, "optional": true }, "@esbuild/linux-mips64el": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.2.tgz", - "integrity": "sha512-9siSZngT0/ZKG+AH+/agwKF29LdCxw4ODi/PiE0F52B2rtLozlDP92umf8G2GPoVV611LN4pZ+nSTckebOscUA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.3.tgz", + "integrity": "sha512-5rMOWkp7FQGtAH3QJddP4w3s47iT20hwftqdm7b+loe95o8JU8ro3qZbhgMRy0VuFU0DizymF1pBKkn3YHWtsw==", "dev": true, "optional": true }, "@esbuild/linux-ppc64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.2.tgz", - "integrity": "sha512-y0T4aV2CA+ic04ULya1A/8M2RDpDSK2ckgTj6jzHKFJvCq0jQg8afQQIn4EM0G8u2neyOiNHgSF9YKPfuqKOVw==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.3.tgz", + "integrity": "sha512-h0zj1ldel89V5sjPLo5H1SyMzp4VrgN1tPkN29TmjvO1/r0MuMRwJxL8QY05SmfsZRs6TF0c/IDH3u7XYYmbAg==", "dev": true, "optional": true }, "@esbuild/linux-riscv64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.2.tgz", - "integrity": "sha512-x5ssCdXmZC86L2Li1qQPF/VaC4VP20u/Zm8jlAu9IiVOVi79YsSz6cpPDYZl1rfKSHYCJW9XBfFCo66S5gVPSA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.3.tgz", + "integrity": "sha512-dkAKcTsTJ+CRX6bnO17qDJbLoW37npd5gSNtSzjYQr0svghLJYGYB0NF1SNcU1vDcjXLYS5pO4qOW4YbFama4A==", "dev": true, "optional": true }, "@esbuild/linux-s390x": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.2.tgz", - "integrity": "sha512-NP7fTpGSFWdXyvp8iAFU04uFh9ARoplFVM/m+8lTRpaYG+2ytHPZWyscSsMM6cvObSIK2KoPHXiZD4l99WaxbQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.3.tgz", + "integrity": "sha512-vnD1YUkovEdnZWEuMmy2X2JmzsHQqPpZElXx6dxENcIwTu+Cu5ERax6+Ke1QsE814Zf3c6rxCfwQdCTQ7tPuXA==", "dev": true, "optional": true }, "@esbuild/linux-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.2.tgz", - "integrity": "sha512-giZ/uOxWDKda44ZuyfKbykeXznfuVNkTgXOUOPJIjbayJV6FRpQ4zxUy9JMBPLaK9IJcdWtaoeQrYBMh3Rr4vQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.3.tgz", + "integrity": "sha512-IOXOIm9WaK7plL2gMhsWJd+l2bfrhfilv0uPTptoRoSb2p09RghhQQp9YY6ZJhk/kqmeRt6siRdMSLLwzuT0KQ==", "dev": true, "optional": true }, "@esbuild/netbsd-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.2.tgz", - "integrity": "sha512-IeFMfGFSQfIj1d4XU+6lkbFzMR+mFELUUVYrZ+jvWzG4NGvs6o53ReEHLHpYkjRbdEjJy2W3lTekTxrFHW7YJg==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.3.tgz", + "integrity": "sha512-uTgCwsvQ5+vCQnqM//EfDSuomo2LhdWhFPS8VL8xKf+PKTCrcT/2kPPoWMTs22aB63MLdGMJiE3f1PHvCDmUOw==", "dev": true, "optional": true }, "@esbuild/openbsd-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.2.tgz", - "integrity": "sha512-48QhWD6WxcebNNaE4FCwgvQVUnAycuTd+BdvA/oZu+/MmbpU8pY2dMEYlYzj5uNHWIG5jvdDmFXu0naQeOWUoA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.3.tgz", + "integrity": "sha512-vNAkR17Ub2MgEud2Wag/OE4HTSI6zlb291UYzHez/psiKarp0J8PKGDnAhMBcHFoOHMXHfExzmjMojJNbAStrQ==", "dev": true, "optional": true }, "@esbuild/sunos-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.2.tgz", - "integrity": "sha512-90r3nTBLgdIgD4FCVV9+cR6Hq2Dzs319icVsln+NTmTVwffWcCqXGml8rAoocHuJ85kZK36DCteii96ba/PX8g==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.3.tgz", + "integrity": "sha512-W8H9jlGiSBomkgmouaRoTXo49j4w4Kfbl6I1bIdO/vT0+0u4f20ko3ELzV3hPI6XV6JNBVX+8BC+ajHkvffIJA==", "dev": true, "optional": true }, "@esbuild/win32-arm64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.2.tgz", - "integrity": "sha512-sNndlsBT8OeE/MZDSGpRDJlWuhjuUz/dn80nH0EP4ZzDUYvMDVa7G87DVpweBrn4xdJYyXS/y4CQNrf7R2ODXg==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.3.tgz", + "integrity": "sha512-EjEomwyLSCg8Ag3LDILIqYCZAq/y3diJ04PnqGRgq8/4O3VNlXyMd54j/saShaN4h5o5mivOjAzmU6C3X4v0xw==", "dev": true, "optional": true }, "@esbuild/win32-ia32": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.2.tgz", - "integrity": "sha512-Ti2QChGNFzWhUNNVuU4w21YkYTErsNh3h+CzvlEhzgRbwsJ7TrWQqRzW3bllLKKvTppuF3DJ3XP1GEg11AfrEQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.3.tgz", + "integrity": "sha512-WGiE/GgbsEwR33++5rzjiYsKyHywE8QSZPF7Rfx9EBfK3Qn3xyR6IjyCr5Uk38Kg8fG4/2phN7sXp4NPWd3fcw==", "dev": true, "optional": true }, "@esbuild/win32-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.2.tgz", - "integrity": "sha512-VEfTCZicoZnZ6sGkjFPGRFFJuL2fZn2bLhsekZl1CJslflp2cJS/VoKs1jMk+3pDfsGW6CfQVUckP707HwbXeQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.3.tgz", + "integrity": "sha512-xRxC0jaJWDLYvcUvjQmHCJSfMrgmUuvsoXgDeU/wTorQ1ngDdUBuFtgY3W1Pc5sprGAvZBtWdJX7RPg/iZZUqA==", "dev": true, "optional": true }, @@ -3595,34 +3595,34 @@ "dev": true }, "esbuild": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.2.tgz", - "integrity": "sha512-LmHPAa5h4tSxz+g/D8IHY6wCjtIiFx8I7/Q0Aq+NmvtoYvyMnJU0KQJcqB6QH30X9x/W4CemgUtPgQDZFca5SA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.3.tgz", + "integrity": "sha512-Kgq0/ZsAPzKrbOjCQcjoSmPoWhlcVnGAUo7jvaLHoxW1Drto0KGkR1xBNg2Cp43b9ImvxmPEJZ9xkfcnqPsfBw==", "dev": true, "requires": { - "@esbuild/aix-ppc64": "0.21.2", - "@esbuild/android-arm": "0.21.2", - "@esbuild/android-arm64": "0.21.2", - "@esbuild/android-x64": "0.21.2", - "@esbuild/darwin-arm64": "0.21.2", - "@esbuild/darwin-x64": "0.21.2", - "@esbuild/freebsd-arm64": "0.21.2", - "@esbuild/freebsd-x64": "0.21.2", - "@esbuild/linux-arm": "0.21.2", - "@esbuild/linux-arm64": "0.21.2", - "@esbuild/linux-ia32": "0.21.2", - "@esbuild/linux-loong64": "0.21.2", - "@esbuild/linux-mips64el": "0.21.2", - "@esbuild/linux-ppc64": "0.21.2", - "@esbuild/linux-riscv64": "0.21.2", - "@esbuild/linux-s390x": "0.21.2", - "@esbuild/linux-x64": "0.21.2", - "@esbuild/netbsd-x64": "0.21.2", - "@esbuild/openbsd-x64": "0.21.2", - "@esbuild/sunos-x64": "0.21.2", - "@esbuild/win32-arm64": "0.21.2", - "@esbuild/win32-ia32": "0.21.2", - "@esbuild/win32-x64": "0.21.2" + "@esbuild/aix-ppc64": "0.21.3", + "@esbuild/android-arm": "0.21.3", + "@esbuild/android-arm64": "0.21.3", + "@esbuild/android-x64": "0.21.3", + "@esbuild/darwin-arm64": "0.21.3", + "@esbuild/darwin-x64": "0.21.3", + "@esbuild/freebsd-arm64": "0.21.3", + "@esbuild/freebsd-x64": "0.21.3", + "@esbuild/linux-arm": "0.21.3", + "@esbuild/linux-arm64": "0.21.3", + "@esbuild/linux-ia32": "0.21.3", + "@esbuild/linux-loong64": "0.21.3", + "@esbuild/linux-mips64el": "0.21.3", + "@esbuild/linux-ppc64": "0.21.3", + "@esbuild/linux-riscv64": "0.21.3", + "@esbuild/linux-s390x": "0.21.3", + "@esbuild/linux-x64": "0.21.3", + "@esbuild/netbsd-x64": "0.21.3", + "@esbuild/openbsd-x64": "0.21.3", + "@esbuild/sunos-x64": "0.21.3", + "@esbuild/win32-arm64": "0.21.3", + "@esbuild/win32-ia32": "0.21.3", + "@esbuild/win32-x64": "0.21.3" } }, "escape-string-regexp": { diff --git a/code/package.json b/code/package.json index 23c00df86..e158503a8 100644 --- a/code/package.json +++ b/code/package.json @@ -39,7 +39,7 @@ "@types/node": "^18", "@types/vscode": "1.78.0", "@vscode/vsce": "^2.26.1", - "esbuild": "^0.21.2", + "esbuild": "^0.21.3", "ovsx": "^0.9.1", "typescript": "^5.4.5" }, From dc387562a12904d29dd93c23d019b1dc1105b8ea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 14:32:12 +0000 Subject: [PATCH 35/60] build(deps): bump platformdirs from 4.2.1 to 4.2.2 in /code Bumps [platformdirs](https://github.com/platformdirs/platformdirs) from 4.2.1 to 4.2.2. - [Release notes](https://github.com/platformdirs/platformdirs/releases) - [Changelog](https://github.com/platformdirs/platformdirs/blob/main/CHANGES.rst) - [Commits](https://github.com/platformdirs/platformdirs/compare/4.2.1...4.2.2) --- updated-dependencies: - dependency-name: platformdirs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- code/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/requirements.txt b/code/requirements.txt index 605a5505f..24d3a5fc5 100644 --- a/code/requirements.txt +++ b/code/requirements.txt @@ -32,9 +32,9 @@ lsprotocol==2023.0.1 \ --hash=sha256:c75223c9e4af2f24272b14c6375787438279369236cd568f596d4951052a60f2 \ --hash=sha256:cc5c15130d2403c18b734304339e51242d3018a05c4f7d0f198ad6e0cd21861d # via pygls -platformdirs==4.2.1 \ - --hash=sha256:031cd18d4ec63ec53e82dceaac0417d218a6863f7745dfcc9efe7793b7039bdf \ - --hash=sha256:17d5a1161b3fd67b390023cb2d3b026bbd40abde6fdb052dfbd3a29c3ba22ee1 +platformdirs==4.2.2 \ + --hash=sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee \ + --hash=sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3 # via -r requirements.in pygls==1.3.1 \ --hash=sha256:140edceefa0da0e9b3c533547c892a42a7d2fd9217ae848c330c53d266a55018 \ From e2c628f9d80902f91620fa009e392f15b8c2c9a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 14:59:34 +0000 Subject: [PATCH 36/60] build(deps-dev): bump esbuild from 0.21.3 to 0.21.4 in /code Bumps [esbuild](https://github.com/evanw/esbuild) from 0.21.3 to 0.21.4. - [Release notes](https://github.com/evanw/esbuild/releases) - [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md) - [Commits](https://github.com/evanw/esbuild/compare/v0.21.3...v0.21.4) --- updated-dependencies: - dependency-name: esbuild dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- code/package-lock.json | 382 ++++++++++++++++++++--------------------- code/package.json | 2 +- 2 files changed, 192 insertions(+), 192 deletions(-) diff --git a/code/package-lock.json b/code/package-lock.json index 9d73805ef..a6d203170 100644 --- a/code/package-lock.json +++ b/code/package-lock.json @@ -18,7 +18,7 @@ "@types/node": "^18", "@types/vscode": "1.78.0", "@vscode/vsce": "^2.26.1", - "esbuild": "^0.21.3", + "esbuild": "^0.21.4", "ovsx": "^0.9.1", "typescript": "^5.4.5" }, @@ -235,9 +235,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.3.tgz", - "integrity": "sha512-yTgnwQpFVYfvvo4SvRFB0SwrW8YjOxEoT7wfMT7Ol5v7v5LDNvSGo67aExmxOb87nQNeWPVvaGBNfQ7BXcrZ9w==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.4.tgz", + "integrity": "sha512-Zrm+B33R4LWPLjDEVnEqt2+SLTATlru1q/xYKVn8oVTbiRBGmK2VIMoIYGJDGyftnGaC788IuzGFAlb7IQ0Y8A==", "cpu": [ "ppc64" ], @@ -251,9 +251,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.3.tgz", - "integrity": "sha512-bviJOLMgurLJtF1/mAoJLxDZDL6oU5/ztMHnJQRejbJrSc9FFu0QoUoFhvi6qSKJEw9y5oGyvr9fuDtzJ30rNQ==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.4.tgz", + "integrity": "sha512-E7H/yTd8kGQfY4z9t3nRPk/hrhaCajfA3YSQSBrst8B+3uTcgsi8N+ZWYCaeIDsiVs6m65JPCaQN/DxBRclF3A==", "cpu": [ "arm" ], @@ -267,9 +267,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.3.tgz", - "integrity": "sha512-c+ty9necz3zB1Y+d/N+mC6KVVkGUUOcm4ZmT5i/Fk5arOaY3i6CA3P5wo/7+XzV8cb4GrI/Zjp8NuOQ9Lfsosw==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.4.tgz", + "integrity": "sha512-fYFnz+ObClJ3dNiITySBUx+oNalYUT18/AryMxfovLkYWbutXsct3Wz2ZWAcGGppp+RVVX5FiXeLYGi97umisA==", "cpu": [ "arm64" ], @@ -283,9 +283,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.3.tgz", - "integrity": "sha512-JReHfYCRK3FVX4Ra+y5EBH1b9e16TV2OxrPAvzMsGeES0X2Ndm9ImQRI4Ket757vhc5XBOuGperw63upesclRw==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.4.tgz", + "integrity": "sha512-mDqmlge3hFbEPbCWxp4fM6hqq7aZfLEHZAKGP9viq9wMUBVQx202aDIfc3l+d2cKhUJM741VrCXEzRFhPDKH3Q==", "cpu": [ "x64" ], @@ -299,9 +299,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.3.tgz", - "integrity": "sha512-U3fuQ0xNiAkXOmQ6w5dKpEvXQRSpHOnbw7gEfHCRXPeTKW9sBzVck6C5Yneb8LfJm0l6le4NQfkNPnWMSlTFUQ==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.4.tgz", + "integrity": "sha512-72eaIrDZDSiWqpmCzVaBD58c8ea8cw/U0fq/PPOTqE3c53D0xVMRt2ooIABZ6/wj99Y+h4ksT/+I+srCDLU9TA==", "cpu": [ "arm64" ], @@ -315,9 +315,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.3.tgz", - "integrity": "sha512-3m1CEB7F07s19wmaMNI2KANLcnaqryJxO1fXHUV5j1rWn+wMxdUYoPyO2TnAbfRZdi7ADRwJClmOwgT13qlP3Q==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.4.tgz", + "integrity": "sha512-uBsuwRMehGmw1JC7Vecu/upOjTsMhgahmDkWhGLWxIgUn2x/Y4tIwUZngsmVb6XyPSTXJYS4YiASKPcm9Zitag==", "cpu": [ "x64" ], @@ -331,9 +331,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.3.tgz", - "integrity": "sha512-fsNAAl5pU6wmKHq91cHWQT0Fz0vtyE1JauMzKotrwqIKAswwP5cpHUCxZNSTuA/JlqtScq20/5KZ+TxQdovU/g==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.4.tgz", + "integrity": "sha512-8JfuSC6YMSAEIZIWNL3GtdUT5NhUA/CMUCpZdDRolUXNAXEE/Vbpe6qlGLpfThtY5NwXq8Hi4nJy4YfPh+TwAg==", "cpu": [ "arm64" ], @@ -347,9 +347,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.3.tgz", - "integrity": "sha512-tci+UJ4zP5EGF4rp8XlZIdq1q1a/1h9XuronfxTMCNBslpCtmk97Q/5qqy1Mu4zIc0yswN/yP/BLX+NTUC1bXA==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.4.tgz", + "integrity": "sha512-8d9y9eQhxv4ef7JmXny7591P/PYsDFc4+STaxC1GBv0tMyCdyWfXu2jBuqRsyhY8uL2HU8uPyscgE2KxCY9imQ==", "cpu": [ "x64" ], @@ -363,9 +363,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.3.tgz", - "integrity": "sha512-f6kz2QpSuyHHg01cDawj0vkyMwuIvN62UAguQfnNVzbge2uWLhA7TCXOn83DT0ZvyJmBI943MItgTovUob36SQ==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.4.tgz", + "integrity": "sha512-2rqFFefpYmpMs+FWjkzSgXg5vViocqpq5a1PSRgT0AvSgxoXmGF17qfGAzKedg6wAwyM7UltrKVo9kxaJLMF/g==", "cpu": [ "arm" ], @@ -379,9 +379,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.3.tgz", - "integrity": "sha512-vvG6R5g5ieB4eCJBQevyDMb31LMHthLpXTc2IGkFnPWS/GzIFDnaYFp558O+XybTmYrVjxnryru7QRleJvmZ6Q==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.4.tgz", + "integrity": "sha512-/GLD2orjNU50v9PcxNpYZi+y8dJ7e7/LhQukN3S4jNDXCKkyyiyAz9zDw3siZ7Eh1tRcnCHAo/WcqKMzmi4eMQ==", "cpu": [ "arm64" ], @@ -395,9 +395,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.3.tgz", - "integrity": "sha512-HjCWhH7K96Na+66TacDLJmOI9R8iDWDDiqe17C7znGvvE4sW1ECt9ly0AJ3dJH62jHyVqW9xpxZEU1jKdt+29A==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.4.tgz", + "integrity": "sha512-pNftBl7m/tFG3t2m/tSjuYeWIffzwAZT9m08+9DPLizxVOsUl8DdFzn9HvJrTQwe3wvJnwTdl92AonY36w/25g==", "cpu": [ "ia32" ], @@ -411,9 +411,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.3.tgz", - "integrity": "sha512-BGpimEccmHBZRcAhdlRIxMp7x9PyJxUtj7apL2IuoG9VxvU/l/v1z015nFs7Si7tXUwEsvjc1rOJdZCn4QTU+Q==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.4.tgz", + "integrity": "sha512-cSD2gzCK5LuVX+hszzXQzlWya6c7hilO71L9h4KHwqI4qeqZ57bAtkgcC2YioXjsbfAv4lPn3qe3b00Zt+jIfQ==", "cpu": [ "loong64" ], @@ -427,9 +427,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.3.tgz", - "integrity": "sha512-5rMOWkp7FQGtAH3QJddP4w3s47iT20hwftqdm7b+loe95o8JU8ro3qZbhgMRy0VuFU0DizymF1pBKkn3YHWtsw==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.4.tgz", + "integrity": "sha512-qtzAd3BJh7UdbiXCrg6npWLYU0YpufsV9XlufKhMhYMJGJCdfX/G6+PNd0+v877X1JG5VmjBLUiFB0o8EUSicA==", "cpu": [ "mips64el" ], @@ -443,9 +443,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.3.tgz", - "integrity": "sha512-h0zj1ldel89V5sjPLo5H1SyMzp4VrgN1tPkN29TmjvO1/r0MuMRwJxL8QY05SmfsZRs6TF0c/IDH3u7XYYmbAg==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.4.tgz", + "integrity": "sha512-yB8AYzOTaL0D5+2a4xEy7OVvbcypvDR05MsB/VVPVA7nL4hc5w5Dyd/ddnayStDgJE59fAgNEOdLhBxjfx5+dg==", "cpu": [ "ppc64" ], @@ -459,9 +459,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.3.tgz", - "integrity": "sha512-dkAKcTsTJ+CRX6bnO17qDJbLoW37npd5gSNtSzjYQr0svghLJYGYB0NF1SNcU1vDcjXLYS5pO4qOW4YbFama4A==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.4.tgz", + "integrity": "sha512-Y5AgOuVzPjQdgU59ramLoqSSiXddu7F3F+LI5hYy/d1UHN7K5oLzYBDZe23QmQJ9PIVUXwOdKJ/jZahPdxzm9w==", "cpu": [ "riscv64" ], @@ -475,9 +475,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.3.tgz", - "integrity": "sha512-vnD1YUkovEdnZWEuMmy2X2JmzsHQqPpZElXx6dxENcIwTu+Cu5ERax6+Ke1QsE814Zf3c6rxCfwQdCTQ7tPuXA==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.4.tgz", + "integrity": "sha512-Iqc/l/FFwtt8FoTK9riYv9zQNms7B8u+vAI/rxKuN10HgQIXaPzKZc479lZ0x6+vKVQbu55GdpYpeNWzjOhgbA==", "cpu": [ "s390x" ], @@ -491,9 +491,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.3.tgz", - "integrity": "sha512-IOXOIm9WaK7plL2gMhsWJd+l2bfrhfilv0uPTptoRoSb2p09RghhQQp9YY6ZJhk/kqmeRt6siRdMSLLwzuT0KQ==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.4.tgz", + "integrity": "sha512-Td9jv782UMAFsuLZINfUpoF5mZIbAj+jv1YVtE58rFtfvoKRiKSkRGQfHTgKamLVT/fO7203bHa3wU122V/Bdg==", "cpu": [ "x64" ], @@ -507,9 +507,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.3.tgz", - "integrity": "sha512-uTgCwsvQ5+vCQnqM//EfDSuomo2LhdWhFPS8VL8xKf+PKTCrcT/2kPPoWMTs22aB63MLdGMJiE3f1PHvCDmUOw==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.4.tgz", + "integrity": "sha512-Awn38oSXxsPMQxaV0Ipb7W/gxZtk5Tx3+W+rAPdZkyEhQ6968r9NvtkjhnhbEgWXYbgV+JEONJ6PcdBS+nlcpA==", "cpu": [ "x64" ], @@ -523,9 +523,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.3.tgz", - "integrity": "sha512-vNAkR17Ub2MgEud2Wag/OE4HTSI6zlb291UYzHez/psiKarp0J8PKGDnAhMBcHFoOHMXHfExzmjMojJNbAStrQ==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.4.tgz", + "integrity": "sha512-IsUmQeCY0aU374R82fxIPu6vkOybWIMc3hVGZ3ChRwL9hA1TwY+tS0lgFWV5+F1+1ssuvvXt3HFqe8roCip8Hg==", "cpu": [ "x64" ], @@ -539,9 +539,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.3.tgz", - "integrity": "sha512-W8H9jlGiSBomkgmouaRoTXo49j4w4Kfbl6I1bIdO/vT0+0u4f20ko3ELzV3hPI6XV6JNBVX+8BC+ajHkvffIJA==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.4.tgz", + "integrity": "sha512-hsKhgZ4teLUaDA6FG/QIu2q0rI6I36tZVfM4DBZv3BG0mkMIdEnMbhc4xwLvLJSS22uWmaVkFkqWgIS0gPIm+A==", "cpu": [ "x64" ], @@ -555,9 +555,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.3.tgz", - "integrity": "sha512-EjEomwyLSCg8Ag3LDILIqYCZAq/y3diJ04PnqGRgq8/4O3VNlXyMd54j/saShaN4h5o5mivOjAzmU6C3X4v0xw==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.4.tgz", + "integrity": "sha512-UUfMgMoXPoA/bvGUNfUBFLCh0gt9dxZYIx9W4rfJr7+hKe5jxxHmfOK8YSH4qsHLLN4Ck8JZ+v7Q5fIm1huErg==", "cpu": [ "arm64" ], @@ -571,9 +571,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.3.tgz", - "integrity": "sha512-WGiE/GgbsEwR33++5rzjiYsKyHywE8QSZPF7Rfx9EBfK3Qn3xyR6IjyCr5Uk38Kg8fG4/2phN7sXp4NPWd3fcw==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.4.tgz", + "integrity": "sha512-yIxbspZb5kGCAHWm8dexALQ9en1IYDfErzjSEq1KzXFniHv019VT3mNtTK7t8qdy4TwT6QYHI9sEZabONHg+aw==", "cpu": [ "ia32" ], @@ -587,9 +587,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.3.tgz", - "integrity": "sha512-xRxC0jaJWDLYvcUvjQmHCJSfMrgmUuvsoXgDeU/wTorQ1ngDdUBuFtgY3W1Pc5sprGAvZBtWdJX7RPg/iZZUqA==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.4.tgz", + "integrity": "sha512-sywLRD3UK/qRJt0oBwdpYLBibk7KiRfbswmWRDabuncQYSlf8aLEEUor/oP6KRz8KEG+HoiVLBhPRD5JWjS8Sg==", "cpu": [ "x64" ], @@ -1248,9 +1248,9 @@ } }, "node_modules/esbuild": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.3.tgz", - "integrity": "sha512-Kgq0/ZsAPzKrbOjCQcjoSmPoWhlcVnGAUo7jvaLHoxW1Drto0KGkR1xBNg2Cp43b9ImvxmPEJZ9xkfcnqPsfBw==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.4.tgz", + "integrity": "sha512-sFMcNNrj+Q0ZDolrp5pDhH0nRPN9hLIM3fRPwgbLYJeSHHgnXSnbV3xYgSVuOeLWH9c73VwmEverVzupIv5xuA==", "dev": true, "hasInstallScript": true, "bin": { @@ -1260,29 +1260,29 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.3", - "@esbuild/android-arm": "0.21.3", - "@esbuild/android-arm64": "0.21.3", - "@esbuild/android-x64": "0.21.3", - "@esbuild/darwin-arm64": "0.21.3", - "@esbuild/darwin-x64": "0.21.3", - "@esbuild/freebsd-arm64": "0.21.3", - "@esbuild/freebsd-x64": "0.21.3", - "@esbuild/linux-arm": "0.21.3", - "@esbuild/linux-arm64": "0.21.3", - "@esbuild/linux-ia32": "0.21.3", - "@esbuild/linux-loong64": "0.21.3", - "@esbuild/linux-mips64el": "0.21.3", - "@esbuild/linux-ppc64": "0.21.3", - "@esbuild/linux-riscv64": "0.21.3", - "@esbuild/linux-s390x": "0.21.3", - "@esbuild/linux-x64": "0.21.3", - "@esbuild/netbsd-x64": "0.21.3", - "@esbuild/openbsd-x64": "0.21.3", - "@esbuild/sunos-x64": "0.21.3", - "@esbuild/win32-arm64": "0.21.3", - "@esbuild/win32-ia32": "0.21.3", - "@esbuild/win32-x64": "0.21.3" + "@esbuild/aix-ppc64": "0.21.4", + "@esbuild/android-arm": "0.21.4", + "@esbuild/android-arm64": "0.21.4", + "@esbuild/android-x64": "0.21.4", + "@esbuild/darwin-arm64": "0.21.4", + "@esbuild/darwin-x64": "0.21.4", + "@esbuild/freebsd-arm64": "0.21.4", + "@esbuild/freebsd-x64": "0.21.4", + "@esbuild/linux-arm": "0.21.4", + "@esbuild/linux-arm64": "0.21.4", + "@esbuild/linux-ia32": "0.21.4", + "@esbuild/linux-loong64": "0.21.4", + "@esbuild/linux-mips64el": "0.21.4", + "@esbuild/linux-ppc64": "0.21.4", + "@esbuild/linux-riscv64": "0.21.4", + "@esbuild/linux-s390x": "0.21.4", + "@esbuild/linux-x64": "0.21.4", + "@esbuild/netbsd-x64": "0.21.4", + "@esbuild/openbsd-x64": "0.21.4", + "@esbuild/sunos-x64": "0.21.4", + "@esbuild/win32-arm64": "0.21.4", + "@esbuild/win32-ia32": "0.21.4", + "@esbuild/win32-x64": "0.21.4" } }, "node_modules/escape-string-regexp": { @@ -2940,163 +2940,163 @@ } }, "@esbuild/aix-ppc64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.3.tgz", - "integrity": "sha512-yTgnwQpFVYfvvo4SvRFB0SwrW8YjOxEoT7wfMT7Ol5v7v5LDNvSGo67aExmxOb87nQNeWPVvaGBNfQ7BXcrZ9w==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.4.tgz", + "integrity": "sha512-Zrm+B33R4LWPLjDEVnEqt2+SLTATlru1q/xYKVn8oVTbiRBGmK2VIMoIYGJDGyftnGaC788IuzGFAlb7IQ0Y8A==", "dev": true, "optional": true }, "@esbuild/android-arm": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.3.tgz", - "integrity": "sha512-bviJOLMgurLJtF1/mAoJLxDZDL6oU5/ztMHnJQRejbJrSc9FFu0QoUoFhvi6qSKJEw9y5oGyvr9fuDtzJ30rNQ==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.4.tgz", + "integrity": "sha512-E7H/yTd8kGQfY4z9t3nRPk/hrhaCajfA3YSQSBrst8B+3uTcgsi8N+ZWYCaeIDsiVs6m65JPCaQN/DxBRclF3A==", "dev": true, "optional": true }, "@esbuild/android-arm64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.3.tgz", - "integrity": "sha512-c+ty9necz3zB1Y+d/N+mC6KVVkGUUOcm4ZmT5i/Fk5arOaY3i6CA3P5wo/7+XzV8cb4GrI/Zjp8NuOQ9Lfsosw==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.4.tgz", + "integrity": "sha512-fYFnz+ObClJ3dNiITySBUx+oNalYUT18/AryMxfovLkYWbutXsct3Wz2ZWAcGGppp+RVVX5FiXeLYGi97umisA==", "dev": true, "optional": true }, "@esbuild/android-x64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.3.tgz", - "integrity": "sha512-JReHfYCRK3FVX4Ra+y5EBH1b9e16TV2OxrPAvzMsGeES0X2Ndm9ImQRI4Ket757vhc5XBOuGperw63upesclRw==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.4.tgz", + "integrity": "sha512-mDqmlge3hFbEPbCWxp4fM6hqq7aZfLEHZAKGP9viq9wMUBVQx202aDIfc3l+d2cKhUJM741VrCXEzRFhPDKH3Q==", "dev": true, "optional": true }, "@esbuild/darwin-arm64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.3.tgz", - "integrity": "sha512-U3fuQ0xNiAkXOmQ6w5dKpEvXQRSpHOnbw7gEfHCRXPeTKW9sBzVck6C5Yneb8LfJm0l6le4NQfkNPnWMSlTFUQ==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.4.tgz", + "integrity": "sha512-72eaIrDZDSiWqpmCzVaBD58c8ea8cw/U0fq/PPOTqE3c53D0xVMRt2ooIABZ6/wj99Y+h4ksT/+I+srCDLU9TA==", "dev": true, "optional": true }, "@esbuild/darwin-x64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.3.tgz", - "integrity": "sha512-3m1CEB7F07s19wmaMNI2KANLcnaqryJxO1fXHUV5j1rWn+wMxdUYoPyO2TnAbfRZdi7ADRwJClmOwgT13qlP3Q==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.4.tgz", + "integrity": "sha512-uBsuwRMehGmw1JC7Vecu/upOjTsMhgahmDkWhGLWxIgUn2x/Y4tIwUZngsmVb6XyPSTXJYS4YiASKPcm9Zitag==", "dev": true, "optional": true }, "@esbuild/freebsd-arm64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.3.tgz", - "integrity": "sha512-fsNAAl5pU6wmKHq91cHWQT0Fz0vtyE1JauMzKotrwqIKAswwP5cpHUCxZNSTuA/JlqtScq20/5KZ+TxQdovU/g==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.4.tgz", + "integrity": "sha512-8JfuSC6YMSAEIZIWNL3GtdUT5NhUA/CMUCpZdDRolUXNAXEE/Vbpe6qlGLpfThtY5NwXq8Hi4nJy4YfPh+TwAg==", "dev": true, "optional": true }, "@esbuild/freebsd-x64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.3.tgz", - "integrity": "sha512-tci+UJ4zP5EGF4rp8XlZIdq1q1a/1h9XuronfxTMCNBslpCtmk97Q/5qqy1Mu4zIc0yswN/yP/BLX+NTUC1bXA==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.4.tgz", + "integrity": "sha512-8d9y9eQhxv4ef7JmXny7591P/PYsDFc4+STaxC1GBv0tMyCdyWfXu2jBuqRsyhY8uL2HU8uPyscgE2KxCY9imQ==", "dev": true, "optional": true }, "@esbuild/linux-arm": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.3.tgz", - "integrity": "sha512-f6kz2QpSuyHHg01cDawj0vkyMwuIvN62UAguQfnNVzbge2uWLhA7TCXOn83DT0ZvyJmBI943MItgTovUob36SQ==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.4.tgz", + "integrity": "sha512-2rqFFefpYmpMs+FWjkzSgXg5vViocqpq5a1PSRgT0AvSgxoXmGF17qfGAzKedg6wAwyM7UltrKVo9kxaJLMF/g==", "dev": true, "optional": true }, "@esbuild/linux-arm64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.3.tgz", - "integrity": "sha512-vvG6R5g5ieB4eCJBQevyDMb31LMHthLpXTc2IGkFnPWS/GzIFDnaYFp558O+XybTmYrVjxnryru7QRleJvmZ6Q==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.4.tgz", + "integrity": "sha512-/GLD2orjNU50v9PcxNpYZi+y8dJ7e7/LhQukN3S4jNDXCKkyyiyAz9zDw3siZ7Eh1tRcnCHAo/WcqKMzmi4eMQ==", "dev": true, "optional": true }, "@esbuild/linux-ia32": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.3.tgz", - "integrity": "sha512-HjCWhH7K96Na+66TacDLJmOI9R8iDWDDiqe17C7znGvvE4sW1ECt9ly0AJ3dJH62jHyVqW9xpxZEU1jKdt+29A==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.4.tgz", + "integrity": "sha512-pNftBl7m/tFG3t2m/tSjuYeWIffzwAZT9m08+9DPLizxVOsUl8DdFzn9HvJrTQwe3wvJnwTdl92AonY36w/25g==", "dev": true, "optional": true }, "@esbuild/linux-loong64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.3.tgz", - "integrity": "sha512-BGpimEccmHBZRcAhdlRIxMp7x9PyJxUtj7apL2IuoG9VxvU/l/v1z015nFs7Si7tXUwEsvjc1rOJdZCn4QTU+Q==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.4.tgz", + "integrity": "sha512-cSD2gzCK5LuVX+hszzXQzlWya6c7hilO71L9h4KHwqI4qeqZ57bAtkgcC2YioXjsbfAv4lPn3qe3b00Zt+jIfQ==", "dev": true, "optional": true }, "@esbuild/linux-mips64el": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.3.tgz", - "integrity": "sha512-5rMOWkp7FQGtAH3QJddP4w3s47iT20hwftqdm7b+loe95o8JU8ro3qZbhgMRy0VuFU0DizymF1pBKkn3YHWtsw==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.4.tgz", + "integrity": "sha512-qtzAd3BJh7UdbiXCrg6npWLYU0YpufsV9XlufKhMhYMJGJCdfX/G6+PNd0+v877X1JG5VmjBLUiFB0o8EUSicA==", "dev": true, "optional": true }, "@esbuild/linux-ppc64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.3.tgz", - "integrity": "sha512-h0zj1ldel89V5sjPLo5H1SyMzp4VrgN1tPkN29TmjvO1/r0MuMRwJxL8QY05SmfsZRs6TF0c/IDH3u7XYYmbAg==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.4.tgz", + "integrity": "sha512-yB8AYzOTaL0D5+2a4xEy7OVvbcypvDR05MsB/VVPVA7nL4hc5w5Dyd/ddnayStDgJE59fAgNEOdLhBxjfx5+dg==", "dev": true, "optional": true }, "@esbuild/linux-riscv64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.3.tgz", - "integrity": "sha512-dkAKcTsTJ+CRX6bnO17qDJbLoW37npd5gSNtSzjYQr0svghLJYGYB0NF1SNcU1vDcjXLYS5pO4qOW4YbFama4A==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.4.tgz", + "integrity": "sha512-Y5AgOuVzPjQdgU59ramLoqSSiXddu7F3F+LI5hYy/d1UHN7K5oLzYBDZe23QmQJ9PIVUXwOdKJ/jZahPdxzm9w==", "dev": true, "optional": true }, "@esbuild/linux-s390x": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.3.tgz", - "integrity": "sha512-vnD1YUkovEdnZWEuMmy2X2JmzsHQqPpZElXx6dxENcIwTu+Cu5ERax6+Ke1QsE814Zf3c6rxCfwQdCTQ7tPuXA==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.4.tgz", + "integrity": "sha512-Iqc/l/FFwtt8FoTK9riYv9zQNms7B8u+vAI/rxKuN10HgQIXaPzKZc479lZ0x6+vKVQbu55GdpYpeNWzjOhgbA==", "dev": true, "optional": true }, "@esbuild/linux-x64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.3.tgz", - "integrity": "sha512-IOXOIm9WaK7plL2gMhsWJd+l2bfrhfilv0uPTptoRoSb2p09RghhQQp9YY6ZJhk/kqmeRt6siRdMSLLwzuT0KQ==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.4.tgz", + "integrity": "sha512-Td9jv782UMAFsuLZINfUpoF5mZIbAj+jv1YVtE58rFtfvoKRiKSkRGQfHTgKamLVT/fO7203bHa3wU122V/Bdg==", "dev": true, "optional": true }, "@esbuild/netbsd-x64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.3.tgz", - "integrity": "sha512-uTgCwsvQ5+vCQnqM//EfDSuomo2LhdWhFPS8VL8xKf+PKTCrcT/2kPPoWMTs22aB63MLdGMJiE3f1PHvCDmUOw==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.4.tgz", + "integrity": "sha512-Awn38oSXxsPMQxaV0Ipb7W/gxZtk5Tx3+W+rAPdZkyEhQ6968r9NvtkjhnhbEgWXYbgV+JEONJ6PcdBS+nlcpA==", "dev": true, "optional": true }, "@esbuild/openbsd-x64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.3.tgz", - "integrity": "sha512-vNAkR17Ub2MgEud2Wag/OE4HTSI6zlb291UYzHez/psiKarp0J8PKGDnAhMBcHFoOHMXHfExzmjMojJNbAStrQ==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.4.tgz", + "integrity": "sha512-IsUmQeCY0aU374R82fxIPu6vkOybWIMc3hVGZ3ChRwL9hA1TwY+tS0lgFWV5+F1+1ssuvvXt3HFqe8roCip8Hg==", "dev": true, "optional": true }, "@esbuild/sunos-x64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.3.tgz", - "integrity": "sha512-W8H9jlGiSBomkgmouaRoTXo49j4w4Kfbl6I1bIdO/vT0+0u4f20ko3ELzV3hPI6XV6JNBVX+8BC+ajHkvffIJA==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.4.tgz", + "integrity": "sha512-hsKhgZ4teLUaDA6FG/QIu2q0rI6I36tZVfM4DBZv3BG0mkMIdEnMbhc4xwLvLJSS22uWmaVkFkqWgIS0gPIm+A==", "dev": true, "optional": true }, "@esbuild/win32-arm64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.3.tgz", - "integrity": "sha512-EjEomwyLSCg8Ag3LDILIqYCZAq/y3diJ04PnqGRgq8/4O3VNlXyMd54j/saShaN4h5o5mivOjAzmU6C3X4v0xw==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.4.tgz", + "integrity": "sha512-UUfMgMoXPoA/bvGUNfUBFLCh0gt9dxZYIx9W4rfJr7+hKe5jxxHmfOK8YSH4qsHLLN4Ck8JZ+v7Q5fIm1huErg==", "dev": true, "optional": true }, "@esbuild/win32-ia32": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.3.tgz", - "integrity": "sha512-WGiE/GgbsEwR33++5rzjiYsKyHywE8QSZPF7Rfx9EBfK3Qn3xyR6IjyCr5Uk38Kg8fG4/2phN7sXp4NPWd3fcw==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.4.tgz", + "integrity": "sha512-yIxbspZb5kGCAHWm8dexALQ9en1IYDfErzjSEq1KzXFniHv019VT3mNtTK7t8qdy4TwT6QYHI9sEZabONHg+aw==", "dev": true, "optional": true }, "@esbuild/win32-x64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.3.tgz", - "integrity": "sha512-xRxC0jaJWDLYvcUvjQmHCJSfMrgmUuvsoXgDeU/wTorQ1ngDdUBuFtgY3W1Pc5sprGAvZBtWdJX7RPg/iZZUqA==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.4.tgz", + "integrity": "sha512-sywLRD3UK/qRJt0oBwdpYLBibk7KiRfbswmWRDabuncQYSlf8aLEEUor/oP6KRz8KEG+HoiVLBhPRD5JWjS8Sg==", "dev": true, "optional": true }, @@ -3595,34 +3595,34 @@ "dev": true }, "esbuild": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.3.tgz", - "integrity": "sha512-Kgq0/ZsAPzKrbOjCQcjoSmPoWhlcVnGAUo7jvaLHoxW1Drto0KGkR1xBNg2Cp43b9ImvxmPEJZ9xkfcnqPsfBw==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.4.tgz", + "integrity": "sha512-sFMcNNrj+Q0ZDolrp5pDhH0nRPN9hLIM3fRPwgbLYJeSHHgnXSnbV3xYgSVuOeLWH9c73VwmEverVzupIv5xuA==", "dev": true, "requires": { - "@esbuild/aix-ppc64": "0.21.3", - "@esbuild/android-arm": "0.21.3", - "@esbuild/android-arm64": "0.21.3", - "@esbuild/android-x64": "0.21.3", - "@esbuild/darwin-arm64": "0.21.3", - "@esbuild/darwin-x64": "0.21.3", - "@esbuild/freebsd-arm64": "0.21.3", - "@esbuild/freebsd-x64": "0.21.3", - "@esbuild/linux-arm": "0.21.3", - "@esbuild/linux-arm64": "0.21.3", - "@esbuild/linux-ia32": "0.21.3", - "@esbuild/linux-loong64": "0.21.3", - "@esbuild/linux-mips64el": "0.21.3", - "@esbuild/linux-ppc64": "0.21.3", - "@esbuild/linux-riscv64": "0.21.3", - "@esbuild/linux-s390x": "0.21.3", - "@esbuild/linux-x64": "0.21.3", - "@esbuild/netbsd-x64": "0.21.3", - "@esbuild/openbsd-x64": "0.21.3", - "@esbuild/sunos-x64": "0.21.3", - "@esbuild/win32-arm64": "0.21.3", - "@esbuild/win32-ia32": "0.21.3", - "@esbuild/win32-x64": "0.21.3" + "@esbuild/aix-ppc64": "0.21.4", + "@esbuild/android-arm": "0.21.4", + "@esbuild/android-arm64": "0.21.4", + "@esbuild/android-x64": "0.21.4", + "@esbuild/darwin-arm64": "0.21.4", + "@esbuild/darwin-x64": "0.21.4", + "@esbuild/freebsd-arm64": "0.21.4", + "@esbuild/freebsd-x64": "0.21.4", + "@esbuild/linux-arm": "0.21.4", + "@esbuild/linux-arm64": "0.21.4", + "@esbuild/linux-ia32": "0.21.4", + "@esbuild/linux-loong64": "0.21.4", + "@esbuild/linux-mips64el": "0.21.4", + "@esbuild/linux-ppc64": "0.21.4", + "@esbuild/linux-riscv64": "0.21.4", + "@esbuild/linux-s390x": "0.21.4", + "@esbuild/linux-x64": "0.21.4", + "@esbuild/netbsd-x64": "0.21.4", + "@esbuild/openbsd-x64": "0.21.4", + "@esbuild/sunos-x64": "0.21.4", + "@esbuild/win32-arm64": "0.21.4", + "@esbuild/win32-ia32": "0.21.4", + "@esbuild/win32-x64": "0.21.4" } }, "escape-string-regexp": { diff --git a/code/package.json b/code/package.json index e158503a8..17c70e16f 100644 --- a/code/package.json +++ b/code/package.json @@ -39,7 +39,7 @@ "@types/node": "^18", "@types/vscode": "1.78.0", "@vscode/vsce": "^2.26.1", - "esbuild": "^0.21.3", + "esbuild": "^0.21.4", "ovsx": "^0.9.1", "typescript": "^5.4.5" }, From e7eca4b577cb63023bda494248a9ac9f581bd3b7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 17:56:55 +0000 Subject: [PATCH 37/60] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.4.4 → v0.4.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.4...v0.4.5) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 13ab20d71..92811ef0e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.4 + rev: v0.4.5 hooks: - id: ruff args: [--fix] From 17af2f5fada02ea3f0eb7d2f88a711163f2586bb Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Wed, 29 May 2024 22:45:50 +0100 Subject: [PATCH 38/60] Bump ruff version --- lib/esbonio/hatch.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/esbonio/hatch.toml b/lib/esbonio/hatch.toml index 6af300a74..48819f81c 100644 --- a/lib/esbonio/hatch.toml +++ b/lib/esbonio/hatch.toml @@ -35,4 +35,4 @@ value = ["tests/sphinx-agent", "tests/e2e"] [envs.hatch-static-analysis] config-path = "ruff_defaults.toml" -dependencies = ["ruff==0.4.4"] +dependencies = ["ruff==0.4.5"] From f411375a34b3bc82aa5754ef498915448fd66a8b Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Mon, 13 May 2024 14:19:35 +0100 Subject: [PATCH 39/60] lsp: use rstrip --- .../esbonio/server/features/sphinx_manager/client_subprocess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/esbonio/esbonio/server/features/sphinx_manager/client_subprocess.py b/lib/esbonio/esbonio/server/features/sphinx_manager/client_subprocess.py index e2a8c6405..0e9f6d5d9 100644 --- a/lib/esbonio/esbonio/server/features/sphinx_manager/client_subprocess.py +++ b/lib/esbonio/esbonio/server/features/sphinx_manager/client_subprocess.py @@ -273,7 +273,7 @@ async def forward_stderr(server: asyncio.subprocess.Process): # EOF is signalled with an empty bytestring while (line := await server.stderr.readline()) != b"": - sphinx_logger.info(line.decode().strip()) + sphinx_logger.info(line.decode().rstrip()) def make_subprocess_sphinx_client( From 7ea560f98f086678ad29a8db939228af105e525f Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Fri, 24 May 2024 19:19:45 +0100 Subject: [PATCH 40/60] sphinx-agent: Convert `types.py` into a folder This file is starting to get bigger and bigger, it would make sense to break this up at some point --- lib/esbonio/esbonio/sphinx_agent/{types.py => types/__init__.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/esbonio/esbonio/sphinx_agent/{types.py => types/__init__.py} (100%) diff --git a/lib/esbonio/esbonio/sphinx_agent/types.py b/lib/esbonio/esbonio/sphinx_agent/types/__init__.py similarity index 100% rename from lib/esbonio/esbonio/sphinx_agent/types.py rename to lib/esbonio/esbonio/sphinx_agent/types/__init__.py From 3b58d127ab1c3e6ddfea30db574b8d915034c77b Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Fri, 24 May 2024 19:25:43 +0100 Subject: [PATCH 41/60] sphinx-agent: Listen for roles registered through the Sphinx API The sphinx-agent's version of the `Sphinx` object, now calls out to the `add_role` method exposed through the `Esbonio` object. This allows the agent to capture roles as they are registered through Sphinx itself. Technically, this is a worse choice as this misses the roles that are provided by docutils itself, as well as any roles registered through a method we don't override yet. However, taking a step back this is an improvement when it comes to teaching esbonio about how each of the roles/directives work. Taking this approach it will be possible for the sphinx-agent's version of `Sphinx` to accept additional arguments, passing them onto the `Esbonio` object and providing a single point of entry for extending both Sphinx and Esbonio in one go. (Yes, this does mean however, that Sphinx extension authors will have to check for the presence of Esbonio before providing these additional parameters) Alternatively, users can call the relevant methods through `app.esbonio` if they prefer. --- .../esbonio/server/features/roles/__init__.py | 26 ++++----- .../server/features/sphinx_support/roles.py | 15 +++--- lib/esbonio/esbonio/sphinx_agent/app.py | 53 +++++++++++++++++-- .../esbonio/sphinx_agent/handlers/roles.py | 29 +++++----- .../esbonio/sphinx_agent/types/__init__.py | 4 ++ .../esbonio/sphinx_agent/types/roles.py | 23 ++++++++ .../server/features/test_role_completion.py | 2 +- 7 files changed, 107 insertions(+), 45 deletions(-) create mode 100644 lib/esbonio/esbonio/sphinx_agent/types/roles.py diff --git a/lib/esbonio/esbonio/server/features/roles/__init__.py b/lib/esbonio/esbonio/server/features/roles/__init__.py index 26c22ce22..6c9028a2a 100644 --- a/lib/esbonio/esbonio/server/features/roles/__init__.py +++ b/lib/esbonio/esbonio/server/features/roles/__init__.py @@ -3,9 +3,8 @@ import inspect import typing -import attrs - from esbonio import server +from esbonio.sphinx_agent import types if typing.TYPE_CHECKING: from typing import Any @@ -16,23 +15,14 @@ from typing import Union -@attrs.define -class Role: - """Represents a role.""" - - name: str - """The name of the role, as the user would type in an rst file.""" - - implementation: Optional[str] - """The dotted name of the role's implementation.""" - - class RoleProvider: """Base class for role providers.""" def suggest_roles( self, context: server.CompletionContext - ) -> Union[Optional[List[Role]], Coroutine[Any, Any, Optional[List[Role]]]]: + ) -> Union[ + Optional[List[types.Role]], Coroutine[Any, Any, Optional[List[types.Role]]] + ]: """Givem a completion context, suggest roles that may be used.""" return None @@ -59,7 +49,9 @@ def add_provider(self, provider: RoleProvider): """ self._providers[id(provider)] = provider - async def suggest_roles(self, context: server.CompletionContext) -> List[Role]: + async def suggest_roles( + self, context: server.CompletionContext + ) -> List[types.Role]: """Suggest roles that may be used, given a completion context. Parameters @@ -67,11 +59,11 @@ async def suggest_roles(self, context: server.CompletionContext) -> List[Role]: context The completion context """ - items: List[Role] = [] + items: List[types.Role] = [] for provider in self._providers.values(): try: - result: Optional[List[Role]] = None + result: Optional[List[types.Role]] = None aresult = provider.suggest_roles(context) if inspect.isawaitable(aresult): diff --git a/lib/esbonio/esbonio/server/features/sphinx_support/roles.py b/lib/esbonio/esbonio/server/features/sphinx_support/roles.py index fcd4d6c7c..996efd1cc 100644 --- a/lib/esbonio/esbonio/server/features/sphinx_support/roles.py +++ b/lib/esbonio/esbonio/server/features/sphinx_support/roles.py @@ -2,11 +2,12 @@ import typing -from lsprotocol import types +from lsprotocol import types as lsp from esbonio import server from esbonio.server.features import roles from esbonio.server.features.project_manager import ProjectManager +from esbonio.sphinx_agent import types if typing.TYPE_CHECKING: from typing import List @@ -21,7 +22,7 @@ def __init__(self, manager: ProjectManager): async def suggest_roles( self, context: server.CompletionContext - ) -> Optional[List[roles.Role]]: + ) -> Optional[List[types.Role]]: """Given a completion context, suggest roles that may be used.""" if (project := self.manager.get_project(context.uri)) is None: @@ -30,7 +31,7 @@ async def suggest_roles( # Does the document have a default domain set? results = await project.find_symbols( uri=str(context.uri.resolve()), - kind=types.SymbolKind.Class.value, + kind=lsp.SymbolKind.Class.value, detail="default-domain", ) if len(results) > 0: @@ -41,23 +42,23 @@ async def suggest_roles( primary_domain = await project.get_config_value("primary_domain") active_domain = default_domain or primary_domain or "py" - result: List[roles.Role] = [] + result: List[types.Role] = [] for name, implementation in await project.get_roles(): # std: directives can be used unqualified if name.startswith("std:"): short_name = name.replace("std:", "") result.append( - roles.Role(name=short_name, implementation=implementation) + types.Role(name=short_name, implementation=implementation) ) # Also suggest unqualified versions of directives from the currently active domain. elif name.startswith(f"{active_domain}:"): short_name = name.replace(f"{active_domain}:", "") result.append( - roles.Role(name=short_name, implementation=implementation) + types.Role(name=short_name, implementation=implementation) ) - result.append(roles.Role(name=name, implementation=implementation)) + result.append(types.Role(name=name, implementation=implementation)) return result diff --git a/lib/esbonio/esbonio/sphinx_agent/app.py b/lib/esbonio/esbonio/sphinx_agent/app.py index 7edbcb086..b75927bf6 100644 --- a/lib/esbonio/esbonio/sphinx_agent/app.py +++ b/lib/esbonio/esbonio/sphinx_agent/app.py @@ -2,7 +2,7 @@ import logging import pathlib -from typing import IO +import typing from sphinx.application import Sphinx as _Sphinx from sphinx.util import console @@ -12,6 +12,16 @@ from .database import Database from .log import DiagnosticFilter +if typing.TYPE_CHECKING: + from typing import IO + from typing import Any + from typing import List + from typing import Tuple + from typing import Type + + from sphinx.domains import Domain + + sphinx_logger = logging.getLogger(SPHINX_LOG_NAMESPACE) sphinx_log_setup = sphinx_logging_module.setup @@ -37,12 +47,25 @@ def __init__(self, dbpath: pathlib.Path, app: _Sphinx): self.db = Database(dbpath) self.log = DiagnosticFilter(app) - # Override sphinx's usual logging setup function - sphinx_logging_module.setup = setup_logging # type: ignore + self._roles: List[Tuple[str, Any]] = [] + """Roles captured during Sphinx startup.""" + + def add_role(self, name: str, role: Any): + """Register a role with esbonio. + + Parameters + ---------- + name + The name of the role, as the user would type in a document + + role + The role's implementation + """ + self._roles.append((name, role)) class Sphinx(_Sphinx): - """A regular sphinx application with a few extra fields.""" + """An extended sphinx application that integrates with esbonio.""" esbonio: Esbonio @@ -50,9 +73,31 @@ def __init__(self, *args, **kwargs): # Disable color codes console.nocolor() + # Add in esbonio specific functionality self.esbonio = Esbonio( dbpath=pathlib.Path(kwargs["outdir"], "esbonio.db").resolve(), app=self, ) + # Override sphinx's usual logging setup function + sphinx_logging_module.setup = setup_logging # type: ignore + super().__init__(*args, **kwargs) + + def add_role(self, name: str, role: Any, override: bool = False): + super().add_role(name, role, override) + self.esbonio.add_role(name, role) + + def add_domain(self, domain: Type[Domain], override: bool = False) -> None: + super().add_domain(domain, override) + + for name, role in domain.roles.items(): + providers = [] + if (item_types := target_types.get(name)) is not None: + providers.append( + self.esbonio.create_role_target_provider( + "objects", obj_types=list(item_types) + ) + ) + + self.esbonio.add_role(f"{domain.name}:{name}", role, providers) diff --git a/lib/esbonio/esbonio/sphinx_agent/handlers/roles.py b/lib/esbonio/esbonio/sphinx_agent/handlers/roles.py index 40d83b685..00071c40e 100644 --- a/lib/esbonio/esbonio/sphinx_agent/handlers/roles.py +++ b/lib/esbonio/esbonio/sphinx_agent/handlers/roles.py @@ -1,6 +1,6 @@ import inspect from typing import Any -from typing import List +from typing import Dict from typing import Optional from docutils.parsers.rst import roles as docutils_roles @@ -54,32 +54,29 @@ def get_impl_location(impl: Any) -> Optional[str]: def index_roles(app: Sphinx): """Index all the roles that are available to this app.""" - roles: List[types.Directive] = [] + roles: Dict[str, types.Role] = {} + + # Process the roles registered through Sphinx + for name, impl in app.esbonio._roles: + roles[name] = types.Role(name, get_impl_name(impl)) + + # Look any remaining docutils provided roles found_roles = { **docutils_roles._roles, # type: ignore[attr-defined] **docutils_roles._role_registry, # type: ignore[attr-defined] } for name, role in found_roles.items(): - if role == docutils_roles.unimplemented_role: + if role == docutils_roles.unimplemented_role or name in roles: continue - roles.append((name, get_impl_name(role), None)) - - for prefix, domain in app.env.domains.items(): - for name, role in domain.roles.items(): - roles.append( - ( - f"{prefix}:{name}", - get_impl_name(role), - None, - ) - ) + roles[name] = types.Role(name, get_impl_name(role)) app.esbonio.db.ensure_table(ROLES_TABLE) app.esbonio.db.clear_table(ROLES_TABLE) - app.esbonio.db.insert_values(ROLES_TABLE, roles) + app.esbonio.db.insert_values(ROLES_TABLE, [r.to_db() for r in roles.values()]) def setup(app: Sphinx): - app.connect("builder-inited", index_roles) + # Ensure that this runs as late as possibile + app.connect("builder-inited", index_roles, priority=999) diff --git a/lib/esbonio/esbonio/sphinx_agent/types/__init__.py b/lib/esbonio/esbonio/sphinx_agent/types/__init__.py index 05d1104d2..90a2f3c14 100644 --- a/lib/esbonio/esbonio/sphinx_agent/types/__init__.py +++ b/lib/esbonio/esbonio/sphinx_agent/types/__init__.py @@ -17,6 +17,10 @@ from typing import Union from urllib import parse +from .roles import Role + +__all__ = ("Role",) + MYST_DIRECTIVE: "re.Pattern" = re.compile( r""" (\s*) # directives can be indented diff --git a/lib/esbonio/esbonio/sphinx_agent/types/roles.py b/lib/esbonio/esbonio/sphinx_agent/types/roles.py new file mode 100644 index 000000000..17cdc2306 --- /dev/null +++ b/lib/esbonio/esbonio/sphinx_agent/types/roles.py @@ -0,0 +1,23 @@ +from __future__ import annotations + +import typing +from dataclasses import dataclass + +if typing.TYPE_CHECKING: + from typing import Optional + from typing import Tuple + + +@dataclass +class Role: + """Represents a role.""" + + name: str + """The name of the role, as the user would type in an rst file.""" + + implementation: Optional[str] + """The dotted name of the role's implementation.""" + + def to_db(self) -> Tuple[str, Optional[str], None]: + """Convert this role to its database representation.""" + return (self.name, self.implementation, None) diff --git a/lib/esbonio/tests/server/features/test_role_completion.py b/lib/esbonio/tests/server/features/test_role_completion.py index 87fd5d833..086fc4745 100644 --- a/lib/esbonio/tests/server/features/test_role_completion.py +++ b/lib/esbonio/tests/server/features/test_role_completion.py @@ -8,10 +8,10 @@ from pytest_lsp import client_capabilities from esbonio import server -from esbonio.server.features.roles import Role from esbonio.server.features.roles import completion from esbonio.server.testing import range_from_str from esbonio.sphinx_agent.types import RST_ROLE +from esbonio.sphinx_agent.types import Role if typing.TYPE_CHECKING: from typing import Literal From 7f8cfb77bd267aa30418032c96613abf94f28bd3 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Sun, 26 May 2024 16:14:12 +0100 Subject: [PATCH 42/60] sphinx-agent: Define a target provider for domain roles This extends our custom `add_domain()` method to register an "objects" target provider for cross-referencing roles that are part of a domain. This *should* provide the parent language server enough information to provide role target completions for domain objects --- lib/esbonio/esbonio/sphinx_agent/app.py | 45 +++++++++++++++++-- .../esbonio/sphinx_agent/handlers/roles.py | 15 ++++--- lib/esbonio/esbonio/sphinx_agent/types/lsp.py | 36 +++++++++++++++ .../esbonio/sphinx_agent/types/roles.py | 35 ++++++++++++++- lib/esbonio/esbonio/sphinx_agent/util.py | 9 ++-- 5 files changed, 125 insertions(+), 15 deletions(-) create mode 100644 lib/esbonio/esbonio/sphinx_agent/types/lsp.py diff --git a/lib/esbonio/esbonio/sphinx_agent/app.py b/lib/esbonio/esbonio/sphinx_agent/app.py index b75927bf6..2b3e65bb7 100644 --- a/lib/esbonio/esbonio/sphinx_agent/app.py +++ b/lib/esbonio/esbonio/sphinx_agent/app.py @@ -9,18 +9,23 @@ from sphinx.util import logging as sphinx_logging_module from sphinx.util.logging import NAMESPACE as SPHINX_LOG_NAMESPACE +from . import types from .database import Database from .log import DiagnosticFilter if typing.TYPE_CHECKING: from typing import IO from typing import Any + from typing import Dict from typing import List + from typing import Optional + from typing import Set from typing import Tuple from typing import Type from sphinx.domains import Domain + RoleDefinition = Tuple[str, Any, List[types.Role.TargetProvider]] sphinx_logger = logging.getLogger(SPHINX_LOG_NAMESPACE) sphinx_log_setup = sphinx_logging_module.setup @@ -47,10 +52,15 @@ def __init__(self, dbpath: pathlib.Path, app: _Sphinx): self.db = Database(dbpath) self.log = DiagnosticFilter(app) - self._roles: List[Tuple[str, Any]] = [] + self._roles: List[RoleDefinition] = [] """Roles captured during Sphinx startup.""" - def add_role(self, name: str, role: Any): + def add_role( + self, + name: str, + role: Any, + target_providers: Optional[List[types.Role.TargetProvider]] = None, + ): """Register a role with esbonio. Parameters @@ -60,8 +70,30 @@ def add_role(self, name: str, role: Any): role The role's implementation + + target_providers + A list of target providers for the role """ - self._roles.append((name, role)) + self._roles.append((name, role, target_providers or [])) + + @staticmethod + def create_role_target_provider(name: str, **kwargs) -> types.Role.TargetProvider: + """Create a new role target provider + + Parameters + ---------- + name + The name of the provider + + kwargs + Additional arguments to pass to the provider instance + + Returns + ------- + types.Role.TargetProvider + The target provider + """ + return types.Role.TargetProvider(name, kwargs) class Sphinx(_Sphinx): @@ -91,6 +123,13 @@ def add_role(self, name: str, role: Any, override: bool = False): def add_domain(self, domain: Type[Domain], override: bool = False) -> None: super().add_domain(domain, override) + target_types: Dict[str, Set[str]] = {} + + for obj_name, item_type in domain.object_types.items(): + for role_name in item_type.roles: + target_type = f"{domain.name}:{obj_name}" + target_types.setdefault(role_name, set()).add(target_type) + for name, role in domain.roles.items(): providers = [] if (item_types := target_types.get(name)) is not None: diff --git a/lib/esbonio/esbonio/sphinx_agent/handlers/roles.py b/lib/esbonio/esbonio/sphinx_agent/handlers/roles.py index 00071c40e..1f96d33b0 100644 --- a/lib/esbonio/esbonio/sphinx_agent/handlers/roles.py +++ b/lib/esbonio/esbonio/sphinx_agent/handlers/roles.py @@ -16,6 +16,7 @@ Database.Column(name="name", dtype="TEXT"), Database.Column(name="implementation", dtype="TEXT"), Database.Column(name="location", dtype="JSON"), + Database.Column(name="target_providers", dtype="JSON"), ], ) @@ -27,8 +28,8 @@ def get_impl_name(role: Any) -> str: return f"{role.__module__}.{role.__class__.__name__}" -def get_impl_location(impl: Any) -> Optional[str]: - """Get the implementation location of the given directive""" +def get_impl_location(impl: Any) -> Optional[types.Location]: + """Get the implementation location of the given role""" try: if (filepath := inspect.getsourcefile(impl)) is None: @@ -45,7 +46,7 @@ def get_impl_location(impl: Any) -> Optional[str]: ), ) - return as_json(location) + return location except Exception: # TODO: Log the error somewhere.. return None @@ -57,8 +58,8 @@ def index_roles(app: Sphinx): roles: Dict[str, types.Role] = {} # Process the roles registered through Sphinx - for name, impl in app.esbonio._roles: - roles[name] = types.Role(name, get_impl_name(impl)) + for name, impl, providers in app.esbonio._roles: + roles[name] = types.Role(name, get_impl_name(impl), target_providers=providers) # Look any remaining docutils provided roles found_roles = { @@ -74,7 +75,9 @@ def index_roles(app: Sphinx): app.esbonio.db.ensure_table(ROLES_TABLE) app.esbonio.db.clear_table(ROLES_TABLE) - app.esbonio.db.insert_values(ROLES_TABLE, [r.to_db() for r in roles.values()]) + app.esbonio.db.insert_values( + ROLES_TABLE, [r.to_db(as_json) for r in roles.values()] + ) def setup(app: Sphinx): diff --git a/lib/esbonio/esbonio/sphinx_agent/types/lsp.py b/lib/esbonio/esbonio/sphinx_agent/types/lsp.py new file mode 100644 index 000000000..3e09fd557 --- /dev/null +++ b/lib/esbonio/esbonio/sphinx_agent/types/lsp.py @@ -0,0 +1,36 @@ +from __future__ import annotations + +import enum +from dataclasses import dataclass + + +@dataclass(frozen=True) +class Position: + line: int + character: int + + +@dataclass(frozen=True) +class Range: + start: Position + end: Position + + +@dataclass(frozen=True) +class Location: + uri: str + range: Range + + +class DiagnosticSeverity(enum.IntEnum): + Error = 1 + Warning = 2 + Information = 3 + Hint = 4 + + +@dataclass(frozen=True) +class Diagnostic: + range: Range + message: str + severity: DiagnosticSeverity diff --git a/lib/esbonio/esbonio/sphinx_agent/types/roles.py b/lib/esbonio/esbonio/sphinx_agent/types/roles.py index 17cdc2306..a32d5c140 100644 --- a/lib/esbonio/esbonio/sphinx_agent/types/roles.py +++ b/lib/esbonio/esbonio/sphinx_agent/types/roles.py @@ -2,22 +2,53 @@ import typing from dataclasses import dataclass +from dataclasses import field if typing.TYPE_CHECKING: + from typing import Any + from typing import Callable + from typing import Dict + from typing import List from typing import Optional from typing import Tuple + from .lsp import Location + @dataclass class Role: """Represents a role.""" + @dataclass + class TargetProvider: + """A target provider instance.""" + + name: str + """The name of the provider.""" + + kwargs: Dict[str, Any] = field(default_factory=dict) + """Arguments to pass to the target provider.""" + name: str """The name of the role, as the user would type in an rst file.""" implementation: Optional[str] """The dotted name of the role's implementation.""" - def to_db(self) -> Tuple[str, Optional[str], None]: + location: Optional[Location] = field(default=None) + """The location of the role's implementation, if known.""" + + target_providers: List[TargetProvider] = field(default_factory=list) + """The list of target providers that can be used with this role.""" + + def to_db( + self, dumps: Callable[[Any], str] + ) -> Tuple[str, Optional[str], Optional[str], Optional[str]]: """Convert this role to its database representation.""" - return (self.name, self.implementation, None) + if len(self.target_providers) > 0: + providers = dumps(self.target_providers) + else: + providers = None + + location = dumps(self.location) if self.location is not None else None + return (self.name, self.implementation, location, providers) diff --git a/lib/esbonio/esbonio/sphinx_agent/util.py b/lib/esbonio/esbonio/sphinx_agent/util.py index f0da0347a..66a6a900f 100644 --- a/lib/esbonio/esbonio/sphinx_agent/util.py +++ b/lib/esbonio/esbonio/sphinx_agent/util.py @@ -1,6 +1,7 @@ import dataclasses import json import logging +import pathlib import sys from typing import Any from typing import Union @@ -11,7 +12,10 @@ def _serialize_message(obj): - if isinstance(obj, _TranslationProxy): + if dataclasses.is_dataclass(obj): + return dataclasses.asdict(obj) + + if isinstance(obj, (_TranslationProxy, pathlib.Path)): return str(obj) if isinstance(obj, set): @@ -21,9 +25,6 @@ def _serialize_message(obj): def as_json(data: Any) -> str: - if dataclasses.is_dataclass(data): - data = dataclasses.asdict(data) - return json.dumps(data, default=_serialize_message) From 4f8f255f91d089ebb7dca02ced8cce176138acdb Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Sun, 26 May 2024 16:19:22 +0100 Subject: [PATCH 43/60] sphinx-agent: Record domain objects in the database This defines a new `objects` table where we can store objects from a domain that can be cross-referenced. I initially wanted to discover domain objects incrementally using the `object-description-transform` event to avoid what I am sure will become a performance issue - looping over every object in every domain on every build... However, nothing is that simple, not only does the event not give you the name of the object(!) it is not even called for every object. e.g. `py:module` and `std:doc` So, we instead do both! The `object-description-transform` event is still useful as it gives us the chance to get the object's description and precise location. When calling `get_objects()` becomes an issue, we will have to try and come up with a better approach. --- .../esbonio/sphinx_agent/handlers/__init__.py | 1 + .../esbonio/sphinx_agent/handlers/domains.py | 116 ++++++++++++++++++ lib/esbonio/tests/sphinx-agent/conftest.py | 28 ++++- .../sphinx-agent/handlers/test_database.py | 10 ++ .../sphinx-agent/handlers/test_domains.py | 54 ++++++++ .../tests/workspaces/demo/rst/domains.rst | 4 + .../workspaces/demo/rst/domains/python.rst | 74 +++++++++++ 7 files changed, 285 insertions(+), 2 deletions(-) create mode 100644 lib/esbonio/esbonio/sphinx_agent/handlers/domains.py create mode 100644 lib/esbonio/tests/sphinx-agent/handlers/test_domains.py create mode 100644 lib/esbonio/tests/workspaces/demo/rst/domains.rst create mode 100644 lib/esbonio/tests/workspaces/demo/rst/domains/python.rst diff --git a/lib/esbonio/esbonio/sphinx_agent/handlers/__init__.py b/lib/esbonio/esbonio/sphinx_agent/handlers/__init__.py index 8bf9f7297..ddd60f478 100644 --- a/lib/esbonio/esbonio/sphinx_agent/handlers/__init__.py +++ b/lib/esbonio/esbonio/sphinx_agent/handlers/__init__.py @@ -34,6 +34,7 @@ f"{__name__}.symbols", f"{__name__}.directives", f"{__name__}.roles", + f"{__name__}.domains", ) diff --git a/lib/esbonio/esbonio/sphinx_agent/handlers/domains.py b/lib/esbonio/esbonio/sphinx_agent/handlers/domains.py new file mode 100644 index 000000000..661f693e7 --- /dev/null +++ b/lib/esbonio/esbonio/sphinx_agent/handlers/domains.py @@ -0,0 +1,116 @@ +from __future__ import annotations + +import typing + +from sphinx import addnodes + +from .. import types +from ..app import Database +from ..app import Sphinx +from ..util import as_json + +if typing.TYPE_CHECKING: + from typing import Dict + from typing import Optional + from typing import Tuple + +OBJECTS_TABLE = Database.Table( + "objects", + [ + Database.Column(name="name", dtype="TEXT"), + Database.Column(name="display", dtype="TEXT"), + Database.Column(name="domain", dtype="TEXT"), + Database.Column(name="objtype", dtype="TEXT"), + Database.Column(name="docname", dtype="TEXT"), + Database.Column(name="description", dtype="TEXT"), + Database.Column(name="location", dtype="JSON"), + ], +) + + +class DomainObjects: + """Discovers and indexes domain objects.""" + + def __init__(self, app: Sphinx): + self._info: Dict[ + Tuple[str, str, str, str], Tuple[Optional[str], Optional[str]] + ] = {} + + app.connect("builder-inited", self.init_db) + app.connect("object-description-transform", self.object_defined) + app.connect("build-finished", self.commit) + + def init_db(self, app: Sphinx): + """Prepare the database.""" + app.esbonio.db.ensure_table(OBJECTS_TABLE) + + def commit(self, app, exc): + """Commit changes to the database. + + The only way to guarantee we discover all objects, from all domains correctly, + is to call the ``get_objects()`` method on each domain. This means we process + every object, every time we build. + + I will be *very* surprised if this never becomes a performance issue, but we + will have to think of a smarter approach when it comes to it. + """ + app.esbonio.db.clear_table(OBJECTS_TABLE) + rows = [] + + for name, domain in app.env.domains.items(): + for objname, dispname, objtype, docname, _, _ in domain.get_objects(): + desc, location = self._info.get( + (objname, name, objtype, docname), (None, None) + ) + rows.append( + (objname, str(dispname), name, objtype, docname, desc, location) + ) + + app.esbonio.db.insert_values(OBJECTS_TABLE, rows) + self._info.clear() + + def object_defined( + self, app: Sphinx, domain: str, objtype: str, content: addnodes.desc_content + ): + """Record additional information about a domain object. + + Despite having a certain amount of structure to them (thanks to the API), + domains can still do arbitrary things - take a peek at the implementations of + the ``std``, ``py`` and ``cpp`` domains! + + So while this will never be perfect, this method is called each time the + ``object-description-transform`` event is fired and attempts to extract the + object's description and precise location. + + The trick however, is linking these items up with the correct object + """ + + sig = content.parent[0] + + try: + name = sig["ids"][0] # type: ignore[index] + except Exception: + return + + docname = app.env.docname + description = content.astext() + + if (source := sig.source) is not None and (line := sig.line) is not None: + location = as_json( + types.Location( + uri=str(types.Uri.for_file(source)), + range=types.Range( + start=types.Position(line=line, character=0), + end=types.Position(line=line + 1, character=0), + ), + ) + ) + else: + location = None + + key = (name, domain, objtype, docname) + self._info[key] = (description, location) + + +def setup(app: Sphinx): + DomainObjects(app) diff --git a/lib/esbonio/tests/sphinx-agent/conftest.py b/lib/esbonio/tests/sphinx-agent/conftest.py index e98e86296..65197f669 100644 --- a/lib/esbonio/tests/sphinx-agent/conftest.py +++ b/lib/esbonio/tests/sphinx-agent/conftest.py @@ -1,9 +1,12 @@ import logging +import pathlib import sys +import pytest import pytest_asyncio from lsprotocol.types import WorkspaceFolder from pygls.workspace import Workspace +from sphinx.application import Sphinx from esbonio.server.features.project_manager import Project from esbonio.server.features.sphinx_manager.client import ClientState @@ -18,9 +21,13 @@ logger = logging.getLogger(__name__) +@pytest.fixture +def build_dir(tmp_path_factory): + return tmp_path_factory.mktemp("build") + + @pytest_asyncio.fixture -async def client(uri_for, tmp_path_factory): - build_dir = tmp_path_factory.mktemp("build") +async def client(uri_for, build_dir): demo_workspace = uri_for("workspaces", "demo") test_uri = demo_workspace / "index.rst" @@ -52,6 +59,23 @@ async def client(uri_for, tmp_path_factory): await sphinx_client.stop() +@pytest.fixture() +def app(client, uri_for, build_dir): + """Sphinx application instance, used for validating results. + + While we don't use it directly, depending on the ``client`` fixture ensures that the build has + completed and the ``environment.pickle`` file is there ready for us to use. + """ + demo_workspace = uri_for("workspaces", "demo") + return Sphinx( + srcdir=demo_workspace.fs_path, + confdir=demo_workspace.fs_path, + outdir=str(pathlib.Path(build_dir, "html")), + doctreedir=str(pathlib.Path(build_dir, "doctrees")), + buildername="html", + ) + + @pytest_asyncio.fixture async def project(client: SubprocessSphinxClient): project = Project(client.db) diff --git a/lib/esbonio/tests/sphinx-agent/handlers/test_database.py b/lib/esbonio/tests/sphinx-agent/handlers/test_database.py index d6f6ae234..0e1568b82 100644 --- a/lib/esbonio/tests/sphinx-agent/handlers/test_database.py +++ b/lib/esbonio/tests/sphinx-agent/handlers/test_database.py @@ -34,6 +34,16 @@ async def test_files_table(client: SubprocessSphinxClient, project: Project): "rst/diagnostics", "rst/diagnostics.html", ), + ( + anuri(src, "rst", "domains.rst"), + "rst/domains", + "rst/domains.html", + ), + ( + anuri(src, "rst", "domains", "python.rst"), + "rst/domains/python", + "rst/domains/python.html", + ), (anuri(src, "rst", "symbols.rst"), "rst/symbols", "rst/symbols.html"), (anuri(src, "myst", "roles.md"), "myst/roles", "myst/roles.html"), ( diff --git a/lib/esbonio/tests/sphinx-agent/handlers/test_domains.py b/lib/esbonio/tests/sphinx-agent/handlers/test_domains.py new file mode 100644 index 000000000..e1c07c5fc --- /dev/null +++ b/lib/esbonio/tests/sphinx-agent/handlers/test_domains.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +import typing + +import pytest + +from esbonio.server.features.project_manager import Project + +if typing.TYPE_CHECKING: + from sphinx.application import Sphinx + + +@pytest.mark.asyncio +async def test_python_domain_discovery(app: Sphinx, project: Project): + """Ensure that we can correctly index all the objects associated with the Python domain.""" + + expected = set() + domain = app.env.domains["py"] + + for name, _, objtype, docname, _, _ in domain.get_objects(): + expected.add((name, objtype, docname)) + + actual = set() + db = await project.get_db() + cursor = await db.execute( + "SELECT name, objtype, docname FROM objects where domain = 'py'" + ) + + for item in await cursor.fetchall(): + actual.add(item) + + assert expected == actual + + +@pytest.mark.asyncio +async def test_std_domain_discovery(app: Sphinx, project: Project): + """Ensure that we can correctly index all the objects associated with the Python domain.""" + + expected = set() + domain = app.env.domains["std"] + + for name, _, objtype, docname, _, _ in domain.get_objects(): + expected.add((name, objtype, docname)) + + actual = set() + db = await project.get_db() + cursor = await db.execute( + "SELECT name, objtype, docname FROM objects where domain = 'std'" + ) + + for item in await cursor.fetchall(): + actual.add(item) + + assert expected == actual diff --git a/lib/esbonio/tests/workspaces/demo/rst/domains.rst b/lib/esbonio/tests/workspaces/demo/rst/domains.rst new file mode 100644 index 000000000..f0d695c6a --- /dev/null +++ b/lib/esbonio/tests/workspaces/demo/rst/domains.rst @@ -0,0 +1,4 @@ +.. toctree:: + :glob: + + domains/* diff --git a/lib/esbonio/tests/workspaces/demo/rst/domains/python.rst b/lib/esbonio/tests/workspaces/demo/rst/domains/python.rst new file mode 100644 index 000000000..06013656c --- /dev/null +++ b/lib/esbonio/tests/workspaces/demo/rst/domains/python.rst @@ -0,0 +1,74 @@ +Python Domain +============= + +The Python domain provides a set of roles and directives for documenting Python code. +Consider the following:: + + import re + + DEFAULT_PATTERN = re.compile(r"\b\w+\b") + + + class NoMatchesError(RuntimeError): + pass + + class PatternCounter: + def __init__(self, pattern=None): + self._pattern = pattern or DEFAULT_PATTERN + + @classmethod + def fromstr(cls, pattern: str): + return cls(re.compile(pattern)) + + @property + def pattern(self): + return self._pattern + + def count(self, text: str) -> int: + if (num_matches := len(self.pattern.findall(text))) == 0: + raise NoMatchesError() + + return num_matches + + def count_numbers(text: str): + pattern = re.compile(r"\b\d+\b") + counter = PatternCounter(pattern) + + return counter.count(text) + +You could use the Python domain as follows to document it + +.. module:: counters.pattern + +.. exception:: NoMatchesError(RuntimeError) + + Raised when the :class:`PatternCounter` class does not find any matches. + +.. data:: DEFAULT_PATTERN + :type: re.Pattern + :value: re.compile(r"\b\w+\b") + + The default pattern used when creating an instance of :class:`PatternCounter` with no arguments. + +.. class:: PatternCounter(pattern=None) + + This counter implementation counts the occurances of the given regular expression in a string. + If ``pattern`` is ``None``, :data:`DEFAULT_PATTERN` will be used. + + .. classmethod:: fromstr(cls, pattern: str) + + Helper for creating a ``PatternCounter`` instance from a string + + .. property:: pattern + :type: re.Pattern + + The pattern used by this instance + + .. method:: count(self, text: str) -> int + + Return the number of matches found in the given ``text``. + Raises a :exc:`NoMatchesError` if no matches can be found. + +.. function:: count_numbers(text: str) -> int + + Helper function for counting the amount of numbers contained in the given ``text``. From 5384adc9a94b716deed6e9a0e8a58c8cf271e6a0 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Sun, 26 May 2024 16:26:54 +0100 Subject: [PATCH 44/60] sphinx-agent: Reorganise some types --- .../esbonio/sphinx_agent/types/__init__.py | 166 ++---------------- .../esbonio/sphinx_agent/types/roles.py | 114 ++++++++++++ 2 files changed, 133 insertions(+), 147 deletions(-) diff --git a/lib/esbonio/esbonio/sphinx_agent/types/__init__.py b/lib/esbonio/esbonio/sphinx_agent/types/__init__.py index 90a2f3c14..bd27df1c3 100644 --- a/lib/esbonio/esbonio/sphinx_agent/types/__init__.py +++ b/lib/esbonio/esbonio/sphinx_agent/types/__init__.py @@ -5,7 +5,6 @@ """ import dataclasses -import enum import os import pathlib import re @@ -17,9 +16,27 @@ from typing import Union from urllib import parse +from .lsp import Diagnostic +from .lsp import DiagnosticSeverity +from .lsp import Location +from .lsp import Position +from .lsp import Range +from .roles import MYST_ROLE +from .roles import RST_DEFAULT_ROLE +from .roles import RST_ROLE from .roles import Role -__all__ = ("Role",) +__all__ = ( + "Diagnostic", + "DiagnosticSeverity", + "Location", + "MYST_ROLE", + "Position", + "RST_DEFAULT_ROLE", + "RST_ROLE", + "Range", + "Role", +) MYST_DIRECTIVE: "re.Pattern" = re.compile( r""" @@ -41,52 +58,6 @@ initial declaration. """ -MYST_ROLE: "re.Pattern" = re.compile( - r""" - ([^\w`]|^\s*) # roles cannot be preceeded by letter chars - (?P - { # roles start with a '{' - (?P[:\w-]+)? # roles have a name - }? # roles end with a '}' - ) - (?P - ` # targets begin with a '`' character - ((?P[^<`>]*?)<)? # targets may specify an alias - (?P[!~])? # targets may have a modifier - (?P