@grafana/create-plugin 5.18.2 → 5.18.3
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,15 @@
|
|
|
1
|
+
# v5.18.3 (Fri Feb 21 2025)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- Create Plugin: fix absolute path being interpreted by shell [#1560](https://github.com/grafana/plugin-tools/pull/1560) ([@jackw](https://github.com/jackw))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Jack Westbrook ([@jackw](https://github.com/jackw))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
1
13
|
# v5.18.1 (Thu Feb 20 2025)
|
|
2
14
|
|
|
3
15
|
#### 🐛 Bug Fix
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { execFile as nodeExecFile } from 'node:child_process';
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import { resolve } from 'node:path';
|
|
4
4
|
import { promisify } from 'node:util';
|
|
5
5
|
import { getPackageJson } from './utils.packagejson.js';
|
|
6
|
-
const
|
|
6
|
+
const execFile = promisify(nodeExecFile);
|
|
7
7
|
export async function prettifyFiles(options) {
|
|
8
8
|
const targetPath = options.targetPath ?? process.cwd();
|
|
9
9
|
const projectRoot = options.projectRoot ?? targetPath;
|
|
@@ -16,8 +16,9 @@ export async function prettifyFiles(options) {
|
|
|
16
16
|
const prettierVersion = getPrettierVersion(projectRoot);
|
|
17
17
|
const directoryToWrite = resolve(projectRoot, targetPath);
|
|
18
18
|
try {
|
|
19
|
-
let command =
|
|
20
|
-
|
|
19
|
+
let command = 'npx';
|
|
20
|
+
const args = ['-y', `prettier@${prettierVersion}`, directoryToWrite, '--write'];
|
|
21
|
+
await execFile(command, args);
|
|
21
22
|
}
|
|
22
23
|
catch (error) {
|
|
23
24
|
throw new Error('There was a problem running prettier on the plugin files. Please run `npx -y prettier@2 . --write` manually in your plugin directory.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/create-plugin",
|
|
3
|
-
"version": "5.18.
|
|
3
|
+
"version": "5.18.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"directory": "packages/create-plugin",
|
|
6
6
|
"url": "https://github.com/grafana/plugin-tools"
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"engines": {
|
|
79
79
|
"node": ">=20"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "fde37e2e639208485af1c8b0343231d27661b4f5"
|
|
82
82
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { execFile as nodeExecFile } from 'node:child_process';
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import { resolve } from 'node:path';
|
|
4
4
|
import { promisify } from 'node:util';
|
|
5
5
|
import { getPackageJson } from './utils.packagejson.js';
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const execFile = promisify(nodeExecFile);
|
|
8
8
|
|
|
9
9
|
type PrettifyFilesArgs = {
|
|
10
10
|
// The path where we want to prettify files, defaults to the CWD
|
|
@@ -30,8 +30,9 @@ export async function prettifyFiles(options: PrettifyFilesArgs) {
|
|
|
30
30
|
const directoryToWrite = resolve(projectRoot, targetPath);
|
|
31
31
|
|
|
32
32
|
try {
|
|
33
|
-
let command =
|
|
34
|
-
|
|
33
|
+
let command = 'npx';
|
|
34
|
+
const args = ['-y', `prettier@${prettierVersion}`, directoryToWrite, '--write'];
|
|
35
|
+
await execFile(command, args);
|
|
35
36
|
} catch (error) {
|
|
36
37
|
throw new Error(
|
|
37
38
|
'There was a problem running prettier on the plugin files. Please run `npx -y prettier@2 . --write` manually in your plugin directory.'
|