Skip to content

Commit

Permalink
integrate cspell
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmylife committed Mar 28, 2024
1 parent d50e960 commit 41b82c7
Show file tree
Hide file tree
Showing 7 changed files with 639 additions and 104 deletions.
49 changes: 0 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,52 +85,3 @@ Read more about it here:
yarn run lint:fix
```


# Distributing your plugin

When distributing a Grafana plugin either within the community or privately the plugin must be signed so the Grafana application can verify its authenticity. This can be done with the `@grafana/sign-plugin` package.

_Note: It's not necessary to sign a plugin during development. The docker development environment that is scaffolded with `@grafana/create-plugin` caters for running the plugin without a signature._
## Initial steps
Before signing a plugin please read the Grafana [plugin publishing and signing criteria](https://grafana.com/docs/grafana/latest/developers/plugins/publishing-and-signing-criteria/) documentation carefully.
`@grafana/create-plugin` has added the necessary commands and workflows to make signing and distributing a plugin via the grafana plugins catalog as straightforward as possible.
Before signing a plugin for the first time please consult the Grafana [plugin signature levels](https://grafana.com/docs/grafana/latest/developers/plugins/sign-a-plugin/#plugin-signature-levels) documentation to understand the differences between the types of signature level.
1. Create a [Grafana Cloud account](https://grafana.com/signup).
2. Make sure that the first part of the plugin ID matches the slug of your Grafana Cloud account.
- _You can find the plugin ID in the `plugin.json` file inside your plugin directory. For example, if your account slug is `acmecorp`, you need to prefix the plugin ID with `acmecorp-`._
3. Create a Grafana Cloud API key with the `PluginPublisher` role.
4. Keep a record of this API key as it will be required for signing a plugin
## Signing a plugin
### Using Github actions release workflow
If the plugin is using the github actions supplied with `@grafana/create-plugin` signing a plugin is included out of the box. The [release workflow](./.github/workflows/release.yml) can prepare everything to make submitting your plugin to Grafana as easy as possible. Before being able to sign the plugin however a secret needs adding to the Github repository.
1. Please navigate to "settings > secrets > actions" within your repo to create secrets.
2. Click "New repository secret"
3. Name the secret "GRAFANA_API_KEY"
4. Paste your Grafana Cloud API key in the Secret field
5. Click "Add secret"
#### Push a version tag
To trigger the workflow we need to push a version tag to github. This can be achieved with the following steps:
1. Run `npm version <major|minor|patch>`
2. Run `git push origin main --follow-tags`
## Learn more
Below you can find source code for existing app plugins and other related documentation.
- [Basic data source plugin example](https://github.com/grafana/grafana-plugin-examples/tree/master/examples/datasource-basic#readme)
- [`plugin.json` documentation](https://grafana.com/developers/plugin-tools/reference-plugin-json)
- [How to sign a plugin?](https://grafana.com/docs/grafana/latest/developers/plugins/sign-a-plugin/)
47 changes: 47 additions & 0 deletions cspell.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"ignorePaths": [
".config/**",
".github/**",
".vscode/**",
"coverage/**",
"cspell.config.json",
"e2e/**",
"playwright/**",
"dist/**",
"docker-compose*.yaml",
"docker-compose*.yml",
"go.sum",
"mage_output_file.go",
"node_modules/**",
"package.json",
"pkg/**/*_test.go",
"pkg/**/*.html",
"pkg/**/*.json",
"pkg/**/*.jsonc",
"pkg/testdata/**",
"prometheus/**",
"provisioning/**",
"src/dashboards/**",
"yarn.lock"
],
"ignoreRegExpList": [
"import\\s*\\((.|[\r\n])*?\\)",
"import\\s*.*\".*?\""
],
"words": [
"grafana",
"datasource",
"datasources",
"prometheusamazon",
"tsdb",
"promlib",
"instancemgmt",
"plog",
"sdkhttpclient",
"sigv",
"SIGV",
"awsds",
"httpss",
"Mwdhmsy"
]
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"lint": "eslint --cache --ignore-path ./.gitignore --ext .js,.jsx,.ts,.tsx .",
"lint:fix": "yarn run lint --fix",
"server": "docker-compose up --build",
"sign": "npx --yes @grafana/sign-plugin@latest --rootUrls https://github.com/grafana/prometheus-amazon"
"sign": "npx --yes @grafana/sign-plugin@latest --rootUrls https://github.com/grafana/prometheus-amazon",
"spellcheck": "cspell -c cspell.config.json \"**/*.{ts,tsx,js,go,md,mdx,yml,yaml,json,scss,css}\""
},
"author": "Grafana Labs",
"license": "Apache-2.0",
Expand Down Expand Up @@ -43,6 +44,7 @@
"@typescript-eslint/eslint-plugin": "6.21.0",
"@typescript-eslint/parser": "6.21.0",
"copy-webpack-plugin": "12.0.2",
"cspell": "6.13.3",
"css-loader": "6.10.0",
"eslint": "8.56.0",
"eslint-config-prettier": "9.1.0",
Expand Down
43 changes: 0 additions & 43 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,47 +55,4 @@ export default defineConfig({
dependencies: ['auth'],
}
],
// projects: [
// {
// name: 'chromium',
// use: { ...devices['Desktop Chrome'] },
// },

// {
// name: 'firefox',
// use: { ...devices['Desktop Firefox'] },
// },

// {
// name: 'webkit',
// use: { ...devices['Desktop Safari'] },
// },

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
// ],

/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
});
6 changes: 3 additions & 3 deletions src/configuration/ConfigEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { config } from '@grafana/runtime';
import { Alert, FieldValidationMessage, useTheme2 } from '@grafana/ui';
import React from 'react';

import { DataSourcehttpSettingsOverhaul } from './DataSourceHttpSettingsOverhaul';
import { DataSourceHttpSettingsOverhaul } from './DataSourceHttpSettingsOverhaul';

export const PROM_CONFIG_LABEL_WIDTH = 30;

Expand All @@ -30,7 +30,7 @@ export const ConfigEditor = (props: Props) => {
docsLink="https://grafana.com/docs/grafana/latest/datasources/prometheus/configure-prometheus-data-source/"
/>
<hr className={`${styles.hrTopSpace} ${styles.hrBottomSpace}`} />
<DataSourcehttpSettingsOverhaul
<DataSourceHttpSettingsOverhaul
options={options}
onOptionsChange={onOptionsChange}
renderSigV4Editor={<SIGV4ConnectionConfig inExperimentalAuthComponent={true} {...props}></SIGV4ConnectionConfig>}
Expand Down Expand Up @@ -131,7 +131,7 @@ export function overhaulStyles(theme: GrafanaTheme2) {
font-weight: 400;
`,
container: css`
maxwidth: 578;
maxWidth: 578;
`,
};
}
2 changes: 1 addition & 1 deletion src/configuration/DataSourceHttpSettingsOverhaul.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type Props = {
secureSocksDSProxyEnabled: boolean;
};

export const DataSourcehttpSettingsOverhaul = (props: Props) => {
export const DataSourceHttpSettingsOverhaul = (props: Props) => {
const {
options,
onOptionsChange,
Expand Down
Loading

0 comments on commit 41b82c7

Please sign in to comment.