@grafana/create-plugin 5.26.3 → 5.26.4
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 +14 -0
- package/dist/migrations/manager.js +4 -2
- package/dist/migrations/scripts/004-eslint9-flat-config.js +2 -1
- package/package.json +3 -2
- package/src/migrations/manager.ts +6 -2
- package/src/migrations/scripts/004-eslint9-flat-config.test.ts +7 -1
- package/src/migrations/scripts/004-eslint9-flat-config.ts +2 -1
- package/templates/common/_package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# v5.26.4 (Fri Sep 12 2025)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- Create-plugin: fix migration manager error and eslint ignores patterns [#2112](https://github.com/grafana/plugin-tools/pull/2112) ([@jackw](https://github.com/jackw))
|
|
6
|
+
- Update dependency @grafana/plugin-e2e to v2.1.12 [#2115](https://github.com/grafana/plugin-tools/pull/2115) ([@renovate[bot]](https://github.com/renovate[bot]))
|
|
7
|
+
|
|
8
|
+
#### Authors: 2
|
|
9
|
+
|
|
10
|
+
- [@renovate[bot]](https://github.com/renovate[bot])
|
|
11
|
+
- Jack Westbrook ([@jackw](https://github.com/jackw))
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
1
15
|
# v5.26.3 (Thu Sep 11 2025)
|
|
2
16
|
|
|
3
17
|
#### 🐛 Bug Fix
|
|
@@ -5,6 +5,7 @@ import { migrationsDebug, formatFiles, flushChanges, printChanges, installNPMDep
|
|
|
5
5
|
import { gitCommitNoVerify } from '../utils/utils.git.js';
|
|
6
6
|
import { setRootConfig } from '../utils/utils.config.js';
|
|
7
7
|
import { output } from '../utils/utils.console.js';
|
|
8
|
+
import { CURRENT_APP_VERSION } from '../utils/utils.version.js';
|
|
8
9
|
|
|
9
10
|
function getMigrationsToRun(fromVersion, toVersion, migrations = defaultMigrations.migrations) {
|
|
10
11
|
const semverRange = `${fromVersion} - ${toVersion}`;
|
|
@@ -23,7 +24,8 @@ async function runMigrations(migrations, options = {}) {
|
|
|
23
24
|
const migrationList = Object.entries(migrations).map(
|
|
24
25
|
([key, migrationMeta]) => `${key} (${migrationMeta.description})`
|
|
25
26
|
);
|
|
26
|
-
|
|
27
|
+
const migrationListBody = migrationList.length > 0 ? output.bulletList(migrationList) : ["No migrations to run."];
|
|
28
|
+
output.log({ title: "Running the following migrations:", body: migrationListBody });
|
|
27
29
|
for (const [key, migration] of Object.entries(migrations)) {
|
|
28
30
|
try {
|
|
29
31
|
const context = await runMigration(migration, new Context(basePath));
|
|
@@ -43,7 +45,7 @@ async function runMigrations(migrations, options = {}) {
|
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
|
-
const latestVersion = Object.values(migrations).at(-1)
|
|
48
|
+
const latestVersion = migrationList.length > 0 ? Object.values(migrations).at(-1)?.version : CURRENT_APP_VERSION;
|
|
47
49
|
setRootConfig({ version: latestVersion });
|
|
48
50
|
if (options.commitEachMigration) {
|
|
49
51
|
await gitCommitNoVerify(`chore: update .config/.cprc.json to version ${latestVersion}.`);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { camelCase } from 'change-case';
|
|
2
|
+
import { convertIgnorePatternToMinimatch } from '@ivanmaxlogiudice/gitignore';
|
|
2
3
|
import { parse } from 'jsonc-parser';
|
|
3
4
|
import minimist from 'minimist';
|
|
4
5
|
import { resolve, dirname, relative } from 'node:path';
|
|
@@ -322,7 +323,7 @@ function getIgnorePaths(context) {
|
|
|
322
323
|
return Array.from(result);
|
|
323
324
|
}
|
|
324
325
|
const isValidIdentifier = (name) => /^[a-z_$][0-9a-z_$]*$/iu.test(name);
|
|
325
|
-
const addIgnoreLinesToSet = (content) => content.split("\n").filter((line) => line.length > 0 && !line.startsWith("#")).map((line) => line.trim());
|
|
326
|
+
const addIgnoreLinesToSet = (content) => content.split("\n").filter((line) => line.length > 0 && !line.startsWith("#")).map((line) => convertIgnorePatternToMinimatch(line.trim()));
|
|
326
327
|
function discoverRelativeLegacyConfigs(context, configPath, discoveredConfigs = /* @__PURE__ */ new Map()) {
|
|
327
328
|
if (discoveredConfigs.has(configPath)) {
|
|
328
329
|
return discoveredConfigs;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/create-plugin",
|
|
3
|
-
"version": "5.26.
|
|
3
|
+
"version": "5.26.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"directory": "packages/create-plugin",
|
|
6
6
|
"url": "https://github.com/grafana/plugin-tools"
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"typecheck": "tsc --noEmit"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
+
"@ivanmaxlogiudice/gitignore": "^0.0.2",
|
|
28
29
|
"chalk": "^5.3.0",
|
|
29
30
|
"change-case": "^5.4.0",
|
|
30
31
|
"debug": "^4.3.4",
|
|
@@ -60,5 +61,5 @@
|
|
|
60
61
|
"engines": {
|
|
61
62
|
"node": ">=20"
|
|
62
63
|
},
|
|
63
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "756a017a7ee999fb29a1ad0ab1b8f1928a64793a"
|
|
64
65
|
}
|
|
@@ -5,6 +5,7 @@ import { flushChanges, printChanges, migrationsDebug, formatFiles, installNPMDep
|
|
|
5
5
|
import { gitCommitNoVerify } from '../utils/utils.git.js';
|
|
6
6
|
import { setRootConfig } from '../utils/utils.config.js';
|
|
7
7
|
import { output } from '../utils/utils.console.js';
|
|
8
|
+
import { CURRENT_APP_VERSION } from '../utils/utils.version.js';
|
|
8
9
|
|
|
9
10
|
export type MigrationFn = (context: Context) => Context | Promise<Context>;
|
|
10
11
|
|
|
@@ -39,7 +40,9 @@ export async function runMigrations(migrations: Record<string, MigrationMeta>, o
|
|
|
39
40
|
([key, migrationMeta]) => `${key} (${migrationMeta.description})`
|
|
40
41
|
);
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
const migrationListBody = migrationList.length > 0 ? output.bulletList(migrationList) : ['No migrations to run.'];
|
|
44
|
+
|
|
45
|
+
output.log({ title: 'Running the following migrations:', body: migrationListBody });
|
|
43
46
|
|
|
44
47
|
for (const [key, migration] of Object.entries(migrations)) {
|
|
45
48
|
try {
|
|
@@ -65,7 +68,8 @@ export async function runMigrations(migrations: Record<string, MigrationMeta>, o
|
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
70
|
|
|
68
|
-
|
|
71
|
+
// If there are no migrations to run, we should set the version to the current create-plugin version.
|
|
72
|
+
const latestVersion = migrationList.length > 0 ? Object.values(migrations).at(-1)?.version : CURRENT_APP_VERSION;
|
|
69
73
|
setRootConfig({ version: latestVersion });
|
|
70
74
|
|
|
71
75
|
if (options.commitEachMigration) {
|
|
@@ -87,7 +87,13 @@ describe('004-eslint9-flat-config', () => {
|
|
|
87
87
|
"import { defineConfig } from "eslint/config";
|
|
88
88
|
|
|
89
89
|
export default defineConfig([{
|
|
90
|
-
ignores: [
|
|
90
|
+
ignores: [
|
|
91
|
+
"**/*.test.ts",
|
|
92
|
+
"**/.github",
|
|
93
|
+
"**/.vscode",
|
|
94
|
+
"**/playwright-report",
|
|
95
|
+
"**/dist",
|
|
96
|
+
],
|
|
91
97
|
}, {
|
|
92
98
|
rules: {
|
|
93
99
|
"no-console": "error",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { camelCase } from 'change-case';
|
|
2
|
+
import { convertIgnorePatternToMinimatch } from '@ivanmaxlogiudice/gitignore';
|
|
2
3
|
import type { Linter } from 'eslint';
|
|
3
4
|
import { parse } from 'jsonc-parser';
|
|
4
5
|
import minimist from 'minimist';
|
|
@@ -418,7 +419,7 @@ const addIgnoreLinesToSet = (content: string) =>
|
|
|
418
419
|
content
|
|
419
420
|
.split('\n')
|
|
420
421
|
.filter((line) => line.length > 0 && !line.startsWith('#'))
|
|
421
|
-
.map((line) => line.trim());
|
|
422
|
+
.map((line) => convertIgnorePatternToMinimatch(line.trim()));
|
|
422
423
|
|
|
423
424
|
function discoverRelativeLegacyConfigs(
|
|
424
425
|
context: Context,
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
{{#if useCypress}} "@grafana/e2e": "^11.0.7",
|
|
22
22
|
"@grafana/e2e-selectors": "^12.1.0",{{/if}}
|
|
23
23
|
"@grafana/eslint-config": "^8.0.0",{{#if usePlaywright}}
|
|
24
|
-
"@grafana/plugin-e2e": "^2.1.
|
|
24
|
+
"@grafana/plugin-e2e": "^2.1.12",{{/if}}
|
|
25
25
|
"@grafana/tsconfig": "^2.0.0",{{#if usePlaywright}}
|
|
26
26
|
"@playwright/test": "^1.52.0",{{/if}}{{#if useExperimentalRspack}}
|
|
27
27
|
"@rspack/core": "^1.3.0",
|