@grafana/create-plugin 6.5.0-canary.2320.20267441803.0 → 6.5.0-canary.2320.20267597497.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.
@@ -123,28 +123,8 @@ function addI18nextToExternalsArray(externalsArray) {
123
123
  additionsDebug("'i18next' already in externals array");
124
124
  return false;
125
125
  }
126
- let insertIndex = -1;
127
- for (let i = 0; i < externalsArray.elements.length; i++) {
128
- const element = externalsArray.elements[i];
129
- if (element && (element.type === "Literal" || element.type === "StringLiteral") && element.value === "rxjs") {
130
- insertIndex = i + 1;
131
- break;
132
- }
133
- }
134
- if (insertIndex === -1) {
135
- for (let i = externalsArray.elements.length - 1; i >= 0; i--) {
136
- const element = externalsArray.elements[i];
137
- if (element && element.type !== "FunctionExpression" && element.type !== "ArrowFunctionExpression") {
138
- insertIndex = i + 1;
139
- break;
140
- }
141
- }
142
- if (insertIndex === -1) {
143
- insertIndex = externalsArray.elements.length;
144
- }
145
- }
146
- externalsArray.elements.splice(insertIndex, 0, builders.literal("i18next"));
147
- additionsDebug(`Added 'i18next' to externals array at position ${insertIndex}`);
126
+ externalsArray.elements.push(builders.literal("i18next"));
127
+ additionsDebug("Added 'i18next' to externals array");
148
128
  return true;
149
129
  }
150
130
  function ensureI18nextExternal(context) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/create-plugin",
3
- "version": "6.5.0-canary.2320.20267441803.0",
3
+ "version": "6.5.0-canary.2320.20267597497.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": "4f8f948e49999c33b0539f1bba311552d27670eb"
59
+ "gitHead": "98307e6a7ae71c85e59d5b7bf2f2eeb98f9fb332"
60
60
  }
@@ -164,35 +164,9 @@ function addI18nextToExternalsArray(externalsArray: recast.types.namedTypes.Arra
164
164
  return false;
165
165
  }
166
166
 
167
- // Find the position after 'rxjs' to insert 'i18next'
168
- let insertIndex = -1;
169
- for (let i = 0; i < externalsArray.elements.length; i++) {
170
- const element = externalsArray.elements[i];
171
- if (element && (element.type === 'Literal' || element.type === 'StringLiteral') && element.value === 'rxjs') {
172
- insertIndex = i + 1;
173
- break;
174
- }
175
- }
176
-
177
- // If 'rxjs' not found, append to the end (before the function at the end)
178
- if (insertIndex === -1) {
179
- // Find the last non-function element
180
- for (let i = externalsArray.elements.length - 1; i >= 0; i--) {
181
- const element = externalsArray.elements[i];
182
- if (element && element.type !== 'FunctionExpression' && element.type !== 'ArrowFunctionExpression') {
183
- insertIndex = i + 1;
184
- break;
185
- }
186
- }
187
- // If still not found, append at the end
188
- if (insertIndex === -1) {
189
- insertIndex = externalsArray.elements.length;
190
- }
191
- }
192
-
193
- // Insert 'i18next' at the found position
194
- externalsArray.elements.splice(insertIndex, 0, builders.literal('i18next'));
195
- additionsDebug(`Added 'i18next' to externals array at position ${insertIndex}`);
167
+ // Append 'i18next' to the end of the array
168
+ externalsArray.elements.push(builders.literal('i18next'));
169
+ additionsDebug("Added 'i18next' to externals array");
196
170
  return true;
197
171
  }
198
172