@grafana/create-plugin 1.6.1 → 1.6.2

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,23 @@
1
+ # v1.6.2 (Wed Jun 07 2023)
2
+
3
+ ### Release Notes
4
+
5
+ #### Create Plugin: Introduce OS check ([#263](https://github.com/grafana/plugin-tools/pull/263))
6
+
7
+ `create-plugin` will now exit when run natively on Windows, which is an unsupported platform with known issues. By exiting early we hope to prevent users from hitting issues whilst developing plugins. We recommend the use of Windows Subsystem for Linux (WSL) which is supported.
8
+
9
+ ---
10
+
11
+ #### 🐛 Bug Fix
12
+
13
+ - Create Plugin: Introduce OS check [#263](https://github.com/grafana/plugin-tools/pull/263) ([@jackw](https://github.com/jackw))
14
+
15
+ #### Authors: 1
16
+
17
+ - Jack Westbrook ([@jackw](https://github.com/jackw))
18
+
19
+ ---
20
+
1
21
  # v1.6.1 (Tue Jun 06 2023)
2
22
 
3
23
  :tada: This release contains work from a new contributor! :tada:
package/dist/bin/run.js CHANGED
@@ -6,6 +6,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
6
6
  exports.__esModule = true;
7
7
  var minimist_1 = __importDefault(require("minimist"));
8
8
  var commands_1 = require("../commands");
9
+ var utils_os_1 = require("../utils/utils.os");
10
+ if ((0, utils_os_1.isUnsupportedPlatform)()) {
11
+ console.error("Unsupported operating system 'Windows' detected. Please use WSL with create-plugin.");
12
+ process.exit(1);
13
+ }
9
14
  var args = process.argv.slice(2);
10
15
  var argv = (0, minimist_1["default"])(args);
11
16
  var commands = {
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.isUnsupportedPlatform = void 0;
4
+ var os_1 = require("os");
5
+ function isUnsupportedPlatform() {
6
+ var os = (0, os_1.platform)();
7
+ if (os === 'win32') {
8
+ return true;
9
+ }
10
+ return false;
11
+ }
12
+ exports.isUnsupportedPlatform = isUnsupportedPlatform;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/create-plugin",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "directory": "packages/create-plugin",
@@ -66,5 +66,5 @@
66
66
  "engines": {
67
67
  "node": ">=16"
68
68
  },
69
- "gitHead": "5a9268448ffcd92f5803ba8cff2dac7e2c6575cc"
69
+ "gitHead": "8bb2069edfde4077a018ce301be52acce67b7d1d"
70
70
  }
package/src/bin/run.ts CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  import minimist from 'minimist';
4
4
  import { generate, update, migrate, version } from '../commands';
5
+ import { isUnsupportedPlatform } from '../utils/utils.os';
6
+
7
+ // Exit early if operating system isn't supported.
8
+ if (isUnsupportedPlatform()) {
9
+ console.error("Unsupported operating system 'Windows' detected. Please use WSL with create-plugin.");
10
+ process.exit(1);
11
+ }
5
12
 
6
13
  const args = process.argv.slice(2);
7
14
  const argv = minimist(args);
@@ -0,0 +1,11 @@
1
+ import { platform } from 'os';
2
+
3
+ export function isUnsupportedPlatform() {
4
+ const os = platform();
5
+
6
+ if (os === 'win32') {
7
+ return true;
8
+ }
9
+
10
+ return false;
11
+ }