diff --git a/.all-contributorsrc b/.all-contributorsrc index 16d00c5e3..ccbbece52 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -295,6 +295,15 @@ "contributions": [ "code" ] + }, + { + "login": "ivanortegaalba", + "name": "Ivan Ortega Alba", + "avatar_url": "https://avatars.githubusercontent.com/u/5699976?v=4", + "profile": "https://github.com/ivanortegaalba", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7 diff --git a/CHANGELOG.md b/CHANGELOG.md index 76e5ee4bd..8dbd184f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,96 @@ +# (Thu Oct 03 2024) + +#### πŸ› Bug Fix + +- `@grafana/plugin-types-bundler@0.0.2` + - Types-bundler: Update readme [#1162](https://github.com/grafana/plugin-tools/pull/1162) ([@jackw](https://github.com/jackw)) + +#### Authors: 1 + +- Jack Westbrook ([@jackw](https://github.com/jackw)) + +--- + +# (Thu Oct 03 2024) + +#### πŸ› Bug Fix + +- `@grafana/create-plugin@5.4.2` + - Create Plugin: Remove topnav feature flag from Scenes templates [#1139](https://github.com/grafana/plugin-tools/pull/1139) ([@jackw](https://github.com/jackw)) + - Update grafana patch dependencies [#1156](https://github.com/grafana/plugin-tools/pull/1156) ([@renovate[bot]](https://github.com/renovate[bot])) + +#### Authors: 2 + +- [@renovate[bot]](https://github.com/renovate[bot]) +- Jack Westbrook ([@jackw](https://github.com/jackw)) + +--- + +# (Wed Oct 02 2024) + +#### πŸ› Bug Fix + +- `@grafana/plugin-e2e@1.8.3` + - Plugin E2e: Support scenes powered dashboard UI [#1155](https://github.com/grafana/plugin-tools/pull/1155) ([@sunker](https://github.com/sunker)) + +#### Authors: 1 + +- Erik Sundell ([@sunker](https://github.com/sunker)) + +--- + +# (Tue Oct 01 2024) + +#### πŸ› Bug Fix + +- `@grafana/create-plugin@5.4.1` + - Update grafana dependencies [#1113](https://github.com/grafana/plugin-tools/pull/1113) ([@renovate[bot]](https://github.com/renovate[bot])) + - Update grafana patch dependencies [#1141](https://github.com/grafana/plugin-tools/pull/1141) ([@renovate[bot]](https://github.com/renovate[bot])) + +#### Authors: 1 + +- [@renovate[bot]](https://github.com/renovate[bot]) + +--- + +# (Mon Sep 30 2024) + +#### πŸš€ Enhancement + +- `@grafana/create-plugin@5.4.0` + - Create Plugin: Update go sdk when running update cmd [#1143](https://github.com/grafana/plugin-tools/pull/1143) ([@jackw](https://github.com/jackw)) + +#### Authors: 1 + +- Jack Westbrook ([@jackw](https://github.com/jackw)) + +--- + +# (Mon Sep 30 2024) + +:tada: This release contains work from a new contributor! :tada: + +Thank you, Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)), for all your work! + +#### πŸ› Bug Fix + +- `@grafana/plugin-e2e@1.8.2` + - Update dashboard variables settings URL [#1144](https://github.com/grafana/plugin-tools/pull/1144) ([@ivanortegaalba](https://github.com/ivanortegaalba)) +- `@grafana/create-plugin@5.3.12` + - Switch to createDataFrame [#1133](https://github.com/grafana/plugin-tools/pull/1133) ([@tolzhabayev](https://github.com/tolzhabayev)) + +#### πŸ”© Dependency Updates + +- Chore(deps-dev): Bump vite from 5.2.11 to 5.4.8 [#1135](https://github.com/grafana/plugin-tools/pull/1135) ([@dependabot[bot]](https://github.com/dependabot[bot])) + +#### Authors: 3 + +- [@dependabot[bot]](https://github.com/dependabot[bot]) +- Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)) +- Timur Olzhabayev ([@tolzhabayev](https://github.com/tolzhabayev)) + +--- + # (Wed Sep 25 2024) #### πŸ› Bug Fix diff --git a/README.md b/README.md index dfa3d09a0..4021e302c 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Kevin Yu

πŸ’»
Ashley Harrison

πŸ’» + +
Ivan Ortega Alba

πŸ’» + diff --git a/docusaurus/docs/get-started/best-practices.md b/docusaurus/docs/get-started/best-practices.md index cdbad0199..b0e9866c5 100644 --- a/docusaurus/docs/get-started/best-practices.md +++ b/docusaurus/docs/get-started/best-practices.md @@ -7,7 +7,7 @@ keywords: - plugins - plugin - best practices -sidebar_position: 10 +sidebar_position: 30 --- # Best practices for plugin development diff --git a/docusaurus/docs/get-started/folder-structure.md b/docusaurus/docs/get-started/folder-structure.md deleted file mode 100644 index d03b245be..000000000 --- a/docusaurus/docs/get-started/folder-structure.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -id: folder-structure -title: Folder structure -description: How your folder structure should look after running create-plugin. -keywords: - - grafana - - plugins - - plugin - - create-plugin - - folders -sidebar_position: 60 ---- - -After you [Run](./get-started.mdx#run-the-create-plugin-tool) the `create-plugin` tool and have answered the prompts, your project should look similar to this: - -``` -myorg-myplugin-datasource/ -β”œβ”€β”€ .config/ -β”œβ”€β”€ .eslintrc -β”œβ”€β”€ .github -β”‚Β Β  └── workflows -β”œβ”€β”€ .gitignore -β”œβ”€β”€ .nvmrc -β”œβ”€β”€ .prettierrc.js -β”œβ”€β”€ CHANGELOG.md -β”œβ”€β”€ LICENSE -β”œβ”€β”€ Magefile.go -β”œβ”€β”€ README.md -β”‚Β Β  └── integration -β”œβ”€β”€ docker-compose.yaml -β”œβ”€β”€ go.mod -β”œβ”€β”€ go.sum -β”œβ”€β”€ jest-setup.js -β”œβ”€β”€ jest.config.js -β”œβ”€β”€ node_modules -β”œβ”€β”€ package.json -β”œβ”€β”€ pkg -β”‚Β Β  β”œβ”€β”€ main.go -β”‚Β Β  └── plugin -β”œβ”€β”€ playwright.config.ts -β”œβ”€β”€ src -β”‚Β Β  β”œβ”€β”€ README.md -β”‚Β Β  β”œβ”€β”€ components -β”‚Β Β  β”œβ”€β”€ datasource.ts -β”‚Β Β  β”œβ”€β”€ img -β”‚Β Β  β”œβ”€β”€ module.ts -β”‚Β Β  β”œβ”€β”€ plugin.json -β”‚Β Β  └── types.ts -β”œβ”€β”€ tsconfig.json -└── tests -``` - -## Required files - -You must have files with these exact filenames: - -| Filename | Description | -| ------------------- | -------------------------------------------------------------------------------------------------------- | -| `./go.mod` | Go modules dependencies. Refer to [Golang documentation](https://golang.org/cmd/go/#hdr-The_go_mod_file) | -| `./src/plugin.json` | A JSON file describing the plugin. | -| `./src/module.ts` | The entry point of the frontend plugin. | -| `./pkg/main.go` | The entry point of the backend plugin. | - -## Optional files - -These files in your project are optional: - -| Filename | Description | -| --------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `./Magefile.go` | We strongly recommend using mage build files so that you can use the build targets provided by the backend plugin SDK. | diff --git a/docusaurus/docs/get-started/get-started.mdx b/docusaurus/docs/get-started/get-started.mdx index bc3a6b5d1..fd7615a20 100644 --- a/docusaurus/docs/get-started/get-started.mdx +++ b/docusaurus/docs/get-started/get-started.mdx @@ -167,7 +167,7 @@ The file structure should look like this: └── tsconfig.json ``` -For more information about these files, refer to [Folder structure](/get-started/folder-structure/). +For more information about these files, refer to [Anatomy of a plugin](/key-concepts/anatomy-of-a-plugin/). ## Build and run your plugin in Docker diff --git a/docusaurus/docs/how-to-guides/data-source-plugins/add-features-for-explore-queries.md b/docusaurus/docs/how-to-guides/data-source-plugins/add-features-for-explore-queries.md index 549064e7b..0ffe334d8 100644 --- a/docusaurus/docs/how-to-guides/data-source-plugins/add-features-for-explore-queries.md +++ b/docusaurus/docs/how-to-guides/data-source-plugins/add-features-for-explore-queries.md @@ -66,7 +66,7 @@ However, if you want a custom visualization, you can add a hint to your returned Construct a data frame with specific metadata like this: ```ts -const firstResult = new MutableDataFrame({ +const firstResult = createDataFrame({ fields: [...], meta: { preferredVisualisationType: 'logs', diff --git a/docusaurus/docs/key-concepts/anatomy-of-a-plugin.md b/docusaurus/docs/key-concepts/anatomy-of-a-plugin.md new file mode 100644 index 000000000..ff687793f --- /dev/null +++ b/docusaurus/docs/key-concepts/anatomy-of-a-plugin.md @@ -0,0 +1,184 @@ +--- +id: anatomy-of-a-plugin +title: Anatomy of a plugin +description: This guide describes the anatomy of a plugin, including the individual components that make up each plugin type. +keywords: + - grafana + - plugins + - plugin + - create-plugin + - folders + - anatomy + - components + - apps + - data sources + - panels +sidebar_position: 0 +--- + +# Anatomy of a plugin + +Grafana plugins enable you to extend Grafana’s core functionality by adding custom features, such as new data sources, visualizations, or entire applications. + +This guide walks you through the essential components of a Grafana plugin, and how to structure and organize them. You'll learn about the folder structure generated by the `create-plugin` tool, and where to go next to learn how to build and extend a plugin using the scaffolded template. + +## Before you begin + +Before proceeding, we recommend reviewing the [plugin types and usage guide](/key-concepts/plugin-types-usage) to gain a basic understanding of the different types of plugins available. + +Each Grafana plugin is composed of several essential components that extend Grafana’s functionality in different ways. First, we’ll explore the core parts of each of the three primary plugin types: apps, data sources, and panels. + +![The different available plugin types: app, data source, and panel](./images/plugin-types.png) + +## App plugins + +App plugins provide maximum flexibility, allowing developers to build custom experiences that go beyond basic visualization or data interaction. They can include custom pages, backends for server-side logic, and UI extensions that hook into Grafana’s core functionality. + +![The components of an app plugin](./images/app-plugin.png) + +### Pages + +Apps can add custom pages accessible from the Grafana navigation. These pages are essentially React components that allow developers to create custom user interfaces. To add a page, developers can use the `PluginPage` component from the `@grafana/runtime` package. You can [learn more about adding pages to apps](/tutorials/build-an-app-plugin#add-a-page-in-the-navigation-menu) in our app tutorial. + +![An example custom app page](./images/app-pages.png) + +### Configuration + +App plugins often include configuration pages where users can input necessary settings like API credentials or other parameters. You can [learn more about adding configuration pages to apps](/tutorials/build-an-app-plugin#configuration-page) in our app tutorial. + +![An example app configuration page](./images/app-configuration.png) + +### UI extensions + +App plugins can register and expose UI extensions that hook into core Grafana features, providing additional functionality or interaction points. These extension points allow for powerful integrations with Grafana’s UI. You can [learn more about UI extensions](/how-to-guides/ui-extensions/) in our how-to guides. + +![An example panel visualization](./images/ui-extension.png) + +### Health check + +Apps can define health checks to ensure that the plugin is properly configured and operational. You can customize these checks based on the plugin’s backend logic. See our [example health check](https://github.com/grafana/grafana-plugin-examples/blob/7d761244d370ad91715c68e24e6d83852d8e5b11/examples/app-with-backend/pkg/plugin/app.go#L47) for implementation details. + +### Call resource + +Apps can have backends to handle server-side functionality, such as making external API calls or processing more advanced authentication methods. The `CallResourceHandler` method is commonly used for this purpose. See our [app with backend example](https://github.com/grafana/grafana-plugin-examples/tree/main/examples/app-with-backend) for implementation details. + +### Nested plugins + +App plugins can bundle multiple plugins, such as data sources or panels, into a single installable package. This approach is useful for services that require a combination of plugins for full functionality. You can [learn more about working with nested plugins](/how-to-guides/app-plugins/work-with-nested-plugins) in our documentation. + +## Data source plugins + +Data source plugins allow Grafana to connect to external services, configure queries, and display data. They can include frontend-only or full-stack components (with a backend). + +![The components of a Data Source plugin](./images/data-source-plugin.png) + +### Config editor + +The config editor is where users provide connection details (for example, API keys, URLs) for the external service when configuring a specific instance of the data source. To define the config editor, use `setConfigEditor()` and pass a custom configuration component. You can see [how to define a config editor in our basic data source plugin example](https://github.com/grafana/grafana-plugin-examples/blob/main/examples/datasource-basic/src/components/ConfigEditor/ConfigEditor.tsx). + +Ensure that your sensitive data is stored securely using `secureJson`. Read our guide on [adding authentication for data source plugins](/how-to-guides/data-source-plugins/add-authentication-for-data-source-plugins#store-configuration-in-securejsondata) for more details. + +![An example Data Source config editor](./images/datasource-configeditor.png) + +### Query editor + +The query editor allows users to construct queries against the connected service. This editor is used when adding a panel in a dashboard, when using Explore, and when creating a new Alert Rule. Query editors can be customized to provide a [code editor](https://github.com/grafana/grafana/blob/main/packages/grafana-ui/src/components/Monaco/CodeEditor.tsx) as well as a guided query builder. You can see [how to define a query editor in our data source plugin example](https://github.com/grafana/grafana-plugin-examples/blob/main/examples/datasource-basic/src/components/QueryEditor/QueryEditor.tsx). + +![An example data source query editor](./images/datasource-queryeditor.png) + +### Health check + +The "Save and Test" button in the data source config page allows users to verify that the connection works. Plugins can customize this behavior by [adding custom health checks](/how-to-guides/data-source-plugins/convert-a-frontend-datasource-to-backend#health-check). + +![A data source health check being performed](./images/datasource-healthcheck.png) + +### Query data + +The `QueryData` method processes multiple queries and returns corresponding responses. Each query includes a `RefID`, which is mapped to its response in a `QueryDataResponse`. The method loops through the queries, processes them individually, and returns either the result or an error with an appropriate status code. + +This approach allows for efficient handling of multiple queries, with built-in logging and error management to ensure smooth operation. + +Take a look at the [QueryData implementation in our data source example](https://github.com/grafana/grafana-plugin-examples/blob/main/examples/datasource-http-backend/pkg/plugin/datasource.go#L99). + +### Call resource + +Custom endpoints allow a data source plugin to expose custom HTTP API routes for server-side functionality. This is particularly useful when dealing with authentication, advanced queries, or processing large datasets. You can create custom endpoints in the backend by using the `CallResourceHandler` method to handle requests and respond with data or status information. + +For an example of how to implement custom endpoints, refer to the [app with backend example](https://github.com/grafana/grafana-plugin-examples/blob/main/examples/app-with-backend/pkg/plugin/resources.go). + +## Panel plugins + +Panel plugins enhance Grafana by offering custom components that provide unique data visualizations or other useful widget-like functionality within dashboards. + +![The components of a panel plugin](./images/panel-plugin.png) + +### Visualization + +Panel plugins provide visual representations of data in Grafana dashboards. To create a custom visualization, developers use React components to define how data will be rendered on the dashboard. This visualization can be anything from a simple chart to a complex interactive widget. The panel’s `render()` function defines how the data is passed into the visualization and how updates are handled when data or options change. + +For more details on panel visualizations, refer to the [panel plugin example](https://github.com/grafana/grafana-plugin-examples/tree/main/examples/panel-basic). + +![An example panel visualization](./images/panel-visualization.png) + +### Panel options + +Panel options allow users to customize the behavior and appearance of the panel plugin. You can define these options by implementing the `OptionsEditor` component, which can expose options relevant to the visualization. These options are passed into the panel’s `render()` function, allowing for dynamic updates based on user inputs. + +You can see an example of how to implement panel options in the [basic panel example](https://github.com/grafana/grafana-plugin-examples/blob/main/examples/panel-basic/src/types.ts#L5). + +![An example of custom panel options on the right](./images/panel-options.png) + +## Plugin folder structure + +Run the `create-plugin` tool to generate a new folder for your plugin. The plugin folder follows a standard naming convention (for example, `organization-pluginName-pluginType`) and contains all the necessary files for building, running, and testing your plugin. + +Here's an overview of the folder layout and key files: + +``` +myorg-myplugin-datasource/ +β”œβ”€β”€ pkg/ +β”‚ β”œβ”€β”€ main.go +β”‚ └── plugin/ +β”œβ”€β”€ src/ +β”‚ β”œβ”€β”€ module.ts +β”‚ β”œβ”€β”€ plugin.json +└── tests/ +β”œβ”€β”€ CHANGELOG.md +β”œβ”€β”€ docker-compose.yaml +β”œβ”€β”€ go.mod +β”œβ”€β”€ package.json +β”œβ”€β”€ LICENSE +β”œβ”€β”€ Magefile.go +β”œβ”€β”€ README.md +``` + +:::note + +The `create-plugin` CLI tool is constantly being improved and as such there may be minor differences between this documentation and your scaffolded plugin project. + +::: + +### Key plugin files + +The following files are crucial for your plugin's development and functionality: + +- **Frontend code** (`src/`): This directory contains all the frontend code for your plugin. The main files to be aware of here are `plugin.json` and `module.ts`. + - `plugin.json`: Stores [metadata about your plugin](/reference/plugin-json), including information like its description, supported Grafana versions, and dependencies. + - `module.ts`: The entry point for your plugin's frontend logic. +- **Backend code** (`pkg/`): If your plugin includes backend functionality, the code will reside in this directory, typically within `pkg/plugin/`. Backend plugins are written in Go, and `main.go` serves as the entry point for your backend logic. +- **Test files** (`tests/`): This folder contains your plugin’s test files, typically suffixed with `.spec.ts` for frontend tests. You can [learn more about testing your plugin](/e2e-test-a-plugin/introduction) in our E2E testing guide. +- **Other files**: + - `docker-compose.yaml`: Contains the Docker configuration for running a local development instance of Grafana. + - `CHANGELOG.md`: Documents the history of changes and updates made to the plugin. + - `README.md`: Provides an overview of the plugin, including installation instructions and usage guidelines. + +## Next steps + +Now that you have an understanding of the essential components of a Grafana plugin and the structure of the project, we have some resources to recommend: + +- **Tutorials**: Dive deeper into specific plugin development tasks with our [Grafana plugin tutorials](/tutorials). These guides will help you create and customize data sources, panels, and app plugins. +- **Plugin Examples**: Check out the [Grafana Plugin Examples repository](https://github.com/grafana/grafana-plugin-examples) on GitHub for sample projects showcasing various types of plugins. +- **Community**: Join the [Grafana Community](https://community.grafana.com/c/plugin-development/30) to get advice, share experiences, and seek help from other plugin developers. +- **Plugin Publishing**: When you’re ready to share your plugin, [learn how to publish a Grafana plugin](/publish-a-plugin/publish-a-plugin). + +These resources will guide you through the finer details of building, testing, and eventually publishing your plugin, ensuring you have a smooth development process. diff --git a/docusaurus/docs/key-concepts/images/app-configuration.png b/docusaurus/docs/key-concepts/images/app-configuration.png new file mode 100644 index 000000000..7f2f4beb8 Binary files /dev/null and b/docusaurus/docs/key-concepts/images/app-configuration.png differ diff --git a/docusaurus/docs/key-concepts/images/app-pages.png b/docusaurus/docs/key-concepts/images/app-pages.png new file mode 100644 index 000000000..e7c0567a9 Binary files /dev/null and b/docusaurus/docs/key-concepts/images/app-pages.png differ diff --git a/docusaurus/docs/key-concepts/images/app-plugin.png b/docusaurus/docs/key-concepts/images/app-plugin.png new file mode 100644 index 000000000..6eeef7a91 Binary files /dev/null and b/docusaurus/docs/key-concepts/images/app-plugin.png differ diff --git a/docusaurus/docs/key-concepts/images/data-source-plugin.png b/docusaurus/docs/key-concepts/images/data-source-plugin.png new file mode 100644 index 000000000..c7e657f25 Binary files /dev/null and b/docusaurus/docs/key-concepts/images/data-source-plugin.png differ diff --git a/docusaurus/docs/key-concepts/images/datasource-configeditor.png b/docusaurus/docs/key-concepts/images/datasource-configeditor.png new file mode 100644 index 000000000..96acec9e4 Binary files /dev/null and b/docusaurus/docs/key-concepts/images/datasource-configeditor.png differ diff --git a/docusaurus/docs/key-concepts/images/datasource-healthcheck.png b/docusaurus/docs/key-concepts/images/datasource-healthcheck.png new file mode 100644 index 000000000..40204dcbb Binary files /dev/null and b/docusaurus/docs/key-concepts/images/datasource-healthcheck.png differ diff --git a/docusaurus/docs/key-concepts/images/datasource-queryeditor.png b/docusaurus/docs/key-concepts/images/datasource-queryeditor.png new file mode 100644 index 000000000..8edc6090c Binary files /dev/null and b/docusaurus/docs/key-concepts/images/datasource-queryeditor.png differ diff --git a/docusaurus/docs/key-concepts/images/panel-options.png b/docusaurus/docs/key-concepts/images/panel-options.png new file mode 100644 index 000000000..f2667599b Binary files /dev/null and b/docusaurus/docs/key-concepts/images/panel-options.png differ diff --git a/docusaurus/docs/key-concepts/images/panel-plugin.png b/docusaurus/docs/key-concepts/images/panel-plugin.png new file mode 100644 index 000000000..077aa0f8a Binary files /dev/null and b/docusaurus/docs/key-concepts/images/panel-plugin.png differ diff --git a/docusaurus/docs/key-concepts/images/panel-visualization.png b/docusaurus/docs/key-concepts/images/panel-visualization.png new file mode 100644 index 000000000..f56d19f3f Binary files /dev/null and b/docusaurus/docs/key-concepts/images/panel-visualization.png differ diff --git a/docusaurus/docs/key-concepts/images/plugin-types.png b/docusaurus/docs/key-concepts/images/plugin-types.png new file mode 100644 index 000000000..6b994b869 Binary files /dev/null and b/docusaurus/docs/key-concepts/images/plugin-types.png differ diff --git a/docusaurus/docs/key-concepts/images/ui-extension.png b/docusaurus/docs/key-concepts/images/ui-extension.png new file mode 100644 index 000000000..73e4edc8e Binary files /dev/null and b/docusaurus/docs/key-concepts/images/ui-extension.png differ diff --git a/docusaurus/docs/tutorials/build-a-data-source-plugin.md b/docusaurus/docs/tutorials/build-a-data-source-plugin.md index 7628e1fc7..01acb8972 100644 --- a/docusaurus/docs/tutorials/build-a-data-source-plugin.md +++ b/docusaurus/docs/tutorials/build-a-data-source-plugin.md @@ -106,7 +106,7 @@ Let's see how to create and return a data frame from the `query` method. In this 1. Create a data frame with a time field and a number field: ```ts title="src/datasource.ts" - const frame = new MutableDataFrame({ + const frame = createDataFrame({ refId: query.refId, fields: [ { name: 'time', type: FieldType.time }, diff --git a/docusaurus/website/README.md b/docusaurus/website/README.md index 5927f6f69..94834075a 100644 --- a/docusaurus/website/README.md +++ b/docusaurus/website/README.md @@ -42,16 +42,17 @@ Insert the client-side redirect here: /plugin-tools/docusaurus/website/docusauru ``` { from: ['/something-that-does-not-exist', '/something-that-does-not-exist/testing'], - to: '/get-started/folder-structure', + to: '/key-concepts/anatomy-of-a-plugin', }, ``` -`from` - being the old location and `to` being the new one. You can have multiple `from` urls for a single `to` url. +`from` - being the old location and `to` being the new one. You can have multiple `from` urls for a single `to` url. To test that the redirect works prior to publishing the PR deploy your branch to DEV Stage of developer portal. You can do so by [running this action](https://github.com/grafana/plugin-tools/actions/workflows/deploy-to-developer-portal-dev.yml) called `Deploy to Developer Portal DEV Bucket`. Hit the `run workflow` button and choose following parameters: + - Use workflow from: Branch `main` (keep it as it is by default) - Which branch to use? Here you should enter your branch name. -- Hit the `run workflow` button \ No newline at end of file +- Hit the `run workflow` button diff --git a/docusaurus/website/docusaurus.config.base.js b/docusaurus/website/docusaurus.config.base.js index 612ac1d8f..1d5e2c173 100644 --- a/docusaurus/website/docusaurus.config.base.js +++ b/docusaurus/website/docusaurus.config.base.js @@ -201,6 +201,10 @@ const plugins = [ from: ['/reference/prompts'], to: '/reference/cli-commands/', }, + { + from: ['/get-started/folder-structure'], + to: '/key-concepts/anatomy-of-a-plugin', + }, ], }, ], diff --git a/docusaurus/website/package.json b/docusaurus/website/package.json index aca4a666e..435d1da7c 100644 --- a/docusaurus/website/package.json +++ b/docusaurus/website/package.json @@ -1,6 +1,6 @@ { "name": "website", - "version": "3.4.6", + "version": "3.4.7", "private": true, "scripts": { "docusaurus": "docusaurus", diff --git a/package-lock.json b/package-lock.json index c75e8e6c0..1007a744b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,7 @@ } }, "docusaurus/website": { - "version": "3.4.6", + "version": "3.4.7", "dependencies": { "@docusaurus/core": "^3.0.1", "@docusaurus/plugin-client-redirects": "^3.1.1", @@ -2635,9 +2635,9 @@ } }, "node_modules/@braintree/sanitize-url": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-7.0.0.tgz", - "integrity": "sha512-GMu2OJiTd1HSe74bbJYQnVvELANpYiGFZELyyTM1CR0sdv5ReQAcJ/c/8pIrPab3lO11+D+EpuGLUxqz+y832g==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-7.0.1.tgz", + "integrity": "sha512-URg8UM6lfC9ZYqFipItRSxYJdgpU5d2Z4KnjsJ+rj6tgAmGme7E+PQNCiud8g0HDaZKMovu2qjfa0f5Ge0Vlsg==", "dev": true, "license": "MIT" }, @@ -3916,74 +3916,6 @@ "resolved": "packages/create-plugin", "link": true }, - "node_modules/@grafana/data": { - "version": "10.4.8", - "resolved": "https://registry.npmjs.org/@grafana/data/-/data-10.4.8.tgz", - "integrity": "sha512-Dja+V/vzVO5SZ1QPbal0llV7EoIsJwXhot+xLdwKhiboyykQ6AgwGOPPy20yJGn+xHO0elLgph69SphZkKAvPg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@braintree/sanitize-url": "7.0.0", - "@grafana/schema": "10.4.8", - "@types/d3-interpolate": "^3.0.0", - "@types/string-hash": "1.1.3", - "d3-interpolate": "3.0.1", - "date-fns": "3.3.1", - "dompurify": "^3.0.0", - "eventemitter3": "5.0.1", - "fast_array_intersect": "1.1.0", - "history": "4.10.1", - "lodash": "4.17.21", - "marked": "12.0.0", - "marked-mangle": "1.1.7", - "moment": "2.30.1", - "moment-timezone": "0.5.45", - "ol": "7.4.0", - "papaparse": "5.4.1", - "react-use": "17.5.0", - "regenerator-runtime": "0.14.1", - "rxjs": "7.8.1", - "string-hash": "^1.1.3", - "tinycolor2": "1.6.0", - "tslib": "2.6.2", - "uplot": "1.6.30", - "xss": "^1.0.14" - }, - "peerDependencies": { - "react": "^17.0.0 || ^18.0.0", - "react-dom": "^17.0.0 || ^18.0.0" - } - }, - "node_modules/@grafana/data/node_modules/eventemitter3": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@grafana/data/node_modules/marked": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-12.0.0.tgz", - "integrity": "sha512-Vkwtq9rLqXryZnWaQc86+FHLC6tr/fycMfYAhiOIXkrNmeGAyhSxjqu0Rs1i0bBqw5u0S7+lV9fdH2ZSVaoa0w==", - "dev": true, - "license": "MIT", - "bin": { - "marked": "bin/marked.js" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/@grafana/data/node_modules/rxjs": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", - "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.1.0" - } - }, "node_modules/@grafana/eslint-config": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@grafana/eslint-config/-/eslint-config-7.0.0.tgz", @@ -4594,16 +4526,6 @@ "resolved": "packages/plugin-types-bundler", "link": true }, - "node_modules/@grafana/schema": { - "version": "10.4.8", - "resolved": "https://registry.npmjs.org/@grafana/schema/-/schema-10.4.8.tgz", - "integrity": "sha512-wB9MqcMkkKPirZOfMHdTT7whuKUGCWBAE9JywHA+uYtm0XfztKxhjVMUaAWs0zlI6SPADB82av/oHAlaagCyCw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "tslib": "2.6.2" - } - }, "node_modules/@grafana/sign-plugin": { "resolved": "packages/sign-plugin", "link": true @@ -4822,11 +4744,13 @@ } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.2", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "license": "MIT", "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, "node_modules/@jridgewell/sourcemap-codec": { @@ -7645,22 +7569,6 @@ "@types/ms": "*" } }, - "node_modules/@types/eslint": { - "version": "8.21.3", - "license": "MIT", - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.4", - "license": "MIT", - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "node_modules/@types/estree": { "version": "1.0.5", "license": "MIT" @@ -8363,7 +8271,9 @@ } }, "node_modules/@webassemblyjs/ast": { - "version": "1.11.6", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", + "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", "license": "MIT", "dependencies": { "@webassemblyjs/helper-numbers": "1.11.6", @@ -8372,18 +8282,26 @@ }, "node_modules/@webassemblyjs/floating-point-hex-parser": { "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", + "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", "license": "MIT" }, "node_modules/@webassemblyjs/helper-api-error": { "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", + "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", "license": "MIT" }, "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.11.6", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", + "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", "license": "MIT" }, "node_modules/@webassemblyjs/helper-numbers": { "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", + "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", "license": "MIT", "dependencies": { "@webassemblyjs/floating-point-hex-parser": "1.11.6", @@ -8393,20 +8311,26 @@ }, "node_modules/@webassemblyjs/helper-wasm-bytecode": { "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", + "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", "license": "MIT" }, "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.11.6", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", + "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6" + "@webassemblyjs/wasm-gen": "1.12.1" } }, "node_modules/@webassemblyjs/ieee754": { "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", + "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", "license": "MIT", "dependencies": { "@xtuc/ieee754": "^1.2.0" @@ -8414,6 +8338,8 @@ }, "node_modules/@webassemblyjs/leb128": { "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", + "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", "license": "Apache-2.0", "dependencies": { "@xtuc/long": "4.2.2" @@ -8421,27 +8347,33 @@ }, "node_modules/@webassemblyjs/utf8": { "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", + "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", "license": "MIT" }, "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.11.6", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", + "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/helper-wasm-section": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-opt": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6", - "@webassemblyjs/wast-printer": "1.11.6" + "@webassemblyjs/helper-wasm-section": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-opt": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1", + "@webassemblyjs/wast-printer": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.11.6", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", + "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", "@webassemblyjs/leb128": "1.11.6", @@ -8449,20 +8381,24 @@ } }, "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.11.6", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", + "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.11.6", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", + "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-api-error": "1.11.6", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", @@ -8471,10 +8407,12 @@ } }, "node_modules/@webassemblyjs/wast-printer": { - "version": "1.11.6", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", + "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@xtuc/long": "4.2.2" } }, @@ -8487,10 +8425,14 @@ }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", "license": "BSD-3-Clause" }, "node_modules/@xtuc/long": { "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "license": "Apache-2.0" }, "node_modules/@yarnpkg/lockfile": { @@ -8573,8 +8515,10 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-assertions": { - "version": "1.9.0", + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "license": "MIT", "peerDependencies": { "acorn": "^8" @@ -11952,9 +11896,9 @@ } }, "node_modules/date-fns": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.3.1.tgz", - "integrity": "sha512-y8e109LYGgoQDveiEBD3DYXKba1jWf5BA8YU1FL5Tvm0BTdEfy54WLCwnuYWZNnzzvALy/QQ4Hov+Q9RVRv+Zw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.6.0.tgz", + "integrity": "sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==", "dev": true, "license": "MIT", "funding": { @@ -12573,9 +12517,9 @@ } }, "node_modules/dompurify": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.1.6.tgz", - "integrity": "sha512-cTOAhc36AalkjtBpfG6O8JimdTMWNXjiePT2xQH/ppBGi/4uIpmj8eKyIkMJErXWARyINV/sB38yf8JCLF5pbQ==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.1.7.tgz", + "integrity": "sha512-VaTstWtsneJY8xzy7DekmYWEOZcmzIe3Qb3zPd4STve1OBTa+e+WmS1ITQec1fZYXI3HCsOZZiSMpG6oxoWMWQ==", "dev": true, "license": "(MPL-2.0 OR Apache-2.0)" }, @@ -12767,7 +12711,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.15.0", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "license": "MIT", "dependencies": { "graceful-fs": "^4.2.4", @@ -15039,6 +14985,8 @@ }, "node_modules/glob-to-regexp": { "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", "license": "BSD-2-Clause" }, "node_modules/global-dirs": { @@ -19483,13 +19431,13 @@ } }, "node_modules/marked-mangle": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/marked-mangle/-/marked-mangle-1.1.7.tgz", - "integrity": "sha512-bLsXKovJEEs/Dl++TBPmjX8ALFmrH5G0doTs+BdDOloBKWYRf3acyJghce78SnwInDkNPJ6crubr4MnFG7urOA==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/marked-mangle/-/marked-mangle-1.1.9.tgz", + "integrity": "sha512-eLTXr1xQzba/WZp/trPS0HkR9W02ifasH6IWPrBv++eO2m8POiwV4muQ6Tof2C5Fhdo3z8ggXs6VGw1f931Vsg==", "dev": true, "license": "MIT", "peerDependencies": { - "marked": ">=4 <13" + "marked": ">=4 <15" } }, "node_modules/marked-terminal": { @@ -25418,9 +25366,9 @@ } }, "node_modules/react-use": { - "version": "17.5.0", - "resolved": "https://registry.npmjs.org/react-use/-/react-use-17.5.0.tgz", - "integrity": "sha512-PbfwSPMwp/hoL847rLnm/qkjg3sTRCvn6YhUZiHaUa3FA6/aNoFX79ul5Xt70O1rK+9GxSVqkY0eTwMdsR/bWg==", + "version": "17.5.1", + "resolved": "https://registry.npmjs.org/react-use/-/react-use-17.5.1.tgz", + "integrity": "sha512-LG/uPEVRflLWMwi3j/sZqR00nF6JGqTTDblkXK2nzXsIvij06hXl1V/MZIlwj1OKIQUtlh1l9jK8gLsRyCQxMg==", "dev": true, "license": "Unlicense", "dependencies": { @@ -25430,7 +25378,7 @@ "fast-deep-equal": "^3.1.3", "fast-shallow-equal": "^1.0.0", "js-cookie": "^2.2.1", - "nano-css": "^5.6.1", + "nano-css": "^5.6.2", "react-universal-interface": "^0.6.2", "resize-observer-polyfill": "^1.5.1", "screenfull": "^5.1.0", @@ -28086,11 +28034,13 @@ } }, "node_modules/terser": { - "version": "5.16.8", + "version": "5.34.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.34.1.tgz", + "integrity": "sha512-FsJZ7iZLd/BXkz+4xrRTGJ26o/6VTjQytUk8b8OxkwcD2I+79VPJlz7qss1+zE7h8GNIScFqXcDyJ/KqBYZFVA==", "license": "BSD-2-Clause", "dependencies": { - "@jridgewell/source-map": "^0.3.2", - "acorn": "^8.5.0", + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, @@ -28102,14 +28052,16 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.9", + "version": "5.3.10", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", + "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", "license": "MIT", "dependencies": { - "@jridgewell/trace-mapping": "^0.3.17", + "@jridgewell/trace-mapping": "^0.3.20", "jest-worker": "^27.4.5", "schema-utils": "^3.1.1", "serialize-javascript": "^6.0.1", - "terser": "^5.16.8" + "terser": "^5.26.0" }, "engines": { "node": ">= 10.13.0" @@ -29236,13 +29188,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/uplot": { - "version": "1.6.30", - "resolved": "https://registry.npmjs.org/uplot/-/uplot-1.6.30.tgz", - "integrity": "sha512-48oVVRALM/128ttW19F2a2xobc2WfGdJ0VJFX00099CfqbCTuML7L2OrTKxNzeFP34eo1+yJbqFSoFAp2u28/Q==", - "dev": true, - "license": "MIT" - }, "node_modules/uri-js": { "version": "4.4.1", "license": "BSD-2-Clause", @@ -29691,7 +29636,9 @@ "dev": true }, "node_modules/watchpack": { - "version": "2.4.0", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", + "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", "license": "MIT", "dependencies": { "glob-to-regexp": "^0.4.1", @@ -29750,32 +29697,33 @@ "license": "Apache-2.0" }, "node_modules/webpack": { - "version": "5.89.0", + "version": "5.95.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.95.0.tgz", + "integrity": "sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q==", "license": "MIT", "dependencies": { - "@types/eslint-scope": "^3.7.3", - "@types/estree": "^1.0.0", - "@webassemblyjs/ast": "^1.11.5", - "@webassemblyjs/wasm-edit": "^1.11.5", - "@webassemblyjs/wasm-parser": "^1.11.5", + "@types/estree": "^1.0.5", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.9.0", - "browserslist": "^4.14.5", + "acorn-import-attributes": "^1.9.5", + "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.15.0", + "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", + "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", "schema-utils": "^3.2.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.7", - "watchpack": "^2.4.0", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" }, "bin": { @@ -30078,6 +30026,12 @@ "node": ">=10.13.0" } }, + "node_modules/webpack/node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, "node_modules/webpack/node_modules/json-parse-even-better-errors": { "version": "2.3.1", "license": "MIT" @@ -30658,7 +30612,7 @@ }, "packages/create-plugin": { "name": "@grafana/create-plugin", - "version": "5.3.11", + "version": "5.4.2", "license": "Apache-2.0", "dependencies": { "@types/marked-terminal": "^6.0.1", @@ -30958,7 +30912,7 @@ }, "packages/plugin-e2e": { "name": "@grafana/plugin-e2e", - "version": "1.8.1", + "version": "1.8.3", "license": "Apache-2.0", "dependencies": { "semver": "^7.5.4", @@ -31003,7 +30957,7 @@ }, "packages/plugin-meta-extractor": { "name": "@grafana/plugin-meta-extractor", - "version": "0.0.7", + "version": "0.0.8", "license": "Apache-2.0", "dependencies": { "debug": "^4.3.4", @@ -31013,11 +30967,58 @@ "plugin-meta-extractor": "dist/bin/run.js" }, "devDependencies": { - "@grafana/data": "^10.4.1", + "@grafana/data": "^11.3.0-199826", "@types/node": "^20.11.25", "react": "^18.2.0" } }, + "packages/plugin-meta-extractor/node_modules/@grafana/data": { + "version": "11.3.0-199922", + "resolved": "https://registry.npmjs.org/@grafana/data/-/data-11.3.0-199922.tgz", + "integrity": "sha512-vdc5UJCzPZzzSl0Iieuy4ZJ7QXaJbfcQ5z7+6+GnrF/+FUByQ5oxh8QNUT/eKom5knQrqz//UdHO4jr1F1jQow==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@braintree/sanitize-url": "7.0.1", + "@grafana/schema": "11.3.0-199922", + "@types/d3-interpolate": "^3.0.0", + "@types/string-hash": "1.1.3", + "d3-interpolate": "3.0.1", + "date-fns": "3.6.0", + "dompurify": "^3.0.0", + "eventemitter3": "5.0.1", + "fast_array_intersect": "1.1.0", + "history": "4.10.1", + "lodash": "4.17.21", + "marked": "12.0.2", + "marked-mangle": "1.1.9", + "moment": "2.30.1", + "moment-timezone": "0.5.45", + "ol": "7.4.0", + "papaparse": "5.4.1", + "react-use": "17.5.1", + "rxjs": "7.8.1", + "string-hash": "^1.1.3", + "tinycolor2": "1.6.0", + "tslib": "2.7.0", + "uplot": "1.6.31", + "xss": "^1.0.14" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, + "packages/plugin-meta-extractor/node_modules/@grafana/schema": { + "version": "11.3.0-199922", + "resolved": "https://registry.npmjs.org/@grafana/schema/-/schema-11.3.0-199922.tgz", + "integrity": "sha512-dfd/vL5PEGJ9ODCms4+aLZjFI7zn3MFcJxGqUz/t4by1AYNl3yOzJCvnNgKsvS/RLWL+9cGb1juAjCZJumVIjg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "2.7.0" + } + }, "packages/plugin-meta-extractor/node_modules/@types/node": { "version": "20.16.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.2.tgz", @@ -31027,15 +31028,59 @@ "undici-types": "~6.19.2" } }, + "packages/plugin-meta-extractor/node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "dev": true, + "license": "MIT" + }, + "packages/plugin-meta-extractor/node_modules/marked": { + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-12.0.2.tgz", + "integrity": "sha512-qXUm7e/YKFoqFPYPa3Ukg9xlI5cyAtGmyEIzMfW//m6kXwCy2Ps9DYf5ioijFKQ8qyuscrHoY04iJGctu2Kg0Q==", + "dev": true, + "license": "MIT", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 18" + } + }, + "packages/plugin-meta-extractor/node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "packages/plugin-meta-extractor/node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "dev": true, + "license": "0BSD" + }, "packages/plugin-meta-extractor/node_modules/undici-types": { "version": "6.19.8", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", "dev": true }, + "packages/plugin-meta-extractor/node_modules/uplot": { + "version": "1.6.31", + "resolved": "https://registry.npmjs.org/uplot/-/uplot-1.6.31.tgz", + "integrity": "sha512-sQZqSwVCbJGnFB4IQjQYopzj5CoTZJ4Br1fG/xdONimqgHmsacvCjNesdGDypNKFbrhLGIeshYhy89FxPF+H+w==", + "dev": true, + "license": "MIT" + }, "packages/plugin-types-bundler": { "name": "@grafana/plugin-types-bundler", - "version": "0.0.1", + "version": "0.0.2", "license": "Apache-2.0", "dependencies": { "@grafana/levitate": "^0.14.0", diff --git a/packages/create-plugin/CHANGELOG.md b/packages/create-plugin/CHANGELOG.md index b0ee137eb..0182c9a6e 100644 --- a/packages/create-plugin/CHANGELOG.md +++ b/packages/create-plugin/CHANGELOG.md @@ -1,3 +1,54 @@ +# v5.4.2 (Thu Oct 03 2024) + +#### πŸ› Bug Fix + +- Create Plugin: Remove topnav feature flag from Scenes templates [#1139](https://github.com/grafana/plugin-tools/pull/1139) ([@jackw](https://github.com/jackw)) +- Update grafana patch dependencies [#1156](https://github.com/grafana/plugin-tools/pull/1156) ([@renovate[bot]](https://github.com/renovate[bot])) + +#### Authors: 2 + +- [@renovate[bot]](https://github.com/renovate[bot]) +- Jack Westbrook ([@jackw](https://github.com/jackw)) + +--- + +# v5.4.1 (Tue Oct 01 2024) + +#### πŸ› Bug Fix + +- Update grafana dependencies [#1113](https://github.com/grafana/plugin-tools/pull/1113) ([@renovate[bot]](https://github.com/renovate[bot])) +- Update grafana patch dependencies [#1141](https://github.com/grafana/plugin-tools/pull/1141) ([@renovate[bot]](https://github.com/renovate[bot])) + +#### Authors: 1 + +- [@renovate[bot]](https://github.com/renovate[bot]) + +--- + +# v5.4.0 (Mon Sep 30 2024) + +#### πŸš€ Enhancement + +- Create Plugin: Update go sdk when running update cmd [#1143](https://github.com/grafana/plugin-tools/pull/1143) ([@jackw](https://github.com/jackw)) + +#### Authors: 1 + +- Jack Westbrook ([@jackw](https://github.com/jackw)) + +--- + +# v5.3.12 (Mon Sep 30 2024) + +#### πŸ› Bug Fix + +- Switch to createDataFrame [#1133](https://github.com/grafana/plugin-tools/pull/1133) ([@tolzhabayev](https://github.com/tolzhabayev)) + +#### Authors: 1 + +- Timur Olzhabayev ([@tolzhabayev](https://github.com/tolzhabayev)) + +--- + # v5.3.11 (Wed Sep 25 2024) #### πŸ› Bug Fix diff --git a/packages/create-plugin/package.json b/packages/create-plugin/package.json index b5de5879d..1609026d7 100644 --- a/packages/create-plugin/package.json +++ b/packages/create-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@grafana/create-plugin", - "version": "5.3.11", + "version": "5.4.2", "repository": { "directory": "packages/create-plugin", "url": "https://github.com/grafana/plugin-tools" diff --git a/packages/create-plugin/src/commands/generate.command.ts b/packages/create-plugin/src/commands/generate.command.ts index 4b60f19c6..593879634 100644 --- a/packages/create-plugin/src/commands/generate.command.ts +++ b/packages/create-plugin/src/commands/generate.command.ts @@ -11,7 +11,7 @@ import { renderTemplateFromFile, getTemplateData } from '../utils/utils.template import { prettifyFiles } from '../utils/utils.prettifyFiles.js'; import { printGenerateSuccessMessage } from './generate/print-success-message.js'; import { promptUser } from './generate/prompt-user.js'; -import { updateGoSdkAndModules } from './generate/update-go-sdk-and-packages.js'; +import { updateGoSdkAndModules } from '../utils/utils.goSdk.js'; import { TemplateData } from '../types.js'; export const generate = async (argv: minimist.ParsedArgs) => { diff --git a/packages/create-plugin/src/commands/update.command.ts b/packages/create-plugin/src/commands/update.command.ts index b3a4bcab4..eda7db52b 100644 --- a/packages/create-plugin/src/commands/update.command.ts +++ b/packages/create-plugin/src/commands/update.command.ts @@ -1,13 +1,14 @@ -import minimist from 'minimist'; import chalk from 'chalk'; -import { printRedBox, printBlueBox } from '../utils/utils.console.js'; -import { updatePackageJson, updateNpmScripts } from '../utils/utils.npm.js'; -import { isGitDirectory, isGitDirectoryClean } from '../utils/utils.git.js'; -import { isPluginDirectory, updateDotConfigFolder } from '../utils/utils.plugin.js'; -import { getVersion, getGrafanaRuntimeVersion } from '../utils/utils.version.js'; -import { getPackageManagerFromUserAgent } from '../utils/utils.packageManager.js'; +import minimist from 'minimist'; import { UDPATE_CONFIG } from '../constants.js'; +import { printBlueBox, printRedBox } from '../utils/utils.console.js'; import { getOnlyExistingInCwd, removeFilesInCwd } from '../utils/utils.files.js'; +import { isGitDirectory, isGitDirectoryClean } from '../utils/utils.git.js'; +import { updateGoSdkAndModules } from '../utils/utils.goSdk.js'; +import { updateNpmScripts, updatePackageJson } from '../utils/utils.npm.js'; +import { getPackageManagerFromUserAgent } from '../utils/utils.packageManager.js'; +import { isPluginDirectory, updateDotConfigFolder } from '../utils/utils.plugin.js'; +import { getGrafanaRuntimeVersion, getVersion } from '../utils/utils.version.js'; export const update = async (argv: minimist.ParsedArgs) => { const { packageManagerName } = getPackageManagerFromUserAgent(); @@ -55,6 +56,7 @@ In case you want to proceed as is please use the ${chalk.bold('--force')} flag.) onlyOutdated: true, ignoreGrafanaDependencies: false, }); + await updateGoSdkAndModules(process.cwd()); const filesToRemove = getOnlyExistingInCwd(UDPATE_CONFIG.filesToRemove); if (filesToRemove.length) { diff --git a/packages/create-plugin/src/commands/generate/update-go-sdk-and-packages.ts b/packages/create-plugin/src/utils/utils.goSdk.ts similarity index 100% rename from packages/create-plugin/src/commands/generate/update-go-sdk-and-packages.ts rename to packages/create-plugin/src/utils/utils.goSdk.ts diff --git a/packages/create-plugin/templates/common/_package.json b/packages/create-plugin/templates/common/_package.json index 416766291..37fb75efa 100644 --- a/packages/create-plugin/templates/common/_package.json +++ b/packages/create-plugin/templates/common/_package.json @@ -19,10 +19,10 @@ "license": "Apache-2.0", "devDependencies": { "@babel/core": "^7.21.4",{{#if useCypress}} - "@grafana/e2e": "^11.0.4", - "@grafana/e2e-selectors": "^11.2.0",{{/if}} + "@grafana/e2e": "^11.0.6", + "@grafana/e2e-selectors": "^11.2.2",{{/if}} "@grafana/eslint-config": "^7.0.0",{{#if usePlaywright}} - "@grafana/plugin-e2e": "^1.7.2",{{/if}} + "@grafana/plugin-e2e": "^1.8.3",{{/if}} "@grafana/tsconfig": "^2.0.0",{{#if usePlaywright}} "@playwright/test": "^1.41.2",{{/if}} "@swc/core": "^1.3.90", @@ -31,7 +31,6 @@ "@testing-library/jest-dom": "6.1.4", "@testing-library/react": "14.0.0", "@types/jest": "^29.5.0", - "@types/lodash": "^4.14.194", "@types/node": "^20.8.7",{{#unless useReactRouterV6}} "@types/react-router-dom": "^{{ reactRouterVersion }}",{{/unless}} "@types/testing-library__jest-dom": "5.14.8", @@ -65,11 +64,11 @@ }, "dependencies": { "@emotion/css": "11.10.6", - "@grafana/data": "^11.2.0", - "@grafana/runtime": "^11.2.0", - "@grafana/ui": "^11.2.0", + "@grafana/data": "^11.2.2", + "@grafana/runtime": "^11.2.2", + "@grafana/ui": "^11.2.2", "@grafana/schema": "^10.4.0",{{#if_eq pluginType "scenesapp"}} - "@grafana/scenes": "^5.14.7",{{/if_eq}} + "@grafana/scenes": "^5.16.3",{{/if_eq}} "react": "18.2.0", "react-dom": "18.2.0",{{#if isAppType}} "react-router-dom": "^{{ reactRouterVersion }}", diff --git a/packages/create-plugin/templates/common/docker-compose.yaml b/packages/create-plugin/templates/common/docker-compose.yaml index a64f474f7..fd48d7d21 100644 --- a/packages/create-plugin/templates/common/docker-compose.yaml +++ b/packages/create-plugin/templates/common/docker-compose.yaml @@ -7,7 +7,7 @@ services: context: ./.config args: grafana_image: ${GRAFANA_IMAGE:-{{~grafanaImage~}} } - grafana_version: ${GRAFANA_VERSION:-11.2.0} + grafana_version: ${GRAFANA_VERSION:-11.2.2} development: ${DEVELOPMENT:-false} ports: - 3000:3000/tcp diff --git a/packages/create-plugin/templates/datasource/src/datasource.ts b/packages/create-plugin/templates/datasource/src/datasource.ts index 20a2981f6..d4e615165 100644 --- a/packages/create-plugin/templates/datasource/src/datasource.ts +++ b/packages/create-plugin/templates/datasource/src/datasource.ts @@ -5,13 +5,12 @@ import { DataQueryResponse, DataSourceApi, DataSourceInstanceSettings, - MutableDataFrame, + createDataFrame, FieldType, } from '@grafana/data'; import { MyQuery, MyDataSourceOptions, DEFAULT_QUERY, DataSourceResponse } from './types'; import { lastValueFrom } from 'rxjs'; -import _ from 'lodash'; export class DataSource extends DataSourceApi { baseUrl: string; @@ -37,7 +36,7 @@ export class DataSource extends DataSourceApi { // Return a constant for each query. const data = options.targets.map((target) => { - return new MutableDataFrame({ + return createDataFrame({ refId: target.refId, fields: [ { name: 'Time', values: [from, to], type: FieldType.time }, @@ -77,7 +76,7 @@ export class DataSource extends DataSourceApi { } } catch (err) { let message = ''; - if (_.isString(err)) { + if (typeof err === 'string') { message = err; } else if (isFetchError(err)) { message = 'Fetch error: ' + (err.statusText ? err.statusText : defaultErrorMessage); diff --git a/packages/create-plugin/templates/scenes-app/src/pages/Home/Home.tsx b/packages/create-plugin/templates/scenes-app/src/pages/Home/Home.tsx index c00ce8950..2aa00048e 100644 --- a/packages/create-plugin/templates/scenes-app/src/pages/Home/Home.tsx +++ b/packages/create-plugin/templates/scenes-app/src/pages/Home/Home.tsx @@ -28,12 +28,6 @@ const HomePage = () => { return ( <> - {!config.featureToggles.topnav && ( - - Scenes are designed to work with the new navigation wrapper that will be standard in Grafana 10 - - )} - {!config.datasources[DATASOURCE_REF.uid] && ( These demos depend on testdata datasource: {JSON.stringify(DATASOURCE_REF)}. See{' '} diff --git a/packages/plugin-e2e/CHANGELOG.md b/packages/plugin-e2e/CHANGELOG.md index c2cfe89fa..c1ebc5e33 100644 --- a/packages/plugin-e2e/CHANGELOG.md +++ b/packages/plugin-e2e/CHANGELOG.md @@ -1,3 +1,31 @@ +# v1.8.3 (Wed Oct 02 2024) + +#### πŸ› Bug Fix + +- Plugin E2e: Support scenes powered dashboard UI [#1155](https://github.com/grafana/plugin-tools/pull/1155) ([@sunker](https://github.com/sunker)) + +#### Authors: 1 + +- Erik Sundell ([@sunker](https://github.com/sunker)) + +--- + +# v1.8.2 (Mon Sep 30 2024) + +:tada: This release contains work from a new contributor! :tada: + +Thank you, Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)), for all your work! + +#### πŸ› Bug Fix + +- Update dashboard variables settings URL [#1144](https://github.com/grafana/plugin-tools/pull/1144) ([@ivanortegaalba](https://github.com/ivanortegaalba)) + +#### Authors: 1 + +- Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)) + +--- + # v1.8.1 (Wed Sep 25 2024) #### πŸ› Bug Fix diff --git a/packages/plugin-e2e/package.json b/packages/plugin-e2e/package.json index 1ed09dcbb..89415981c 100644 --- a/packages/plugin-e2e/package.json +++ b/packages/plugin-e2e/package.json @@ -1,6 +1,6 @@ { "name": "@grafana/plugin-e2e", - "version": "1.8.1", + "version": "1.8.3", "main": "./dist/index.js", "types": "./dist/index.d.ts", "files": [ diff --git a/packages/plugin-e2e/src/e2e-selectors/types.ts b/packages/plugin-e2e/src/e2e-selectors/types.ts index 3db3b77cc..00a55dafa 100644 --- a/packages/plugin-e2e/src/e2e-selectors/types.ts +++ b/packages/plugin-e2e/src/e2e-selectors/types.ts @@ -109,6 +109,12 @@ export type Components = { Alert: { alertV2: (severity: string) => string; }; + NavToolbar: { + editDashboard: { + backToDashboardButton: string; + editButton: string; + }; + }; PageToolbar: { item: (tooltip: string) => string; showMoreItems: string; diff --git a/packages/plugin-e2e/src/e2e-selectors/versioned/components.ts b/packages/plugin-e2e/src/e2e-selectors/versioned/components.ts index f9308f16f..8e0a1d93e 100644 --- a/packages/plugin-e2e/src/e2e-selectors/versioned/components.ts +++ b/packages/plugin-e2e/src/e2e-selectors/versioned/components.ts @@ -166,6 +166,16 @@ export const versionedComponents = { [MIN_GRAFANA_VERSION]: (severity: string) => `Alert ${severity}`, }, }, + NavToolbar: { + editDashboard: { + editButton: { + '11.1.0': 'data-testid Edit dashboard button', + }, + backToDashboardButton: { + '11.1.0': 'data-testid Back to dashboard button', + }, + }, + }, PageToolbar: { item: { [MIN_GRAFANA_VERSION]: (tooltip: string) => `${tooltip}`, diff --git a/packages/plugin-e2e/src/e2e-selectors/versioned/pages.ts b/packages/plugin-e2e/src/e2e-selectors/versioned/pages.ts index 5f3517216..b94dcaa87 100644 --- a/packages/plugin-e2e/src/e2e-selectors/versioned/pages.ts +++ b/packages/plugin-e2e/src/e2e-selectors/versioned/pages.ts @@ -40,6 +40,7 @@ export const versionedPages = { '9.5.0': (title: string) => `data-testid ${title}`, }, addNewPanel: { + '11.1.0': 'data-testid Add new panel', [MIN_GRAFANA_VERSION]: 'Add new panel', }, itemButtonAddViz: { @@ -63,12 +64,14 @@ export const versionedPages = { List: { url: { [MIN_GRAFANA_VERSION]: '/dashboard/new?orgId=1&editview=templating', + '11.3.0': '/dashboard/new?orgId=1&editview=variables', }, }, Edit: { url: { - [MIN_GRAFANA_VERSION]: (annotationIndex: string) => - `/dashboard/new?orgId=1&editview=templating&editIndex=${annotationIndex}`, + [MIN_GRAFANA_VERSION]: (variableIndex: string) => + `/dashboard/new?orgId=1&editview=templating&editIndex=${variableIndex}`, + '11.3.0': (variableIndex: string) => `/dashboard/new?orgId=1&editview=variables&editIndex=${variableIndex}`, }, }, }, @@ -107,6 +110,7 @@ export const versionedPages = { List: { url: { [MIN_GRAFANA_VERSION]: (dashboardUid: string) => `/d/${dashboardUid}?editview=templating`, + '11.3.0': (dashboardUid: string) => `/d/${dashboardUid}?editview=variables`, }, newButton: { [MIN_GRAFANA_VERSION]: 'Variable editor New variable button', @@ -125,6 +129,8 @@ export const versionedPages = { url: { [MIN_GRAFANA_VERSION]: (dashboardUid: string, editIndex: string) => `/d/${dashboardUid}?editview=templating&editIndex=${editIndex}`, + '11.3.0': (dashboardUid: string, editIndex: string) => + `/d/${dashboardUid}?editview=variables&editIndex=${editIndex}`, }, General: { generalTypeSelectV2: { diff --git a/packages/plugin-e2e/src/models/pages/DashboardPage.ts b/packages/plugin-e2e/src/models/pages/DashboardPage.ts index 58a514c2b..62d2b7d10 100644 --- a/packages/plugin-e2e/src/models/pages/DashboardPage.ts +++ b/packages/plugin-e2e/src/models/pages/DashboardPage.ts @@ -78,12 +78,21 @@ export class DashboardPage extends GrafanaPage { */ async addPanel(): Promise { const { components, pages } = this.ctx.selectors; + + // From Grafana 11.3.0, one needs to click the edit button before adding a new panel in already existing dashboards + if (semver.gte(this.ctx.grafanaVersion, '11.3.0') && this.dashboard?.uid) { + await this.getByGrafanaSelector(components.NavToolbar.editDashboard.editButton).click(); + } + if (semver.gte(this.ctx.grafanaVersion, '10.0.0')) { await this.getByGrafanaSelector( components.PageToolbar.itemButton(components.PageToolbar.itemButtonTitle) ).click(); await this.getByGrafanaSelector(pages.AddDashboard.itemButton(pages.AddDashboard.itemButtonAddViz)).click(); } else { + if (this.dashboard?.uid) { + await this.getByGrafanaSelector(components.PageToolbar.item('Add panel')).click(); + } await this.getByGrafanaSelector(pages.AddDashboard.addNewPanel).click(); } diff --git a/packages/plugin-e2e/src/models/pages/PanelEditPage.ts b/packages/plugin-e2e/src/models/pages/PanelEditPage.ts index 2073bc5f8..d38ab897c 100644 --- a/packages/plugin-e2e/src/models/pages/PanelEditPage.ts +++ b/packages/plugin-e2e/src/models/pages/PanelEditPage.ts @@ -6,6 +6,7 @@ import { GrafanaPage } from './GrafanaPage'; import { TimeRange } from '../components/TimeRange'; import { Panel } from '../components/Panel'; import { radioButtonSetChecked } from '../utils'; +import { DashboardPage } from './DashboardPage'; export class PanelEditPage extends GrafanaPage { datasource: DataSourcePicker; @@ -116,11 +117,31 @@ export class PanelEditPage extends GrafanaPage { return this.getByGrafanaSelector(this.ctx.selectors.components.PanelEditor.toggleVizPicker); } + /** + * Clicks the "Back to dashboard" button in the panel editor + * In versions prior to 11.3.0, this method clicks the "Apply" button instead + */ + async backToDashboard() { + if (semver.gte(this.ctx.grafanaVersion, '11.3.0')) { + await this.getByGrafanaSelector( + this.ctx.selectors.components.NavToolbar.editDashboard.backToDashboardButton + ).click(); + } else if (semver.gte(this.ctx.grafanaVersion, '9.0.0')) { + await this.ctx.page.getByTestId(this.ctx.selectors.components.PanelEditor.applyButton).click(); + } else { + await this.ctx.page.getByLabel('panel editor apply').click(); + } + + return new DashboardPage(this.ctx, this.args); + } + /** * Clicks the "Apply" button in the panel editor + * + * @deprecated use {@link PanelEditPage.backToDashboard} method instead. */ async apply() { - await this.ctx.page.getByTestId(this.ctx.selectors.components.PanelEditor.applyButton).click(); + return this.backToDashboard(); } /** diff --git a/packages/plugin-e2e/tests/as-admin-user/datasource/dashboards/dashboard.spec.ts b/packages/plugin-e2e/tests/as-admin-user/datasource/dashboards/dashboard.spec.ts new file mode 100644 index 000000000..b16eb20f8 --- /dev/null +++ b/packages/plugin-e2e/tests/as-admin-user/datasource/dashboards/dashboard.spec.ts @@ -0,0 +1,14 @@ +import { expect, test } from '../../../../src'; + +test('add panel in already existing dashboard', async ({ gotoDashboardPage, readProvisionedDashboard, page }) => { + const dashboard = await readProvisionedDashboard({ fileName: 'redshift.json' }); + const dashboardPage = await gotoDashboardPage(dashboard); + await dashboardPage.addPanel(); + await expect(page.url()).toContain('editPanel'); +}); + +test('add panel in new dashboard', async ({ dashboardPage, page }) => { + const panelEditPage = await dashboardPage.addPanel(); + await expect(panelEditPage.panel.locator).toBeVisible(); + await expect(page.url()).toContain('editPanel'); +}); diff --git a/packages/plugin-e2e/tests/as-admin-user/datasource/query-editor/queryEditor.spec.ts b/packages/plugin-e2e/tests/as-admin-user/datasource/query-editor/queryEditor.spec.ts index c62316d6b..60daff97f 100644 --- a/packages/plugin-e2e/tests/as-admin-user/datasource/query-editor/queryEditor.spec.ts +++ b/packages/plugin-e2e/tests/as-admin-user/datasource/query-editor/queryEditor.spec.ts @@ -47,3 +47,14 @@ test('should set correct cache time on query passed to the backend', async ({ await panelEditPage.refreshPanel(); await expect(await queryReq).toBeTruthy(); }); + +test('backToDashboard method should be backwards compatible and navigate to dashboard page', async ({ + gotoPanelEditPage, + readProvisionedDashboard, + page, +}) => { + const dashboard = await readProvisionedDashboard({ fileName: 'redshift.json' }); + const panelEditPage = await gotoPanelEditPage({ dashboard, id: '3' }); + await panelEditPage.backToDashboard(); + await expect(page.url()).not.toContain('editPanel'); +}); diff --git a/packages/plugin-meta-extractor/package.json b/packages/plugin-meta-extractor/package.json index e09242973..e2a5255d7 100644 --- a/packages/plugin-meta-extractor/package.json +++ b/packages/plugin-meta-extractor/package.json @@ -1,6 +1,6 @@ { "name": "@grafana/plugin-meta-extractor", - "version": "0.0.7", + "version": "0.0.8", "description": "Extract meta information from a Grafana plugin source code.", "types": "./dist/index.d.ts", "bin": "./dist/bin/run.js", @@ -37,7 +37,7 @@ "typescript": "^5.4.5" }, "devDependencies": { - "@grafana/data": "^10.4.1", + "@grafana/data": "^11.3.0-199826", "@types/node": "^20.11.25", "react": "^18.2.0" } diff --git a/packages/plugin-types-bundler/CHANGELOG.md b/packages/plugin-types-bundler/CHANGELOG.md index aa2e37ada..f194b9f96 100644 --- a/packages/plugin-types-bundler/CHANGELOG.md +++ b/packages/plugin-types-bundler/CHANGELOG.md @@ -1,3 +1,15 @@ +# v0.0.2 (Thu Oct 03 2024) + +#### πŸ› Bug Fix + +- Types-bundler: Update readme [#1162](https://github.com/grafana/plugin-tools/pull/1162) ([@jackw](https://github.com/jackw)) + +#### Authors: 1 + +- Jack Westbrook ([@jackw](https://github.com/jackw)) + +--- + # v0.0.1 (Wed Sep 25 2024) #### πŸ› Bug Fix diff --git a/packages/plugin-types-bundler/README.md b/packages/plugin-types-bundler/README.md index 5d39c1907..ee49a0158 100644 --- a/packages/plugin-types-bundler/README.md +++ b/packages/plugin-types-bundler/README.md @@ -5,6 +5,8 @@ `@grafana/plugin-types-bundler` is a cli tool that can be used to bundle types from the source code of a Grafana plugin. This single file will wrap all the types up into a single d.ts file which can then be shared with other Grafana plugins. +It is recommended that you create a separate `.ts` file that exports only the types you want to expose rather than run this tool against the plugins `module.{ts,tsx}` file. + ## Install ``` diff --git a/packages/plugin-types-bundler/package.json b/packages/plugin-types-bundler/package.json index 706bb035f..027ff8415 100644 --- a/packages/plugin-types-bundler/package.json +++ b/packages/plugin-types-bundler/package.json @@ -1,6 +1,6 @@ { "name": "@grafana/plugin-types-bundler", - "version": "0.0.1", + "version": "0.0.2", "description": "Bundle grafana plugin typescript types for sharing with other plugins", "bin": "./dist/bin/run.js", "type": "module",