@grafana/create-plugin 6.5.0-canary.2320.20268376971.0 → 6.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ # v6.5.0 (Wed Dec 17 2025)
2
+
3
+ :tada: This release contains work from a new contributor! :tada:
4
+
5
+ Thank you, Joonseo Lee ([@joonseolee](https://github.com/joonseolee)), for all your work!
6
+
7
+ #### 🚀 Enhancement
8
+
9
+ - feat: add dependabot config for plugins [#2248](https://github.com/grafana/plugin-tools/pull/2248) ([@joonseolee](https://github.com/joonseolee) [@jackw](https://github.com/jackw))
10
+
11
+ #### Authors: 2
12
+
13
+ - Jack Westbrook ([@jackw](https://github.com/jackw))
14
+ - Joonseo Lee ([@joonseolee](https://github.com/joonseolee))
15
+
16
+ ---
17
+
1
18
  # v6.4.4 (Fri Dec 12 2025)
2
19
 
3
20
  #### 🐛 Bug Fix
@@ -1,8 +1,8 @@
1
1
  var defaultAdditions = [
2
2
  {
3
- name: "i18n",
4
- description: "Adds internationalization (i18n) support to the plugin",
5
- scriptPath: import.meta.resolve("./scripts/i18n/index.js")
3
+ name: "example-addition",
4
+ description: "Adds an example addition to the plugin",
5
+ scriptPath: import.meta.resolve("./scripts/example-addition.js")
6
6
  }
7
7
  ];
8
8
 
@@ -205,6 +205,6 @@ function sortObjectByKeys(obj) {
205
205
  return Object.keys(obj).sort().reduce((acc, key) => ({ ...acc, [key]: obj[key] }), {});
206
206
  }
207
207
  const migrationsDebug = debug.extend("migrations");
208
- const additionsDebug = debug.extend("additions");
208
+ debug.extend("additions");
209
209
 
210
- export { addDependenciesToPackageJson, additionsDebug, flushChanges, formatFiles, installNPMDependencies, isVersionGreater, migrationsDebug, printChanges, readJsonFile, removeDependenciesFromPackageJson };
210
+ export { addDependenciesToPackageJson, flushChanges, formatFiles, installNPMDependencies, isVersionGreater, migrationsDebug, printChanges, readJsonFile, removeDependenciesFromPackageJson };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/create-plugin",
3
- "version": "6.5.0-canary.2320.20268376971.0",
3
+ "version": "6.5.0",
4
4
  "repository": {
5
5
  "directory": "packages/create-plugin",
6
6
  "url": "https://github.com/grafana/plugin-tools"
@@ -56,5 +56,5 @@
56
56
  "engines": {
57
57
  "node": ">=20"
58
58
  },
59
- "gitHead": "47d4c2ff4f55df3a644771982994d0c85ec7d96d"
59
+ "gitHead": "a143221c100f1402e6f430997383830439749d40"
60
60
  }
@@ -5,24 +5,17 @@ This guide provides specific instructions for working with migrations and additi
5
5
  ## Agent Behavior
6
6
 
7
7
  - Refer to current migrations and additions typescript files found in @./additions/scripts and @./migrations/scripts
8
+ - When creating a new migration add it to the exported migrations object in @./migrations/migrations.ts
8
9
  - Always refer to @./context.ts to know what methods are available on the context class
9
10
  - Always check for file existence using the @./context.ts class before attempting to do anything with it
10
11
  - Never write files with any 3rd party npm library. Use the context for all file operations
11
- - Always return the context for the next migration/addition
12
+ - Always return the context for the next migration
12
13
  - Test thoroughly using the provided utils in @./test-utils.ts where necessary
13
- - Never attempt to read or write files outside the current working directory
14
-
15
- ## Migrations
16
-
17
- Migrations are automatically run during `create-plugin update` to keep plugins compatible with newer versions of the tooling. They are forced upon developers to ensure compatibility and are versioned based on the create-plugin version. Migrations primarily target configuration files or files that are scaffolded by create-plugin.
18
-
19
- ### Migration Behavior
20
-
21
- - When creating a new migration add it to the exported migrations object in @./migrations/migrations.ts
22
14
  - Each migration must be idempotent and must include a test case that uses the `.toBeIdempotent` custom matcher found in @../../vitest.setup.ts
23
15
  - Keep migrations focused on one task
16
+ - Never attempt to read or write files outside the current working directory
24
17
 
25
- ### Migration Naming Conventions
18
+ ## Naming Conventions
26
19
 
27
20
  - Each migration lives under @./migrations/scripts
28
21
  - Migration filenames follow the format: `NNN-migration-title` where migration-title is, at the most, a three word summary of what the migration does and NNN is the next number in sequence based on the current file name in @./migrations/scripts
@@ -30,16 +23,3 @@ Migrations are automatically run during `create-plugin update` to keep plugins c
30
23
  - `NNN-migration-title.ts` - main migration logic
31
24
  - `NNN-migration-title.test.ts` - migration logic tests
32
25
  - Each migration should export a default function named "migrate"
33
-
34
- ## Additions
35
-
36
- Additions are optional features that developers choose to add via `create-plugin add`. They are not versioned and can be run at any time to enhance a plugin with new capabilities.
37
-
38
- ### Addition Behavior
39
-
40
- - Additions add new features or capabilities to a plugin (e.g., i18n support, testing frameworks, etc.)
41
- - It should be safe to run multiple times
42
- - Always use defensive programming: check if features already exist before adding them
43
- - Use `additionsDebug()` for logging to help with troubleshooting
44
- - If the addition accepts user input, export a `schema` object using `valibot` for input validation
45
- - Each addition should export a default function that takes `(context: Context, options?: T)` and returns `Context`
@@ -2,8 +2,8 @@ import { Codemod } from '../types.js';
2
2
 
3
3
  export default [
4
4
  {
5
- name: 'i18n',
6
- description: 'Adds internationalization (i18n) support to the plugin',
7
- scriptPath: import.meta.resolve('./scripts/i18n/index.js'),
5
+ name: 'example-addition',
6
+ description: 'Adds an example addition to the plugin',
7
+ scriptPath: import.meta.resolve('./scripts/example-addition.js'),
8
8
  },
9
9
  ] satisfies Codemod[];
@@ -19,7 +19,7 @@
19
19
  "updated": "%TODAY%"
20
20
  },
21
21
  "dependencies": {
22
- "grafanaDependency": ">=11.5.0",
22
+ "grafanaDependency": ">=10.4.0",
23
23
  "plugins": []
24
24
  }
25
25
  }
@@ -1,122 +0,0 @@
1
- import * as recast from 'recast';
2
- import * as babelParser from 'recast/parsers/babel-ts.js';
3
- import { additionsDebug } from '../../../utils.js';
4
-
5
- const { builders } = recast.types;
6
- function addI18nInitialization(context, needsBackwardCompatibility) {
7
- const moduleTsPath = context.doesFileExist("src/module.ts") ? "src/module.ts" : context.doesFileExist("src/module.tsx") ? "src/module.tsx" : null;
8
- if (!moduleTsPath) {
9
- additionsDebug("No module.ts or module.tsx found, skipping i18n initialization");
10
- return;
11
- }
12
- const moduleContent = context.getFile(moduleTsPath);
13
- if (!moduleContent) {
14
- return;
15
- }
16
- if (moduleContent.includes("initPluginTranslations")) {
17
- additionsDebug("i18n already initialized in module file");
18
- return;
19
- }
20
- try {
21
- const ast = recast.parse(moduleContent, {
22
- parser: babelParser
23
- });
24
- const imports = [];
25
- imports.push(
26
- builders.importDeclaration(
27
- [builders.importSpecifier(builders.identifier("initPluginTranslations"))],
28
- builders.literal("@grafana/i18n")
29
- )
30
- );
31
- imports.push(
32
- builders.importDeclaration(
33
- [builders.importDefaultSpecifier(builders.identifier("pluginJson"))],
34
- builders.literal("plugin.json")
35
- )
36
- );
37
- if (needsBackwardCompatibility) {
38
- imports.push(
39
- builders.importDeclaration(
40
- [builders.importSpecifier(builders.identifier("config"))],
41
- builders.literal("@grafana/runtime")
42
- )
43
- );
44
- imports.push(
45
- builders.importDeclaration(
46
- [builders.importDefaultSpecifier(builders.identifier("semver"))],
47
- builders.literal("semver")
48
- )
49
- );
50
- imports.push(
51
- builders.importDeclaration(
52
- [builders.importSpecifier(builders.identifier("loadResources"))],
53
- builders.literal("./loadResources")
54
- )
55
- );
56
- }
57
- const lastImportIndex = ast.program.body.findLastIndex((node) => node.type === "ImportDeclaration");
58
- if (lastImportIndex !== -1) {
59
- ast.program.body.splice(lastImportIndex + 1, 0, ...imports);
60
- } else {
61
- ast.program.body.unshift(...imports);
62
- }
63
- const i18nInitCode = needsBackwardCompatibility ? `// Before Grafana version 12.1.0 the plugin is responsible for loading translation resources
64
- // In Grafana version 12.1.0 and later Grafana is responsible for loading translation resources
65
- const loaders = semver.lt(config?.buildInfo?.version || '0.0.0', '12.1.0') ? [loadResources] : [];
66
-
67
- await initPluginTranslations(pluginJson.id, loaders);` : `await initPluginTranslations(pluginJson.id);`;
68
- const initAst = recast.parse(i18nInitCode, {
69
- parser: babelParser
70
- });
71
- const finalLastImportIndex = ast.program.body.findLastIndex((node) => node.type === "ImportDeclaration");
72
- if (finalLastImportIndex !== -1) {
73
- ast.program.body.splice(finalLastImportIndex + 1, 0, ...initAst.program.body);
74
- } else {
75
- ast.program.body.unshift(...initAst.program.body);
76
- }
77
- const output = recast.print(ast, {
78
- tabWidth: 2,
79
- trailingComma: true,
80
- lineTerminator: "\n"
81
- }).code;
82
- context.updateFile(moduleTsPath, output);
83
- additionsDebug(`Updated ${moduleTsPath} with i18n initialization`);
84
- } catch (error) {
85
- additionsDebug("Error updating module file:", error);
86
- }
87
- }
88
- function createLoadResourcesFile(context) {
89
- const loadResourcesPath = "src/loadResources.ts";
90
- if (context.doesFileExist(loadResourcesPath)) {
91
- additionsDebug("loadResources.ts already exists, skipping");
92
- return;
93
- }
94
- const pluginJsonRaw = context.getFile("src/plugin.json");
95
- if (!pluginJsonRaw) {
96
- additionsDebug("Cannot create loadResources.ts without plugin.json");
97
- return;
98
- }
99
- const loadResourcesContent = `import { LANGUAGES, ResourceLoader, Resources } from '@grafana/i18n';
100
- import pluginJson from 'plugin.json';
101
-
102
- const resources = LANGUAGES.reduce<Record<string, () => Promise<{ default: Resources }>>>((acc, lang) => {
103
- acc[lang.code] = () => import(\`./locales/\${lang.code}/\${pluginJson.id}.json\`);
104
- return acc;
105
- }, {});
106
-
107
- export const loadResources: ResourceLoader = async (resolvedLanguage: string) => {
108
- try {
109
- const translation = await resources[resolvedLanguage]();
110
- return translation.default;
111
- } catch (error) {
112
- // This makes sure that the plugin doesn't crash when the resolved language in Grafana isn't supported by the plugin
113
- console.error(\`The plugin '\${pluginJson.id}' doesn't support the language '\${resolvedLanguage}'\`, error);
114
- return {};
115
- }
116
- };
117
- `;
118
- context.addFile(loadResourcesPath, loadResourcesContent);
119
- additionsDebug("Created src/loadResources.ts for backward compatibility");
120
- }
121
-
122
- export { addI18nInitialization, createLoadResourcesFile };
@@ -1,250 +0,0 @@
1
- import { coerce, gte } from 'semver';
2
- import { parseDocument, stringify } from 'yaml';
3
- import * as recast from 'recast';
4
- import * as typeScriptParser from 'recast/parsers/typescript.js';
5
- import { additionsDebug } from '../../../utils.js';
6
-
7
- const { builders } = recast.types;
8
- function updateDockerCompose(context) {
9
- if (!context.doesFileExist("docker-compose.yaml")) {
10
- additionsDebug("docker-compose.yaml not found, skipping");
11
- return;
12
- }
13
- const composeContent = context.getFile("docker-compose.yaml");
14
- if (!composeContent) {
15
- return;
16
- }
17
- try {
18
- const composeDoc = parseDocument(composeContent);
19
- const currentEnv = composeDoc.getIn(["services", "grafana", "environment"]);
20
- if (!currentEnv) {
21
- additionsDebug("No environment section found in docker-compose.yaml, skipping");
22
- return;
23
- }
24
- if (typeof currentEnv === "object") {
25
- const envMap = currentEnv;
26
- const toggleValue = envMap.get("GF_FEATURE_TOGGLES_ENABLE");
27
- if (toggleValue) {
28
- const toggleStr = toggleValue.toString();
29
- if (toggleStr.includes("localizationForPlugins")) {
30
- additionsDebug("localizationForPlugins already in GF_FEATURE_TOGGLES_ENABLE");
31
- return;
32
- }
33
- composeDoc.setIn(
34
- ["services", "grafana", "environment", "GF_FEATURE_TOGGLES_ENABLE"],
35
- `${toggleStr},localizationForPlugins`
36
- );
37
- } else {
38
- composeDoc.setIn(["services", "grafana", "environment", "GF_FEATURE_TOGGLES_ENABLE"], "localizationForPlugins");
39
- }
40
- context.updateFile("docker-compose.yaml", stringify(composeDoc));
41
- additionsDebug("Updated docker-compose.yaml with localizationForPlugins feature toggle");
42
- }
43
- } catch (error) {
44
- additionsDebug("Error updating docker-compose.yaml:", error);
45
- }
46
- }
47
- function updatePluginJson(context, locales, needsBackwardCompatibility) {
48
- if (!context.doesFileExist("src/plugin.json")) {
49
- additionsDebug("src/plugin.json not found, skipping");
50
- return;
51
- }
52
- const pluginJsonRaw = context.getFile("src/plugin.json");
53
- if (!pluginJsonRaw) {
54
- return;
55
- }
56
- try {
57
- const pluginJson = JSON.parse(pluginJsonRaw);
58
- const existingLanguages = Array.isArray(pluginJson.languages) ? pluginJson.languages : [];
59
- const mergedLanguages = [.../* @__PURE__ */ new Set([...existingLanguages, ...locales])];
60
- pluginJson.languages = mergedLanguages;
61
- if (!pluginJson.dependencies) {
62
- pluginJson.dependencies = {};
63
- }
64
- const currentGrafanaDep = pluginJson.dependencies.grafanaDependency || ">=11.0.0";
65
- const targetVersion = needsBackwardCompatibility ? "11.0.0" : "12.1.0";
66
- const minVersion = coerce(targetVersion);
67
- const currentVersion = coerce(currentGrafanaDep.replace(/^[><=]+/, ""));
68
- if (!currentVersion || !minVersion || !gte(currentVersion, minVersion)) {
69
- pluginJson.dependencies.grafanaDependency = `>=${targetVersion}`;
70
- additionsDebug(`Updated grafanaDependency to >=${targetVersion}`);
71
- }
72
- context.updateFile("src/plugin.json", JSON.stringify(pluginJson, null, 2));
73
- additionsDebug("Updated src/plugin.json with languages:", locales);
74
- } catch (error) {
75
- additionsDebug("Error updating src/plugin.json:", error);
76
- }
77
- }
78
- function createI18nextConfig(context) {
79
- if (context.doesFileExist("i18next.config.ts")) {
80
- additionsDebug("i18next.config.ts already exists, skipping");
81
- return;
82
- }
83
- const pluginJsonRaw = context.getFile("src/plugin.json");
84
- if (!pluginJsonRaw) {
85
- additionsDebug("Cannot create i18next.config.ts without plugin.json");
86
- return;
87
- }
88
- try {
89
- const pluginJson = JSON.parse(pluginJsonRaw);
90
- const pluginId = pluginJson.id;
91
- if (!pluginId) {
92
- additionsDebug("No plugin ID found in plugin.json");
93
- return;
94
- }
95
- const i18nextConfig = `import { defineConfig } from 'i18next-cli';
96
- import pluginJson from './src/plugin.json';
97
-
98
- export default defineConfig({
99
- locales: pluginJson.languages,
100
- extract: {
101
- input: ['src/**/*.{tsx,ts}'],
102
- output: 'src/locales/{{language}}/{{namespace}}.json',
103
- defaultNS: pluginJson.id,
104
- functions: ['t', '*.t'],
105
- transComponents: ['Trans'],
106
- },
107
- });
108
- `;
109
- context.addFile("i18next.config.ts", i18nextConfig);
110
- additionsDebug("Created i18next.config.ts");
111
- } catch (error) {
112
- additionsDebug("Error creating i18next.config.ts:", error);
113
- }
114
- }
115
- function addI18nextToExternalsArray(externalsArray) {
116
- const hasI18next = externalsArray.elements.some((element) => {
117
- if (element && (element.type === "Literal" || element.type === "StringLiteral") && typeof element.value === "string") {
118
- return element.value === "i18next";
119
- }
120
- return false;
121
- });
122
- if (hasI18next) {
123
- additionsDebug("'i18next' already in externals array");
124
- return false;
125
- }
126
- externalsArray.elements.push(builders.literal("i18next"));
127
- additionsDebug("Added 'i18next' to externals array");
128
- return true;
129
- }
130
- function ensureI18nextExternal(context) {
131
- try {
132
- additionsDebug("Checking for externals configuration...");
133
- const externalsPath = ".config/bundler/externals.ts";
134
- if (context.doesFileExist(externalsPath)) {
135
- additionsDebug(`Found ${externalsPath}, checking for i18next...`);
136
- const externalsContent = context.getFile(externalsPath);
137
- if (externalsContent) {
138
- try {
139
- const ast = recast.parse(externalsContent, {
140
- parser: typeScriptParser
141
- });
142
- let hasChanges = false;
143
- recast.visit(ast, {
144
- visitVariableDeclarator(path) {
145
- const { node } = path;
146
- if (node.id.type === "Identifier" && node.id.name === "externals" && node.init && node.init.type === "ArrayExpression") {
147
- additionsDebug("Found externals array in externals.ts");
148
- if (addI18nextToExternalsArray(node.init)) {
149
- hasChanges = true;
150
- }
151
- }
152
- return this.traverse(path);
153
- }
154
- });
155
- if (hasChanges) {
156
- const output = recast.print(ast, {
157
- tabWidth: 2,
158
- trailingComma: true,
159
- lineTerminator: "\n"
160
- });
161
- context.updateFile(externalsPath, output.code);
162
- additionsDebug(`Updated ${externalsPath} with i18next external`);
163
- }
164
- return;
165
- } catch (error) {
166
- additionsDebug(`Error updating ${externalsPath}:`, error);
167
- }
168
- }
169
- }
170
- const webpackConfigPath = ".config/webpack/webpack.config.ts";
171
- additionsDebug(`Checking for ${webpackConfigPath}...`);
172
- if (context.doesFileExist(webpackConfigPath)) {
173
- additionsDebug(`Found ${webpackConfigPath}, checking for inline externals...`);
174
- const webpackContent = context.getFile(webpackConfigPath);
175
- if (webpackContent) {
176
- try {
177
- const ast = recast.parse(webpackContent, {
178
- parser: typeScriptParser
179
- });
180
- let hasChanges = false;
181
- let foundExternals = false;
182
- recast.visit(ast, {
183
- visitObjectExpression(path) {
184
- const { node } = path;
185
- const properties = node.properties;
186
- if (properties) {
187
- for (const prop of properties) {
188
- if (prop && (prop.type === "Property" || prop.type === "ObjectProperty")) {
189
- const key = "key" in prop ? prop.key : null;
190
- const value = "value" in prop ? prop.value : null;
191
- if (key && key.type === "Identifier" && key.name === "externals" && value && value.type === "ArrayExpression") {
192
- foundExternals = true;
193
- additionsDebug("Found externals property in webpack.config.ts");
194
- if (addI18nextToExternalsArray(value)) {
195
- hasChanges = true;
196
- }
197
- }
198
- }
199
- }
200
- }
201
- return this.traverse(path);
202
- },
203
- visitProperty(path) {
204
- const { node } = path;
205
- if (node.key && node.key.type === "Identifier" && node.key.name === "externals" && node.value && node.value.type === "ArrayExpression") {
206
- if (!foundExternals) {
207
- foundExternals = true;
208
- additionsDebug("Found externals property in webpack.config.ts (via visitProperty)");
209
- }
210
- if (addI18nextToExternalsArray(node.value)) {
211
- hasChanges = true;
212
- }
213
- }
214
- return this.traverse(path);
215
- }
216
- });
217
- if (!foundExternals) {
218
- additionsDebug("No externals property found in webpack.config.ts");
219
- }
220
- if (hasChanges) {
221
- const output = recast.print(ast, {
222
- tabWidth: 2,
223
- trailingComma: true,
224
- lineTerminator: "\n"
225
- });
226
- context.updateFile(webpackConfigPath, output.code);
227
- additionsDebug(`Updated ${webpackConfigPath} with i18next external`);
228
- } else if (foundExternals) {
229
- additionsDebug("i18next already present in externals, no changes needed");
230
- }
231
- return;
232
- } catch (error) {
233
- additionsDebug(`Error updating ${webpackConfigPath}:`, error);
234
- additionsDebug(`Error details: ${error instanceof Error ? error.message : String(error)}`);
235
- }
236
- } else {
237
- additionsDebug(`File ${webpackConfigPath} exists but content is empty`);
238
- }
239
- } else {
240
- additionsDebug(`File ${webpackConfigPath} does not exist`);
241
- }
242
- additionsDebug("No externals configuration found, skipping i18next external check");
243
- } catch (error) {
244
- additionsDebug(
245
- `Unexpected error in ensureI18nextExternal: ${error instanceof Error ? error.message : String(error)}`
246
- );
247
- }
248
- }
249
-
250
- export { createI18nextConfig, ensureI18nextExternal, updateDockerCompose, updatePluginJson };
@@ -1,64 +0,0 @@
1
- import * as v from 'valibot';
2
- import { additionsDebug } from '../../../utils.js';
3
- import { updateDockerCompose, updatePluginJson, createI18nextConfig, ensureI18nextExternal } from './config-updates.js';
4
- import { addI18nInitialization, createLoadResourcesFile } from './code-generation.js';
5
- import { addI18nDependency, addSemverDependency, updateEslintConfig, addI18nextCli } from './tooling.js';
6
- import { checkReactVersion, checkNeedsBackwardCompatibility, createLocaleFiles } from './utils.js';
7
-
8
- const schema = v.object(
9
- {
10
- locales: v.pipe(
11
- v.union([v.string(), v.array(v.string())]),
12
- v.transform((input) => {
13
- return typeof input === "string" ? input.split(",").map((s) => s.trim()) : input;
14
- }),
15
- v.array(
16
- v.pipe(
17
- v.string(),
18
- v.regex(/^[a-z]{2}-[A-Z]{2}$/, "Locale must be in format xx-XX (e.g., en-US, es-ES, sv-SE)")
19
- ),
20
- 'Please provide a comma-separated list of all supported locales, e.g., "en-US,es-ES,sv-SE"'
21
- ),
22
- v.minLength(1, 'Please provide a comma-separated list of all supported locales, e.g., "en-US,es-ES,sv-SE"')
23
- )
24
- },
25
- 'Please provide a comma-separated list of all supported locales, e.g., "en-US,es-ES,sv-SE"'
26
- );
27
- function i18nAddition(context, options) {
28
- const { locales } = options;
29
- additionsDebug("Adding i18n support with locales:", locales);
30
- checkReactVersion(context);
31
- const needsBackwardCompatibility = checkNeedsBackwardCompatibility(context);
32
- additionsDebug("Needs backward compatibility:", needsBackwardCompatibility);
33
- updateDockerCompose(context);
34
- updatePluginJson(context, locales, needsBackwardCompatibility);
35
- createLocaleFiles(context, locales);
36
- addI18nDependency(context);
37
- if (needsBackwardCompatibility) {
38
- addSemverDependency(context);
39
- }
40
- updateEslintConfig(context);
41
- addI18nInitialization(context, needsBackwardCompatibility);
42
- if (needsBackwardCompatibility) {
43
- createLoadResourcesFile(context);
44
- }
45
- addI18nextCli(context);
46
- createI18nextConfig(context);
47
- try {
48
- ensureI18nextExternal(context);
49
- } catch (error) {
50
- additionsDebug(`Error ensuring i18next external: ${error instanceof Error ? error.message : String(error)}`);
51
- }
52
- additionsDebug("\n\u2705 i18n support has been successfully added to your plugin!\n");
53
- additionsDebug("Next steps:");
54
- additionsDebug("1. Follow the instructions to translate your source code:");
55
- additionsDebug(
56
- " https://grafana.com/developers/plugin-tools/how-to-guides/plugin-internationalization-grafana-11#determine-the-text-to-translate"
57
- );
58
- additionsDebug("2. Run the i18n-extract script to scan your code for translatable strings:");
59
- additionsDebug(" npm run i18n-extract (or yarn/pnpm run i18n-extract)");
60
- additionsDebug("3. Fill in your locale JSON files with translated strings\n");
61
- return context;
62
- }
63
-
64
- export { i18nAddition as default, schema };