@grafana/create-plugin 2.3.0 → 2.3.1-canary.441.edac461.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.
@@ -29,6 +29,7 @@ var path_1 = __importDefault(require("path"));
29
29
  var constants_1 = require("../constants");
30
30
  var utils_handlebars_1 = require("../utils/utils.handlebars");
31
31
  var utils_path_1 = require("../utils/utils.path");
32
+ var utils_version_1 = require("../utils/utils.version");
32
33
  var utils_packageManager_1 = require("../utils/utils.packageManager");
33
34
  var print_success_message_1 = require("./generate-actions/print-success-message");
34
35
  var update_go_sdk_and_packages_1 = require("./generate-actions/update-go-sdk-and-packages");
@@ -111,6 +112,7 @@ function default_1(plop) {
111
112
  packageManagerVersion: packageManagerVersion,
112
113
  isAppType: isAppType,
113
114
  isNPM: packageManagerName === 'npm',
115
+ packageVersion: (0, utils_version_1.getVersion)(),
114
116
  };
115
117
  var commonActions = getActionsForTemplateFolder({
116
118
  folderPath: constants_1.TEMPLATE_PATHS.common,
@@ -37,12 +37,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.version = void 0;
40
- var path_1 = require("path");
41
- var fs_1 = require("fs");
40
+ var utils_version_1 = require("../utils/utils.version");
42
41
  var version = function () { return __awaiter(void 0, void 0, void 0, function () {
43
42
  return __generator(this, function (_a) {
44
43
  try {
45
- console.log(getVersion());
44
+ console.log((0, utils_version_1.getVersion)());
46
45
  }
47
46
  catch (error) {
48
47
  console.error(error);
@@ -52,12 +51,3 @@ var version = function () { return __awaiter(void 0, void 0, void 0, function ()
52
51
  });
53
52
  }); };
54
53
  exports.version = version;
55
- var getVersion = function () {
56
- var packageJsonPath = (0, path_1.resolve)(__dirname, '..', '..', 'package.json');
57
- var pkg = (0, fs_1.readFileSync)(packageJsonPath, 'utf8');
58
- var version = JSON.parse(pkg).version;
59
- if (!version) {
60
- throw "Could not find the version of sign-plugin";
61
- }
62
- return version;
63
- };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getVersion = void 0;
4
+ var path_1 = require("path");
5
+ var fs_1 = require("fs");
6
+ var getVersion = function () {
7
+ var packageJsonPath = (0, path_1.resolve)(__dirname, '..', '..', 'package.json');
8
+ var pkg = (0, fs_1.readFileSync)(packageJsonPath, 'utf8');
9
+ var version = JSON.parse(pkg).version;
10
+ if (!version) {
11
+ throw "Could not find the version of create-plugin";
12
+ }
13
+ return version;
14
+ };
15
+ exports.getVersion = getVersion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/create-plugin",
3
- "version": "2.3.0",
3
+ "version": "2.3.1-canary.441.edac461.0",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "directory": "packages/create-plugin",
@@ -66,5 +66,5 @@
66
66
  "engines": {
67
67
  "node": ">=20"
68
68
  },
69
- "gitHead": "20d8e2c7eef2c091e4fc26a583fe232bec52fd44"
69
+ "gitHead": "edac46133a9f6609cc8a86001531b85512061f99"
70
70
  }
@@ -5,6 +5,7 @@ import type { ModifyActionConfig, NodePlopAPI } from 'plop';
5
5
  import { EXTRA_TEMPLATE_VARIABLES, IS_DEV, PARTIALS_DIR, PLUGIN_TYPES, TEMPLATE_PATHS } from '../constants';
6
6
  import { ifEq, normalizeId } from '../utils/utils.handlebars';
7
7
  import { getExportPath } from '../utils/utils.path';
8
+ import { getVersion } from '../utils/utils.version';
8
9
  import { getPackageManagerInstallCmd, getPackageManagerFromUserAgent } from '../utils/utils.packageManager';
9
10
  import { printGenerateSuccessMessage } from './generate-actions/print-success-message';
10
11
  import { updateGoSdkAndModules } from './generate-actions/update-go-sdk-and-packages';
@@ -99,6 +100,7 @@ export default function (plop: NodePlopAPI) {
99
100
  packageManagerVersion,
100
101
  isAppType,
101
102
  isNPM: packageManagerName === 'npm',
103
+ packageVersion: getVersion(),
102
104
  };
103
105
  // Copy over files that are shared between plugins types
104
106
  const commonActions = getActionsForTemplateFolder({
@@ -17,4 +17,5 @@ export type TemplateData = {
17
17
  packageManagerVersion: string;
18
18
  isAppType: boolean;
19
19
  isNPM: boolean;
20
+ packageVersion: string;
20
21
  };
@@ -1,5 +1,4 @@
1
- import { resolve } from 'path';
2
- import { readFileSync } from 'fs';
1
+ import { getVersion } from '../utils/utils.version';
3
2
 
4
3
  export const version = async () => {
5
4
  try {
@@ -9,13 +8,3 @@ export const version = async () => {
9
8
  process.exit(1);
10
9
  }
11
10
  };
12
-
13
- const getVersion = () => {
14
- const packageJsonPath = resolve(__dirname, '..', '..', 'package.json');
15
- const pkg = readFileSync(packageJsonPath, 'utf8');
16
- const { version } = JSON.parse(pkg);
17
- if (!version) {
18
- throw `Could not find the version of sign-plugin`;
19
- }
20
- return version;
21
- };
@@ -0,0 +1,12 @@
1
+ import { resolve } from 'path';
2
+ import { readFileSync } from 'fs';
3
+
4
+ export const getVersion = () => {
5
+ const packageJsonPath = resolve(__dirname, '..', '..', 'package.json');
6
+ const pkg = readFileSync(packageJsonPath, 'utf8');
7
+ const { version } = JSON.parse(pkg);
8
+ if (!version) {
9
+ throw `Could not find the version of create-plugin`;
10
+ }
11
+ return version;
12
+ };
@@ -0,0 +1,3 @@
1
+ {
2
+ version: {{ packageVersion }}
3
+ }
@@ -1,6 +1,5 @@
1
1
  /*
2
2
  * ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️
3
- *
4
3
  * In order to extend the configuration follow the steps in
5
4
  * https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/extend-configurations#extend-the-eslint-config
6
5
  */
@@ -9,5 +8,17 @@
9
8
  "root": true,
10
9
  "rules": {
11
10
  "react/prop-types": "off"
12
- }
11
+ },
12
+ "overrides": [
13
+ {
14
+ "plugins": ["deprecation"],
15
+ "files": ["src/**/*.{ts,tsx}"],
16
+ "rules": {
17
+ "deprecation/deprecation": "warn"
18
+ },
19
+ "parserOptions": {
20
+ "project": "./tsconfig.json"
21
+ }
22
+ }
23
+ ]
13
24
  }
@@ -34,6 +34,7 @@
34
34
  "@types/react-router-dom": "^5.3.3",{{/if}}
35
35
  "copy-webpack-plugin": "^11.0.0",
36
36
  "css-loader": "^6.7.3",
37
+ "eslint-plugin-deprecation": "^2.0.0",
37
38
  "eslint-webpack-plugin": "^4.0.1",
38
39
  "fork-ts-checker-webpack-plugin": "^8.0.0",
39
40
  "glob": "^10.2.7",