@grafana/create-plugin 3.2.0-canary.706.8d661c1.0 → 3.2.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,15 @@
|
|
|
1
|
+
# v3.2.0 (Thu Feb 01 2024)
|
|
2
|
+
|
|
3
|
+
#### 🚀 Enhancement
|
|
4
|
+
|
|
5
|
+
- Create-plugin: Check for a clean working tree [#705](https://github.com/grafana/plugin-tools/pull/705) ([@leventebalogh](https://github.com/leventebalogh))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Levente Balogh ([@leventebalogh](https://github.com/leventebalogh))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
1
13
|
# v3.1.3 (Mon Jan 29 2024)
|
|
2
14
|
|
|
3
15
|
#### 🐛 Bug Fix
|
|
@@ -5,7 +5,6 @@ import { confirmPrompt, selectPrompt, printMessage, printSuccessMessage, printRe
|
|
|
5
5
|
import { updatePackageJson, hasNpmDependenciesToUpdate, getPackageJsonUpdatesAsText, updateNpmScripts, writePackageManagerInPackageJson, } from '../utils/utils.npm.js';
|
|
6
6
|
import { getPackageManagerWithFallback } from '../utils/utils.packageManager.js';
|
|
7
7
|
import { isGitDirectory, isGitDirectoryClean } from '../utils/utils.git.js';
|
|
8
|
-
import { isPluginDirectory } from '../utils/utils.plugin.js';
|
|
9
8
|
export const update = async (argv) => {
|
|
10
9
|
try {
|
|
11
10
|
if (!(await isGitDirectory()) && !argv.force) {
|
|
@@ -26,14 +25,6 @@ In case you want to proceed as is please use the ${chalk.bold('--force')} flag.)
|
|
|
26
25
|
});
|
|
27
26
|
process.exit(1);
|
|
28
27
|
}
|
|
29
|
-
if (!isPluginDirectory() && !argv.force) {
|
|
30
|
-
printRedBox({
|
|
31
|
-
title: 'Are you inside a plugin directory?',
|
|
32
|
-
subtitle: 'We couldn\'t find a "src/plugin.json" file under your current directory.',
|
|
33
|
-
content: `(Please make sure to run this command from the root of your plugin folder. In case you want to proceed as is please use the ${chalk.bold('--force')} flag.)`,
|
|
34
|
-
});
|
|
35
|
-
process.exit(1);
|
|
36
|
-
}
|
|
37
28
|
printMessage(TEXT.updateCommandWarning);
|
|
38
29
|
if (await confirmPrompt(TEXT.updateConfigPrompt)) {
|
|
39
30
|
compileTemplateFiles(UDPATE_CONFIG.filesToOverride, getTemplateData());
|
|
@@ -5,12 +5,3 @@ export function getPluginJson(srcDir) {
|
|
|
5
5
|
const pluginJsonPath = path.join(srcPath, 'plugin.json');
|
|
6
6
|
return readJsonFile(pluginJsonPath);
|
|
7
7
|
}
|
|
8
|
-
export function isPluginDirectory() {
|
|
9
|
-
try {
|
|
10
|
-
getPluginJson();
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
catch (e) {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/create-plugin",
|
|
3
|
-
"version": "3.2.0
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"directory": "packages/create-plugin",
|
|
6
6
|
"url": "https://github.com/grafana/plugin-tools"
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"engines": {
|
|
87
87
|
"node": ">=20"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "96e111bfcc9615a97c3085f16646d1bb76f5ddb4"
|
|
90
90
|
}
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
} from '../utils/utils.npm.js';
|
|
13
13
|
import { getPackageManagerWithFallback } from '../utils/utils.packageManager.js';
|
|
14
14
|
import { isGitDirectory, isGitDirectoryClean } from '../utils/utils.git.js';
|
|
15
|
-
import { isPluginDirectory } from '../utils/utils.plugin.js';
|
|
16
15
|
|
|
17
16
|
export const update = async (argv: minimist.ParsedArgs) => {
|
|
18
17
|
try {
|
|
@@ -38,18 +37,6 @@ In case you want to proceed as is please use the ${chalk.bold('--force')} flag.)
|
|
|
38
37
|
process.exit(1);
|
|
39
38
|
}
|
|
40
39
|
|
|
41
|
-
if (!isPluginDirectory() && !argv.force) {
|
|
42
|
-
printRedBox({
|
|
43
|
-
title: 'Are you inside a plugin directory?',
|
|
44
|
-
subtitle: 'We couldn\'t find a "src/plugin.json" file under your current directory.',
|
|
45
|
-
content: `(Please make sure to run this command from the root of your plugin folder. In case you want to proceed as is please use the ${chalk.bold(
|
|
46
|
-
'--force'
|
|
47
|
-
)} flag.)`,
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
process.exit(1);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
40
|
// 0. Warning
|
|
54
41
|
// ----------
|
|
55
42
|
printMessage(TEXT.updateCommandWarning);
|
|
@@ -6,13 +6,3 @@ export function getPluginJson(srcDir?: string) {
|
|
|
6
6
|
const pluginJsonPath = path.join(srcPath, 'plugin.json');
|
|
7
7
|
return readJsonFile(pluginJsonPath);
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
// Checks if CWD is a valid root directory of a plugin
|
|
11
|
-
export function isPluginDirectory() {
|
|
12
|
-
try {
|
|
13
|
-
getPluginJson();
|
|
14
|
-
return true;
|
|
15
|
-
} catch (e) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
}
|